2013-04-14 15:04:56 +00:00
|
|
|
|
|
|
|
|
|
|
|
var Nav1Page =
|
|
|
|
{
|
2023-08-26 18:36:00 +00:00
|
|
|
a:2,
|
|
|
|
|
|
|
|
|
|
|
|
new: func()
|
|
|
|
{
|
|
|
|
m = {parents: [Nav1Page, KLN94.Page.new(KLN94.PAGE_NAV, 0, 0)]};
|
|
|
|
return m;
|
|
|
|
},
|
|
|
|
|
|
|
|
hasActiveIdent: func { 1 },
|
|
|
|
showsCDI: func { 1 },
|
|
|
|
|
|
|
|
display: func(gps)
|
|
|
|
{
|
|
|
|
if (gps.isDirectToActive()) {
|
|
|
|
|
|
|
|
} else {
|
|
|
|
# leg mode
|
|
|
|
gps.setLine(0, sprintf('%6s->%6s',
|
|
|
|
gps.props.previousIdent.getStringValue(),
|
|
|
|
gps.props.activeIdent.getStringValue())
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
gps.setLine(3, ' VNV Off');
|
|
|
|
|
|
|
|
var toFrom = gps.isTo() ? 'To' : 'Fr';
|
|
|
|
var eteToWp1 = gps.formatDuration(gps.props.timeToWaypoint.getIntValue());
|
|
|
|
gps.setLine(4, sprintf('%03d*%s ', bearingToWp1, toFrom) ~ eteToWp1);
|
|
|
|
},
|
|
|
|
|
|
|
|
refresh: func(gps)
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
2013-04-14 15:04:56 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
var Nav2Page =
|
|
|
|
{
|
2023-08-26 18:36:00 +00:00
|
|
|
new: func()
|
|
|
|
{
|
|
|
|
m = {parents: [Nav2Page, KLN94.Page.new(KLN94.PAGE_NAV, 0, 1)]};
|
|
|
|
return m;
|
|
|
|
},
|
|
|
|
|
|
|
|
display: func(gps)
|
|
|
|
{
|
|
|
|
# select refnavaid!
|
|
|
|
|
|
|
|
gps.setLine(0, ' PRESENT POSN');
|
|
|
|
gps.setLine(1, ' Ref:%s', gps.refNavaid.id);
|
|
|
|
|
|
|
|
gps.setLine(3, ' ' + gps.formatLatitude(gps.props.indicatedLat.getDoubleValue()));
|
|
|
|
gps.setLine(4, ' ' + gps.formatLongitude(gps.props.indicatedLon.getDoubleValue()));
|
|
|
|
}
|
2013-04-14 15:04:56 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
var Nav3Page =
|
|
|
|
{
|
2023-08-26 18:36:00 +00:00
|
|
|
new: func()
|
|
|
|
{
|
|
|
|
m = {parents: [Nav3Page, KLN94.Page.new(KLN94.PAGE_NAV, 0, 2)]};
|
|
|
|
return m;
|
|
|
|
},
|
2013-04-14 15:04:56 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
var nav1 = Nav1Page.new();
|
|
|
|
|
2023-08-26 18:36:00 +00:00
|
|
|
# FIXME gps.addPage causes a "No such member" error
|
|
|
|
# I don't yet know how to fix this, thus it's commented out for now
|
|
|
|
# (Benedikt Wolf 2023)
|
2013-04-14 15:04:56 +00:00
|
|
|
|
2023-08-26 18:36:00 +00:00
|
|
|
#gps.addPage(nav1);
|
2013-04-14 15:04:56 +00:00
|
|
|
|
|
|
|
|
2023-08-26 18:36:00 +00:00
|
|
|
#gps.addPage(Nav2Page.new());
|
|
|
|
#gps.addPage(Nav3Page.new());
|