Board index FlightGear Development Canvas

Aircraft-specific dialogs

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: Aircraft-specific dialogs

Postby wlbragg » Sun Jan 28, 2018 8:38 am

describe how the dialog you'd like to have would look like

Originally I envisioned a pop-up volume gauge, without a border, with an animated needle that reflects in real time the tanks water volume. Since though, I realized the Aircrane has a digital glass display displaying the tank volume. So I think now instead of the gauge with a needle indicator I can do it similar to what your doing for the propellants. This one became less important because the actual display is on the front panel at eye level so you can still see it and control the aircraft at the same time. But it would be nice to have a larger pop-up that you can position to maximize aircraft control while filing the tank.

I would still like to know if a border-less graphic such as a gauge with an animated needle is possible as that was my original concept and I can envision other use cases for such a thing.

Other indicators would be feedback coming from a sensor that indicates the depth that the boom or hose is submersed in the water. Another would be a click-able image of the water cannon nozzle's tilt angle that will adjust the water cannon angle.

Then there is basically the entire tank control panel that is on the center console where without autopilot it is close to impossible to manipulate and fly at the same time. The idea would be to replicate it in a dialog that would allow easy control of all the tank fill, dispersal settings and actions using the mouse. Were talking things that are normally changed using a knob or toggle switch.

I will also need one for the cargo controls, such as weight feedback and a cable or rope emergency shear button or switch. I'm sure there is some other things I am forgetting.

The idea is I need to be able to display and control via the mouse any displays or controls that need to be accessed in real time in a dialog that can be position as to be able to maintain control of the aircraft. It just so happens the Aircrane has a considerable amount of these types of activities that need monitored or activated while trying to control the aircraft at the same time.

Like you said I need to really think about how I want it laid out. I think the best way would be a graphic that looks like the real thing but with mouse click-able hot spots to both display information and execute actions.
Kansas(2-27-15)/Ohio/Midwest scenery development.
KEQA (2-27-15), 3AU, KRCP Airport Layout
Intel i5 3570K AMDRX480
User avatar
wlbragg
 
Posts: 4988
Joined: Sat Aug 25, 2012 11:31 pm
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Linux/AMDRX480

Re: Aircraft-specific dialogs

Postby wlbragg » Sun Jan 28, 2018 8:40 am

For some of the more time critical actions I think I would want a stand alone pop-up graphic. For other things a "tabbed framework" with multiple pages would work.
Kansas(2-27-15)/Ohio/Midwest scenery development.
KEQA (2-27-15), 3AU, KRCP Airport Layout
Intel i5 3570K AMDRX480
User avatar
wlbragg
 
Posts: 4988
Joined: Sat Aug 25, 2012 11:31 pm
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Linux/AMDRX480

Re: Aircraft-specific dialogs

Postby Hooray » Sun Jan 28, 2018 8:48 am

The way Thorsten's code is currently set up, it could be made to work in both scenarios - i.e. standalone, but also tabbed.

Thorsten wrote in Sun Jan 28, 2018 8:04 am:I think tabs can be done rather easily on the raster image (imagine a few buttons, the canvas framework just outlines the active option and switches the relevant layer on).

I might have a stab at their more complex boxes, I rather like the design.


I don't know how generic their underlying code currently is, but for the diagram, we can use rleibner's plot2D helpers - which he has been wanting to get commited to $FGDATA/Nasal/Caanvas anyway (currently, it's part of the addon - but is already structured to check if the module is loaded already, i.e. will only load it into the canvas namespace, if it's not there yet)

He's also been working on animated dials, too.

It would seem like a good idea to have a few very different "reference aircraft" implementing this (e.g. the shuttle, AirCrane, Alouette III and maybe even the Vostok).
That way, there won't be any aircraft specific assumptions hard-coded, while also making sure that the module lives in fgdata and doesn't need to be adopted via copy&paste
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: 11375
Joined: Tue Mar 25, 2008 8:40 am

