1
0
Fork 0

Cond / door / elec

This commit is contained in:
Jonathan Redpath 2022-04-21 16:02:39 +01:00
parent ecdea928ee
commit d55f4b34d3
3 changed files with 146 additions and 142 deletions

View file

@ -110,6 +110,8 @@ var canvas_lowerECAMPageCond =
obj["TAT"].setText(sprintf("%+2.0f", val));
}),
];
obj.timer = maketimestamp();
obj.times = [];
return obj;
},
getKeysBottom: func() {
@ -154,6 +156,7 @@ var canvas_lowerECAMPageCond =
}
},
update: func(notification) {
me.timer.stamp();
me.updatePower();
if (me.test.getVisible() == 1) {
@ -170,6 +173,7 @@ var canvas_lowerECAMPageCond =
}
me.updateBottom(notification);
append(me.times, me.timer.elapsedUSec());
},
updatePower: func() {
if (me.name == ecam.SystemDisplayController.displayedPage.name) {

View file

@ -49,8 +49,8 @@ var canvas_lowerECAMPageDoor =
obj.update_items = [
props.UpdateManager.FromHashValue("doorL1", nil, func(val) {
if (val > 0) {
props.UpdateManager.FromHashValue("doorL1", 0.1, func(val) {
if (val >= 0.1) {
obj["Cabin1Left"].show();
obj["Cabin1Left"].setColor(0.7333,0.3803,0);
obj["Cabin1Left"].setColorFill(0.7333,0.3803,0);
@ -65,8 +65,8 @@ var canvas_lowerECAMPageDoor =
obj["Cabin1LeftSlide"].show();
}
}),
props.UpdateManager.FromHashValue("doorL4", nil, func(val) {
if (val > 0) {
props.UpdateManager.FromHashValue("doorL4", 0.1, func(val) {
if (val >= 0.1) {
obj["Cabin4Left"].show();
obj["Cabin4Left"].setColor(0.7333,0.3803,0);
obj["Cabin4Left"].setColorFill(0.7333,0.3803,0);
@ -81,8 +81,8 @@ var canvas_lowerECAMPageDoor =
obj["Cabin4LeftSlide"].show();
}
}),
props.UpdateManager.FromHashValue("doorR1", nil, func(val) {
if (val > 0) {
props.UpdateManager.FromHashValue("doorR1", 0.1, func(val) {
if (val >= 0.1) {
obj["Cabin1Right"].show();
obj["Cabin1Right"].setColor(0.7333,0.3803,0);
obj["Cabin1Right"].setColorFill(0.7333,0.3803,0);
@ -97,8 +97,8 @@ var canvas_lowerECAMPageDoor =
obj["Cabin1RightSlide"].show();
}
}),
props.UpdateManager.FromHashValue("doorR4", nil, func(val) {
if (val > 0) {
props.UpdateManager.FromHashValue("doorR4", 0.1, func(val) {
if (val >= 0.1) {
obj["Cabin4Right"].show();
obj["Cabin4Right"].setColor(0.7333,0.3803,0);
obj["Cabin4Right"].setColorFill(0.7333,0.3803,0);
@ -113,8 +113,8 @@ var canvas_lowerECAMPageDoor =
obj["Cabin4RightSlide"].show();
}
}),
props.UpdateManager.FromHashValue("cargoAft", nil, func(val) {
if (val > 0) {
props.UpdateManager.FromHashValue("cargoAft", 0.1, func(val) {
if (val >= 0.1) {
obj["Cargo2Door"].setColor(0.7333,0.3803,0);
obj["Cargo2Door"].setColorFill(0.7333,0.3803,0);
obj["Cargo2Lbl"].show();
@ -126,8 +126,8 @@ var canvas_lowerECAMPageDoor =
obj["Cargo2Line"].hide();
}
}),
props.UpdateManager.FromHashValue("cargoBulk", nil, func(val) {
if (val > 0) {
props.UpdateManager.FromHashValue("cargoBulk", 0.1, func(val) {
if (val >= 0.1) {
obj["Bulk"].setColor(0.7333,0.3803,0);
obj["Bulk"].setColorFill(0.7333,0.3803,0);
obj["BulkLbl"].show();
@ -139,8 +139,8 @@ var canvas_lowerECAMPageDoor =
obj["BulkLine"].hide();
}
}),
props.UpdateManager.FromHashValue("cargoFwd", nil, func(val) {
if (val > 0) {
props.UpdateManager.FromHashValue("cargoFwd", 0.1, func(val) {
if (val >= 0.1) {
obj["Cargo1Door"].setColor(0.7333,0.3803,0);
obj["Cargo1Door"].setColorFill(0.7333,0.3803,0);
obj["Cargo1Lbl"].show();
@ -152,7 +152,7 @@ var canvas_lowerECAMPageDoor =
obj["Cargo1Line"].hide();
}
}),
props.UpdateManager.FromHashList(["oxyPB","oxyBottlePress","oxyBottleRegulLoPr"], nil, func(val) {
props.UpdateManager.FromHashList(["oxyPB","oxyBottlePress","oxyBottleRegulLoPr"], 1, func(val) {
if (val.oxyPB) {
if (val.oxyBottlePress < 300 or val.oxyBottleRegulLoPr) {
obj["DOOROXY-OxyIndicator"].setColor(0.7333,0.3803,0);
@ -170,14 +170,8 @@ var canvas_lowerECAMPageDoor =
}
obj["DOOROXY-PR"].setText(sprintf("%4.0f", math.round(val.oxyBottlePress, 10)));
}),
props.UpdateManager.FromHashValue("pressVS", nil, func(val) {
if (val > 9950) {
obj["DOOR-VS"].setText(sprintf("%+4.0f", 9950));
} else if (val < -9950) {
obj["DOOR-VS"].setText(sprintf("%+4.0f", -9950));
} else {
obj["DOOR-VS"].setText(sprintf("%+4.0f", math.round(val,50)));
}
props.UpdateManager.FromHashValue("pressVS", 25, func(val) {
obj["DOOR-VS"].setText(sprintf("%+4.0f", math.clamp(math.round(val,50), -9950, 9950)));
if (abs(val) > 2000) {
obj["DOOR-VS"].setColor(0.7333,0.3803,0);
@ -185,14 +179,14 @@ var canvas_lowerECAMPageDoor =
obj["DOOR-VS"].setColor(0.0509,0.7529,0.2941);
}
}),
props.UpdateManager.FromHashValue("FWCPhase", nil, func(val) {
props.UpdateManager.FromHashValue("FWCPhase", 1, func(val) {
if (val >= 5 and val <= 7) {
obj["DOOR-VS-Container"].show();
} else {
obj["DOOR-VS-Container"].hide();
}
}),
props.UpdateManager.FromHashValue("oxyBottleRegulLoPr", nil, func(val) {
props.UpdateManager.FromHashValue("oxyBottleRegulLoPr", 1, func(val) {
if (val) {
obj["DOOROXY-REGUL-LO-PR"].show();
} else {

View file

@ -30,21 +30,17 @@ var canvas_lowerECAMPageElec =
obj["IDG1-RISE-Value"].hide();
obj.update_items = [
props.UpdateManager.FromHashValue("apuLoad", 0.1, func(val) {
props.UpdateManager.FromHashValue("apuLoad", 0.5, func(val) {
obj["APUGenLoad"].setText(sprintf("%s", math.round(val)));
if (val < 110) {
obj["APUGenHz"].setColor(0.0509,0.7529,0.2941);
if (val <= 100) {
obj["APUGenLoad"].setColor(0.0509,0.7529,0.2941);
} else {
obj["APUGenHz"].setColor(0.7333,0.3803,0);
obj["APUGenLoad"].setColor(0.7333,0.3803,0);
}
}),
props.UpdateManager.FromHashValue("apuHertz", 0.5, func(val) {
if (val == 0) {
obj["APUGenHz"].setText(sprintf("XX"));
} else {
obj["APUGenHz"].setText(sprintf("%s", math.round(val)));
}
obj["APUGenHz"].setText(sprintf("%s", math.round(val)));
if (val >= 390 and val <= 410) {
obj["APUGenHz"].setColor(0.0509,0.7529,0.2941);
@ -52,7 +48,7 @@ var canvas_lowerECAMPageElec =
obj["APUGenHz"].setColor(0.7333,0.3803,0);
}
}),
props.UpdateManager.FromHashValue("apuVolt", 0.1, func(val) {
props.UpdateManager.FromHashValue("apuVolt", 0.5, func(val) {
obj["APUGenVolt"].setText(sprintf("%s", math.round(val)));
if (val >= 110 and val <= 120) {
@ -61,7 +57,7 @@ var canvas_lowerECAMPageElec =
obj["APUGenVolt"].setColor(0.7333,0.3803,0);
}
}),
props.UpdateManager.FromHashList(["apuMaster","apuVolt","apuLoad","apuHertz","apuGLC"], nil, func(val) {
props.UpdateManager.FromHashList(["apuMaster","apuVolt","apuLoad","apuHertz","apuGLC"], 0.5, func(val) {
if (val.apuMaster == 0) {
obj["APUGentext"].setColor(0.8078,0.8039,0.8078);
} else {
@ -74,7 +70,7 @@ var canvas_lowerECAMPageElec =
}
}
}),
props.UpdateManager.FromHashList(["apuMaster","apuGenPB"], nil, func(val) {
props.UpdateManager.FromHashList(["apuMaster","apuGenPB"], 1, func(val) {
if (val.apuMaster == 0) {
obj["APU-content"].hide();
obj["APUGEN-off"].hide();
@ -90,7 +86,7 @@ var canvas_lowerECAMPageElec =
}
}
}),
props.UpdateManager.FromHashValue("elecIDG1Disc", nil, func(val) {
props.UpdateManager.FromHashValue("elecIDG1Disc", 1, func(val) {
if (!val) {
obj["IDG1-DISC"].show();
obj["ELEC-IDG-1-label"].setColor(0.7333,0.3803,0);
@ -99,7 +95,7 @@ var canvas_lowerECAMPageElec =
obj["ELEC-IDG-1-label"].setColor(0.8078,0.8039,0.8078);
}
}),
props.UpdateManager.FromHashValue("elecIDG2Disc", nil, func(val) {
props.UpdateManager.FromHashValue("elecIDG2Disc", 1, func(val) {
if (!val) {
obj["IDG2-DISC"].show();
obj["ELEC-IDG-2-label"].setColor(0.7333,0.3803,0);
@ -108,7 +104,7 @@ var canvas_lowerECAMPageElec =
obj["ELEC-IDG-2-label"].setColor(0.8078,0.8039,0.8078);
}
}),
props.UpdateManager.FromHashValue("engine1Running", nil, func(val) {
props.UpdateManager.FromHashValue("engine1Running", 1, 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);
@ -117,7 +113,7 @@ var canvas_lowerECAMPageElec =
obj["GEN1-num-label"].setColor(0.8078,0.8039,0.8078);
}
}),
props.UpdateManager.FromHashValue("engine2Running", nil, func(val) {
props.UpdateManager.FromHashValue("engine2Running", 1, 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);
@ -165,14 +161,14 @@ var canvas_lowerECAMPageElec =
obj["ELEC-Line-AC2-TR2"].setColor(0.7333,0.3803,0);
}
}),
props.UpdateManager.FromHashList(["elecGen1GLC","elecAcTie1"], nil, func(val) {
props.UpdateManager.FromHashList(["elecGen1GLC","elecAcTie1"], 1, func(val) {
if (val.elecGen1GLC or val.elecAcTie1) {
obj["AC1-in"].show();
} else {
obj["AC1-in"].hide();
}
}),
props.UpdateManager.FromHashList(["elecGen2GLC","elecAcTie2"], nil, func(val) {
props.UpdateManager.FromHashList(["elecGen2GLC","elecAcTie2"], 1, func(val) {
if (val.elecGen2GLC or val.elecAcTie2) {
obj["AC2-in"].show();
} else {
@ -193,14 +189,14 @@ var canvas_lowerECAMPageElec =
obj["ACESS-SHED"].show();
}
}),
props.UpdateManager.FromHashValue("ElecGalleyShed", nil, func(val) {
props.UpdateManager.FromHashValue("ElecGalleyShed", 1, func(val) {
if (val) {
obj["GalleyShed"].show();
} else {
obj["GalleyShed"].hide();
}
}),
props.UpdateManager.FromHashList(["elecBat1Switch","elecBat2Switch","dcBat"], nil, func(val) {
props.UpdateManager.FromHashList(["elecBat1Switch","elecBat2Switch","dcBat"], 0.5, func(val) {
if (val.elecBat1Switch or val.elecBat2Switch) {
obj["ELEC-DCBAT-label"].setText("DC BAT");
if (val.dcBat > 25) {
@ -213,7 +209,55 @@ var canvas_lowerECAMPageElec =
obj["ELEC-DCBAT-label"].setColor(0.7333,0.3803,0);
}
}),
props.UpdateManager.FromHashList(["elecBat1Switch","elecBat1Volt","elecBat1Amp","elecBat1Direction","elecBat1Fault"], nil, func(val) {
props.UpdateManager.FromHashValue("elecBat1Volt", 0.5, func(val) {
obj["Bat1Volt"].setText(sprintf("%2.0f", val));
if (val >= 25 and val <= 31) {
obj["Bat1Volt"].setColor(0.0509,0.7529,0.2941);
} else {
obj["Bat1Volt"].setColor(0.7333,0.3803,0);
}
}),
props.UpdateManager.FromHashList(["elecBat1Amp","elecBat1Direction"], 0.5, func(val) {
obj["Bat1Ampere"].setText(sprintf("%2.0f", val.elecBat1Amp));
if (val.elecBat1Amp > 5 and val.elecBat1Direction == 1) {
obj["Bat1Ampere"].setColor(0.7333,0.3803,0);
} else {
obj["Bat1Ampere"].setColor(0.0509,0.7529,0.2941);
}
}),
props.UpdateManager.FromHashList(["elecBat1Volt","elecBat1Amp","elecBat1Fault"], 0.5, func(val) {
if (val.elecBat1Fault or val.elecBat1Volt < 25 or val.elecBat1Volt > 31 or val.elecBat1Amp > 5) {
obj["BAT1-label"].setColor(0.7333,0.3803,0);
} else {
obj["BAT1-label"].setColor(0.8078,0.8039,0.8078);
}
}),
props.UpdateManager.FromHashValue("elecBat2Volt", 0.5, func(val) {
obj["Bat2Volt"].setText(sprintf("%2.0f", val));
if (val >= 25 and val <= 31) {
obj["Bat2Volt"].setColor(0.0509,0.7529,0.2941);
} else {
obj["Bat2Volt"].setColor(0.7333,0.3803,0);
}
}),
props.UpdateManager.FromHashList(["elecBat2Amp","elecBat2Direction"], 0.5, func(val) {
obj["Bat2Ampere"].setText(sprintf("%2.0f", val.elecBat2Amp));
if (val.elecBat2Amp > 5 and val.elecBat2Direction == 1) {
obj["Bat2Ampere"].setColor(0.7333,0.3803,0);
} else {
obj["Bat2Ampere"].setColor(0.0509,0.7529,0.2941);
}
}),
props.UpdateManager.FromHashList(["elecBat2Volt","elecBat2Amp","elecBat2Fault"], 0.5, func(val) {
if (val.elecBat2Fault or val.elecBat2Volt < 25 or val.elecBat2Volt > 31 or val.elecBat2Amp > 5) {
obj["BAT2-label"].setColor(0.7333,0.3803,0);
} else {
obj["BAT2-label"].setColor(0.8078,0.8039,0.8078);
}
}),
props.UpdateManager.FromHashList(["elecBat1Switch","elecBat1Direction"], 1, func(val) {
if (val.elecBat1Switch == 0) {
obj["BAT1-OFF"].show();
obj["BAT1-content"].hide();
@ -222,22 +266,7 @@ var canvas_lowerECAMPageElec =
} else {
obj["BAT1-OFF"].hide();
obj["BAT1-content"].show();
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);
} else {
obj["Bat1Volt"].setColor(0.7333,0.3803,0);
}
if (val.elecBat1Amp > 5 and val.elecBat1Direction == 1) {
obj["Bat1Ampere"].setColor(0.7333,0.3803,0);
} else {
obj["Bat1Ampere"].setColor(0.0509,0.7529,0.2941);
}
if (val.elecBat1Direction == 0) {
obj["BAT1-discharge"].hide();
obj["BAT1-charge"].hide();
@ -251,14 +280,8 @@ var canvas_lowerECAMPageElec =
}
}
}
if (val.elecBat1Fault or val.elecBat1Volt < 25 or val.elecBat1Volt > 31 or val.elecBat1Amp > 5) {
obj["BAT1-label"].setColor(0.7333,0.3803,0);
} else {
obj["BAT1-label"].setColor(0.8078,0.8039,0.8078);
}
}),
props.UpdateManager.FromHashList(["elecBat2Switch","elecBat2Volt","elecBat2Amp","elecBat2Direction","elecBat2Fault"], nil, func(val) {
props.UpdateManager.FromHashList(["elecBat2Switch","elecBat2Direction"], 1, func(val) {
if (val.elecBat2Switch == 0) {
obj["BAT2-OFF"].show();
obj["BAT2-content"].hide();
@ -267,22 +290,7 @@ var canvas_lowerECAMPageElec =
} else {
obj["BAT2-OFF"].hide();
obj["BAT2-content"].show();
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);
} else {
obj["Bat2Volt"].setColor(0.7333,0.3803,0);
}
if (val.elecBat2Amp > 5 and val.elecBat2Direction == 1) {
obj["Bat2Ampere"].setColor(0.7333,0.3803,0);
} else {
obj["Bat2Ampere"].setColor(0.0509,0.7529,0.2941);
}
if (val.elecBat2Direction == 0) {
obj["BAT2-discharge"].hide();
obj["BAT2-charge"].hide();
@ -296,14 +304,8 @@ var canvas_lowerECAMPageElec =
}
}
}
if (val.elecBat2Fault or val.elecBat2Volt < 25 or val.elecBat2Volt > 31 or val.elecBat2Amp > 5) {
obj["BAT2-label"].setColor(0.7333,0.3803,0);
} else {
obj["BAT2-label"].setColor(0.8078,0.8039,0.8078);
}
}),
props.UpdateManager.FromHashList(["elecTR1Amp","elecTR1Volt"], nil, func(val) {
props.UpdateManager.FromHashList(["elecTR1Amp","elecTR1Volt"], 0.5, func(val) {
obj["TR1Volt"].setText(sprintf("%s", math.round(val.elecTR1Volt)));
obj["TR1Ampere"].setText(sprintf("%s", math.round(val.elecTR1Amp)));
@ -325,7 +327,7 @@ var canvas_lowerECAMPageElec =
obj["TR1Ampere"].setColor(0.0509,0.7529,0.2941);
}
}),
props.UpdateManager.FromHashList(["elecTR2Amp","elecTR2Volt"], nil, func(val) {
props.UpdateManager.FromHashList(["elecTR2Amp","elecTR2Volt"], 0.5, func(val) {
obj["TR2Volt"].setText(sprintf("%s", math.round(val.elecTR2Volt)));
obj["TR2Ampere"].setText(sprintf("%s", math.round(val.elecTR2Amp)));
@ -347,41 +349,37 @@ var canvas_lowerECAMPageElec =
obj["TR2Ampere"].setColor(0.0509,0.7529,0.2941);
}
}),
props.UpdateManager.FromHashList(["elecExtHertz","elecExtVolt","elecGroundCart"], nil, func(val) {
if (val.elecGroundCart == 0) {
obj["EXTPWR-group"].hide();
props.UpdateManager.FromHashValue("elecExtHertz", 0.5, func(val) {
if (val > 410 or val < 390) {
obj["ExtHz"].setColor(0.7333,0.3803,0);
} else {
obj["EXTPWR-group"].show();
obj["ExtVolt"].setText(sprintf("%s", math.round(val.elecExtVolt)));
obj["ExtHz"].setText(sprintf("%s", math.round(val.elecExtHertz)));
if (val.elecExtHertz > 410 or val.elecExtHertz < 390 or val.elecExtVolt > 120 or val.elecExtVolt < 110) {
obj["EXTPWR-label"].setColor(0.7333,0.3803,0);
} else {
obj["EXTPWR-label"].setColor(0.0509,0.7529,0.2941);
}
if (val.elecExtHertz > 410 or val.elecExtHertz < 390) {
obj["ExtHz"].setColor(0.7333,0.3803,0);
} else {
obj["ExtHz"].setColor(0.0509,0.7529,0.2941);
}
if (val.elecExtVolt > 120 or val.elecExtVolt < 110) {
obj["ExtVolt"].setColor(0.7333,0.3803,0);
} else {
obj["ExtVolt"].setColor(0.0509,0.7529,0.2941);
}
obj["ExtHz"].setColor(0.0509,0.7529,0.2941);
}
obj.extPwrHertz = sprintf("%s", math.round(val));
}),
props.UpdateManager.FromHashValue("elecExtVolt", 0.5, func(val) {
if (val > 120 or val < 110) {
obj["ExtVolt"].setColor(0.7333,0.3803,0);
} else {
obj["ExtVolt"].setColor(0.0509,0.7529,0.2941);
}
obj.extPwrVoltage = sprintf("%s", math.round(val));
}),
props.UpdateManager.FromHashList(["elecExtHertz","elecExtVolt"], 0.5, func(val) {
if (val.elecExtHertz > 410 or val.elecExtHertz < 390 or val.elecExtVolt > 120 or val.elecExtVolt < 110) {
obj["EXTPWR-label"].setColor(0.7333,0.3803,0);
} else {
obj["EXTPWR-label"].setColor(0.0509,0.7529,0.2941);
}
}),
props.UpdateManager.FromHashValue("elecDCTie1", nil, func(val) {
props.UpdateManager.FromHashValue("elecDCTie1", 1, func(val) {
if (val) {
obj["ELEC-Line-DC1-DCESS_DCBAT"].show();
} else {
obj["ELEC-Line-DC1-DCESS_DCBAT"].hide();
}
}),
props.UpdateManager.FromHashValue("elecDCTie2", nil, func(val) {
props.UpdateManager.FromHashValue("elecDCTie2", 1, func(val) {
if (val) {
obj["ELEC-Line-DC2-DCESS_DCBAT"].show();
obj["ELEC-Line-DC2-DCBAT"].show();
@ -390,28 +388,28 @@ var canvas_lowerECAMPageElec =
obj["ELEC-Line-DC2-DCBAT"].hide();
}
}),
props.UpdateManager.FromHashValue("elecDCTie1", nil, func(val) {
props.UpdateManager.FromHashValue("elecDCTie1", 1, func(val) {
if (val) {
obj["ELEC-Line-DC1-DCBAT"].show();
} else {
obj["ELEC-Line-DC1-DCBAT"].hide();
}
}),
props.UpdateManager.FromHashValue("elecDcEssFeedBat", nil, func(val) {
props.UpdateManager.FromHashValue("elecDcEssFeedBat", 1, func(val) {
if (val) {
obj["ELEC-Line-DC1-DCESS"].show();
} else {
obj["ELEC-Line-DC1-DCESS"].hide();
}
}),
props.UpdateManager.FromHashValue("elecTrEssContact", nil, func(val) {
props.UpdateManager.FromHashValue("elecTrEssContact", 1, func(val) {
if (val) {
obj["ELEC-Line-ESSTR-DCESS"].show();
} else {
obj["ELEC-Line-ESSTR-DCESS"].hide();
}
}),
props.UpdateManager.FromHashList(["elecEmerGenVoltsRelay","elec15XE1"], nil, func(val) {
props.UpdateManager.FromHashList(["elecEmerGenVoltsRelay","elec15XE1"], 1, func(val) {
if (val.elecEmerGenVoltsRelay) {
if (val.elec15XE1) {
obj["EMERGEN-out"].show();
@ -424,7 +422,7 @@ var canvas_lowerECAMPageElec =
obj["ELEC-Line-Emergen-ESSTR"].hide();
}
}),
props.UpdateManager.FromHashList(["elecTREssAmp","elecTREssVolt","elecTrEssContact"], nil, func(val) {
props.UpdateManager.FromHashList(["elecTREssAmp","elecTREssVolt","elecTrEssContact"], 0.5, func(val) {
if (val.elecTrEssContact) {
obj["ESSTR-group"].show();
obj["ESSTR-Volt"].setText(sprintf("%s", math.round(val.elecTREssVolt)));
@ -451,8 +449,8 @@ var canvas_lowerECAMPageElec =
obj["ESSTR-group"].hide();
}
}),
props.UpdateManager.FromHashList(["elecEmerGenHertz","elecEmerGenVolts","elecEmerGenVoltsRelay"], nil, func(val) {
if (val.elecEmerGenVolts == 0) {
props.UpdateManager.FromHashList(["elecEmerGenHertz","elecEmerGenVolts","elecEmerGenVoltsRelay"], 0.5, func(val) {
if (val.elecEmerGenVolts < 110) {
obj["EMERGEN-group"].hide();
obj["ELEC-Line-Emergen-ESSTR"].hide();
obj["ELEC-Line-Emergen-ESSTR-off"].show();
@ -485,7 +483,7 @@ var canvas_lowerECAMPageElec =
}
}
}),
props.UpdateManager.FromHashList(["elecGen1Switch","elecGen1Hertz","elecGen1Volt","engine1Running","elecGen1Relay"], nil, func(val) {
props.UpdateManager.FromHashList(["elecGen1Switch","elecGen1Hertz","elecGen1Volt","engine1Running","elecGen1Relay"], 0.5, func(val) {
if (val.elecGen1Switch == 0) {
obj["GEN1-content"].hide();
obj["GEN1-off"].show();
@ -524,7 +522,7 @@ var canvas_lowerECAMPageElec =
}
}
}),
props.UpdateManager.FromHashList(["elecGen2Switch","elecGen2Hertz","elecGen2Volt","engine1Running","elecGen2Relay"], nil, func(val) {
props.UpdateManager.FromHashList(["elecGen2Switch","elecGen2Hertz","elecGen2Volt","engine1Running","elecGen2Relay"], 0.5, func(val) {
if (val.elecGen2Switch == 0) {
obj["GEN2-content"].hide();
obj["GEN2-off"].show();
@ -563,21 +561,21 @@ var canvas_lowerECAMPageElec =
}
}
}),
props.UpdateManager.FromHashList(["elecTR1Contact","elecAC1"], nil, func(val) {
if (val.elecTR1Contact) {
props.UpdateManager.FromHashValue("elecTR1Contact", 1, func(val) {
if (val) {
obj["ELEC-Line-TR1-DC1"].show();
} else {
obj["ELEC-Line-TR1-DC1"].hide();
}
}),
props.UpdateManager.FromHashList(["elecTR2Contact","elecAC2"], nil, func(val) {
if (val.elecTR2Contact) {
props.UpdateManager.FromHashValue("elecTR2Contact", 1, func(val) {
if (val) {
obj["ELEC-Line-TR2-DC2"].show();
} else {
obj["ELEC-Line-TR2-DC2"].hide();
}
}),
props.UpdateManager.FromHashList(["elecAcEssFeed1","elecAcEssFeed2","elecAC1","elecAC2"], nil, func(val) {
props.UpdateManager.FromHashList(["elecAcEssFeed1","elecAcEssFeed2","elecAC1","elecAC2"], 0.5, func(val) {
if (val.elecAcEssFeed1) {
if (val.elecAC1 >= 110) {
obj["ELEC-Line-AC1-ACESS"].show();
@ -597,49 +595,49 @@ var canvas_lowerECAMPageElec =
obj["ELEC-Line-AC2-ACESS"].hide();
}
}),
props.UpdateManager.FromHashList(["elecGen1Volt","elecGen1GLC"], nil, func(val) {
props.UpdateManager.FromHashList(["elecGen1Volt","elecGen1GLC"], 0.5, 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) {
props.UpdateManager.FromHashList(["elecGen2Volt","elecGen2GLC"], 0.5, func(val) {
if (val.elecGen2Volt >= 110 and val.elecGen2GLC) {
obj["ELEC-Line-GEN2-AC2"].show();
} else {
obj["ELEC-Line-GEN2-AC2"].hide();
}
}),
props.UpdateManager.FromHashValue("elecAcTie1", nil, func(val) {
props.UpdateManager.FromHashValue("elecAcTie1", 1, func(val) {
if (val) {
obj["ELEC-Line-APU-AC1"].show();
} else {
obj["ELEC-Line-APU-AC1"].hide();
}
}),
props.UpdateManager.FromHashValue("elecAcTie2", nil, func(val) {
props.UpdateManager.FromHashValue("elecAcTie2", 1, func(val) {
if (val) {
obj["ELEC-Line-EXT-AC2"].show();
} else {
obj["ELEC-Line-EXT-AC2"].hide();
}
}),
props.UpdateManager.FromHashList(["elecAcTie1","elecAcTie2","apuGLC","elecExtEPC"], nil, func(val) {
props.UpdateManager.FromHashList(["elecAcTie1","elecAcTie2","apuGLC","elecExtEPC"], 1, func(val) {
if ((val.apuGLC and val.elecAcTie2) or (val.elecExtEPC and val.elecAcTie1) or (val.elecAcTie1 and val.elecAcTie2)) {
obj["ELEC-Line-APU-EXT"].show();
} else {
obj["ELEC-Line-APU-EXT"].hide();
}
}),
props.UpdateManager.FromHashValue("elecExtEPC", nil, func(val) {
props.UpdateManager.FromHashValue("elecExtEPC", 1, func(val) {
if (val) {
obj["EXT-out"].show();
} else {
obj["EXT-out"].hide();
}
}),
props.UpdateManager.FromHashValue("apuGLC", nil, func(val) {
props.UpdateManager.FromHashValue("apuGLC", 1, func(val) {
if (val) {
obj["APU-out"].show();
} else {
@ -653,18 +651,18 @@ var canvas_lowerECAMPageElec =
obj["ELEC-Line-ACESS-TRESS"].hide();
}
}),
props.UpdateManager.FromHashValue("elec15XE2", nil, func(val) {
props.UpdateManager.FromHashValue("elec15XE2", 1, func(val) {
if (val) {
obj["STATINV-group"].show();
} else {
obj["STATINV-group"].hide();
}
}),
props.UpdateManager.FromHashValue("statInvVolts", 0.1, func(val) {
obj["StatVolt"].setText(sprintf("%s",math.round(val)));
props.UpdateManager.FromHashValue("statInvVolts", 0.5, func(val) {
obj["StatVolt"].setText(sprintf("%s", math.round(val)));
}),
props.UpdateManager.FromHashValue("statInvHertz", 0.5, func(val) {
obj["StatHz"].setText(sprintf("%s",math.round(val)));
obj["StatHz"].setText(sprintf("%s", math.round(val)));
}),
];
@ -764,6 +762,14 @@ var canvas_lowerECAMPageElec =
update_item.update(notification);
}
if (notification.elecGroundCart == 0) {
me["EXTPWR-group"].hide();
} else {
me["EXTPWR-group"].show();
me["ExtVolt"].setText(me.extPwrVoltage);
me["ExtHz"].setText(me.extPwrHertz);
}
me.updateBottom(notification);
},
updatePower: func() {