diff --git a/Nasal/canvas/map/altitude-profile.draw b/Nasal/canvas/map/altitude-profile.draw new file mode 100644 index 000000000..14932095e --- /dev/null +++ b/Nasal/canvas/map/altitude-profile.draw @@ -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); + } +} + diff --git a/Nasal/canvas/map/route.draw b/Nasal/canvas/map/route.draw index a7edf838d..a69ef04f4 100644 --- a/Nasal/canvas/map/route.draw +++ b/Nasal/canvas/map/route.draw @@ -59,10 +59,22 @@ var draw_route = func (group, theroute, controller=nil, lod=0) append(cmds,4); 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); -} \ No newline at end of file + +} + +