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
53 lines
1.6 KiB
Text
53 lines
1.6 KiB
Text
|
|
var draw_rwy_nd = func (group, rwy, controller=nil, lod=nil) {
|
|
# print("drawing runways-nd");
|
|
canvas._draw_rwy_nd(group,rwy.lat,rwy.lon,rwy.length,rwy.width,rwy.heading);
|
|
}
|
|
|
|
|
|
##
|
|
# TODO: this is not yet a real draw callback ... (wrong signature, not yet integrated)
|
|
|
|
var _draw_rwy_nd = func (group, lat, lon, length, width, rwyhdg) {
|
|
var apt = airportinfo("EHAM");
|
|
var rwy = apt.runway("18R");
|
|
|
|
var crds = [];
|
|
var coord = geo.Coord.new();
|
|
width=width*20; # Else rwy is too thin to be visible
|
|
coord.set_latlon(lat, lon);
|
|
coord.apply_course_distance(rwyhdg, -14.2*NM2M);
|
|
append(crds,"N"~coord.lat());
|
|
append(crds,"E"~coord.lon());
|
|
coord.apply_course_distance(rwyhdg, 28.4*NM2M+length);
|
|
append(crds,"N"~coord.lat());
|
|
append(crds,"E"~coord.lon());
|
|
icon_rwy = group.createChild("path", "rwy-cl")
|
|
.setStrokeLineWidth(3)
|
|
.setDataGeo([2,4],crds)
|
|
.setColor(1,1,1)
|
|
.setStrokeDashArray([10, 20, 10, 20, 10]);
|
|
var crds = [];
|
|
coord.set_latlon(lat, lon);
|
|
coord.apply_course_distance(rwyhdg + 90, width/2);
|
|
append(crds,"N"~coord.lat());
|
|
append(crds,"E"~coord.lon());
|
|
coord.apply_course_distance(rwyhdg, length);
|
|
append(crds,"N"~coord.lat());
|
|
append(crds,"E"~coord.lon());
|
|
icon_rwy = group.createChild("path", "rwy")
|
|
.setStrokeLineWidth(3)
|
|
.setDataGeo([2,4],crds)
|
|
.setColor(1,1,1);
|
|
var crds = [];
|
|
coord.apply_course_distance(rwyhdg - 90, width);
|
|
append(crds,"N"~coord.lat());
|
|
append(crds,"E"~coord.lon());
|
|
coord.apply_course_distance(rwyhdg, -length);
|
|
append(crds,"N"~coord.lat());
|
|
append(crds,"E"~coord.lon());
|
|
icon_rwy = group.createChild("path", "rwy")
|
|
.setStrokeLineWidth(3)
|
|
.setDataGeo([2,4],crds)
|
|
.setColor(1,1,1);
|
|
}
|