MAJOR Update to engine system, new ACCONFIG System: step 1/5 of THE BIG PUSH

This commit is contained in:
Joshua Davidson 2017-04-05 18:36:27 -04:00
parent d4069ab9da
commit 4ae105e6e7
25 changed files with 34047 additions and 3235 deletions

View file

@ -75,7 +75,6 @@
<nasal> <nasal>
<A320> <A320>
<file>Aircraft/A320Family/Nasal/engines.nas</file>
<file>Aircraft/A320Family/Nasal/electrical.nas</file> <file>Aircraft/A320Family/Nasal/electrical.nas</file>
<file>Aircraft/A320Family/Nasal/systems.nas</file> <file>Aircraft/A320Family/Nasal/systems.nas</file>
<file>Aircraft/A320Family/Nasal/a319livery.nas</file> <file>Aircraft/A320Family/Nasal/a319livery.nas</file>
@ -85,6 +84,12 @@
<file>Aircraft/A320Family/Nasal/PFD_FMA.nas</file> <file>Aircraft/A320Family/Nasal/PFD_FMA.nas</file>
<file>Aircraft/A320Family/Nasal/fctl.nas</file> <file>Aircraft/A320Family/Nasal/fctl.nas</file>
</A320> </A320>
<acconfig>
<file>Aircraft/A320Family/AircraftConfig/acconfig.nas</file>
</acconfig>
<systems>
<file>Aircraft/A320Family/Nasal/engines.nas</file>
</systems>
<itaf> <itaf>
<file>Aircraft/A320Family/Nasal/it-autoflight.nas</file> <file>Aircraft/A320Family/Nasal/it-autoflight.nas</file>
</itaf> </itaf>

View file

@ -68,7 +68,6 @@
<nasal> <nasal>
<A320> <A320>
<file>Aircraft/A320Family/Nasal/engines.nas</file>
<file>Aircraft/A320Family/Nasal/electrical.nas</file> <file>Aircraft/A320Family/Nasal/electrical.nas</file>
<file>Aircraft/A320Family/Nasal/systems.nas</file> <file>Aircraft/A320Family/Nasal/systems.nas</file>
<file>Aircraft/A320Family/Nasal/a320livery.nas</file> <file>Aircraft/A320Family/Nasal/a320livery.nas</file>
@ -78,6 +77,12 @@
<file>Aircraft/A320Family/Nasal/PFD_FMA.nas</file> <file>Aircraft/A320Family/Nasal/PFD_FMA.nas</file>
<file>Aircraft/A320Family/Nasal/fctl.nas</file> <file>Aircraft/A320Family/Nasal/fctl.nas</file>
</A320> </A320>
<acconfig>
<file>Aircraft/A320Family/AircraftConfig/acconfig.nas</file>
</acconfig>
<systems>
<file>Aircraft/A320Family/Nasal/engines.nas</file>
</systems>
<itaf> <itaf>
<file>Aircraft/A320Family/Nasal/it-autoflight.nas</file> <file>Aircraft/A320Family/Nasal/it-autoflight.nas</file>
</itaf> </itaf>

View file

@ -72,7 +72,7 @@
</instrumentation> </instrumentation>
<alarms> <alarms>
<master-caution type="bool">false</master-caution> <master-caution type="bool">0</master-caution>
</alarms> </alarms>
<menubar> <menubar>
@ -93,24 +93,15 @@
<menu n="100"> <menu n="100">
<enabled type="bool">true</enabled> <enabled type="bool">true</enabled>
<item> <item>
<name>autostart</name> <label>Aircraft Config</label>
<label>Autostart</label>
<binding>
<command>property-toggle</command>
<property>sim/model/start-idling</property>
</binding>
</item>
<item>
<label>Select Livery</label>
<binding> <binding>
<command>nasal</command> <command>nasal</command>
<script> <script>
aircraft.livery.dialog.open(); acconfig.main_dlg.open();
</script> </script>
</binding> </binding>
</item> </item>
<item> <item>
<name>pushback</name>
<label>Pushback</label> <label>Pushback</label>
<binding> <binding>
<command>dialog-show</command> <command>dialog-show</command>
@ -274,7 +265,21 @@
</settings> </settings>
</it-autoflight> </it-autoflight>
<engines n="0">
<engine n="0">
<egt-actual type="float">0</egt-actual>
<state type="int">0</state>
</engine>
<engine n="1">
<egt-actual type="float">0</egt-actual>
<state type="int">0</state>
</engine>
</engines>
<apu>
<rpm type="float">0</rpm>
<egt type="float">0</egt>
</apu>
<autopilot> <autopilot>
<autobrake> <autobrake>
@ -288,9 +293,10 @@
<controls> <controls>
<APU> <APU>
<fire-switch type="bool">false</fire-switch> <fire-switch type="bool">0</fire-switch>
<master-switch type="bool">false</master-switch> <master type="bool">0</master>
<starter type="bool">false</starter> <start type="bool">0</start>
<bleed type="bool">0</bleed>
</APU> </APU>
<electric> <electric>
<avionics-switch type="bool">true</avionics-switch> <avionics-switch type="bool">true</avionics-switch>
@ -300,65 +306,65 @@
<engine n="0"> <engine n="0">
<cutoff type="bool">true</cutoff> <cutoff type="bool">true</cutoff>
<cutoff-switch type="bool">true</cutoff-switch> <cutoff-switch type="bool">true</cutoff-switch>
<starter type="bool">false</starter> <starter type="bool">0</starter>
<starter-switch type="bool">false</starter-switch> <starter-switch type="bool">0</starter-switch>
<max-athr-thrust type="float">0.94</max-athr-thrust> <max-athr-thrust type="float">0.94</max-athr-thrust>
</engine> </engine>
<engine n="1"> <engine n="1">
<cutoff type="bool">true</cutoff> <cutoff type="bool">true</cutoff>
<cutoff-switch type="bool">true</cutoff-switch> <cutoff-switch type="bool">true</cutoff-switch>
<starter type="bool">false</starter> <starter type="bool">0</starter>
<starter-switch type="bool">false</starter-switch> <starter-switch type="bool">0</starter-switch>
<max-athr-thrust type="float">0.94</max-athr-thrust> <max-athr-thrust type="float">0.94</max-athr-thrust>
</engine> </engine>
</engines> </engines>
<flight> <flight>
<speedbrake-arm>0</speedbrake-arm> <speedbrake-arm>0</speedbrake-arm>
<ground-spoilers-armed type="bool">false</ground-spoilers-armed> <ground-spoilers-armed type="bool">0</ground-spoilers-armed>
<speedbrake-lever type="double">0</speedbrake-lever> <speedbrake-lever type="double">0</speedbrake-lever>
</flight> </flight>
<gear> <gear>
<brake-parking type="bool">true</brake-parking> <brake-parking type="bool">true</brake-parking>
<tiller-cmd-norm type="double">0</tiller-cmd-norm> <tiller-cmd-norm type="double">0</tiller-cmd-norm>
<tiller-enabled type="bool">false</tiller-enabled> <tiller-enabled type="bool">0</tiller-enabled>
</gear> </gear>
<lighting> <lighting>
<beacon type="bool">false</beacon> <beacon type="bool">0</beacon>
<interior type="double">0</interior> <interior type="double">0</interior>
<cockpit type="bool">false</cockpit> <cockpit type="bool">0</cockpit>
<cones type="bool">true</cones> <cones type="bool">true</cones>
<dome-norm type="double">0</dome-norm> <dome-norm type="double">0</dome-norm>
<landing-lights n="0" type="bool">false</landing-lights> <landing-lights n="0" type="bool">0</landing-lights>
<landing-lights n="1" type="bool">false</landing-lights> <landing-lights n="1" type="bool">0</landing-lights>
<landing-lights n="2" type="bool">false</landing-lights> <landing-lights n="2" type="bool">0</landing-lights>
<nav-lights-switch type="int">0</nav-lights-switch> <nav-lights-switch type="int">0</nav-lights-switch>
<overhead-panel-norm type="double">0.8</overhead-panel-norm> <overhead-panel-norm type="double">0.8</overhead-panel-norm>
<main-panel-pedestal-norm type="double">0.8</main-panel-pedestal-norm> <main-panel-pedestal-norm type="double">0.8</main-panel-pedestal-norm>
<strobe type="bool">false</strobe> <strobe type="bool">0</strobe>
</lighting> </lighting>
<switches> <switches>
<!-- Smoking is bad :P --> <!-- Smoking is bad :P -->
<no-smoking-sign type="bool">true</no-smoking-sign> <no-smoking-sign type="bool">true</no-smoking-sign>
<seatbelt-sign type="bool">false</seatbelt-sign> <seatbelt-sign type="bool">0</seatbelt-sign>
</switches> </switches>
</controls> </controls>
<engines> <engines>
<apu> <apu>
<rpm type="double">0</rpm> <rpm type="double">0</rpm>
<on-fire type="bool">false</on-fire> <on-fire type="bool">0</on-fire>
<running type="bool">false</running> <running type="bool">0</running>
<serviceable type="bool">true</serviceable> <serviceable type="bool">true</serviceable>
</apu> </apu>
<engine n="0"> <engine n="0">
<on-fire type="bool">false</on-fire> <on-fire type="bool">0</on-fire>
<reverser-pos-norm type="double">0</reverser-pos-norm> <reverser-pos-norm type="double">0</reverser-pos-norm>
<running type="bool">false</running> <running type="bool">0</running>
</engine> </engine>
<engine n="1"> <engine n="1">
<on-fire type="bool">false</on-fire> <on-fire type="bool">0</on-fire>
<reverser-pos-norm type="double">0</reverser-pos-norm> <reverser-pos-norm type="double">0</reverser-pos-norm>
<running type="bool">false</running> <running type="bool">0</running>
</engine> </engine>
</engines> </engines>
@ -439,7 +445,7 @@
</configuration-module> </configuration-module>
<inputs> <inputs>
<arinc429> <arinc429>
<decision-height-ncd type="bool">false</decision-height-ncd> <decision-height-ncd type="bool">0</decision-height-ncd>
<decision-height type="double">250</decision-height> <decision-height type="double">250</decision-height>
</arinc429> </arinc429>
</inputs> </inputs>
@ -458,16 +464,16 @@
</groundradar> </groundradar>
<chrono n="0"> <chrono n="0">
<started type="bool">false</started> <started type="bool">0</started>
<paused type="bool">false</paused> <paused type="bool">0</paused>
<text type="string">0' 00'</text> <text type="string">0' 00'</text>
<started-at type="int">0</started-at> <started-at type="int">0</started-at>
<elapsed-time type="int">0</elapsed-time> <elapsed-time type="int">0</elapsed-time>
</chrono> </chrono>
<chrono n="1"> <chrono n="1">
<started type="bool">false</started> <started type="bool">0</started>
<paused type="bool">false</paused> <paused type="bool">0</paused>
<text type="string">0' 00'</text> <text type="string">0' 00'</text>
<started-at type="int">0</started-at> <started-at type="int">0</started-at>
<elapsed-time type="int">0</elapsed-time> <elapsed-time type="int">0</elapsed-time>
@ -481,8 +487,8 @@
</altimeter> </altimeter>
<pfd> <pfd>
<minimums-mode>DH</minimums-mode> <minimums-mode>DH</minimums-mode>
<ILS1>false</ILS1> <ILS1>0</ILS1>
<ILS2>false</ILS2> <ILS2>0</ILS2>
<stallvls>-10</stallvls> <stallvls>-10</stallvls>
<fma> <fma>
<athr-box>O </athr-box> <athr-box>O </athr-box>

