Showing 3 changed files with 187 additions and 44 deletions
+159 -2
Nasal/display.nas
... ...
@@ -47,17 +47,32 @@ var displayClass = {
47 47
                 ],
48 48
                 text: [
49 49
                     'VSIText',
50
-                    'Speed110'
50
+                    'Speed110',
51
+                    'Alt11100'
51 52
                 ],
52 53
                 clip: [
53 54
                     'SpeedLint1',
54
-                    'SpeedTape'
55
+                    'SpeedTape',
56
+                    'LintAlt',
57
+                    'AltLint00011'
55 58
                 ],
56 59
             });
57 60
 
61
+            var AltBigAltSmall = [ 'AltBigC', 'AltSmallC' ];
62
+            for (var place = 1; place <= 6; place +=1) {
63
+                append(AltBigAltSmall,
64
+                    'AltBigU' ~ place,
65
+                    'AltSmallU' ~ place,
66
+                    'AltBigD' ~ place,
67
+                    'AltSmallD' ~ place
68
+                );
69
+            }
70
+            me.loadGroup({text: AltBigAltSmall});
71
+
58 72
             me.updateAI(getprop('/orientation/roll-deg'),getprop('orientation/pitch-deg'));
59 73
             me.updateVSI(getprop('/instrumentation/vertical-speed-indicator/indicated-speed-fpm'));
60 74
             me.updateIAS(getprop('/velocities/airspeed-kt'));
75
+            me.updateALT(getprop('instrumentation/altimeter/indicated-altitude-ft'));
61 76
             me.progress.removeAllChildren();
62 77
             me.progress = nil;
63 78
             me.showInitProgress = nil;
... ...
@@ -143,6 +158,8 @@ var displayClass = {
143 158
         PitchScale : "rect(70,664,370,256)",
144 159
         SpeedLint1 : "rect(252,226,318,204)",
145 160
         SpeedTape : "rect(115,239,455,156)",
161
+        LintAlt : "rect(115,808,455,704)",
162
+        AltLint00011 : "rect(252,804,318,771)",
146 163
     },
147 164
 
