Board index FlightGear Development Canvas

MessageBox/Widget API for MFD use (existing canvas)

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.

MessageBox/Widget API for MFD use (existing canvas)

Postby Hooray » Tue Jun 24, 2014 1:51 pm

I was going to adapt the MessageBox example to render a MessageBox inside a MFD instrument, but then I realized that we're always creating new "windows", i.e. the API doesn't currently provide any way to render to/reuse an existing Canvas - for more sophisticated MFD instruments (Avidyne Entegra R9, G1000, GPSMap196, Garmin 530), we'll probably need to ensure that all widgets and dialogs support being rendered in an existing canvas.

Especially the Avidyne Entegra R9 code should greatly benefit from being able to reuse (and style) existing widgets, because they're currently creating their own widgets without using any of the standard widgets. For instance, they came up with their own "tab" widgets and scroll areas: https://gitorious.org/extra500/extra500 ... widget.nas
Including a gui.nas based "message" system: https://gitorious.org/extra500/extra500 ... i.nas#L125
Image


F-JJTH mentioned that he'll also have to support certain widgets for the GPSMap196 (tabs, dialogs, text fields, labels buttons).

Given the degree of GUI support in both instruments, it would make sense to keep such use-cases in mind so that avionics developers can reuse/style existing widgets, and customize widgets or create new ones, that won't be instrument/aircraft-specific, but that will be just generic Canvas widgets. Overall, supporting such use-cases would then be fully in line with ARINC 661, i.e. fully supporting recursion in the form of a GUI widget rendered on a MFD, showin inside a GUI dialog :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: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Re: MessageBox/Widget API for MFD use (existing canvas)

Postby Johan G » Mon Jun 30, 2014 11:21 pm

As for widgets, is it possible to keep them enough VMC to have them easily change theme (e.g. for different avionics manufacturers or for different GUI themes)?
Low-level flying — It's all fun and games till someone looses an engine. (Paraphrased from a YouTube video)
Improving the Dassault Mirage F1 (Wiki, Forum, GitLab. Work in slow progress)
Some YouTube videos
Johan G
Moderator
 
Posts: 6634
Joined: Fri Aug 06, 2010 6:33 pm
Location: Sweden
Callsign: SE-JG
IRC name: Johan_G
Version: 2020.3.4
OS: Windows 10, 64 bit

Re: MessageBox/Widget API for MFD use (existing canvas)

Postby Hooray » Mon Jun 30, 2014 11:45 pm

yeah, it is already using MVC, the styling part is handled by $FG_ROOT/Nasal/canvas/gui/styles/DefaultStyle.nas, which basically determines appearance of widgets (size, fonts, images etc).
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: MessageBox/Widget API for MFD use (existing canvas)

Postby Octal450 » Fri Apr 22, 2016 9:04 pm

@Hooray

I would like to use this instrument. Do you know where is a download?

Regards,
Skillset: JSBsim Flight Dynamics, Systems, Canvas, Autoflight/Control, Instrumentation, Animations
Aircraft: A320-family, MD-11, MD-80, Contribs in a few others

Octal450's GitHub|Launcher Catalog
|Airbus Dev Discord|Octal450 Hangar Dev Discord
User avatar
Octal450
 
Posts: 5601
Joined: Tue Oct 06, 2015 1:51 pm
Location: Huntsville, AL
Callsign: WTF411
Version: next
OS: Windows 11

Re: MessageBox/Widget API for MFD use (existing canvas)

Postby Hooray » Fri Apr 22, 2016 9:44 pm

Sorry, please don't get this wrong, but my suggestion would be to look more carefully at the threads/postings you are responding to, e.g. by looking up the links posted. Had you done that, you would have noticed that the instrument is called the Avidyne Entegra R9 (wiki), and that it was implemented on the extra500 aircraft (wiki), whose primary developers were originally D-ECHO and D-EKEW (IIRC).
Back when this was originally implemented, they stated that it would not be designed with reusability in mind, any attempts to collaborate with them to change that were unfortunately not fruitful, in fact my PMs regarding this were basically ignored - subsequently, I merely ended up documenting the issues highlighted on the forum.

That being said, I haven't tracked any extra500/R9 developments in months/years, so some/all of this may no longer be re relevant/applicable, your best bet is indeed reviewing the extra500 repository, or maybe get in touch with the extra500 developers to learn more about the current situation of their avionics/MFDs.

Personally, I still think that this is one of the most sophisticated Canvas based MFDs available in FlightGear, but it was difficult to reuse elsewhere without some major re-architecting - back when we were working on the ND/MapStructure code, we were working out a way to make that happen still by coming up with dedicated sub-frameworks (e.g. for MFDs, animations, pages etc); and indeed, with Richard's recent MFD framework now being available, and his recently announced Emesary work, this may be worth revisiting - hopefully, things will turn out to be more fruitful this time, and it may not be such a bad thing if I am not involved in this given that the extra500 folks didn't really seem very receptive regarding the feedback I, and others (such as Philosopher), provided originally in response to reviewing the Avidyne R9 code.

Anyway, your posting, i.e. the question regarding instrument reuse, is proving that our original point was, and still is, very valid.
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


Return to Canvas

Who is online

Users browsing this forum: No registered users and 6 guests