For prototyping purposes, i.e. developing new styles for other aircraft, my suggestion would really be to use a PUI/XML dialog and add the boilerplate code from ND.nas into it, so that you can develop the style without having to exit/restart FlightGear:
Are you going to making an Citation Style Canvas Display?
If you are interested in this, I can probably walk you through the whole thing and mentor you to create a corresponding dialog and make that work to easily create new ND styles - but I would ask you to help us update the wiki accordingly, or even document your journey using a new wiki article.
If you are interested in this, I can probably walk you through the whole thing and mentor you to create a corresponding dialog and make that work to easily create new ND styles -
<button>
<legend>Reload</legend>
<default>1</default>
<border>2</border>
<binding>
<command>reinit</command>
<subsystem>gui</subsystem>
</binding>
</button>
<close><![CDATA[
print("nasal/closing block");
foreach(var mfd; MFDInstances) {
mfd.del();
}
]]></close>
Nasal runtime error: No such member: del
at /home/chris/fgfs2016_4/install/flightgear/fgdata/Nasal/canvas/api.nas, line 467
called from: /home/chris/fgfs2016_4/install/flightgear/fgdata/Nasal/canvas/map/navdisplay.mfd, line 108
called from: __dlg:canvas-nd, line 4
<close><![CDATA[
print("nasal/closing block");
foreach(var mfd; MFDInstances) {
MFDInstances[mfd].del();
}
]]></close>
nasal/closing block
Nasal runtime error: container index not scalar
at __dlg:canvas-nd, line 4
I can also update the item " Customizing MapStructure Styling" of the "Canvas Snippets wiki". Now I know how to modify styles of APT, VOR ...
I tried to transfer all this code to a citation navdislay.styles but I encounter some problems with the names include in the loops "foreach" of the navdisplay.mfd, which are really different of these in my .svg file.
### this is the "old" method that's less flexible, we want to use the style hash instead (see above)
# because things are much better configurable that way
# now look up all required SVG elements and initialize member fields using the same name to have a convenient handle
foreach(var element; ["dmeLDist","dmeRDist","dmeL","dmeR","vorL","vorR","vorLId","vorRId",
"status.wxr","status.wpt","status.sta","status.arpt"])
me.symbols[element] = me.nd.getElementById(element);
# load elements from vector image, and create instance variables using identical names, and call updateCenter() on each
# anything that needs updatecenter called, should be added to the vector here
#
foreach(var element; ["staArrowL2","staArrowR2","staFromL2","staToL2","staFromR2","staToR2",
"hdgTrk","trkInd","hdgBug","HdgBugCRT","TrkBugLCD","HdgBugLCD","curHdgPtr",
"HdgBugCRT2","TrkBugLCD2","HdgBugLCD2","hdgBug2","selHdgLine","selHdgLine2","curHdgPtr2",
"staArrowL","staArrowR","staToL","staFromL","staToR","staFromR"] )
me.symbols[element] = me.nd.getElementById(element).updateCenter();
Users browsing this forum: No registered users and 5 guests