1
0
Fork 0

Upper ECAM (IAE): EPR value should round with sprintf() rather than math.round()

This commit is contained in:
Jonathan Redpath 2021-10-16 15:42:31 +01:00
parent 13029c4d0c
commit 7675a9f5f0

View file

@ -210,15 +210,13 @@ var canvas_upperECAM = {
props.UpdateManager.FromHashValue("EPR_2", 0.01, func(val) {
obj["EPR2-needle"].setRotation((val + 90) * D2R);
}),
props.UpdateManager.FromHashValue("EPR_actual_1", 0.0001, func(val) {
epr1 = math.round(val, 0.001);
props.UpdateManager.FromHashValue("EPR_actual_1", nil, func(val) {
obj["EPR1"].setText(sprintf("%1.0f", math.floor(epr1)));
obj["EPR1-decimal"].setText(sprintf("%03d", (epr1 - int(epr1)) * 1000));
obj["EPR1-decimal"].setText(sprintf("%03d", (val - int(val)) * 1000));
}),
props.UpdateManager.FromHashValue("EPR_actual_2", 0.0001, func(val) {
epr2 = math.round(val, 0.001);
props.UpdateManager.FromHashValue("EPR_actual_2", nil, func(val) {
obj["EPR2"].setText(sprintf("%1.0f", math.floor(epr2)));
obj["EPR2-decimal"].setText(sprintf("%03d", (epr2 - int(epr2)) * 1000));
obj["EPR2-decimal"].setText(sprintf("%03d", (val - int(val)) * 1000));
}),
props.UpdateManager.FromHashValue("EPR_lim", 0.005, func(val) {
obj["EPR1-ylim"].setRotation((val + 90) * D2R);
@ -286,9 +284,8 @@ var canvas_upperECAM = {
obj["N1Lim-mode"].setText(sprintf("%s", val));
}),
props.UpdateManager.FromHashValue("eprLimit", 0.0005, func(val) {
eprLim = math.round(val, 0.001);
obj["EPRLim"].setText(sprintf("%1.0f", math.floor(eprLim)));
obj["EPRLim-decimal"].setText(sprintf("%03d", (eprLim - int(eprLim)) * 1000));
obj["EPRLim-decimal"].setText(sprintf("%03d", (val - int(val)) * 1000));
}),
props.UpdateManager.FromHashValue("n1Limit", 0.01, func(val) {
obj["N1Lim"].setText(sprintf("%s", math.floor(val + 0.05)));