Board index FlightGear Development Canvas

NavDisplay & MapStructure discussion (previously via PM)

Canvas is FlightGear's new fully scriptable 2D drawing system that will allow you to easily create new instruments, HUDs and even GUI dialogs and custom GUI widgets, without having to write C++ code and without having to rebuild FlightGear.

Re: NavDisplay & MapStructure discussion (previously via PM)

Postby Philosopher » Sat May 10, 2014 7:49 pm

Question about the airplane symbol SVG (Nasal/canvas/map/Images/boeingAirplane.svg): can we center the SVG image, or do we need to do that with Canvas? Currently the image is centered on its drawing area, which looks off-center; to center it on the displays, I think it would have to be aligned at the top left? I think we could offset it in Canvas, but that probably wouldn't be the best solution.
Thanks,
Philosopher
(inactive but lurking occasionally...)
Philosopher
 
Posts: 1590
Joined: Sun Aug 12, 2012 6:29 pm
Location: Stuck in my head...
Callsign: AFTI
Version: Git
OS: Mac OS X 10.7.5

Re: NavDisplay & MapStructure discussion (previously via PM)

Postby Hooray » Sat May 10, 2014 7:58 pm

I think Gijs or Hyde committed that file, so better left for them to answer - there are probably some assumptions made in the drawing code, too...
Also, I don't even have access to Inkscape currently, so I am not in a particularly good position to help here :D
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 11345
Joined: Tue Mar 25, 2008 8:40 am

Re: NavDisplay & MapStructure discussion (previously via PM)

Postby Gijs » Sun May 11, 2014 10:58 am

I don't know if we can display objects that are outside the canvas, but if we can, that would be the easiest option. In my current (or is it now old?) code, I translated the object through Nasal to center it ;-)
Airports: EHAM, EHLE, KSFO
Aircraft: 747-400
User avatar
Gijs
Moderator
 
Posts: 9380
Joined: Tue Jul 03, 2007 2:55 pm
Location: Amsterdam/Delft, the Netherlands
Callsign: PH-GYS
Version: Git
OS: Windows 10

Re: NavDisplay & MapStructure discussion (previously via PM)

Postby Philosopher » Sun May 11, 2014 7:12 pm

Uh... what code now? Haven't seen it in a while ;).

I centered it in Inkscape and it looks fine on both the ND and map dialog. Just have a 900-lines-of-diff commit to finalize after that, then some testing :).
Thanks,
Philosopher
(inactive but lurking occasionally...)
Philosopher
 
Posts: 1590
Joined: Sun Aug 12, 2012 6:29 pm
Location: Stuck in my head...
Callsign: AFTI
Version: Git
OS: Mac OS X 10.7.5

Re: NavDisplay & MapStructure discussion (previously via PM)

Postby Hooray » Sun May 11, 2014 7:18 pm

Philosopher wrote in Sun May 11, 2014 7:12 pm:Just have a 900-lines-of-diff commit to finalize after that, then some testing :).


If that's 900 lines of Nasal diffs and not XML/SVG, I don't mind going through the whole thing and helping with testing. My testing routine now involves the ufo and the map-canvas.xml dialog, and then the ND dialog, so that I don't have to wait for the 747/777 to start up. Even though I am still considering to extend the configuration hash such that the whole canvas dialog can be procedurally created (it's only using PUI buttons for now, and we have native Canvas buttons already... )
Image

But the ND code really needs some serious cleanup - just not too eager to touch it until the map-canvas/airports dialogs are working, because that stuff is basically the "back-end" - and Gijs and others still seem to be working with the ND code, but I have several ideas on generalizing the "framework" to help reduce update() and turn navdisplay.mfd into less than 500 LoC
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 11345
Joined: Tue Mar 25, 2008 8:40 am

Re: NavDisplay & MapStructure discussion (previously via PM)

Postby Hooray » Mon May 12, 2014 12:32 am