View file

@ -68,7 +68,6 @@
<nasal> <nasal>
<A320> <A320>
<file>Aircraft/A320Family/Nasal/engines.nas</file>
<file>Aircraft/A320Family/Nasal/electrical.nas</file> <file>Aircraft/A320Family/Nasal/electrical.nas</file>
<file>Aircraft/A320Family/Nasal/systems.nas</file> <file>Aircraft/A320Family/Nasal/systems.nas</file>
<file>Aircraft/A320Family/Nasal/a321livery.nas</file> <file>Aircraft/A320Family/Nasal/a321livery.nas</file>
@ -78,6 +77,12 @@
<file>Aircraft/A320Family/Nasal/PFD_FMA.nas</file> <file>Aircraft/A320Family/Nasal/PFD_FMA.nas</file>
<file>Aircraft/A320Family/Nasal/fctl.nas</file> <file>Aircraft/A320Family/Nasal/fctl.nas</file>
</A320> </A320>
<acconfig>
<file>Aircraft/A320Family/AircraftConfig/acconfig.nas</file>
</acconfig>
<systems>
<file>Aircraft/A320Family/Nasal/engines.nas</file>
</systems>
<itaf> <itaf>
<file>Aircraft/A320Family/Nasal/it-autoflight.nas</file> <file>Aircraft/A320Family/Nasal/it-autoflight.nas</file>
</itaf> </itaf>

View file

@ -74,10 +74,7 @@
<nasal> <nasal>
<A320> <A320>
<file>Aircraft/A320Family/Nasal/engines.nas</file>
<file>Aircraft/A320Family/Nasal/electrical.nas</file> <file>Aircraft/A320Family/Nasal/electrical.nas</file>
<file>Aircraft/A320Family/Nasal/v-speeds.nas</file>
<file>Aircraft/A320Family/Nasal/tyresmoke.nas</file>
<file>Aircraft/A320Family/Nasal/systems.nas</file> <file>Aircraft/A320Family/Nasal/systems.nas</file>
<file>Aircraft/A320Family/Nasal/acjlivery.nas</file> <file>Aircraft/A320Family/Nasal/acjlivery.nas</file>
<file>Aircraft/A320Family/Models/Instruments/ND/ND.nas</file> <file>Aircraft/A320Family/Models/Instruments/ND/ND.nas</file>
@ -86,6 +83,12 @@
<file>Aircraft/A320Family/Nasal/PFD_FMA.nas</file> <file>Aircraft/A320Family/Nasal/PFD_FMA.nas</file>
<file>Aircraft/A320Family/Nasal/fctl.nas</file> <file>Aircraft/A320Family/Nasal/fctl.nas</file>
</A320> </A320>
<acconfig>
<file>Aircraft/A320Family/AircraftConfig/acconfig.nas</file>
</acconfig>
<systems>
<file>Aircraft/A320Family/Nasal/engines.nas</file>
</systems>
<itaf> <itaf>
<file>Aircraft/A320Family/Nasal/it-autoflight.nas</file> <file>Aircraft/A320Family/Nasal/it-autoflight.nas</file>
</itaf> </itaf>

View file

@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!-- A3XX Aircraft Config Dialog -->
<PropertyList>
<name>aircraft-config-init</name>
<layout>vbox</layout>
<pref-width>200</pref-width>
<group>
<layout>hbox</layout>
<text>
<halign>left</halign>
<label>Please wait...</label>
</text>
</group>
<hrule/>
<group>
<layout>vbox</layout>
<text>
<halign>center</halign>
<label>Initializing...</label>
</text>
</group>
</PropertyList>

197
AircraftConfig/acconfig.nas Normal file
View file

