From e2080544d90e4523aaaaf2ea6c06a9792d215ad9 Mon Sep 17 00:00:00 2001 From: Jonathan Redpath Date: Sun, 26 Sep 2021 16:36:29 +0100 Subject: [PATCH] Improve StatInv display on Lower ECAM --- Models/Instruments/Lower-ECAM/Lower-ECAM-elec.nas | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Models/Instruments/Lower-ECAM/Lower-ECAM-elec.nas b/Models/Instruments/Lower-ECAM/Lower-ECAM-elec.nas index 5f7e62ad..678075fc 100644 --- a/Models/Instruments/Lower-ECAM/Lower-ECAM-elec.nas +++ b/Models/Instruments/Lower-ECAM/Lower-ECAM-elec.nas @@ -653,15 +653,19 @@ var canvas_lowerECAMPageElec = obj["ELEC-Line-ACESS-TRESS"].hide(); } }), - props.UpdateManager.FromHashList(["elec15XE2","statInvVolts","statInvHertz"], nil, func(val) { - if (val.elec15XE2) { + props.UpdateManager.FromHashValue("elec15XE2", nil, func(val) { + if (val) { obj["STATINV-group"].show(); - obj["StatVolt"].setText(sprintf("%s",val.statInvVolts)); - obj["StatHertz"].setText(sprintf("%s",val.statInvHertz)); } else { obj["STATINV-group"].hide(); } }), + props.UpdateManager.FromHashValue("statInvVolts", 0.1, 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.displayedGForce = 0;