Well, I guess we need to move away from the assumption that all layers have symbols, I took your APS layer and quickly adapted it to render a raster image that uses map server URLs to look up a satellite image online using Tom's recent CanvasImage/http support and the current lat/lon, and it's "kinda" working - but treating it like a symbol with a geo position now, but it's less than 20 lines of code (except for the usual MapStructure markup) - maybe we should introduce some kind of "overlay-layer" (handling zoom, lat/lon, transformation/alignment) :D
Image
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 11345
Joined: Tue Mar 25, 2008 8:40 am

Re: NavDisplay & MapStructure discussion (previously via PM)

Postby Philosopher » Mon May 12, 2014 12:52 am

And...? is there problem? Really, raster images are just symbols too - just populate them at even spacing while they are in range. (You could add a MapStructure function to do this spacing.)
Thanks,
Philosopher
(inactive but lurking occasionally...)
Philosopher
 
Posts: 1590
Joined: Sun Aug 12, 2012 6:29 pm
Location: Stuck in my head...
Callsign: AFTI
Version: Git
OS: Mac OS X 10.7.5

Re: NavDisplay & MapStructure discussion (previously via PM)

Postby Hooray » Mon May 12, 2014 1:01 am

Yes, but we don't want it to be treated like a symbol (which gets repositioned according to the searchCmd result set).
There's no real problem, still playing around with it. Intuitively, I would add an [Overlay] class whose searchCmd gets treated like a "volatile/dynamic" layer (TFC/WXR/FLT), and then we need to assemble mapserver/GIS URLs for the current lat/lon and range, and then align several groups of raster images (e.g. 3x3 grid) and transform them if needed. searchCmd() would then merely provide a vector with positions for each tile's center probably, while the update() method would set the http:// URL for of the 3x3 images. Well, several ways to skin that cat - not important right now, but it's a neat little experiment, and it proves that focusing on building blocks is extremely powerful - because extending the hard-coded Map dialog accordingly would have been so much more difficult than "just" allowing Nasal/Canvas to render raster images, and reference images via http :-)
It's nice to see how Canvas helps modernize areas in FG that haven't really been developed at all - allowing us even to come up with features that cannot be easily supported otherwise.
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 11345
Joined: Tue Mar 25, 2008 8:40 am

Re: NavDisplay & MapStructure discussion (previously via PM)

Postby Hooray » Mon May 12, 2014 11:37 am

Philosopher wrote in Mon May 12, 2014 12:52 am:Really, raster images are just symbols too - just populate them at even spacing while they are in range. (You could add a MapStructure function to do this spacing.)


Regarding the RTE vs LEG comments you made - thanks to your LineSymbol helper we should now be able to use the same class to also create a lat/lon coordinate grid for the map, I actually just played with it by adding a "GRID" layer that is just a modified copy of FLT, but this is one of those things that would make sense to use the SymbolCache for, i.e. by rendering it to a 256x256 sub-texture and only transforming it according to ref-lat/ref-lon and heading/range (zoom). Otherwise, we'll keep on redrawing redundant stuff. So having some kind of dedicated "overlay" helper may not be such a bad idea after all

Regarding the whole styling vs. caching debate, I do think that animating things after fetching them from the cache may not even be necessary - in many cases would simply animate things directly inside the cache and then fetch the animated (e.g. blinking) sub-texture instead. That would be supported right now already, we just aren't doing that ATM.
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 11345
Joined: Tue Mar 25, 2008 8:40 am

Re: NavDisplay & MapStructure discussion (previously via PM)

Postby Philosopher » Fri May 23, 2014 3:14 am

Okay, just wondering if there is anything else we need to address, otherwise I would like to push it back to master before the weekend (minus TUT/tutorial.nas, as your print statements diligently remind me!) as it's pretty good and the dialog's mostly functional.

About the only real issue that I know of is that RTE might flicker because it has to decimate and redraw the whole path (yeah, ik, that kinda defeats the purpose... but oh well), but I haven't seen that myself yet (Hyde reported it). That'd be a bug-fix though, so committing it directly to master would be okay.
Thanks,
Philosopher
(inactive but lurking occasionally...)
Philosopher
 
