- fixed some bugs + more airport infos + multikey system
This commit is contained in:
parent
bf59d755aa
commit
53406990dc
6 changed files with 163 additions and 10 deletions
Aircraft/Instruments-3d/zkv500
|
@ -7,7 +7,7 @@ var screenAirportMain = {
|
||||||
search: func {
|
search: func {
|
||||||
me.apt = me.oaci != nil ? airportinfo(me.oaci) : airportinfo();
|
me.apt = me.oaci != nil ? airportinfo(me.oaci) : airportinfo();
|
||||||
if (me.apt != nil) {
|
if (me.apt != nil) {
|
||||||
glide_slope_tunnel.complement_runways(me.apt);
|
#glide_slope_tunnel.complement_runways(me.apt);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -74,18 +74,25 @@ var screenAirportInfos = {
|
||||||
},
|
},
|
||||||
lines : func {
|
lines : func {
|
||||||
me.rwylist = [];
|
me.rwylist = [];
|
||||||
foreach (var r; keys(screenAirportMain.apt.runways))
|
foreach (var r; keys(screenAirportMain.apt.runways)) {
|
||||||
append(me.rwylist, [r, screenAirportMain.apt.runways[r].length,
|
string.isdigit(r[0]) or continue;
|
||||||
screenAirportMain.apt.runways[r].width]);
|
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
|
line[0].setValue(sprintf("%s", screenAirportMain.apt.name)); #TODO check length to truncate if too long
|
||||||
rwyindex = me.page * 4;
|
rwyindex = me.page * 4;
|
||||||
for (var l = 1; l < LINES; l += 1) {
|
for (var l = 1; l < LINES; l += 1) {
|
||||||
rwyindex += 1;
|
rwyindex += 1;
|
||||||
if (rwyindex < size(me.rwylist))
|
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][0],
|
||||||
me.rwylist[rwyindex][1],
|
me.rwylist[rwyindex][1],
|
||||||
me.rwylist[rwyindex][2]));
|
me.rwylist[rwyindex][2],
|
||||||
|
me.rwylist[rwyindex][3]));
|
||||||
else
|
else
|
||||||
line[l].setValue("");
|
line[l].setValue("");
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,9 +35,9 @@ var screenModeAndSettings = { # screen for changing the GPS mode and settings
|
||||||
mode = me.mode_ + 1;
|
mode = me.mode_ + 1;
|
||||||
page = 0;
|
page = 0;
|
||||||
displayed_screen = page_list[mode][page];
|
displayed_screen = page_list[mode][page];
|
||||||
if (mode == 3)
|
if (mode == 4)
|
||||||
screenTaskSelect.n = list_routes();
|
screenTaskSelect.n = list_routes();
|
||||||
elsif (mode == 2)
|
elsif (mode == 3)
|
||||||
screenTurnpointSelect.n = load_bookmarks();
|
screenTurnpointSelect.n = load_bookmarks();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -308,7 +308,7 @@ var screenEdit = {
|
||||||
me.edit_title,
|
me.edit_title,
|
||||||
me.edit_zone,
|
me.edit_zone,
|
||||||
"",
|
"",
|
||||||
"ESC -> AVOID",
|
"ESC -> RESET",
|
||||||
sprintf("START -> %s", me.start_command)
|
sprintf("START -> %s", me.start_command)
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,6 +33,7 @@ var screenTurnpointSelect = {
|
||||||
if (bookmark.getNode("waypoint-type") != nil)
|
if (bookmark.getNode("waypoint-type") != nil)
|
||||||
gps_wp.getNode("wp[1]/waypoint-type").setValue(bookmark.getNode("waypoint-type").getValue());
|
gps_wp.getNode("wp[1]/waypoint-type").setValue(bookmark.getNode("waypoint-type").getValue());
|
||||||
blocked = 0;
|
blocked = 0;
|
||||||
|
me.loaded = 1;
|
||||||
page = 1;
|
page = 1;
|
||||||
mode = 3;
|
mode = 3;
|
||||||
left_knob(0);
|
left_knob(0);
|
||||||
|
|
|
@ -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
|
var left_knob = func(dir) { #manage left button, cycle in mode's pages if not blocked
|
||||||
isOn > 0 or return;
|
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);
|
page = cycle(size(page_list[mode]), page, dir);
|
||||||
displayed_screen = page_list[mode][page];
|
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;
|
foreach (var c ;props.globals.getNode("/instrumentation/gps/bookmarks").getChildren("bookmark")) n += 1;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
print(file ~ " not found...");
|
||||||
return n;
|
return n;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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]
|
[example from Lionceau: Aircraft/Lionceau/Models/Panel/front-panel.xml]
|
||||||
Your ZKV500 is ready to be powered on!
|
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
|
The ZKV500 has IO capacities: routes are red from $FGHOME/Routes and
|
||||||
written in $FGHOME/Export, the bookmarks are red and written in
|
written in $FGHOME/Export, the bookmarks are red and written in
|
||||||
$FGHOME/Export/bookmarks.xml
|
$FGHOME/Export/bookmarks.xml
|
||||||
|
@ -159,12 +168,16 @@ KNOB|------------------------|KNOB
|
||||||
|
|
||||||
-> PAGE knob allows you to cycle in the different pages available for
|
-> PAGE knob allows you to cycle in the different pages available for
|
||||||
each mode.
|
each mode.
|
||||||
|
key sequence ":gl"
|
||||||
-> SELECT knob allows yo to navigate in a page, or select element, or
|
-> SELECT knob allows yo to navigate in a page, or select element, or
|
||||||
edit some simple text (depending of screen).
|
edit some simple text (depending of screen).
|
||||||
|
key sequence ":gr"
|
||||||
-> MODE knob allows you to select a mode, and acces to the ZKV500 settings
|
-> MODE knob allows you to select a mode, and acces to the ZKV500 settings
|
||||||
you can access this knob at any time, any screen.
|
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
|
-> POWER knob allows you to turn ON and OFF the ZKV500, and set the
|
||||||
LCD enlightment.
|
LCD enlightment.
|
||||||
|
key sequence ":gp"
|
||||||
The goal of each button depends of the displayed screen.
|
The goal of each button depends of the displayed screen.
|
||||||
|
|
||||||
4. USER'S MANUAL
|
4. USER'S MANUAL
|
||||||
|
@ -175,6 +188,7 @@ more and more enlighted.
|
||||||
When powered ON, you are on the ModeAndSettings screen.
|
When powered ON, you are on the ModeAndSettings screen.
|
||||||
Right-click on POWER knob will first decrease enlightment intensity until
|
Right-click on POWER knob will first decrease enlightment intensity until
|
||||||
switch the ZKV500 off.
|
switch the ZKV500 off.
|
||||||
|
key sequence ":gp [up/down x times]"
|
||||||
|
|
||||||
2. Screens list
|
2. Screens list
|
||||||
[] -> button
|
[] -> button
|
||||||
|
|
125
Aircraft/Instruments-3d/zkv500/multikey.xml
Normal file
125
Aircraft/Instruments-3d/zkv500/multikey.xml
Normal file
|
@ -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>
|
Loading…
Add table
Reference in a new issue