a9576e8c8d
- get rid of global variables and use instance variables - identified all important drawing routines and move them into *.draw files - changed to dynamic loading of *.draw *.model and *.layer files - implemented poor-man's controller hash to move use-case specific conditionals out of the draw files, and back into the instantiation, i.e. Gijs' EFIS class - started identifying stuff that is not specific to drawing, but to what is to be drawn, i.e. Model stuff - such as positioned queries, moved those out into *.model files - some more work on supporting more than a single ND MFD instance per aircraft - renamed a handful of SVG identifiers to avoid naming conflicts and to simplify usage of SVG IDs as member fields - moved all of the setlistener setup out of the fdm-initialized stub right into the ctor of the Efis class (actually that's controller stuff...) - initial MapStructure framework - aircraft-agnostic NavDisplay class - preparations for deprecating map.nas - additions to canvas.map - preparations for making NDStyles configurable via XML
34 lines
863 B
Text
34 lines
863 B
Text
##
|
|
# Draw a waypoint symbol and waypoint name (Gijs' 744 ND.nas code)
|
|
|
|
#
|
|
var drawwp = func (group, lat, lon, name, i, wp) {
|
|
var wp_group = group.createChild("group","wp");
|
|
wp[i] = wp_group.createChild("path", "wp-" ~ i)
|
|
.setStrokeLineWidth(3)
|
|
.moveTo(0,-25)
|
|
.lineTo(-5,-5)
|
|
.lineTo(-25,0)
|
|
.lineTo(-5,5)
|
|
.lineTo(0,25)
|
|
.lineTo(5,5)
|
|
.lineTo(25,0)
|
|
.lineTo(5,-5)
|
|
.setColor(1,1,1)
|
|
.close();
|
|
#####
|
|
# The commented code leads to a segfault when a route is replaced by a new one
|
|
#####
|
|
#
|
|
# text_wp[i] = wp_group.createChild("text", "wp-text-" ~ i)
|
|
#
|
|
var text_wps = wp_group.createChild("text", "wp-text-" ~ i)
|
|
.setDrawMode( canvas.Text.TEXT )
|
|
.setText(name)
|
|
.setFont("LiberationFonts/LiberationSans-Regular.ttf")
|
|
.setFontSize(28)
|
|
.setTranslation(25,35)
|
|
.setColor(1,0,1);
|
|
wp_group.setGeoPosition(lat, lon)
|
|
.set("z-index",4);
|
|
};
|