2019-10-14 16:48:35 +00:00
|
|
|
# A3XX Buttons
|
|
|
|
# Joshua Davidson (Octal450)
|
|
|
|
|
2020-04-18 05:36:46 +00:00
|
|
|
# Copyright (c) 2020 Josh Davidson (Octal450)
|
2019-10-14 16:48:35 +00:00
|
|
|
|
2020-05-03 20:05:44 +00:00
|
|
|
var OnLt = props.globals.getNode("/controls/switches/emerCallLtO");
|
|
|
|
var CallLt = props.globals.getNode("/controls/switches/emerCallLtC");
|
|
|
|
var EmerCall = props.globals.getNode("/controls/switches/emerCall");
|
|
|
|
var CabinCall = props.globals.getNode("/controls/switches/cabinCall");
|
|
|
|
var MechCall = props.globals.getNode("/controls/switches/mechCall");
|
|
|
|
var cvr_tone = props.globals.getNode("/controls/CVR/tone");
|
|
|
|
|
2019-10-14 16:48:35 +00:00
|
|
|
# Resets buttons to the default values
|
2020-11-28 15:25:02 +00:00
|
|
|
var variousReset = func() {
|
2020-11-22 20:42:51 +00:00
|
|
|
setprop("/modes/cpt-du-xfr", 0);
|
|
|
|
setprop("/modes/fo-du-xfr", 0);
|
2020-09-12 17:21:23 +00:00
|
|
|
setprop("/controls/fadec/n1mode1", 0);
|
|
|
|
setprop("/controls/fadec/n1mode2", 0);
|
2020-11-22 20:42:51 +00:00
|
|
|
setprop("/instrumentation/mk-viii/serviceable", 1);
|
|
|
|
setprop("/instrumentation/mk-viii/inputs/discretes/ta-tcf-inhibit", 0);
|
|
|
|
setprop("/instrumentation/mk-viii/inputs/discretes/gpws-inhibit", 0);
|
|
|
|
setprop("/instrumentation/mk-viii/inputs/discretes/glideslope-inhibit", 0);
|
|
|
|
setprop("/instrumentation/mk-viii/inputs/discretes/momentary-flap-all-override", 0);
|
|
|
|
setprop("/instrumentation/mk-viii/inputs/discretes/momentary-flap-3-override", 0);
|
2020-09-12 17:21:23 +00:00
|
|
|
setprop("/controls/switches/cabinCall", 0);
|
|
|
|
setprop("/controls/switches/mechCall", 0);
|
|
|
|
setprop("/controls/switches/emer-lights", 0.5);
|
2019-10-14 16:48:35 +00:00
|
|
|
# cockpit voice recorder stuff
|
2020-09-12 17:21:23 +00:00
|
|
|
setprop("/controls/CVR/power", 0);
|
|
|
|
setprop("/controls/CVR/test", 0);
|
|
|
|
setprop("/controls/CVR/tone", 0);
|
|
|
|
setprop("/controls/CVR/gndctl", 0);
|
|
|
|
setprop("/controls/CVR/erase", 0);
|
|
|
|
setprop("/controls/switches/pneumatics/cabin-fans", 1);
|
|
|
|
setprop("/controls/oxygen/crewOxyPB", 1); # 0 = OFF 1 = AUTO
|
|
|
|
setprop("/controls/switches/emerCallLtO", 0); # ON light, flashes white for 10s
|
|
|
|
setprop("/controls/switches/emerCallLtC", 0); # CALL light, flashes amber for 10s
|
|
|
|
setprop("/controls/switches/emerCall", 0);
|
|
|
|
setprop("/controls/switches/LrainRpt", 0);
|
|
|
|
setprop("/controls/switches/RrainRpt", 0);
|
|
|
|
setprop("/controls/switches/wiperLspd", 0); # -1 = INTM 0 = OFF 1 = LO 2 = HI
|
|
|
|
setprop("/controls/switches/wiperRspd", 0); # -1 = INTM 0 = OFF 1 = LO 2 = HI
|
|
|
|
setprop("/controls/lighting/strobe", 0);
|
|
|
|
setprop("/controls/lighting/beacon", 0);
|
|
|
|
setprop("/controls/switches/beacon", 0);
|
|
|
|
setprop("/controls/switches/wing-lights", 0);
|
|
|
|
setprop("/controls/switches/landing-lights-l", 0);
|
|
|
|
setprop("/controls/switches/landing-lights-r", 0);
|
|
|
|
setprop("/controls/lighting/wing-lights", 0);
|
|
|
|
setprop("/controls/lighting/nav-lights-switch", 0);
|
|
|
|
setprop("/controls/lighting/landing-lights[1]", 0);
|
|
|
|
setprop("/controls/lighting/landing-lights[2]", 0);
|
|
|
|
setprop("/controls/lighting/taxi-light-switch", 0);
|
|
|
|
setprop("/controls/lighting/DU/du1", 1);
|
|
|
|
setprop("/controls/lighting/DU/du2", 1);
|
|
|
|
setprop("/controls/lighting/DU/du3", 1);
|
|
|
|
setprop("/controls/lighting/DU/du4", 1);
|
|
|
|
setprop("/controls/lighting/DU/du5", 1);
|
|
|
|
setprop("/controls/lighting/DU/du6", 1);
|
|
|
|
setprop("/controls/lighting/DU/mcdu1", 1);
|
|
|
|
setprop("/controls/lighting/DU/mcdu2", 1);
|
2020-11-22 20:42:51 +00:00
|
|
|
setprop("/modes/fcu/hdg-time", -45);
|
2020-11-07 14:35:31 +00:00
|
|
|
setprop("/controls/navigation/switching/att-hdg", 0);
|
|
|
|
setprop("/controls/navigation/switching/air-data", 0);
|
2020-11-28 15:39:24 +00:00
|
|
|
setprop("/controls/switches/no-smoking-sign", 0.5);
|
2020-09-12 17:21:23 +00:00
|
|
|
setprop("/controls/switches/seatbelt-sign", 1);
|
2019-10-14 16:48:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
var BUTTONS = {
|
2020-11-28 15:25:02 +00:00
|
|
|
storeEmerCall: 0,
|
2019-10-14 16:48:35 +00:00
|
|
|
update: func() {
|
2020-11-28 15:25:02 +00:00
|
|
|
me.storeEmerCall = EmerCall.getValue();
|
|
|
|
if (me.storeEmerCall) {
|
|
|
|
EmerCallOnLight(me.storeEmerCall);
|
|
|
|
EmerCallLight(me.storeEmerCall);
|
2019-10-14 16:48:35 +00:00
|
|
|
}
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
2020-05-03 20:05:44 +00:00
|
|
|
var _OnLt = nil;
|
2020-11-28 15:25:02 +00:00
|
|
|
var EmerCallOnLight = func(emerCallSts) {
|
2020-05-03 20:05:44 +00:00
|
|
|
_OnLt = OnLt.getValue();
|
2020-11-28 15:25:02 +00:00
|
|
|
if ((_OnLt and emerCallSts) or !emerCallSts) {
|
2020-05-03 20:05:44 +00:00
|
|
|
OnLt.setValue(0);
|
2020-11-28 15:25:02 +00:00
|
|
|
} else if (!_OnLt and emerCallSts) {
|
2020-05-03 20:05:44 +00:00
|
|
|
OnLt.setValue(1);
|
2019-10-14 16:48:35 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-05-03 20:05:44 +00:00
|
|
|
var _CallLt = nil;
|
2020-11-28 15:25:02 +00:00
|
|
|
var EmerCallLight = func(emerCallSts) {
|
2020-05-03 20:05:44 +00:00
|
|
|
_CallLt = CallLt.getValue();
|
2020-11-28 15:25:02 +00:00
|
|
|
_EmerCall2 = emerCallSts;
|
|
|
|
if ((_CallLt and emerCallSts) or !emerCallSts) {
|
2020-05-03 20:05:44 +00:00
|
|
|
CallLt.setValue(0);
|
2020-11-28 15:25:02 +00:00
|
|
|
} else if (!_CallLt and emerCallSts) {
|
2020-05-03 20:05:44 +00:00
|
|
|
CallLt.setValue(1);
|
2019-10-14 16:48:35 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-11-28 15:25:02 +00:00
|
|
|
var _EmerCallRunning = 0;
|
|
|
|
var EmerCallFunc = func() {
|
|
|
|
if (!_EmerCallRunning) {
|
|
|
|
_EmerCallRunning = 1;
|
|
|
|
EmerCall.setValue(1);
|
|
|
|
settimer(func() {
|
|
|
|
EmerCall.setValue(0);
|
|
|
|
_EmerCallRunning = 0;
|
|
|
|
}, 7);
|
|
|
|
}
|
2019-10-14 16:48:35 +00:00
|
|
|
}
|
|
|
|
|
2020-11-28 15:25:02 +00:00
|
|
|
var _CabinCallRunning = 0;
|
|
|
|
var CabinCallFunc = func() {
|
|
|
|
if (!_CabinCallRunning) {
|
|
|
|
_CabinCallRunning = 1;
|
|
|
|
CabinCall.setValue(1);
|
|
|
|
settimer(func() {
|
|
|
|
CabinCall.setValue(0);
|
|
|
|
_CabinCallRunning = 0;
|
|
|
|
}, 2);
|
|
|
|
}
|
2019-10-14 16:48:35 +00:00
|
|
|
}
|
2020-11-28 15:25:02 +00:00
|
|
|
|
|
|
|
var _MechCallRunning = 0;
|
|
|
|
var MechCallFunc = func() {
|
|
|
|
if (!_MechCallRunning) {
|
|
|
|
_MechCallRunning = 1;
|
|
|
|
MechCall.setValue(1);
|
|
|
|
settimer(func() {
|
|
|
|
MechCall.setValue(0);
|
|
|
|
_MechCallRunning = 0;
|
|
|
|
}, 6);
|
|
|
|
}
|
2019-10-14 16:48:35 +00:00
|
|
|
}
|
|
|
|
|
2020-11-28 15:25:02 +00:00
|
|
|
var _CVRtestRunning = 0;
|
|
|
|
var CVR_test = func() {
|
2020-05-03 20:05:44 +00:00
|
|
|
if (pts.Controls.Gear.parkingBrake.getValue()) {
|
2020-11-28 15:25:02 +00:00
|
|
|
if (!_CVRtestRunning) {
|
|
|
|
_CVRtestRunning = 1;
|
|
|
|
cvr_tone.setValue(1);
|
|
|
|
settimer(func() {
|
|
|
|
_CVRtestRunning = 0;
|
|
|
|
cvr_tone.setValue(0);
|
|
|
|
}, 15);
|
|
|
|
}
|
2019-10-14 16:48:35 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-04-19 00:26:24 +00:00
|
|
|
setlistener("/controls/apu/master", func() { # poor mans set-reset latch
|
2020-05-03 20:05:44 +00:00
|
|
|
if (!systems.APUNodes.Controls.master.getValue() and (systems.APUController.APU.signals.emer or systems.APUController.APU.signals.autoshutdown)) {
|
2020-04-19 00:26:24 +00:00
|
|
|
systems.APUController.APU.signals.emer = 0;
|
2020-04-19 00:58:19 +00:00
|
|
|
systems.APUController.APU.signals.autoshutdown = 0;
|
2019-10-14 16:48:35 +00:00
|
|
|
}
|
2020-04-27 15:37:43 +00:00
|
|
|
}, 0, 0);
|
|
|
|
|
2020-11-28 15:25:02 +00:00
|
|
|
var toggleSTD = func() {
|
2020-04-27 15:37:43 +00:00
|
|
|
if (pts.Instrumentation.Altimeter.std.getBoolValue()) {
|
|
|
|
pts.Instrumentation.Altimeter.settingInhg.setValue(pts.Instrumentation.Altimeter.oldQnh.getValue());
|
|
|
|
pts.Instrumentation.Altimeter.std.setBoolValue(0);
|
|
|
|
} else {
|
|
|
|
pts.Instrumentation.Altimeter.oldQnh.setValue(pts.Instrumentation.Altimeter.settingInhg.getValue());
|
|
|
|
pts.Instrumentation.Altimeter.settingInhg.setValue(29.92);
|
|
|
|
pts.Instrumentation.Altimeter.std.setBoolValue(1);
|
|
|
|
}
|
2020-10-13 19:50:22 +00:00
|
|
|
}
|