Board index FlightGear Development Canvas

Using a canvas map in the GUI

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: Using a canvas map in the GUI

Postby Gijs » Thu Nov 08, 2012 10:46 pm

Could we please make the canvas of the Start on Ground dialog resizable? It doesn't fit my screen ;-)

Also, getting the following error when I open that dialog, and the map seems to fail (black screen). This is with 30 minutes old fgdata, simgear and flightgear.
Code: Select all
Nasal runtime error: undefined symbol: _addChild
  at C:/FlightGear/fgdata/Nasal/props.nas, line 17
  called from: C:/FlightGear/fgdata/Nasal/canvas/PropertyElement.nas, line 14
  called from: C:/FlightGear/fgdata/Nasal/canvas/api.nas, line 142
  called from: C:/FlightGear/fgdata/Nasal/canvas/api.nas, line 282
  called from: C:/FlightGear/fgdata/Nasal/canvas/api.nas, line 739
  called from: __canvas:airport-selection, line 5
Airports: EHAM, EHLE, KSFO
Aircraft: 747-400
User avatar
Gijs
Moderator
 
Posts: 9544
Joined: Tue Jul 03, 2007 3:55 pm
Location: Delft, the Netherlands
Callsign: PH-GYS
Version: Git
OS: Windows 10

Re: Using a canvas map in the GUI

Postby Hooray » Thu Nov 08, 2012 11:35 pm

Tested this on a small (screen-wise) notebook with 32 bit Linux (latest SG/FG/FGDATA), and I am NOT seeing the Nasal errors you mentioned.
However, I agree that the dialog has really become huge - and it also doesn't fit on my screen here ... however, looking at the git log, that's not really a canvas issue, but rather Stuart has added loads of other info to the dialog now. Such as frequencies etc.

I'd suggest to make this info either optional (via a show/hide button) or at least introduce a tabbed layout here...
Note that PUI dialogs cannot be arbitrarily resized, that would require a full canvas GUI (i.e. vector images)

At the moment, such huge dialogs are a serious usability regression on certain systems, because they won't be usable there (i.e. in resolutions <= 1024x786)

BTW: You can easily comment/remove the canvas widget from the dialog to see for yourself that it doesn't solve the problem at all :D

As a compromise, I would restrict the height of the airport list to 50% (the width to 30-40%) and get rid of the weird formatting for the frequency list, maybe even use a real list widget here. There's really lots of wasted space there at the moment ...
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: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Re: Using a canvas map in the GUI

Postby stuart » Fri Nov 09, 2012 12:12 am

Gijs, Hooray,

What resolution are you running at?

I'll see what I can do to reduce the dialog size. A tabbed layout is the obvious choice.

(BTW - the frequencies are displayed the way they are to work around some PUI bugs...)

-Stuart
G-MWLX
User avatar
stuart
Moderator
 
Posts: 1629
Joined: Wed Nov 29, 2006 10:56 am
Location: Edinburgh
Callsign: G-MWLX

Re: Using a canvas map in the GUI

Postby Gijs » Fri Nov 09, 2012 12:17 am

1366x768 here
Airports: EHAM, EHLE, KSFO
Aircraft: 747-400
User avatar
Gijs
Moderator
 
Posts: 9544
Joined: Tue Jul 03, 2007 3:55 pm
Location: Delft, the Netherlands
Callsign: PH-GYS
Version: Git
OS: Windows 10

Re: Using a canvas map in the GUI

Postby Hooray » Fri Nov 09, 2012 12:22 am

Gijs brought it up, but it seems only to be an issue when using displays <= 16" and the typical resolutions there ...
I really don't mind it, because I primarily run FG on displays >= 17 "

However, it would obviously make sense to add some detection heuristics to the GUI code (dialog builder) to check if the resulting dialog box has dimensions that are greater than the current resolution.

In fact, on my netbook I can't use most of the GUI dialogs anymore for these very reasons ...

(BTW - the frequencies are displayed the way they are to work around some PUI bugs...)

Keep in mind that we can use multiple canvas per dialog and even uses those to work around such bugs by using a canvas/osgtext region to display such information in a sane fashion
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: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Re: Using a canvas map in the GUI

Postby zakalawe » Fri Nov 09, 2012 11:18 am

Funny, I was planning to increase the default windows size to 1024x768 partly because of the airports dialog :)
zakalawe
 
Posts: 1259
Joined: Sat Jul 19, 2008 5:48 pm
Location: Edinburgh, Scotland
Callsign: G-ZKLW
Version: next
OS: Mac

Re: Using a canvas map in the GUI

Postby Gijs » Fri Nov 09, 2012 2:56 pm

53% of the forum visitors in the past month has a minimum screen resolution (smallest side) equal to, or smaller than 800px. Excluding mobile phones here (resolutions smaller than 600). I guess this percentage will be smaller if you measure the screens from all users, but still, I think this shows that small screens are not some unimportant minority ;-)

PS: 62% uses Windows,17% Linux and 13% Mac
Airports: EHAM, EHLE, KSFO
Aircraft: 747-400
User avatar
Gijs
Moderator
 
Posts: 9544
Joined: Tue Jul 03, 2007 3:55 pm
Location: Delft, the Netherlands
Callsign: PH-GYS
Version: Git
OS: Windows 10

