Showing 5 changed files with 50 additions and 27 deletions
+5 -4
Models/PFD.svg
... ...
@@ -6533,19 +6533,20 @@
6533 6533
        inkscape:label="TIME-text"
6534 6534
        id="TIME-text"
6535 6535
        y="737.37219"
6536
-       x="927.99896"
6536
+       x="939.99896"
6537 6537
        style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:18.66666603px;line-height:125%;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans Bold';letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
6538 6538
        xml:space="preserve"><tspan
6539 6539
          y="737.37219"
6540
-         x="927.99896"
6540
+         x="939.99896"
6541 6541
          id="tspan6089-5"
6542 6542
          sodipodi:role="line">23:59:59</tspan></text>
6543 6543
     <text
6544
-       id="text6095"
6544
+       id="TIME-REF-text"
6545 6545
        y="736.52142"
6546 6546
        x="896.71527"
6547 6547
        style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:16px;line-height:125%;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
6548
-       xml:space="preserve"><tspan
6548
+       xml:space="preserve"
6549
+       inkscape:label="TIME-REF-text"><tspan
6549 6550
          y="736.52142"
6550 6551
          x="896.71527"
6551 6552
          id="tspan6093"
+10
Nasal/buttons.nas
... ...
@@ -227,6 +227,16 @@ var buttonsClass = {
227 227
                         data.settings.units.altitude = 'mpm';
228 228
                 }
229 229
             },
230
+            {type: 'separator'},
231
+            {text: 'TIME REF: ', type: 'normal'},
232
+            {text: data.settings.time.actual,
233
+                type: 'editable|end-of-line',
234
+                choices: [ '  GMT >', '< LCL >', '< UTC >', '< RL   ' ],
235
+                callback: func (id, selected) {
236
+                    data.settings.time.actual = me.device.windows.state[id].objects[selected].text;
237
+                    data.settings.time.label = string.trim(me.device.windows.state[id].objects[selected].text, 0, func (c) c == ` ` or c == `<` or c == `>`);
238
+                }
239
+            },
230 240
         ];
231 241
         me.device.windows.draw( windowId, {autogeom: 1}, obj_infos);
232 242
         me.device.knobs.FmsOuter = me.device.knobs.NavigateMenu;
+4 -2
Nasal/display.nas
... ...
@@ -124,7 +124,7 @@ var displayClass = {
124 124
                 'SelectedALT-text',
125 125
                 'TAS-text',
126 126
                 'GSPD-text',
127
-                'TIME-text',
127
+                'TIME-text', 'TIME-REF-text',
128 128
                 'OAT-text',
129 129
                 'VSIText',
130 130
                 'Speed110',
... ...
@@ -1232,8 +1232,10 @@ var displayClass = {
1232 1232
 
1233 1233
     updateTIME : func {
1234 1234
 # updates the displayed time botoom left {{{
1235
+        me.screenElements['TIME-REF-text']
1236
+            .setText(data.settings.time.label);
1235 1237
         me.screenElements['TIME-text']
1236
-            .setText(getprop('/sim/time/gmt-string'));
1238
+            .setText(time[data.settings.time.label]());
1237 1239
     },
1238 1240
 #}}}
1239 1241
 
+27 -21
Nasal/lib.nas
... ...
@@ -40,29 +40,35 @@ var DMS = func (d, c) {
40 40
     return sprintf('%d %02d %04.1f %s', int(deg), int(min), abs(sec), c);
41 41
 }
42 42
 
43
-var timeUTC = func {
44
-    setprop('/instrumentation/zkv1000/infos/time', sprintf('UTC %02i%02i%02i',
45
-                getprop('/sim/time/utc/hour'),
46
-                getprop('/sim/time/utc/minute'),
47
-                getprop('/sim/time/utc/second')));
48
-}
43
+var time = {
44
+    GMT : func {
45
+        return getprop('/sim/time/gmt-string');
46
+    },
49 47
 
50
-var timeLCL = func {
51
-    var utc_hour = getprop('/sim/time/utc/hour') + (getprop('/sim/time/local-offset') / 3600);
52
-    if (utc_hour > 23) utc_hour -= 24;
53
-    if (utc_hour < 0)  utc_hour += 24;
54
-    setprop('/instrumentation/zkv1000/infos/time', sprintf('LCL  %02i%02i%02i',
55
-                utc_hour, 
56
-                getprop('/sim/time/utc/minute'),
57
-                getprop('/sim/time/utc/second')));
58
-}
48
+    UTC : func {
49
+        return sprintf('%02i:%02i:%02i',
50
+                    getprop('/sim/time/utc/hour'),
51
+                    getprop('/sim/time/utc/minute'),
52
+                    getprop('/sim/time/utc/second'));
53
+    },
59 54
 
60
-var timeRL = func {
61
-    setprop('/instrumentation/zkv1000/infos/time', sprintf('RL   %02i%02i%02i',
62
-                getprop('/sim/time/real/hour'),
63
-                getprop('/sim/time/real/minute'),
64
-                getprop('/sim/time/real/second')));
65
-}
55
+    LCL : func {
56
+        var utc_hour = getprop('/sim/time/utc/hour') + (getprop('/sim/time/local-offset') / 3600);
57
+        if (utc_hour > 23) utc_hour -= 24;
58
+        if (utc_hour < 0)  utc_hour += 24;
59
+        return sprintf('%02i:%02i:%02i',
60
+                    utc_hour,
61
+                    getprop('/sim/time/utc/minute'),
62
+                    getprop('/sim/time/utc/second'));
63
+    },
64
+
65
+    RL : func {
66
+        return sprintf('%02i:%02i:%02i',
67
+                    getprop('/sim/time/real/hour'),
68
+                    getprop('/sim/time/real/minute'),
69
+                    getprop('/sim/time/real/second'));
70
+    },
71
+};
66 72
 
67 73
 # returns time + d (is seconds) formated HH:MM:SS
68 74
 var HMS = func (hh, mm, ss, d = 0) {
+4
zkv1000.nas
... ...
@@ -48,6 +48,10 @@ var data = { # set of data common to all devices
48 48
             distance: 'nm',
49 49
             vertical: 'fpm',
50 50
         },
51
+        time: {
52
+            label: 'GMT',
53
+            actual: '  GMT >',
54
+        },
51 55
     },
52 56
     timers : {
53 57
         '20Hz': maketimer (