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 Gijs » Thu Jul 10, 2014 8:15 am

I know, but thats a tad harder to implement. For mow I'm happy with this ;-)
Airports: EHAM, EHLE, KSFO
Aircraft: 747-400
User avatar
Gijs
Moderator
 
Posts: 9364
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 Soitanen » Thu Jul 10, 2014 9:02 am

I see one algorithm, but I don't know, maybe it's not optimal.

1. Check windspeed. If WS>6kt, then set /some/property/wind-show=1
If WS<4 kt, then set /some/property/wind-show=0
2. Read /some/property/wind-show and use it for showing or hiding.
Boeing 737-300. Reworked cockpit, FDM, autopilot and much more. WIP.
Boeing 737-800. WIP. Canvas PFD and ND.
Antonov An-24B. Made from scratch. Very good FDM. 3D model by Adrian. WIP.
Project Russia (some cities, based on OSM with custom objects).
Soitanen
 
Posts: 489
Joined: Sat Jun 16, 2012 6:50 am
Location: Saint-Petersburg, Russia
Version: git
OS: Linux Mint 17

Re: NavDisplay & MapStructure discussion (previously via PM)

Postby Hooray » Thu Jul 10, 2014 3:38 pm

in addition to the "predicate" callback and its true/false callbacks, there's also a "common" callback supported that can be used to do pretty much anything, you could leave the others empty then
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: 11329
Joined: Tue Mar 25, 2008 8:40 am

Re: NavDisplay & MapStructure discussion (previously via PM)

Postby Gijs » Thu Jul 10, 2014 4:43 pm

@Soitanen, I've used a variable (more flexible than a property) and it works fine! Will push it with my next update. Keep the missing features/bugs coming, it's easy to miss things on such complex instruments.
Airports: EHAM, EHLE, KSFO
Aircraft: 747-400
User avatar
Gijs
Moderator
 
Posts: 9364
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 Hooray » Thu Jul 10, 2014 5:19 pm

just make sure that it's an instance variable (me.foo) or your variable may be shared across all ND instances
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: 11329
Joined: Tue Mar 25, 2008 8:40 am

Re: NavDisplay & MapStructure discussion (previously via PM)

Postby Gijs » Thu Jul 10, 2014 9:17 pm

Pushed now! Please give it a try Soitanen.
Airports: EHAM, EHLE, KSFO
Aircraft: 747-400
User avatar
Gijs
Moderator
 
Posts: 9364
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 Hyde » Sat Jul 12, 2014 2:34 pm

@Gijs,
Airport mark becomes not displayed by the latest change.
Please check.
Hyde
 
Posts: 728
Joined: Fri Aug 12, 2011 1:09 pm
Location: Peachtree city, GA
Callsign: N407DS
Version: GIT
OS: Fedora 25

Re: NavDisplay & MapStructure discussion (previously via PM)

Postby Gijs » Sat Jul 12, 2014 2:54 pm

What do you mean with "airport mark"?
Airports: EHAM, EHLE, KSFO
Aircraft: 747-400
User avatar
Gijs
Moderator
 
Posts: 9364
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 Hyde » Sat Jul 12, 2014 3:12 pm

Pallarel lines at departure and arrival airport of route.
http://www.hyde-tech.com/~hyde/flightgear/AptMark.png
This should be displayed and erased togeter with the route. (Previously it was displayed when change range or mode and not eraced even next leg is activated.)
Hyde
 
Posts: 728
Joined: Fri Aug 12, 2011 1:09 pm
Location: Peachtree city, GA
Callsign: N407DS
Version: GIT
OS: Fedora 25

Re: NavDisplay & MapStructure discussion (previously via PM)

Postby Gijs » Sat Jul 12, 2014 3:31 pm

