Added recharging and some dialogs

This commit is contained in:
Sidi Liang 2019-07-31 14:07:05 +08:00
parent 7cfca6184d
commit eefbd0c908
19 changed files with 36527 additions and 18 deletions

Binary file not shown.

After

(image error) Size: 7.1 KiB

Binary file not shown.

After

(image error) Size: 32 KiB

Binary file not shown.

After

(image error) Size: 32 KiB

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

(image error) Size: 716 KiB

Binary file not shown.

After

(image error) Size: 160 KiB

View File

@ -0,0 +1,47 @@
<?xml version="1.0"?>
<PropertyList>
<path>Fuel_Truck_Short_VolvoFM.ac</path>
<!--
<animation>
<type>select</type>
<object-name>fuel_pipe</object-name>
<condition>
<equals>
<property>services/service-truck/connect</property>
<value>1</value>
</equals>
</condition>
</animation>
-->
<animation>
<type>select</type>
<object-name>fuel_pipe_disconnected</object-name>
<condition>
<equals>
<property>services/service-truck/connect</property>
<value>0</value>
</equals>
</condition>
</animation>
<animation>
<type>translate</type>
<object>fuel_pipe_disconnected</object>
<object>fuel_truck</object>
<object>handle</object>
<property>gear/gear[1]/compression-norm</property>
<interpolation>
<entry><ind>0.15</ind><dep>0.0</dep></entry>
<entry><ind>0.40</ind><dep>0.25</dep></entry>
</interpolation>
<axis>
<x>0</x>
<y>0</y>
<z>1</z>
</axis>
</animation>
</PropertyList>

View File

@ -473,5 +473,23 @@
</condition>
</animation>
<!-- Fuel Truck -->
<model>
<path>Aircraft/followme_e-tron/Models/Service-Truck/Service_Truck_Short_VolvoFM.xml</path>
<condition>
<and>
<equals>
<property>services/service-truck/enable</property>
<value>1</value>
</equals>
<less-than>
<property>velocities/groundspeed-kt</property>
<value>1</value>
</less-than>
</and>
</condition>
</model>
</PropertyList>

View File

