Board index FlightGear Development Canvas

Canvas G1000

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: Canvas G1000

Postby stuart » Fri Feb 16, 2018 4:52 pm

Hi All,

I've had a look at the zvk1000 and the PFD SVG file looks like exactly what I need - the differences between it and the G1000 are minimal.

So I think there is no need for you to work further on a PFD display.

Thanks for pointing it out to me.

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

Re: Canvas G1000

Postby stuart » Thu Mar 08, 2018 12:56 pm

Hi All,

(Cross-post from the -devel mailing list)

Earlier in the week, I pushed some significant updates to the FG1000 to fgdata.

1) I've added the PFD. Most of the instruments are functional with the exception of the CDI for NAV radios which I've still to finish. particularly pleased with the inset map (press the INSET softkey). Many thanks to
Sebastian Marque who wrote the zkv1000, and whose SVG and display codeI was about to re-use.

2) Proper 3D instruments are now available, so the FG1000 can be added to the cockpit of aircraft. Many thanks to Jean-Paul Anceaux for these.

3) I've cleaned up some of the interfaces so that you can easily create a UI dialog that mirrors one of the aircraft PFD/MFDs.

There's still a lot of work to do, but it's now suitable for VFR flying, and getting close to the stage where there's sufficient function working that a user could use it for IFR flying, if not editing IFR flightplans.

The current status is available here: http://wiki.flightgear.org/FG1000

There are instructions on the wiki and in the README files on how to add the FG1000 to aircraft for those interested.
G-MWLX
User avatar
stuart
Moderator
 
Posts: 1423
Joined: Wed Nov 29, 2006 9:56 am
Location: Edinburgh
Callsign: G-MWLX

Re: Canvas G1000

Postby Hooray » Fri Mar 09, 2018 2:52 pm

Glad to see that you could get the inset map working - so far, we're under the assumption that a number of hard-coded assumptions at the MapStructure level would conflict with that ?
Did you customize any of those settings, e.g. resolution of the texture, clipping etc ?
I am asking because I'd expect an inset map to require a much lower resolution/size, which could also translate into tangible performance improvements.

FWIW, we were at some point hoping to introduce the equivalent of a "LayerCache" MapStructure MVC framework, to be able to cache certain queries and reuse those in related/similar maps - at the time, we were thinking of multiple instruments/maps showing related information just with different ranges/settings selected - possibly 2 screens (maps) per pilots.

The idea was to only run the broadest navcache queries and filter symbols based on the map's settings (range, offset, orientation)

This would be the equivalent of a "data provider" for navcache queries - i.e. instead of running identical navcache queries for different ranges/positions, we'd run a broader one and filter afterwards in Nasal space.

Especially some of the heavier layers could benefit from that (again, just an assumption).

Another optimization that we were talking about is putting navaids into range-based Canvas groups to be able to better/more easily filter at the Canvas level without having to go through Nasal space - e.g. at the mere cost of calling .show()/.hide() on circular ranges around the aircraft, which should mean having to do less work.
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: 11123
Joined: Tue Mar 25, 2008 8:40 am

Re: Canvas G1000

Postby it0uchpods » Fri Mar 09, 2018 4:45 pm

Fantastic work Stuart... :mrgreen:

Your work will be appreciated for many GA aircraft.

Kind Regards,
Josh
it0uchpods/WTF411

FGFS Aircraft Developer
Lead Programmer at it0uchpods Design Group
Download High Quality Aircraft from it0uchpods Hangar
User avatar
it0uchpods
 
Posts: 3468
Joined: Tue Oct 06, 2015 12:51 pm
Version: 2018.2.1
OS: Windows 10 x64

Re: Canvas G1000

Postby Hooray » Sun Mar 11, 2018 6:56 pm

Here's a screenshot showing Stuart's latest work on the PFD and its inset map (added to the newsletter/changelog respectively):

http://wiki.flightgear.org/FlightGear_N ... 00_Updates
Image
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: 11123
Joined: Tue Mar 25, 2008 8:40 am

Re: Canvas G1000

Postby Michat » Sun Mar 11, 2018 8:26 pm

Cool eh ¡

Please notice that the HSI stuart is using doesn't match 100% . See HSI dots, aircraft icon and bug indicator. Post ago I shared with you amended HSI version of the original one by Zakharov. It seems Stuart is carrying those errors by adopting zhaka's design.

@stuart you can use my modified version of the HSI with zero problem, as is exactly the same dimension.

the file containing da HSI is called garmin1000bcleanpfd.svg

