Showing 1 changed files with 19 additions and 5 deletions
+19 -5
Nasal/EIS/single-prop.nas
... ...
@@ -1,6 +1,9 @@
1
+# This is most an example than a really efficient EIS
2
+# power % is throttle %
3
+# assumes that there are two tanks with equals quantity...
1 4
 displayClass.showEIS = func (groups) {
2 5
     canvas.parsesvg(me.screen, data.zkv1000_reldir ~ 'Systems/EIS/single-prop.svg');
3
-    append(groups.show, 'EIS', 'POWER-pointer');
6
+    append(groups.show, 'EIS', 'POWER-pointer', 'FUEL-RIGHT-pointer', 'FUEL-LEFT-pointer');
4 7
     append(groups.text,
5 8
             'RPM-text', 'EGT-text', 'CHT-text', 'FUEL-USED-text',
6 9
             'FUEL-FLOW-text', 'MAN-Hg-text', 'POWER-PERCENT-text',
... ...
@@ -28,11 +31,22 @@ displayClass.updateEIS = func {
28 31
             .setText(psi == nil ? '--' : sprintf('%u', psi));
29 32
         me.screenElements['OIL-TEMP-text']
30 33
             .setText(sprintf('%i', getprop('/engines/engine/oil-temperature-degf')));
31
-        var used_fuel = getprop('/instrumentation/zkv1000/eis/fuel-qty-at-start')
32
-                      - getprop('/consumables/fuel/tank/level-gal_us')
33
-                      - getprop('/consumables/fuel/tank[1]/level-gal_us');
34
+        var full = getprop('/instrumentation/zkv1000/eis/fuel-qty-at-start');
35
+        var right = getprop('/consumables/fuel/tank/level-gal_us');
36
+        var left = getprop('/consumables/fuel/tank[1]/level-gal_us');
37
+        var used_fuel = full - (right + left);
34 38
         me.screenElements['FUEL-USED-text']
35 39
             .setText(sprintf('%.1d', used_fuel > 0 ? used_fuel : 0));
40
+        me.screenElements['FUEL-RIGHT-pointer']
41
+            .setTranslation(
42
+                    0,
43
+                    (1 - right / (full/2)) * -80
44
+                );
45
+        me.screenElements['FUEL-LEFT-pointer']
46
+            .setTranslation(
47
+                    0,
48
+                    (1 - left / (full/2)) * -80
49
+                );
36 50
         me.screenElements['BUS-V-text']
37 51
             .setText(sprintf('%.1i', getprop('/systems/electrical/outputs/bus')));
38 52
         me.screenElements['BATT-text']
... ...
@@ -43,7 +57,7 @@ displayClass.updateEIS = func {
43 57
         me.screenElements['EGT-text']
44 58
             .setText(sprintf('%i', getprop('/engines/engine/egt-degf')));
45 59
     }
46
-    settimer(func me.updateEIS(), 1);
60
+    settimer(func me.updateEIS(), 0.2);
47 61
     me._eis_count += 1;
48 62
 };
49 63