Board index FlightGear Development Aircraft Cockpit development

2D Panel

Discussion about creating 2d and 3d cockpits.

2D Panel

Postby Octal450 » Sat Dec 16, 2017 3:28 pm

In addition to the Virtual Cockpit, I want to have a 2D panel in my Airbus' for users who cannot graphically use the Virtual Cockpit with good frames, or coming from FSX or such, may prefer 2D panels.

But, none of those stupid panels cover the whole screen that you cannot see out of, there should be multiple panels, like Main, First Officer, Overhead, Pedestal.

Where can I find more info on 2D panels? I do not see much info on the wiki. Is it possible to have multiple 2D panels like I describe above? Can I place Canvas instruments into the 2D, like they get mapped to a 3D object?

Kind Regards,
Josh
Waste of time. Goodbye forever.
Octal450
 
Posts: 4398
Joined: Tue Oct 06, 2015 12:51 pm

Re: 2D Panel

Postby Hooray » Sat Dec 16, 2017 4:21 pm

yeah, you can use different 2D panels - they can be switched easily, too - best to refer to the 2D panel of the c172p (reference plan).
I am not sure if anyone has previously created a 2D panels with canvas textures - but it should be possible actually, but it's been years since I looked at the 2D panel stuff.
The C++ code should be easy enough to extend to make this work (if necessary).

However, to be perfectly honest - I would tackle the whole thing differently, and just use a conventional Canvas GUI dialog and set up your 2D panel inside that - you can load existing textures and other artwork just fine, with a little Nasal coding you could even set up the animation logic automatically:

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

Note that there is no reason why you should not be able to also load other 2D instruments into the same dialog, and change the dialog decoration/transparency as you see fit.
In other words, my suggestion would be to let the 2D panel stuff alone, and just use a conventional Canvas GUI dialog, and load 2D instruments into that - or create new ones from scratch using conventional Inkscape/GIMP images.

That should be pretty straightforward to do - if you'd like to use existing 2D instruments, it would be much easier to code a simple parser that loads the XML file and maps that to a handful of Canvas primitives, analogous to svg.nas (or the pui2canvas parser).

For starters, see:
https://sourceforge.net/p/flightgear/fg ... E.xmlpanel
https://sourceforge.net/p/flightgear/fg ... .minipanel


In addition, do note that the 2D panel stuff is considered to be legacy code that is in the process of being revamped by James, as part of unifying the 2d rendering back-end: http://wiki.flightgear.org/Unifying_the ... via_canvas

His most recent comments related to this are quoted below:
http://wiki.flightgear.org/Canvas_News#2D_Panels
James wrote:James has done most of the work to port the 2D panels to use Canvas, and will do the C++ HUD next, and hence is creating Canvas elements bypassing the Nasal API


Do note however that the approach that is taken now is not in line with the original consensus on the devel list to come up with a Nasal space parser and augment the Canvas C++ code as necessary, so that the 2D panel back-end would become maintainable by fgdata contributors - so, I am not sure if James has meanwhile shared any of this code or not, since it seems he's using a pure C++ approach instead of a scripted parser. If in doubt, I'd suggest getting in touch via the devel list, because this is something that James mentioned being working on (on/off) over the years - so better to discuss this before duplicating effort here.

But again, writing a Nasal space parser to map the existing 2D panel stuff to Canvas primitives would be pretty straightforward actually.
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: 11376
Joined: Tue Mar 25, 2008 8:40 am

Re: 2D Panel

Postby V12 » Sat Dec 16, 2017 6:03 pm

it0uchpods :
Download default Concorde from fgaddons, there are some 2D panels :

Image

Image
Fly high, fly fast - fly Concorde !
User avatar
V12
 
Posts: 1607
Joined: Thu Jan 12, 2017 4:27 pm
Location: LZIB
Callsign: BAWV12

Re: 2D Panel

Postby OO-GPM » Mon Feb 12, 2018 2:31 pm

it0uchpods:

I was wondering if you've made any progress with 2d panels in canvas?
I'm a fan of 2d panels and curious to experiment with canvas to develop them for a few aircrafts in FG.

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

Re: 2D Panel

Postby Octal450 » Mon Feb 12, 2018 2:52 pm

Hi,
I have not toyed with them yet.

Kind Regards,
Josh
Waste of time. Goodbye forever.
Octal450
 
Posts: 4398
Joined: Tue Oct 06, 2015 12:51 pm

Re: 2D Panel

Postby Thorsten » Mon Feb 12, 2018 6:15 pm

I was wondering if you've made any progress with 2d panels in canvas?


Be a bit patient, I'm currently rolling out a toolkit to give you something like this

Image

in canvas (you need to bring the artwork as images) - with this you'll be able to do any panel you like easily.
Thorsten
 
Posts: 11203
Joined: Mon Nov 02, 2009 8:33 am

Re: 2D Panel

Postby Octal450 » Mon Feb 12, 2018 8:41 pm

Hi Thorsten,
That is fantastic!

What about the performance hit?

Kind Regards,
Josh
Waste of time. Goodbye forever.
Octal450
 
Posts: 4398
Joined: Tue Oct 06, 2015 12:51 pm

Re: 2D Panel

Postby Hooray » Mon Feb 12, 2018 8:44 pm

Why do you expect any signfiicant performance drops, given that a typical MFD is more dynamic than a GUI dialog showing a few animated values/gauges ?
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: 11376
Joined: Tue Mar 25, 2008 8:40 am

Re: 2D Panel

Postby Thorsten » Tue Feb 13, 2018 6:40 am

What about the performance hit?


It's pretty much like a canvas instrument - depends all on update rate and on property I/O. If you're trying to cram 5000 properties into a page, it's going to be heavy, if you want to show ~ 10 instruments it's going to be light.

The advantage as compared to a 3d cockpit is that you can tab and only update what's on the current tab.
Thorsten
 
Posts: 11203
Joined: Mon Nov 02, 2009 8:33 am

Re: 2D Panel

Postby legoboyvdlp » Mon Feb 26, 2018 2:39 pm

I take it that it no longer covers the entire screen of your computer?
User avatar
legoboyvdlp
 
Posts: 7183
Joined: Sat Jul 26, 2014 1:28 am
Callsign: YV-LEGO
Version: next
OS: Windows 10 HP


Return to Cockpit development

Who is online

Users browsing this forum: No registered users and 1 guest