1
0
Fork 0

Remove deprecated file, rename class

This commit is contained in:
legoboyvdlp R 2020-05-01 09:41:39 +01:00
parent 2600e31daf
commit e5066031d0
11 changed files with 92 additions and 113 deletions

View file

@ -3957,7 +3957,6 @@
<file>Aircraft/A320-family/Nasal/Systems/hydraulics.nas</file> <file>Aircraft/A320-family/Nasal/Systems/hydraulics.nas</file>
<file>Aircraft/A320-family/Nasal/Systems/fuel.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/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/ADR.nas</file>
<file>Aircraft/A320-family/Nasal/Systems/ADIRS/SwitchingPanel.nas</file> <file>Aircraft/A320-family/Nasal/Systems/ADIRS/SwitchingPanel.nas</file>
<file>Aircraft/A320-family/Nasal/Systems/Comm/HF.nas</file> <file>Aircraft/A320-family/Nasal/Systems/Comm/HF.nas</file>

View file

@ -384,15 +384,15 @@ var beforestart_b = func {
setprop("/controls/adirs/ir[0]/knob","1"); setprop("/controls/adirs/ir[0]/knob","1");
setprop("/controls/adirs/ir[1]/knob","1"); setprop("/controls/adirs/ir[1]/knob","1");
setprop("/controls/adirs/ir[2]/knob","1"); setprop("/controls/adirs/ir[2]/knob","1");
if (systems.ADIRSnew.Switches.adrSw[0].getValue() != 1) { systems.ADIRSControlPanel.adrSw(0); } if (systems.ADIRS.Switches.adrSw[0].getValue() != 1) { systems.ADIRSControlPanel.adrSw(0); }
if (systems.ADIRSnew.Switches.adrSw[1].getValue() != 1) { systems.ADIRSControlPanel.adrSw(1); } if (systems.ADIRS.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[2].getValue() != 1) { systems.ADIRSControlPanel.adrSw(2); }
systems.ADIRSControlPanel.irModeSw(0, 1); systems.ADIRSControlPanel.irModeSw(0, 1);
systems.ADIRSControlPanel.irModeSw(1, 1); systems.ADIRSControlPanel.irModeSw(1, 1);
systems.ADIRSControlPanel.irModeSw(2, 1); systems.ADIRSControlPanel.irModeSw(2, 1);
systems.ADIRSnew.ADIRunits[0].instAlign(); systems.ADIRS.ADIRunits[0].instAlign();
systems.ADIRSnew.ADIRunits[1].instAlign(); systems.ADIRS.ADIRunits[1].instAlign();
systems.ADIRSnew.ADIRunits[2].instAlign(); systems.ADIRS.ADIRunits[2].instAlign();
setprop("/controls/adirs/mcducbtn", 1); setprop("/controls/adirs/mcducbtn", 1);
setprop("/controls/switches/beacon", 1); setprop("/controls/switches/beacon", 1);
setprop("/controls/lighting/nav-lights-switch", 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[0]/knob","1");
setprop("/controls/adirs/ir[1]/knob","1"); setprop("/controls/adirs/ir[1]/knob","1");
setprop("/controls/adirs/ir[2]/knob","1"); setprop("/controls/adirs/ir[2]/knob","1");
if (systems.ADIRSnew.Switches.adrSw[0].getValue() != 1) { systems.ADIRSControlPanel.adrSw(0); } if (systems.ADIRS.Switches.adrSw[0].getValue() != 1) { systems.ADIRSControlPanel.adrSw(0); }
if (systems.ADIRSnew.Switches.adrSw[1].getValue() != 1) { systems.ADIRSControlPanel.adrSw(1); } if (systems.ADIRS.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[2].getValue() != 1) { systems.ADIRSControlPanel.adrSw(2); }
systems.ADIRSControlPanel.irModeSw(0, 1); systems.ADIRSControlPanel.irModeSw(0, 1);
systems.ADIRSControlPanel.irModeSw(1, 1); systems.ADIRSControlPanel.irModeSw(1, 1);
systems.ADIRSControlPanel.irModeSw(2, 1); systems.ADIRSControlPanel.irModeSw(2, 1);
systems.ADIRSnew.ADIRunits[0].instAlign(); systems.ADIRS.ADIRunits[0].instAlign();
systems.ADIRSnew.ADIRunits[1].instAlign(); systems.ADIRS.ADIRunits[1].instAlign();
systems.ADIRSnew.ADIRunits[2].instAlign(); systems.ADIRS.ADIRunits[2].instAlign();
setprop("/controls/adirs/mcducbtn", 1); setprop("/controls/adirs/mcducbtn", 1);
setprop("/controls/switches/beacon", 1); setprop("/controls/switches/beacon", 1);
setprop("/controls/switches/wing-lights", 1); setprop("/controls/switches/wing-lights", 1);

View file

@ -669,7 +669,7 @@ var canvas_lowerECAM_apu = {
me["APUGenHz"].setText(sprintf("%s", math.round(apu_hz.getValue()))); me["APUGenHz"].setText(sprintf("%s", math.round(apu_hz.getValue())));
# APU Bleed # 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"].setColor(0.0509,0.7529,0.2941);
me["APUBleedPSI"].setText(sprintf("%s", math.round(bleedapu.getValue()))); me["APUBleedPSI"].setText(sprintf("%s", math.round(bleedapu.getValue())));
} else { } else {

View file

@ -1383,19 +1383,19 @@ var canvas_MCDU_base = {
me.showRightArrow(0, 0, 0, 0, 0, 1); me.showRightArrow(0, 0, 0, 0, 0, 1);
} }
if (getprop("/systems/navigation/adr/operating-1") and systems.ADIRSnew.ADIRunits[0].inAlign == 0) { if (getprop("/systems/navigation/adr/operating-1") and systems.ADIRS.ADIRunits[0].inAlign == 0) {
me["Simple_C3S"].setText("IRS1 ALIGNED ON GPS"); me["Simple_C3S"].setText("IRS1 ALIGNED ON GPS");
} else { } else {
me["Simple_C3S"].setText("IRS1 ALIGNING ON GPS"); me["Simple_C3S"].setText("IRS1 ALIGNING ON GPS");
} }
if (getprop("/systems/navigation/adr/operating-2") and systems.ADIRSnew.ADIRunits[1].inAlign == 0) { if (getprop("/systems/navigation/adr/operating-2") and systems.ADIRS.ADIRunits[1].inAlign == 0) {
me["Simple_C4S"].setText("IRS2 ALIGNED ON GPS"); me["Simple_C4S"].setText("IRS2 ALIGNED ON GPS");
} else { } else {
me["Simple_C4S"].setText("IRS2 ALIGNING ON GPS"); me["Simple_C4S"].setText("IRS2 ALIGNING ON GPS");
} }
if (getprop("/systems/navigation/adr/operating-3") and systems.ADIRSnew.ADIRunits[2].inAlign == 0) { if (getprop("/systems/navigation/adr/operating-3") and systems.ADIRS.ADIRunits[2].inAlign == 0) {
me["Simple_C5S"].setText("IRS3 ALIGNED ON GPS"); me["Simple_C5S"].setText("IRS3 ALIGNED ON GPS");
} else { } else {
me["Simple_C5S"].setText("IRS3 ALIGNING ON GPS"); me["Simple_C5S"].setText("IRS3 ALIGNING ON GPS");

View file

@ -538,8 +538,8 @@
<binding> <binding>
<command>nasal</command> <command>nasal</command>
<script> <script>
if (systems.ADIRSnew.Switches.irModeSw[0].getValue() != 2) { if (systems.ADIRS.Switches.irModeSw[0].getValue() != 2) {
systems.ADIRSControlPanel.irModeSw(0, systems.ADIRSnew.Switches.irModeSw[0].getValue() + 1); systems.ADIRSControlPanel.irModeSw(0, systems.ADIRS.Switches.irModeSw[0].getValue() + 1);
} else { } else {
systems.ADIRSControlPanel.irModeSw(0, 0); systems.ADIRSControlPanel.irModeSw(0, 0);
} }
@ -557,8 +557,8 @@
<binding> <binding>
<command>nasal</command> <command>nasal</command>
<script> <script>
if (systems.ADIRSnew.Switches.irModeSw[0].getValue() != 0) { if (systems.ADIRS.Switches.irModeSw[0].getValue() != 0) {
systems.ADIRSControlPanel.irModeSw(0, systems.ADIRSnew.Switches.irModeSw[0].getValue() - 1); systems.ADIRSControlPanel.irModeSw(0, systems.ADIRS.Switches.irModeSw[0].getValue() - 1);
} else { } else {
systems.ADIRSControlPanel.irModeSw(0, 2); systems.ADIRSControlPanel.irModeSw(0, 2);
} }
@ -634,8 +634,8 @@
<binding> <binding>
<command>nasal</command> <command>nasal</command>
<script> <script>
if (systems.ADIRSnew.Switches.irModeSw[1].getValue() != 2) { if (systems.ADIRS.Switches.irModeSw[1].getValue() != 2) {
systems.ADIRSControlPanel.irModeSw(1, systems.ADIRSnew.Switches.irModeSw[1].getValue() + 1); systems.ADIRSControlPanel.irModeSw(1, systems.ADIRS.Switches.irModeSw[1].getValue() + 1);
} else { } else {
systems.ADIRSControlPanel.irModeSw(1, 0); systems.ADIRSControlPanel.irModeSw(1, 0);
} }
@ -653,8 +653,8 @@
<binding> <binding>
<command>nasal</command> <command>nasal</command>
<script> <script>
if (systems.ADIRSnew.Switches.irModeSw[1].getValue() != 0) { if (systems.ADIRS.Switches.irModeSw[1].getValue() != 0) {
systems.ADIRSControlPanel.irModeSw(1, systems.ADIRSnew.Switches.irModeSw[1].getValue() - 1); systems.ADIRSControlPanel.irModeSw(1, systems.ADIRS.Switches.irModeSw[1].getValue() - 1);
} else { } else {
systems.ADIRSControlPanel.irModeSw(1, 2); systems.ADIRSControlPanel.irModeSw(1, 2);
} }
@ -730,8 +730,8 @@
<binding> <binding>
<command>nasal</command> <command>nasal</command>
<script> <script>
if (systems.ADIRSnew.Switches.irModeSw[2].getValue() != 2) { if (systems.ADIRS.Switches.irModeSw[2].getValue() != 2) {
systems.ADIRSControlPanel.irModeSw(2, systems.ADIRSnew.Switches.irModeSw[2].getValue() + 1); systems.ADIRSControlPanel.irModeSw(2, systems.ADIRS.Switches.irModeSw[2].getValue() + 1);
} else { } else {
systems.ADIRSControlPanel.irModeSw(2, 0); systems.ADIRSControlPanel.irModeSw(2, 0);
} }
@ -749,8 +749,8 @@
<binding> <binding>
<command>nasal</command> <command>nasal</command>
<script> <script>
if (systems.ADIRSnew.Switches.irModeSw[2].getValue() != 0) { if (systems.ADIRS.Switches.irModeSw[2].getValue() != 0) {
systems.ADIRSControlPanel.irModeSw(2, systems.ADIRSnew.Switches.irModeSw[2].getValue() - 1); systems.ADIRSControlPanel.irModeSw(2, systems.ADIRS.Switches.irModeSw[2].getValue() - 1);
} else { } else {
systems.ADIRSControlPanel.irModeSw(2, 2); systems.ADIRSControlPanel.irModeSw(2, 2);
} }

View file

@ -1050,7 +1050,7 @@ var canvas_PFD_1 = {
wow2_act = wow2.getValue(); wow2_act = wow2.getValue();
# Errors # 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["AI_group"].show();
me["HDG_group"].show(); me["HDG_group"].show();
me["AI_error"].hide(); me["AI_error"].hide();
@ -1788,7 +1788,7 @@ var canvas_PFD_2 = {
wow2_act = wow2.getValue(); wow2_act = wow2.getValue();
# Errors # 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["AI_group"].show();
me["HDG_group"].show(); me["HDG_group"].show();
me["AI_error"].hide(); me["AI_error"].hide();

View file

@ -47,7 +47,7 @@ var DMC = {
me.outputs[6] = nil; me.outputs[6] = nil;
}, },
update: func() { 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) { if (me._set != 1) {
me._setNil = 0; me._setNil = 0;
me.setOutputs(me.activeADIRS); me.setOutputs(me.activeADIRS);

View file

@ -72,7 +72,7 @@ var messages_priority_3 = func {
if (getprop("systems/navigation/adr/computation/overspeed-vfe")) { if (getprop("systems/navigation/adr/computation/overspeed-vfe")) {
overspeedFlap.active = 1; overspeedFlap.active = 1;
overspeedFlap.msg = "-VFE................" ~ (systems.ADIRSnew.overspeedVFE.getValue() - 4); overspeedFlap.msg = "-VFE................" ~ (systems.ADIRS.overspeedVFE.getValue() - 4);
} else { } else {
ECAM_controller.warningReset(overspeedFlap); ECAM_controller.warningReset(overspeedFlap);
overspeedFlap.msg = "-VFE................XXX"; overspeedFlap.msg = "-VFE................XXX";
@ -1496,7 +1496,7 @@ var messages_memo = func {
refuelg.active = 0; 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; irs_in_align.active = 1;
if (getprop("ECAM/phases/timer/eng1or2-output")) { if (getprop("ECAM/phases/timer/eng1or2-output")) {
irs_in_align.colour = "a"; irs_in_align.colour = "a";
@ -1505,7 +1505,7 @@ var messages_memo = func {
} }
timeNow = pts.Sim.Time.elapsedSec.getValue(); 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) { if (numberMinutes >= 7) {
irs_in_align.msg = "IRS IN ALIGN > 7 MN"; irs_in_align.msg = "IRS IN ALIGN > 7 MN";

View file

@ -201,7 +201,6 @@ var systemsInit = func {
systems.HYD.init(); systems.HYD.init();
systems.FUEL.init(); systems.FUEL.init();
systems.ADIRS.init(); systems.ADIRS.init();
systems.ADIRSnew.init();
systems.eng_init(); systems.eng_init();
systems.APUController.init(); systems.APUController.init();
systems.fire_init(); systems.fire_init();
@ -236,7 +235,7 @@ var systemsLoop = maketimer(0.1, func {
systems.PNEU.loop(); systems.PNEU.loop();
systems.HYD.loop(); systems.HYD.loop();
systems.FUEL.loop(); systems.FUEL.loop();
systems.ADIRSnew.loop(); systems.ADIRS.loop();
libraries.ECAM.loop(); libraries.ECAM.loop();
libraries.BUTTONS.update(); libraries.BUTTONS.update();
fadec.FADEC.loop(); fadec.FADEC.loop();

View file

@ -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);
},
};

View file

@ -61,34 +61,34 @@ var ADIRU = {
}, },
# BITE # BITE
selfTest: func() { selfTest: func() {
ADIRSnew._selfTest = 1; ADIRS._selfTest = 1;
_selfTestTime = pts.Sim.Time.elapsedSec.getValue(); _selfTestTime = pts.Sim.Time.elapsedSec.getValue();
ADIRSnew.Lights.adrOff[me.num].setValue(1); ADIRS.Lights.adrOff[me.num].setValue(1);
ADIRSnew.Lights.adrFault[me.num].setValue(1); ADIRS.Lights.adrFault[me.num].setValue(1);
settimer(func() { settimer(func() {
ADIRSnew.Lights.adrOff[me.num].setValue(0); ADIRS.Lights.adrOff[me.num].setValue(0);
ADIRSnew.Lights.adrFault[me.num].setValue(0); ADIRS.Lights.adrFault[me.num].setValue(0);
}, 0.1); }, 0.1);
settimer(func() { settimer(func() {
ADIRSnew.Lights.adrOff[me.num].setValue(1); ADIRS.Lights.adrOff[me.num].setValue(1);
ADIRSnew.Lights.adrFault[me.num].setValue(1); ADIRS.Lights.adrFault[me.num].setValue(1);
ADIRSnew.Lights.irFault[me.num].setValue(1); ADIRS.Lights.irFault[me.num].setValue(1);
ADIRSnew.Lights.irOff[me.num].setValue(1); ADIRS.Lights.irOff[me.num].setValue(1);
}, 1.0); }, 1.0);
settimer(func() { settimer(func() {
ADIRSnew.Lights.adrOff[me.num].setValue(0); ADIRS.Lights.adrOff[me.num].setValue(ADIRS.Switches.adrSw[me.num].getValue());
ADIRSnew.Lights.adrFault[me.num].setValue(0); ADIRS.Lights.adrFault[me.num].setValue(0);
ADIRSnew.Lights.irFault[me.num].setValue(0); ADIRS.Lights.irFault[me.num].setValue(0);
ADIRSnew.Lights.irOff[me.num].setValue(0); ADIRS.Lights.irOff[me.num].setValue(ADIRS.Switches.irSw[me.num].getValue());
}, 1.1); }, 1.1);
ADIRSnew.selfTest(); ADIRS.selfTest();
}, },
# Alignment # Alignment
align: func(time) { align: func(time) {
ADIRSnew.Lights.irFault[me.num].setBoolValue(0); ADIRS.Lights.irFault[me.num].setBoolValue(0);
if (!ADIRSnew.skip.getValue()) { if (!ADIRS.skip.getValue()) {
if (time > 0 and me.aligned == 0 and me.inAlign == 0 and me.operative == 1) { if (time > 0 and me.aligned == 0 and me.inAlign == 0 and me.operative == 1) {
me._alignTime = pts.Sim.Time.elapsedSec.getValue() + time; me._alignTime = pts.Sim.Time.elapsedSec.getValue() + time;
me.inAlign = 1; me.inAlign = 1;
@ -154,26 +154,26 @@ var ADIRU = {
if (me._voltageMain) { if (me._voltageMain) {
me._noPowerTime = 0; me._noPowerTime = 0;
me.setOperative(1); me.setOperative(1);
if (!ADIRSnew._selfTest) { if (!ADIRS._selfTest) {
ADIRSnew.Lights.onBat.setBoolValue(0); ADIRS.Lights.onBat.setBoolValue(0);
} }
} elsif (((me._timeVar < me._noPowerTime + 300 and me._voltageLimitedTime) or !me._voltageLimitedTime) and me._voltageBackup) { } elsif (((me._timeVar < me._noPowerTime + 300 and me._voltageLimitedTime) or !me._voltageLimitedTime) and me._voltageBackup) {
me.setOperative(1); me.setOperative(1);
if (!ADIRSnew._selfTest) { if (!ADIRS._selfTest) {
ADIRSnew.Lights.onBat.setBoolValue(1); ADIRS.Lights.onBat.setBoolValue(1);
} }
} else { } else {
me._noPowerTime = 0; me._noPowerTime = 0;
me.setOperative(0); me.setOperative(0);
if (!ADIRSnew._selfTest) { if (!ADIRS._selfTest) {
ADIRSnew.Lights.onBat.setBoolValue(0); ADIRS.Lights.onBat.setBoolValue(0);
} }
} }
} else { } else {
me._noPowerTime = 0; me._noPowerTime = 0;
me.setOperative(0); me.setOperative(0);
if (!ADIRSnew._selfTest) { if (!ADIRS._selfTest) {
ADIRSnew.Lights.onBat.setBoolValue(0); ADIRS.Lights.onBat.setBoolValue(0);
} }
} }
}, },
@ -182,42 +182,42 @@ var ADIRU = {
var ADIRSControlPanel = { var ADIRSControlPanel = {
adrSw: func(n) { adrSw: func(n) {
if (n < 0 or n > _NUMADIRU) { return; } if (n < 0 or n > _NUMADIRU) { return; }
ADIRSnew._adrSwitchState = ADIRSnew.Switches.adrSw[n].getValue(); ADIRS._adrSwitchState = ADIRS.Switches.adrSw[n].getValue();
ADIRSnew.Switches.adrSw[n].setValue(!ADIRSnew._adrSwitchState); ADIRS.Switches.adrSw[n].setValue(!ADIRS._adrSwitchState);
if (ADIRSnew.ADIRunits[n] != nil) { if (ADIRS.ADIRunits[n] != nil) {
ADIRSnew.ADIRunits[n].outputOn = !ADIRSnew._adrSwitchState; ADIRS.ADIRunits[n].outputOn = !ADIRS._adrSwitchState;
} }
ADIRSnew.Lights.adrOff[n].setValue(ADIRSnew._adrSwitchState); ADIRS.Lights.adrOff[n].setValue(ADIRS._adrSwitchState);
}, },
irSw: func(n) { irSw: func(n) {
if (n < 0 or n > _NUMADIRU) { return; } if (n < 0 or n > _NUMADIRU) { return; }
ADIRSnew._irSwitchState = ADIRSnew.Switches.irSw[n].getValue(); ADIRS._irSwitchState = ADIRS.Switches.irSw[n].getValue();
ADIRSnew.Switches.irSw[n].setValue(!ADIRSnew._irSwitchState); ADIRS.Switches.irSw[n].setValue(!ADIRS._irSwitchState);
if (ADIRSnew.IRunits[n] != nil) { if (ADIRS.IRunits[n] != nil) {
ADIRSnew.IRunits[n].outputOn = !ADIRSnew._irSwitchState; ADIRS.IRunits[n].outputOn = !ADIRS._irSwitchState;
} }
ADIRSnew.Lights.irOff[n].setValue(ADIRSnew._adrSwitchState); ADIRS.Lights.irOff[n].setValue(ADIRS._adrSwitchState);
}, },
irModeSw: func(n, mode) { irModeSw: func(n, mode) {
if (n < 0 or n > _NUMADIRU) { return; } if (n < 0 or n > _NUMADIRU) { return; }
if (mode < 0 or mode > 2) { return; } if (mode < 0 or mode > 2) { return; }
me._irModeSwitchState = ADIRSnew.Switches.irModeSw[n].getValue(); me._irModeSwitchState = ADIRS.Switches.irModeSw[n].getValue();
if (ADIRSnew.ADIRunits[n] != nil) { if (ADIRS.ADIRunits[n] != nil) {
ADIRSnew.ADIRunits[n].mode = mode; ADIRS.ADIRunits[n].mode = mode;
ADIRSnew.ADIRunits[n].updateEnergised(mode); ADIRS.ADIRunits[n].updateEnergised(mode);
ADIRSnew.Switches.irModeSw[n].setValue(mode); ADIRS.Switches.irModeSw[n].setValue(mode);
if (mode == 0) { if (mode == 0) {
ADIRSnew.Lights.irFault[n].setBoolValue(0); ADIRS.Lights.irFault[n].setBoolValue(0);
ADIRSnew.ADIRunits[n].stopAlignNoAlign(); ADIRS.ADIRunits[n].stopAlignNoAlign();
} elsif (ADIRSnew.ADIRunits[n].aligned == 0) { } elsif (ADIRS.ADIRunits[n].aligned == 0) {
ADIRSnew.ADIRunits[n].update(); # update early so operative is set properly ADIRS.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.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 # local vars
_adrSwitchState: 0, _adrSwitchState: 0,
_irSwitchState: 0, _irSwitchState: 0,
@ -275,17 +275,17 @@ var ADIRSnew = {
me._slatPos = pts.Fdm.JSBsim.Fcs.slatDeg.getValue(); me._slatPos = pts.Fdm.JSBsim.Fcs.slatDeg.getValue();
if (me._flapPos >= 23 and me._slatPos >= 25) { if (me._flapPos >= 23 and me._slatPos >= 25) {
ADIRSnew.overspeedVFE.setValue(181); ADIRS.overspeedVFE.setValue(181);
} elsif (me._flapPos >= 18) { } elsif (me._flapPos >= 18) {
ADIRSnew.overspeedVFE.setValue(189); ADIRS.overspeedVFE.setValue(189);
} elsif (me._flapPos >= 13 or me._slatPos > 20) { } elsif (me._flapPos >= 13 or me._slatPos > 20) {
ADIRSnew.overspeedVFE.setValue(204); ADIRS.overspeedVFE.setValue(204);
} elsif (me._slatPos <= 20 and me._flapPos > 2) { } elsif (me._slatPos <= 20 and me._flapPos > 2) {
ADIRSnew.overspeedVFE.setValue(219); ADIRS.overspeedVFE.setValue(219);
} elsif (me._slatPos >= 2 and me._slatPos <= 20) { } elsif (me._slatPos >= 2 and me._slatPos <= 20) {
ADIRSnew.overspeedVFE.setValue(234); ADIRS.overspeedVFE.setValue(234);
} else { } else {
ADIRSnew.overspeedVFE.setValue(1024); ADIRS.overspeedVFE.setValue(1024);
} }
} }
), ),
@ -321,7 +321,7 @@ var ADIRSnew = {
} }
}, },
selfTest: func() { selfTest: func() {
ADIRSnew.Lights.onBat.setBoolValue(1); ADIRS.Lights.onBat.setBoolValue(1);
selfTestLoop.start(); selfTestLoop.start();
}, },
@ -338,10 +338,10 @@ setlistener("/systems/fmgc/cas-compare/cas-reject-all", func() {
}, 0, 0); }, 0, 0);
setlistener("/controls/adirs/skip", func() { setlistener("/controls/adirs/skip", func() {
if (ADIRSnew.skip.getBoolValue()) { if (ADIRS.skip.getBoolValue()) {
for (i = 0; i < 3; i = i + 1) { for (i = 0; i < 3; i = i + 1) {
if (ADIRSnew.ADIRunits[i].inAlign == 1) { if (ADIRS.ADIRunits[i].inAlign == 1) {
ADIRSnew.ADIRunits[i].stopAlignAligned(); ADIRS.ADIRunits[i].stopAlignAligned();
} }
} }
} }
@ -349,8 +349,8 @@ setlistener("/controls/adirs/skip", func() {
selfTestLoop = maketimer(0.2, func() { selfTestLoop = maketimer(0.2, func() {
if (pts.Sim.Time.elapsedSec.getValue() > _selfTestTime + 5) { if (pts.Sim.Time.elapsedSec.getValue() > _selfTestTime + 5) {
ADIRSnew.Lights.onBat.setBoolValue(0); ADIRS.Lights.onBat.setBoolValue(0);
selfTestLoop.stop(); selfTestLoop.stop();
ADIRSnew._selfTest = 0; ADIRS._selfTest = 0;
} }
}); });