Re: Using a canvas map in the GUI

Postby Hooray » Fri Nov 09, 2012 3:16 pm

Our current GUI is a real issue when it comes to supporting small-screen devices (not just phones, but really just netbooks or notebooks). So, I'd be careful about requiring a higher resolution and making it the default.
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: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Re: Using a canvas map in the GUI

Postby stuart » Fri Nov 09, 2012 11:43 pm

I've just checked in an update to airport.xml.

It _almost_ fits within 800x600. The dialog is about 40 pixels too wide, but is at least usable.

-Stuart
G-MWLX
User avatar
stuart
Moderator
 
Posts: 1629
Joined: Wed Nov 29, 2006 10:56 am
Location: Edinburgh
Callsign: G-MWLX

Re: Using a canvas map in the GUI

Postby Hooray » Fri Nov 09, 2012 11:53 pm

That looks MUCH better here!

To squeeze out more pixels, we could probably safely reduce the width of the airport list column by about 1/4th.
Also, the "search/100nm" buttons could then be moved to a separate line.

Overall, I'd think it's probably a good idea to agree on a certain "minimum" screen resolution that should be usable with our GUI dialogs, 800x600 sounds like the lowest possible resolution. There's probably nobody trying to really use FG in 640x480 (?)

OTOH, even netbooks an phones are getting increasingly powerful, there are some netbooks out there with NVIDIA ION chipsets, that should be able to run FG...
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: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Re: Using a canvas map in the GUI

Postby Gijs » Sat Nov 10, 2012 2:24 pm

Much much better yeah! Thanks!

EDIT: Canvas errors and black map issue are solved too, I just forgot to move the fresh fgfs.exe to the right directory. Cannot believe it took me a month before I would notice :oops: ...
Airports: EHAM, EHLE, KSFO
Aircraft: 747-400
User avatar
Gijs
Moderator
 
Posts: 9544
Joined: Tue Jul 03, 2007 3:55 pm
Location: Delft, the Netherlands
Callsign: PH-GYS
Version: Git
OS: Windows 10

Re: Using a canvas map in the GUI

Postby TheTom » Sat Nov 10, 2012 2:43 pm

Gijs wrote in Sat Nov 10, 2012 2:24 pm:
Code: Select all
Nasal runtime error: undefined symbol: _addChild

Are you sure you are using the latest flightgear? _addChild should be available since about a month: https://gitorious.org/fg/flightgear/blo ... xx#line526
TheTom
 
Posts: 322
Joined: Sun Oct 09, 2011 11:20 am

Re: Using a canvas map in the GUI

Postby Gijs » Sat Nov 10, 2012 2:48 pm

See my edited post ;-)
Airports: EHAM, EHLE, KSFO
Aircraft: 747-400
User avatar
Gijs
Moderator
 
Posts: 9544
Joined: Tue Jul 03, 2007 3:55 pm
Location: Delft, the Netherlands
Callsign: PH-GYS
Version: Git
OS: Windows 10

Re: Using a canvas map in the GUI

Postby Hooray » Mon Dec 03, 2012 10:15 am

stuart wrote in Thu Sep 27, 2012 11:04 pm:I look forward to James/Tom adding panning function to the library so the airport dialog supports it withough any further coding :)


Tom has just implemented this - zooming/panning now work properly.
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: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Re: Using a canvas map in the GUI

Postby Hooray » Mon Dec 10, 2012 9:16 pm

Hooray wrote in Wed Sep 19, 2012 1:56 pm:
zakalawe wrote in Wed Sep 19, 2012 1:34 pm:There's also a long-requested feature to use the replay-code to extract the historical aircraft position, which would be another kind of data to show.


That's definitely a good idea, accessing the replay/flight recorder buffers via a dedicated Nasal/property tree interface would be pretty cool, not just for showing historical path data, but also for computing a flight profile, or even for doing a full flight evaluation - which could also be done via Nasal/Canvas then, we just need Nasal hooks (i.e. ghosts) to access the replay/flight recorder subsystem and get data from it.

I've been talking to ThorstenB about exposing the system to Nasal a while ago, and when Tom and I played around with graph plotting, we also figured that it would be kinda cool to access such info from Nasal.

The combination of these features (replay/flight recorder access + Nasal + Canvas), would also make it possible to create a full flight instructor console. The original graph-plotting experiments were pretty encouraging:
Image
And 2D plotting is another long-standing feature request, originally brought up by Curt: http://www.mail-archive.com/flightgear- ... 03651.html

curt wrote:But, I was just thinking today that it might be cool to have a built
in grapher for simple / quick graphing needs.

With the property system it would be trivial to pick an arbitrary
property from the property tree and graph it over time -- superimposed
on top of everything else.


With the Canvas, it has now become trivial to create such graphs, but we still need to have Nasal-space access to the corresponding subsystems and data, i.e. the replay/flight recorder system.


Update: Zakalawe has just committed to implement the required hooks for this as part of issue 763: https://gitorious.org/fg/flightgear/com ... dfc1e1cb43
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: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Previous

Return to Canvas

Who is online

Users browsing this forum: No registered users and 2 guests