@ -0,0 +1,197 @@
# Aircraft Config Center
# Joshua Davidson (it0uchpods)
setprop("/systems/acconfig/autoconfig-running", 0);
var main_dlg = gui.Dialog.new("sim/gui/dialogs/acconfig/main/dialog", "Aircraft/A320Family/AircraftConfig/main.xml");
var welcome_dlg = gui.Dialog.new("sim/gui/dialogs/acconfig/welcome/dialog", "Aircraft/A320Family/AircraftConfig/welcome.xml");
var ps_load_dlg = gui.Dialog.new("sim/gui/dialogs/acconfig/psload/dialog", "Aircraft/A320Family/AircraftConfig/psload.xml");
var ps_loaded_dlg = gui.Dialog.new("sim/gui/dialogs/acconfig/psloaded/dialog", "Aircraft/A320Family/AircraftConfig/psloaded.xml");
var init_dlg = gui.Dialog.new("sim/gui/dialogs/acconfig/init/dialog", "Aircraft/A320Family/AircraftConfig/ac_init.xml");
init_dlg.open();
setlistener("/sim/signals/fdm-initialized", func {
init_dlg.close();
welcome_dlg.open();
});
################
# Panel States #
################
# Cold and Dark
var colddark = func {
ps_load_dlg.open();
setprop("/systems/acconfig/autoconfig-running", 1);
# Initial shutdown, and reinitialization.
setprop("/controls/engines/engine-start-switch", 1);
setprop("/controls/engines/engine[0]/cutoff-switch", 1);
setprop("/controls/engines/engine[1]/cutoff-switch", 1);
setprop("/controls/electric/engine[0]/generator", 0);
setprop("/controls/electric/engine[1]/generator", 0);
setprop("/controls/flight/slats", 0.000);
setprop("/controls/flight/flaps", 0.000);
setprop("/controls/flight/flap-lever", 0);
setprop("/controls/flight/speedbrake-arm", 0);
setprop("/controls/gear/gear-down", 1);
# systems.elec_init();
itaf.ap_init();
setprop("/it-autoflight/input/fd1", 1);
setprop("/it-autoflight/input/fd2", 1);
if (getprop("/engines/engine[1]/n2") < 2) {
colddark_b();
} else {
var colddark_eng_off = setlistener("/engines/engine[1]/n2", func {
if (getprop("/engines/engine[1]/n2") < 2) {
removelistener(colddark_eng_off);
colddark_b();
}
});
}
}
var colddark_b = func {
# Continues the Cold and Dark script, after engines fully shutdown.
setprop("/controls/APU/master", 0);
setprop("/controls/APU/start", 0);
setprop("/controls/APU/bleed", 0);
setprop("/controls/electric/APU-generator", 0);
setprop("/controls/electric/battery-switch", 0);
setprop("/systems/acconfig/autoconfig-running", 0);
ps_load_dlg.close();
ps_loaded_dlg.open();
}
# Ready to Start Eng
var beforestart = func {
ps_load_dlg.open();
setprop("/systems/acconfig/autoconfig-running", 1);
# First, we set everything to cold and dark.
setprop("/controls/engines/engine-start-switch", 1);
setprop("/controls/engines/engine[0]/cutoff-switch", 1);
setprop("/controls/engines/engine[1]/cutoff-switch", 1);
setprop("/controls/electric/engine[0]/generator", 0);
setprop("/controls/electric/engine[1]/generator", 0);
setprop("/controls/flight/slats", 0.000);
setprop("/controls/flight/flaps", 0.000);
setprop("/controls/flight/flap-lever", 0);
setprop("/controls/flight/speedbrake-arm", 0);
setprop("/controls/gear/gear-down", 1);
# systems.elec_init();
itaf.ap_init();
setprop("/it-autoflight/input/fd1", 1);
setprop("/it-autoflight/input/fd2", 1);
setprop("/controls/APU/master", 0);
setprop("/controls/APU/start", 0);
setprop("/controls/APU/bleed", 0);
setprop("/controls/electric/APU-generator", 0);
setprop("/controls/electric/battery-switch", 0);
# Now the Startup!
setprop("/controls/electric/battery-switch", 1);
setprop("/controls/APU/master", 1);
setprop("/controls/APU/start", 1);
var apu_rpm_chk = setlistener("/systems/apu/rpm", func {
if (getprop("/systems/apu/rpm") >= 99) {
removelistener(apu_rpm_chk);
beforestart_b();
}
});
}
var beforestart_b = func {
# Continue with engine start prep.
setprop("/controls/electric/APU-generator", 1);
setprop("/controls/APU/bleed", 1);
setprop("/controls/electric/engine[0]/generator", 1);
setprop("/controls/electric/engine[1]/generator", 1);
setprop("/systems/acconfig/autoconfig-running", 0);
ps_load_dlg.close();
ps_loaded_dlg.open();
}
# Ready to Taxi
var taxi = func {
ps_load_dlg.open();
setprop("/systems/acconfig/autoconfig-running", 1);
# First, we set everything to cold and dark.
setprop("/controls/engines/engine-start-switch", 1);
setprop("/controls/engines/engine[0]/cutoff-switch", 1);
setprop("/controls/engines/engine[1]/cutoff-switch", 1);
setprop("/controls/electric/engine[0]/generator", 0);
setprop("/controls/electric/engine[1]/generator", 0);
setprop("/controls/flight/slats", 0.000);
setprop("/controls/flight/flaps", 0.000);
setprop("/controls/flight/flap-lever", 0);
setprop("/controls/flight/speedbrake-arm", 0);
setprop("/controls/gear/gear-down", 1);
# systems.elec_init();
itaf.ap_init();
setprop("/it-autoflight/input/fd1", 1);
setprop("/it-autoflight/input/fd2", 1);
setprop("/controls/APU/master", 0);
setprop("/controls/APU/start", 0);
setprop("/controls/APU/bleed", 0);
setprop("/controls/electric/APU-generator", 0);
setprop("/controls/electric/battery-switch", 0);
# Now the Startup!
setprop("/controls/electric/battery-switch", 1);
setprop("/controls/APU/master", 1);
setprop("/controls/APU/start", 1);
var apu_rpm_chk = setlistener("/systems/apu/rpm", func {
if (getprop("/systems/apu/rpm") >= 99) {
removelistener(apu_rpm_chk);
taxi_b();
}
});
}
var taxi_b = func {
# Continue with engine start prep, and start engine 2.
setprop("/controls/electric/APU-generator", 1);
setprop("/controls/APU/bleed", 1);
setprop("/controls/electric/engine[0]/generator", 1);
setprop("/controls/electric/engine[1]/generator", 1);
setprop("/controls/engines/engine-start-switch", 2);
setprop("/controls/engines/engine[1]/cutoff-switch", 0);
var eng_two_chk = setlistener("/engines/engine[1]/state", func {
if (getprop("/engines/engine[1]/state") == 3) {
removelistener(eng_two_chk);
taxi_c();
}
});
}
var taxi_c = func {
# Start engine 1.
setprop("/controls/engines/engine[0]/cutoff-switch", 0);
var eng_one_chk = setlistener("/engines/engine[0]/state", func {
if (getprop("/engines/engine[0]/state") == 3) {
removelistener(eng_one_chk);
taxi_d();
}
});
}
var taxi_d = func {
# After Start items.
setprop("/controls/engines/engine-start-switch", 1);
setprop("/controls/APU/bleed", 0);
setprop("/controls/APU/master", 0);
setprop("/controls/APU/start", 0);
setprop("/systems/acconfig/autoconfig-running", 0);
ps_load_dlg.close();
ps_loaded_dlg.open();
}
# Ready to Takeoff
var takeoff = func {
# The same as taxi, except we set some things afterwards.
taxi();
var eng_one_chk_c = setlistener("/engines/engine[0]/state", func {
if (getprop("/engines/engine[0]/state") == 3) {
removelistener(eng_one_chk_c);
setprop("/controls/flight/speedbrake-arm", 1);
setprop("/controls/flight/flaps", 0.290);
setprop("/controls/flight/slats", 0.666);
setprop("/controls/flight/flap-lever", 1);
setprop("/controls/flight/flap-txt", "1+F");
setprop("/controls/flight/elevator-trim", -0.1);
}
});
}

