1
0
Fork 0

FMGC: bugfix; also more getprop --> props.globals

This commit is contained in:
legoboyvdlp R 2021-06-13 00:24:46 +01:00
parent 87f49f28e9
commit 3345d0247f
7 changed files with 44 additions and 45 deletions

View file

@ -258,7 +258,7 @@ var colddark = func {
setprop("/controls/engines/engine[0]/cutoff-switch", 1);
setprop("/controls/engines/engine[1]/cutoff-switch", 1);
setprop("/controls/flight/flaps", 0);
setprop("/controls/flight/speedbrake-arm", 0);
pts.Controls.Flight.speedbrakeArm.setValue(0);
setprop("/controls/flight/speedbrake", 0);
setprop("/controls/gear/gear-down", 1);
setprop("/controls/flight/elevator-trim", 0);
@ -317,7 +317,7 @@ var beforestart = func {
setprop("/controls/engines/engine[0]/cutoff-switch", 1);
setprop("/controls/engines/engine[1]/cutoff-switch", 1);
setprop("/controls/flight/flaps", 0);
setprop("/controls/flight/speedbrake-arm", 0);
pts.Controls.Flight.speedbrakeArm.setValue(0);
setprop("/controls/flight/speedbrake", 0);
setprop("/controls/gear/gear-down", 1);
setprop("/controls/flight/elevator-trim", 0);
@ -380,9 +380,9 @@ var beforestart_b = func {
setprop("/controls/adirs/mcducbtn", 1);
setprop("/controls/switches/beacon", 1);
setprop("/controls/lighting/nav-lights-switch", 1);
setprop("/controls/switches/no-smoking-sign", 0.5);
setprop("/controls/switches/seatbelt-sign", 1);
setprop("/controls/switches/emer-lights", 0.5);
libraries.noSmokingSwitch.setValue(0.5);
libraries.seatbeltSwitch.setValue(1.0);
libraries.emerLtsSwitch.setValue(0.5);
setprop("/controls/radio/rmp[0]/on", 1);
setprop("/controls/radio/rmp[1]/on", 1);
setprop("/controls/radio/rmp[2]/on", 1);
@ -412,7 +412,7 @@ var taxi = func {
setprop("/controls/engines/engine[0]/cutoff-switch", 1);
setprop("/controls/engines/engine[1]/cutoff-switch", 1);
setprop("/controls/flight/flaps", 0);
setprop("/controls/flight/speedbrake-arm", 0);
pts.Controls.Flight.speedbrakeArm.setValue(0);
setprop("/controls/flight/speedbrake", 0);
setprop("/controls/gear/gear-down", 1);
setprop("/controls/flight/elevator-trim", 0);
@ -476,9 +476,9 @@ var taxi_b = func {
setprop("/controls/switches/beacon", 1);
setprop("/controls/switches/wing-lights", 1);
setprop("/controls/lighting/nav-lights-switch", 1);
setprop("/controls/switches/no-smoking-sign", 0.5);
setprop("/controls/switches/seatbelt-sign", 1);
setprop("/controls/switches/emer-lights", 0.5);
libraries.noSmokingSwitch.setValue(0.5);
libraries.seatbeltSwitch.setValue(1.0);
libraries.emerLtsSwitch.setValue(0.5);
setprop("/controls/radio/rmp[0]/on", 1);
setprop("/controls/radio/rmp[1]/on", 1);
setprop("/controls/radio/rmp[2]/on", 1);
@ -537,7 +537,7 @@ var takeoff = func {
setprop("/controls/lighting/taxi-light-switch", 1);
setprop("/controls/switches/landing-lights-l", 1);
setprop("/controls/switches/landing-lights-r", 1);
setprop("/controls/flight/speedbrake-arm", 1);
pts.Controls.Flight.speedbrakeArm.setValue(1);
setprop("/controls/flight/flaps", 0.2);
setprop("/controls/atc/mode-knob", 4);
atc.transponderPanel.modeSwitch(5);

View file

@ -3158,7 +3158,7 @@ var messages_config_memo = func {
toMemoLine1.colour = "c";
}
if (getprop("/controls/switches/seatbelt-sign") and getprop("/controls/switches/no-smoking-sign")) {
if (libraries.seatbeltSwitch.getValue() and libraries.noSmokingSwitch.getValue() ) {
toMemoLine2.msg = " SIGNS ON";
toMemoLine2.colour = "g";
} else {
@ -3166,7 +3166,7 @@ var messages_config_memo = func {
toMemoLine2.colour = "c";
}
if (getprop("/controls/flight/speedbrake-arm")) {
if (pts.Controls.Flight.speedbrakeArm.getValue()) {
toMemoLine3.msg = " SPLRS ARM";
toMemoLine3.colour = "g";
} else {
@ -3202,7 +3202,7 @@ var messages_config_memo = func {
setprop("/ECAM/to-memo-reset", 0);
}
if ((phaseVarMemo == 2 and getprop("/ECAM/engine-start-time") != 0 and getprop("/ECAM/engine-start-time") + 120 < pts.Sim.Time.elapsedSec.getValue()) or getprop("/ECAM/to-memo-flipflop")) {
if ((phaseVarMemo == 2 and engStrtTime.getValue() != 0 and engStrtTime.getValue() + 120 < pts.Sim.Time.elapsedSec.getValue()) or getprop("/ECAM/to-memo-flipflop")) {
toMemoLine1.active = 1;
toMemoLine2.active = 1;
toMemoLine3.active = 1;
@ -3224,7 +3224,7 @@ var messages_config_memo = func {
ldgMemoLine1.colour = "c";
}
if (getprop("/controls/switches/seatbelt-sign") and getprop("/controls/switches/no-smoking-sign")) {
if (libraries.seatbeltSwitch.getValue() and libraries.noSmokingSwitch.getValue()) {
ldgMemoLine2.msg = " SIGNS ON";
ldgMemoLine2.colour = "g";
} else {
@ -3232,7 +3232,7 @@ var messages_config_memo = func {
ldgMemoLine2.colour = "c";
}
if (getprop("/controls/flight/speedbrake-arm")) {
if (pts.Controls.Flight.speedbrakeArm.getValue()) {
ldgMemoLine3.msg = " SPLRS ARM";
ldgMemoLine3.colour = "g";
} else {
@ -3343,19 +3343,19 @@ var messages_memo = func {
}
}
if (getprop("/controls/flight/speedbrake-arm") == 1 and toMemoLine1.active != 1 and ldgMemoLine1.active != 1) {
if (pts.Controls.Flight.speedbrakeArm.getValue() == 1 and toMemoLine1.active != 1 and ldgMemoLine1.active != 1) {
gnd_splrs.active = 1;
} else {
gnd_splrs.active = 0;
}
if (getprop("/controls/lighting/seatbelt-sign") == 1 and toMemoLine1.active != 1 and ldgMemoLine1.active != 1) {
if (libraries.seatbeltLight.getValue() == 1 and toMemoLine1.active != 1 and ldgMemoLine1.active != 1) {
seatbelts.active = 1;
} else {
seatbelts.active = 0;
}
if (getprop("/controls/lighting/no-smoking-sign") == 1 and toMemoLine1.active != 1 and ldgMemoLine1.active != 1) { # should go off after takeoff assuming switch is in auto due to old logic from the days when smoking was allowed!
if (libraries.noSmokingLight.getValue() == 1 and toMemoLine1.active != 1 and ldgMemoLine1.active != 1) { # should go off after takeoff assuming switch is in auto due to old logic from the days when smoking was allowed!
nosmoke.active = 1;
} else {
nosmoke.active = 0;

View file

@ -5,33 +5,29 @@
var ap_active = 0;
var athr_active = 0;
var aileron = 0;
var elevator = 0;
var engModeSel = 0;
var APUMaster = 0;
var APURPM = 0;
var gearDown = 0;
var apOffTime = 0;
var athrOffTime = 0;
var apWarnNode = 0;
var athrWarnNode = 0;
var engStrtTimeSw = 0;
var engStrtTime = 0;
var page = 0;
var apOffTime = props.globals.initNode("/ECAM/warnings/ap-off-time", 0, "INT");
var athrOffTime = props.globals.initNode("/ECAM/warnings/athr-off-time", 0, "INT");
var engStrtTimeSw = props.globals.initNode("/ECAM/engine-start-time-switch", 0, "BOOL");
var engStrtTime = props.globals.initNode("/ECAM/engine-start-time", 0.0, "DOUBLE");
var apWarnNode = props.globals.initNode("/it-autoflight/output/ap-warning", 0, "INT");
var athrWarnNode = props.globals.initNode("/it-autoflight/output/athr-warning", 0, "INT");
var page = props.globals.initNode("/ECAM/Lower/page", "door", "STRING");
var gearWarnLight = props.globals.initNode("/ECAM/warnings/landing-gear-warning-light", 0, "BOOL");
var ECAM = {
_cachePage: "",
init: func() {
page = props.globals.initNode("/ECAM/Lower/page", "door", "STRING");
apOffTime = props.globals.initNode("/ECAM/warnings/ap-off-time", 0, "INT");
athrOffTime = props.globals.initNode("/ECAM/warnings/athr-off-time", 0, "INT");
engStrtTimeSw = props.globals.initNode("/ECAM/engine-start-time-switch", 0, "BOOL");
engStrtTime = props.globals.initNode("/ECAM/engine-start-time", 0.0, "DOUBLE");
apWarnNode = props.globals.initNode("/it-autoflight/output/ap-warning", 0, "INT");
athrWarnNode = props.globals.initNode("/it-autoflight/output/athr-warning", 0, "INT");
page.setValue("door");
apOffTime.setValue(0);
athrOffTime.setValue(0);
engStrtTimeSw.setValue(0);
engStrtTime.setValue(0);
apWarnNode.setValue(0);
athrWarnNode.setValue(0);
me.reset();
},
update_items: [

View file

@ -78,8 +78,8 @@ setprop("/FMGC/internal/vor2-mcdu", "999.99/XXX");
setprop("/FMGC/internal/adf1-mcdu", "XXX/999.99");
setprop("/FMGC/internal/adf2-mcdu", "999.99/XXX");
var FMGCAlignDone = [props.globals.getNode("/FMGC/internal/align1-done"),props.globals.getNode("/FMGC/internal/align2-done"),props.globals.getNode("/FMGC/internal/align3-done")];
var FMGCAlignTime = [props.globals.getNode("/FMGC/internal/align1-time"),props.globals.getNode("/FMGC/internal/align2-time"),props.globals.getNode("/FMGC/internal/align3-time")];
var FMGCAlignDone = [props.globals.initNode("/FMGC/internal/align1-done", 0, "BOOL"), props.globals.initNode("/FMGC/internal/align2-done", 0, "BOOL"), props.globals.initNode("/FMGC/internal/align3-done", 0, "BOOL")];
var FMGCAlignTime = [props.globals.initNode("/FMGC/internal/align1-time", 0, "DOUBLE"), props.globals.initNode("/FMGC/internal/align2-time", 0, "DOUBLE"), props.globals.initNode("/FMGC/internal/align3-time", 0, "DOUBLE")];
var adirsSkip = props.globals.getNode("/systems/acconfig/options/adirs-skip");
var blockCalculating = props.globals.initNode("/FMGC/internal/block-calculating", 0, "BOOL");
var fuelCalculating = props.globals.initNode("/FMGC/internal/fuel-calculating", 0, "BOOL");

View file

@ -24,7 +24,7 @@ var variousReset = func() {
setprop("/instrumentation/mk-viii/inputs/discretes/momentary-flap-3-override", 0);
setprop("/controls/switches/cabinCall", 0);
setprop("/controls/switches/mechCall", 0);
setprop("/controls/switches/emer-lights", 0.5);
libraries.emerLtsSwitch.setValue(0.5);
# cockpit voice recorder stuff
setprop("/controls/CVR/power", 0);
setprop("/controls/CVR/test", 0);
@ -62,9 +62,9 @@ var variousReset = func() {
setprop("/modes/fcu/hdg-time", -45);
setprop("/controls/navigation/switching/att-hdg", 0);
setprop("/controls/navigation/switching/air-data", 0);
setprop("/controls/switches/no-smoking-sign", 0.0);
setprop("/controls/switches/seatbelt-sign", 0);
setprop("/controls/switches/emer-lights", 0);
libraries.noSmokingSwitch.setValue(0.0);
libraries.seatbeltSwitch.setValue(0.0);
libraries.emerLtsSwitch.setValue(0.0);
}
var BUTTONS = {

View file

@ -142,6 +142,9 @@ var groundspeed = 0;
var stateL = 0;
var stateR = 0;
var seatbeltSwitch = props.globals.getNode("/controls/switches/seatbelt-sign");
var noSmokingSwitch = props.globals.getNode("/controls/switches/no-smoking-sign");
var emerLtsSwitch = props.globals.getNode("/controls/switches/emer-lights");
var seatbeltLight = props.globals.getNode("/controls/lighting/seatbelt-sign");
var noSmokingLight = props.globals.getNode("/controls/lighting/no-smoking-sign");

View file

@ -91,9 +91,9 @@ var MCDU_reset = func(i) {
setprop("/FMGC/internal/align-ref-long-sign", "");
setprop("/FMGC/internal/align-ref-lat-edit", 0);
setprop("/FMGC/internal/align-ref-long-edit", 0);
setprop("/FMGC/internal/align1-done", 0);
setprop("/FMGC/internal/align2-done", 0);
setprop("/FMGC/internal/align3-done", 0);
fmgc.FMGCAlignDone[0].setValue(0);
fmgc.FMGCAlignDone[1].setValue(0);
fmgc.FMGCAlignDone[2].setValue(0);
# ROUTE SELECTION
fmgc.FMGCInternal.altSelected = 0;