Cool eh ¡
User avatar
Michat
 
Posts: 923
Joined: Mon Jan 25, 2010 6:24 pm
Location: Spain
Version: 191b
OS: GNewSense

Re: Canvas G1000

Postby Hooray » Mon Mar 12, 2018 3:54 pm

things like the HSI (or speed/altitude ladder/tape) could actually live in their own SVG file and just be included - that would make it much easier to use such components elsewhere.
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: 11123
Joined: Tue Mar 25, 2008 8:40 am

Re: Canvas G1000

Postby stuart » Tue Mar 13, 2018 10:34 am

@Hooray. Taking each of your comments in turn:
[list=]
[li] Thanks for the screenshot. I'm my own worst enemy for not providing media showing my work :).
[li] So far I haven't had any problems with hardcoded assumptions in the MapStructure layer. As you'll have seen, I've abstracted out a NavMap with the control logic for both the MFD map and the PFD inset map (though I've still to use it for the former). There is definitely room to improve performance with resolution/clipping of the SlippyMap layers, but I'm not seeing much perf impact running the inset may on my (admittedly fairly powerful) machine.
[li] Yes, the HSI, tapes etc could be extracted into separate svg files along with some control logic. They are fairly complicated (I can't take any credit for them - it's all from the zvk1000), so that would be worth doing.
[/list]

I'm going to create a short TODO list for architectural improvements to make on the wiki page.

@Michat - Hadn't spotted that. Thanks! I'll get it corrected tonight.

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

Re: Canvas G1000

Postby Richard » Tue Mar 13, 2018 12:04 pm

Here's another one that I grabbed when Stuart was showing me the FG1000 about a week ago.

Image
Richard
 
Posts: 601
Joined: Sun Nov 02, 2014 10:17 pm
Version: Git
OS: Win10

Re: Canvas G1000

Postby Hooray » Tue Mar 13, 2018 5:55 pm

I think having some kind of architectural todo list sounds like a good idea.
To be honest, I did notice some lag here using the device, so I guess it will be interesting to profile/benchmark the whole thing - on really powerful computers like you have, possibly using running multiple instances side-by-side to see what can be done.
There are other ways to do stress-tests even on powerful computers, e.g. accelerating sim-time

That is why I previously suggested using fgtapes and/or flight plans to do semi-automated scripted flights.
For stress-testing the MapStructure system, we ended up using a "driver hash" that would use arbitrary AI traffic nodes - so that different positions/maps were shown.
Given your use of the Emesary framework, it would seem pretty straightforward to drive the instrument from another source ?

It might also be interesting to add OSG StatsHandler based stats to canvas, so that we can see what is going on.
Obviously, that's touching C++ code - but sooner or later, it will make sense to look at the C++ side of things.

Regarding the HSI, I believe that Thorsten has code to draw such stuff procedurally (?)

PS: I've added Richard's screen shot to the wiki article, so that it can be used for the newsletter/changelog (mine was taken using the ufo ...)
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: 11123
Joined: Tue Mar 25, 2008 8:40 am

Re: Canvas G1000

Postby Michat » Thu Mar 15, 2018 5:35 pm

I see that the G1000 interface that Stuart and Richard have shown still is the old version.

I wonder if you guys have knowledge that I provided amended design. See in the next picture SD card Slot and some tags (see Range and Push PAN) re-aligned after some manipulation by Stuart over the right column.

Image


Thanks and 29.92 for you.

EDIT. Is also available the second bug (go around bug indicator) missing in the zakha's design.
User avatar
Michat
 
Posts: 923
Joined: Mon Jan 25, 2010 6:24 pm
Location: Spain
Version: 191b
OS: GNewSense

Re: Canvas G1000

Postby stuart » Fri Mar 16, 2018 1:38 pm

Hi Michat,

When I get the chance I'll apply the update interface skin. Thanks.

I also had a look at the updated HSI icons you mentioned. I'm slightly confused, as the manual I'm looking at has circular "dots" for the HSI, rather than the angled ones you've updated. Are we perhaps looking at different versions of the G1000 display?

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

Re: Canvas G1000

Postby Michat » Fri Mar 16, 2018 7:22 pm

Howdy Stuart.

Uhh. Surprise ¡ So, it seems several styles of dots for the HSI exist. I did use an official-generic G1000 videotube. Also I watched many videos , it seems there are many G1000 interfaces adoptions ( product line ). As you can see I took the button less one.

Being G1000 "Res skinable", I guess those dots styles could be related with skin-themed PFD. So we have a complete set. :)