@ -12,6 +12,7 @@ var electric_init = func(){ #Initialize
props.getNode("/",1).setValue("/systems/electrical/e-tron/fwd-eng-I-A-max",0);
props.getNode("/",1).setValue("/systems/electrical/e-tron/bwd-eng-I-A",0);
props.getNode("/",1).setValue("/systems/electrical/e-tron/bwd-eng-I-A-max",0);
props.getNode("/systems/electrical/e-tron/battery-remaining-percent", 1).setValue("0%");
print("Electrical system initiallized!");
}
@ -19,23 +20,34 @@ var electric_update = func(){
var currentBattery_kWs = props.getNode("/systems/electrical/e-tron/battery-kWs",1);
var currentBattery_kWh = props.getNode("/systems/electrical/e-tron/battery-kWh",1);
var currentBattery_percent = props.getNode("/systems/electrical/e-tron/battery-remaining-percent", 1);
if(props.getNode("/",1).getValue("/systems/electrical/e-tron/switch/bat-fwd-eng") == 1){
props.getNode("/",1).setValue("/systems/electrical/e-tron/fwd-eng-U-V-max",380);
props.getNode("/",1).setValue("/systems/electrical/e-tron/fwd-eng-I-A-max",747);
if(currentBattery_kWs.getValue() >= 0.1){
if(props.getNode("/",1).getValue("/systems/electrical/e-tron/switch/bat-fwd-eng") == 1){
props.getNode("/",1).setValue("/systems/electrical/e-tron/fwd-eng-U-V-max",380);
props.getNode("/",1).setValue("/systems/electrical/e-tron/fwd-eng-I-A-max",747);
}else if(props.getNode("/",1).getValue("/systems/electrical/e-tron/switch/bat-fwd-eng") == 0){
props.getNode("/",1).setValue("/systems/electrical/e-tron/fwd-eng-U-V-max",0);
props.getNode("/",1).setValue("/systems/electrical/e-tron/fwd-eng-I-A-max",0);
}
if(props.getNode("/",1).getValue("/systems/electrical/e-tron/switch/bat-bwd-eng") == 1){
props.getNode("/",1).setValue("/systems/electrical/e-tron/bwd-eng-U-V-max",380);
props.getNode("/",1).setValue("/systems/electrical/e-tron/bwd-eng-I-A-max",747);
}else if(props.getNode("/",1).getValue("/systems/electrical/e-tron/switch/bat-bwd-eng") == 0){
props.getNode("/",1).setValue("/systems/electrical/e-tron/bwd-eng-U-V-max",0);
props.getNode("/",1).setValue("/systems/electrical/e-tron/bwd-eng-I-A-max",0);
}
}else{
props.getNode("/",1).setValue("/systems/electrical/e-tron/fwd-eng-U-V-max",0);
props.getNode("/",1).setValue("/systems/electrical/e-tron/fwd-eng-I-A-max",0);
}
if(props.getNode("/",1).getValue("/systems/electrical/e-tron/switch/bat-bwd-eng") == 1){
props.getNode("/",1).setValue("/systems/electrical/e-tron/bwd-eng-U-V-max",380);
props.getNode("/",1).setValue("/systems/electrical/e-tron/bwd-eng-I-A-max",747);
}else{
props.getNode("/",1).setValue("/systems/electrical/e-tron/bwd-eng-U-V-max",0);
props.getNode("/",1).setValue("/systems/electrical/e-tron/bwd-eng-I-A-max",0);
}
#battery consume
var currentFwdEngConsume = props.getNode("/systems/electrical/e-tron/fwd-eng-U-V",1).getValue() * props.getNode("/systems/electrical/e-tron/fwd-eng-I-A",1).getValue() * 0.001;
@ -44,6 +56,7 @@ var electric_update = func(){
props.getNode("/",1).setValue("/systems/electrical/e-tron/battery-kWs", currentBattery_kWs.getValue() - currentTotalConsume);
currentBattery_kWh.setValue(currentBattery_kWs.getValue()/3600);
currentBattery_percent.setValue(sprintf("%.0f", currentBattery_kWs.getValue()/2880)~"%");
}
var electricTimer = maketimer(1, electric_update);

View File

@ -9,6 +9,7 @@ props.getNode("/",1).setValue("/controls/gear/brake-cmd",0);
var update_engine = func(){
var throttle = props.getNode("/",1).getValue("/controls/engines/engine/throttle");
var direction = props.getNode("/",1).getValue("/controls/engines/engine/direction");
var mode = props.getNode("/",1).getValue("/controls/mode");
var fwdUNode = props.getNode("/systems/electrical/e-tron/fwd-eng-U-V",1);
var fwdANode = props.getNode("/systems/electrical/e-tron/fwd-eng-I-A",1);
@ -20,6 +21,8 @@ var update_engine = func(){
var bwdMaxU = props.getNode("/",1).getValue("/systems/electrical/e-tron/bwd-eng-U-V-max");
var bwdMaxA = props.getNode("/",1).getValue("/systems/electrical/e-tron/bwd-eng-I-A-max");
throttle = throttle * mode;
fwdUNode.setValue(throttle * fwdMaxU);
fwdANode.setValue(throttle * fwdMaxA);
bwdUNode.setValue(throttle * bwdMaxU);
@ -99,13 +102,23 @@ var rpm_calculate = func(rpm_rate){
var startEngine = func(){
props.getNode("/",1).setValue("/controls/engines/engine/rpm1",1000);
props.getNode("/",1).setValue("/controls/engines/engine/started",1);
props.getNode("/",1).setValue("/systems/electrical/e-tron/switch/bat-fwd-eng",1);
props.getNode("/",1).setValue("/systems/electrical/e-tron/switch/bat-bwd-eng",1);
engineTimer.simulatedTime = 1;
engineTimer.start();
print("Engine started");
if(!props.getNode("/controls/is-recharging").getValue()){
props.getNode("/",1).setValue("/controls/engines/engine/rpm1",1000);
props.getNode("/",1).setValue("/controls/engines/engine/started",1);
props.getNode("/",1).setValue("/systems/electrical/e-tron/switch/bat-fwd-eng",1);
props.getNode("/",1).setValue("/systems/electrical/e-tron/switch/bat-bwd-eng",1);
engineTimer.simulatedTime = 1;
engineTimer.start();
if(props.getNode("systems/welcome-message", 1).getValue() == 1){
props.getNode("/sim/messages/copilot", 1).setValue("Beijing di san tsui jiao tong wei ti xing nin, Dao lu tsian wan tiao, an tsuan di yi tiao, xing che bull gui fun, tsin ren liang hang lei");
}else if(props.getNode("systems/welcome-message", 1).getValue() == 2){
props.getNode("/sim/messages/copilot", 1).setValue("The Traffic Commission of the Third District of Beijing reminds you that there are thousands of roads and safety is the first. If you drive recklessly, your loved ones will be filled with tears.");
}
print("Engine started");
}else if(followme.chargeTimer.isRunning()){
#screen.log.write("Battery is recharging, cannot start engine.", 0, 0.584, 1);
setprop("/sim/sound/voices/pilot", "Battery is recharging, cannot start engine.");
}
}
var stopEngine = func(){
props.getNode("/",1).setValue("/controls/engines/engine/rpm1",0);

View File

@ -26,6 +26,7 @@ liveryFuse.init("Aircraft/followme_e-tron/Models/Texture");
aircraft.livery.select("Blanco");
props.getNode("/",1).setValue("/systems/horn", 0);
props.getNode("/",1).setValue("/controls/mode", 1);
var frontleft_door = aircraft.door.new("/controls/doors/frontleft", 1);
var frontright_door = aircraft.door.new("/controls/doors/frontright", 1);
@ -42,6 +43,8 @@ var beacon = aircraft.light.new( "/sim/model/lights/indicator-right", [0.8, 0.5]
props.getNode("/",1).setValue("/controls/lighting/indicator-left", 0);
props.getNode("/",1).setValue("/controls/lighting/indicator-right", 0);
props.getNode("/",1).setValue("services/service-truck/enable", 0);
props.getNode("/controls/is-recharging", 1).setValue(0);
#var Led = {
@ -256,6 +259,41 @@ var IndicatorController = {
var indicatorController = IndicatorController.new();
var chargeBatterySec = func(){
var battery = props.getNode("/systems/electrical/e-tron/battery-kWs");
var currentBattery = battery.getValue();
if(currentBattery >= 288000){
screen.log.write("Battery is Successfully recharged!", 0, 0.584, 1);
chargeBatteryStop();
}
battery.setValue(currentBattery+240);
}
var chargeTimer = maketimer(1, chargeBatterySec);
var chargeBatteryStart = func(){
if(props.getNode("/",1).getValue("services/service-truck/connect") == 1 and props.getNode("/",1).getValue("/controls/engines/engine/started") == 0){
var deltaBattery = 288000-props.getNode("/systems/electrical/e-tron/battery-kWs").getValue();
var remainingTime = sprintf("%.0f", (deltaBattery / 240) / 60); #Based on 20 mins from 0 to full
#screen.log.write("Recharging. About "~remainingTime~" mins remaining.", 0, 0.584, 1);
setprop("/sim/sound/voices/pilot", "Recharging. About "~remainingTime~" mins remaining.");
chargeTimer.start();
props.getNode("/controls/is-recharging", 1).setValue(1);
}else if(!props.getNode("/",1).getValue("services/service-truck/connect")){
#screen.log.write("Cannot recharge. Call service truck and connect the cable first.", 0, 0.584, 1);
setprop("/sim/sound/voices/pilot", "Cannot recharge. Call service truck and connect the cable first.");
}else if(props.getNode("/",1).getValue("/controls/engines/engine/started")){
#screen.log.write("Cannot recharge. Shut down the engine first.", 0, 0.584, 1);
setprop("/sim/sound/voices/pilot", "Cannot recharge. Shut down the engine first.");
}
}
var chargeBatteryStop = func(){
chargeTimer.stop();
props.getNode("/controls/is-recharging", 1).setValue(0);
}
var brakesABS = func(){
var gearFrtLftSpeed = math.round(props.getNode("/",1).getValue("/fdm/jsbsim/gear/unit/wheel-speed-fps"));
var gearFrtRgtSpeed = math.round(props.getNode("/",1).getValue("/fdm/jsbsim/gear/unit[1]/wheel-speed-fps"));

View File

@ -136,6 +136,20 @@
<menu n="10">
<label>Follow me</label>
<enabled type="bool">true</enabled>
<item>
<label>Show Options</label>
<binding>
<command>dialog-show</command>
<dialog-name>vehicle-dialog</dialog-name>
</binding>
</item>
<item>
<label>Battery Management</label>
<binding>
<command>dialog-show</command>
<dialog-name>battery-management</dialog-name>
</binding>
</item>
<item>
<label>Select Livery</label>
<binding>

View File

@ -0,0 +1,137 @@
<?xml version="1.0"?>
<!-- C182s Skylane
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
-->
<PropertyList>
<name>battery-management</name>
<layout>vbox</layout>
<resizable>false</resizable>
<modal>false</modal>
<draggable>true</draggable>
<group>
<layout>hbox</layout>
<empty><stretch>true</stretch></empty>
<text>
<label>Battery status</label>
</text>
<empty><stretch>true</stretch></empty>
<button>
<legend/>
<key>Esc</key>
<pref-width>16</pref-width>
<pref-height>16</pref-height>
<binding>
<command>dialog-close</command>
</binding>
</button>
</group>
<hrule/>
<group>
<layout>vbox</layout>
<padding>6</padding>
<text>
<label>Battery remaining</label>
</text>
<text>
<label>Remaining</label>
<halign>left</halign>
<live>true</live>
<property>/systems/electrical/e-tron/battery-remaining-percent</property>
</text>
</group>
<hrule/>
<group>
<layout>vbox</layout>
<padding>6</padding>
<checkbox>
<halign>left</halign>
<label>Service Tank Trailer</label>
<live>true</live>
<property>services/service-truck/enable</property>
<enable>
<less-than>
<property>velocities/groundspeed-kt</property>
<value>0.1</value>
</less-than>
</enable>
<binding>
<command>property-toggle</command>
<property>services/service-truck/enable</property>
</binding>
<binding>
<command>dialog-update</command>
</binding>
</checkbox>
</group>
<group>
<layout>vbox</layout>
<padding>6</padding>
<checkbox>
<halign>left</halign>
<label>Connect cable</label>
<live>true</live>
<property>services/service-truck/connect</property>
<enable>
<and>
<equals>
<property>services/service-truck/enable</property>
<value>1</value>
</equals>
<less-than>
<property>velocities/groundspeed-kt</property>
<value>0.1</value>
</less-than>
</and>
</enable>
<binding>
<command>property-toggle</command>
<property>services/service-truck/connect</property>
</binding>
<binding>
<command>dialog-update</command>
</binding>
</checkbox>
</group>
<hrule/>
<group>
<layout>hbox</layout>
<button>
<halign>right</halign>
<legend>Recharge</legend>
<pref-width>120</pref-width>
<pref-height>28</pref-height>
<enable>
<and>
<not>
<property>/sim/freeze/replay-state</property>
</not>
<less-than>
<property>velocities/groundspeed-kt</property>
<value>1.0</value>
</less-than>
</and>
</enable>
<binding>
<command>nasal</command>
<script>followme.chargeBatteryStart()</script>
</binding>
</button>
</group>
</PropertyList>

View File

@ -0,0 +1,164 @@
<?xml version="1.0"?>
<PropertyList>
<name>c182s-baggage-weight-dialog</name>
<layout>vbox</layout>
<resizable>false</resizable>
<modal>false</modal>
<draggable>true</draggable>
<group>
<layout>hbox</layout>
<empty><stretch>true</stretch></empty>
<text>
<label>Baggage Weight</label>
</text>
<empty><stretch>true</stretch></empty>
<button>
<legend/>
<key>Esc</key>
<pref-width>16</pref-width>
<pref-height>16</pref-height>
<binding>
<command>dialog-close</command>
</binding>
</button>
</group>
<hrule/>
<group>
<layout>vbox</layout>
<padding>6</padding>
<empty><stretch>true</stretch></empty>
<text>
<label>120 POUNDS MAXIMUM BAGGAGE FORWARD OF BAGGAGE DOOR LATCH AND</label>
</text>
<text>
<label>80 POINDS MAXIMUM BAGGAGE AFT OF BAGGAGE DOOR LATCH</label>
</text>
<text>
<label>MAXIMUM 200 POUNDS COMBINED</label>
</text>
<text>
<label>FOR ADDITIONAL LOADING INSTRUCTIONS SEE WEIGHT AND BALANCE DATA</label>
</text>
</group>
<hrule/>
<group>
<layout>vbox</layout>
<padding>6</padding>
<empty><stretch>true</stretch></empty>
<group>
<layout>hbox</layout>
<text>
<label>Baggage 1 Weight:</label>
<halign>left</halign>
</text>
<slider>
<name>c182s-baggage1-weight-slider</name>
<min>0</min>
<max>150.0</max>
<live>true</live>
<enable>
<less-than>
<property>velocities/groundspeed-kt</property>
<value>1.0</value>
</less-than>
</enable>
<property>/payload/weight[4]/weight-lb</property>
<binding>
<command>dialog-apply</command>
<name>c182s-baggage1-weight-slider</name>
</binding>
</slider>
<text>
<label>123</label>
<halign>left</halign>
<format>%.0f</format>
<live>true</live>
<property>/payload/weight[4]/weight-lb</property>
</text>
<text>
<label>pounds</label>
<halign>left</halign>
</text>
</group>
<group>
<layout>hbox</layout>
<text>
<label>Baggage 2 Weight:</label>
<halign>left</halign>
</text>
<slider>
<name>c182s-baggage2-weight-slider</name>
<min>0</min>
<max>120.0</max>
<live>true</live>
<enable>
<less-than>
<property>velocities/groundspeed-kt</property>
<value>1.0</value>
</less-than>
</enable>
<property>/payload/weight[5]/weight-lb</property>
<binding>
<command>dialog-apply</command>
<name>c182s-baggage2-weight-slider</name>
</binding>
</slider>
<text>
<label>123</label>
<halign>left</halign>
<format>%.0f</format>
<live>true</live>
<property>/payload/weight[5]/weight-lb</property>
</text>
<text>
<label>pounds</label>
<halign>left</halign>
</text>
</group>
</group>
<group>
<layout>hbox</layout>
<text>
<visible>
<greater-than-equals>
<property>velocities/groundspeed-kt</property>
<value>1.0</value>
</greater-than-equals>
</visible>
<color>
<red>0.9</red>
<green>0.1</green>
<blue>0.1</blue>
</color>
<label>Dialog disabled when in movement</label>
</text>
</group>
<hrule/>
<group>
<layout>hbox</layout>
<default-padding>6</default-padding>
<empty><stretch>true</stretch></empty>
<button>
<legend>Close</legend>
<equal>true</equal>
<key>Esc</key>
<default>true</default>
<binding>
<command>dialog-close</command>
</binding>
</button>
</group>
</PropertyList>

220
gui/dialogs/ground-equipement.xml Executable file
View File

@ -0,0 +1,220 @@
<?xml version="1.0"?>
<!-- C182s Skylane
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
-->
<PropertyList>
<name>ground-equipement</name>
<layout>vbox</layout>
<resizable>false</resizable>
<modal>false</modal>
<draggable>true</draggable>
<group>
<layout>hbox</layout>
<empty><stretch>true</stretch></empty>
<text>
<label>Ground Equipement</label>
</text>
<empty><stretch>true</stretch></empty>
<button>
<legend/>
<key>Esc</key>
<pref-width>16</pref-width>
<pref-height>16</pref-height>
<binding>
<command>dialog-close</command>
</binding>
</button>
</group>
<hrule/>
<group>
<layout>hbox</layout>
<checkbox>
<halign>left</halign>
<label>Enable ladder </label>
<live>true</live>
<property>/sim/ladder/enable</property>
<enable>
<less-than>
<property>velocities/groundspeed-kt</property>
<value>0.1</value>
</less-than>
</enable>
<binding>
<command>property-toggle</command>
<property>/sim/ladder/enable</property>
</binding>
<binding>
<command>dialog-update</command>
</binding>
</checkbox>
<radio>
<halign>left</halign>
<label>ladder left</label>
<property>sim/model/c182s/ladder_position_l</property>
<live>true</live>
<enable>
<property>/sim/ladder/enable</property>
</enable>
<binding>
<command>dialog-update</command>
</binding>
<binding>
<command>nasal</command>
<script>
setprop("sim/model/c182s/ladder_position_l", 1);
setprop("sim/model/c182s/ladder_position_r", 0);
</script>
</binding>
</radio>
<radio>
<halign>right</halign>
<label>ladder right</label>
<enable>
<property>/sim/ladder/enable</property>
</enable>
<property>sim/model/c182s/ladder_position_r</property>
<live>true</live>
<binding>
<command>dialog-update</command>
</binding>
<binding>
<command>nasal</command>
<script>
setprop("sim/model/c182s/ladder_position_l", 0);
setprop("sim/model/c182s/ladder_position_r", 1);
</script>
</binding>
</radio>
</group>
<hrule/>
<group>
<layout>vbox</layout>
<padding>6</padding>
<checkbox>
<halign>left</halign>
<label>Place Ground Power Unit</label>
<live>true</live>
<property>/sim/gpu/enable</property>
<enable>
<less-than>
<property>velocities/groundspeed-kt</property>
<value>0.1</value>
</less-than>
</enable>
<binding>
<command>property-toggle</command>
<property>/sim/gpu/enable</property>
</binding>
<binding>
<command>dialog-update</command>
</binding>
</checkbox>
</group>
<group>
<layout>vbox</layout>
<padding>6</padding>
<checkbox>
<halign>left</halign>
<label>Connect Groud Power Unit</label>
<live>true</live>
<property>/controls/electric/external-power</property>
<enable>
<property>/sim/gpu/enable</property>
</enable>
<binding>
<command>property-toggle</command>
<property>/controls/electric/external-power</property>
</binding>
<binding>
<command>dialog-update</command>
</binding>
</checkbox>
</group>
<hrule/>
<group>
<layout>vbox</layout>
<padding>6</padding>
<checkbox>
<halign>left</halign>
<label>Fuel Tank Trailer</label>
<live>true</live>
<property>/sim/fueltanktrailer/enable</property>
<enable>
<less-than>
<property>velocities/groundspeed-kt</property>
<value>0.1</value>
</less-than>
</enable>
<binding>
<command>property-toggle</command>
<property>/sim/fueltanktrailer/enable</property>
</binding>
<binding>
<command>dialog-update</command>
</binding>
</checkbox>
</group>
<hrule/>
<group>
<layout>vbox</layout>
<padding>6</padding>
<checkbox>
<halign>left</halign>
<label>External heater applied</label>
<live>true</live>
<property>/engines/engine/external-heat/enabled</property>
<enable>
<and>
<less-than>
<property>velocities/groundspeed-kt</property>
<value>0.1</value>
</less-than>
<less-than>
<property>/engines/engine/thruster/rpm</property>
<value>0.0001</value>
</less-than>
</and>
</enable>
<binding>
<command>property-toggle</command>
<property>/engines/engine/external-heat/enabled</property>
</binding>
<binding>
<command>dialog-update</command>
</binding>
</checkbox>
</group>
</PropertyList>

103
gui/dialogs/immat.xml Executable file
View File

@ -0,0 +1,103 @@
<?xml version="1.0"?>
<PropertyList>
<name>registration-dialog</name>
<layout>vbox</layout>
<resizable>false</resizable>
<modal>false</modal>
<draggable>true</draggable>
<group>
<layout>hbox</layout>
<empty><stretch>true</stretch></empty>
<text>
<label>Registration</label>
</text>
<empty><stretch>true</stretch></empty>
<button>
<legend/>
<key>Esc</key>
<pref-width>16</pref-width>
<pref-height>16</pref-height>
<binding>
<command>dialog-close</command>
</binding>
</button>
</group>
<hrule/>
<group>
<layout>vbox</layout>
<padding>6</padding>
<group>
<layout>hbox</layout>
<text>
<label>Registration number:</label>
<halign>left</halign>
</text>
<input>
<halign>left</halign>
<property>/sim/model/immat</property>
<type>STRING</type>
<width>100</width>
</input>
</group>
<group>
<layout>hbox</layout>
<checkbox>
<halign>left</halign>
<label>Show on panel</label>
<property>/sim/model/c182s/immat-on-panel</property>
<live>true</live>
<binding>
<command>property-toggle</command>
<property>/sim/model/c182s/immat-on-panel</property>
</binding>
<binding>
<command>dialog-update</command><!-- makes sure that command is still there when dialog is closed-->
</binding>
</checkbox>
</group>
</group>
<hrule/>
<group>
<layout>hbox</layout>
<default-padding>6</default-padding>
<empty><stretch>true</stretch></empty>
<button>
<legend>Apply</legend>
<equal>true</equal>
<default>false</default>
<binding>
<command>dialog-apply</command>
</binding>
<binding>
<command>dialog-close</command>
</binding>
</button>
<button>
<legend>Cancel</legend>
<equal>true</equal>
<key>Esc</key>
<default>true</default>
<binding>
<command>dialog-close</command>
</binding>
</button>
</group>
</PropertyList>

265
gui/dialogs/securing.xml Executable file
View File

@ -0,0 +1,265 @@
<?xml version="1.0"?>
<!-- C182s Skylane
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
-->
<PropertyList>
<name>securing</name>
<layout>vbox</layout>
<resizable>false</resizable>
<modal>false</modal>
<draggable>true</draggable>
<group>
<layout>hbox</layout>
<empty><stretch>true</stretch></empty>
<text>
<label>Aircraft Securing on Ground</label>
</text>
<empty><stretch>true</stretch></empty>
<button>
<legend/>
<key>Esc</key>
<pref-width>16</pref-width>
<pref-height>16</pref-height>
<binding>
<command>dialog-close</command>
</binding>
</button>
</group>
<hrule/>
<group>
<layout>hbox</layout>
<padding>6</padding>
<checkbox>
<halign>left</halign>
<label>Place nose wheel chock</label>
<live>true</live>
<property>/sim/chocks001/enable</property>
<enable>
<less-than>
<property>velocities/groundspeed-kt</property>
<value>0.1</value>
</less-than>
</enable>
<binding>
<command>property-toggle</command>
<property>/sim/chocks001/enable</property>
</binding>
<binding>
<command>dialog-update</command><!--do not use dialog-apply - bad interactions with walker!-->
</binding>
</checkbox>
<checkbox>
<halign>center</halign>
<label>Place left wheel chock</label>
<live>true</live>
<property>/sim/chocks002/enable</property>
<enable>
<less-than>
<property>velocities/groundspeed-kt</property>
<value>0.1</value>
</less-than>
</enable>
<binding>
<command>property-toggle</command>
<property>/sim/chocks002/enable</property>
</binding>
<binding>
<command>dialog-update</command><!--do not use dialog-apply - bad interactions with walker!-->
</binding>
</checkbox>
<checkbox>
<halign>right</halign>
<label>Place right wheel chock</label>
<live>true</live>
<property>/sim/chocks003/enable</property>
<enable>
<less-than>
<property>velocities/groundspeed-kt</property>
<value>0.1</value>
</less-than>
</enable>
<binding>
<command>property-toggle</command>
<property>/sim/chocks003/enable</property>
</binding>
<binding>
<command>dialog-update</command><!--do not use dialog-apply - bad interactions with walker!-->
</binding>
</checkbox>
</group>
<group>
<layout>hbox</layout>
<padding>6</padding>
<checkbox>
<halign>right</halign>
<label>Place right safety cone</label>
<live>true</live>
<property>/sim/coneR/enable</property>
<enable>
<less-than>
<property>velocities/groundspeed-kt</property>
<value>0.1</value>
</less-than>
</enable>
<binding>
<command>property-toggle</command>
<property>/sim/coneR/enable</property>
</binding>
<binding>
<command>dialog-update</command>
</binding>
</checkbox>
<checkbox>
<halign>left</halign>
<label>Place left safety cone</label>
<live>true</live>
<property>/sim/coneL/enable</property>
<enable>
<less-than>
<property>velocities/groundspeed-kt</property>
<value>0.1</value>
</less-than>
</enable>
<binding>
<command>property-toggle</command>
<property>/sim/coneL/enable</property>
</binding>
<binding>
<command>dialog-update</command>
</binding>
</checkbox>
</group>
<hrule/>
<group>
<layout>hbox</layout>
<!-- Small left padding -->
<group>
<layout>vbox</layout>
<padding>6</padding>
</group>
<group>
<layout>vbox</layout>
<checkbox>
<halign>left</halign>
<label>Put pitot tube cover </label>
<property>/sim/model/c182s/securing/pitot-cover-visible</property>
<live>true</live>
<enable>
<less-than>
<property>velocities/groundspeed-kt</property>
<value>1.0</value>
</less-than>
</enable>
<binding>
<command>property-toggle</command>
<property>/sim/model/c182s/securing/pitot-cover-visible</property>
</binding>
<binding>
<command>dialog-update</command>
</binding>
</checkbox>
<checkbox>
<halign>left</halign>
<label>Enable left tie-down </label>
<property>/sim/model/c182s/securing/tiedownL-visible</property>
<live>true</live>
<enable>
<less-than>
<property>velocities/groundspeed-kt</property>
<value>0.1</value>
</less-than>
</enable>
<binding>
<command>property-toggle</command>
<property>/sim/model/c182s/securing/tiedownL-visible</property>
</binding>
<binding>
<command>dialog-update</command>
</binding>
</checkbox>
<checkbox>
<halign>left</halign>
<label>Enable right tie-down </label>
<property>/sim/model/c182s/securing/tiedownR-visible</property>
<live>true</live>
<enable>
<less-than>
<property>velocities/groundspeed-kt</property>
<value>0.1</value>
</less-than>
</enable>
<binding>
<command>property-toggle</command>
<property>/sim/model/c182s/securing/tiedownR-visible</property>
</binding>
<binding>
<command>dialog-update</command>
</binding>
</checkbox>
<checkbox>
<halign>left</halign>
<label>Enable tail tie-down </label>
<property>/sim/model/c182s/securing/tiedownT-visible</property>
<live>true</live>
<enable>
<less-than>
<property>velocities/groundspeed-kt</property>
<value>0.1</value>
</less-than>
</enable>
<binding>
<command>property-toggle</command>
<property>/sim/model/c182s/securing/tiedownT-visible</property>
</binding>
<binding>
<command>dialog-update</command>
</binding>
</checkbox>
</group>
<!-- Force group to the left -->
<empty><stretch>true</stretch></empty>
</group>
<hrule/>
</PropertyList>

213
gui/dialogs/vehicle-dialog.xml Executable file
View File

@ -0,0 +1,213 @@
<?xml version="1.0"?>
<!-- C182s Skylane
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
-->
<PropertyList>
<name>vehicle-dialog</name>
<layout>vbox</layout>
<resizable>false</resizable>
<modal>false</modal>
<draggable>true</draggable>
<group>
<layout>hbox</layout>
<empty><stretch>true</stretch></empty>
<text>
<label>Vehicle Options</label>
</text>
<empty><stretch>true</stretch></empty>
<button>
<legend/>
<key>Esc</key>
<pref-width>32</pref-width>
<pref-height>16</pref-height>
<binding>
<command>dialog-close</command>
</binding>
</button>
</group>
<hrule/>
<group>
<layout>vbox</layout>
<padding>6</padding>
<button>
<halign>left</halign>
<legend>Enable Performance Mode</legend>
<pref-width>150</pref-width>
<pref-height>28</pref-height>
<enable>
<and>
<not>
<property>/sim/freeze/replay-state</property>
</not>
</and>
</enable>
<binding>
<command>property-assign</command><!-- dialog-apply would apply values to all objects here - setlistener reacts on them in unfortunate way-->
<property>/controls/mode</property>
<value>1</value>
</binding>
</button>
<button>
<halign>left</halign>
<legend>Enable Comfort Mode</legend>
<pref-width>150</pref-width>
<pref-height>28</pref-height>
<enable>
<and>
<not>
<property>/sim/freeze/replay-state</property>
</not>
</and>
</enable>
<binding>
<command>property-assign</command><!-- dialog-apply would apply values to all objects here - setlistener reacts on them in unfortunate way-->
<property>/controls/mode</property>
<value>0.65</value>
</binding>
</button>
</group>
<hrule/>
<group>
<layout>vbox</layout>
<padding>6</padding>
<text><label>Welcome message</label></text>
<button>
<halign>middle</halign>
<legend>Disable welcome message</legend>
<pref-width>160</pref-width>
<pref-height>28</pref-height>
<enable>
<or>
<equals>
<property>systems/welcome-message</property>
<value>1</value>
</equals>
<equals>
<property>systems/welcome-message</property>
<value>2</value>
</equals>
</or>
</enable>
<binding>
<command>property-assign</command>
<property>systems/welcome-message</property>
<value>0</value>
</binding>
</button>
</group>
<group>
<layout>hbox</layout>
<padding>2</padding>
<button>
<halign>right</halign>
<legend>Enable Chinese</legend>
<pref-width>100</pref-width>
<pref-height>28</pref-height>
<enable>
<or>
<equals>
<property>systems/welcome-message</property>
<value>0</value>
</equals>
<equals>
<property>systems/welcome-message</property>
<value>2</value>
</equals>
</or>
</enable>
<binding>
<command>property-assign</command>
<property>systems/welcome-message</property>
<value>1</value>
</binding>
</button>
<button>
<halign>right</halign>
<legend>Enable English</legend>
<pref-width>100</pref-width>
<pref-height>28</pref-height>
<enable>
<or>
<equals>
<property>systems/welcome-message</property>
<value>0</value>
</equals>
<equals>
<property>systems/welcome-message</property>
<value>1</value>
</equals>
</or>
</enable>
<binding>
<command>property-assign</command>
<property>systems/welcome-message</property>
<value>2</value>
</binding>
</button>
</group>
<hrule/>
<group>
<layout>hbox</layout>
<button>
<halign>right</halign>
<legend>Quick Recharge</legend>
<pref-width>120</pref-width>
<pref-height>28</pref-height>
<enable>
<and>
<not>
<property>/sim/freeze/replay-state</property>
</not>
<less-than>
<property>velocities/groundspeed-kt</property>
<value>1.0</value>
</less-than>
<not>
<property>/controls/engines/engine/started</property>
</not>
</and>
</enable>
<binding>
<command>property-assign</command>
<property>/systems/electrical/e-tron/battery-kWs</property>
<value>288000</value>
</binding>
</button>
</group>
<hrule/>
<hrule/>
</PropertyList>