Ah, you mean the arrival/departure runway symbols ;-)
My only recent change to them added the runway number. They work the same as before here; only show up after changing range/mode once (because it's the only non-mapstructure layer I think; Philisopher should now more) and at ranges below 40NM. I did not yet implement the simplified symbol that's shown at larger ranges.

If they really do not show up on your computer, the first thing I would look at is the error log...
Airports: EHAM, EHLE, KSFO
Aircraft: 747-400
User avatar
Gijs
Moderator
 
Posts: 9364
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 Hyde » Sat Jul 12, 2014 3:36 pm

Yeah,
I get the nasal error
Nasal runtime error: No such member: setBackdropColor
at /home/hyde/work/FlightGear/fgdata/Nasal/canvas/map/runway-nd.draw, line 61
called from: /home/hyde/work/FlightGear/fgdata/Nasal/canvas/map/runway-nd.draw, line 5
.
.
.
Hyde
 
Posts: 728
Joined: Fri Aug 12, 2011 1:09 pm
Location: Peachtree city, GA
Callsign: N407DS
Version: GIT
OS: Fedora 25

Re: NavDisplay & MapStructure discussion (previously via PM)

Postby Gijs » Sat Jul 12, 2014 3:47 pm

Always a good idea to check for errors when something doesn't work. Apparently I forgot to remove some test code for an uncommitted feature. Will do in a minute.
Airports: EHAM, EHLE, KSFO
Aircraft: 747-400
User avatar
Gijs
Moderator
 
Posts: 9364
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 omega95 » Tue Jul 15, 2014 11:40 pm

omega95 wrote:I was going to get an ND (the Canvas one) on the aircraft, but when I was going to create a custom airbus "skin", I found this - http://wiki.flightgear.org/Canvas_ND_Fr ... _ND_Styles that recommends that I DON'T make one. :|


I was wondering I would need to do to separate VORs and NDBs from the STA layer, and change the skin (fonts, circle/line sizes, icons etc.) and add/make a terrain layer (some like http://i.imgur.com/BClRh.png but I can make it a lot cleaner and put it in the right place). Also, I wanted to use the canvas subsystem to make add a TAXI view - just a re-colored version of the airport diagram on the airport selection chart. My original plan was to have pilots install SVGs into the database and it loads from that, but if I can dynamically draw it, it wouldn't be necessary.

Cheers!
Merlion Virtual Airlines - the experience of a flight time...
Get high quality aircraft, airports, video tutorials or development tools from my hangar.
omega95
 
Posts: 1223
Joined: Sat Jul 30, 2011 12:59 am
Location: -unknown-
Callsign: MIA0001, OM-EGA
IRC name: omega95
Version: 2.12 git
OS: Ubuntu 13.04

Re: NavDisplay & MapStructure discussion (previously via PM)

Postby Hooray » Wed Jul 16, 2014 4:52 am

That advice was specifically meant for people without any Nasal coding experience, because the framework itself has sufficiently evolved to allow such customizations, without having to copy/edit files and change a ton of code.

What you describe would be much more work than simply disregarding the -old- advice not to come up with a custom Airbus ND style now.
It's not that bad, it mainly involves:

  • copy the Boeing SVG file
  • saving it under a different file name, save it under Airbus.svg
  • copying the Boeing style and pasting an identical version named "Airbus"
  • changing the SVG file name to your new file

These steps will take ~3 minutes only

That will give a Boeing ND, under the "Airbus" name.
Once that works, you can basically open your Airbus.svg file and change symbols/appearance there.

Likewise, you can remove/add custom symbol animation callbacks from the Airbus styles hash.
Obviously, once you change/add new SVG element IDs, you need to add those to your animation callbacks

The layer changes /additions you describe are trivial to do using MapStructure, those are not "symbols" but actual MapStructure layers - see the MapStructure article for details.
fonts, colors, symbols can be easily customized using MapStructure styles. Extending styling to the ND would not be too difficult either.

A terrain layer is also easy to do, but will have performance implications:

http://wiki.flightgear.org/Canvas_MapStructure_Layers
http://wiki.flightgear.org/MapStructure ... new_Layers

Regarding the TAXI view, we already have a taxiways.layer that would only need to be adapted/ported:
Image
Changing colors there would be trivial, it's just a matter of applying MapStructure styles.

The main step is taking taxiways.draw and turning it into a MapStructure symbol file: http://wiki.flightgear.org/MapStructure ... xml_dialog
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: 11329
Joined: Tue Mar 25, 2008 8:40 am

Re: NavDisplay & MapStructure discussion (previously via PM)

Postby omega95 » Wed Jul 16, 2014 9:14 am

I was wondering if I could copy the contents of the navdisplay.styles file (Boeing style content) into airbus.styles and start it off with
Code: Select all
NDStyles['Airbus'] = { ... style data here };


And then, change the layers etc.

Also, I'm trying to edit the SVG file but can't figure out exactly what to do (never played with SVGs before) Are there different objects or layers? I only see [base], CTR and PLAN layers and when I hit TAB to scroll through objects, it only goes through a few and leaves out the heading discs and most others.

Thank you!
Last edited by omega95 on Wed Jul 16, 2014 9:33 am, edited 1 time in total.
Merlion Virtual Airlines - the experience of a flight time...
Get high quality aircraft, airports, video tutorials or development tools from my hangar.
omega95
 
Posts: 1223
Joined: Sat Jul 30, 2011 12:59 am
Location: -unknown-
Callsign: MIA0001, OM-EGA
IRC name: omega95
Version: 2.12 git
OS: Ubuntu 13.04

PreviousNext

Return to Canvas

Who is online

Users browsing this forum: No registered users and 10 guests