1
0
Fork 0

Fix transponder, self-test now only occurs when power lost > 3 seconds, fix ECAM warnings going off sometimes when they shouldn't

This commit is contained in:
legoboyvdlp R 2019-12-28 15:53:17 +00:00
parent 6d806db28e
commit 8edf5bb5cb
8 changed files with 175 additions and 94 deletions

View file

@ -253,6 +253,7 @@ var gen2_load = props.globals.initNode("/systems/electrical/extra/gen2-load", 0,
var du4_test = props.globals.initNode("/instrumentation/du/du4-test", 0, "BOOL");
var du4_test_time = props.globals.initNode("/instrumentation/du/du4-test-time", 0, "DOUBLE");
var du4_test_amount = props.globals.initNode("/instrumentation/du/du4-test-amount", 0, "DOUBLE");
var du4_offtime = props.globals.initNode("/instrumentation/du/du4-off-time", 0.0, "DOUBLE");
var canvas_lowerECAM_base = {
init: func(canvas_group, file) {
@ -274,27 +275,34 @@ var canvas_lowerECAM_base = {
getKeys: func() {
return [];
},
update: func() {
elapsedtime = elapsed_sec.getValue();
updateDu4: func() {
var elapsedtime = elapsed_sec.getValue();
if (ac2.getValue() >= 110) {
if (gear0_wow.getValue() == 1) {
if (autoconfig_running.getValue() != 1 and du4_test.getValue() != 1) {
if (du4_offtime.getValue() + 3 < elapsedtime) {
if (gear0_wow.getValue() == 1) {
if (autoconfig_running.getValue() != 1 and du4_test.getValue() != 1) {
du4_test.setValue(1);
du4_test_amount.setValue(math.round((rand() * 5 ) + 35, 0.1));
du4_test_time.setValue(elapsedtime);
} else if (autoconfig_running.getValue() == 1 and du4_test.getValue() != 1) {
du4_test.setValue(1);
du4_test_amount.setValue(math.round((rand() * 5 ) + 35, 0.1));
du4_test_time.setValue(elapsedtime - 30);
}
} else {
du4_test.setValue(1);
du4_test_amount.setValue(math.round((rand() * 5 ) + 35, 0.1));
du4_test_time.setValue(elapsedtime);
} else if (autoconfig_running.getValue() == 1 and du4_test.getValue() != 1) {
du4_test.setValue(1);
du4_test_amount.setValue(math.round((rand() * 5 ) + 35, 0.1));
du4_test_time.setValue(elapsedtime - 30);
du4_test_amount.setValue(0);
du4_test_time.setValue(-100);
}
} else {
du4_test.setValue(1);
du4_test_amount.setValue(0);
du4_test_time.setValue(-100);
}
} else if (ac1_src.getValue() == "XX" or ac2_src.getValue() == "XX") {
} else {
du4_test.setValue(0);
du4_offtime.setValue(elapsedtime);
}
},
update: func() {
var elapsedtime = elapsed_sec.getValue();
if (ac2.getValue() >= 110 and lighting_du4.getValue() > 0.01) {
if (du4_test_time.getValue() + du4_test_amount.getValue() >= elapsedtime) {
@ -3244,6 +3252,7 @@ var canvas_lowerECAM_test = {
return ["Test_white","Test_text"];
},
update: func() {
var elapsedtime = elapsed_sec.getValue();
if (du4_test_time.getValue() + 1 >= elapsedtime) {
me["Test_white"].show();
me["Test_text"].hide();
@ -3310,3 +3319,7 @@ var showLowerECAM = func {
var dlg = canvas.Window.new([512, 512], "dialog").set("resize", 1);
dlg.setCanvas(lowerECAM_display);
}
setlistener("/systems/electrical/bus/ac-2", func() {
canvas_lowerECAM_base.updateDu4();
}, 0, 0);

View file

@ -20,8 +20,10 @@ var du1_test_amount = props.globals.getNode("/instrumentation/du/du1-test-amount
var du2_test = props.globals.getNode("/instrumentation/du/du2-test");
var du2_test_time = props.globals.getNode("/instrumentation/du/du2-test-time");
var du2_test_amount = props.globals.getNode("/instrumentation/du/du2-test-amount");
var du2_offtime = props.globals.initNode("/instrumentation/du/du2-off-time", 0.0, "DOUBLE");
var du5_test = props.globals.getNode("/instrumentation/du/du5-test");
var du5_test_time = props.globals.getNode("/instrumentation/du/du5-test-time");
var du5_offtime = props.globals.initNode("/instrumentation/du/du5-off-time", 0.0, "DOUBLE");
var du5_test_amount = props.globals.getNode("/instrumentation/du/du5-test-amount");
var du6_test = props.globals.getNode("/instrumentation/du/du6-test");
var du6_test_time = props.globals.getNode("/instrumentation/du/du6-test-time");
@ -84,47 +86,60 @@ var canvas_nd_base = {
getKeys: func() {
return [];
},
update: func() {
elapsedtime = getprop("/sim/time/elapsed-sec");
updateDu2: func() {
var elapsedtime = getprop("/sim/time/elapsed-sec");
if (getprop("/systems/electrical/bus/ac-ess-shed") >= 110) {
if (wow0.getValue() == 1) {
if (getprop("/systems/acconfig/autoconfig-running") != 1 and du2_test.getValue() != 1) {
if (du2_offtime.getValue() + 3 < elapsedtime) {
if (wow0.getValue() == 1) {
if (getprop("/systems/acconfig/autoconfig-running") != 1 and du2_test.getValue() != 1) {
du2_test.setValue(1);
du2_test_amount.setValue(math.round((rand() * 5 ) + 35, 0.1));
du2_test_time.setValue(getprop("/sim/time/elapsed-sec"));
} else if (getprop("/systems/acconfig/autoconfig-running") == 1 and du2_test.getValue() != 1) {
du2_test.setValue(1);
du2_test_amount.setValue(math.round((rand() * 5 ) + 35, 0.1));
du2_test_time.setValue(getprop("/sim/time/elapsed-sec") - 30);
}
} else {
du2_test.setValue(1);
du2_test_amount.setValue(math.round((rand() * 5 ) + 35, 0.1));
du2_test_time.setValue(getprop("/sim/time/elapsed-sec"));
} else if (getprop("/systems/acconfig/autoconfig-running") == 1 and du2_test.getValue() != 1) {
du2_test.setValue(1);
du2_test_amount.setValue(math.round((rand() * 5 ) + 35, 0.1));
du2_test_time.setValue(getprop("/sim/time/elapsed-sec") - 30);
du2_test_amount.setValue(0);
du2_test_time.setValue(-100);
}
} else {
du2_test.setValue(1);
du2_test_amount.setValue(0);
du2_test_time.setValue(-100);
}
} else {
du2_test.setValue(0);
du2_offtime.setValue(elapsedtime);
}
},
updateDu5: func() {
var elapsedtime = getprop("/sim/time/elapsed-sec");
if (getprop("/systems/electrical/bus/ac-2") >= 110) {
if (wow0.getValue() == 1) {
if (getprop("/systems/acconfig/autoconfig-running") != 1 and du5_test.getValue() != 1) {
if (du5_offtime.getValue() + 3 < elapsedtime) {
if (wow0.getValue() == 1) {
if (getprop("/systems/acconfig/autoconfig-running") != 1 and du5_test.getValue() != 1) {
du5_test.setValue(1);
du5_test_amount.setValue(math.round((rand() * 5 ) + 35, 0.1));
du5_test_time.setValue(getprop("/sim/time/elapsed-sec"));
} else if (getprop("/systems/acconfig/autoconfig-running") == 1 and du5_test.getValue() != 1) {
du5_test.setValue(1);
du5_test_amount.setValue(math.round((rand() * 5 ) + 35, 0.1));
du5_test_time.setValue(getprop("/sim/time/elapsed-sec") - 30);
}
} else {
du5_test.setValue(1);
du5_test_amount.setValue(math.round((rand() * 5 ) + 35, 0.1));
du5_test_time.setValue(getprop("/sim/time/elapsed-sec"));
} else if (getprop("/systems/acconfig/autoconfig-running") == 1 and du5_test.getValue() != 1) {
du5_test.setValue(1);
du5_test_amount.setValue(math.round((rand() * 5 ) + 35, 0.1));
du5_test_time.setValue(getprop("/sim/time/elapsed-sec") - 30);
du5_test_amount.setValue(0);
du5_test_time.setValue(-100);
}
} else {
du5_test.setValue(1);
du5_test_amount.setValue(0);
du5_test_time.setValue(-100);
}
} else {
du5_test.setValue(0);
du5_offtime.setValue(elapsedtime);
}
},
update: func() {
var elapsedtime = getprop("/sim/time/elapsed-sec");
if (getprop("/systems/electrical/bus/ac-ess-shed") >= 110 and getprop("/controls/lighting/DU/du2") > 0) {
if (du2_test_time.getValue() + du2_test_amount.getValue() >= elapsedtime and cpt_du_xfr.getValue() != 1) {
ND_1.page.hide();
@ -383,3 +398,11 @@ var showNd = func(nd = nil) {
var dlg = canvas.Window.new([512, 512], "dialog").set("resize", 1);
dlg.setCanvas(nd_display[nd]);
}
setlistener("/systems/electrical/bus/ac-ess-shed", func() {
canvas_nd_base.updateDu2();
}, 0, 0);
setlistener("/systems/electrical/bus/ac-2", func() {
canvas_nd_base.updateDu5();
}, 0, 0);

View file

@ -124,6 +124,7 @@ var track = props.globals.initNode("/instrumentation/pfd/track-deg", 0.0, "DOUBL
var track_diff = props.globals.initNode("/instrumentation/pfd/track-hdg-diff", 0.0, "DOUBLE");
var du1_test = props.globals.initNode("/instrumentation/du/du1-test", 0, "BOOL");
var du1_test_time = props.globals.initNode("/instrumentation/du/du1-test-time", 0.0, "DOUBLE");
var du1_offtime = props.globals.initNode("/instrumentation/du/du1-off-time", 0.0, "DOUBLE");
var du1_test_amount = props.globals.initNode("/instrumentation/du/du1-test-amount", 0.0, "DOUBLE");
var du2_test = props.globals.initNode("/instrumentation/du/du2-test", 0, "BOOL");
var du2_test_time = props.globals.initNode("/instrumentation/du/du2-test-time", 0.0, "DOUBLE");
@ -134,6 +135,7 @@ var du5_test_amount = props.globals.initNode("/instrumentation/du/du5-test-amoun
var du6_test = props.globals.initNode("/instrumentation/du/du6-test", 0, "BOOL");
var du6_test_time = props.globals.initNode("/instrumentation/du/du6-test-time", 0.0, "DOUBLE");
var du6_test_amount = props.globals.initNode("/instrumentation/du/du6-test-amount", 0.0, "DOUBLE");
var du6_offtime = props.globals.initNode("/instrumentation/du/du6-off-time", 0.0, "DOUBLE");
var canvas_PFD_base = {
init: func(canvas_group, file) {
@ -187,47 +189,58 @@ var canvas_PFD_base = {
"QNH_std","QNH_box","LOC_pointer","LOC_scale","GS_scale","GS_pointer","CRS_pointer","HDG_target","HDG_scale","HDG_one","HDG_two","HDG_three","HDG_four","HDG_five","HDG_six","HDG_seven","HDG_digit_L","HDG_digit_R","HDG_error","HDG_group","HDG_frame",
"TRK_pointer","machError"];
},
update: func() {
elapsedtime_act = elapsedtime.getValue();
updateDu1: func() {
var elapsedtime_act = elapsedtime.getValue();
if (acess.getValue() >= 110) {
if (wow0.getValue() == 1) {
if (acconfig.getValue() != 1 and du1_test.getValue() != 1) {
if (du1_offtime.getValue() + 3 < elapsedtime_act) {
if (wow0.getValue() == 1) {
if (acconfig.getValue() != 1 and du1_test.getValue() != 1) {
du1_test.setValue(1);
du1_test_amount.setValue(math.round((rand() * 5 ) + 35, 0.1));
du1_test_time.setValue(elapsedtime_act);
} else if (acconfig.getValue() == 1 and du1_test.getValue() != 1) {
du1_test.setValue(1);
du1_test_amount.setValue(math.round((rand() * 5 ) + 35, 0.1));
du1_test_time.setValue(elapsedtime_act - 30);
}
} else {
du1_test.setValue(1);
du1_test_amount.setValue(math.round((rand() * 5 ) + 35, 0.1));
du1_test_time.setValue(elapsedtime_act);
} else if (acconfig.getValue() == 1 and du1_test.getValue() != 1) {
du1_test.setValue(1);
du1_test_amount.setValue(math.round((rand() * 5 ) + 35, 0.1));
du1_test_time.setValue(elapsedtime_act - 30);
du1_test_amount.setValue(0);
du1_test_time.setValue(-100);
}
} else {
du1_test.setValue(1);
du1_test_amount.setValue(0);
du1_test_time.setValue(-100);
}
} else {
du1_test.setValue(0);
du1_offtime.setValue(elapsedtime_act);
}
},
updateDu6: func() {
var elapsedtime_act = elapsedtime.getValue();
if (ac2.getValue() >= 110) {
if (wow0.getValue() == 1) {
if (acconfig.getValue() != 1 and du6_test.getValue() != 1) {
if (du6_offtime.getValue() + 3 < elapsedtime_act) {
if (wow0.getValue() == 1) {
if (acconfig.getValue() != 1 and du6_test.getValue() != 1) {
du6_test.setValue(1);
du6_test_amount.setValue(math.round((rand() * 5 ) + 35, 0.1));
du6_test_time.setValue(elapsedtime_act);
} else if (acconfig.getValue() == 1 and du6_test.getValue() != 1) {
du6_test.setValue(1);
du6_test_amount.setValue(math.round((rand() * 5 ) + 35, 0.1));
du6_test_time.setValue(elapsedtime_act - 30);
}
} else {
du6_test.setValue(1);
du6_test_amount.setValue(math.round((rand() * 5 ) + 35, 0.1));
du6_test_time.setValue(elapsedtime_act);
} else if (acconfig.getValue() == 1 and du6_test.getValue() != 1) {
du6_test.setValue(1);
du6_test_amount.setValue(math.round((rand() * 5 ) + 35, 0.1));
du6_test_time.setValue(elapsedtime_act - 30);
du6_test_amount.setValue(0);
du6_test_time.setValue(-100);
}
} else {
du6_test.setValue(1);
du6_test_amount.setValue(0);
du6_test_time.setValue(-100);
}
} else {
du6_test.setValue(0);
du6_offtime.setValue(elapsedtime_act);
}
},
update: func() {
var elapsedtime_act = elapsedtime.getValue();
if (acconfig_mismatch.getValue() == "0x000") {
PFD_1_mismatch.page.hide();
@ -1556,4 +1569,12 @@ var fontSizeHDG = func(input) {
} else {
return 32;
}
};
};
setlistener("/systems/electrical/bus/ac-ess", func() {
canvas_PFD_base.updateDu1();
}, 0, 0);
setlistener("/systems/electrical/bus/ac-2", func() {
canvas_PFD_base.updateDu6();
}, 0, 0);

View file

@ -28,6 +28,7 @@ var N1_lim = props.globals.initNode("/ECAM/Upper/N1ylim", 0, "DOUBLE");
var du3_test = props.globals.initNode("/instrumentation/du/du3-test", 0, "BOOL");
var du3_test_time = props.globals.initNode("/instrumentation/du/du3-test-time", 0.0, "DOUBLE");
var du3_test_amount = props.globals.initNode("/instrumentation/du/du3-test-amount", 0.0, "DOUBLE");
var du3_offtime = props.globals.initNode("/instrumentation/du/du3-off-time", 0.0, "DOUBLE");
# Fetch nodes:
var et = props.globals.getNode("/sim/time/elapsed-sec", 1);
@ -133,28 +134,34 @@ var canvas_upperECAM_base = {
getKeys: func() {
return [];
},
update: func() {
elapsedtime = et.getValue();
updateDu3: func() {
var elapsedtime = et.getValue();
if (acess.getValue() >= 110) {
if (wow0.getValue() == 1) {
if (acconfig.getValue() != 1 and du3_test.getValue() != 1) {
if (du3_offtime.getValue() + 3 < elapsedtime) {
if (wow0.getValue() == 1) {
if (acconfig.getValue() != 1 and du3_test.getValue() != 1) {
du3_test.setValue(1);
du3_test_amount.setValue(math.round((rand() * 5 ) + 35, 0.1));
du3_test_time.setValue(elapsedtime);
} else if (acconfig.getValue() == 1 and du3_test.getValue() != 1) {
du3_test.setValue(1);
du3_test_amount.setValue(math.round((rand() * 5 ) + 35, 0.1));
du3_test_time.setValue(elapsedtime - 30);
}
} else {
du3_test.setValue(1);
du3_test_amount.setValue(math.round((rand() * 5 ) + 35, 0.1));
du3_test_time.setValue(elapsedtime);
} else if (acconfig.getValue() == 1 and du3_test.getValue() != 1) {
du3_test.setValue(1);
du3_test_amount.setValue(math.round((rand() * 5 ) + 35, 0.1));
du3_test_time.setValue(elapsedtime - 30);
du3_test_amount.setValue(0);
du3_test_time.setValue(-100);
}
} else {
du3_test.setValue(1);
du3_test_amount.setValue(0);
du3_test_time.setValue(-100);
}
} else {
du3_test.setValue(0);
du3_offtime.setValue(elapsedtime);
}
},
update: func() {
var elapsedtime = et.getValue();
cur_eng_option = eng_option.getValue();
if (acess.getValue() >= 110 and du3_lgt.getValue() > 0.01) {
@ -1168,6 +1175,7 @@ var canvas_upperECAM_test = {
return ["Test_white","Test_text"];
},
update: func() {
var elapsedtime = et.getValue();
if (du3_test_time.getValue() + 1 >= elapsedtime) {
me["Test_white"].show();
me["Test_text"].hide();
@ -1212,3 +1220,7 @@ var showUpperECAM = func {
var dlg = canvas.Window.new([512, 512], "dialog").set("resize", 1);
dlg.setCanvas(upperECAM_display);
}
setlistener("/systems/electrical/bus/ac-ess", func() {
canvas_upperECAM_base.updateDu3();
}, 0, 0);

View file

@ -341,12 +341,12 @@ var ECAM_controller = {
}
},
warningReset: func(warning) {
if (warning.aural != 9 and warning.active == 1) {
aural[warning.aural].setBoolValue(0);
}
warning.active = 0;
warning.noRepeat = 0;
warning.noRepeat2 = 0;
if (warning.aural == 2) {
aural[2].setValue(0);
}
},
};

View file

@ -151,8 +151,10 @@ var FCUController = {
setprop("/it-autoflight/sound/apoffsound", 0);
setprop("/it-autoflight/sound/apoffsound2", 0);
}
setprop("/it-autoflight/output/ap-warning", 0);
setprop("/ECAM/warnings/master-warning-light", 0);
if (getprop("/it-autoflight/output/ap-warning") != 0) {
setprop("/it-autoflight/output/ap-warning", 0);
setprop("/ECAM/warnings/master-warning-light", 0);
}
}
}
},

View file

@ -955,14 +955,26 @@
</clipto>
</pure_gain>
<switch name="/instrumentation/transponder/altimeter-input">
<test logic="AND" value="/systems/navigation/adr/output/baro-alt-corrected-1-capt">
<switch name="/instrumentation/transponder/altimeter-input/mode-c-alt-ft">
<test logic="AND" value="/instrumentation/altimeter[0]/mode-c-alt-ft">
/instrumentation/transponder/altimeter-input-src eq 1
</test>
<test logic="AND" value="/systems/navigation/adr/output/baro-alt-corrected-2-capt">
<test logic="AND" value="/instrumentation/altimeter[1]/mode-c-alt-ft">
/instrumentation/transponder/altimeter-input-src eq 2
</test>
<test logic="AND" value="/systems/navigation/adr/output/baro-alt-corrected-3-capt">
<test logic="AND" value="/instrumentation/altimeter[2]/mode-c-alt-ft">
/instrumentation/transponder/altimeter-input-src eq 3
</test>
</switch>
<switch name="/instrumentation/transponder/altimeter-input/mode-s-alt-ft">
<test logic="AND" value="/instrumentation/altimeter[0]/mode-s-alt-ft">
/instrumentation/transponder/altimeter-input-src eq 1
</test>
<test logic="AND" value="/instrumentation/altimeter[1]/mode-s-alt-ft">
/instrumentation/transponder/altimeter-input-src eq 2
</test>
<test logic="AND" value="/instrumentation/altimeter[2]/mode-s-alt-ft">
/instrumentation/transponder/altimeter-input-src eq 3
</test>
</switch>

View file

@ -226,8 +226,6 @@
<mode>2</mode>
<encoder-path>/instrumentation/transponder/altimeter-input</encoder-path>
<airspeed-path>/instrumentation/transponder/airspeed-input</airspeed-path>
<mode-c-altitude>/instrumentation/encoder/mode-c-alt-ft</mode-c-altitude>
<mode-s-altitude>/instrumentation/encoder/mode-s-alt-ft</mode-s-altitude>
</transponder>
<turn-indicator>