Add altitude profile T/C, T/D, S/C and E/D mark on ND route
This commit is contained in:
parent
381aeb918e
commit
21fe2f4489
2 changed files with 45 additions and 2 deletions
31
Nasal/canvas/map/altitude-profile.draw
Normal file
31
Nasal/canvas/map/altitude-profile.draw
Normal file
|
@ -0,0 +1,31 @@
|
|||
##
|
||||
# Draw a altitude profile position on the route with text
|
||||
#
|
||||
|
||||
var drawprofile = func (group, property, disptext)
|
||||
{
|
||||
var symNode = props.globals.getNode("autopilot/route-manager/vnav/"~property, 1);
|
||||
var lon = symNode.getNode("longitude-deg", 1).getValue();
|
||||
var lat = symNode.getNode("latitude-deg", 1).getValue();
|
||||
var sym_group = group.createChild("group", property);
|
||||
if(lon != nil)
|
||||
{
|
||||
var radius = 13;
|
||||
sym_group.createChild("path", property)
|
||||
.setStrokeLineWidth(5)
|
||||
.moveTo(-radius, 0)
|
||||
.arcLargeCW(radius, radius, 0, 2 * radius, 0)
|
||||
.arcLargeCW(radius, radius, 0, -2 * radius, 0)
|
||||
.setColor(0.195,0.96,0.097);
|
||||
sym_group.createChild("text", property)
|
||||
.setDrawMode( canvas.Text.TEXT )
|
||||
.setText(disptext)
|
||||
.setFont("LiberationFonts/LiberationSans-Regular.ttf")
|
||||
.setFontSize(28)
|
||||
.setTranslation(25,35)
|
||||
.setColor(0.195,0.96,0.097);
|
||||
sym_group.setGeoPosition(lat, lon)
|
||||
.set("z-index",4);
|
||||
}
|
||||
}
|
||||
|
|
@ -60,9 +60,21 @@ var draw_route = func (group, theroute, controller=nil, lod=0)
|
|||
canvas.drawwp(group, leg.path()[1].lat, leg.path()[1].lon, leg.alt_cstr, leg.wp_name, i, wp);
|
||||
}
|
||||
|
||||
# Set Top Of Crimb coordinate
|
||||
canvas.drawprofile(route_group, "tc", "T/C");
|
||||
# Set Top Of Descent coordinate
|
||||
canvas.drawprofile(route_group, "td", "T/D");
|
||||
# Set Step Crimb coordinate
|
||||
canvas.drawprofile(route_group, "sc", "S/C");
|
||||
# Set Top Of Descent coordinate
|
||||
canvas.drawprofile(route_group, "ed", "E/D");
|
||||
|
||||
# Update route coordinates
|
||||
debug.dump(cmds);
|
||||
debug.dump(coords);
|
||||
route.setDataGeo(cmds, coords);
|
||||
updatewp(0);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue