Merge branch 'dev' into fuel-prediction
This commit is contained in:
commit
6e737cc8c8
16 changed files with 334 additions and 340 deletions
|
@ -576,42 +576,6 @@
|
|||
<footrest-cpt n="1" type="double">0</footrest-cpt>
|
||||
<footrest-fo n="0" type="double">0</footrest-fo>
|
||||
<footrest-fo n="1" type="double">0</footrest-fo>
|
||||
<adirs n="0">
|
||||
<adr n="0">
|
||||
<fault type="bool">false</fault>
|
||||
<off type="bool">false</off>
|
||||
</adr>
|
||||
<adr n="1">
|
||||
<fault type="bool">false</fault>
|
||||
<off type="bool">false</off>
|
||||
</adr>
|
||||
<adr n="2">
|
||||
<fault type="bool">false</fault>
|
||||
<off type="bool">false</off>
|
||||
</adr>
|
||||
<display>
|
||||
<selected type="int">1</selected>
|
||||
<dataknob type="int">5</dataknob>
|
||||
<text type="string"></text>
|
||||
</display>
|
||||
<ir n="0">
|
||||
<align type="bool">false</align>
|
||||
<knob type="int">0</knob>
|
||||
<fault type="bool">false</fault>
|
||||
</ir>
|
||||
<ir n="1">
|
||||
<align type="bool">false</align>
|
||||
<knob type="int">0</knob>
|
||||
<fault type="bool">false</fault>
|
||||
</ir>
|
||||
<ir n="2">
|
||||
<align type="bool">false</align>
|
||||
<knob type="int">0</knob>
|
||||
<fault type="bool">false</fault>
|
||||
</ir>
|
||||
<onbat type="bool">false</onbat>
|
||||
<skip type="bool">0</skip>
|
||||
</adirs>
|
||||
<atc>
|
||||
<system-knob type="int">0</system-knob>
|
||||
<mode-knob type="int">0</mode-knob>
|
||||
|
@ -803,9 +767,9 @@
|
|||
<navigation>
|
||||
<adirscp>
|
||||
<switches>
|
||||
<adr-1 type="bool">0</adr-1>
|
||||
<adr-2 type="bool">0</adr-2>
|
||||
<adr-3 type="bool">0</adr-3>
|
||||
<adr-1 type="bool">1</adr-1>
|
||||
<adr-2 type="bool">1</adr-2>
|
||||
<adr-3 type="bool">1</adr-3>
|
||||
<ir-1 type="bool">0</ir-1>
|
||||
<ir-2 type="bool">0</ir-2>
|
||||
<ir-3 type="bool">0</ir-3>
|
||||
|
@ -817,9 +781,9 @@
|
|||
<adr-1-fault type="bool">0</adr-1-fault>
|
||||
<adr-2-fault type="bool">0</adr-2-fault>
|
||||
<adr-3-fault type="bool">0</adr-3-fault>
|
||||
<adr-1-off type="bool">1</adr-1-off>
|
||||
<adr-2-off type="bool">1</adr-2-off>
|
||||
<adr-3-off type="bool">1</adr-3-off>
|
||||
<adr-1-off type="bool">0</adr-1-off>
|
||||
<adr-2-off type="bool">0</adr-2-off>
|
||||
<adr-3-off type="bool">0</adr-3-off>
|
||||
<ir-1-fault type="bool">0</ir-1-fault>
|
||||
<ir-2-fault type="bool">0</ir-2-fault>
|
||||
<ir-3-fault type="bool">0</ir-3-fault>
|
||||
|
@ -3957,7 +3921,6 @@
|
|||
<file>Aircraft/A320-family/Nasal/Systems/hydraulics.nas</file>
|
||||
<file>Aircraft/A320-family/Nasal/Systems/fuel.nas</file>
|
||||
<file>Aircraft/A320-family/Nasal/Systems/FADEC/engines-common.nas</file>
|
||||
<file>Aircraft/A320-family/Nasal/Systems/ADIRS/ADIRS.nas</file>
|
||||
<file>Aircraft/A320-family/Nasal/Systems/ADIRS/ADR.nas</file>
|
||||
<file>Aircraft/A320-family/Nasal/Systems/ADIRS/SwitchingPanel.nas</file>
|
||||
<file>Aircraft/A320-family/Nasal/Systems/Comm/HF.nas</file>
|
||||
|
|
|
@ -384,15 +384,15 @@ var beforestart_b = func {
|
|||
setprop("/controls/adirs/ir[0]/knob","1");
|
||||
setprop("/controls/adirs/ir[1]/knob","1");
|
||||
setprop("/controls/adirs/ir[2]/knob","1");
|
||||
if (systems.ADIRSnew.Switches.adrSw[0].getValue() != 1) { systems.ADIRSControlPanel.adrSw(0); }
|
||||
if (systems.ADIRSnew.Switches.adrSw[1].getValue() != 1) { systems.ADIRSControlPanel.adrSw(1); }
|
||||
if (systems.ADIRSnew.Switches.adrSw[2].getValue() != 1) { systems.ADIRSControlPanel.adrSw(2); }
|
||||
if (systems.ADIRS.Switches.adrSw[0].getValue() != 1) { systems.ADIRSControlPanel.adrSw(0); }
|
||||
if (systems.ADIRS.Switches.adrSw[1].getValue() != 1) { systems.ADIRSControlPanel.adrSw(1); }
|
||||
if (systems.ADIRS.Switches.adrSw[2].getValue() != 1) { systems.ADIRSControlPanel.adrSw(2); }
|
||||
systems.ADIRSControlPanel.irModeSw(0, 1);
|
||||
systems.ADIRSControlPanel.irModeSw(1, 1);
|
||||
systems.ADIRSControlPanel.irModeSw(2, 1);
|
||||
systems.ADIRSnew.ADIRunits[0].instAlign();
|
||||
systems.ADIRSnew.ADIRunits[1].instAlign();
|
||||
systems.ADIRSnew.ADIRunits[2].instAlign();
|
||||
systems.ADIRS.ADIRunits[0].instAlign();
|
||||
systems.ADIRS.ADIRunits[1].instAlign();
|
||||
systems.ADIRS.ADIRunits[2].instAlign();
|
||||
setprop("/controls/adirs/mcducbtn", 1);
|
||||
setprop("/controls/switches/beacon", 1);
|
||||
setprop("/controls/lighting/nav-lights-switch", 1);
|
||||
|
@ -476,15 +476,15 @@ var taxi_b = func {
|
|||
setprop("/controls/adirs/ir[0]/knob","1");
|
||||
setprop("/controls/adirs/ir[1]/knob","1");
|
||||
setprop("/controls/adirs/ir[2]/knob","1");
|
||||
if (systems.ADIRSnew.Switches.adrSw[0].getValue() != 1) { systems.ADIRSControlPanel.adrSw(0); }
|
||||
if (systems.ADIRSnew.Switches.adrSw[1].getValue() != 1) { systems.ADIRSControlPanel.adrSw(1); }
|
||||
if (systems.ADIRSnew.Switches.adrSw[2].getValue() != 1) { systems.ADIRSControlPanel.adrSw(2); }
|
||||
if (systems.ADIRS.Switches.adrSw[0].getValue() != 1) { systems.ADIRSControlPanel.adrSw(0); }
|
||||
if (systems.ADIRS.Switches.adrSw[1].getValue() != 1) { systems.ADIRSControlPanel.adrSw(1); }
|
||||
if (systems.ADIRS.Switches.adrSw[2].getValue() != 1) { systems.ADIRSControlPanel.adrSw(2); }
|
||||
systems.ADIRSControlPanel.irModeSw(0, 1);
|
||||
systems.ADIRSControlPanel.irModeSw(1, 1);
|
||||
systems.ADIRSControlPanel.irModeSw(2, 1);
|
||||
systems.ADIRSnew.ADIRunits[0].instAlign();
|
||||
systems.ADIRSnew.ADIRunits[1].instAlign();
|
||||
systems.ADIRSnew.ADIRunits[2].instAlign();
|
||||
systems.ADIRS.ADIRunits[0].instAlign();
|
||||
systems.ADIRS.ADIRunits[1].instAlign();
|
||||
systems.ADIRS.ADIRunits[2].instAlign();
|
||||
setprop("/controls/adirs/mcducbtn", 1);
|
||||
setprop("/controls/switches/beacon", 1);
|
||||
setprop("/controls/switches/wing-lights", 1);
|
||||
|
|
|
@ -669,7 +669,7 @@ var canvas_lowerECAM_apu = {
|
|||
me["APUGenHz"].setText(sprintf("%s", math.round(apu_hz.getValue())));
|
||||
|
||||
# APU Bleed
|
||||
if (systems.ADIRSnew.Operating.adr[0].getValue() and (apu_master.getValue() == 1 or bleedapu.getValue() > 0)) {
|
||||
if (systems.ADIRS.Operating.adr[0].getValue() and (apu_master.getValue() == 1 or bleedapu.getValue() > 0)) {
|
||||
me["APUBleedPSI"].setColor(0.0509,0.7529,0.2941);
|
||||
me["APUBleedPSI"].setText(sprintf("%s", math.round(bleedapu.getValue())));
|
||||
} else {
|
||||
|
|
|
@ -107,6 +107,8 @@ var cruiseTemp = props.globals.getNode("/FMGC/internal/cruise-temp", 1);
|
|||
var cruiseTempSet = props.globals.getNode("/FMGC/internal/cruise-temp-set", 1);
|
||||
var tropo = props.globals.getNode("/FMGC/internal/tropo", 1);
|
||||
var tropoSet = props.globals.getNode("/FMGC/internal/tropo-set", 1);
|
||||
var gndtemp = props.globals.getNode("/FMGC/internal/gndtemp", 1);
|
||||
var gndtempSet = props.globals.getNode("/FMGC/internal/gndtemp-set", 1);
|
||||
var ADIRSMCDUBTN = props.globals.getNode("/controls/adirs/mcducbtn", 1);
|
||||
|
||||
# IRSINIT variables
|
||||
|
@ -1105,16 +1107,16 @@ var canvas_MCDU_base = {
|
|||
me["Simple_Title"].setColor(1, 1, 1);
|
||||
me["Simple_PageNum"].setText("X/X");
|
||||
me["Simple_PageNum"].hide();
|
||||
me["ArrowLeft"].hide();
|
||||
me["ArrowLeft"].show();
|
||||
me["ArrowRight"].show();
|
||||
|
||||
me.showLeft(0, 1, 0, -1, 0, 1);
|
||||
me["Simple_L0S"].hide();
|
||||
me.showLeftS(1, 1, 1, -1, 1, 1);
|
||||
me.showLeftArrow(-1, -1, -1, -1, -1, -1);
|
||||
me.showRight(0, 0, 1, -1, 1, 1);
|
||||
me.showRightS(1, 0, -1, -1, -1, 1);
|
||||
me.showRightArrow(-1, -1, -1, -1, 1, -1);
|
||||
me.showRight(0, 0, 1, 1, 1, 1);
|
||||
me.showRightS(1, 0, -1, -1, 1, 1);
|
||||
me.showRightArrow(-1, -1, -1, 1, -1, -1);
|
||||
|
||||
me.fontLeft(default, default, default, default, default, default);
|
||||
me.fontLeftS(default, default, default, default, default, default);
|
||||
|
@ -1122,12 +1124,12 @@ var canvas_MCDU_base = {
|
|||
me.fontRightS(default, default, default, default, default, default);
|
||||
|
||||
me.fontSizeLeft(normal, normal, normal, normal, normal, normal);
|
||||
me.fontSizeRight(normal, normal, normal, normal, normal, normal);
|
||||
me.fontSizeRight(normal, normal, normal, normal, normal, 0);
|
||||
|
||||
me.colorLeft("blu", "wht", "blu", "blu", "ack", "ack");
|
||||
me.colorLeftS("wht", "wht", "wht", "wht", "wht", "wht");
|
||||
me.colorLeftArrow("wht", "wht", "wht", "wht", "wht", "wht");
|
||||
me.colorRight("blu", "amb", "amb", "wht", "wht", "blu");
|
||||
me.colorRight("blu", "amb", "amb", "wht", "blu", "blu");
|
||||
me.colorRightS("wht", "amb", "wht", "wht", "wht", "wht");
|
||||
me.colorRightArrow("wht", "wht", "wht", "wht", "wht", "wht");
|
||||
|
||||
|
@ -1192,7 +1194,7 @@ var canvas_MCDU_base = {
|
|||
me["INITA_FromTo"].show();
|
||||
me["Simple_L1"].hide();
|
||||
me["Simple_L2"].setColor(1,1,1);
|
||||
me["Simple_L2"].setText("----/------");
|
||||
me["Simple_L2"].setText("----/----------");
|
||||
me.showRight(-1, 1, 0, 0, 0, 0);
|
||||
me["Simple_R2S"].show();
|
||||
me["INITA_InitRequest"].show();
|
||||
|
@ -1207,9 +1209,23 @@ var canvas_MCDU_base = {
|
|||
me.showRightArrow(0, 0, 1, 0, 0, 0);
|
||||
}
|
||||
if (tropoSet.getValue() == 1) {
|
||||
me["Simple_R6"].setFontSize(normal);
|
||||
me["Simple_R5"].setFontSize(normal);
|
||||
} else {
|
||||
me["Simple_R5"].setFontSize(small);
|
||||
}
|
||||
|
||||
me["Simple_R6S"].setText("GND TEMP");
|
||||
if (getprop("/FMGC/status/phase") == 0 and !getprop("/FMGC/internal/gndtemp-set")) {
|
||||
setprop("/FMGC/internal/gndtemp", 15 - (2 * getprop("/position/gear-agl-ft") / 1000));
|
||||
me["Simple_R6"].setText(sprintf("%.0fg", gndtemp.getValue()));
|
||||
me["Simple_R6"].setFontSize(small);
|
||||
} else {
|
||||
if (getprop("/FMGC/internal/gndtemp-set")) {
|
||||
me["Simple_R6"].setFontSize(normal);
|
||||
} else {
|
||||
me["Simple_R6"].setFontSize(small);
|
||||
}
|
||||
me["Simple_R6"].setText(sprintf("%.0fg", gndtemp.getValue()));
|
||||
}
|
||||
|
||||
me["Simple_L1S"].setText(" CO RTE");
|
||||
|
@ -1221,13 +1237,13 @@ var canvas_MCDU_base = {
|
|||
me["Simple_L3"].setText(sprintf("%s", flightNum.getValue()));
|
||||
me["Simple_R1S"].setText("FROM/TO ");
|
||||
me["Simple_R2S"].setText("INIT ");
|
||||
me["Simple_R6S"].setText("TROPO");
|
||||
me["Simple_R5S"].setText("TROPO");
|
||||
|
||||
me["Simple_R1"].setText(sprintf("%s", depArpt.getValue() ~ "/" ~ arrArpt.getValue()));
|
||||
me["Simple_R2"].setText("REQUEST ");
|
||||
me["Simple_R3"].setText("IRS INIT ");
|
||||
me["Simple_R5"].setText("WIND ");
|
||||
me["Simple_R6"].setText(sprintf("%5.0f", tropo.getValue()));
|
||||
me["Simple_R4"].setText("WIND ");
|
||||
me["Simple_R5"].setText(sprintf("%5.0f", tropo.getValue()));
|
||||
} else if (page == "IRSINIT") {
|
||||
if (!pageSwitch[i].getBoolValue()) {
|
||||
me["Simple"].show();
|
||||
|
@ -1340,17 +1356,17 @@ var canvas_MCDU_base = {
|
|||
minutes2 = sprintf("%.1f",abs((dms2 - degrees2) * 60));
|
||||
sign2 = degrees2 >= 0 ? "E" : "W";
|
||||
me["Simple_R2"].setText(abs(degrees2) ~ "g" ~ minutes2 ~ " " ~ sign2);
|
||||
if (getprop("/systems/navigation/adr/operating-1") and getprop("/FMGC/internal/align1-done")) {
|
||||
if (systems.ADIRS.ADIRunits[0].operative and getprop("/FMGC/internal/align1-done")) {
|
||||
me["Simple_C3"].setText(abs(degrees) ~ "g" ~ minutes ~ " " ~ sign ~ "/" ~ abs(degrees2) ~ "g" ~ minutes2 ~ " " ~ sign2);
|
||||
} else {
|
||||
me["Simple_C3"].setText("-----.--/-----.--");
|
||||
}
|
||||
if (getprop("/systems/navigation/adr/operating-2") and getprop("/FMGC/internal/align2-done")) {
|
||||
if (systems.ADIRS.ADIRunits[1].operative and getprop("/FMGC/internal/align2-done")) {
|
||||
me["Simple_C4"].setText(abs(degrees) ~ "g" ~ minutes ~ " " ~ sign ~ "/" ~ abs(degrees2) ~ "g" ~ minutes2 ~ " " ~ sign2);
|
||||
} else {
|
||||
me["Simple_C4"].setText("-----.--/-----.--");
|
||||
}
|
||||
if (getprop("/systems/navigation/adr/operating-3") and getprop("/FMGC/internal/align3-done")) {
|
||||
if (systems.ADIRS.ADIRunits[2].operative and getprop("/FMGC/internal/align3-done")) {
|
||||
me["Simple_C5"].setText(abs(degrees) ~ "g" ~ minutes ~ " " ~ sign ~ "/" ~ abs(degrees2) ~ "g" ~ minutes2 ~ " " ~ sign2);
|
||||
} else {
|
||||
me["Simple_C5"].setText("-----.--/-----.--");
|
||||
|
@ -1367,20 +1383,32 @@ var canvas_MCDU_base = {
|
|||
me.showRightArrow(0, 0, 0, 0, 0, 1);
|
||||
}
|
||||
|
||||
if (getprop("/systems/navigation/adr/operating-1") and systems.ADIRSnew.ADIRunits[0].inAlign == 0) {
|
||||
me["Simple_C3S"].setText("IRS1 ALIGNED ON GPS");
|
||||
if (systems.ADIRS.Operating.aligned[0].getValue()) {
|
||||
if (systems.ADIRS.ADIRunits[0].mode == 2) {
|
||||
me["Simple_C3S"].setText("IRS1 IN ATT");
|
||||
} else {
|
||||
me["Simple_C3S"].setText("IRS1 ALIGNED ON GPS");
|
||||
}
|
||||
} else {
|
||||
me["Simple_C3S"].setText("IRS1 ALIGNING ON GPS");
|
||||
}
|
||||
|
||||
if (getprop("/systems/navigation/adr/operating-2") and systems.ADIRSnew.ADIRunits[1].inAlign == 0) {
|
||||
me["Simple_C4S"].setText("IRS2 ALIGNED ON GPS");
|
||||
if (systems.ADIRS.Operating.aligned[1].getValue()) {
|
||||
if (systems.ADIRS.ADIRunits[1].mode == 2) {
|
||||
me["Simple_C4S"].setText("IRS2 IN ATT");
|
||||
} else {
|
||||
me["Simple_C4S"].setText("IRS2 ALIGNED ON GPS");
|
||||
}
|
||||
} else {
|
||||
me["Simple_C4S"].setText("IRS2 ALIGNING ON GPS");
|
||||
}
|
||||
|
||||
if (getprop("/systems/navigation/adr/operating-3") and systems.ADIRSnew.ADIRunits[2].inAlign == 0) {
|
||||
me["Simple_C5S"].setText("IRS3 ALIGNED ON GPS");
|
||||
if (systems.ADIRS.Operating.aligned[2].getValue()) {
|
||||
if (systems.ADIRS.ADIRunits[2].mode == 2) {
|
||||
me["Simple_C5S"].setText("IRS3 IN ATT");
|
||||
} else {
|
||||
me["Simple_C5S"].setText("IRS3 ALIGNED ON GPS");
|
||||
}
|
||||
} else {
|
||||
me["Simple_C5S"].setText("IRS3 ALIGNING ON GPS");
|
||||
}
|
||||
|
@ -1465,7 +1493,7 @@ var canvas_MCDU_base = {
|
|||
me["Simple_PageNum"].setText("X/X");
|
||||
me["Simple_PageNum"].hide();
|
||||
me["ArrowLeft"].show();
|
||||
me["ArrowRight"].hide();
|
||||
me["ArrowRight"].show();
|
||||
|
||||
me.showLeft(1, 1, 1, 1, 1, 1);
|
||||
me["Simple_L0S"].hide();
|
||||
|
@ -1602,7 +1630,7 @@ var canvas_MCDU_base = {
|
|||
me["Simple_PageNum"].setText("X/X");
|
||||
me["Simple_PageNum"].hide();
|
||||
me["ArrowLeft"].show();
|
||||
me["ArrowRight"].hide();
|
||||
me["ArrowRight"].show();
|
||||
|
||||
me.showLeft(1, 1, 1, 1, 1, 1);
|
||||
me["Simple_L0S"].hide();
|
||||
|
|
|
@ -34,11 +34,11 @@
|
|||
<object-name>FAC1Btn1F</object-name>
|
||||
<object-name>FAC1Btn2O</object-name>
|
||||
<object-name>IR1Btn1F</object-name>
|
||||
<object-name>IR1Btn2A</object-name>
|
||||
<object-name>IR1Btn2O</object-name>
|
||||
<object-name>IR2Btn1F</object-name>
|
||||
<object-name>IR2Btn2A</object-name>
|
||||
<object-name>IR2Btn2O</object-name>
|
||||
<object-name>IR3Btn1F</object-name>
|
||||
<object-name>IR3Btn2A</object-name>
|
||||
<object-name>IR3Btn2O</object-name>
|
||||
<object-name>RamAirBtn2O</object-name>
|
||||
<object-name>SEC1Btn1F</object-name>
|
||||
<object-name>SEC1Btn2O</object-name>
|
||||
|
@ -538,8 +538,8 @@
|
|||
<binding>
|
||||
<command>nasal</command>
|
||||
<script>
|
||||
if (systems.ADIRSnew.Switches.irModeSw[0].getValue() != 2) {
|
||||
systems.ADIRSControlPanel.irModeSw(0, systems.ADIRSnew.Switches.irModeSw[0].getValue() + 1);
|
||||
if (systems.ADIRS.Switches.irModeSw[0].getValue() != 2) {
|
||||
systems.ADIRSControlPanel.irModeSw(0, systems.ADIRS.Switches.irModeSw[0].getValue() + 1);
|
||||
} else {
|
||||
systems.ADIRSControlPanel.irModeSw(0, 0);
|
||||
}
|
||||
|
@ -557,8 +557,8 @@
|
|||
<binding>
|
||||
<command>nasal</command>
|
||||
<script>
|
||||
if (systems.ADIRSnew.Switches.irModeSw[0].getValue() != 0) {
|
||||
systems.ADIRSControlPanel.irModeSw(0, systems.ADIRSnew.Switches.irModeSw[0].getValue() - 1);
|
||||
if (systems.ADIRS.Switches.irModeSw[0].getValue() != 0) {
|
||||
systems.ADIRSControlPanel.irModeSw(0, systems.ADIRS.Switches.irModeSw[0].getValue() - 1);
|
||||
} else {
|
||||
systems.ADIRSControlPanel.irModeSw(0, 2);
|
||||
}
|
||||
|
@ -608,7 +608,7 @@
|
|||
</animation>
|
||||
<animation>
|
||||
<type>select</type>
|
||||
<object-name>IR1Btn2A</object-name>
|
||||
<object-name>IR1Btn2O</object-name>
|
||||
<condition>
|
||||
<or>
|
||||
<equals>
|
||||
|
@ -634,8 +634,8 @@
|
|||
<binding>
|
||||
<command>nasal</command>
|
||||
<script>
|
||||
if (systems.ADIRSnew.Switches.irModeSw[1].getValue() != 2) {
|
||||
systems.ADIRSControlPanel.irModeSw(1, systems.ADIRSnew.Switches.irModeSw[1].getValue() + 1);
|
||||
if (systems.ADIRS.Switches.irModeSw[1].getValue() != 2) {
|
||||
systems.ADIRSControlPanel.irModeSw(1, systems.ADIRS.Switches.irModeSw[1].getValue() + 1);
|
||||
} else {
|
||||
systems.ADIRSControlPanel.irModeSw(1, 0);
|
||||
}
|
||||
|
@ -653,8 +653,8 @@
|
|||
<binding>
|
||||
<command>nasal</command>
|
||||
<script>
|
||||
if (systems.ADIRSnew.Switches.irModeSw[1].getValue() != 0) {
|
||||
systems.ADIRSControlPanel.irModeSw(1, systems.ADIRSnew.Switches.irModeSw[1].getValue() - 1);
|
||||
if (systems.ADIRS.Switches.irModeSw[1].getValue() != 0) {
|
||||
systems.ADIRSControlPanel.irModeSw(1, systems.ADIRS.Switches.irModeSw[1].getValue() - 1);
|
||||
} else {
|
||||
systems.ADIRSControlPanel.irModeSw(1, 2);
|
||||
}
|
||||
|
@ -704,7 +704,7 @@
|
|||
</animation>
|
||||
<animation>
|
||||
<type>select</type>
|
||||
<object-name>IR2Btn2A</object-name>
|
||||
<object-name>IR2Btn2O</object-name>
|
||||
<condition>
|
||||
<or>
|
||||
<equals>
|
||||
|
@ -730,8 +730,8 @@
|
|||
<binding>
|
||||
<command>nasal</command>
|
||||
<script>
|
||||
if (systems.ADIRSnew.Switches.irModeSw[2].getValue() != 2) {
|
||||
systems.ADIRSControlPanel.irModeSw(2, systems.ADIRSnew.Switches.irModeSw[2].getValue() + 1);
|
||||
if (systems.ADIRS.Switches.irModeSw[2].getValue() != 2) {
|
||||
systems.ADIRSControlPanel.irModeSw(2, systems.ADIRS.Switches.irModeSw[2].getValue() + 1);
|
||||
} else {
|
||||
systems.ADIRSControlPanel.irModeSw(2, 0);
|
||||
}
|
||||
|
@ -749,8 +749,8 @@
|
|||
<binding>
|
||||
<command>nasal</command>
|
||||
<script>
|
||||
if (systems.ADIRSnew.Switches.irModeSw[2].getValue() != 0) {
|
||||
systems.ADIRSControlPanel.irModeSw(2, systems.ADIRSnew.Switches.irModeSw[2].getValue() - 1);
|
||||
if (systems.ADIRS.Switches.irModeSw[2].getValue() != 0) {
|
||||
systems.ADIRSControlPanel.irModeSw(2, systems.ADIRS.Switches.irModeSw[2].getValue() - 1);
|
||||
} else {
|
||||
systems.ADIRSControlPanel.irModeSw(2, 2);
|
||||
}
|
||||
|
@ -800,7 +800,7 @@
|
|||
</animation>
|
||||
<animation>
|
||||
<type>select</type>
|
||||
<object-name>IR3Btn2A</object-name>
|
||||
<object-name>IR3Btn2O</object-name>
|
||||
<condition>
|
||||
<or>
|
||||
<equals>
|
||||
|
|
|
@ -32096,13 +32096,13 @@ refs 4
|
|||
SURF 0X32
|
||||
mat 9
|
||||
refs 2
|
||||
129 0 0
|
||||
142 0 0
|
||||
128 0 0
|
||||
139 0 0
|
||||
SURF 0X32
|
||||
mat 9
|
||||
refs 2
|
||||
128 0 0
|
||||
139 0 0
|
||||
129 0 0
|
||||
142 0 0
|
||||
kids 0
|
||||
OBJECT poly
|
||||
name "Eng2FireTst"
|
||||
|
@ -43564,11 +43564,11 @@ refs 4
|
|||
4 0.5 0
|
||||
kids 0
|
||||
OBJECT poly
|
||||
name "IR1Btn2A"
|
||||
name "IR1Btn2O"
|
||||
data 9
|
||||
Cube.1025
|
||||
crease 30.0
|
||||
texture "buttons3.png"
|
||||
texture "buttons2.png"
|
||||
texrep 1 1
|
||||
numvert 8
|
||||
0.00773 0.19745 0.28598
|
||||
|
@ -44081,11 +44081,11 @@ refs 4
|
|||
6 0 0.5
|
||||
kids 0
|
||||
OBJECT poly
|
||||
name "IR2Btn2A"
|
||||
name "IR2Btn2O"
|
||||
data 9
|
||||
Cube.1029
|
||||
crease 30.0
|
||||
texture "buttons3.png"
|
||||
texture "buttons2.png"
|
||||
texrep 1 1
|
||||
numvert 8
|
||||
-0.00317 0.19745 0.19429
|
||||
|
@ -44690,11 +44690,11 @@ refs 4
|
|||
4 0.5 0
|
||||
kids 0
|
||||
OBJECT poly
|
||||
name "IR3Btn2A"
|
||||
name "IR3Btn2O"
|
||||
data 9
|
||||
Cube.1027
|
||||
crease 30.0
|
||||
texture "buttons3.png"
|
||||
texture "buttons2.png"
|
||||
texrep 1 1
|
||||
numvert 8
|
||||
-0.00046 0.20745 0.24088
|
||||
|
|
|
@ -1050,7 +1050,7 @@ var canvas_PFD_1 = {
|
|||
wow2_act = wow2.getValue();
|
||||
|
||||
# Errors
|
||||
if (systems.ADIRSnew.ADIRunits[0].aligned == 1 or (systems.ADIRSnew.ADIRunits[2].aligned == 1 and att_switch.getValue() == -1)) {
|
||||
if (systems.ADIRS.ADIRunits[0].aligned == 1 or (systems.ADIRS.ADIRunits[2].aligned == 1 and att_switch.getValue() == -1)) {
|
||||
me["AI_group"].show();
|
||||
me["HDG_group"].show();
|
||||
me["AI_error"].hide();
|
||||
|
@ -1788,7 +1788,7 @@ var canvas_PFD_2 = {
|
|||
wow2_act = wow2.getValue();
|
||||
|
||||
# Errors
|
||||
if (systems.ADIRSnew.ADIRunits[1].aligned == 1 or (systems.ADIRSnew.ADIRunits[2].aligned == 1 and att_switch.getValue() == 1)) {
|
||||
if (systems.ADIRS.ADIRunits[1].aligned == 1 or (systems.ADIRS.ADIRunits[2].aligned == 1 and att_switch.getValue() == 1)) {
|
||||
me["AI_group"].show();
|
||||
me["HDG_group"].show();
|
||||
me["AI_error"].hide();
|
||||
|
|
|
@ -47,7 +47,7 @@ var DMC = {
|
|||
me.outputs[6] = nil;
|
||||
},
|
||||
update: func() {
|
||||
if (systems.ADIRSnew.ADIRunits[me.activeADIRS].operative and systems.ADIRSnew.ADIRunits[me.activeADIRS].outputOn) {
|
||||
if (systems.ADIRS.ADIRunits[me.activeADIRS].operative and systems.ADIRS.ADIRunits[me.activeADIRS].outputOn) {
|
||||
if (me._set != 1) {
|
||||
me._setNil = 0;
|
||||
me.setOutputs(me.activeADIRS);
|
||||
|
|
|
@ -72,7 +72,7 @@ var messages_priority_3 = func {
|
|||
|
||||
if (getprop("systems/navigation/adr/computation/overspeed-vfe")) {
|
||||
overspeedFlap.active = 1;
|
||||
overspeedFlap.msg = "-VFE................" ~ (systems.ADIRSnew.overspeedVFE.getValue() - 4);
|
||||
overspeedFlap.msg = "-VFE................" ~ (systems.ADIRS.overspeedVFE.getValue() - 4);
|
||||
} else {
|
||||
ECAM_controller.warningReset(overspeedFlap);
|
||||
overspeedFlap.msg = "-VFE................XXX";
|
||||
|
@ -1214,7 +1214,7 @@ var messages_priority_2 = func {
|
|||
}
|
||||
|
||||
# APU AUTO SHUT DOWN
|
||||
if (apuEmerShutdown.clearFlag == 0 and systems.APUController.APU.signals.autoshutdown and !systems.APUController.APU.signals.emer and !getprop("systems/fire/apu/warning-active") and (phaseVar == 6 or phaseVar >= 9 or phaseVar <= 2)) {
|
||||
if (apuAutoShutdown.clearFlag == 0 and systems.APUController.APU.signals.autoshutdown and !systems.APUController.APU.signals.emer and !getprop("systems/fire/apu/warning-active") and (phaseVar == 6 or phaseVar >= 9 or phaseVar <= 2)) {
|
||||
apuAutoShutdown.active = 1;
|
||||
} elsif (apuAutoShutdown.clearFlag == 1) {
|
||||
ECAM_controller.warningReset(apuAutoShutdown);
|
||||
|
@ -1496,7 +1496,7 @@ var messages_memo = func {
|
|||
refuelg.active = 0;
|
||||
}
|
||||
|
||||
if ((phaseVar == 1 or phaseVar == 2) and toMemoLine1.active != 1 and ldgMemoLine1.active != 1 and (systems.ADIRSnew.ADIRunits[0].inAlign == 1 or systems.ADIRSnew.ADIRunits[1].inAlign == 1 or systems.ADIRSnew.ADIRunits[2].inAlign == 1)) {
|
||||
if ((phaseVar == 1 or phaseVar == 2) and toMemoLine1.active != 1 and ldgMemoLine1.active != 1 and (systems.ADIRS.ADIRunits[0].inAlign == 1 or systems.ADIRS.ADIRunits[1].inAlign == 1 or systems.ADIRS.ADIRunits[2].inAlign == 1)) {
|
||||
irs_in_align.active = 1;
|
||||
if (getprop("ECAM/phases/timer/eng1or2-output")) {
|
||||
irs_in_align.colour = "a";
|
||||
|
@ -1505,7 +1505,7 @@ var messages_memo = func {
|
|||
}
|
||||
|
||||
timeNow = pts.Sim.Time.elapsedSec.getValue();
|
||||
numberMinutes = math.round(math.max(systems.ADIRSnew.ADIRunits[0]._alignTime - timeNow, systems.ADIRSnew.ADIRunits[1]._alignTime - timeNow, systems.ADIRSnew.ADIRunits[2]._alignTime - timeNow) / 60);
|
||||
numberMinutes = math.round(math.max(systems.ADIRS.ADIRunits[0]._alignTime - timeNow, systems.ADIRS.ADIRunits[1]._alignTime - timeNow, systems.ADIRS.ADIRunits[2]._alignTime - timeNow) / 60);
|
||||
|
||||
if (numberMinutes >= 7) {
|
||||
irs_in_align.msg = "IRS IN ALIGN > 7 MN";
|
||||
|
|
|
@ -147,9 +147,9 @@ setlistener("/gear/gear[0]/wow-fmgc", func {
|
|||
});
|
||||
|
||||
var trimReset = func {
|
||||
gear0 = getprop("gear/gear[0]/wow");
|
||||
flaps = getprop("controls/flight/flap-pos");
|
||||
if (gear0 == 1 and getprop("FMGC/status/to-state") == 0 and (flaps >= 5 or (flaps >= 4 and getprop("instrumentation/mk-viii/inputs/discretes/momentary-flap3-override") == 1))) {
|
||||
gear0 = getprop("/gear/gear[0]/wow");
|
||||
flaps = getprop("/controls/flight/flap-pos");
|
||||
if (gear0 == 1 and getprop("/FMGC/status/to-state") == 0 and (flaps >= 5 or (flaps >= 4 and getprop("/instrumentation/mk-viii/inputs/discretes/momentary-flap3-override") == 1))) {
|
||||
interpolate("/controls/flight/elevator-trim", 0.0, 1.5);
|
||||
}
|
||||
}
|
||||
|
@ -159,19 +159,19 @@ var trimReset = func {
|
|||
###############
|
||||
|
||||
var updateARPT = func {
|
||||
dep = getprop("FMGC/internal/dep-arpt");
|
||||
arr = getprop("FMGC/internal/arr-arpt");
|
||||
alt = getprop("FMGC/internal/alt-airport");
|
||||
dep = getprop("/FMGC/internal/dep-arpt");
|
||||
arr = getprop("/FMGC/internal/arr-arpt");
|
||||
alt = getprop("/FMGC/internal/alt-airport");
|
||||
setprop("autopilot/route-manager/departure/airport", dep);
|
||||
setprop("autopilot/route-manager/destination/airport", arr);
|
||||
setprop("autopilot/route-manager/alternate/airport", alt);
|
||||
if (getprop("autopilot/route-manager/active") != 1) {
|
||||
if (getprop("/autopilot/route-manager/active") != 1) {
|
||||
fgcommand("activate-flightplan", props.Node.new({"activate": 1}));
|
||||
}
|
||||
}
|
||||
|
||||
setlistener("/FMGC/internal/cruise-ft", func {
|
||||
setprop("autopilot/route-manager/cruise/altitude-ft", getprop("FMGC/internal/cruise-ft"));
|
||||
setprop("autopilot/route-manager/cruise/altitude-ft", getprop("/FMGC/internal/cruise-ft"));
|
||||
});
|
||||
|
||||
########
|
||||
|
@ -235,48 +235,48 @@ var updateFuel = func {
|
|||
############################
|
||||
|
||||
var masterFMGC = maketimer(0.2, func {
|
||||
n1_left = getprop("engines/engine[0]/n1-actual");
|
||||
n1_right = getprop("engines/engine[1]/n1-actual");
|
||||
flaps = getprop("controls/flight/flap-pos");
|
||||
modelat = getprop("modes/pfd/fma/roll-mode");
|
||||
mode = getprop("modes/pfd/fma/pitch-mode");
|
||||
modeI = getprop("it-autoflight/mode/vert");
|
||||
gs = getprop("velocities/groundspeed-kt");
|
||||
alt = getprop("instrumentation/altimeter/indicated-altitude-ft");
|
||||
n1_left = getprop("/engines/engine[0]/n1-actual");
|
||||
n1_right = getprop("/engines/engine[1]/n1-actual");
|
||||
flaps = getprop("/controls/flight/flap-pos");
|
||||
modelat = getprop("/modes/pfd/fma/roll-mode");
|
||||
mode = getprop("/modes/pfd/fma/pitch-mode");
|
||||
modeI = getprop("/it-autoflight/mode/vert");
|
||||
gs = getprop("/velocities/groundspeed-kt");
|
||||
alt = getprop("/instrumentation/altimeter/indicated-altitude-ft");
|
||||
aglalt = pts.Position.gearAglFt.getValue();
|
||||
cruiseft = getprop("FMGC/internal/cruise-ft");
|
||||
cruiseft_b = getprop("FMGC/internal/cruise-ft") - 200;
|
||||
newcruise = getprop("it-autoflight/internal/alt");
|
||||
phase = getprop("FMGC/status/phase");
|
||||
state1 = getprop("systems/thrust/state1");
|
||||
state2 = getprop("systems/thrust/state2");
|
||||
wowl = getprop("gear/gear[1]/wow");
|
||||
wowr = getprop("gear/gear[2]/wow");
|
||||
targetalt = getprop("it-autoflight/internal/alt");
|
||||
targetvs = getprop("it-autoflight/input/vs");
|
||||
targetfpa = getprop("it-autoflight/input/fpa");
|
||||
accel_agl_ft = getprop("it-autoflight/settings/accel-agl-ft");
|
||||
locarm = getprop("it-autopilot/output/loc-armed");
|
||||
apprarm = getprop("it-autopilot/output/appr-armed");
|
||||
gear0 = getprop("gear/gear[0]/wow");
|
||||
ap1 = getprop("it-autoflight/output/ap1");
|
||||
ap2 = getprop("it-autoflight/output/ap2");
|
||||
flx = getprop("systems/thrust/lim-flex");
|
||||
lat = getprop("it-autoflight/mode/lat");
|
||||
newlat = getprop("modes/pfd/fma/roll-mode");
|
||||
vert = getprop("it-autoflight/mode/vert");
|
||||
newvert = getprop("modes/pfd/fma/pitch-mode");
|
||||
newvertarm = getprop("modes/pfd/fma/pitch-mode2-armed");
|
||||
thr1 = getprop("controls/engines/engine[0]/throttle-pos");
|
||||
thr2 = getprop("controls/engines/engine[1]/throttle-pos");
|
||||
gear0 = getprop("gear/gear[0]/wow");
|
||||
state1 = getprop("systems/thrust/state1");
|
||||
state2 = getprop("systems/thrust/state2");
|
||||
altSel = getprop("it-autoflight/input/alt");
|
||||
crzFl = getprop("FMGC/internal/cruise-fl");
|
||||
cruiseft = getprop("/FMGC/internal/cruise-ft");
|
||||
cruiseft_b = getprop("/FMGC/internal/cruise-ft") - 200;
|
||||
newcruise = getprop("/it-autoflight/internal/alt");
|
||||
phase = getprop("/FMGC/status/phase");
|
||||
state1 = getprop("/systems/thrust/state1");
|
||||
state2 = getprop("/systems/thrust/state2");
|
||||
wowl = getprop("/gear/gear[1]/wow");
|
||||
wowr = getprop("/gear/gear[2]/wow");
|
||||
targetalt = getprop("/it-autoflight/internal/alt");
|
||||
targetvs = getprop("/it-autoflight/input/vs");
|
||||
targetfpa = getprop("/it-autoflight/input/fpa");
|
||||
accel_agl_ft = getprop("/it-autoflight/settings/accel-agl-ft");
|
||||
locarm = getprop("/it-autopilot/output/loc-armed");
|
||||
apprarm = getprop("/it-autopilot/output/appr-armed");
|
||||
gear0 = getprop("/gear/gear[0]/wow");
|
||||
ap1 = getprop("/it-autoflight/output/ap1");
|
||||
ap2 = getprop("/it-autoflight/output/ap2");
|
||||
flx = getprop("/systems/thrust/lim-flex");
|
||||
lat = getprop("/it-autoflight/mode/lat");
|
||||
newlat = getprop("/modes/pfd/fma/roll-mode");
|
||||
vert = getprop("/it-autoflight/mode/vert");
|
||||
newvert = getprop("/modes/pfd/fma/pitch-mode");
|
||||
newvertarm = getprop("/modes/pfd/fma/pitch-mode2-armed");
|
||||
thr1 = getprop("/controls/engines/engine[0]/throttle-pos");
|
||||
thr2 = getprop("/controls/engines/engine[1]/throttle-pos");
|
||||
gear0 = getprop("/gear/gear[0]/wow");
|
||||
state1 = getprop("/systems/thrust/state1");
|
||||
state2 = getprop("/systems/thrust/state2");
|
||||
altSel = getprop("/it-autoflight/input/alt");
|
||||
crzFl = getprop("/FMGC/internal/cruise-fl");
|
||||
|
||||
if (getprop("gear/gear[0]/wow") != getprop("gear/gear[0]/wow-fmgc")) {
|
||||
setprop("gear/gear[0]/wow-fmgc", getprop("gear/gear[0]/wow"));
|
||||
if (getprop("/gear/gear[0]/wow") != getprop("/gear/gear[0]/wow-fmgc")) {
|
||||
setprop("gear/gear[0]/wow-fmgc", getprop("/gear/gear[0]/wow"));
|
||||
}
|
||||
|
||||
if ((n1_left < 85 or n1_right < 85) and gs < 90 and mode == " " and gear0 == 1 and phase == 1) { # rejected takeoff
|
||||
|
@ -331,21 +331,21 @@ var masterFMGC = maketimer(0.2, func {
|
|||
setprop("FMGC/status/phase", 2);
|
||||
}
|
||||
|
||||
if (getprop("systems/navigation/adr/computation/overspeed-vfe-spd") != 1024) {
|
||||
setprop("FMGC/internal/maxspeed", getprop("systems/navigation/adr/computation/overspeed-vfe-spd") - 4);
|
||||
if (getprop("/systems/navigation/adr/computation/overspeed-vfe-spd") != 1024) {
|
||||
setprop("FMGC/internal/maxspeed", getprop("/systems/navigation/adr/computation/overspeed-vfe-spd") - 4);
|
||||
} elsif (pts.Gear.position[0].getValue() != 0 or pts.Gear.position[1].getValue() != 0 or pts.Gear.position[2].getValue() != 0) {
|
||||
setprop("FMGC/internal/maxspeed", 284);
|
||||
} else {
|
||||
setprop("FMGC/internal/maxspeed", getprop("it-fbw/speeds/vmo-mmo"));
|
||||
setprop("FMGC/internal/maxspeed", getprop("/it-fbw/speeds/vmo-mmo"));
|
||||
}
|
||||
|
||||
# calculate speeds
|
||||
flap = getprop("controls/flight/flap-pos");
|
||||
weight_lbs = getprop("fdm/jsbsim/inertia/weight-lbs") / 1000;
|
||||
tow = getprop("FMGC/internal/tow");
|
||||
lw = getprop("FMGC/internal/lw");
|
||||
altitude = getprop("instrumentation/altimeter/indicated-altitude-ft");
|
||||
dest_wind = getprop("FMGC/internal/dest-wind");
|
||||
flap = getprop("/controls/flight/flap-pos");
|
||||
weight_lbs = getprop("/fdm/jsbsim/inertia/weight-lbs") / 1000;
|
||||
tow = getprop("/FMGC/internal/tow");
|
||||
lw = getprop("/FMGC/internal/lw");
|
||||
altitude = getprop("/instrumentation/altimeter/indicated-altitude-ft");
|
||||
dest_wind = getprop("/FMGC/internal/dest-wind");
|
||||
|
||||
# current appr speeds
|
||||
clean = 2 * weight_lbs * 0.45359237 + 85;
|
||||
|
@ -363,7 +363,7 @@ var masterFMGC = maketimer(0.2, func {
|
|||
flap2 = vs1g_conf_2 * 1.47;
|
||||
flap3 = vs1g_conf_3 * 1.36;
|
||||
|
||||
if (getprop("FMGC/internal/ldg-config-3-set")) {
|
||||
if (getprop("/FMGC/internal/ldg-config-3-set")) {
|
||||
vls = vs1g_conf_3 * 1.23;
|
||||
} else {
|
||||
vls = vs1g_conf_full * 1.23
|
||||
|
@ -373,7 +373,7 @@ var masterFMGC = maketimer(0.2, func {
|
|||
vls = 113;
|
||||
}
|
||||
|
||||
if (!getprop("FMGC/internal/vapp-speed-set")) {
|
||||
if (!getprop("/FMGC/internal/vapp-speed-set")) {
|
||||
if (dest_wind < 5) {
|
||||
vapp = vls + 5;
|
||||
} else if (dest_wind > 15) {
|
||||
|
@ -387,8 +387,8 @@ var masterFMGC = maketimer(0.2, func {
|
|||
aoa_prot = 15;
|
||||
aoa_max = 17.5;
|
||||
aoa_0 = -5;
|
||||
aoa = getprop("systems/navigation/adr/output/aoa-1");
|
||||
cas = getprop("systems/navigation/adr/output/cas-1");
|
||||
aoa = getprop("/systems/navigation/adr/output/aoa-1");
|
||||
cas = getprop("/systems/navigation/adr/output/cas-1");
|
||||
|
||||
alpha_prot = cas * math.sqrt((aoa - aoa_0)/(aoa_prot - aoa_0));
|
||||
alpha_max = cas * math.sqrt((aoa - aoa_0)/(aoa_max - aoa_0));
|
||||
|
@ -417,7 +417,7 @@ var masterFMGC = maketimer(0.2, func {
|
|||
slat_appr = vs1g_clean_appr * 1.23;
|
||||
flap2_appr = vs1g_conf_2_appr * 1.47;
|
||||
|
||||
if (getprop("FMGC/internal/ldg-config-3-set")) {
|
||||
if (getprop("/FMGC/internal/ldg-config-3-set")) {
|
||||
vls_appr = vs1g_conf_3_appr * 1.23;
|
||||
} else {
|
||||
vls_appr = vs1g_conf_full_appr * 1.23
|
||||
|
@ -427,7 +427,7 @@ var masterFMGC = maketimer(0.2, func {
|
|||
vls_appr = 113;
|
||||
}
|
||||
|
||||
if (!getprop("FMGC/internal/vapp-speed-set")) {
|
||||
if (!getprop("/FMGC/internal/vapp-speed-set")) {
|
||||
if (dest_wind < 5) {
|
||||
vapp_appr = vls_appr + 5;
|
||||
} else if (dest_wind > 15) {
|
||||
|
@ -472,7 +472,7 @@ var masterFMGC = maketimer(0.2, func {
|
|||
|
||||
# Need info on these, also correct for height at altitude...
|
||||
# https://www.pprune.org/archive/index.php/t-587639.html
|
||||
if (getprop("FMGC/status/to-state") == 1) {
|
||||
if (getprop("/FMGC/status/to-state") == 1) {
|
||||
if (flap == 0) { # 0
|
||||
setprop("FMGC/internal/computed-speeds/vls_min", vs1g_clean * 1.28);
|
||||
} else if (flap == 1) { # 1
|
||||
|
@ -535,31 +535,31 @@ var masterFMGC = maketimer(0.2, func {
|
|||
departure_rwy = fmgc.flightPlanController.flightplans[2].departure_runway;
|
||||
destination_rwy = fmgc.flightPlanController.flightplans[2].destination_runway;
|
||||
if (destination_rwy != nil and phase >= 2) {
|
||||
var airport = airportinfo(getprop("FMGC/internal/arr-arpt"));
|
||||
var airport = airportinfo(getprop("/FMGC/internal/arr-arpt"));
|
||||
setprop("FMGC/internal/ldg-elev", airport.elevation * M2FT); # eventually should be runway elevation
|
||||
magnetic_hdg = geo.normdeg(destination_rwy.heading - getprop("environment/magnetic-variation-deg"));
|
||||
magnetic_hdg = geo.normdeg(destination_rwy.heading - getprop("/environment/magnetic-variation-deg"));
|
||||
runway_ils = destination_rwy.ils_frequency_mhz;
|
||||
if (runway_ils != nil and !getprop("FMGC/internal/ils1freq-set") and !getprop("FMGC/internal/ils1crs-set")) {
|
||||
if (runway_ils != nil and !getprop("/FMGC/internal/ils1freq-set") and !getprop("/FMGC/internal/ils1crs-set")) {
|
||||
setprop("FMGC/internal/ils1freq-calculated", runway_ils);
|
||||
setprop("instrumentation/nav[0]/frequencies/selected-mhz", runway_ils);
|
||||
setprop("instrumentation/nav[0]/radials/selected-deg", magnetic_hdg);
|
||||
} else if (runway_ils != nil and !getprop("FMGC/internal/ils1freq-set")) {
|
||||
} else if (runway_ils != nil and !getprop("/FMGC/internal/ils1freq-set")) {
|
||||
setprop("FMGC/internal/ils1freq-calculated", runway_ils);
|
||||
setprop("instrumentation/nav[0]/frequencies/selected-mhz", runway_ils);
|
||||
} else if (!getprop("FMGC/internal/ils1crs-set")) {
|
||||
} else if (!getprop("/FMGC/internal/ils1crs-set")) {
|
||||
setprop("instrumentation/nav[0]/radials/selected-deg", magnetic_hdg);
|
||||
}
|
||||
} else if (departure_rwy != nil and phase <= 1) {
|
||||
magnetic_hdg = geo.normdeg(departure_rwy.heading - getprop("environment/magnetic-variation-deg"));
|
||||
magnetic_hdg = geo.normdeg(departure_rwy.heading - getprop("/environment/magnetic-variation-deg"));
|
||||
runway_ils = departure_rwy.ils_frequency_mhz;
|
||||
if (runway_ils != nil and !getprop("FMGC/internal/ils1freq-set") and !getprop("FMGC/internal/ils1crs-set")) {
|
||||
if (runway_ils != nil and !getprop("/FMGC/internal/ils1freq-set") and !getprop("/FMGC/internal/ils1crs-set")) {
|
||||
setprop("FMGC/internal/ils1freq-calculated", runway_ils);
|
||||
setprop("instrumentation/nav[0]/frequencies/selected-mhz", runway_ils);
|
||||
setprop("instrumentation/nav[0]/radials/selected-deg", magnetic_hdg);
|
||||
} else if (runway_ils != nil and !getprop("FMGC/internal/ils1freq-set")) {
|
||||
} else if (runway_ils != nil and !getprop("/FMGC/internal/ils1freq-set")) {
|
||||
setprop("FMGC/internal/ils1freq-calculated", runway_ils);
|
||||
setprop("instrumentation/nav[0]/frequencies/selected-mhz", runway_ils);
|
||||
} else if (!getprop("FMGC/internal/ils1crs-set")) {
|
||||
} else if (!getprop("/FMGC/internal/ils1crs-set")) {
|
||||
setprop("instrumentation/nav[0]/radials/selected-deg", magnetic_hdg);
|
||||
}
|
||||
}
|
||||
|
@ -567,11 +567,11 @@ var masterFMGC = maketimer(0.2, func {
|
|||
|
||||
var reset_FMGC = func {
|
||||
setprop("FMGC/status/phase", "0");
|
||||
fd1 = getprop("it-autoflight/input/fd1");
|
||||
fd2 = getprop("it-autoflight/input/fd2");
|
||||
spd = getprop("it-autoflight/input/spd-kts");
|
||||
hdg = getprop("it-autoflight/input/hdg");
|
||||
alt = getprop("it-autoflight/input/alt");
|
||||
fd1 = getprop("/it-autoflight/input/fd1");
|
||||
fd2 = getprop("/it-autoflight/input/fd2");
|
||||
spd = getprop("/it-autoflight/input/spd-kts");
|
||||
hdg = getprop("/it-autoflight/input/hdg");
|
||||
alt = getprop("/it-autoflight/input/alt");
|
||||
ITAF.init();
|
||||
FMGCinit();
|
||||
flightPlanController.reset();
|
||||
|
@ -591,7 +591,7 @@ var reset_FMGC = func {
|
|||
setprop("systems/pressurization/outflowpos", "0");
|
||||
setprop("systems/pressurization/deltap-norm", "0");
|
||||
setprop("systems/pressurization/outflowpos-norm", "0");
|
||||
altitude = getprop("instrumentation/altimeter/indicated-altitude-ft");
|
||||
altitude = getprop("/instrumentation/altimeter/indicated-altitude-ft");
|
||||
setprop("systems/pressurization/cabinalt", altitude);
|
||||
setprop("systems/pressurization/targetalt", altitude);
|
||||
setprop("systems/pressurization/diff-to-target", "0");
|
||||
|
@ -608,15 +608,15 @@ var reset_FMGC = func {
|
|||
}
|
||||
|
||||
var various = maketimer(1, func {
|
||||
if (getprop("engines/engine[0]/state") == 3 and getprop("engines/engine[1]/state") != 3) {
|
||||
setprop("it-autoflight/settings/accel-agl-ft", getprop("FMGC/internal/eng-out-reduc"));
|
||||
} else if (getprop("engines/engine[0]/state") != 3 and getprop("engines/engine[1]/state") == 3) {
|
||||
setprop("it-autoflight/settings/accel-agl-ft", getprop("FMGC/internal/eng-out-reduc"));
|
||||
if (getprop("/engines/engine[0]/state") == 3 and getprop("/engines/engine[1]/state") != 3) {
|
||||
setprop("it-autoflight/settings/accel-agl-ft", getprop("/FMGC/internal/eng-out-reduc"));
|
||||
} else if (getprop("/engines/engine[0]/state") != 3 and getprop("/engines/engine[1]/state") == 3) {
|
||||
setprop("it-autoflight/settings/accel-agl-ft", getprop("/FMGC/internal/eng-out-reduc"));
|
||||
} else {
|
||||
setprop("it-autoflight/settings/accel-agl-ft", getprop("FMGC/internal/accel-agl-ft"));
|
||||
setprop("it-autoflight/settings/accel-agl-ft", getprop("/FMGC/internal/accel-agl-ft"));
|
||||
}
|
||||
|
||||
setprop("FMGC/internal/gw", math.round(getprop("fdm/jsbsim/inertia/weight-lbs"), 100));
|
||||
setprop("FMGC/internal/gw", math.round(getprop("/fdm/jsbsim/inertia/weight-lbs"), 100));
|
||||
});
|
||||
|
||||
var various2 = maketimer(0.5, func {
|
||||
|
@ -629,9 +629,9 @@ var various2 = maketimer(0.5, func {
|
|||
});
|
||||
|
||||
var nav0 = func {
|
||||
var freqnav0uf = getprop("instrumentation/nav[0]/frequencies/selected-mhz");
|
||||
var freqnav0uf = getprop("/instrumentation/nav[0]/frequencies/selected-mhz");
|
||||
var freqnav0 = sprintf("%.2f", freqnav0uf);
|
||||
var namenav0 = getprop("instrumentation/nav[0]/nav-id");
|
||||
var namenav0 = getprop("/instrumentation/nav[0]/nav-id");
|
||||
if (freqnav0 >= 108.10 and freqnav0 <= 111.95) {
|
||||
if (namenav0 != "") {
|
||||
setprop("FMGC/internal/ils1-mcdu", namenav0 ~ "/" ~ freqnav0);
|
||||
|
@ -642,9 +642,9 @@ var nav0 = func {
|
|||
}
|
||||
|
||||
var nav1 = func {
|
||||
var freqnav1uf = getprop("instrumentation/nav[1]/frequencies/selected-mhz");
|
||||
var freqnav1uf = getprop("/instrumentation/nav[1]/frequencies/selected-mhz");
|
||||
var freqnav1 = sprintf("%.2f", freqnav1uf);
|
||||
var namenav1 = getprop("instrumentation/nav[1]/nav-id");
|
||||
var namenav1 = getprop("/instrumentation/nav[1]/nav-id");
|
||||
if (freqnav1 >= 108.10 and freqnav1 <= 111.95) {
|
||||
if (namenav1 != "") {
|
||||
setprop("FMGC/internal/ils2-mcdu", freqnav1 ~ "/" ~ namenav1);
|
||||
|
@ -655,9 +655,9 @@ var nav1 = func {
|
|||
}
|
||||
|
||||
var nav2 = func {
|
||||
var freqnav2uf = getprop("instrumentation/nav[2]/frequencies/selected-mhz");
|
||||
var freqnav2uf = getprop("/instrumentation/nav[2]/frequencies/selected-mhz");
|
||||
var freqnav2 = sprintf("%.2f", freqnav2uf);
|
||||
var namenav2 = getprop("instrumentation/nav[2]/nav-id");
|
||||
var namenav2 = getprop("/instrumentation/nav[2]/nav-id");
|
||||
if (freqnav2 >= 108.00 and freqnav2 <= 117.95) {
|
||||
if (namenav2 != "") {
|
||||
setprop("FMGC/internal/vor1-mcdu", namenav2 ~ "/" ~ freqnav2);
|
||||
|
@ -668,9 +668,9 @@ var nav2 = func {
|
|||
}
|
||||
|
||||
var nav3 = func {
|
||||
var freqnav3uf = getprop("instrumentation/nav[3]/frequencies/selected-mhz");
|
||||
var freqnav3uf = getprop("/instrumentation/nav[3]/frequencies/selected-mhz");
|
||||
var freqnav3 = sprintf("%.2f", freqnav3uf);
|
||||
var namenav3 = getprop("instrumentation/nav[3]/nav-id");
|
||||
var namenav3 = getprop("/instrumentation/nav[3]/nav-id");
|
||||
if (freqnav3 >= 108.00 and freqnav3 <= 117.95) {
|
||||
if (namenav3 != "") {
|
||||
setprop("FMGC/internal/vor2-mcdu", freqnav3 ~ "/" ~ namenav3);
|
||||
|
@ -681,9 +681,9 @@ var nav3 = func {
|
|||
}
|
||||
|
||||
var adf0 = func {
|
||||
var freqadf0uf = getprop("instrumentation/adf[0]/frequencies/selected-khz");
|
||||
var freqadf0uf = getprop("/instrumentation/adf[0]/frequencies/selected-khz");
|
||||
var freqadf0 = sprintf("%.2f", freqadf0uf);
|
||||
var nameadf0 = getprop("instrumentation/adf[0]/ident");
|
||||
var nameadf0 = getprop("/instrumentation/adf[0]/ident");
|
||||
if (freqadf0 >= 190 and freqadf0 <= 1750) {
|
||||
if (nameadf0 != "") {
|
||||
setprop("FMGC/internal/adf1-mcdu", nameadf0 ~ "/" ~ freqadf0);
|
||||
|
@ -694,9 +694,9 @@ var adf0 = func {
|
|||
}
|
||||
|
||||
var adf1 = func {
|
||||
var freqadf1uf = getprop("instrumentation/adf[1]/frequencies/selected-khz");
|
||||
var freqadf1uf = getprop("/instrumentation/adf[1]/frequencies/selected-khz");
|
||||
var freqadf1 = sprintf("%.2f", freqadf1uf);
|
||||
var nameadf1 = getprop("instrumentation/adf[1]/ident");
|
||||
var nameadf1 = getprop("/instrumentation/adf[1]/ident");
|
||||
if (freqadf1 >= 190 and freqadf1 <= 1750) {
|
||||
if (nameadf1 != "") {
|
||||
setprop("FMGC/internal/adf2-mcdu", freqadf1 ~ "/" ~ nameadf1);
|
||||
|
@ -711,30 +711,30 @@ var adf1 = func {
|
|||
#################
|
||||
|
||||
var ManagedSPD = maketimer(0.25, func {
|
||||
if (getprop("FMGC/internal/cruise-lvl-set") == 1 and getprop("FMGC/internal/cost-index-set") == 1) {
|
||||
if (getprop("it-autoflight/input/spd-managed") == 1) {
|
||||
altitude = getprop("instrumentation/altimeter/indicated-altitude-ft");
|
||||
mode = getprop("modes/pfd/fma/pitch-mode");
|
||||
ias = getprop("instrumentation/airspeed-indicator/indicated-speed-kt");
|
||||
mach = getprop("instrumentation/airspeed-indicator/indicated-mach");
|
||||
ktsmach = getprop("it-autoflight/input/kts-mach");
|
||||
mngktsmach = getprop("FMGC/internal/mng-kts-mach");
|
||||
mng_spd = getprop("FMGC/internal/mng-spd");
|
||||
mng_spd_cmd = getprop("FMGC/internal/mng-spd-cmd");
|
||||
kts_sel = getprop("it-autoflight/input/spd-kts");
|
||||
mach_sel = getprop("it-autoflight/input/spd-mach");
|
||||
srsSPD = getprop("it-autoflight/settings/togaspd");
|
||||
phase = getprop("FMGC/status/phase"); # 0 is Preflight 1 is Takeoff 2 is Climb 3 is Cruise 4 is Descent 5 is Decel/Approach 6 is Go Around 7 is Done
|
||||
flap = getprop("controls/flight/flap-pos");
|
||||
maxspeed = getprop("FMGC/internal/maxspeed");
|
||||
minspeed = getprop("FMGC/internal/minspeed");
|
||||
mach_switchover = getprop("FMGC/internal/mach-switchover");
|
||||
decel = getprop("FMGC/internal/decel");
|
||||
if (getprop("/FMGC/internal/cruise-lvl-set") == 1 and getprop("/FMGC/internal/cost-index-set") == 1) {
|
||||
if (getprop("/it-autoflight/input/spd-managed") == 1) {
|
||||
altitude = getprop("/instrumentation/altimeter/indicated-altitude-ft");
|
||||
mode = getprop("/modes/pfd/fma/pitch-mode");
|
||||
ias = getprop("/instrumentation/airspeed-indicator/indicated-speed-kt");
|
||||
mach = getprop("/instrumentation/airspeed-indicator/indicated-mach");
|
||||
ktsmach = getprop("/it-autoflight/input/kts-mach");
|
||||
mngktsmach = getprop("/FMGC/internal/mng-kts-mach");
|
||||
mng_spd = getprop("/FMGC/internal/mng-spd");
|
||||
mng_spd_cmd = getprop("/FMGC/internal/mng-spd-cmd");
|
||||
kts_sel = getprop("/it-autoflight/input/spd-kts");
|
||||
mach_sel = getprop("/it-autoflight/input/spd-mach");
|
||||
srsSPD = getprop("/it-autoflight/settings/togaspd");
|
||||
phase = getprop("/FMGC/status/phase"); # 0 is Preflight 1 is Takeoff 2 is Climb 3 is Cruise 4 is Descent 5 is Decel/Approach 6 is Go Around 7 is Done
|
||||
flap = getprop("/controls/flight/flap-pos");
|
||||
maxspeed = getprop("/FMGC/internal/maxspeed");
|
||||
minspeed = getprop("/FMGC/internal/minspeed");
|
||||
mach_switchover = getprop("/FMGC/internal/mach-switchover");
|
||||
decel = getprop("/FMGC/internal/decel");
|
||||
|
||||
mng_alt_spd_cmd = getprop("FMGC/internal/mng-alt-spd");
|
||||
mng_alt_spd_cmd = getprop("/FMGC/internal/mng-alt-spd");
|
||||
mng_alt_spd = math.round(mng_alt_spd_cmd, 1);
|
||||
|
||||
mng_alt_mach_cmd = getprop("FMGC/internal/mng-alt-mach");
|
||||
mng_alt_mach_cmd = getprop("/FMGC/internal/mng-alt-mach");
|
||||
mng_alt_mach = math.round(mng_alt_mach_cmd, 0.001);
|
||||
|
||||
if (mach > mng_alt_mach and (phase == 2 or phase == 3)) {
|
||||
|
@ -809,7 +809,7 @@ var ManagedSPD = maketimer(0.25, func {
|
|||
}
|
||||
}
|
||||
|
||||
mng_spd_cmd = getprop("FMGC/internal/mng-spd-cmd");
|
||||
mng_spd_cmd = getprop("/FMGC/internal/mng-spd-cmd");
|
||||
|
||||
if (mng_spd_cmd > maxspeed -5) {
|
||||
setprop("FMGC/internal/mng-spd", maxspeed -5);
|
||||
|
@ -823,7 +823,7 @@ var ManagedSPD = maketimer(0.25, func {
|
|||
setprop("it-autoflight/input/kts-mach", 1);
|
||||
}
|
||||
|
||||
mng_spd = getprop("FMGC/internal/mng-spd");
|
||||
mng_spd = getprop("/FMGC/internal/mng-spd");
|
||||
|
||||
if (kts_sel != mng_spd and !ktsmach) {
|
||||
setprop("it-autoflight/input/spd-kts", mng_spd);
|
||||
|
@ -840,10 +840,10 @@ var ManagedSPD = maketimer(0.25, func {
|
|||
});
|
||||
|
||||
var switchDatabase = func {
|
||||
database1 = getprop("FMGC/internal/navdatabase");
|
||||
database2 = getprop("FMGC/internal/navdatabase2");
|
||||
code1 = getprop("FMGC/internal/navdatabasecode");
|
||||
code2 = getprop("FMGC/internal/navdatabasecode2");
|
||||
database1 = getprop("/FMGC/internal/navdatabase");
|
||||
database2 = getprop("/FMGC/internal/navdatabase2");
|
||||
code1 = getprop("/FMGC/internal/navdatabasecode");
|
||||
code2 = getprop("/FMGC/internal/navdatabasecode2");
|
||||
setprop("FMGC/internal/navdatabase", database2);
|
||||
setprop("FMGC/internal/navdatabase2", database1);
|
||||
setprop("FMGC/internal/navdatabasecode", code2);
|
||||
|
@ -852,12 +852,12 @@ var switchDatabase = func {
|
|||
|
||||
# Landing to phase 7
|
||||
setlistener("gear/gear[1]/wow", func() {
|
||||
if (getprop("gear/gear[1]/wow") == 0 and timer30secLanding.isRunning) {
|
||||
if (getprop("/gear/gear[1]/wow") == 0 and timer30secLanding.isRunning) {
|
||||
timer30secLanding.stop();
|
||||
setprop("FMGC/internal/landing-time", -99);
|
||||
}
|
||||
|
||||
if (getprop("gear/gear[1]/wow") == 1 and getprop("FMGC/internal/landing-time") == -99) {
|
||||
if (getprop("/gear/gear[1]/wow") == 1 and getprop("/FMGC/internal/landing-time") == -99) {
|
||||
timer30secLanding.start();
|
||||
setprop("FMGC/internal/landing-time", pts.Sim.Time.elapsedSec.getValue());
|
||||
}
|
||||
|
@ -869,7 +869,7 @@ setlistener("systems/navigation/adr/operating-1", func() {
|
|||
timer48gpsAlign1.stop();
|
||||
}
|
||||
|
||||
if (getprop("FMGC/internal/align1-time") == -99) {
|
||||
if (getprop("/FMGC/internal/align1-time") == -99) {
|
||||
timer48gpsAlign1.start();
|
||||
setprop("FMGC/internal/align1-time", pts.Sim.Time.elapsedSec.getValue());
|
||||
}
|
||||
|
@ -881,7 +881,7 @@ setlistener("systems/navigation/adr/operating-2", func() {
|
|||
timer48gpsAlign2.stop();
|
||||
}
|
||||
|
||||
if (getprop("FMGC/internal/align2-time") == -99) {
|
||||
if (getprop("/FMGC/internal/align2-time") == -99) {
|
||||
timer48gpsAlign2.start();
|
||||
setprop("FMGC/internal/align2-time", pts.Sim.Time.elapsedSec.getValue());
|
||||
}
|
||||
|
@ -893,7 +893,7 @@ setlistener("systems/navigation/adr/operating-3", func() {
|
|||
timer48gpsAlign3.stop();
|
||||
}
|
||||
|
||||
if (getprop("FMGC/internal/align3-time") == -99) {
|
||||
if (getprop("/FMGC/internal/align3-time") == -99) {
|
||||
timer48gpsAlign3.start();
|
||||
setprop("FMGC/internal/align3-time", pts.Sim.Time.elapsedSec.getValue());
|
||||
}
|
||||
|
@ -902,7 +902,7 @@ setlistener("systems/navigation/adr/operating-3", func() {
|
|||
# Maketimers
|
||||
|
||||
var timer30secLanding = maketimer(1, func() {
|
||||
if (pts.Sim.Time.elapsedSec.getValue() > getprop("FMGC/internal/landing-time") + 30) {
|
||||
if (pts.Sim.Time.elapsedSec.getValue() > getprop("/FMGC/internal/landing-time") + 30) {
|
||||
setprop("FMGC/status/phase", 7);
|
||||
setprop("FMGC/internal/landing-time", -99);
|
||||
timer30secLanding.stop();
|
||||
|
@ -910,7 +910,7 @@ var timer30secLanding = maketimer(1, func() {
|
|||
});
|
||||
|
||||
var timer48gpsAlign1 = maketimer(1, func() {
|
||||
if (pts.Sim.Time.elapsedSec.getValue() > getprop("FMGC/internal/align1-time") + 48) {
|
||||
if (pts.Sim.Time.elapsedSec.getValue() > getprop("/FMGC/internal/align1-time") + 48 or getprop("/systems/acconfig/options/adirs-skip")) {
|
||||
setprop("FMGC/internal/align1-done", 1);
|
||||
setprop("FMGC/internal/align1-time", -99);
|
||||
timer48gpsAlign1.stop();
|
||||
|
@ -918,7 +918,7 @@ var timer48gpsAlign1 = maketimer(1, func() {
|
|||
});
|
||||
|
||||
var timer48gpsAlign2 = maketimer(1, func() {
|
||||
if (pts.Sim.Time.elapsedSec.getValue() > getprop("FMGC/internal/align2-time") + 48) {
|
||||
if (pts.Sim.Time.elapsedSec.getValue() > getprop("/FMGC/internal/align2-time") + 48 or getprop("/systems/acconfig/options/adirs-skip")) {
|
||||
setprop("FMGC/internal/align2-done", 1);
|
||||
setprop("FMGC/internal/align2-time", -99);
|
||||
timer48gpsAlign2.stop();
|
||||
|
@ -926,7 +926,7 @@ var timer48gpsAlign2 = maketimer(1, func() {
|
|||
});
|
||||
|
||||
var timer48gpsAlign3 = maketimer(1, func() {
|
||||
if (pts.Sim.Time.elapsedSec.getValue() > getprop("FMGC/internal/align3-time") + 48) {
|
||||
if (pts.Sim.Time.elapsedSec.getValue() > getprop("/FMGC/internal/align3-time") + 48 or getprop("/systems/acconfig/options/adirs-skip")) {
|
||||
setprop("FMGC/internal/align3-done", 1);
|
||||
setprop("FMGC/internal/align3-time", -99);
|
||||
timer48gpsAlign3.stop();
|
||||
|
|
|
@ -201,7 +201,6 @@ var systemsInit = func {
|
|||
systems.HYD.init();
|
||||
systems.FUEL.init();
|
||||
systems.ADIRS.init();
|
||||
systems.ADIRSnew.init();
|
||||
systems.eng_init();
|
||||
systems.APUController.init();
|
||||
systems.fire_init();
|
||||
|
@ -236,7 +235,7 @@ var systemsLoop = maketimer(0.1, func {
|
|||
systems.PNEU.loop();
|
||||
systems.HYD.loop();
|
||||
systems.FUEL.loop();
|
||||
systems.ADIRSnew.loop();
|
||||
systems.ADIRS.loop();
|
||||
libraries.ECAM.loop();
|
||||
libraries.BUTTONS.update();
|
||||
fadec.FADEC.loop();
|
||||
|
|
|
@ -190,7 +190,7 @@ var initInputA = func(key, i) {
|
|||
}
|
||||
} else if (key == "R3") {
|
||||
setprop("MCDU[" ~ i ~ "]/page", "IRSINIT");
|
||||
} else if (key == "R6") {
|
||||
} else if (key == "R5") {
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("FMGC/internal/tropo", 36090);
|
||||
setprop("FMGC/internal/tropo-set", 0);
|
||||
|
@ -206,5 +206,17 @@ var initInputA = func(key, i) {
|
|||
notAllowed(i);
|
||||
}
|
||||
}
|
||||
} else if (key == "R6") {
|
||||
if (scratchpad == "CLR") {
|
||||
setprop("FMGC/internal/gndtemp-set", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
} else if (int(scratchpad) != nil and getprop("FMGC/status/phase") == 0 and size(scratchpad) >= 1 and size(scratchpad) <= 3 and scratchpad >= -99 and scratchpad <= 99) {
|
||||
setprop("FMGC/internal/gndtemp", scratchpad);
|
||||
setprop("FMGC/internal/gndtemp-set", 1);
|
||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
||||
} else {
|
||||
notAllowed(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -529,7 +529,9 @@ var rskbutton = func(btn, i) {
|
|||
notAllowed(i);
|
||||
}
|
||||
} else if (btn == "5") {
|
||||
if (getprop("MCDU[" ~ i ~ "]/page") == "INITB") {
|
||||
if (getprop("MCDU[" ~ i ~ "]/page") == "INITA") {
|
||||
initInputA("R5",i);
|
||||
} else if (getprop("MCDU[" ~ i ~ "]/page") == "INITB") {
|
||||
initInputB("R5",i);
|
||||
} else if (getprop("MCDU[" ~ i ~ "]/page") == "PERFTO") {
|
||||
perfTOInput("R5",i);
|
||||
|
@ -607,6 +609,12 @@ var arrowbutton = func(btn, i) {
|
|||
setprop("MCDU[" ~ i ~ "]/page", "DATA2");
|
||||
} else if (getprop("MCDU[" ~ i ~ "]/page") == "DATA2") {
|
||||
setprop("MCDU[" ~ i ~ "]/page", "DATA");
|
||||
} else if (getprop("MCDU[" ~ i ~ "]/page") == "INITA") {
|
||||
if (getprop("engines/engine[0]/state") != 3 and getprop("engines/engine[1]/state") != 3) {
|
||||
setprop("MCDU[" ~ i ~ "]/page", "INITB");
|
||||
} else {
|
||||
setprop("MCDU[" ~ i ~ "]/page", "FUELPRED");
|
||||
}
|
||||
} else if (getprop("MCDU[" ~ i ~ "]/page") == "INITB" or getprop("MCDU[" ~ i ~ "]/page") == "FUELPRED") {
|
||||
setprop("MCDU[" ~ i ~ "]/page", "INITA");
|
||||
} else if (getprop("MCDU[" ~ i ~ "]/page") == "PRINTFUNC") {
|
||||
|
@ -629,6 +637,8 @@ var arrowbutton = func(btn, i) {
|
|||
} else {
|
||||
setprop("MCDU[" ~ i ~ "]/page", "FUELPRED");
|
||||
}
|
||||
} else if (getprop("MCDU[" ~ i ~ "]/page") == "INITB" or getprop("MCDU[" ~ i ~ "]/page") == "FUELPRED") {
|
||||
setprop("MCDU[" ~ i ~ "]/page", "INITA");
|
||||
} else if (getprop("MCDU[" ~ i ~ "]/page") == "PRINTFUNC") {
|
||||
setprop("MCDU[" ~ i ~ "]/page", "PRINTFUNC2");
|
||||
} else if (getprop("MCDU[" ~ i ~ "]/page") == "PRINTFUNC2") {
|
||||
|
|
|
@ -1,19 +0,0 @@
|
|||
# A3XX ADIRS System
|
||||
# Joshua Davidson (Octal450)
|
||||
|
||||
# Copyright (c) 2020 Josh Davidson (Octal450)
|
||||
var ADIRS = {
|
||||
init: func() {
|
||||
setprop("controls/adirs/mcdu/mode1", ""); # INVAL ALIGN NAV ATT or off (blank)
|
||||
setprop("controls/adirs/mcdu/mode2", "");
|
||||
setprop("controls/adirs/mcdu/mode3", "");
|
||||
setprop("controls/adirs/mcdu/status1", ""); # see smith thales p487
|
||||
setprop("controls/adirs/mcdu/status2", "");
|
||||
setprop("controls/adirs/mcdu/status3", "");
|
||||
setprop("controls/adirs/mcdu/hdg", ""); # only shown if in ATT mode
|
||||
setprop("controls/adirs/mcdu/avgdrift1", "");
|
||||
setprop("controls/adirs/mcdu/avgdrift2", "");
|
||||
setprop("controls/adirs/mcdu/avgdrift3", "");
|
||||
setprop("controls/adirs/mcducbtn", 0);
|
||||
},
|
||||
};
|
|
@ -22,7 +22,7 @@ var ADIRU = {
|
|||
num: 0,
|
||||
aligned: 0,
|
||||
inAlign: 0,
|
||||
outputOn: 0, # 0 = disc, 1 = normal
|
||||
outputOn: 1, # 0 = disc, 1 = normal
|
||||
mode: 0, # 0 = off, 1 = nav, 2 = att
|
||||
energised: 0, # 0 = off, 1 = on
|
||||
operative: 0, # 0 = off,
|
||||
|
@ -61,34 +61,34 @@ var ADIRU = {
|
|||
},
|
||||
# BITE
|
||||
selfTest: func() {
|
||||
ADIRSnew._selfTest = 1;
|
||||
ADIRS._selfTest = 1;
|
||||
_selfTestTime = pts.Sim.Time.elapsedSec.getValue();
|
||||
|
||||
ADIRSnew.Lights.adrOff[me.num].setValue(1);
|
||||
ADIRSnew.Lights.adrFault[me.num].setValue(1);
|
||||
ADIRS.Lights.adrOff[me.num].setValue(1);
|
||||
ADIRS.Lights.adrFault[me.num].setValue(1);
|
||||
settimer(func() {
|
||||
ADIRSnew.Lights.adrOff[me.num].setValue(0);
|
||||
ADIRSnew.Lights.adrFault[me.num].setValue(0);
|
||||
ADIRS.Lights.adrOff[me.num].setValue(0);
|
||||
ADIRS.Lights.adrFault[me.num].setValue(0);
|
||||
}, 0.1);
|
||||
settimer(func() {
|
||||
ADIRSnew.Lights.adrOff[me.num].setValue(1);
|
||||
ADIRSnew.Lights.adrFault[me.num].setValue(1);
|
||||
ADIRSnew.Lights.irFault[me.num].setValue(1);
|
||||
ADIRSnew.Lights.irOff[me.num].setValue(1);
|
||||
ADIRS.Lights.adrOff[me.num].setValue(1);
|
||||
ADIRS.Lights.adrFault[me.num].setValue(1);
|
||||
ADIRS.Lights.irFault[me.num].setValue(1);
|
||||
ADIRS.Lights.irOff[me.num].setValue(1);
|
||||
}, 1.0);
|
||||
settimer(func() {
|
||||
ADIRSnew.Lights.adrOff[me.num].setValue(0);
|
||||
ADIRSnew.Lights.adrFault[me.num].setValue(0);
|
||||
ADIRSnew.Lights.irFault[me.num].setValue(0);
|
||||
ADIRSnew.Lights.irOff[me.num].setValue(0);
|
||||
ADIRS.Lights.adrOff[me.num].setValue(!ADIRS.Switches.adrSw[me.num].getValue());
|
||||
ADIRS.Lights.adrFault[me.num].setValue(0);
|
||||
ADIRS.Lights.irFault[me.num].setValue(0);
|
||||
ADIRS.Lights.irOff[me.num].setValue(0);
|
||||
}, 1.1);
|
||||
|
||||
ADIRSnew.selfTest();
|
||||
ADIRS.selfTest();
|
||||
},
|
||||
# Alignment
|
||||
align: func(time) {
|
||||
ADIRSnew.Lights.irFault[me.num].setBoolValue(0);
|
||||
if (!ADIRSnew.skip.getValue()) {
|
||||
ADIRS.Lights.irFault[me.num].setBoolValue(0);
|
||||
if (!ADIRS.skip.getValue()) {
|
||||
if (time > 0 and me.aligned == 0 and me.inAlign == 0 and me.operative == 1) {
|
||||
me._alignTime = pts.Sim.Time.elapsedSec.getValue() + time;
|
||||
me.inAlign = 1;
|
||||
|
@ -110,7 +110,7 @@ var ADIRU = {
|
|||
print("Stopping alignment or setting unaligned state");
|
||||
me.inAlign = 0;
|
||||
me.aligned = 0;
|
||||
setprop("systems/navigation/aligned-" ~ (me.num + 1), 0);
|
||||
ADIRS.Operating.aligned[me.num].setValue(0);
|
||||
if (me.alignTimer != nil) {
|
||||
me.alignTimer.stop();
|
||||
}
|
||||
|
@ -118,7 +118,7 @@ var ADIRU = {
|
|||
stopAlignAligned: func() {
|
||||
me.inAlign = 0;
|
||||
me.aligned = 1;
|
||||
setprop("systems/navigation/aligned-" ~ (me.num + 1), 1);
|
||||
ADIRS.Operating.aligned[me.num].setValue(1);
|
||||
if (me.alignTimer != nil) {
|
||||
me.alignTimer.stop();
|
||||
}
|
||||
|
@ -154,26 +154,26 @@ var ADIRU = {
|
|||
if (me._voltageMain) {
|
||||
me._noPowerTime = 0;
|
||||
me.setOperative(1);
|
||||
if (!ADIRSnew._selfTest) {
|
||||
ADIRSnew.Lights.onBat.setBoolValue(0);
|
||||
if (!ADIRS._selfTest) {
|
||||
ADIRS.Lights.onBat.setBoolValue(0);
|
||||
}
|
||||
} elsif (((me._timeVar < me._noPowerTime + 300 and me._voltageLimitedTime) or !me._voltageLimitedTime) and me._voltageBackup) {
|
||||
me.setOperative(1);
|
||||
if (!ADIRSnew._selfTest) {
|
||||
ADIRSnew.Lights.onBat.setBoolValue(1);
|
||||
if (!ADIRS._selfTest) {
|
||||
ADIRS.Lights.onBat.setBoolValue(1);
|
||||
}
|
||||
} else {
|
||||
me._noPowerTime = 0;
|
||||
me.setOperative(0);
|
||||
if (!ADIRSnew._selfTest) {
|
||||
ADIRSnew.Lights.onBat.setBoolValue(0);
|
||||
if (!ADIRS._selfTest) {
|
||||
ADIRS.Lights.onBat.setBoolValue(0);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
me._noPowerTime = 0;
|
||||
me.setOperative(0);
|
||||
if (!ADIRSnew._selfTest) {
|
||||
ADIRSnew.Lights.onBat.setBoolValue(0);
|
||||
if (!ADIRS._selfTest) {
|
||||
ADIRS.Lights.onBat.setBoolValue(0);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -182,49 +182,49 @@ var ADIRU = {
|
|||
var ADIRSControlPanel = {
|
||||
adrSw: func(n) {
|
||||
if (n < 0 or n > _NUMADIRU) { return; }
|
||||
ADIRSnew._adrSwitchState = ADIRSnew.Switches.adrSw[n].getValue();
|
||||
ADIRSnew.Switches.adrSw[n].setValue(!ADIRSnew._adrSwitchState);
|
||||
if (ADIRSnew.ADIRunits[n] != nil) {
|
||||
ADIRSnew.ADIRunits[n].outputOn = !ADIRSnew._adrSwitchState;
|
||||
ADIRS._adrSwitchState = ADIRS.Switches.adrSw[n].getValue();
|
||||
ADIRS.Switches.adrSw[n].setValue(!ADIRS._adrSwitchState);
|
||||
if (ADIRS.ADIRunits[n] != nil) {
|
||||
ADIRS.ADIRunits[n].outputOn = !ADIRS._adrSwitchState;
|
||||
}
|
||||
ADIRSnew.Lights.adrOff[n].setValue(ADIRSnew._adrSwitchState);
|
||||
ADIRS.Lights.adrOff[n].setValue(ADIRS._adrSwitchState);
|
||||
},
|
||||
irSw: func(n) {
|
||||
if (n < 0 or n > _NUMADIRU) { return; }
|
||||
ADIRSnew._irSwitchState = ADIRSnew.Switches.irSw[n].getValue();
|
||||
ADIRSnew.Switches.irSw[n].setValue(!ADIRSnew._irSwitchState);
|
||||
if (ADIRSnew.IRunits[n] != nil) {
|
||||
ADIRSnew.IRunits[n].outputOn = !ADIRSnew._irSwitchState;
|
||||
ADIRS._irSwitchState = ADIRS.Switches.irSw[n].getValue();
|
||||
ADIRS.Switches.irSw[n].setValue(!ADIRS._irSwitchState);
|
||||
if (ADIRS.IRunits[n] != nil) {
|
||||
ADIRS.IRunits[n].outputOn = !ADIRS._irSwitchState;
|
||||
}
|
||||
ADIRSnew.Lights.irOff[n].setValue(ADIRSnew._adrSwitchState);
|
||||
ADIRS.Lights.irOff[n].setValue(ADIRS._adrSwitchState);
|
||||
},
|
||||
irModeSw: func(n, mode) {
|
||||
if (n < 0 or n > _NUMADIRU) { return; }
|
||||
if (mode < 0 or mode > 2) { return; }
|
||||
me._irModeSwitchState = ADIRSnew.Switches.irModeSw[n].getValue();
|
||||
if (ADIRSnew.ADIRunits[n] != nil) {
|
||||
ADIRSnew.ADIRunits[n].mode = mode;
|
||||
ADIRSnew.ADIRunits[n].updateEnergised(mode);
|
||||
ADIRSnew.Switches.irModeSw[n].setValue(mode);
|
||||
me._irModeSwitchState = ADIRS.Switches.irModeSw[n].getValue();
|
||||
if (ADIRS.ADIRunits[n] != nil) {
|
||||
ADIRS.ADIRunits[n].mode = mode;
|
||||
ADIRS.ADIRunits[n].updateEnergised(mode);
|
||||
ADIRS.Switches.irModeSw[n].setValue(mode);
|
||||
if (mode == 0) {
|
||||
ADIRSnew.Lights.irFault[n].setBoolValue(0);
|
||||
ADIRSnew.ADIRunits[n].stopAlignNoAlign();
|
||||
} elsif (ADIRSnew.ADIRunits[n].aligned == 0) {
|
||||
ADIRSnew.ADIRunits[n].update(); # update early so operative is set properly
|
||||
ADIRSnew.ADIRunits[n].align(calcAlignTime(pts.Position.latitude.getValue())); # when you set NAV, it first acquires GPS position then acquires GPS. You then use IRS INIT > to set PPOS to align if you wish
|
||||
ADIRS.Lights.irFault[n].setBoolValue(0);
|
||||
ADIRS.ADIRunits[n].stopAlignNoAlign();
|
||||
} elsif (ADIRS.ADIRunits[n].aligned == 0) {
|
||||
ADIRS.ADIRunits[n].update(); # update early so operative is set properly
|
||||
ADIRS.ADIRunits[n].align(calcAlignTime(pts.Position.latitude.getValue())); # when you set NAV, it first acquires GPS position then acquires GPS. You then use IRS INIT > to set PPOS to align if you wish
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
var ADIRSnew = {
|
||||
var ADIRS = {
|
||||
# local vars
|
||||
_adrSwitchState: 0,
|
||||
_irSwitchState: 0,
|
||||
_irModeSwitchState: 0,
|
||||
_hasPower: 0,
|
||||
_cacheOperative: [0, 0, 0],
|
||||
_cacheOutputOn: [0, 0, 0],
|
||||
_cacheOutputOn: [1, 1, 1],
|
||||
_flapPos: nil,
|
||||
_slatPos: nil,
|
||||
_selfTest: 0,
|
||||
|
@ -239,19 +239,20 @@ var ADIRSnew = {
|
|||
|
||||
# PTS
|
||||
Lights: {
|
||||
adrFault: [props.globals.getNode("controls/navigation/adirscp/lights/adr-1-fault"), props.globals.getNode("controls/navigation/adirscp/lights/adr-2-fault"), props.globals.getNode("controls/navigation/adirscp/lights/adr-3-fault")],
|
||||
adrOff: [props.globals.getNode("controls/navigation/adirscp/lights/adr-1-off"), props.globals.getNode("controls/navigation/adirscp/lights/adr-2-off"), props.globals.getNode("controls/navigation/adirscp/lights/adr-3-off")],
|
||||
irFault: [props.globals.getNode("controls/navigation/adirscp/lights/ir-1-fault"), props.globals.getNode("controls/navigation/adirscp/lights/ir-2-fault"), props.globals.getNode("controls/navigation/adirscp/lights/ir-3-fault")],
|
||||
irOff: [props.globals.getNode("controls/navigation/adirscp/lights/ir-1-off"), props.globals.getNode("controls/navigation/adirscp/lights/ir-2-off"), props.globals.getNode("controls/navigation/adirscp/lights/ir-3-off")],
|
||||
onBat: props.globals.getNode("controls/navigation/adirscp/lights/on-bat"),
|
||||
adrFault: [props.globals.getNode("/controls/navigation/adirscp/lights/adr-1-fault"), props.globals.getNode("/controls/navigation/adirscp/lights/adr-2-fault"), props.globals.getNode("/controls/navigation/adirscp/lights/adr-3-fault")],
|
||||
adrOff: [props.globals.getNode("/controls/navigation/adirscp/lights/adr-1-off"), props.globals.getNode("/controls/navigation/adirscp/lights/adr-2-off"), props.globals.getNode("/controls/navigation/adirscp/lights/adr-3-off")],
|
||||
irFault: [props.globals.getNode("/controls/navigation/adirscp/lights/ir-1-fault"), props.globals.getNode("/controls/navigation/adirscp/lights/ir-2-fault"), props.globals.getNode("/controls/navigation/adirscp/lights/ir-3-fault")],
|
||||
irOff: [props.globals.getNode("/controls/navigation/adirscp/lights/ir-1-off"), props.globals.getNode("/controls/navigation/adirscp/lights/ir-2-off"), props.globals.getNode("/controls/navigation/adirscp/lights/ir-3-off")],
|
||||
onBat: props.globals.getNode("/controls/navigation/adirscp/lights/on-bat"),
|
||||
},
|
||||
Switches: {
|
||||
adrSw: [props.globals.getNode("controls/navigation/adirscp/switches/adr-1"), props.globals.getNode("controls/navigation/adirscp/switches/adr-2"), props.globals.getNode("controls/navigation/adirscp/switches/adr-3")],
|
||||
irModeSw: [props.globals.getNode("controls/navigation/adirscp/switches/ir-1-mode"), props.globals.getNode("controls/navigation/adirscp/switches/ir-2-mode"), props.globals.getNode("controls/navigation/adirscp/switches/ir-3-mode")],
|
||||
irSw: [props.globals.getNode("controls/navigation/adirscp/switches/ir-1"), props.globals.getNode("controls/navigation/adirscp/switches/ir-2"), props.globals.getNode("controls/navigation/adirscp/switches/ir-3")],
|
||||
adrSw: [props.globals.getNode("/controls/navigation/adirscp/switches/adr-1"), props.globals.getNode("/controls/navigation/adirscp/switches/adr-2"), props.globals.getNode("/controls/navigation/adirscp/switches/adr-3")],
|
||||
irModeSw: [props.globals.getNode("/controls/navigation/adirscp/switches/ir-1-mode"), props.globals.getNode("/controls/navigation/adirscp/switches/ir-2-mode"), props.globals.getNode("/controls/navigation/adirscp/switches/ir-3-mode")],
|
||||
irSw: [props.globals.getNode("/controls/navigation/adirscp/switches/ir-1"), props.globals.getNode("/controls/navigation/adirscp/switches/ir-2"), props.globals.getNode("/controls/navigation/adirscp/switches/ir-3")],
|
||||
},
|
||||
Operating: {
|
||||
adr: [props.globals.getNode("systems/navigation/adr/operating-1"), props.globals.getNode("systems/navigation/adr/operating-2"), props.globals.getNode("systems/navigation/adr/operating-3")],
|
||||
adr: [props.globals.getNode("/systems/navigation/adr/operating-1"), props.globals.getNode("/systems/navigation/adr/operating-2"), props.globals.getNode("/systems/navigation/adr/operating-3")],
|
||||
aligned: [props.globals.getNode("/systems/navigation/aligned-1"), props.globals.getNode("/systems/navigation/aligned-2"), props.globals.getNode("/systems/navigation/aligned-3")],
|
||||
},
|
||||
|
||||
# Nodes
|
||||
|
@ -275,17 +276,17 @@ var ADIRSnew = {
|
|||
me._slatPos = pts.Fdm.JSBsim.Fcs.slatDeg.getValue();
|
||||
|
||||
if (me._flapPos >= 23 and me._slatPos >= 25) {
|
||||
ADIRSnew.overspeedVFE.setValue(181);
|
||||
ADIRS.overspeedVFE.setValue(181);
|
||||
} elsif (me._flapPos >= 18) {
|
||||
ADIRSnew.overspeedVFE.setValue(189);
|
||||
ADIRS.overspeedVFE.setValue(189);
|
||||
} elsif (me._flapPos >= 13 or me._slatPos > 20) {
|
||||
ADIRSnew.overspeedVFE.setValue(204);
|
||||
ADIRS.overspeedVFE.setValue(204);
|
||||
} elsif (me._slatPos <= 20 and me._flapPos > 2) {
|
||||
ADIRSnew.overspeedVFE.setValue(219);
|
||||
ADIRS.overspeedVFE.setValue(219);
|
||||
} elsif (me._slatPos >= 2 and me._slatPos <= 20) {
|
||||
ADIRSnew.overspeedVFE.setValue(234);
|
||||
ADIRS.overspeedVFE.setValue(234);
|
||||
} else {
|
||||
ADIRSnew.overspeedVFE.setValue(1024);
|
||||
ADIRS.overspeedVFE.setValue(1024);
|
||||
}
|
||||
}
|
||||
),
|
||||
|
@ -321,7 +322,7 @@ var ADIRSnew = {
|
|||
}
|
||||
},
|
||||
selfTest: func() {
|
||||
ADIRSnew.Lights.onBat.setBoolValue(1);
|
||||
ADIRS.Lights.onBat.setBoolValue(1);
|
||||
selfTestLoop.start();
|
||||
},
|
||||
|
||||
|
@ -338,10 +339,10 @@ setlistener("/systems/fmgc/cas-compare/cas-reject-all", func() {
|
|||
}, 0, 0);
|
||||
|
||||
setlistener("/controls/adirs/skip", func() {
|
||||
if (ADIRSnew.skip.getBoolValue()) {
|
||||
if (ADIRS.skip.getBoolValue()) {
|
||||
for (i = 0; i < 3; i = i + 1) {
|
||||
if (ADIRSnew.ADIRunits[i].inAlign == 1) {
|
||||
ADIRSnew.ADIRunits[i].stopAlignAligned();
|
||||
if (ADIRS.ADIRunits[i].inAlign == 1) {
|
||||
ADIRS.ADIRunits[i].stopAlignAligned();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -349,8 +350,8 @@ setlistener("/controls/adirs/skip", func() {
|
|||
|
||||
selfTestLoop = maketimer(0.2, func() {
|
||||
if (pts.Sim.Time.elapsedSec.getValue() > _selfTestTime + 5) {
|
||||
ADIRSnew.Lights.onBat.setBoolValue(0);
|
||||
ADIRS.Lights.onBat.setBoolValue(0);
|
||||
selfTestLoop.stop();
|
||||
ADIRSnew._selfTest = 0;
|
||||
ADIRS._selfTest = 0;
|
||||
}
|
||||
});
|
|
@ -1 +1 @@
|
|||
29
|
||||
30
|
Loading…
Add table
Reference in a new issue