A32X: fix ground service dialog, formatting

This commit is contained in:
Joshua Davidson 2017-12-01 07:24:52 -05:00
parent e616ce182d
commit 712afc6899
4 changed files with 288 additions and 310 deletions

View file

@ -4,10 +4,9 @@
##############################################
# Copyright (c) Joshua Davidson (it0uchpods) #
##############################################
# modified by D-ECHO for Ground Services
-->
<!-- A3XX Ground Services Config Dialog -->
<!-- A3XX Aircraft Config Dialog -->
<PropertyList>
@ -32,244 +31,156 @@
</button>
</group>
<vrule/>
<hrule/>
<group>
<layout>vbox</layout>
<checkbox>
<label>Enable De-icing Truck</label>
<halign>left</halign>
<property>/services/deicing_truck/enable</property>
<binding>
<command>dialog-apply</command>
</binding>
<live>true</live>
</checkbox>
<button>
<legend>De-ice Aircraft</legend>
<halign>center</halign>
<padding>5</padding>
<enable>
<property>/services/deicing_truck/enable</property>
</enable>
<binding>
<command>property-assign</command>
<property>/services/deicing_truck/de-ice</property>
<value>1</value>
</binding>
</button>
<checkbox>
<label>Enable Fuel Truck</label>
<halign>left</halign>
<enable>
<not><property>/services/fuel-truck/connect</property></not>
</enable>
<property>/services/fuel-truck/enable</property>
<binding>
<command>dialog-apply</command>
</binding>
<live>true</live>
</checkbox>
<checkbox>
<label>Connect Fuel Truck</label>
<halign>left</halign>
<enable>
<property>/services/fuel-truck/enable</property>
</enable>
<property>/services/fuel-truck/connect</property>
<binding>
<command>dialog-apply</command>
</binding>
<live>true</live>
</checkbox>
<checkbox>
<label>Enable Catering Truck</label>
<halign>left</halign>
<property>/services/catering/enable</property>
<binding>
<command>dialog-apply</command>
</binding>
<live>true</live>
</checkbox>
<button>
<legend>Toggle Catering</legend>
<halign>center</halign>
<padding>5</padding>
<enable>
<property>/services/catering/enable</property>
</enable>
<binding>
<condition>
<less-than>
<property>/services/catering/position-norm</property>
<value>0.1</value>
</less-than>
</condition><command>property-interpolate</command>
<property>/services/catering/position-norm</property>
<value>0.68</value>
<time>5</time>
</binding>
<binding>
<condition>
<greater-than-equals>
<property>/services/catering/position-norm</property>
<value>0.1</value>
</greater-than-equals>
</condition><command>property-interpolate</command>
<property>/services/catering/position-norm</property>
<value>0.0</value>
<time>5</time>
</binding>
</button>
<checkbox>
<label>Enable Baggage Ramp</label>
<halign>left</halign>
<property>/services/baggage/enable</property>
<binding>
<command>dialog-apply</command>
</binding>
<live>true</live>
</checkbox>
<group>
<layout>vbox</layout>
<checkbox>
<label>Enable De-icing Truck</label>
<halign>left</halign>
<property>/services/deicing_truck/enable</property>
<binding>
<command>dialog-apply</command>
</binding>
<live>true</live>
</checkbox>
<button>
<legend>De-ice Aircraft</legend>
<halign>center</halign>
<padding>5</padding>
<enable>
<property>/services/deicing_truck/enable</property>
</enable>
<binding>
<command>property-assign</command>
<property>/services/deicing_truck/de-ice</property>
<value>1</value>
</binding>
</button>
<checkbox>
<label>Enable Fuel Truck</label>
<halign>left</halign>
<enable>
<not><property>/services/fuel-truck/connect</property></not>
</enable>
<property>/services/fuel-truck/enable</property>
<binding>
<command>dialog-apply</command>
</binding>
<live>true</live>
</checkbox>
<checkbox>
<label>Connect Fuel Truck</label>
<halign>left</halign>
<enable>
<property>/services/fuel-truck/enable</property>
</enable>
<property>/services/fuel-truck/connect</property>
<binding>
<command>dialog-apply</command>
</binding>
<live>true</live>
</checkbox>
<checkbox>
<label>Enable Catering Truck</label>
<halign>left</halign>
<property>/services/catering/enable</property>
<binding>
<command>dialog-apply</command>
</binding>
<live>true</live>
</checkbox>
<button>
<legend>Toggle Catering</legend>
<halign>center</halign>
<padding>5</padding>
<enable>
<property>/services/catering/enable</property>
</enable>
<binding>
<condition>
<less-than>
<property>/services/catering/position-norm</property>
<value>0.1</value>
</less-than>
</condition><command>property-interpolate</command>
<property>/services/catering/position-norm</property>
<value>0.68</value>
<time>5</time>
</binding>
<binding>
<condition>
<greater-than-equals>
<property>/services/catering/position-norm</property>
<value>0.1</value>
</greater-than-equals>
</condition><command>property-interpolate</command>
<property>/services/catering/position-norm</property>
<value>0.0</value>
<time>5</time>
</binding>
</button>
<checkbox>
<label>Enable Baggage Ramp</label>
<halign>left</halign>
<property>/services/baggage/enable</property>
<binding>
<command>dialog-apply</command>
</binding>
<live>true</live>
</checkbox>
<hrule/>
<layout>hbox</layout>
<hrule>
<stretch type="bool">true</stretch>
</hrule>
<text>
<label>Stairways</label>
</text>
<checkbox>
<label>Front Left</label>
<halign>left</halign>
<property>/services/stairs/l1</property>
<binding>
<command>dialog-apply</command>
</binding>
<live>true</live>
</checkbox>
<checkbox>
<label>Rear Left</label>
<halign>left</halign>
<property>/services/stairs/l4</property>
<binding>
<command>dialog-apply</command>
</binding>
<live>true</live>
</checkbox>
<checkbox>
<label>Stairway cover</label>
<halign>left</halign>
<property>/services/stairs/cover</property>
<binding>
<command>dialog-apply</command>
</binding>
<live>true</live>
</checkbox>
<hrule/>
<text>
<label>Wheel chockes</label>
</text>
<checkbox>
<label>Nose Gear</label>
<halign>left</halign>
<property>/services/chokes/nose</property>
<binding>
<command>dialog-apply</command>
</binding>
<live>true</live>
</checkbox>
<checkbox>
<label>Main Left Gear</label>
<halign>left</halign>
<property>/services/chokes/left</property>
<binding>
<command>dialog-apply</command>
</binding>
<live>true</live>
</checkbox>
<checkbox>
<label>Main Right Gear</label>
<halign>left</halign>
<property>/services/chokes/right</property>
<binding>
<command>dialog-apply</command>
</binding>
<live>true</live>
</checkbox>
<hrule/>
<text>
<label>Ground Power</label>
</text>
<checkbox>
<label>Enable External Power Box</label>
<halign>left</halign>
<property>/controls/switches/cart</property>
<binding>
<command>property-assign</command>
<property>/controls/electrical/switches/gen-ext</property>
<value>0</value>
</binding>
<enable>
<and>
<equals>
<property>/controls/gear/brake-parking</property>
<value>1</value>
</equals>
<less-than>
<property>/velocities/groundspeed-kt</property>
<value>2</value>
</less-than>
</and>
</enable>
<binding>
<command>dialog-apply</command>
</binding>
<live>true</live>
</checkbox>
<checkbox>
<label>Enable External Air</label>
<halign>left</halign>
<property>/controls/pneumatic/switches/groundair</property>
<binding>
<command>property-toggle</command>
<property>/controls/pneumatic/switches/groundair</property>
</binding>
<enable>
<and>
<equals>
<property>/controls/gear/brake-parking</property>
<value>1</value>
</equals>
<less-than>
<property>/velocities/groundspeed-kt</property>
<value>2</value>
</less-than>
</and>
</enable>
<binding>
<command>dialog-apply</command>
</binding>
<live>true</live>
</checkbox>
<hrule>
<stretch type="bool">true</stretch>
</hrule>
</group>
<checkbox>
<label>Front Left</label>
<halign>left</halign>
<property>/services/stairs/l1</property>
<binding>
<command>dialog-apply</command>
</binding>
<live>true</live>
</checkbox>
<checkbox>
<label>Rear Left</label>
<halign>left</halign>
<property>/services/stairs/l4</property>
<binding>
<command>dialog-apply</command>
</binding>
<live>true</live>
</checkbox>
<checkbox>
<label>Stairway Cover</label>
<halign>left</halign>
<property>/services/stairs/cover</property>
<binding>
<command>dialog-apply</command>
</binding>
<live>true</live>
</checkbox>
</group>
</PropertyList>

