diff --git a/Aircraft/Instruments-3d/zkv500/AirportScreens.nas b/Aircraft/Instruments-3d/zkv500/AirportScreens.nas index 8e4198be1..a026ed51a 100644 --- a/Aircraft/Instruments-3d/zkv500/AirportScreens.nas +++ b/Aircraft/Instruments-3d/zkv500/AirportScreens.nas @@ -7,7 +7,7 @@ var screenAirportMain = { search: func { me.apt = me.oaci != nil ? airportinfo(me.oaci) : airportinfo(); if (me.apt != nil) { - glide_slope_tunnel.complement_runways(me.apt); + #glide_slope_tunnel.complement_runways(me.apt); return 1; } else @@ -74,18 +74,25 @@ var screenAirportInfos = { }, lines : func { me.rwylist = []; - foreach (var r; keys(screenAirportMain.apt.runways)) - append(me.rwylist, [r, screenAirportMain.apt.runways[r].length, - screenAirportMain.apt.runways[r].width]); + foreach (var r; keys(screenAirportMain.apt.runways)) { + string.isdigit(r[0]) or continue; + var number = math.mod(num(substr(r, 0, 2)) + 18, 36); + var side = substr(r, 2, 1); + var comp = sprintf("%02d%s", number, side == "R" ? "L" : side == "L" ? "R" : side); + append(me.rwylist, [r, comp, + screenAirportMain.apt.runways[r].length, + screenAirportMain.apt.runways[r].width]); + } line[0].setValue(sprintf("%s", screenAirportMain.apt.name)); #TODO check length to truncate if too long rwyindex = me.page * 4; for (var l = 1; l < LINES; l += 1) { rwyindex += 1; if (rwyindex < size(me.rwylist)) - line[l].setValue(sprintf("%s [%dm / %dm]", + line[l].setValue(sprintf("%s - %s [%dm / %dm]", me.rwylist[rwyindex][0], me.rwylist[rwyindex][1], - me.rwylist[rwyindex][2])); + me.rwylist[rwyindex][2], + me.rwylist[rwyindex][3])); else line[l].setValue(""); } diff --git a/Aircraft/Instruments-3d/zkv500/MainScreens.nas b/Aircraft/Instruments-3d/zkv500/MainScreens.nas index 389704f3d..f5ec9e09f 100644 --- a/Aircraft/Instruments-3d/zkv500/MainScreens.nas +++ b/Aircraft/Instruments-3d/zkv500/MainScreens.nas @@ -35,9 +35,9 @@ var screenModeAndSettings = { # screen for changing the GPS mode and settings mode = me.mode_ + 1; page = 0; displayed_screen = page_list[mode][page]; - if (mode == 3) + if (mode == 4) screenTaskSelect.n = list_routes(); - elsif (mode == 2) + elsif (mode == 3) screenTurnpointSelect.n = load_bookmarks(); } }, @@ -308,7 +308,7 @@ var screenEdit = { me.edit_title, me.edit_zone, "", - "ESC -> AVOID", + "ESC -> RESET", sprintf("START -> %s", me.start_command) ]); } diff --git a/Aircraft/Instruments-3d/zkv500/TurnpointScreens.nas b/Aircraft/Instruments-3d/zkv500/TurnpointScreens.nas index 6af2a1c0d..20090c837 100644 --- a/Aircraft/Instruments-3d/zkv500/TurnpointScreens.nas +++ b/Aircraft/Instruments-3d/zkv500/TurnpointScreens.nas @@ -33,6 +33,7 @@ var screenTurnpointSelect = { if (bookmark.getNode("waypoint-type") != nil) gps_wp.getNode("wp[1]/waypoint-type").setValue(bookmark.getNode("waypoint-type").getValue()); blocked = 0; + me.loaded = 1; page = 1; mode = 3; left_knob(0); diff --git a/Aircraft/Instruments-3d/zkv500/ZKV500.nas b/Aircraft/Instruments-3d/zkv500/ZKV500.nas index 51c4947cc..c6ebef23f 100644 --- a/Aircraft/Instruments-3d/zkv500/ZKV500.nas +++ b/Aircraft/Instruments-3d/zkv500/ZKV500.nas @@ -77,7 +77,11 @@ var start_button = func() { #manage start button, depends of displayed screen var left_knob = func(dir) { #manage left button, cycle in mode's pages if not blocked isOn > 0 or return; - if (blocked == 0) { + if (blocked == 0) { + if (displayed_screen == 13 and dir) { + mode = screenEdit.previous_mode; + page = screenEdit.previous_page; + } page = cycle(size(page_list[mode]), page, dir); displayed_screen = page_list[mode][page]; } @@ -216,6 +220,8 @@ var load_bookmarks = func { #load turnpoints })); foreach (var c ;props.globals.getNode("/instrumentation/gps/bookmarks").getChildren("bookmark")) n += 1; } + else + print(file ~ " not found..."); return n; } diff --git a/Aircraft/Instruments-3d/zkv500/manual.txt b/Aircraft/Instruments-3d/zkv500/manual.txt index 97ab02a33..1cb576dc9 100644 --- a/Aircraft/Instruments-3d/zkv500/manual.txt +++ b/Aircraft/Instruments-3d/zkv500/manual.txt @@ -68,6 +68,15 @@ Then in your panel configuration file, just put the 3D model, as usual: [example from Lionceau: Aircraft/Lionceau/Models/Panel/front-panel.xml] Your ZKV500 is ready to be powered on! +It comes with "vi-like" multikey system, accessible with ":g" sequence. +To intall it, just add in the <input> section of your configuration file the +following line: + <keyboard n="0" include="../Instruments-3d/zkv500/multikey.xml"/> +NOTE: to avoid creation of multiple instances of keyboard node, it is +recommanded to explicit n="0" for each call of keyboard tag. +Now turning knobs is as simple as using up or down arrow! +The next sequence's keys are described below. + The ZKV500 has IO capacities: routes are red from $FGHOME/Routes and written in $FGHOME/Export, the bookmarks are red and written in $FGHOME/Export/bookmarks.xml @@ -159,12 +168,16 @@ KNOB|------------------------|KNOB -> PAGE knob allows you to cycle in the different pages available for each mode. + key sequence ":gl" -> SELECT knob allows yo to navigate in a page, or select element, or edit some simple text (depending of screen). + key sequence ":gr" -> MODE knob allows you to select a mode, and acces to the ZKV500 settings you can access this knob at any time, any screen. + key sequence ":gm" -> POWER knob allows you to turn ON and OFF the ZKV500, and set the LCD enlightment. + key sequence ":gp" The goal of each button depends of the displayed screen. 4. USER'S MANUAL @@ -175,6 +188,7 @@ more and more enlighted. When powered ON, you are on the ModeAndSettings screen. Right-click on POWER knob will first decrease enlightment intensity until switch the ZKV500 off. +key sequence ":gp [up/down x times]" 2. Screens list [] -> button diff --git a/Aircraft/Instruments-3d/zkv500/multikey.xml b/Aircraft/Instruments-3d/zkv500/multikey.xml new file mode 100644 index 000000000..072cfaa57 --- /dev/null +++ b/Aircraft/Instruments-3d/zkv500/multikey.xml @@ -0,0 +1,125 @@ +<?xml version="1.0"?> + +<PropertyList> + <multikey> + <key n="103"> + <name>g</name> + <desc>GPS ZKV500</desc> + <key n="112"> + <name>p</name> + <desc>Power knob</desc> + <key n="94"> + <name>^</name> + <desc>turn right power knob</desc> + <no-exit/> + <binding> + <command>nasal</command> + <script>zkv500.power_knob(1)</script> + </binding> + </key> + <key n="95"> + <name>_</name> + <desc>turn left power knob</desc> + <no-exit/> + <binding> + <command>nasal</command> + <script>zkv500.power_knob(-1)</script> + </binding> + </key> + </key> + <key n="109"> + <name>m</name> + <desc>Mode knob</desc> + <key n="94"> + <name>^</name> + <desc>turn right mode knob</desc> + <no-exit/> + <binding> + <command>nasal</command> + <script>zkv500.select_mode(1)</script> + </binding> + </key> + <key n="95"> + <name>_</name> + <desc>turn left mode knob</desc> + <no-exit/> + <binding> + <command>nasal</command> + <script>zkv500.select_mode(-1)</script> + </binding> + </key> + </key> + <key n="108"> + <name>l</name> + <desc>Upper left knob</desc> + <key n="94"> + <name>^</name> + <desc>turn right upper left knob</desc> + <no-exit/> + <binding> + <command>nasal</command> + <script>zkv500.left_knob(1)</script> + </binding> + </key> + <key n="95"> + <name>_</name> + <desc>turn left upper left knob</desc> + <no-exit/> + <binding> + <command>nasal</command> + <script>zkv500.left_knob(-1)</script> + </binding> + </key> + </key> + <key n="114"> + <name>r</name> + <desc>Upper right knob</desc> + <key n="94"> + <name>^</name> + <desc>turn right upper right knob</desc> + <no-exit/> + <binding> + <command>nasal</command> + <script>zkv500.right_knob(1)</script> + </binding> + </key> + <key n="95"> + <name>_</name> + <desc>turn left upper right knob</desc> + <no-exit/> + <binding> + <command>nasal</command> + <script>zkv500.right_knob(-1)</script> + </binding> + </key> + </key> + <key n="101"> + <name>e</name> + <desc>Enter button</desc> + <exit/> + <binding> + <command>nasal</command> + <script>zkv500.enter_button()</script> + </binding> + </key> + <key n="120"> + <name>x</name> + <desc>Escape button</desc> + <exit/> + <binding> + <command>nasal</command> + <script>zkv500.escape_button()</script> + </binding> + </key> + <key n="115"> + <name>s</name> + <desc>Start button</desc> + <exit/> + <binding> + <command>nasal</command> + <script>zkv500.start_button()</script> + </binding> + </key> + </key> + </multikey> +</PropertyList>