1
0
Fork 0

Finish ELEC

This commit is contained in:
legoboyvdlp R 2021-07-24 13:58:03 +01:00
parent 31ece32ee9
commit 1775bb0e16
2 changed files with 282 additions and 429 deletions

View file

@ -111,15 +111,19 @@ var canvas_lowerECAMPageElec =
props.UpdateManager.FromHashValue("engine1Running", nil, func(val) {
if (val == 0) {
obj["ELEC-IDG-1-num-label"].setColor(0.7333,0.3803,0);
obj["GEN1-num-label"].setColor(0.7333,0.3803,0);
} else {
obj["ELEC-IDG-1-num-label"].setColor(0.8078,0.8039,0.8078);
obj["GEN1-num-label"].setColor(0.8078,0.8039,0.8078);
}
}),
props.UpdateManager.FromHashValue("engine2Running", nil, func(val) {
if (val == 0) {
obj["ELEC-IDG-2-num-label"].setColor(0.7333,0.3803,0);
obj["GEN2-num-label"].setColor(0.7333,0.3803,0);
} else {
obj["ELEC-IDG-2-num-label"].setColor(0.8078,0.8039,0.8078);
obj["GEN2-num-label"].setColor(0.8078,0.8039,0.8078);
}
}),
props.UpdateManager.FromHashValue("dc1", 0.5, func(val) {
@ -143,7 +147,7 @@ var canvas_lowerECAMPageElec =
obj["ELEC-DCESS-label"].setColor(0.7333,0.3803,0);
}
}),
props.UpdateManager.FromHashValue("ac1", 0.5, func(val) {
props.UpdateManager.FromHashValue("elecAC1", 0.5, func(val) {
if (val >= 110) {
obj["ELEC-AC1-label"].setColor(0.0509,0.7529,0.2941);
obj["AC1-in"].show();
@ -152,7 +156,7 @@ var canvas_lowerECAMPageElec =
obj["AC1-in"].hide();
}
}),
props.UpdateManager.FromHashValue("ac2", 0.5, func(val) {
props.UpdateManager.FromHashValue("elecAC2", 0.5, func(val) {
if (val >= 110) {
obj["ELEC-AC2-label"].setColor(0.0509,0.7529,0.2941);
obj["AC2-in"].show();
@ -161,14 +165,14 @@ var canvas_lowerECAMPageElec =
obj["AC2-in"].hide();
}
}),
props.UpdateManager.FromHashValue("acEss", 0.5, func(val) {
props.UpdateManager.FromHashValue("elecACEss", 0.5, func(val) {
if (val >= 110) {
obj["ELEC-ACESS-label"].setColor(0.0509,0.7529,0.2941);
} else {
obj["ELEC-ACESS-label"].setColor(0.7333,0.3803,0);
}
}),
props.UpdateManager.FromHashValue("acEssShed", 0.5, func(val) {
props.UpdateManager.FromHashValue("elecACEssShed", 0.5, func(val) {
if (val >= 110) {
obj["ACESS-SHED"].hide();
} else {
@ -204,8 +208,8 @@ var canvas_lowerECAMPageElec =
} else {
obj["BAT1-OFF"].hide();
obj["BAT1-content"].show();
obj["Bat1Ampere"].setText(sprintf("%s", val.elecBat1Amp));
obj["Bat1Volt"].setText(sprintf("%s", val.elecBat1Volt));
obj["Bat1Ampere"].setText(sprintf("%2.0f", val.elecBat1Amp));
obj["Bat1Volt"].setText(sprintf("%2.0f", val.elecBat1Volt));
if (val.elecBat1Volt >= 24.95 and val.elecBat1Volt <= 31.05) {
obj["Bat1Volt"].setColor(0.0509,0.7529,0.2941);
@ -248,8 +252,8 @@ var canvas_lowerECAMPageElec =
} else {
obj["BAT2-OFF"].hide();
obj["BAT2-content"].show();
obj["Bat2Ampere"].setText(sprintf("%s", val.elecBat2Amp));
obj["Bat2Volt"].setText(sprintf("%s", val.elecBat2Volt));
obj["Bat2Ampere"].setText(sprintf("%2.0f", val.elecBat2Amp));
obj["Bat2Volt"].setText(sprintf("%2.0f", val.elecBat2Volt));
if (val.elecBat2Volt >= 24.95 and val.elecBat2Volt <= 31.05) {
obj["Bat2Volt"].setColor(0.0509,0.7529,0.2941);
@ -384,7 +388,7 @@ var canvas_lowerECAMPageElec =
obj["ELEC-Line-DC1-DCESS"].hide();
}
}),
props.UpdateManager.FromHashValue("elecDcEssFeedTr", nil, func(val) {
props.UpdateManager.FromHashValue("elecTrEssContact", nil, func(val) {
if (val) {
obj["ELEC-Line-ESSTR-DCESS"].show();
} else {
@ -400,6 +404,252 @@ var canvas_lowerECAMPageElec =
obj["ELEC-Line-Emergen-ESSTR"].hide();
}
}),
props.UpdateManager.FromHashList(["elecTREssAmp","elecTREssVolt","elecTrEssContact"], nil, func(val) {
if (val.elecTrEssContact) {
obj["ESSTR-group"].show();
obj["ESSTR-Volt"].setText(sprintf("%s", math.round(val.elecTREssVolt)));
obj["ESSTR-Ampere"].setText(sprintf("%s", math.round(val.elecTREssAmp)));
if (val.elecTREssVolt < 25 or val.elecTREssVolt > 31 or val.elecTREssAmp < 5) {
obj["ESSTR"].setColor(0.7333,0.3803,0);
} else {
obj["ESSTR"].setColor(0.8078,0.8039,0.8078);
}
if (val.elecTREssVolt < 25 or val.elecTREssVolt > 31) {
obj["ESSTR-Volt"].setColor(0.7333,0.3803,0);
} else {
obj["ESSTR-Volt"].setColor(0.0509,0.7529,0.2941);
}
if (val.elecTREssAmp < 5) {
obj["ESSTR-Ampere"].setColor(0.7333,0.3803,0);
} else {
obj["ESSTR-Ampere"].setColor(0.0509,0.7529,0.2941);
}
} else {
obj["ESSTR-group"].hide();
}
}),
props.UpdateManager.FromHashList(["elecEmerGenHertz","elecEmerGenVolts","elecEmerGenVoltsRelay"], nil, func(val) {
if (val.elecEmerGenVolts == 0) {
obj["EMERGEN-group"].hide();
obj["ELEC-Line-Emergen-ESSTR"].hide();
obj["ELEC-Line-Emergen-ESSTR-off"].show();
obj["EMERGEN-Label-off"].show();
} else {
obj["EMERGEN-group"].show();
obj["ELEC-Line-Emergen-ESSTR"].show();
obj["ELEC-Line-Emergen-ESSTR-off"].hide();
obj["EMERGEN-Label-off"].hide();
obj["EmergenVolt"].setText(sprintf("%s", math.round(val.elecEmerGenVoltsRelay)));
obj["EmergenHz"].setText(sprintf("%s", math.round(val.elecEmerGenHertz)));
if (val.elecEmerGenVoltsRelay > 120 or val.elecEmerGenVoltsRelay < 110 or val.elecEmerGenHertz > 410 or val.elecEmerGenHertz < 390) {
obj["Emergen-Label"].setColor(0.7333,0.3803,0);
} else {
obj["Emergen-Label"].setColor(0.8078,0.8039,0.8078);
}
if (val.elecEmerGenVoltsRelay > 120 or val.elecEmerGenVoltsRelay < 110) {
obj["EmergenVolt"].setColor(0.7333,0.3803,0);
} else {
obj["EmergenVolt"].setColor(0.0509,0.7529,0.2941);
}
if (val.elecEmerGenHertz > 410 or val.elecEmerGenHertz < 390) {
obj["EmergenHz"].setColor(0.7333,0.3803,0);
} else {
obj["EmergenHz"].setColor(0.0509,0.7529,0.2941);
}
}
}),
props.UpdateManager.FromHashList(["elecGen1Switch","elecGen1Hertz","elecGen1Volt","engine1Running","elecGen1Relay"], nil, func(val) {
if (val.elecGen1Switch == 0) {
obj["GEN1-content"].hide();
obj["GEN1-off"].show();
if (val.elecGen1Relay) {
obj["GEN1-label"].setColor(0.7333,0.3803,0);
} else {
obj["GEN1-label"].setColor(0.8078,0.8039,0.8078);
}
} else {
obj["GEN1-content"].show();
obj["GEN1-off"].hide();
obj["Gen1Volt"].setText(sprintf("%s", math.round(val.elecGen1Volt)));
if (val.elecGen1Hertz == 0) {
obj["Gen1Hz"].setText(sprintf("XX"));
} else {
obj["Gen1Hz"].setText(sprintf("%s", math.round(val.elecGen1Hertz)));
}
if (val.elecGen1Volt > 120 or val.elecGen1Volt < 110 or val.elecGen1Hertz > 410 or val.elecGen1Hertz < 390) {
obj["GEN1-label"].setColor(0.7333,0.3803,0);
} else {
obj["GEN1-label"].setColor(0.8078,0.8039,0.8078);
}
if (val.elecGen1Volt > 120 or val.elecGen1Volt < 110) {
obj["Gen1Volt"].setColor(0.7333,0.3803,0);
} else {
obj["Gen1Volt"].setColor(0.0509,0.7529,0.2941);
}
if (val.elecGen1Hertz > 410 or val.elecGen1Hertz < 390) {
obj["Gen1Hz"].setColor(0.7333,0.3803,0);
} else {
obj["Gen1Hz"].setColor(0.0509,0.7529,0.2941);
}
}
}),
props.UpdateManager.FromHashList(["elecGen2Switch","elecGen2Hertz","elecGen2Volt","engine1Running","elecGen2Relay"], nil, func(val) {
if (val.elecGen2Switch == 0) {
obj["GEN2-content"].hide();
obj["GEN2-off"].show();
if (val.elecGen2Relay) {
obj["GEN2-label"].setColor(0.7333,0.3803,0);
} else {
obj["GEN2-label"].setColor(0.8078,0.8039,0.8078);
}
} else {
obj["GEN2-content"].show();
obj["GEN2-off"].hide();
obj["Gen2Volt"].setText(sprintf("%s", math.round(val.elecGen2Volt)));
if (val.elecGen2Hertz == 0) {
obj["Gen2Hz"].setText(sprintf("XX"));
} else {
obj["Gen2Hz"].setText(sprintf("%s", math.round(val.elecGen2Hertz)));
}
if (val.elecGen2Volt > 120 or val.elecGen2Volt < 110 or val.elecGen2Hertz > 410 or val.elecGen2Hertz < 390) {
obj["GEN2-label"].setColor(0.7333,0.3803,0);
} else {
obj["GEN2-label"].setColor(0.8078,0.8039,0.8078);
}
if (val.elecGen2Volt > 120 or val.elecGen2Volt < 110) {
obj["Gen2Volt"].setColor(0.7333,0.3803,0);
} else {
obj["Gen2Volt"].setColor(0.0509,0.7529,0.2941);
}
if (val.elecGen2Hertz > 410 or val.elecGen2Hertz < 390) {
obj["Gen2Hz"].setColor(0.7333,0.3803,0);
} else {
obj["Gen2Hz"].setColor(0.0509,0.7529,0.2941);
}
}
}),
props.UpdateManager.FromHashList(["elecTR1Contact","elecAC1"], nil, func(val) {
if (val.elecTR1Contact) {
if (val.elecAC1 < 110) {
obj["ELEC-Line-AC1-TR1"].setColorFill(0.7333,0.3803,0);
} else {
obj["ELEC-Line-AC1-TR1"].setColorFill(0.0509,0.7529,0.2941);
}
obj["ELEC-Line-AC1-TR1"].show();
obj["ELEC-Line-TR1-DC1"].show();
} else {
obj["ELEC-Line-AC1-TR1"].hide();
obj["ELEC-Line-TR1-DC1"].hide();
}
}),
props.UpdateManager.FromHashList(["elecTR2Contact","elecAC2"], nil, func(val) {
if (val.elecTR2Contact) {
if (val.elecAC2 < 110) {
obj["ELEC-Line-AC2-TR2"].setColorFill(0.7333,0.3803,0);
} else {
obj["ELEC-Line-AC2-TR2"].setColorFill(0.0509,0.7529,0.2941);
}
obj["ELEC-Line-AC2-TR2"].show();
obj["ELEC-Line-TR2-DC2"].show();
} else {
obj["ELEC-Line-AC2-TR2"].hide();
obj["ELEC-Line-TR2-DC2"].hide();
}
}),
props.UpdateManager.FromHashList(["elecAcEssFeed1","elecAcEssFeed2","elecAC1","elecAC2"], nil, func(val) {
if (val.elecAcEssFeed1) {
if (val.elecAC1 >= 110) {
obj["ELEC-Line-AC1-ACESS"].show();
} else {
obj["ELEC-Line-AC1-ACESS"].hide();
}
obj["ELEC-Line-AC2-ACESS"].hide();
} elsif (val.elecAcEssFeed2) {
obj["ELEC-Line-AC1-ACESS"].hide();
if (val.elecAC2 >= 110) {
obj["ELEC-Line-AC2-ACESS"].show();
} else {
obj["ELEC-Line-AC2-ACESS"].hide();
}
} else {
obj["ELEC-Line-AC1-ACESS"].hide();
obj["ELEC-Line-AC2-ACESS"].hide();
}
}),
props.UpdateManager.FromHashList(["elecGen1Volt","elecGen1GLC"], nil, func(val) {
if (val.elecGen1Volt >= 110 and val.elecGen1GLC) {
obj["ELEC-Line-GEN1-AC1"].show();
} else {
obj["ELEC-Line-GEN1-AC1"].hide();
}
}),
props.UpdateManager.FromHashList(["elecGen2Volt","elecGen2GLC"], nil, func(val) {
if (val.elecGen2Volt >= 110 and val.elecGen2GLC) {
obj["ELEC-Line-GEN1-AC1"].show();
} else {
obj["ELEC-Line-GEN1-AC1"].hide();
}
}),
props.UpdateManager.FromHashList(["elecAcTie1","elecAcTie2","apuGLC","elecExtEPC","elecGen1GLC","elecGen2GLC"], nil, func(val) {
if (val.apuGLC and (val.elecAcTie1 or val.elecAcTie2)) {
obj["APU-out"].show();
} else {
obj["APU-out"].hide();
}
if (val.elecExtEPC and (val.elecAcTie1 or val.elecAcTie2)) {
obj["EXT-out"].show();
} else {
obj["EXT-out"].hide();
}
if (val.elecAcTie1 and val.elecAcTie2) {
obj["ELEC-Line-APU-AC1"].show();
obj["ELEC-Line-APU-EXT"].show();
obj["ELEC-Line-EXT-AC2"].show();
} else {
if (val.elecAcTie1) {
obj["ELEC-Line-APU-AC1"].show();
} else {
obj["ELEC-Line-APU-AC1"].hide();
}
if ((val.elecAcTie2 and val.apuGLC and !val.elecGen2GLC) or (val.elecAcTie1 and val.elecExtEPC and !val.elecGen1GLC)) {
obj["ELEC-Line-APU-EXT"].show();
} else {
obj["ELEC-Line-APU-EXT"].hide();
}
if (val.elecAcTie2) {
obj["ELEC-Line-EXT-AC2"].show();
} else {
obj["ELEC-Line-EXT-AC2"].hide();
}
}
}),
props.UpdateManager.FromHashList(["elecACEss"], nil, func(val) {
if (val.elecACEss >= 110 and !val.elecAcEssEmerGenFeed and (!val.elecTR1Contact or !val.elecTR2Contact)) {
obj["ELEC-Line-ACESS-TRESS"].show();
} else {
obj["ELEC-Line-ACESS-TRESS"].hide();
}
}),
];
obj.displayedGForce = 0;
@ -521,6 +771,8 @@ var canvas_lowerECAMPageElec =
};
var input = {
elecAcEssFeed1: "/systems/electrical/relay/ac-ess-feed-1/contact-pos",
elecAcEssFeed2: "/systems/electrical/relay/ac-ess-feed-2/contact-pos",
elecBat1Amp: "/systems/electrical/sources/bat-1/amps",
elecBat2Amp: "/systems/electrical/sources/bat-2/amps",
elecBat1Direction: "/systems/electrical/sources/bat-1/direction",
@ -535,6 +787,11 @@ var input = {
elecTR2Amp: "/systems/electrical/relay/tr-contactor-2/output-amp",
elecTR1Volt: "/systems/electrical/relay/tr-contactor-1/output",
elecTR2Volt: "/systems/electrical/relay/tr-contactor-2/output",
elecTR1Contact: "/systems/electrical/relay/tr-contactor-1/contact-pos",
elecTR2Contact: "/systems/electrical/relay/tr-contactor-2/contact-pos",
elecTREssAmp: "/systems/electrical/relay/dc-ess-feed-tr/output-amp",
elecTrEssContact: "/systems/electrical/relay/dc-ess-feed-tr/contact-pos",
elecTREssVolt: "/systems/electrical/relay/dc-ess-feed-tr/output",
elecIDG1Disc: "/controls/electrical/switches/idg-1-disc",
elecIDG2Disc: "/controls/electrical/switches/idg-2-disc",
elecGroundCart: "/controls/electrical/ground-cart",
@ -543,8 +800,23 @@ var input = {
elecDCTie1: "/systems/electrical/relay/dc-bus-tie-dc-1/contact-pos",
elecDCTie2: "/systems/electrical/relay/dc-bus-tie-dc-2/contact-pos",
elecDcEssFeedBat: "/systems/electrical/relay/dc-ess-feed-bat/contact-pos",
elecDcEssFeedTr: "/systems/electrical/relay/dc-ess-feed-tr/contact-pos",
elecAcEssEmerGenFeed: "/systems/electrical/relay/ac-ess-feed-emer-gen/contact-pos",
elecEmerGenVolts: "/systems/electrical/sources/emer-gen/output-volt",
elecEmerGenVoltsRelay: "/systems/electrical/relay/emer-glc/output",
elecEmerGenHertz: "/systems/electrical/sources/emer-gen/output-hertz",
elecGen1Switch: "/controls/electrical/switches/gen-1",
elecGen1Hertz: "/systems/electrical/sources/idg-1/output-hertz",
elecGen1Volt: "/systems/electrical/sources/idg-1/output-volt",
elecGen1Relay: "/systems/electrical/sources/idg-1/gcr-relay",
elecGen1GLC: "/systems/electrical/relay/gen-1-glc/contact-pos",
elecGen2Switch: "/controls/electrical/switches/gen-2",
elecGen2Hertz: "/systems/electrical/sources/idg-2/output-hertz",
elecGen2Volt: "/systems/electrical/sources/idg-2/output-volt",
elecGen2Relay: "/systems/electrical/sources/idg-2/gcr-relay",
elecGen2GLC: "/systems/electrical/relay/gen-2-glc/contact-pos",
elecAcTie1: "/systems/electrical/relay/ac-bus-ac-bus-tie-1/contact-pos",
elecAcTie2: "/systems/electrical/relay/ac-bus-ac-bus-tie-2/contact-pos",
elecExtEPC: "/systems/electrical/relay/ext-epc/contact-pos",
ElecGalleyShed: "/systems/electrical/some-electric-thingie/galley-shed",
};

View file

@ -1,419 +0,0 @@
# A3XX Lower ECAM Canvas
# Copyright (c) 2020 Josh Davidson (Octal450)
var lowerECAM_apu = nil;
var lowerECAM_bleed = nil;
var lowerECAM_cond = nil;
var lowerECAM_crz = nil;
var lowerECAM_door = nil;
var lowerECAM_elec = nil;
var lowerECAM_eng = nil;
var lowerECAM_fctl = nil;
var lowerECAM_fuel = nil;
var lowerECAM_hyd = nil;
var lowerECAM_press = nil;
var lowerECAM_status = nil;
var lowerECAM_wheel = nil;
var lowerECAM_test = nil;
var lowerECAM_display = nil;
var page = "fctl";
var blue_psi = 0;
var green_psi = 0;
var yellow_psi = 0;
var autobrakemode = 0;
var nosegear = 0;
var leftgear = 0;
var rightgear = 0;
var leftdoor = 0;
var rightdoor = 0;
var nosedoor = 0;
var gearlvr = 0;
var elapsedtime = 0;
var tr1_v = 0;
var tr1_a = 0;
var tr2_v = 0;
var tr2_a = 0;
var essTramps = 0;
var essTrvolts = 0;
var elac1Node = 0;
var elac2Node = 0;
var sec1Node = 0;
var sec2Node = 0;
var eng_valve_state = 0;
var bleed_valve_cur = 0;
var hp_valve_state = 0;
var xbleedcmdstate = 0;
var ramAirState = 0;
# Fetch Nodes
var acconfig_weight_kgs = props.globals.getNode("/systems/acconfig/options/weight-kgs", 1);
var rate = props.globals.getNode("/systems/acconfig/options/lecam-rate", 1);
var autoconfig_running = props.globals.getNode("/systems/acconfig/autoconfig-running", 1);
var ecam_page = props.globals.getNode("/ECAM/Lower/page", 1);
var hour = props.globals.getNode("/sim/time/utc/hour", 1);
var minute = props.globals.getNode("/sim/time/utc/minute", 1);
var apu_flap = props.globals.getNode("/controls/apu/inlet-flap/position-norm", 1);
var apu_rpm = props.globals.getNode("/engines/engine[2]/n1", 1);
var apu_egt = props.globals.getNode("/systems/apu/egt-degC", 1);
var door_left = props.globals.getNode("/ECAM/Lower/door-left", 1);
var door_right = props.globals.getNode("/ECAM/Lower/door-right", 1);
var door_nose_left = props.globals.getNode("/ECAM/Lower/door-nose-left", 1);
var door_nose_right = props.globals.getNode("/ECAM/Lower/door-nose-right", 1);
var apu_rpm_rot = props.globals.getNode("/ECAM/Lower/APU-N", 1);
var apu_egt_rot = props.globals.getNode("/ECAM/Lower/APU-EGT", 1);
var oil_qt1 = props.globals.getNode("/ECAM/Lower/Oil-QT[0]", 1);
var oil_qt2 = props.globals.getNode("/ECAM/Lower/Oil-QT[1]", 1);
var oil_psi1 = props.globals.getNode("/ECAM/Lower/Oil-PSI[0]", 1);
var oil_psi2 = props.globals.getNode("/ECAM/Lower/Oil-PSI[1]", 1);
var bleedapu = props.globals.getNode("", 1);
var aileron_ind_left = props.globals.getNode("", 1);
var aileron_ind_right = props.globals.getNode("/ECAM/Lower/aileron-ind-right", 1);
var elevator_ind_left = props.globals.getNode("", 1);
var elevator_ind_right = props.globals.getNode("/ECAM/Lower/elevator-ind-right", 1);
var elevator_trim_deg = props.globals.getNode("", 1);
var final_deg = props.globals.getNode("", 1);
var temperature_degc = props.globals.getNode("/environment/temperature-degc", 1);
var tank3_content_lbs = props.globals.getNode("/fdm/jsbsim/propulsion/tank[2]/contents-lbs", 1);
var ir2_knob = props.globals.getNode("/controls/adirs/ir[1]/knob", 1);
var apuBleedNotOn = props.globals.getNode("", 1);
var apu_valve = props.globals.getNode("/systems/pneumatics/valves/apu-bleed-valve-cmd", 1);
var apu_valve_state = props.globals.getNode("/systems/pneumatics/valves/apu-bleed-valve", 1);
var xbleedcmd = props.globals.getNode("/systems/pneumatics/valves/crossbleed-valve-cmd", 1);
var xbleed = props.globals.getNode("/systems/pneumatics/valves/crossbleed-valve", 1);
var xbleedstate = nil;
var precooler1_psi = props.globals.getNode("/systems/pneumatics/psi/engine-1-psi", 1);
var precooler2_psi = props.globals.getNode("/systems/pneumatics/psi/engine-2-psi", 1);
var precooler1_temp = props.globals.getNode("/systems/pneumatics/precooler/temp-1", 1);
var precooler2_temp = props.globals.getNode("/systems/pneumatics/precooler/temp-2", 1);
var precooler1_ovht = props.globals.getNode("/systems/pneumatics/precooler/ovht-1", 1);
var precooler2_ovht = props.globals.getNode("/systems/pneumatics/precooler/ovht-2", 1);
var bmc1working = props.globals.getNode("", 1);
var bmc2working = props.globals.getNode("/systems/pneumatics/indicating/bmc2-working", 1);
var bmc1 = 0;
var bmc2 = 0;
var gs_kt = props.globals.getNode("/velocities/groundspeed-kt", 1);
var switch_wing_aice = props.globals.getNode("/controls/ice-protection/wing", 1);
var pack1_bypass = props.globals.getNode("/systems/pneumatics/pack-1-bypass", 1);
var pack2_bypass = props.globals.getNode("/systems/pneumatics/pack-2-bypass", 1);
var oil_qt1_actual = props.globals.getNode("", 1);
var oil_qt2_actual = props.globals.getNode("/engines/engine[1]/oil-qt-actual", 1);
var fuel_used_lbs1 = props.globals.getNode("", 1);
var gLoad = props.globals.getNode("", 1);
# Hydraulic
var blue_psi = 0;
var green_psi = 0;
var yellow_psi = 0;
var rat_deployed = props.globals.getNode("/controls/hydraulic/rat-deployed", 1);
var y_resv_ovht = props.globals.getNode("/systems/hydraulic/yellow-resv-ovht", 1);
var b_resv_ovht = props.globals.getNode("/systems/hydraulic/blue-resv-ovht", 1);
var g_resv_ovht = props.globals.getNode("/systems/hydraulic/green-resv-ovht", 1);
var askidsw = 0;
var brakemode = 0;
var accum = 0;
var L1BrakeTempc = props.globals.getNode("/gear/gear[1]/L1brake-temp-degc", 1);
var L2BrakeTempc = props.globals.getNode("/gear/gear[1]/L2brake-temp-degc", 1);
var R3BrakeTempc = props.globals.getNode("/gear/gear[2]/R3brake-temp-degc", 1);
var R4BrakeTempc = props.globals.getNode("/gear/gear[2]/R4brake-temp-degc", 1);
var switch_cart = props.globals.getNode("/controls/electrical/ground-cart", 1);
var fuel_flow1 = props.globals.getNode("/engines/engine[0]/fuel-flow_actual", 1);
var fuel_flow2 = props.globals.getNode("/engines/engine[1]/fuel-flow_actual", 1);
var cutoff_switch1 = props.globals.getNode("/controls/engines/engine[0]/cutoff-switch", 1);
var cutoff_switch2 = props.globals.getNode("/controls/engines/engine[1]/cutoff-switch", 1);
var autobreak_mode = props.globals.getNode("/controls/autobrake/mode", 1);
var gear1_pos = props.globals.getNode("/gear/gear[0]/position-norm", 1);
var gear2_pos = props.globals.getNode("/gear/gear[1]/position-norm", 1);
var gear3_pos = props.globals.getNode("/gear/gear[2]/position-norm", 1);
var gear_door_L = props.globals.getNode("/systems/hydraulic/gear/door-left", 1);
var gear_door_R = props.globals.getNode("/systems/hydraulic/gear/door-right", 1);
var gear_door_N = props.globals.getNode("/systems/hydraulic/gear/door-nose", 1);
var gear_down = props.globals.getNode("/controls/gear/gear-down", 1);
var press_vs_norm = props.globals.getNode("", 1);
var cabinalt = props.globals.getNode("", 1);
var gear0_wow = props.globals.getNode("/gear/gear[0]/wow", 1);
# ESS TR
essTrvolts = systems.ELEC.Source.trEss.outputVoltRelay.getValue();
essTramps = systems.ELEC.Source.trEss.outputAmpRelay.getValue();
if (systems.ELEC.Relay.essTrContactor.getValue()) {
me["ESSTR-group"].show();
me["ESSTR-Volt"].setText(sprintf("%s", math.round(essTrvolts)));
me["ESSTR-Ampere"].setText(sprintf("%s", math.round(essTramps)));
if (essTrvolts < 25 or essTrvolts > 31 or essTramps < 5) {
me["ESSTR"].setColor(0.7333,0.3803,0);
} else {
me["ESSTR"].setColor(0.8078,0.8039,0.8078);
}
if (essTrvolts < 25 or essTrvolts > 31) {
me["ESSTR-Volt"].setColor(0.7333,0.3803,0);
} else {
me["ESSTR-Volt"].setColor(0.0509,0.7529,0.2941);
}
if (essTramps < 5) {
me["ESSTR-Ampere"].setColor(0.7333,0.3803,0);
} else {
me["ESSTR-Ampere"].setColor(0.0509,0.7529,0.2941);
}
} else {
me["ESSTR-group"].hide();
}
# EMER GEN
if (systems.ELEC.Source.EmerGen.volts.getValue() == 0) {
me["EMERGEN-group"].hide();
me["ELEC-Line-Emergen-ESSTR"].hide();
me["ELEC-Line-Emergen-ESSTR-off"].show();
me["EMERGEN-Label-off"].show();
} else {
me["EMERGEN-group"].show();
me["ELEC-Line-Emergen-ESSTR"].show();
me["ELEC-Line-Emergen-ESSTR-off"].hide();
me["EMERGEN-Label-off"].hide();
me["EmergenVolt"].setText(sprintf("%s", math.round(systems.ELEC.Source.EmerGen.voltsRelay.getValue())));
me["EmergenHz"].setText(sprintf("%s", math.round(systems.ELEC.Source.EmerGen.hertz.getValue())));
if (systems.ELEC.Source.EmerGen.voltsRelay.getValue() > 120 or systems.ELEC.Source.EmerGen.voltsRelay.getValue() < 110 or systems.ELEC.Source.EmerGen.hertz.getValue() > 410 or systems.ELEC.Source.EmerGen.hertz.getValue() < 390) {
me["Emergen-Label"].setColor(0.7333,0.3803,0);
} else {
me["Emergen-Label"].setColor(0.8078,0.8039,0.8078);
}
if (systems.ELEC.Source.EmerGen.voltsRelay.getValue() > 120 or systems.ELEC.Source.EmerGen.voltsRelay.getValue() < 110) {
me["EmergenVolt"].setColor(0.7333,0.3803,0);
} else {
me["EmergenVolt"].setColor(0.0509,0.7529,0.2941);
}
if (systems.ELEC.Source.EmerGen.hertz.getValue() > 410 or systems.ELEC.Source.EmerGen.hertz.getValue() < 390) {
me["EmergenHz"].setColor(0.7333,0.3803,0);
} else {
me["EmergenHz"].setColor(0.0509,0.7529,0.2941);
}
}
# GEN1
if (systems.ELEC.Switch.gen1.getValue() == 0) {
me["GEN1-content"].hide();
me["GEN1-off"].show();
if (systems.ELEC.Source.IDG1.gcrRelay.getValue()) {
me["GEN1-label"].setColor(0.7333,0.3803,0);
} else {
me["GEN1-label"].setColor(0.8078,0.8039,0.8078);
}
if (eng1_running.getValue() == 0) {
me["GEN1-num-label"].setColor(0.7333,0.3803,0);
} else {
me["GEN1-num-label"].setColor(0.8078,0.8039,0.8078);
}
} else {
me["GEN1-content"].show();
me["GEN1-off"].hide();
# me["Gen1Load"].setText(sprintf("%s", math.round(gen1_load.getValue())));
me["Gen1Volt"].setText(sprintf("%s", math.round(systems.ELEC.Source.IDG1.volts.getValue())));
if (systems.ELEC.Source.IDG1.hertz.getValue() == 0) {
me["Gen1Hz"].setText(sprintf("XX"));
} else {
me["Gen1Hz"].setText(sprintf("%s", math.round(systems.ELEC.Source.IDG1.hertz.getValue())));
}
if (eng1_running.getValue() == 0) {
me["GEN1-num-label"].setColor(0.7333,0.3803,0);
} else {
me["GEN1-num-label"].setColor(0.8078,0.8039,0.8078);
}
if (systems.ELEC.Source.IDG1.volts.getValue() > 120 or systems.ELEC.Source.IDG1.volts.getValue() < 110 or systems.ELEC.Source.IDG1.hertz.getValue() > 410 or systems.ELEC.Source.IDG1.hertz.getValue() < 390 or gen1_load.getValue() >= 110) {
me["GEN1-label"].setColor(0.7333,0.3803,0);
} else {
me["GEN1-label"].setColor(0.8078,0.8039,0.8078);
}
if (gen1_load.getValue() >= 110) {
me["Gen1Load"].setColor(0.7333,0.3803,0);
} else {
me["Gen1Load"].setColor(0.0509,0.7529,0.2941);
}
if (systems.ELEC.Source.IDG1.volts.getValue() > 120 or systems.ELEC.Source.IDG1.volts.getValue() < 110) {
me["Gen1Volt"].setColor(0.7333,0.3803,0);
} else {
me["Gen1Volt"].setColor(0.0509,0.7529,0.2941);
}
if (systems.ELEC.Source.IDG1.hertz.getValue() > 410 or systems.ELEC.Source.IDG1.hertz.getValue() < 390) {
me["Gen1Hz"].setColor(0.7333,0.3803,0);
} else {
me["Gen1Hz"].setColor(0.0509,0.7529,0.2941);
}
}
# GEN2
if (systems.ELEC.Switch.gen2.getValue() == 0) {
me["GEN2-content"].hide();
me["GEN2-off"].show();
if (systems.ELEC.Source.IDG2.gcrRelay.getValue()) {
me["GEN2-label"].setColor(0.7333,0.3803,0);
} else {
me["GEN2-label"].setColor(0.8078,0.8039,0.8078);
}
if (eng2_running.getValue() == 0) {
me["GEN2-num-label"].setColor(0.7333,0.3803,0);
} else {
me["GEN2-num-label"].setColor(0.8078,0.8039,0.8078);
}
} else {
me["GEN2-content"].show();
me["GEN2-off"].hide();
# me["Gen2Load"].setText(sprintf("%s", math.round(gen2_load.getValue())));
me["Gen2Volt"].setText(sprintf("%s", math.round(systems.ELEC.Source.IDG2.volts.getValue())));
if (systems.ELEC.Source.IDG2.hertz.getValue() == 0) {
me["Gen2Hz"].setText(sprintf("XX"));
} else {
me["Gen2Hz"].setText(sprintf("%s", math.round(systems.ELEC.Source.IDG2.hertz.getValue())));
}
if (eng2_running.getValue() == 0) {
me["GEN2-num-label"].setColor(0.7333,0.3803,0);
} else {
me["GEN2-num-label"].setColor(0.8078,0.8039,0.8078);
}
if (systems.ELEC.Source.IDG2.volts.getValue() > 120 or systems.ELEC.Source.IDG2.volts.getValue() < 110 or systems.ELEC.Source.IDG2.hertz.getValue() > 410 or systems.ELEC.Source.IDG2.hertz.getValue() < 390 or gen2_load.getValue() >= 110) {
me["GEN2-label"].setColor(0.7333,0.3803,0);
} else {
me["GEN2-label"].setColor(0.8078,0.8039,0.8078);
}
if (gen2_load.getValue() >= 110) {
me["Gen2Load"].setColor(0.7333,0.3803,0);
} else {
me["Gen2Load"].setColor(0.0509,0.7529,0.2941);
}
if (systems.ELEC.Source.IDG2.volts.getValue() > 120 or systems.ELEC.Source.IDG2.volts.getValue() < 110) {
me["Gen2Volt"].setColor(0.7333,0.3803,0);
} else {
me["Gen2Volt"].setColor(0.0509,0.7529,0.2941);
}
if (systems.ELEC.Source.IDG2.hertz.getValue() > 410 or systems.ELEC.Source.IDG2.hertz.getValue() < 390) {
me["Gen2Hz"].setColor(0.7333,0.3803,0);
} else {
me["Gen2Hz"].setColor(0.0509,0.7529,0.2941);
}
}
# Managment of the connecting lines between the components
if (systems.ELEC.Relay.apuGlc.getValue() and (systems.ELEC.Relay.acTie1.getValue() or systems.ELEC.Relay.acTie2.getValue())) {
me["APU-out"].show();
} else {
me["APU-out"].hide();
}
if (systems.ELEC.Relay.extEpc.getValue() and (systems.ELEC.Relay.acTie1.getValue() or systems.ELEC.Relay.acTie2.getValue())) {
me["EXT-out"].show();
} else {
me["EXT-out"].hide();
}
if (systems.ELEC.Source.IDG1.volts.getValue() >= 110 and systems.ELEC.Relay.glc1.getValue()) {
me["ELEC-Line-GEN1-AC1"].show();
} else {
me["ELEC-Line-GEN1-AC1"].hide();
}
if (systems.ELEC.Source.IDG2.volts.getValue() >= 110 and systems.ELEC.Relay.glc2.getValue()) {
me["ELEC-Line-GEN2-AC2"].show();
} else {
me["ELEC-Line-GEN2-AC2"].hide();
}
if (systems.ELEC.Relay.acTie1.getValue() and systems.ELEC.Relay.acTie2.getValue()) {
me["ELEC-Line-APU-AC1"].show();
me["ELEC-Line-APU-EXT"].show();
me["ELEC-Line-EXT-AC2"].show();
} else {
if (systems.ELEC.Relay.acTie1.getValue()) {
me["ELEC-Line-APU-AC1"].show();
} else {
me["ELEC-Line-APU-AC1"].hide();
}
if ((systems.ELEC.Relay.acTie2.getValue() and systems.ELEC.Relay.apuGlc.getValue() and !systems.ELEC.Relay.glc2.getValue()) or (systems.ELEC.Relay.acTie1.getValue() and systems.ELEC.Relay.extEpc.getValue() and !systems.ELEC.Relay.glc1.getValue())) {
me["ELEC-Line-APU-EXT"].show();
} else {
me["ELEC-Line-APU-EXT"].hide();
}
if (systems.ELEC.Relay.acTie2.getValue()) {
me["ELEC-Line-EXT-AC2"].show();
} else {
me["ELEC-Line-EXT-AC2"].hide();
}
}
if (systems.ELEC.Relay.acEssFeed1.getValue()) {
if (systems.ELEC.Bus.ac1.getValue() >= 110) {
me["ELEC-Line-AC1-ACESS"].show();
} else {
me["ELEC-Line-AC1-ACESS"].hide();
}
me["ELEC-Line-AC2-ACESS"].hide();
} elsif (systems.ELEC.Relay.acEssFeed2.getValue()) {
me["ELEC-Line-AC1-ACESS"].hide();
if (systems.ELEC.Bus.ac2.getValue() >= 110) {
me["ELEC-Line-AC2-ACESS"].show();
} else {
me["ELEC-Line-AC2-ACESS"].hide();
}
} else {
me["ELEC-Line-AC1-ACESS"].hide();
me["ELEC-Line-AC2-ACESS"].hide();
}
if (systems.ELEC.Relay.tr1Contactor.getValue()) {
if (systems.ELEC.Bus.ac1.getValue() < 110) {
me["ELEC-Line-AC1-TR1"].setColorFill(0.7333,0.3803,0);
} else {
me["ELEC-Line-AC1-TR1"].setColorFill(0.0509,0.7529,0.2941);
}
me["ELEC-Line-AC1-TR1"].show();
me["ELEC-Line-TR1-DC1"].show();
} else {
me["ELEC-Line-AC1-TR1"].hide();
me["ELEC-Line-TR1-DC1"].hide();
}
if (systems.ELEC.Relay.tr2Contactor.getValue()) {
if (systems.ELEC.Bus.ac2.getValue() < 110) {
me["ELEC-Line-AC2-TR2"].setColorFill(0.7333,0.3803,0);
} else {
me["ELEC-Line-AC2-TR2"].setColorFill(0.0509,0.7529,0.2941);
}
me["ELEC-Line-AC2-TR2"].show();
me["ELEC-Line-TR2-DC2"].show();
} else {
me["ELEC-Line-AC2-TR2"].hide();
me["ELEC-Line-TR2-DC2"].hide();
}
if (systems.ELEC.Bus.acEss.getValue() >= 110 and !systems.ELEC.Relay.acEssEmerGenFeed.getValue() and (!systems.ELEC.Relay.tr1Contactor.getValue() or !systems.ELEC.Relay.tr2Contactor.getValue())) {
me["ELEC-Line-ACESS-TRESS"].show();
} else {
me["ELEC-Line-ACESS-TRESS"].hide();
}