148 165
     texts : {
... ...
@@ -192,4 +209,144 @@ var displayClass = {
192 209
             .setTranslation(0,ias * 5.711);
193 210
         settimer(func me.updateIAS(getprop('/velocities/airspeed-kt')), 0.1);
194 211
     },
212
+
213
+    updateALT: func (alt) {
214
+        if (alt < 0)
215
+            me.screenElements.Alt11100
216
+                .setText(sprintf("% 3i",math.ceil(alt/100)));
217
+        elsif (alt < 100)
218
+            me.screenElements.Alt11100
219
+                .setText('');
220
+        else
221
+            me.screenElements.Alt11100
222
+                .setText(sprintf("% 3i",math.floor(alt/100)));
223
+        me.screenElements.AltLint00011
224
+            .setTranslation(0,math.fmod(alt,100) * 1.24);
225
+
226
+        # From Farmin/G1000 http://wiki.flightgear.org/Project_Farmin/FG1000
227
+        if (alt> -1000 and alt< 1000000) {
228
+            var Offset10 = 0;
229
+            var Offset100 = 0;
230
+            var Offset1000 = 0;
231
+            if (alt< 0) {
232
+                var Ne = 1;
233
+                var alt= -alt;
234
+            }
235
+            else
236
+                var Ne = 0;
237
+
238
+            var Alt10       = math.mod(alt,100);
239
+            var Alt100      = int(math.mod(alt/100,10));
240
+            var Alt1000     = int(math.mod(alt/1000,10));
241
+            var Alt10000    = int(math.mod(alt/10000,10));
242
+            var Alt20       = math.mod(Alt10,20)/20;
243
+            if (Alt10 >= 80)
244
+                var Alt100 += Alt20;
245
+
246
+            if (Alt10 >= 80 and Alt100 >= 9)
247
+                var Alt1000 += Alt20;
248
+
249
+            if (Alt10 >= 80 and Alt100 >= 9 and Alt1000 >= 9)
250
+                var Alt10000 += Alt20;
251
+
252
+            if (alt> 100)
253
+                var Offset10 = 100;
254
+
255
+            if (alt> 1000)
256
+                var Offset100 = 10;
257
+
258
+            if (alt> 10000)
259
+                var Offset1000 = 10;
260
+
261
+            if (!Ne) {
262
+                me.screenElements.LintAlt.setTranslation(0,(math.mod(alt,100))*0.57375);
263
+                var altCentral = (int(alt/100)*100);
264
+            }
265
+            elsif (Ne) {
266
+                me.screenElements.LintAlt.setTranslation(0,(math.mod(alt,100))*-0.57375);
267
+                var altCentral = -(int(alt/100)*100);
268
+            }
269
+            me.screenElements["AltBigC"].setText("");
270
+            me.screenElements["AltSmallC"].setText("");
271
+            for (var place = 1; place <= 6; place += 1) {
272
+                var altUP = altCentral + (place*100);
273
+                var offset = -30.078;
274
+                if (altUP < 0) {
275
+                    var altUP = -altUP;
276
+                    var prefix = "-";
277
+                    var offset += 15.039;
278
+                }
279
+                else
280
+                    var prefix = "";
281
+
282
+                if (altUP == 0) {
283
+                    var AltBigUP    = "";
284
+                    var AltSmallUP  = "0";
285
+
286
+                }
287
+                elsif (math.mod(altUP,500) == 0 and altUP != 0) {
288
+                    var AltBigUP    = sprintf(prefix~"%1d", altUP);
289
+                    var AltSmallUP  = "";
290
+                }
291
+                elsif (altUP < 1000 and (math.mod(altUP,500))) {
292
+                    var AltBigUP    = "";
293
+                    var AltSmallUP  = sprintf(prefix~"%1d", int(math.mod(altUP,1000)));
294
+                    var offset = -30.078;
295
+                }
296
+                elsif ((altUP < 10000) and (altUP >= 1000) and (math.mod(altUP,500))) {
297
+                    var AltBigUP    = sprintf(prefix~"%1d", int(altUP/1000));
298
+                    var AltSmallUP  = sprintf("%1d", int(math.mod(altUP,1000)));
299
+                    var offset += 15.039;
300
+                }
301
+                else {
302
+                    var AltBigUP    = sprintf(prefix~"%1d", int(altUP/1000));
303
+                    var mod = int(math.mod(altUP,1000));
304
+                    var AltSmallUP  = sprintf("%1d", mod);
305
+                    var offset += 30.078;
306
+                }
307
+
308
+                me.screenElements["AltBigU"~place].setText(AltBigUP);
309
+                me.screenElements["AltSmallU"~place].setText(AltSmallUP);
310
+                me.screenElements["AltSmallU"~place].setTranslation(offset,0);
311
+                var altDOWN = altCentral - (place*100);
312
+                var offset = -30.078;
313
+                if (altDOWN < 0) {
314
+                    var altDOWN = -altDOWN;
315
+                    var prefix = "-";
316
+                    var offset += 15.039;
317
+                }
318
+                else
319
+                    var prefix = "";
320
+
321
+                if (altDOWN == 0) {
322
+                    var AltBigDOWN  = "";
323
+                    var AltSmallDOWN    = "0";
324
+                }
325
+                elsif (math.mod(altDOWN,500) == 0 and altDOWN != 0) {
326
+                    var AltBigDOWN  = sprintf(prefix~"%1d", altDOWN);
327
+                    var AltSmallDOWN    = "";
328
+                }
329
+                elsif (altDOWN < 1000 and (math.mod(altDOWN,500))) {
330
+                    var AltBigDOWN  = "";
331
+                    var AltSmallDOWN    = sprintf(prefix~"%1d", int(math.mod(altDOWN,1000)));
332
+                    var offset = -30.078;
333
+                }
334
+                elsif ((altDOWN < 10000) and (altDOWN >= 1000) and (math.mod(altDOWN,500))) {
335
+                    var AltBigDOWN  = sprintf(prefix~"%1d", int(altDOWN/1000));
336
+                    var AltSmallDOWN    = sprintf("%1d", int(math.mod(altDOWN,1000)));
337
+                    var offset += 15.039;
338
+                }
339
+                else {
340
+                    var AltBigDOWN  = sprintf(prefix~"%1d", int(altDOWN/1000));
341
+                    var mod = int(math.mod(altDOWN,1000));
342
+                    var AltSmallDOWN    = sprintf("%1d", mod);
343
+                    var offset += 30.078;
344
+                }
345
+                me.screenElements["AltBigD"~place].setText(AltBigDOWN);
346
+                me.screenElements["AltSmallD"~place].setText(AltSmallDOWN);
347
+                me.screenElements["AltSmallD"~place].setTranslation(offset,0);
348
+            }
349
+        }
350
+        settimer(func me.updateALT(getprop('instrumentation/altimeter/indicated-altitude-ft')), 0.2);
351
+    },
195 352
 };