258
AircraftConfig/main.xml Normal file
View file

@ -0,0 +1,258 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!-- A3XX Aircraft Config Dialog -->
<PropertyList>
<name>aircraft-config</name>
<layout>vbox</layout>
<group>
<layout>hbox</layout>
<text>
<halign>left</halign>
<label>Aircraft Configuration</label>
</text>
<button>
<halign>right</halign>
<pref-width>20</pref-width>
<pref-height>20</pref-height>
<legend>X</legend>
<key>Esc</key>
<binding>
<command>dialog-close</command>
</binding>
</button>
</group>
<hrule/>
<group>
<layout>hbox</layout>
<group>
<layout>vbox</layout>
<group>
<layout>vbox</layout>
<button>
<halign>center</halign>
<legend>Welcome</legend>
<pref-width>140</pref-width>
<binding>
<command>nasal</command>
<script>
acconfig.welcome_dlg.open();
</script>
</binding>
</button>
<button>
<halign>center</halign>
<legend>Select Livery</legend>
<pref-width>140</pref-width>
<binding>
<command>nasal</command>
<script>
aircraft.livery.dialog.toggle();
</script>
</binding>
</button>
<button>
<halign>center</halign>
<legend>Aircraft Tutorial</legend>
<pref-width>140</pref-width>
<enable>
<property>/systems/unused/unusedthing</property>
</enable>
<binding>
<command>nasal</command>
<script>
# Blank for now
</script>
</binding>
</button>
</group>
<group>
<layout>vbox</layout>
<group>
<layout>hbox</layout>
<hrule>
<stretch type="bool">true</stretch>
</hrule>
<text>
<label>Auto Aircraft Config</label>
</text>
<hrule>
<stretch type="bool">true</stretch>
</hrule>
</group>
<group>
<layout>vbox</layout>
<button>
<halign>center</halign>
<legend>Cold and Dark</legend>
<pref-width>140</pref-width>
<enable>
<not><property>/systems/acconfig/autoconfig-running</property></not>
</enable>
<binding>
<command>nasal</command>
<script>acconfig.colddark();</script>
</binding>
<binding>
<command>dialog-close</command>
</binding>
</button>
<button>
<halign>center</halign>
<legend>Ready to Start Eng</legend>
<pref-width>140</pref-width>
<enable>
<not><property>/systems/acconfig/autoconfig-running</property></not>
</enable>
<binding>
<command>nasal</command>
<script>acconfig.beforestart();</script>
</binding>
<binding>
<command>dialog-close</command>
</binding>
</button>
<button>
<halign>center</halign>
<legend>Ready for Taxi</legend>
<pref-width>140</pref-width>
<enable>
<not><property>/systems/acconfig/autoconfig-running</property></not>
</enable>
<binding>
<command>nasal</command>
<script>acconfig.taxi();</script>
</binding>
<binding>
<command>dialog-close</command>
</binding>
</button>
<button>
<halign>center</halign>
<legend>Ready for Takeoff</legend>
<pref-width>140</pref-width>
<enable>
<not><property>/systems/acconfig/autoconfig-running</property></not>
</enable>
<binding>
<command>nasal</command>
<script>acconfig.takeoff();</script>
</binding>
<binding>
<command>dialog-close</command>
</binding>
</button>
</group>
</group>
</group>
<vrule/>
<group>
<layout>vbox</layout>
<checkbox>
<label>Enable De-icing Truck</label>
<halign>left</halign>
<enable>
<property>/systems/unused/unusedthing</property>
</enable>
<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>/systems/unused/unusedthing</property>
</enable>
<binding>
<command>nasal</command>
<script>
if (getprop("services/deicing_truck/enable") == 1) {
setprop("/services/deicing_truck/de-ice", 1);
screen.log.write("Starting De-icing Process...", 1, 1, 1);
} else
screen.log.write("Please Enable the De-icing truck first", 1, 0, 0);
</script>
</binding>
</button>
<checkbox>
<label>Enable Baggage Ramp</label>
<halign>left</halign>
<enable>
<property>/systems/unused/unusedthing</property>
</enable>
<property>services/baggage/enable</property>
<binding>
<command>dialog-apply</command>
</binding>
<live>true</live>
</checkbox>
<checkbox>
<label>Enable External Power Box</label>
<halign>left</halign>
<enable>
<property>/systems/unused/unusedthing</property>
</enable>
<property>/controls/switches/cart</property>
<binding>
<command>dialog-apply</command>
</binding>
<live>true</live>
</checkbox>
<hrule/>
<checkbox>
<label>EIS2 Displays</label>
<halign>left</halign>
<enable>
<property>/systems/unused/unusedthing</property>
</enable>
<property>/options/EIS2</property>
<binding>
<command>dialog-apply</command>
</binding>
<live>true</live>
</checkbox>
<checkbox>
<label>Skip IRS alignment</label>
<halign>left</halign>
<enable>
<property>/systems/unused/unusedthing</property>
</enable>
<property>/systems/unused/unusedthing</property>
<binding>
<command>dialog-apply</command>
</binding>
<live>true</live>
</checkbox>
</group>
</group>
</PropertyList>

35
AircraftConfig/psload.xml Normal file
View file

@ -0,0 +1,35 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!-- A3XX Aircraft Config Dialog -->
<PropertyList>
<name>aircraft-config-panelstateload</name>
<layout>vbox</layout>
<group>
<layout>hbox</layout>
<text>
<halign>left</halign>
<label>Please wait...</label>
</text>
</group>
<hrule/>
<group>
<layout>vbox</layout>
<text>
<halign>center</halign>
<label>Loading Panel State...</label>
</text>
<text>
<halign>center</halign>
<label>Please don't touch anything during this process!</label>
</text>
</group>
</PropertyList>

View file

@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!-- A3XX Aircraft Config Dialog -->
<PropertyList>
<name>aircraft-config-panelstateloaded</name>
<layout>vbox</layout>
<group>
<layout>hbox</layout>
<text>
<halign>left</halign>
<label>Message</label>
</text>
</group>
<hrule/>
<group>
<layout>vbox</layout>
<text>
<halign>center</halign>
<label>Panel State Load Complete!</label>
</text>
<button>
<halign>center</halign>
<legend>Close</legend>
<pref-width>140</pref-width>
<key>Esc</key>
<binding>
<command>dialog-close</command>
</binding>
</button>
</group>
</PropertyList>

View file

@ -0,0 +1,86 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!-- A3XX Aircraft Config Dialog -->
<PropertyList>
<name>aircraft-config-welcome</name>
<layout>vbox</layout>
<group>
<layout>hbox</layout>
<text>
<halign>left</halign>
<label>Welcome!</label>
</text>
<button>
<halign>right</halign>
<pref-width>20</pref-width>
<pref-height>20</pref-height>
<legend>X</legend>
<key>Esc</key>
<binding>
<command>dialog-close</command>
</binding>
</button>
</group>
<hrule/>
<group>
<layout>vbox</layout>
<text>
<halign>center</halign>
<label>Welcome to the it0uchpods A3XX Series!</label>
</text>
<text>
<halign>center</halign>
<label>This is a complex simulation of these amazing Airbus Aircraft.</label>
</text>
<text>
<halign>center</halign>
<label>They are currently still under development, and therefore are not complete yet.</label>
</text>
<text>
<halign>center</halign>
<label>Use the Aircraft Config to select livery, manage panel states, and more!</label>
</text>
<text>
<halign>center</halign>
<label>Please report bugs on the FlightGear forums! Enjoy!</label>
</text>
</group>
<hrule/>
<group>
<layout>vbox</layout>
<button>
<halign>center</halign>
<legend>Open A/C Config</legend>
<pref-width>140</pref-width>
<binding>
<command>nasal</command>
<script>
acconfig.main_dlg.open();
</script>
</binding>
<binding>
<command>dialog-close</command>
</binding>
</button>
<button>
<halign>center</halign>
<legend>Close</legend>
<pref-width>140</pref-width>
<binding>
<command>dialog-close</command>
</binding>
</button>
</group>
</PropertyList>