View file

@ -193,11 +193,102 @@
<binding>
<command>nasal</command>
<script>
acconfig.groundservices_dlg.open();
acconfig.groundservices_dlg.open();
</script>
</binding>
</button>
<checkbox>
<label>Nose Gear Chock</label>
<halign>left</halign>
<property>/services/chokes/nose</property>
<binding>
<command>dialog-apply</command>
</binding>
<enable> <!-- Doesn't really do anything yet -->
<property>/systems/acconfig/unused/unused</property>
</enable>
<live>true</live>
</checkbox>
<checkbox>
<label>Main Left Gear Chock</label>
<halign>left</halign>
<property>/services/chokes/left</property>
<binding>
<command>dialog-apply</command>
</binding>
<enable> <!-- Doesn't really do anything yet -->
<property>/systems/acconfig/unused/unused</property>
</enable>
<live>true</live>
</checkbox>
<checkbox>
<label>Main Right Gear Chock</label>
<halign>left</halign>
<property>/services/chokes/right</property>
<binding>
<command>dialog-apply</command>
</binding>
<enable> <!-- Doesn't really do anything yet -->
<property>/systems/acconfig/unused/unused</property>
</enable>
<live>true</live>
</checkbox>
<checkbox>
<label>Enable External Power Box</label>
<halign>left</halign>
<property>/controls/switches/cart</property>
<binding>
<command>property-assign</command>
<property>/controls/electrical/switches/gen-ext</property>
<value>0</value>
</binding>
<enable>
<and>
<equals>
<property>/controls/gear/brake-parking</property>
<value>1</value>
</equals>
<less-than>
<property>/velocities/groundspeed-kt</property>
<value>2</value>
</less-than>
</and>
</enable>
<binding>
<command>dialog-apply</command>
</binding>
<live>true</live>
</checkbox>
<checkbox>
<label>Enable External Air</label>
<halign>left</halign>
<property>/controls/pneumatic/switches/groundair</property>
<binding>
<command>property-toggle</command>
<property>/controls/pneumatic/switches/groundair</property>
</binding>
<enable>
<and>
<equals>
<property>/controls/gear/brake-parking</property>
<value>1</value>
</equals>
<less-than>
<property>/velocities/groundspeed-kt</property>
<value>2</value>
</less-than>
</and>
</enable>
<binding>
<command>dialog-apply</command>
</binding>
<live>true</live>
</checkbox>
<checkbox>
<label>Yellow HYD Hand Pump</label>
@ -209,22 +300,22 @@
</binding>
<enable>
<and>
<equals>
<property>/controls/gear/brake-parking</property>
<value>1</value>
</equals>
<less-than>
<property>/velocities/groundspeed-kt</property>
<value>2</value>
</less-than>
<less-than>
<property>/systems/electrical/bus/ac2</property>
<value>115</value>
</less-than>
<equals>
<property>/controls/electrical/switches/gen-ext</property>
<value>0</value>
</equals>
<equals>
<property>/controls/gear/brake-parking</property>
<value>1</value>
</equals>
<less-than>
<property>/velocities/groundspeed-kt</property>
<value>2</value>
</less-than>
<less-than>
<property>/systems/electrical/bus/ac2</property>
<value>115</value>
</less-than>
<equals>
<property>/controls/electrical/switches/gen-ext</property>
<value>0</value>
</equals>
</and>
</enable>
<binding>