+7 -5
README.md
... ...
@@ -53,14 +53,16 @@ Dans ce projet je privilégie particulièrement
53 53
     *   retraits de fonctionnalités peu utiles dans un simulateur
54 54
 
55 55
 # État acuel
56
-J'ai récupéré l'implémentation du GDU-104X (je ne sais plus où) l'implémentation du Garmin Primus 1000, et notamment les objets 3D, et les SVG. Les objets 3D sont bien plus jolis que ceux du premier zkv1000 (le .ac de l'ancien était tout cassé, pas réussi à réparer), et le SVG comportait déjà beaucoup d'éléments.
56
+J'ai récupéré l'implémentation du [projet "Farmin/G1000"](http://wiki.flightgear.org/Project_Farmin/FG1000). Le GDU-104X reprend l'implémentation du Garmin Primus 1000, et notamment les objets 3D, et les SVG. Les objets 3D sont bien plus jolis que ceux du premier zkv1000 (le .ac de l'ancien était tout cassé, pas réussi à réparer), et le SVG comportait déjà beaucoup d'éléments.
57 57
 
58 58
 ## général
59
-![][20%]  
60
-**de moins en moins INUTILISABLE**  
59
+![][40%]  
60
+**de plus en plus UTILISABLE**  
61 61
 
62 62
 * double-écran ![][30%]: pas d'écran de MFD, uniquement PFD 
63
-* ![][ongoing]animations écrans ![][20%]: wrapper pour l'affichage des objets (et plus), AI fonctionnel, VS, ALT et IAS, Compas à suivre, 
63
+* ![][ongoing]animations écrans ![][50%]: wrapper pour l'affichage des objets (et plus), Compas à suivre, 
64
+    * AI: ![][90%] reste l'échelle du pitch dont je ne sais pas si il faut la centrer sur le symbole de l'avion
65
+    * VSI, IAS, IA: ![][100%]
64 66
 * animation modèle 3D ![][90%]: les boutons et molettes fonctionnent (radio, comm, softkey, etc.), il manque les textures pour les botons du MFD
65 67
 
66 68
 ## dans le détail
... ...
@@ -76,7 +78,7 @@ J'ai récupéré l'implémentation du GDU-104X (je ne sais plus où) l'implémen
76 78
   * enfin retrouvée la  possibilité de gérer le zkv1000 par la console Nasal et même le nouvel REPL ![][100%]
77 79
 
78 80
 ## feuille de route
79
-1. avoir un PFD utilisable avec les fonctions de base, sans radio-navigation ![][10%]
81
+1. avoir un PFD utilisable avec les fonctions de base, sans radio-navigation ![][80%]
80 82
 1. afficher l'EIS ![][0%]
81 83
 1. afficher les widgets du PFD ![][10%]
82 84
 1. rendre disponible le MFD ![][0%]
+21 -37
Systems/screen.svg
... ...
@@ -138,18 +138,6 @@
138 138
        x2="401.00098"
139 139
        y2="-263.58203"
140 140
        gradientUnits="userSpaceOnUse" />
141
-    <clipPath
142
-       clipPathUnits="userSpaceOnUse"
143
-       id="clipPath6120">
144
-      <rect
145
-         style="display:inline;opacity:1;fill:none;fill-opacity:0.31372549;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
146
-         id="rect6122"
147
-         width="105"
148
-         height="342"
149
-         x="703.5"
150
-         y="113.5"
151
-         inkscape:label="AltLintBG-clip" />
152
-    </clipPath>
153 141
     <clipPath
154 142
        clipPathUnits="userSpaceOnUse"
155 143
        id="clipPath5896">
... ...
@@ -162,18 +150,6 @@
162 150
          y="251"
163 151
          inkscape:label="altlind10-clip" />
164 152
     </clipPath>
165
-    <clipPath
166
-       clipPathUnits="userSpaceOnUse"
167
-       id="clipPath5896-3">
168
-      <rect
169
-         style="fill:none;stroke:none;stroke-width:1.00699997;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
170
-         id="rect5898-6"
171
-         width="34"
172
-         height="67"
173
-         x="771"
174
-         y="251"
175
-         inkscape:label="altlind10-clip" />
176
-    </clipPath>
177 153
     <filter
178 154
        inkscape:collect="always"
179 155
        style="color-interpolation-filters:sRGB"
... ...
@@ -1485,7 +1461,7 @@
1485 1461
          id="AltLint"
1486 1462
          style="display:inline">
1487 1463
         <text
1488
-           inkscape:label="#AltLint100"
1464
+           inkscape:label="AltLint100"
1489 1465
            id="AltLint100"
1490 1466
            y="-397.39993"
1491 1467
            x="770.19751"
... ...
@@ -1732,7 +1708,7 @@
1732 1708
            x="755.13684"
1733 1709
            y="-533.58392"
1734 1710
            id="AltLint1000"
1735
-           inkscape:label="#AltLint1000"><tspan
1711
+           inkscape:label="AltLint1000"><tspan
1736 1712
              id="tspan7311"
1737 1713
              sodipodi:role="line"
1738 1714
              x="755.13684"
... ...
@@ -1969,7 +1945,7 @@
1969 1945
              y="1122.4161"
1970 1946
              style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:30px;line-height:120.00000477%;font-family:sans-serif;-inkscape-font-specification:'Sans, Normal';text-align:end;writing-mode:lr-tb;text-anchor:end;fill:#ffffff;fill-opacity:1">3</tspan></text>
1971 1947
         <text
1972
-           inkscape:label="#AltLint10000"
1948
+           inkscape:label="AltLint10000"
1973 1949
            id="AltLint10000"
1974 1950
            y="-533.58392"
1975 1951
            x="737.1369"
... ...
@@ -4436,7 +4412,7 @@
4436 4412
            id="tspan5009">0</tspan></text>
4437 4413
       <g
4438 4414
          id="LintAlt"
4439
-         clip-path="url(#clipPath6120)"
4415
+         clip-path="none"
4440 4416
          style="display:inline">
4441 4417
         <g
4442 4418
            inkscape:tile-h="48.4"
... ...
@@ -4752,7 +4728,7 @@
4752 4728
            width="100%"
4753 4729
            height="100%" />
4754 4730
         <text
4755
-           inkscape:label="#AltBigD6"
4731
+           inkscape:label="AltBigD6"
4756 4732
            xml:space="preserve"
4757 4733
            style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:0%;font-family:'Liberation Sans';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
4758 4734
            x="726.27905"
... ...
@@ -4775,7 +4751,7 @@
4775 4751
              y="635.18689"
4776 4752
              style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:20px;line-height:125%;font-family:'Liberation Sans';text-align:start;writing-mode:lr-tb;text-anchor:start">800</tspan></text>
4777 4753
         <text
4778
-           inkscape:label="#AltBigD5"
4754
+           inkscape:label="AltBigD5"
4779 4755
            id="AltBigD5"
4780 4756
            y="579.42883"
4781 4757
            x="726.27905"
... ...
@@ -4820,7 +4796,7 @@
4820 4796
              y="520.43689"
4821 4797
              style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:20px;line-height:125%;font-family:'Liberation Sans';text-align:start;writing-mode:lr-tb;text-anchor:start">800</tspan></text>
4822 4798
         <text
4823
-           inkscape:label="#AltBigD3"
4799
+           inkscape:label="AltBigD3"
4824 4800
            id="AltBigD3"
4825 4801
            y="464.67886"
4826 4802
            x="726.27905"
... ...
@@ -4865,7 +4841,7 @@
4865 4841
              y="405.68692"
4866 4842
              style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:20px;line-height:125%;font-family:'Liberation Sans';text-align:start;writing-mode:lr-tb;text-anchor:start">800</tspan></text>
4867 4843
         <text
4868
-           inkscape:label="#AltBigD1"
4844
+           inkscape:label="AltBigD1"
4869 4845
            id="AltBigD1"
4870 4846
            y="349.92886"
4871 4847
            x="726.27905"
... ...
@@ -4888,7 +4864,7 @@
4888 4864
              id="tspan5278"
4889 4865
              sodipodi:role="line">800</tspan></text>
4890 4866
         <text
4891
-           inkscape:label="#AltBigC"
4867
+           inkscape:label="AltBigC"
4892 4868
            xml:space="preserve"
4893 4869
            style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:0%;font-family:'Liberation Sans';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
4894 4870
            x="726.27905"
... ...
@@ -4900,7 +4876,7 @@
4900 4876
              y="292.55386"
4901 4877
              style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:25px;line-height:125%;font-family:'Liberation Sans';text-align:start;writing-mode:lr-tb;text-anchor:start">88</tspan></text>
4902 4878
         <text
4903
-           inkscape:label="#AltSmallC"
4879
+           inkscape:label="AltSmallC"
4904 4880
            xml:space="preserve"
4905 4881
            style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:0%;font-family:'Liberation Sans';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;display:inline;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
4906 4882
            x="756.35358"
... ...
@@ -4956,7 +4932,7 @@
4956 4932
              y="176.18692"
4957 4933
              style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:20px;line-height:125%;font-family:'Liberation Sans';text-align:start;writing-mode:lr-tb;text-anchor:start">800</tspan></text>
4958 4934
         <text
4959
-           inkscape:label="#AltBigU3"
4935
+           inkscape:label="AltBigU3"
4960 4936
            id="AltBigU3"
4961 4937
            y="120.42886"
4962 4938
            x="726.27905"
... ...
@@ -4979,7 +4955,7 @@
4979 4955
              id="tspan5310"
4980 4956
              sodipodi:role="line">800</tspan></text>
4981 4957
         <text
4982
-           inkscape:label="#AltBigU4"
4958
+           inkscape:label="AltBigU4"
4983 4959
            xml:space="preserve"
4984 4960
            style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:0%;font-family:'Liberation Sans';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
4985 4961
            x="726.27863"
... ...
@@ -5071,7 +5047,7 @@
5071 5047
          x="804.11523"
5072 5048
          style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:0%;font-family:sans-serif;-inkscape-font-specification:'Sans, Normal';text-align:end;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:end;display:inline;opacity:1;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;filter:url(#filter4691-7)"
5073 5049
          xml:space="preserve"
5074
-         clip-path="url(#clipPath5896-3)"><tspan
5050
+         clip-path="none"><tspan
5075 5051
            style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:25px;line-height:100%;font-family:sans-serif;-inkscape-font-specification:'Sans, Normal';text-align:end;writing-mode:lr-tb;text-anchor:end;fill:#ffffff;fill-opacity:1"
5076 5052
            y="-32.394936"
5077 5053
            x="804.11523"
... ...
@@ -5207,6 +5183,14 @@
5207 5183
            y="617.60504"
5208 5184
            x="804.11523"
5209 5185
            sodipodi:role="line">60</tspan></text>
5186
+      <rect
5187
+         inkscape:label="altlind10-clip"
5188
+         y="251"
5189
+         x="771"
5190
+         height="67"
5191
+         width="34"
5192
+         id="rect5898-6"
5193
+         style="display:none;fill:none;stroke:none;stroke-width:1.00699997;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
5210 5194
       <rect
5211 5195
          inkscape:label="speedlint1-clip"
5212 5196
          y="251"