From 91891e59557d858eee18672fa2501bc87e274637 Mon Sep 17 00:00:00 2001 From: Jonathan Redpath Date: Wed, 20 Apr 2022 14:02:55 +0100 Subject: [PATCH] Fix APU Hertz parameter --- .../Instruments/Lower-ECAM/Lower-ECAM-APU.nas | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/Models/Instruments/Lower-ECAM/Lower-ECAM-APU.nas b/Models/Instruments/Lower-ECAM/Lower-ECAM-APU.nas index 6d5bf7c2..66c29724 100644 --- a/Models/Instruments/Lower-ECAM/Lower-ECAM-APU.nas +++ b/Models/Instruments/Lower-ECAM/Lower-ECAM-APU.nas @@ -106,7 +106,7 @@ var canvas_lowerECAMPageApu = } }), props.UpdateManager.FromHashValue("apuEgt", 0.05, func(val) { - obj.apuEgt = sprintf("%s", math.round(val, 5)); + obj.apuEgt = sprintf("%s", math.clamp(math.round(val, 5), 0, 9995)); }), props.UpdateManager.FromHashValue("apuEgtRot", 0.1, func(val) { obj["APUEGT-needle"].setRotation((val + 90) * D2R); @@ -126,11 +126,7 @@ var canvas_lowerECAMPageApu = } }), props.UpdateManager.FromHashValue("apuHertz", 0.5, func(val) { - if (val < 0.5) { - obj["APUGenHz"].setText("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); @@ -162,7 +158,17 @@ var canvas_lowerECAMPageApu = }), props.UpdateManager.FromHashValue("apuRpm", 0.5, func(val) { if (val >= 0.5) { - obj["APUN"].setColor(0.0509,0.7529,0.2941); + if (val >= 107) { + obj["APUN"].setColor(1,0,0); + obj["APUN-needle"].setColor(1,0,0); + } elsif (val >= 102) { + obj["APUN"].setColor(0.7333,0.3803,0); + obj["APUN-needle"].setColor(0.7333,0.3803,0); + } else { + obj["APUN"].setColor(0.0509,0.7529,0.2941); + obj["APUN-needle"].setColor(0.0509,0.7529,0.2941); + } + obj["APUEGT"].setColor(0.0509,0.7529,0.2941); obj["APUN-needle"].show(); obj["APUEGT-needle"].show();