2008-06-28 19:38:32 +00:00
|
|
|
var screenTurnpointSelect = {
|
|
|
|
n: 0,
|
|
|
|
page: 0,
|
|
|
|
pointer: 0,
|
|
|
|
loaded: 0,
|
2008-06-30 00:17:21 +00:00
|
|
|
selected: 0,
|
2008-06-28 19:38:32 +00:00
|
|
|
right : func {
|
|
|
|
me.loaded = 0;
|
|
|
|
blocked = 1;
|
|
|
|
var t = browse(me.n, me.pointer, me.page, arg[0]);
|
|
|
|
me.pointer = t[0];
|
|
|
|
me.page = t[1];
|
2008-07-14 14:40:22 +00:00
|
|
|
me.selected = me.page * LINES + me.pointer;
|
2008-06-28 19:38:32 +00:00
|
|
|
},
|
|
|
|
enter : func {
|
|
|
|
},
|
|
|
|
escape : func {
|
|
|
|
},
|
|
|
|
start : func {
|
|
|
|
me.n > 0 or return;
|
2008-06-30 00:17:21 +00:00
|
|
|
var bookmark = gps_data.getNode("bookmarks/bookmark["~me.selected~"]/");
|
2009-12-08 20:18:16 +00:00
|
|
|
var scratch = gps_data.getNode("scratch");
|
|
|
|
scratch.getNode("latitude-deg",1).setValue(bookmark.getNode("latitude-deg").getValue());
|
|
|
|
scratch.getNode("longitude-deg",1).setValue(bookmark.getNode("longitude-deg").getValue());
|
|
|
|
scratch.getNode("altitude-ft",1).setValue(bookmark.getNode("altitude-ft").getValue());
|
|
|
|
scratch.getNode("ident").setValue(bookmark.getNode("ID").getValue());
|
2008-07-14 14:40:22 +00:00
|
|
|
if (bookmark.getNode("name") != nil)
|
2009-12-08 20:18:16 +00:00
|
|
|
scratch.getNode("name",1).setValue(bookmark.getNode("name").getValue());
|
|
|
|
else
|
|
|
|
scratch.getNode("name",1).setValue("");
|
|
|
|
if (bookmark.getNode("type") != nil)
|
|
|
|
scratch.getNode("type",1).setValue(bookmark.getNode("waypoint-type").getValue());
|
|
|
|
else
|
|
|
|
scratch.getNode("type",1).setValue("");
|
|
|
|
gps_data.getNode("command").setValue("obs");
|
2008-06-28 19:38:32 +00:00
|
|
|
blocked = 0;
|
2008-11-02 15:50:21 +00:00
|
|
|
me.loaded = 1;
|
2008-06-28 19:38:32 +00:00
|
|
|
page = 1;
|
|
|
|
mode = 3;
|
|
|
|
left_knob(0);
|
|
|
|
},
|
|
|
|
lines : func {
|
|
|
|
if (me.loaded != 1) blocked = 1;
|
|
|
|
if (me.n > 0)
|
2008-07-14 14:40:22 +00:00
|
|
|
for (var l = 0; l < LINES; l += 1) {
|
|
|
|
if ((me.page * LINES + l) < me.n) {
|
|
|
|
name = gps_data.getNode("bookmarks/bookmark["~((me.page * LINES) + l)~"]/ID").getValue();
|
2008-06-28 19:38:32 +00:00
|
|
|
line[l].setValue(sprintf("%s %s",me.pointer == l ? ">" : " ", name));
|
|
|
|
}
|
|
|
|
else
|
|
|
|
line[l].setValue("");
|
|
|
|
}
|
|
|
|
else
|
|
|
|
display([
|
|
|
|
" ",
|
|
|
|
" ",
|
|
|
|
" NO BOOKMARKS",
|
|
|
|
" ",
|
|
|
|
" "
|
|
|
|
]);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
var screenTurnpointInfos = {
|
|
|
|
right : func {
|
|
|
|
},
|
|
|
|
enter : func {
|
|
|
|
},
|
|
|
|
escape : func {
|
|
|
|
},
|
|
|
|
start : func {
|
|
|
|
},
|
|
|
|
lines : func {
|
|
|
|
display(NOT_YET_IMPLEMENTED);
|
|
|
|
}
|
|
|
|
};
|