Showing 5 changed files with 81 additions and 32 deletions
+2 -2
Models/PFD.svg
... ...
@@ -4246,8 +4246,8 @@
4246 4246
            style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:0%;font-family:'Liberation Sans';text-align:end;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:end;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
4247 4247
            xml:space="preserve"><tspan
4248 4248
              style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:17.5px;line-height:125%;font-family:'Liberation Sans';text-align:end;writing-mode:lr-tb;text-anchor:end"
4249
-             y="293.71161"
4250
-             x="877.40613"
4249
+             y="290"
4250
+             x="870"
4251 4251
              id="tspan6415"
4252 4252
              sodipodi:role="line" /></text>
4253 4253
       </g>
+28 -27
Nasal/afcs.nas
... ...
@@ -22,11 +22,6 @@ var APClass = {
22 22
             data.timers.updateAP.start();
23 23
         }
24 24
 
25
-        if (! contains(data.timers, 'AP_blinking')) {
26
-            data.timers.AP_blinking = maketimer(0, m,  m._blinking);
27
-            data.timers.AP_blinking.singleShot = 1;
28
-        }
29
-
30 25
         var ap_annun = [
31 26
             'LATMOD-Armed-text',  'LATMOD-Active-text',
32 27
             'AP-Status-text',     'YD-Status-text',
... ...
@@ -51,7 +46,7 @@ var APClass = {
51 46
         return m;
52 47
     },
53 48
     softkey: func (side, row, a) {
54
-        if (a or me._locked)
49
+        if (a)
55 50
             return;
56 51
         var _system = me.systems[me.system];
57 52
         var _side = _system[side];
... ...
@@ -69,6 +64,11 @@ var APClass = {
69 64
         STEC55X: {
70 65
             hook : func {
71 66
                 me.trimTarget = 0;
67
+                afcs.getNode('heading-bug-deg').unalias();
68
+                stec55x.hdg.alias(afcs.getNode('heading-bug-deg'));
69
+                afcs.getNode('selected-alt-ft').unalias();
70
+                stec55x.alt.alias(afcs.getNode('selected-alt-ft'));
71
+                setprop('/it-stec55x/input/ap-master-sw', 1);
72 72
             },
73 73
             updateDisplay: func {
74 74
                 var se = flightdeck.PFD.display.screenElements;
... ...
@@ -129,48 +129,49 @@ var APClass = {
129 129
                 }
130 130
             },
131 131
             L: [
132
+                func,
132 133
                 func {
133
-                    var ap_master_sw = '/it-stec55x/input/ap-master-sw';
134
-                    setprop(ap_master_sw, !getprop(ap_master_sw));
135
-                },
136
-                func {
137
-                    var apfd_master_sw = '/it-stec55x/input/apfd-master-sw';
138
-                    setprop(apfd_master_sw, !getprop(apfd_master_sw));
134
+#                    var apfd_master_sw = '/it-stec55x/input/apfd-master-sw';
135
+#                    setprop(apfd_master_sw, !getprop(apfd_master_sw));
139 136
                 },
140 137
                 func {
141
-                    call(stec55x.button.NAV, [], nil, stec55x);
138
+#                    call(stec55x.button.NAV, [], nil, stec55x);
142 139
                 },
143 140
                 func {
144
-                    call(stec55x.button.ALT, [], nil, stec55x);
141
+#                    call(stec55x.button.ALT, [], nil, stec55x);
145 142
                 },
146 143
                 func {
147
-                    call(stec55x.button.VS, [], nil, stec55x);
144
+#                    stec55x.vs.setValue(math.round(data.vsi, 100));
145
+#                    call(stec55x.button.VS, [], nil, stec55x);
148 146
                 },
149 147
                 func,
150 148
             ],
151 149
             R: [
152 150
                 func {
153
-                    var yaw_dumper_sw = '/it-stec55x/input/yaw-damper-sw';
154
-                    setprop(yaw_dumper_sw, !getprop(yaw_dumper_sw));
151
+#                    var yaw_dumper_sw = '/it-stec55x/input/yaw-damper-sw';
152
+#                    setprop(yaw_dumper_sw, !getprop(yaw_dumper_sw));
155 153
                 },
156 154
                 func {
157
-                    call(stec55x.button.HDG, [], nil, stec55x);
155
+                    if (stec55x.roll.getValue() == 0)
156
+                        stec55x.roll.setValue(-1);
157
+                    else
158
+                        call(stec55x.button.HDG, [], nil, stec55x);
158 159
                 },
159 160
                 func {
160
-                    call(stec55x.button.APR, [], nil, stec55x);
161
+#                    call(stec55x.button.APR, [], nil, stec55x);
161 162
                 },
162 163
                 func,
163 164
                 func { # UP (trim)
164
-                    if (autopilot.systems.STEC55X.trimTarget > -15)
165
-                        autopilot.systems.STEC55X.trimTarget -= 1;
166
-                    fgcommand('property-assign', {property: '/it-stec55x/input/man-trim', value: -1});
167
-                    fgcommand('property-assign', {property: '/it-stec55x/input/man-trim', value:  0});
165
+#                    if (autopilot.systems.STEC55X.trimTarget > -15)
166
+#                        autopilot.systems.STEC55X.trimTarget -= 1;
167
+#                    fgcommand('property-assign', {property: '/it-stec55x/input/man-trim', value: -1});
168
+#                    fgcommand('property-assign', {property: '/it-stec55x/input/man-trim', value:  0});
168 169
                 },
169 170
                 func { # DN (trim)
170
-                    if (autopilot.systems.STEC55X.trimTarget < 20)
171
-                        autopilot.systems.STEC55X.trimTarget += 1;
172
-                    fgcommand('property-assign', {property: '/it-stec55x/input/man-trim', value: 1});
173
-                    fgcommand('property-assign', {property: '/it-stec55x/input/man-trim', value: 0});
171
+#                    if (autopilot.systems.STEC55X.trimTarget < 20)
172
+#                        autopilot.systems.STEC55X.trimTarget += 1;
173
+#                    fgcommand('property-assign', {property: '/it-stec55x/input/man-trim', value: 1});
174
+#                    fgcommand('property-assign', {property: '/it-stec55x/input/man-trim', value: 0});
174 175
                 },
175 176
             ],
176 177
         }
+1
Nasal/display.nas
... ...
@@ -297,6 +297,7 @@ var displayClass = {
297 297
         darkblue : [0, 0, 1],
298 298
         red : [1, 0, 0],
299 299
         magenta : [1, 0, 1],
300
+        yellow : [1, 1, 0],
300 301
     },
301 302
 #}}}
302 303
 
+28 -3
README.md
... ...
@@ -19,7 +19,7 @@
19 19
 [red-bug]:    https://upload.wikimedia.org/wikipedia/commons/thumb/a/a4/Red_bug.svg/32px-Red_bug.svg.png "blocking bug"
20 20
 [warning]:    https://upload.wikimedia.org/wikipedia/commons/thumb/1/12/Achtung-orange.svg/32px-Achtung-orange.svg.png "warning symbol"
21 21
 
22
-![ZKV1000 in Diamond DA42, in flight from LFLG to LFBD](https://seb.lautre.net/bozon/index.php?f=15eb94e0c0e1d1)running STEC55X autopilot HDG roll mode.
22
+![ZKV1000 in Diamond DA42, in flight from LFLG to LFBD](https://seb.lautre.net/bozon/index.php?f=15eb94e0c0e1d1)ZKV1000 in Diamond DA42, in flight from LFLG to LFBD, running STEC55X autopilot HDG roll mode.
23 23
 [other pictures available here](https://seb.lautre.net/bozon/index.php?f=158cf95340742d)
24 24
 
25 25
 # Thanks
... ...
@@ -80,6 +80,8 @@ Please report bug at <zkv1000@seb.lautre.net>.
80 80
   * simple Traffic Alert Collision Avoidance System (TCAS)
81 81
   * screen brightness and body lighting settings
82 82
   * checklists management (emergency and normal)
83
+  * possibility to fit the size of the devices to enter the panel
84
+  * auto power on if set
83 85
 * ![][90%]
84 86
   * TMR/REF Timer ![][done], Vspeeds ![][done], minimums ![][pending] (don't understand the role of this)
85 87
   * angle of attack display (not sure about calculation): specific for each airplane (see Installation instructions below)
... ...
@@ -87,11 +89,11 @@ Please report bug at <zkv1000@seb.lautre.net>.
87 89
   * XPDR: emergency code depending of the country (eg.: 1200 for US, 7700 for Europe), should be set in settings
88 90
   * use of [maketimer()](http://wiki.flightgear.org/Nasal_library#maketimer.28.29) instead of [settimer()](http://wiki.flightgear.org/Nasal_library#settimer.28.29) when possible
89 91
   * AFCS capabilities
90
-    * integration of Octal450's [S-TEC 55X](http://wiki.flightgear.org/S-TEC_55X) autopilot system
92
+  * integration of Octal450's [S-TEC 55X](http://wiki.flightgear.org/S-TEC_55X) autopilot system
91 93
 * ![][80%]
94
+  * Setting pages (MFD): pages/sub-pages selection via FMS knob ![][done], pages content implementation ![][ongoing]
92 95
   * route displayed on map: legs ![][done], current and next leg ![][done], TOC/TOD ![][ongoing], OBS ![][ongoing]
93 96
 * ![][70%]
94
-  * Setting pages (MFD): pages/sub-pages selection via FMS knob ![][done], pages content implementation ![][ongoing]
95 97
 * ![][60%]
96 98
   * NOT TESTED: add the posssibility to only use Nasal part of the instrument. This in case of a cockpit which already includes needed objects and animations for screens, knobs and buttons in its config files
97 99
   * Map settings: declutter ![][ongoing], range/zoom ![][done]
... ...
@@ -102,8 +104,10 @@ Please report bug at <zkv1000@seb.lautre.net>.
102 104
 * ![][20%]
103 105
 * ![][10%]
104 106
   * multikey for every part of the device (actually only power on)
107
+  * power off
105 108
   * Aircraft Maintainer's Guide
106 109
 * ![][0%] (TODO list, unsorted)
110
+  * make possible to integrate other autopilot systems than the one integrated
107 111
   * make booting animation visible
108 112
   * make possible to include in the aircraft directory (instead of Instruments-3d)
109 113
   * separation of code for buttons and knobs scenarii and computing
... ...
@@ -145,6 +149,20 @@ Actually `zkv1000.nas` is where everything begins, please have a look at this co
145 149
 ## Set specific values for your aircraft
146 150
 Specifics values for aircraft can be set via the aircraft configuration, in the `<instrumentation>` section, just add a section `<zkv1000>` and set here the needed values.
147 151
 
152
+### Adjust size to  the panel of your aircraft
153
+To increase or decrease the size of all the devices (PFDs and MFDs) you can use a factor property, eg. in the DA42:
154
+
155
+        <size-factor type="double">1.19</size-factor>
156
+
157
+Defaults to 1 if you don't provide this information. Values lower than 1 decreaase size, and higher than 1 increase the size.
158
+
159
+### Make your instrument auto powered on
160
+Let say you want your PFD and MFD switched on as soon as the electrical system allows it. Set your device with the following
161
+
162
+        <auto-power type="bool">1</auto-power>
163
+
164
+Then you need to set the property `/instrumentation/zkv1000/serviceable` by the mean you want, as soon as it property is `true` the zkv1000 will automagically switch on.
165
+
148 166
 ### Vspeeds
149 167
 To see the Vspeeds bugs or the IAS background color change (Vne), set the corresponding V-speeds in knots by adding in your `<instrumentation><zkv1000>` section the following lines (here are the numbers for the Lancair-235, ![][warning] values are not to be used in real life).
150 168
 If not set, defaults to 999 knots
... ...
@@ -258,6 +276,13 @@ Actually it checks if the property `/instrumentation/tcas/serviceable` is set to
258 276
 
259 277
 Moreover it only shows alerts with an annunciation "TRAFFIC" on PFD, and shows icons on maps (MFD and INSET), no decision is taken, no relation with transponder and no evasion scenari and no evasion scenario.
260 278
 
279
+## Autopilot
280
+For now there is only one autopilot system supported: the Octal450's STEC 55X (and at time of writing only HDG mode is available).
281
+
282
+To make it available you have to follow the installation rules of the device [on its own page](http://wiki.flightgear.org/S-TEC_55X). The zkv1000 will find it by its own and make it available.
283
+
284
+This STEC55X autopilot system would remain shipped in the zkv1000 as it is described in the documentation of Cirrus Perspective SR2x, but the zkv1000 will in near future let you create your own and make its choice depending of the availibilities or property set.
285
+
261 286
 ## Map tiles origin
262 287
 By defaults the maps tiles come from `https://maps.wikimedia.org`, type `osm-intl` (please read [https://www.wikimedia.org/wiki/Maps]()), but you can choose your favorite one if you've got one. I've tested `opentopomap.org` and `thunderforest.com` (my favourite).
263 288
 You can tell the zkv1000 the tile server, type and eventually apikey by using `--prop:` option while starting FlightGear session:
+22
mfd.xml
... ...
@@ -323,6 +323,17 @@
323 323
        <max>359</max>
324 324
        <wrap>true</wrap>
325 325
       </binding>
326
+      <binding>
327
+        <condition>
328
+          <property>/instrumentation/zkv1000/MFD/status</property>
329
+        </condition>
330
+        <command>nasal</command>
331
+        <script>
332
+          foreach (var c; keys(zkv1000.flightdeck))
333
+            if (zkv1000.flightdeck[c].role == 'PFD')
334
+              zkv1000.flightdeck[c].display.updateHDG();
335
+        </script>
336
+      </binding>
326 337
     </action>
327 338
   </animation>
328 339
 
... ...
@@ -355,6 +366,17 @@
355 366
        <max>16000</max>
356 367
        <wrap>false</wrap>
357 368
       </binding>
369
+      <binding>
370
+        <condition>
371
+          <property>/instrumentation/zkv1000/MFD/status</property>
372
+        </condition>
373
+        <command>nasal</command>
374
+        <script>
375
+          foreach (var c; keys(zkv1000.flightdeck))
376
+            if (zkv1000.flightdeck[c].role == 'PFD')
377
+              zkv1000.flightdeck[c].display.updateALT();
378
+        </script>
379
+      </binding>
358 380
     </action>
359 381
     <shift-action>
360 382
       <binding>