Stuart it's up to you to use what ever you like, or both if we go finest.

Improved is the bug heading indicator, please use it because the zhaka's one doesn't match with the HSI disk arc, resulting in crispy aliasing when overlapping (always).


Go for the best solution for you.

Time is money. Code is Gold.

Thanks.
User avatar
Michat
 
Posts: 923
Joined: Mon Jan 25, 2010 6:24 pm
Location: Spain
Version: 191b
OS: GNewSense

Re: Canvas G1000

Postby Valafenn » Sat May 26, 2018 6:42 am

Hello,

I'm a newbie on fgfs, and try to understand how it works.

So following the wikipage (http://wiki.flightgear.org/FG1000#Aircraft_Installation), I tried to install FG1000 into a panel in an existing aircraft (Piper Pa-32).

The configuration is
xubuntu 18.04
/sim/fg-root = /usr/share/games/flightgear/
fgfs data = /home/***/.fgfs/
my dedicated hangar to test = /home/***/Desktop/FLIGHTGEAR/MY_HANGAR/

FG1000 installation
In the dedicated Hangar, I create a ./Instruments3d/FG1000 repository
Should i get the dedicated xml files for the panel.xml from ./Instruments3d/FG1000 repository or from /usr/share/games/flightgear/Aircraft/Instruments-3d/FG1000/

In the dedicated_aircraft/nasal/
the "Loader_fg1000.nas" is placed with the following commands
Code: Select all
var nasal_dir = getprop("/sim/fg-root") ~ "/Aircraft/Instruments-3d/FG1000/Nasal/";
io.load_nasal(nasal_dir ~ 'Interfaces/GenericInterfaceController.nas', "fg1000");

var interfaceController = fg1000.GenericInterfaceController.getInstance();
interfaceController.start();

var nasal_dir = getprop("/sim/fg-root") ~ "/Aircraft/Instruments-3d/FG1000/Nasal/";
io.load_nasal(nasal_dir ~ 'FG1000.nas', "fg1000");

# Create the FG1000
var fg1000system = fg1000.FG1000.getInstance();

# Create a PFD as device 1, MFD as device 2
#fg1000system.addPFD(1);
fg1000system.addMFD(2);

# Display the devices
fg1000system.display(1);
fg1000system.display(2);


Code: Select all
var interfaceController = fg1000.GenericInterfaceController.getOrCreateInstance();
doesn't exist, should be replaced by
Code: Select all
var interfaceController = fg1000.GenericInterfaceController.getInstance();


in the FG1000.nas, there is no command .addPFD

The nasal consol gives
Code: Select all
unable to find ActiveFlightPlanWide at /usr/share/games/flightgear/Nasal/global.nas, line 36
called from: /usr/share/games/flightgear/Aircraft/instruments-3d/FG1000/Nasal/MFDPages/surround/Surround.nas, line 130
called from: /usr/share/games/flightgear/Aircraft/instruments-3d/FG1000/Nasal/MFD.nas, line 120
called from: /usr/share/games/flightgear/Aircraft/instruments-3d/FG1000/Nasal/FG1000.nas, line 109
called from : <nasal-console/#1>, line 15


and when the buttons are pressed
Code: Select all
FG1000hardJeyPushed : No <offset> argument passed to fgcommand
PFD_Device: Could not locate page for button


So i do not understand how to create a good nas commands (separate file, where to include the load and start code, before modify the parameters to fit the aircraft).

It could be a great help if it exists an available aircraft with the FG1000 (for the moment the extra 500 panel can be copied, but it is not the FG1000, lol), and if possible a FG2000, FG3000 and FG5000 panels.

Many thanks.
Valafenn
 
Posts: 2
Joined: Sat May 26, 2018 6:23 am

Re: Canvas G1000

Postby stuart » Thu Jun 07, 2018 5:10 pm

Hi,

Apologies for the delay in responding, and thanks very much for trying to get the FG1000 to work. I'd really like to encourage people to try to integrate it so I can find out and resolve any issues. So if you have any problems, please do get in touch!

You shouldn't have to copy any of the FG1000 files into your dedicated hangar, and should just reference the code in /usr/share/games/flightgear/Aircraft/Instruments-3d/FG1000/

What version of FlightGear are you running? (Select Help->About). The code changed from "getInstance()" calls to "getOrCreateInstance()" calls on 18th February, which suggests you're using 2018.1? I'd recommend upgrading to the latest release, as there's been quite an improvement since.

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

PreviousNext

Return to Canvas

Who is online

Users browsing this forum: No registered users and 2 guests