View file

@ -6,7 +6,7 @@
Inputs: Inputs:
name: V2522_A5 name: V2522_A5
type: turbine type: turbine
thrust: 21998.928 lb thrust: 23000 lb
augmented? no augmented? no
injected? no injected? no
--> -->
@ -15,9 +15,11 @@
<milthrust> 23000 </milthrust> <milthrust> 23000 </milthrust>
<bypassratio> 2.0 </bypassratio> <bypassratio> 2.0 </bypassratio>
<tsfc> 0.8 </tsfc> <tsfc> 0.8 </tsfc>
<bleed> 0.03</bleed> <bleed> 0.03 </bleed>
<idlen1> 23.4 </idlen1> <idlen1> 23.4 </idlen1>
<idlen2> 62.7 </idlen2> <idlen2> 63.7 </idlen2>
<n1spinup> 5.1 </n1spinup>
<n2spinup> 22.8 </n2spinup>
<maxn1> 105.8 </maxn1> <maxn1> 105.8 </maxn1>
<maxn2> 102.1 </maxn2> <maxn2> 102.1 </maxn2>
<augmented> 0 </augmented> <augmented> 0 </augmented>

View file

@ -6,7 +6,7 @@
Inputs: Inputs:
name: V2522_A5 name: V2522_A5
type: turbine type: turbine
thrust: 21998.928 lb thrust: 26600 lb
augmented? no augmented? no
injected? no injected? no
--> -->
@ -15,9 +15,11 @@
<milthrust> 26600 </milthrust> <milthrust> 26600 </milthrust>
<bypassratio> 2.0 </bypassratio> <bypassratio> 2.0 </bypassratio>
<tsfc> 0.8 </tsfc> <tsfc> 0.8 </tsfc>
<bleed> 0.03</bleed> <bleed> 0.03 </bleed>
<idlen1> 23.4 </idlen1> <idlen1> 23.4 </idlen1>
<idlen2> 62.7 </idlen2> <idlen2> 63.7 </idlen2>
<n1spinup> 5.1 </n1spinup>
<n2spinup> 22.8 </n2spinup>
<maxn1> 105.8 </maxn1> <maxn1> 105.8 </maxn1>
<maxn2> 102.1 </maxn2> <maxn2> 102.1 </maxn2>
<augmented> 0 </augmented> <augmented> 0 </augmented>

View file

@ -6,7 +6,7 @@
Inputs: Inputs:
name: V2522_A5 name: V2522_A5
type: turbine type: turbine
thrust: 21998.928 lb thrust: 32000 lb
augmented? no augmented? no
injected? no injected? no
--> -->
@ -15,11 +15,13 @@
<milthrust> 32000 </milthrust> <milthrust> 32000 </milthrust>
<bypassratio> 2.0 </bypassratio> <bypassratio> 2.0 </bypassratio>
<tsfc> 0.8 </tsfc> <tsfc> 0.8 </tsfc>
<bleed> 0.03</bleed> <bleed> 0.03 </bleed>
<idlen1> 23.4 </idlen1> <idlen1> 23.4 </idlen1>
<idlen2> 62.7 </idlen2> <idlen2> 63.7 </idlen2>
<n1spinup> 5.1 </n1spinup>
<n2spinup> 22.8 </n2spinup>
<maxn1> 105.8 </maxn1> <maxn1> 105.8 </maxn1>
<maxn2> 102.1</maxn2> <maxn2> 102.1 </maxn2>
<augmented> 0 </augmented> <augmented> 0 </augmented>
<injected> 0 </injected> <injected> 0 </injected>

View file

@ -2119,64 +2119,6 @@
<!-- Engine Cut-off Switches --> <!-- Engine Cut-off Switches -->
<animation>
<type>rotate</type>
<object-name>Lcutoff</object-name>
<property>controls/engines/engine[0]/cutoff</property>
<factor>40</factor>
<center>
<x-m>-0.1064</x-m>
<y-m>0</y-m>
<z-m>-0.3795</z-m>
</center>
<axis>
<x>0</x>
<y>1</y>
<z>0</z>
</axis>
</animation>
<animation>
<type>rotate</type>
<object-name>Rcutoff</object-name>
<property>controls/engines/engine[1]/cutoff</property>
<factor>40</factor>
<center>
<x-m>-0.1064</x-m>
<y-m>0</y-m>
<z-m>-0.3795</z-m>
</center>
<axis>
<x>0</x>
<y>1</y>
<z>0</z>
</axis>
</animation>
<animation>
<type>pick</type>
<object-name>Lcutoff</object-name>
<action>
<button>0</button>
<binding>
<command>property-toggle</command>
<property>controls/engines/engine[0]/cutoff-switch</property>
</binding>
</action>
</animation>
<animation>
<type>pick</type>
<object-name>Rcutoff</object-name>
<action>
<button>0</button>
<binding>
<command>property-toggle</command>
<property>controls/engines/engine[1]/cutoff-switch</property>
</binding>
</action>
</animation>
<!-- Side Stick Animations --> <!-- Side Stick Animations -->
@ -4019,7 +3961,7 @@
<object-name>Lcutoff</object-name> <object-name>Lcutoff</object-name>
<action> <action>
<button>0</button> <button>0</button>
<repeatable type="bool">false</repeatable> <repeatable>false</repeatable>
<binding> <binding>
<command>property-toggle</command> <command>property-toggle</command>
<property>controls/engines/engine[0]/cutoff-switch</property> <property>controls/engines/engine[0]/cutoff-switch</property>
@ -4031,7 +3973,10 @@
<type>rotate</type> <type>rotate</type>
<object-name>Lcutoff</object-name> <object-name>Lcutoff</object-name>
<property>controls/engines/engine[0]/cutoff-switch</property> <property>controls/engines/engine[0]/cutoff-switch</property>
<factor>20</factor> <interpolation>
<entry><ind>0</ind><dep>0</dep></entry>
<entry><ind>1</ind><dep>60</dep></entry>
</interpolation>
<center> <center>
<x-m>-0.1067</x-m> <x-m>-0.1067</x-m>
<y-m>0</y-m> <y-m>0</y-m>
@ -4049,7 +3994,7 @@
<object-name>Rcutoff</object-name> <object-name>Rcutoff</object-name>
<action> <action>
<button>0</button> <button>0</button>
<repeatable type="bool">false</repeatable> <repeatable>false</repeatable>
<binding> <binding>
<command>property-toggle</command> <command>property-toggle</command>
<property>controls/engines/engine[1]/cutoff-switch</property> <property>controls/engines/engine[1]/cutoff-switch</property>
@ -4061,7 +4006,10 @@
<type>rotate</type> <type>rotate</type>
<object-name>Rcutoff</object-name> <object-name>Rcutoff</object-name>
<property>controls/engines/engine[1]/cutoff-switch</property> <property>controls/engines/engine[1]/cutoff-switch</property>
<factor>20</factor> <interpolation>
<entry><ind>0</ind><dep>0</dep></entry>
<entry><ind>1</ind><dep>60</dep></entry>
</interpolation>
<center> <center>
<x-m>-0.1067</x-m> <x-m>-0.1067</x-m>
<y-m>0</y-m> <y-m>0</y-m>

View file