View file

@ -1,5 +1,5 @@
# adapted from 787-8 (omega)
# A32X Ground Services
# D-ECHO, adapted from omega95
var door = aircraft.door.new("/services/deicing_truck/crane", 20);
var door3 = aircraft.door.new("/services/deicing_truck/deicing", 20);
@ -7,75 +7,54 @@ var door3 = aircraft.door.new("/services/deicing_truck/deicing", 20);
var ground_services = {
init : func {
me.UPDATE_INTERVAL = 0.1;
me.loopid = 0;
me.ice_time = 0;
# Catering Truck
setprop("/services/catering/scissor-deg", 0);
setprop("/services/catering/position-norm", 0);
# De-icing Truck
setprop("/services/deicing_truck/enable", 0);
setprop("/services/deicing_truck/de-ice", 0);
# Set them all to 0 if the aircraft is not stationary
if (getprop("/velocities/groundspeed-kt") > 10) {
setprop("/services/chokes/nose", 0);
setprop("/services/chokes/left", 0);
setprop("/services/chokes/right", 0);
setprop("/services/fuel-truck/enable", 0);
setprop("/services/ext-pwr/enable", 0);
setprop("/services/deicing_truck/enable", 0);
setprop("/services/catering/enable", 0);
}
me.reset();
},
update : func {
# Chokes and Parking Brakes Control
# if ((getprop("/services/chokes/nose") == 1) or (getprop("/services/chokes/left") == 1) or (getprop("/services/chokes/right") == 1) or (getprop("/controls/parking-brake") == 1))
# setprop("/controls/gear/brake-parking", 1);
# else
# setprop("/controls/gear/brake-parking", 0);
# Catering Truck Controls
var cater_pos = getprop("/services/catering/position-norm");
var scissor_deg = 3.325 * (1/D2R) * math.asin(cater_pos / (2 * 3.6612));
setprop("/services/catering/scissor-deg", scissor_deg);
me.loopid = 0;
me.ice_time = 0;
# Catering Truck
setprop("/services/catering/scissor-deg", 0);
setprop("/services/catering/position-norm", 0);
# De-icing Truck
setprop("/services/deicing_truck/enable", 0);
setprop("/services/deicing_truck/de-ice", 0);
if (getprop("/services/deicing_truck/enable") and getprop("/services/deicing_truck/de-ice"))
{
# Set them all to 0 if the aircraft is not stationary
if (getprop("/velocities/groundspeed-kt") >= 2) {
setprop("/services/chokes/nose", 0);
setprop("/services/chokes/left", 0);
setprop("/services/chokes/right", 0);
setprop("/services/fuel-truck/enable", 0);
setprop("/services/ext-pwr/enable", 0);
setprop("/services/deicing_truck/enable", 0);
setprop("/services/catering/enable", 0);
}
if (me.ice_time == 2){
me.reset();
},
update : func {
# Catering Truck Controls
var cater_pos = getprop("/services/catering/position-norm");
var scissor_deg = 3.325 * (1/D2R) * math.asin(cater_pos / (2 * 3.6612));
setprop("/services/catering/scissor-deg", scissor_deg);
# De-icing Truck
if (getprop("/services/deicing_truck/enable") and getprop("/services/deicing_truck/de-ice")) {
if (me.ice_time == 2) {
door.move(1);
ground_message ("Lifting De-icing Crane...");
}
if (me.ice_time == 220){
if (me.ice_time == 220) {
door3.move(1);
ground_message ("Starting De-icing Process...");
}
if (me.ice_time == 420){
if (me.ice_time == 420) {
door3.move(0);
ground_message ("De-icing Process Completed...");
}
if (me.ice_time == 650){
if (me.ice_time == 650) {
door.move(0);
ground_message ("Lowering De-icing Crane...");
}
@ -88,12 +67,11 @@ var ground_services = {
setprop("/controls/ice/wing/eng2", 30);
}
} else
} else {
me.ice_time = 0;
}
me.ice_time += 1;
me.ice_time += 1;
},
reset : func {
me.loopid += 1;
@ -110,8 +88,6 @@ var ground_message = func (string) {
setprop("/sim/messages/ground", string);
}
setlistener("sim/signals/fdm-initialized", func {
ground_services.init();
print("Ground Services ..... Initialized");
});

View file

@ -1 +1 @@
4047
4048