1
0
Fork 0

DU: Fix bad display of EPR

This commit is contained in:
Josh Davidson 2021-05-27 15:15:06 -04:00
parent b280576533
commit 8398d2b04d

View file

@ -2,6 +2,9 @@ var flapsPos = nil;
var LBS2KGS = 0.4535924; var LBS2KGS = 0.4535924;
var slatLockGoing = 0; var slatLockGoing = 0;
var slatLockFlash = 0; var slatLockFlash = 0;
var epr1 = 1;
var epr2 = 1;
var eprLim = 1;
var acconfig_weight_kgs = props.globals.getNode("/systems/acconfig/options/weight-kgs", 1); var acconfig_weight_kgs = props.globals.getNode("/systems/acconfig/options/weight-kgs", 1);
var acconfig = props.globals.getNode("/systems/acconfig/autoconfig-running", 1); var acconfig = props.globals.getNode("/systems/acconfig/autoconfig-running", 1);
var du3_test = props.globals.initNode("/instrumentation/du/du3-test", 0, "BOOL"); var du3_test = props.globals.initNode("/instrumentation/du/du3-test", 0, "BOOL");
@ -205,12 +208,14 @@ var canvas_upperECAM = {
obj["EPR2-needle"].setRotation((val + 90) * D2R); obj["EPR2-needle"].setRotation((val + 90) * D2R);
}), }),
props.UpdateManager.FromHashValue("EPR_actual_1", 0.0001, func(val) { props.UpdateManager.FromHashValue("EPR_actual_1", 0.0001, func(val) {
obj["EPR1"].setText(sprintf("%1.0f", math.floor(val))); epr1 = math.round(val, 0.001);
obj["EPR1-decimal"].setText(sprintf("%03d", math.round((val - int(val)) * 1000))); obj["EPR1"].setText(sprintf("%1.0f", math.floor(epr1)));
obj["EPR1-decimal"].setText(sprintf("%03d", (epr1 - int(epr1)) * 1000));
}), }),
props.UpdateManager.FromHashValue("EPR_actual_2", 0.0001, func(val) { props.UpdateManager.FromHashValue("EPR_actual_2", 0.0001, func(val) {
obj["EPR2"].setText(sprintf("%1.0f", math.floor(val))); epr2 = math.round(val, 0.001);
obj["EPR2-decimal"].setText(sprintf("%03d", math.round((val - int(val)) * 1000))); obj["EPR2"].setText(sprintf("%1.0f", math.floor(epr2)));
obj["EPR2-decimal"].setText(sprintf("%03d", (epr2 - int(epr2)) * 1000));
}), }),
props.UpdateManager.FromHashValue("EPR_lim", 0.005, func(val) { props.UpdateManager.FromHashValue("EPR_lim", 0.005, func(val) {
obj["EPR1-ylim"].setRotation((val + 90) * D2R); obj["EPR1-ylim"].setRotation((val + 90) * D2R);
@ -278,8 +283,9 @@ var canvas_upperECAM = {
obj["N1Lim-mode"].setText(sprintf("%s", val)); obj["N1Lim-mode"].setText(sprintf("%s", val));
}), }),
props.UpdateManager.FromHashValue("eprLimit", 0.0005, func(val) { props.UpdateManager.FromHashValue("eprLimit", 0.0005, func(val) {
obj["EPRLim"].setText(sprintf("%1.0f", math.floor(val))); eprLim = math.round(val, 0.001);
obj["EPRLim-decimal"].setText(sprintf("%03d", math.round((val - int(val)) * 1000))); obj["EPRLim"].setText(sprintf("%1.0f", math.floor(eprLim)));
obj["EPRLim-decimal"].setText(sprintf("%03d", (eprLim - int(eprLim)) * 1000));
}), }),
props.UpdateManager.FromHashValue("n1Limit", 0.01, func(val) { props.UpdateManager.FromHashValue("n1Limit", 0.01, func(val) {
obj["N1Lim"].setText(sprintf("%s", math.floor(val + 0.05))); obj["N1Lim"].setText(sprintf("%s", math.floor(val + 0.05)));