@ -48,7 +48,7 @@
<type>rotation</type> <type>rotation</type>
<offset>-30</offset> <offset>-30</offset>
<scale>1.6</scale> <scale>1.6</scale>
<property>engines/apu/rpm</property> <property>/systems/apu/rpm</property>
</transformation> </transformation>
</transformations> </transformations>
</layer> </layer>
@ -66,7 +66,7 @@
<chunks> <chunks>
<chunk> <chunk>
<type>number-value</type> <type>number-value</type>
<property>engines/apu/rpm</property> <property>/systems/apu/rpm</property>
<format type="string">%3.0f</format> <format type="string">%3.0f</format>
</chunk> </chunk>
</chunks> </chunks>
@ -108,7 +108,10 @@
</transformation> </transformation>
</transformations> </transformations>
<condition> <condition>
<property>engines/apu/running</property> <greater-than>
<property>/systems/apu/rpm</property>
<value>98.0</value>
</greater-than>
</condition> </condition>
</layer> </layer>
@ -138,7 +141,7 @@
</transformation> </transformation>
</transformations> </transformations>
<condition> <condition>
<property>controls/APU/master-switch</property> <property>controls/APU/master</property>
</condition> </condition>
</layer> </layer>
@ -156,7 +159,7 @@
<chunks> <chunks>
<chunk> <chunk>
<type>number-value</type> <type>number-value</type>
<property>/systems/electrical/suppliers/apu-v</property><!-- There is no TAT temperature property--> <property>/systems/electrical/suppliers/apu-v</property>
<format type="string">%3.0f</format> <format type="string">%3.0f</format>
</chunk> </chunk>
</chunks> </chunks>
@ -189,7 +192,7 @@
<chunks> <chunks>
<chunk> <chunk>
<type>number-value</type> <type>number-value</type>
<property>environment/temperature-degc</property><!-- There is no TAT temperature property--> <property>environment/temperature-degc</property>
<format type="string">%3.0f</format> <format type="string">%3.0f</format>
</chunk> </chunk>
</chunks> </chunks>

View file

@ -922,16 +922,15 @@
<repeatable type="bool">false</repeatable> <repeatable type="bool">false</repeatable>
<binding> <binding>
<command>property-toggle</command> <command>property-toggle</command>
<property>controls/pneumatic/APU-bleed</property> <property>controls/APU/bleed</property>
</binding> </binding>
</action> </action>
</animation> </animation>
<animation> <animation>
<name>APU bleed on</name> <name>APU bleed on</name>
<type>textranslate</type> <type>textranslate</type>
<object-name>APUBleedBtn2</object-name> <object-name>APUBleedBtn2</object-name>
<property>controls/pneumatic/APU-bleed</property> <property>controls/APU/bleed</property>
<factor>0.5</factor> <factor>0.5</factor>
<axis> <axis>
<x>1</x> <x>1</x>
@ -951,7 +950,6 @@
<command>property-toggle</command> <command>property-toggle</command>
<property>controls/pneumatic/engine[1]/bleed</property> <property>controls/pneumatic/engine[1]/bleed</property>
</binding> </binding>
</action> </action>
</animation> </animation>
<animation> <animation>
@ -1368,7 +1366,7 @@
<repeatable type="bool">false</repeatable> <repeatable type="bool">false</repeatable>
<binding> <binding>
<command>property-toggle</command> <command>property-toggle</command>
<property>controls/APU/master-switch</property> <property>controls/APU/master</property>
</binding> </binding>
</action> </action>
@ -1379,7 +1377,7 @@
<object-name>APUMasterBtn1</object-name> <object-name>APUMasterBtn1</object-name>
<property>engines/apu/serviceable</property> <property>engines/apu/serviceable</property>
<interpolation> <interpolation>
<entry><ind>0</ind><dep>0.5</dep></entry> <entry><ind>0</ind><dep>0</dep></entry> <!-- Set 0.5 to make the FAULT light appear -->
<entry><ind>1</ind><dep>0</dep></entry> <entry><ind>1</ind><dep>0</dep></entry>
</interpolation> </interpolation>
<axis> <axis>
@ -1391,7 +1389,7 @@
<name>APU master switch on</name> <name>APU master switch on</name>
<type>textranslate</type> <type>textranslate</type>
<object-name>APUMasterBtn2</object-name> <object-name>APUMasterBtn2</object-name>
<property>controls/APU/master-switch</property> <property>controls/APU/master</property>
<factor>0.5</factor> <factor>0.5</factor>
<axis> <axis>
<x>1</x> <x>1</x>
@ -1409,7 +1407,7 @@
<repeatable type="bool">false</repeatable> <repeatable type="bool">false</repeatable>
<binding> <binding>
<command>property-toggle</command> <command>property-toggle</command>
<property>controls/APU/starter</property> <property>controls/APU/start</property>
</binding> </binding>
</action> </action>
@ -1418,7 +1416,7 @@
<name>APU starter on</name> <name>APU starter on</name>
<type>textranslate</type> <type>textranslate</type>
<object-name>APUStartBtn2</object-name> <object-name>APUStartBtn2</object-name>
<property>controls/APU/starter</property> <property>controls/APU/start</property>
<factor>0.5</factor> <factor>0.5</factor>
<axis> <axis>
<x>1</x> <x>1</x>

Binary file not shown.

After

Width:  |  Height:  |  Size: 5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5 KiB

After