Posts: 1590
Joined: Sun Aug 12, 2012 6:29 pm
Location: Stuck in my head...
Callsign: AFTI
Version: Git
OS: Mac OS X 10.7.5

Re: NavDisplay & MapStructure discussion (previously via PM)

Postby Hooray » Fri May 23, 2014 9:12 am

agree with you, it's usable as is, and can be extended over time, i.e. during the upcoming release cycle - and any bug fixes are safe to commit, because this is not a critical component, i.e. the hard-coded MapWidget is still there, and this will given Zakalawe, TheTom and others a good chance to experiment with it and provide feedback WRT to stuff missing to phase out the MapWidget completely.
And yeah, just "git checkout tutorial.nas" to undo those changes there - and take out the TUT stuff, I haven't seen much activity on the tutorial/missions side, so not sure what's going on there, or if there's anything going to be committed in time for 3.2 - in that case, I can resurrect and clean up the TUT stuff
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 11345
Joined: Tue Mar 25, 2008 8:40 am

Re: NavDisplay & MapStructure discussion (previously via PM)

Postby Philosopher » Sun May 25, 2014 7:41 pm

Mkayyyyy ...... pushed it!! (actually.... getting the ./objects error, I'll have to see if I can get it to complete)

I don't know what's going to happen if this iteration doesn't work 100%... Oh well, I tested it and it works. (Or it worked, I just made a small untested patch before I sent it off...)

Hooray, you and I had the same idea, for TUT, but I was going to leave the clone alone... we can just keep working on TUT there, if you want (revert one or two commits, maybe make a new branch). But I already did that in the master branch, and added 1-2 bugfixes to both.

I learned a few things about Git today, I'll say. I didn't have to copy any files this time to a temp folder - just manipulating branches was enough - and I managed to add one to the clone before finalizing the master one.

P.S. I don't know what language retreive is... there's no entry on wiktionary! But it's a lot more convenient to type than retrieve. :lol: Looking at the etymology, it looks like I could just be starting the next spelling change for it: http://en.wiktionary.org/wiki/retrieve#Etymology
Thanks,
Philosopher
(inactive but lurking occasionally...)
Philosopher
 
Posts: 1590
Joined: Sun Aug 12, 2012 6:29 pm
Location: Stuck in my head...
Callsign: AFTI
Version: Git
OS: Mac OS X 10.7.5

Re: NavDisplay & MapStructure discussion (previously via PM)

Postby Philosopher » Sun May 25, 2014 8:04 pm

Strangely, Hooray, it pushes to the canvas-hackers clone OK. It looks like there's no response to Clément's message yet though: http://permalink.gmane.org/gmane.comp.v ... rious/5329
Thanks,
Philosopher
(inactive but lurking occasionally...)
Philosopher
 
Posts: 1590
Joined: Sun Aug 12, 2012 6:29 pm
Location: Stuck in my head...
Callsign: AFTI
Version: Git
OS: Mac OS X 10.7.5

Re: NavDisplay & MapStructure discussion (previously via PM)

Postby Hooray » Sun May 25, 2014 9:53 pm

your commits are working fine here, too (actually tested it a few seconds ago!), so good job!
Resurrecting TUT should be a no-brainer, I think we can re-introduce such stuff once map-canvas itself is merged, and then start with a fresh branch, what do you think ?

Regarding git: I don't think I ever had to copy stuff to a temp folder :?

Don't worry about "retreive" though, I just found it funny, because I fixed it TWICE before, and you would always revert my changes later on ;-)
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 11345
Joined: Tue Mar 25, 2008 8:40 am

Re: NavDisplay & MapStructure discussion (previously via PM)

Postby Hyde » Sat May 31, 2014 5:44 pm

@Philosopher
git main branch's canvas ND has not worked quite long time.
Could you update at least no nasal error and ND workable?

Thanks,
Hyde
Hyde
 
Posts: 728
Joined: Fri Aug 12, 2011 1:09 pm
Location: Peachtree city, GA
Callsign: N407DS
Version: GIT
OS: Fedora 25

PreviousNext

Return to Canvas

Who is online

Users browsing this forum: No registered users and 0 guests