Re: Aircraft-specific dialogs

Postby Thorsten » Sun Jan 28, 2018 6:37 pm

I would still like to know if a border-less graphic such as a gauge with an animated needle is possible as that was my original concept and I can envision other use cases for such a thing.


Without having tried this, I believe the best way to set this up is

* user supplies two raster images (gauge and hand)
* both are combined into a widget that accepts translations and rotations as a whole
* user supplies parameter which moves hand

Want me to code this? Doesn't look outrageously difficult, but you need to bring your own gif artwork.
Thorsten
 
Posts: 11190
Joined: Mon Nov 02, 2009 8:33 am

Re: Aircraft-specific dialogs

Postby Alant » Sun Jan 28, 2018 6:55 pm

Alternatively make your gauge and needle with Inkscape and save a s svg. Then animate the svg needle with nasal code.

Alan
Alant
 
Posts: 916
Joined: Wed Jun 23, 2010 5:58 am
Location: Portugal
Callsign: Tarnish99
Version: from Git
OS: Windows 10

Re: Aircraft-specific dialogs

Postby Hooray » Sun Jan 28, 2018 7:05 pm

like I said previously, rleibner has been creating such dialogs using his plot2D framework: viewtopic.php?f=71&t=33677#p326893
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: 11375
Joined: Tue Mar 25, 2008 8:40 am

Re: Aircraft-specific dialogs

Postby wlbragg » Mon Jan 29, 2018 1:51 am

Want me to code this?

Sure, give me a day or two to produce the graphics.
Kansas(2-27-15)/Ohio/Midwest scenery development.
KEQA (2-27-15), 3AU, KRCP Airport Layout
Intel i5 3570K AMDRX480
User avatar
wlbragg
 
Posts: 4988
Joined: Sat Aug 25, 2012 11:31 pm
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Linux/AMDRX480

Re: Aircraft-specific dialogs

Postby Thorsten » Mon Jan 29, 2018 6:27 am

Alternatively make your gauge and needle with Inkscape and save a s svg. Then animate the svg needle with nasal code.


I'm taking it for granted that any experienced canvas coder can make whatever dialog he prefers without using any pre-existing widgets. If anyone has an SVG workflow and canvas knowledge, I'd say hack away - the sky is the limit.

My idea here is that more people can supply raster images (because pretty much everyone texturing a scene object or an aircraft has a workflow) than draw SVG artwork and that it (presumably) would be useful to supply a widget that you just feed two raster images upon init, place it and you're done - no need to deal with SVG elements etc or animate anything with your own Nasal code - the widget will do that for you.
Thorsten
 
Posts: 11190
Joined: Mon Nov 02, 2009 8:33 am

Re: Aircraft-specific dialogs

Postby Hooray » Mon Jan 29, 2018 7:40 am

FYI: Regarding the artwork, Michat has also offered to provide some artwork if we can come up with the requirements.
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: 11375
Joined: Tue Mar 25, 2008 8:40 am

Re: Aircraft-specific dialogs

Postby Thorsten » Mon Jan 29, 2018 9:26 am

Here's a quick proof of concept of the analog gauge widget with two raster images filched from the internet (no, I didn't commit this because it's not licensed) - works like a charm, and raster images being raster images with gradients and shading, this'll probably look better than any SVG solution - basically you can base this on an actual cockpit photograph if you have one.

Image

The actual code to get it in is very simple if the widget lib is used:

Code: Select all
me.gauge_test = cdlg_widget_analog_gauge.new(me.root, "Aircraft/SpaceShuttle/Nasal/canvas/gauge.png", "Aircraft/SpaceShuttle/Nasal/canvas/gauge_needle.png");
me.gauge_test.setTranslation (50, 150);
me.gauge_test.setAngle(30.0);
Thorsten
 
Posts: 11190
Joined: Mon Nov 02, 2009 8:33 am

Re: Aircraft-specific dialogs

