Talk:Canvas Radar
Jump to navigation
Jump to search
setController
that line was already there, now it's there twice - see the end of the Nasal section inside the dialog.
--Hooray (talk) 16:18, 4 February 2014 (UTC)
Old Radar
Is there plans for old style forward looking, with sweep-line and fading dots for contacts? Is the plan to show only MP or is the plan to show AI also?
Necolatis (talk) 23:41, 5 February 2014 (UTC)
- So far, it's dealing with both things - AI and MP, the same way - it would require 3 lines of code to change this to make either of the two modes optional. Regarding the style, that's up to aircraft developers actually - by default, it will be just about providing the corresponding data (positions, altitude, aircraft) - it will be up to the implementor to visualize this in a certain way, i.e. by providing either custom draw routines (callbacks), or simply by providing corresponding SVG/PNG images to customize the appearance of the Radar. Without any Nasal/Canvas experience, people will by default be getting a Radar to similar to the one available on the m2000-5 obviously - but people with some Nasal experience, will be able to easily customize things.
- --Hooray (talk) 00:04, 6 February 2014 (UTC)
Radar class (Mirage 2000-5)
Work in progress This article or section will be worked on in the upcoming hours or days. See history for the latest developments. |
# See: http://wiki.flightgear.org/MapStructure
# Class things:
var name = "RADAR";
var parents = [SymbolLayer.Controller];
var __self__ = caller(0)[0];
SymbolLayer.Controller.add(name, __self__);
SymbolLayer.add(name, {
parents: [MultiSymbolLayer],
type: name, # Symbol type
df_controller: __self__, # controller to use by default -- this one
df_style: {},
});
var new = func(layer){
# load the Radar class from radar2.nas
var path = 'm2000-5/Nasal/radar2.nas';
io.load_nasal(path);
var m = {
parents: [__self__],
layer: layer,
map: layer.map,
listeners: [],
radar: Radar.new(...),
};
# TODO: for non-navaid/FGPositioned layers this needs to be customized to compare objects on the layer
# layer.searcher._equals = func(a, b){
# return 0;
# }
return m;
}; # ctor
var del = func {
foreach (var l; me.listeners){
removelistener(l);
}
}; # del
var searchCmd = func {
printlog(_MP_dbg_lvl, "Running RADAR search");
var range = me.map.controller.query_range();
if(range == nil){
return;
}
return [];
}; # searchCmd
—This unsigned comment was added by Hooray (Talk | contribs) 13:56, November 2, 2015 (UTC)