Showing 2 changed files with 63 additions and 11 deletions
+26 -7
Nasal/display.nas
... ...
@@ -186,13 +186,32 @@ var displayClass = {
186 186
                 me.device.data['aoa-auto'] = 0;
187 187
             }
188 188
             else {
189
-                var eis_dir = data.zkv1000_dir ~ 'Nasal/EIS/';
190
-                var eis_type = getprop('/instrumentation/zkv1000/eis/type');
191
-                if (eis_type == nil or
192
-                        (io.stat(eis_dir ~ eis_type ~ '.nas') == nil
193
-                         and print(eis_type ~ ' not found')))
194
-                    eis_type = 'none';
195
-                io.load_nasal(eis_dir ~ eis_type ~ '.nas', 'zkv1000');
189
+                var eis_file = getprop('/instrumentation/zkv1000/eis/type');
190
+                if (eis_file == nil)
191
+                    eis_file = getprop('/instrumentation/zkv1000/eis/file');
192
+
193
+                if (eis_file != nil) {
194
+                    if (find('/', eis_file) == -1)
195
+                        eis_file = data.zkv1000_dir ~ 'Nasal/EIS/' ~ eis_file ~ '.nas';
196
+                    elsif (split('/', eis_file)[0] == 'Aircraft') {
197
+                        var path = split('/', eis_file);
198
+                        if (getprop('/sim/fg-aircraft') != nil) {
199
+                            eis_file = getprop('/sim/fg-aircraft');
200
+                            for (var i = 1; i < size(path); i += 1)
201
+                                eis_file ~= '/' ~ path[i];
202
+                        }
203
+                        else
204
+                            eis_file = getprop('/sim/fg-root') ~ '/' ~ eis_file;
205
+                    }
206
+                }
207
+                else
208
+                    eis_file = data.zkv1000_dir ~ 'Nasal/EIS/none.nas';
209
+
210
+                if (io.stat(eis_file) == nil
211
+                and print(eis_file ~ ' not found'))
212
+                    eis_file = data.zkv1000_dir ~ 'Nasal/EIS/none.nas';
213
+                io.load_nasal(eis_file, 'zkv1000');
214
+
196 215
                 if (contains(me.parents[0], 'showEIS'))
197 216
                     me.showEIS(groups);
198 217
             }
+37 -4
README.md
... ...
@@ -144,16 +144,49 @@ If not set, defaults to 999 knots
144 144
         </alerts>
145 145
 
146 146
 ### EIS
147
-To tells the zkv1000 which kind of engines equip your aircraft, and the associated EIS
147
+This parameter tells the zkv1000 which kind of engines equips your aircraft, and the associated EIS.  
148
+The Nasal script should include at least three things:
149
+
150
+* a method called `displayClass.showEIS` in which you initialize the EIS, especially by selecting the shown, hide, clipped and texts elements
151
+* a method called `displayClass.updateEIS` which is used to update the EIS display, it includes its own timer to refresh itself
152
+* a SVG object with ID `EIS` (generally the background of the EIS display).  
153
+  It should appears in the lists in `displayClass.showEIS`.  
154
+  ![][warning] This object is used to compute the map width, so it is important to set it on the left of the screen
155
+
156
+There are three ways too put an EIS in MFD:
157
+
158
+#### use one of the included simple EIS provided with the zkv1000
148 159
 
149 160
         <eis>
150 161
           <type>single-prop</type>
151 162
         </eis>
152 163
 
153
-Defaults to `none`, available entries are the `.nas` files located in `Nasal/EIS/` directory.  
154
-If you want to add yours, just copy the `Systems/EIS/single-prop.svg`, modify it to fit your needs, and refer to it in a function named `displayClass.showEIS`, another very important function is `displayClass.updateEIS` (example in [Nasal/EIS/single-prop.nas](zkv1000/Nasal/EIS/single-prop.nas))
164
+Defaults to `none`, available entries are the `.nas` files located in `Nasal/EIS/` directory.
165
+
166
+#### or use the one you specially have created for your aircraft
167
+
168
+        <eis>
169
+          <file>Aircraft/My-Nice-Aircraft/Nasal/EIS.nas</file>
170
+        </eis>
171
+
172
+or the on from another aircraft. Anyway if the EIS nasal file targeted doesn't exist, the fallback is the type `none`.
173
+
174
+#### or you can give the absolute path (deprecated)
175
+
176
+        </eis>
177
+          <file>/home/foobar/fgfs-data/Nasal/testing-jet-jsbsim-EIS.nas</file>
178
+        </eis>
179
+
180
+Be aware that `canvas.parsesvg` uses only relative path and should not work properly if your .nas is outside of the FG tree.  
181
+If you want to add your own EIS, just copy the `Systems/EIS/single-prop.svg`, modify it to fit your needs, and refer to it in a function named `displayClass.showEIS`, another very important function is `displayClass.updateEIS` (example in [Nasal/EIS/single-prop.nas](zkv1000/blob/master/Nasal/EIS/single-prop.nas))  
182
+You are even free to modify the softkeys map in order to get according menus, but this has to be described on another document (check [Nasal/softkeys.nas](zkv1000/master/blob/Nasal/softkeys.nas)).
183
+
184
+No matter of the EIS width, as the map size and center are computed relative to the EIS width automatically.  
185
+
186
+_Notes:_
155 187
 
156
-No matter of the EIS width, as the map size and center are computed relative to the EIS width automatically.
188
+  1. you can use `<file>` or `<type>` indifferently, they are actually identical.
189
+  1. later on the MFD Engine pages will be managed by the file specified in this section
157 190
 
158 191
 ### Angle Of Attack (AOA)
159 192
 You can specify the stall AoA in order to display it in the dedicated display.