Postby Hooray » Mon Jan 29, 2018 9:41 am

that's looking really good - sorry, if I am pointing out the obvious here, but we're in the process of re-implementing an existing feature:

Thorsten wrote in Mon Jan 29, 2018 9:26 am:basically you can base this on an actual cockpit photograph if you have one.


yes, it's probably worth nothing that we have dozens of such instruments in our fgdata package already - i.e. for the 2D panels.

I actually once wrote a simple parser to load/animate 2D panel instrurments from fgdata - and this could be easily extended for these purposes.
I think this was prior to pui2canvas actually - i.e. I used this to bootstrap the pui2canvas stuff.

This would have the added advantage, that these instruments are not just textures, but already come up with the transformation/animation logic to make them functional.
To see for yourself, check out: https://sourceforge.net/p/flightgear/fg ... struments/

http://wiki.flightgear.org/Howto:Parsin ... the_Canvas
Image

The "specs" for loading arbitary instruments form fgdata is README.xmlpanels: https://sourceforge.net/p/flightgear/fg ... E.xmlpanel

Writing such a parser would mean that we would immediately have a library of existing instruments, as well as existing workflows/docs - and it could help make the legacy 2D code obsolete by rendering it on top of the Canvas system: http://wiki.flightgear.org/Unifying_the ... via_canvas
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: 11375
Joined: Tue Mar 25, 2008 8:40 am

Re: Aircraft-specific dialogs

Postby Thorsten » Mon Jan 29, 2018 10:32 am

I'm personally more interested in getting a toolkit to allow users to render any instrument they want than to give an easy path to render existing 2d instruments, but if anyone is interested in adding the parser for the existing stuff to the toolkit, I sure won't object.
Thorsten
 
Posts: 11190
Joined: Mon Nov 02, 2009 8:33 am

Re: Aircraft-specific dialogs

Postby OO-GPM » Mon Feb 05, 2018 9:27 pm

Hi all,

I was wondering if there is a canvas feature that would allow interaction with the dialog itself. I am aware that generic buttons are already implemented but is there anything like programmable click areas?
I'm interested in learning more about canvas for some upcoming projects such as b737 fmc and advanced 2nd panels for those who fly with potatoes (i.e. make fgfs more lightweight)

cheers,
OO-GPM
 
Posts: 4
Joined: Sun Jun 04, 2017 7:41 am
Callsign: OO-GPM
IRC name: gui
OS: MX Linux 18

Re: Aircraft-specific dialogs

Postby Alant » Mon Feb 05, 2018 11:48 pm

The generic canvas buttons etc were never completed,so forget that,

It is very easy to display a svg image on canvas. Each svg object can be made clickable. I think that I have posted links in this thread to the extra500 articles which should give you a quick start. Once you have done this clicking, dragging (left right and up down at the same time !), mouse hover and other mouse actions are available.

The same can be done with raster images, and that is Thorsten preference.

When I have time I will make a wiki article, but I am afraid that I am very busy with other things at the moment. But be assured - the basics are very simple, even for me ;)

Alan
Alant
 
Posts: 916
Joined: Wed Jun 23, 2010 5:58 am
Location: Portugal
Callsign: Tarnish99
Version: from Git
OS: Windows 10

Re: Aircraft-specific dialogs

Postby Thorsten » Tue Feb 06, 2018 6:52 am

I was wondering if there is a canvas feature that would allow interaction with the dialog itself. I am aware that generic buttons are already implemented but is there anything like programmable click areas?


A 'clickspot' is part of the existing widget list, and in fact the propellant dialog depicted above allows to set each tank level by double-clicking - so this is no problem to do. Basically you just define the sensitive area and its shape and what you want to see done.
Thorsten
 
Posts: 11190
Joined: Mon Nov 02, 2009 8:33 am

PreviousNext

Return to Canvas

Who is online

Users browsing this forum: No registered users and 1 guest