Width:  |  Height:  |  Size: 5.6 KiB

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -137,7 +137,7 @@ var Alternator = {
var battery = Battery.new("/controls/electric/battery-switch",24,30,34,1.0,7.0); var battery = Battery.new("/controls/electric/battery-switch",24,30,34,1.0,7.0);
var alternator1 = Alternator.new(0,"controls/electric/engine[0]/generator","/engines/engine[0]/amp-v","/engines/engine[0]/n2",50.0,28.0,60.0); var alternator1 = Alternator.new(0,"controls/electric/engine[0]/generator","/engines/engine[0]/amp-v","/engines/engine[0]/n2",50.0,28.0,60.0);
var alternator2 = Alternator.new(1,"controls/electric/engine[1]/generator","/engines/engine[1]/amp-v","/engines/engine[1]/n2",50.0,28.0,60.0); var alternator2 = Alternator.new(1,"controls/electric/engine[1]/generator","/engines/engine[1]/amp-v","/engines/engine[1]/n2",50.0,28.0,60.0);
var alternator3 = Alternator.new(2,"controls/electric/APU-generator","/engines/apu/amp-v","/engines/apu/rpm",80.0,24.0,60.0); var alternator3 = Alternator.new(2,"controls/electric/APU-generator","/engines/apu/amp-v","/systems/apu/rpm",80.0,24.0,60.0);
##################################### #####################################
setlistener("/sim/signals/fdm-initialized", func { setlistener("/sim/signals/fdm-initialized", func {

View file

@ -1,236 +1,190 @@
## AIRBUS A320 ENGINE CONTROL SYSTEMS # A320Family JSB Engine System
##################################### # Joshua Davidson (it0uchpods)
# NOTE: Update functions are called in systems.nas #####################
# Initializing Vars #
#####################
var apu = var engines = props.globals.getNode("/engines").getChildren("engine");
{ var n1_min = 23.4;
new: func(no) var n2_min = 63.7;
{ var egt_min = 323;
var m = var n1_spin = 5.1;
{ var n2_spin = 22.8;
parents: [apu] var n1_start = 23.3;
}; var n2_start = 63.6;
m.number = no; var egt_start = 489;
var n1_max = 105.8;
var n2_max = 102.1;
var egt_max = 860;
var n1_wm = 0;
var n2_wm = 0;
var apu_max = 99.8;
var apu_egt_max = 462;
var spinup_time = 15;
var start_time = 10;
var egt_lightup_time = 3;
var egt_lightdn_time = 7;
var shutdown_time = 20;
var egt_shutdown_time = 20;
setprop("/systems/apu/rpm", 0);
setprop("/systems/apu/egt", 42);
m.fire_switch = props.globals.getNode("engines/apu[" ~ no ~ "]/fire-switch", 1); ##############################
m.fire_switch.setBoolValue(0); # Trigger Startups and Stops #
m.master_switch = props.globals.getNode("controls/APU[" ~ no ~ "]/master-switch", 1); ##############################
m.master_switch.setBoolValue(0);
m.on_fire = props.globals.getNode("engines/apu[" ~ no ~ "]/on-fire", 1);
m.on_fire.setBoolValue(0);
m.rpm = props.globals.getNode("engines/apu[" ~ no ~ "]/rpm", 1);
m.rpm.setValue(0);
m.running = props.globals.getNode("engines/apu[" ~ no ~ "]/running", 1);
m.running.setBoolValue(0);
m.serviceable = props.globals.getNode("engines/apu[" ~ no ~ "]/serviceable", 1);
m.serviceable.setBoolValue(1);
m.starter = props.globals.getNode("controls/APU[" ~ no ~ "]/starter", 1);
m.starter.setBoolValue(0);
return m; setlistener("/controls/engines/engine[0]/cutoff-switch", func {
}, if (getprop("/controls/engines/engine[0]/cutoff-switch") == 0) {
update: func start_one_check();
{ } else if (getprop("/controls/engines/engine[0]/cutoff-switch") == 1) {
if (me.on_fire.getBoolValue()) setprop("/controls/engines/engine[0]/starter", 0);
{ setprop("/controls/engines/engine[0]/cutoff", 1);
me.serviceable.setBoolValue(0); setprop("/engines/engine[0]/state", 0);
} interpolate(engines[0].getNode("egt-actual"), 0, egt_shutdown_time);
if (me.fire_switch.getBoolValue()) }
{ });
me.on_fire.setBoolValue(0);
}
if (me.serviceable.getBoolValue() and (me.master_switch.getBoolValue() or me.starter.getBoolValue())) var start_one_check = func {
{ if ((getprop("/controls/engines/engine-start-switch") == 2) and (getprop("/controls/APU/bleed") == 1) and (getprop("/systems/apu/rpm") >= 98)) {
if (me.starter.getBoolValue()) auto_start_one();
{ }
var rpm = me.rpm.getValue(); }
rpm += getprop("sim/time/delta-realtime-sec") * 25;
if (rpm >= 100)
{
rpm = 100;
}
me.rpm.setValue(rpm);
}
if (me.master_switch.getBoolValue() and me.rpm.getValue() == 100)
{
me.running.setBoolValue(1);
}
}
else
{
me.running.setBoolValue(0);
var rpm = me.rpm.getValue(); setlistener("/controls/engines/engine[1]/cutoff-switch", func {
rpm -= getprop("sim/time/delta-realtime-sec") * 30; if (getprop("/controls/engines/engine[1]/cutoff-switch") == 0) {
if (rpm <= 0) start_two_check();
{ } else if (getprop("/controls/engines/engine[1]/cutoff-switch") == 1) {
rpm = 0; setprop("/controls/engines/engine[1]/starter", 0);
} setprop("/controls/engines/engine[1]/cutoff", 1);
me.rpm.setValue(rpm); setprop("/engines/engine[0]/state", 0);
} interpolate(engines[1].getNode("egt-actual"), 0, egt_shutdown_time);
} }
}; });
var engine =
{
new: func(no)
{
var m =
{
parents: [engine]
};
m.number = no;
m.contrail = props.globals.getNode("engines/engine[" ~ no ~ "]/contrail", 1); var start_two_check = func {
m.contrail.setBoolValue(0); if ((getprop("/controls/engines/engine-start-switch") == 2) and (getprop("/controls/APU/bleed") == 1) and (getprop("/systems/apu/rpm") >= 98)) {
m.cutoff = props.globals.getNode("controls/engines/engine[" ~ no ~ "]/cutoff", 1); auto_start_two();
m.cutoff.setBoolValue(1); }
m.cutoff_switch = props.globals.getNode("controls/engines/engine[" ~ no ~ "]/cutoff-switch", 1); }
m.cutoff_switch.setBoolValue(1);
m.fire_bottle_discharge = props.globals.getNode("controls/engines/engine[" ~ no ~ "]/fire-bottle-discharge", 1);
m.fire_bottle_discharge.setBoolValue(0);
m.n2 = props.globals.getNode("engines/engine[" ~ no ~ "]/n2", 1);
m.n2.setValue(0);
m.on_fire = props.globals.getNode("engines/engine[" ~ no ~ "]/on-fire", 1);
m.on_fire.setBoolValue(0);
m.out_of_fuel = props.globals.getNode("engines/engine[" ~ no ~ "]/out-of-fuel", 1);
m.out_of_fuel.setBoolValue(0);
m.reverser = props.globals.getNode("controls/engines/engine[" ~ no ~ "]/reverser", 1);
m.reverser.setBoolValue(0);
m.reverser_angle_rad = props.globals.getNode("fdm/jsbsim/propulsion/engine[" ~ no ~ "]/reverser-angle-rad", 1);
m.reverser_angle_rad.setValue(0);
m.reverser_pos_norm = props.globals.getNode("engines/engine[" ~ no ~ "]/reverser-pos-norm", 1);
m.reverser_pos_norm.setValue(0);
m.starter = props.globals.getNode("controls/engines/engine[" ~ no ~ "]/starter", 1);
m.starter.setBoolValue(0);
m.starter_switch = props.globals.getNode("controls/engines/engine[" ~ no ~ "]/starter-switch", 1);
m.starter_switch.setBoolValue(0);
m.serviceable = props.globals.getNode("sim/failure-manager/engines/engine[" ~ no ~ "]/serviceable", 1);
m.serviceable.setBoolValue(1);
m.throttle = props.globals.getNode("controls/engines/engine[" ~ no ~ "]/throttle", 1);
m.throttle.setValue(0);
return m; ####################
}, # Start Engine One #
update: func ####################
{
if (me.on_fire.getBoolValue())
{
me.serviceable.setBoolValue(0);
}
if (me.fire_bottle_discharge.getBoolValue())
{
me.on_fire.setBoolValue(0);
}
if (me.serviceable.getBoolValue())
{
me.cutoff.setBoolValue(me.cutoff_switch.getBoolValue());
}
me.starter.setBoolValue(me.starter_switch.getBoolValue()); var auto_start_one = func {
if (getprop("controls/engines/engine-start-switch") == 0 or getprop("controls/engines/engine-start-switch") == 2) setprop("/engines/engine[0]/state", 1);
{ setprop("/controls/engines/engine[0]/starter", 1);
me.starter.setBoolValue(1); eng_one_auto_startt.start();
} }
if (!props.globals.getNode("engines/apu/running").getBoolValue())
{
me.starter.setBoolValue(0);
}
if (me.n2.getValue() > 50 and props.globals.getNode("environment/contrail").getBoolValue()) var eng_one_auto_start = func {
{ if (getprop("/engines/engine[0]/n2") >= 24.1) {
me.contrail.setBoolValue(1); setprop("/engines/engine[0]/state", 2);
} setprop("/controls/engines/engine[0]/cutoff", 0);
else interpolate(engines[0].getNode("egt-actual"), egt_start, egt_lightup_time);
{ eng_one_n2_checkt.start();
me.contrail.setBoolValue(0); eng_one_auto_startt.stop();
} }
}, }
reverse_thrust: func
{
if (me.throttle.getValue() == 0 and props.globals.getNode("gear/gear[1]/wow").getBoolValue())
{
if (me.reverser_pos_norm.getValue() == 0)
{
interpolate(me.reverser_pos_norm.getPath(),
1, 1.4
);
me.reverser_angle_rad.setValue(math.pi);
me.reverser.setBoolValue(1);
}
elsif (me.reverser_pos_norm.getValue() == 1)
{
interpolate(me.reverser_pos_norm.getPath(),
0, 1.4
);
me.reverser_angle_rad.setValue(0);
me.reverser.setBoolValue(0);
}
}
}
};
var apu1 = apu.new(0);
var engine1 = engine.new(0);
var engine2 = engine.new(1);
# startup/shutdown functions var eng_one_n2_check = func {
var startup = func if (getprop("/engines/engine[0]/egt-actual") >= egt_start) {
{ interpolate(engines[0].getNode("egt-actual"), egt_min, egt_lightdn_time);
setprop("controls/electric/battery-switch", 1); }
setprop("controls/electric/engine[0]/generator", 1); if (getprop("/engines/engine[0]/n2") >= n2_start) {
setprop("controls/electric/engine[1]/generator", 1); setprop("/engines/engine[0]/state", 3);
setprop("controls/engines/engine[0]/cutoff-switch", 1); eng_one_n2_checkt.stop();
setprop("controls/engines/engine[1]/cutoff-switch", 1); }
setprop("controls/APU/master-switch", 1); }
setprop("controls/APU/starter", 1);
var listener1 = setlistener("engines/apu/running", func ####################
{ # Start Engine Two #
if (props.globals.getNode("engines/apu/running").getBoolValue()) ####################
{
setprop("controls/engines/engine-start-switch", 2);
settimer(func
{
setprop("controls/engines/engine[0]/cutoff-switch", 0);
setprop("controls/engines/engine[1]/cutoff-switch", 0);
}, 2);
removelistener(listener1);
}
}, 0, 0);
var listener2 = setlistener("engines/engine[0]/running", func
{
if (props.globals.getNode("engines/engine[0]/running").getBoolValue())
{
settimer(func
{
setprop("controls/APU/master-switch", 0);
setprop("controls/APU/starter", 0);
setprop("controls/engines/engine-start-switch", 1);
setprop("controls/electric/battery-switch", 0);
}, 2);
removelistener(listener2);
}
}, 0, 0);
};
var shutdown = func
{
setprop("controls/electric/engine[0]/generator", 0);
setprop("controls/electric/engine[1]/generator", 0);
setprop("controls/engines/engine[0]/cutoff-switch", 1);
setprop("controls/engines/engine[1]/cutoff-switch", 1);
};
# listener to activate these functions accordingly var auto_start_two = func {
setlistener("sim/model/start-idling", func(idle) setprop("/engines/engine[1]/state", 1);
{ setprop("/controls/engines/engine[1]/starter", 1);
var run = idle.getBoolValue(); eng_two_auto_startt.start();
if (run) }
{
startup(); var eng_two_auto_start = func {
} if (getprop("/engines/engine[1]/n2") >= 24.1) {
else setprop("/engines/engine[1]/state", 2);
{ setprop("/controls/engines/engine[1]/cutoff", 0);
shutdown(); interpolate(engines[1].getNode("egt-actual"), egt_start, egt_lightup_time);
} eng_two_n2_checkt.start();
}, 0, 0); eng_two_auto_startt.stop();
}
}
var eng_two_n2_check = func {
if (getprop("/engines/engine[1]/egt-actual") >= egt_start) {
interpolate(engines[1].getNode("egt-actual"), egt_min, egt_lightdn_time);
}
if (getprop("/engines/engine[1]/n2") >= n2_start) {
setprop("/engines/engine[1]/state", 3);
eng_two_n2_checkt.stop();
}
}
#############
# Start APU #
#############
setlistener("/controls/APU/start", func {
if ((getprop("/controls/APU/master") == 1) and (getprop("/controls/APU/start") == 1)) {
interpolate("/systems/apu/rpm", apu_max, spinup_time);
interpolate("/systems/apu/egt", apu_egt_max, spinup_time);
} else if (getprop("/controls/APU/master") == 0) {
apu_stop();
}
});
############
# Stop APU #
############
setlistener("/controls/APU/master", func {
if (getprop("/controls/APU/master") == 0) {
setprop("/controls/APU/start", 0);
apu_stop();
}
});
var apu_stop = func {
interpolate("/systems/apu/rpm", 0, spinup_time);
interpolate("/systems/apu/egt", 42, spinup_time);
}
#######################
# Various other stuff #
#######################
setlistener("/controls/engines/engine-start-switch", func {
if ((getprop("/controls/engines/engine-start-switch") == 0) or (getprop("/controls/engines/engine-start-switch") == 1)) {
if (getprop("/controls/engines/engine[0]/state") == 1) {
eng_one_stop();
}
if (getprop("/controls/engines/engine[1]/state") == 1) {
eng_two_stop();
}
}
});
setlistener("/controls/APU/bleed", func {
if (getprop("/controls/APU/bleed") == 0) {
if (getprop("/controls/engines/engine[0]/state") == 1) {
eng_one_stop();
}
if (getprop("/controls/engines/engine[1]/state") == 1) {
eng_two_stop();
}
}
});
# Timers
var eng_one_auto_startt = maketimer(0.5, eng_one_auto_start);
var eng_one_n2_checkt = maketimer(0.5, eng_one_n2_check);
var eng_two_auto_startt = maketimer(0.5, eng_two_auto_start);
var eng_two_n2_checkt = maketimer(0.5, eng_two_n2_check);

View file

@ -25,9 +25,6 @@ var systems =
}, },
update: func update: func
{ {
apu1.update();
engine1.update();
engine2.update();
update_electrical(); update_electrical();
# stop calling our systems code if the stop() function was called or the aircraft crashes # stop calling our systems code if the stop() function was called or the aircraft crashes

View file

@ -41,18 +41,26 @@
</filter> </filter>
<filter> <filter>
<name>EGT 1</name> <name>EGT L</name>
<type>gain</type> <type>gain</type>
<gain>1</gain> <gain>1</gain>
<enable>
<condition>
<equals>
<property>/engines/engine[0]/state</property>
<value>3</value>
</equals>
</condition>
</enable>
<update-interval-secs type="double">0.05</update-interval-secs> <update-interval-secs type="double">0.05</update-interval-secs>
<input> <input>
<expression> <expression>
<table> <table>
<property>/engines/engine[0]/n1</property> <property>/engines/engine[0]/n1</property>
<entry><ind> 0</ind><dep>037</dep></entry> <entry><ind>0</ind><dep>0</dep></entry>
<entry><ind> 8</ind><dep>037</dep></entry> <entry><ind>6</ind><dep>0</dep></entry>
<entry><ind> 23</ind><dep>415</dep></entry> <entry><ind>23.4</ind><dep>323</dep></entry>
<entry><ind>110</ind><dep>642</dep></entry> <entry><ind>110</ind><dep>700</dep></entry>
</table> </table>
</expression> </expression>
</input> </input>
@ -60,18 +68,26 @@
</filter> </filter>
<filter> <filter>
<name>EGT 2</name> <name>EGT R</name>
<type>gain</type> <type>gain</type>
<gain>1</gain> <gain>1</gain>
<enable>
<condition>
<equals>
<property>/engines/engine[1]/state</property>
<value>3</value>
</equals>
</condition>
</enable>
<update-interval-secs type="double">0.05</update-interval-secs> <update-interval-secs type="double">0.05</update-interval-secs>
<input> <input>
<expression> <expression>
<table> <table>
<property>/engines/engine[1]/n1</property> <property>/engines/engine[1]/n1</property>
<entry><ind> 0</ind><dep>037</dep></entry> <entry><ind>0</ind><dep>0</dep></entry>
<entry><ind> 8</ind><dep>037</dep></entry> <entry><ind>6</ind><dep>0</dep></entry>
<entry><ind> 23</ind><dep>415</dep></entry> <entry><ind>23.4</ind><dep>323</dep></entry>
<entry><ind>110</ind><dep>642</dep></entry> <entry><ind>110</ind><dep>700</dep></entry>
</table> </table>
</expression> </expression>
</input> </input>