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 clm76 » Tue Sep 25, 2018 5:45 pm

Hi,

I am trying to install the FG1000 in a Citation XP : two PFD and one MFD.
The GDU-1045 have been added to the cockpit and are visible.

Then, I create in CitationXP/Nasal a file Fg1000.nas called by CitationXP-set.xml

The code of Fg1000.nas (inplemented from the wiki) :
Code: Select all
### FG1000 ###

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

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

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

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

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

But I get these errors when loading the aircraft :
############
# FG1000 #
############

PFD_Device: Error loading MAP - STORMSCOPE: svg layer StormscopeGroup
PFD_Device: Error loading MAP - WEATHER DATA LINK: svg layer WeatherDataLinkGroup
PFD_Device: Error loading MAP - TAWS: svg layer TAWSBGroup
PFD_Device: Error loading WPT - AIRPORT DIRECTORY: svg layer AirportDirectoryGroup
PFD_Device: Error loading WPT - AIRPORT DEPARTURE INFORMATION: svg layer AirportDepartureGroup
PFD_Device: Error loading WPT - AIRPORT ARRIVAL INFORMATION: svg layer AirportArrivalGroup
PFD_Device: Error loading WPT - AIRPORT APPROACH INFORMATION: svg layer AirportApproachGroup
PFD_Device: Error loading WPT - WEATHER INFORMATION: svg layer AirportWeatherGroup
PFD_Device: Error loading WPT - USER WPT INFORMATION: svg layer UserWPTInfoGroup
PFD_Device: Error loading AUX - TRIP PLANNING: svg layer TripPlanningGroup
PFD_Device: Error loading AUX - UTILITY: svg layer UtilityGroup
PFD_Device: Error loading AUX - GPS STATUS: svg layer GPSStatusGroup
PFD_Device: Error loading AUX - XM RADIO: svg layer XMRadioGroup
PFD_Device: Error loading AUX - XM INFORMATION: svg layer XMInfoGroup
PFD_Device: Error loading AUX - SYSTEM STATUS: svg layer SystemStatusGroup
PFD_Device: Error loading FPL - ACTIVE FLIGHT PLAN: svg layer ActiveFlightPlanWideGroup
PFD_Device: Error loading FPL - FLIGHT PLAN CATALOG: svg layer FlightPlanCatalogGroup
PFD_Device: Error loading FPL - STORED FLIGHT PLAN: svg layer StoredFlightPlanGroup
PFD_Device: Error loading NRST - NEAREST USER WPTS: svg layer NearestUserWPTGroup
PFD_Device: Error loading NRST - NEAREST AIRSPACES: svg layer NearestAirspacesGroup

And :
Nasal runtime error: No such member: sendFMSNotification
at /home/chris/fg2018_3/install/flightgear/fgdata/Aircraft/Instruments-3d/FG1000/Nasal/Interfaces/GenericFMSPublisher.nas, line 189

I am with Fg2018.3.0 and fgdata has been updated on September 21.
clm76
 
Posts: 149
Joined: Tue Oct 30, 2012 8:18 pm
Location: France - LFOH
Callsign: F-GCLM
Version: 2018.3.0
OS: Linux Mint 18.3

Re: Canvas G1000

Postby stuart » Tue Sep 25, 2018 7:34 pm

Hi Chris,

The first set of error messages are expected - they are pages that have not been implemented yet.

The second is a bug. I've just pushed a fix for this to fgdata: https://sourceforge.net/p/flightgear/fgdata/ci/b83b95751ff33aa675005b1d365903b08bf60c3d/.

Thanks for finding and reporting the problem. Please let me know if you have any other problems.

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

Re: Canvas G1000

Postby clm76 » Wed Sep 26, 2018 7:18 am

Hi stuart,

Bug corrected.

Other problems :
The screens are black : Image

and, when pushing one of the twelve left buttons an error occurs :
FG1000HardKeyPushed: No <offset> argument passed to fgcommand


The others give the error :
Nasal runtime error: No such member: FASCIA
at /home/chris/fg2018_3/install/flightgear/fgdata/Aircraft/Instruments-3d/FG1000/Nasal//MFDPageController.nas, line 122
called from: /home/chris/fg2018_3/install/flightgear/fgdata/Nasal/emesary.nas, line 110
called from: /home/chris/fg2018_3/install/flightgear/fgdata/Aircraft/Instruments-3d/FG1000/Nasal/Commands.nas, line 56


With
Code: Select all
fg1000system.displayGUI(1, 0.5);

the error is :
Nasal runtime error: No such member: getCanvas
at /home/chris/fg2018_3/install/flightgear/fgdata/Aircraft/Instruments-3d/FG1000/Nasal/FG1000.nas, line 159
called from: /home/chris/fg/My_Aircraft/CitationXP/Nasal/Fg1000.nas, line 23
clm76
 
Posts: 149
Joined: Tue Oct 30, 2012 8:18 pm
Location: France - LFOH
Callsign: F-GCLM
Version: 2018.3.0
OS: Linux Mint 18.3

Re: Canvas G1000

Postby stuart » Wed Sep 26, 2018 9:41 am

Hmmm.

I'm not at my FG computer right now so I can't immediately check what might be going wrong.

Have you tried the C182T (https://github.com/stuartbuchanan/c182s), and verified that is working? That would help give us a known-good state to compare against.

Thanks,

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

Re: Canvas G1000

Postby clm76 » Wed Sep 26, 2018 5:45 pm

Have you tried the C182T (https://github.com/stuartbuchanan/c182s), and verified that is working? That would help give us a known-good state to compare against.

Thanks for the link.
I modified my code by comparison with the C182T and now the screens are visible. Was missing in my code :
Code: Select all
fg1000system.show();

I found a bug in GDU104X/GDU-1045.3.xml :
It's necessary to replace
Code: Select all
<path>Model/GDU-104X.2.ac</path>

by
Code: Select all
<path>Model/GDU-104X.3.ac</path>

if not, the third screen is the same as the second.

Problem not yet found :
When pushing or rotating buttons (for example HDG), a nasal error occurs (not with the C182T).
Nasal runtime error: No such member: FASCIA
at /home/chris/fg2018_3/install/flightgear/fgdata/Aircraft/Instruments-3d/FG1000/Nasal//MFDPageController.nas, line 122
called from: /home/chris/fg2018_3/install/flightgear/fgdata/Nasal/emesary.nas, line 110
called from: /home/chris/fg2018_3/install/flightgear/fgdata/Aircraft/Instruments-3d/FG1000/Nasal/Commands.nas, line 56

I'm using GDU-1045 but it's the same problem with GDU-1040.

[EDIT] Solved : wrong reference of the nasal file (G1000.nas) in CitationXP-set.xml.
Code: Select all
 
<nasal>
....
  <fg1000>
        <file>Aircraft/CitationXP/Nasal/G1000.nas</file>
  </fg1000>
...

was not correct. Replaced by :
Code: Select all
  <nasal>
      <citation>
      ........
        <file>Aircraft/CitationXP/Nasal/G1000.nas</file>
     ......
    </citation>
  </nasal>

"<fg1000>" conflicts with the fg1000 code.
clm76
 
Posts: 149
Joined: Tue Oct 30, 2012 8:18 pm
Location: France - LFOH
Callsign: F-GCLM
Version: 2018.3.0
OS: Linux Mint 18.3

Re: Canvas G1000

Postby stuart » Sun Sep 30, 2018 8:54 pm

Ah. Very good spot. A find/replace error. I'll get it corrected.

Can I just check - you are no-longer seeing the "No such member: FASCIA" error now? I'll put a note in the wiki page about not naming the module fg1000 :)

Thanks,

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

Re: Canvas G1000

Postby Necolatis » Mon Oct 01, 2018 3:48 am

Sorry, if this has been asked before.
What is the most elegant way of preventing G1000 from the debug menu to work? (I want the pilot to use the plane's displays, not the G1000)
"Airplane travel is nature's way of making you look like your passport photo."
— Al Gore


Hangar: https://sites.google.com/site/fghangar/
User avatar
Necolatis
 
Posts: 1907
Joined: Mon Oct 29, 2012 12:40 am
Location: EKOD
Callsign: Leto
IRC name: Neco
Version: 2018.3.2
OS: Windows 10

Re: Canvas G1000

Postby Thorsten » Mon Oct 01, 2018 5:19 am

Disable/overwrite the menu item? Like several planes use a custom fuel dialog rather than the default one?
Thorsten
 
Posts: 10639
Joined: Mon Nov 02, 2009 8:33 am

Re: Canvas G1000

Postby clm76 » Mon Oct 01, 2018 5:54 am

stuart wrote in Sun Sep 30, 2018 8:54 pm:Can I just check - you are no-longer seeing the "No such member: FASCIA" error now?

It's correct now, no FASCIA error.

For information, I corrected the Fg1000 Wiki by changing "GDU-1054" by "GDU 1045" (Add the GDU to the cockpit) and by adding a "fg1000system.show" (Load and start the FG1000 system) to prevent a black screen for newbies.
On my plane, i'm using a "setlistener" like the C182T.
clm76
 
Posts: 149
Joined: Tue Oct 30, 2012 8:18 pm
Location: France - LFOH
Callsign: F-GCLM
Version: 2018.3.0
OS: Linux Mint 18.3

Re: Canvas G1000

Postby stuart » Mon Oct 01, 2018 9:59 am

@Necolatis : I should probably just remove the FG1000 from the Debug menu completely, and add some code to automatically add it to the Equipment menu when the FG1000 is instantiated. That way it would only be present for aircraft that have it installed. On the other hand, I don't think the Debug menu is used by most users (is it even visible?) and it is quite neat to have available for things like the ufo.

@clm76: That's great. Do let me know if you have any feedback or would like to contribute to the FG1000. It would be also be great to have the Citation with the FG1000 in fgaddon when you feel it is ready.

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

Re: Canvas G1000

Postby legoboyvdlp » Mon Oct 01, 2018 11:43 am

I think Necolatis is a bit concerned about people using it during OPRF events to get an unfair advantage?
Overwriting the menu should probably work, the Q400-jsb does it, for example. You could replace the binding with a code that triggers the anti-cheat part of our damage code :P
User avatar
legoboyvdlp
 
Posts: 6728
Joined: Sat Jul 26, 2014 1:28 am
Callsign: YV-LEGO
Version: 2018.3.1
OS: Windows 10 HP

Re: Canvas G1000

Postby Hooray » Sun Oct 07, 2018 3:18 pm

I believe we'd be deluding ourselves thinking that removal of the menu item would make the device unavailable.
Anyone able to follow the tutorial or with a bit of Nasal knowledge, should be able to restore the device within a few minutes, and possibly even add to it whatever they deem useful to "cheat".

Using the term "anti-cheat" when it comes to FlightGear is massively misleading and begging for trouble, fgfs is designed to be entirely open, and everything that people are using to fly via MP is also entirely open, so don't even think about about "cheating", it simply isn't worth it, unless you want to remove the property tree and Nasal (for starters).

Besides, the FG1000 (at least in its current form) is de-facto designed to be an online-tool - many of its features (read layers) are kinda useless without having a fast internet connection and withough being online - which makes it such a great asset when it comes to MP.

Obviously, charts are not necessarily in line with fgfs scenery unfortunately.

Unfortunately, the increasing focus on features with such implicit design assumptions also means that -at least to some degree- old fgfs versions may stop functioning, once some implicit/hard-coded defaults get outdated, so that tile servers/mapservers (think URLs) may no longer work.

In addition, like I repeatedly said elsewhere, our current type/nature and degree of use may often be rather controversial, if not even in violation of the TOS of the entities running such a mapserver, referring to Phi specifically: phi charts us sectionals...

For that to change, fgfs would have to create its own charts on the fly and provide those via Torsten's bult-in mongoose httpd, so that fgfs would -again- become self-contained, not just on technical grounds, but also legal ones - quoting TorstenD:

Atlas still in use ?
Torsten wrote:I'd really like to use the Atlas generated maps as a layer in the browser map. Is anybody out there looking for an adventure and is able to modify the Atlas map generator to generate maps on-the-fly? Input would be three parameters: z/x/y where z is the zoom level and x/y are numeric parameters describing latitude and longitude (based on image size). Output should be a generated tile of 256x256 and format png in a memory buffer.

This could be compiled as a Apache httpd module (like osm's "renderd") or linked against a standalone webserver to akt as a tileserver for any openlayers compatible map.

Torsten
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: 11317
Joined: Tue Mar 25, 2008 8:40 am

Re: Canvas G1000

Postby Valafenn » Tue Oct 30, 2018 7:27 am

Good morning gents

First i wish to thank you for the work you've done.

I have downloaded the "nightly" release of FGFS, and made a trial on Piper PA-32...

Image
Image

The questions are :
- How to edit and store an adapted EIS (maybe in the plan's folder, but how it can works with the /usr/share/games/flightgear/Aircraft/Instruments-3d/FG1000/Nasal/ folder ?)
- How can we light the button (it is not visible in night period, for the moment i use crtl+C :roll: ) ?
- I placed many switch panel, i'd to focus ones with gear/flap and heat/lights/pressurization switch, may it will be useful

I have also made a trial on the Mirage IV (dreaming SSBJ :D )

Image
Image

The questions are :
- Why the PFD ground inclination does not work well at high altitude (more than 25000 ft) ?
- It is possible that PFD show a Mach number (maybe a cell on top of the speed barr) ?
- Concerning the four MFD screen, i whish to make it
- the map
- the reflief
- the engines parameters and fuel
- a panel with procedures / flight plan / mission plan

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

Re: Canvas G1000

Postby Hooray » Tue Oct 30, 2018 4:23 pm

@Stuart: Just so that you are aware: ThomasS has created a custom MapStructure layer to visualize airport groundnets - to me, it's looking fairly good, but it's currently shipped as part of the GroundServices "addon" only. I think that this could be a very useful addition to the library of MapStructure layers - and given your recent work in that area, I'd suggest to take a look and consider merging this into fgdata, so that this work can be used elsewhere, without it being specific to a certain addon only, and without it having to be duplicated via copy/paste, which would be against the design/purpose of the MapStructure framework.

Furthermore, this is an "offline" layer, in the sense that it will also work for people without having to be online, i.e. it is procedurally created via Nasal/Canvas, and isn't just downloading/displaying external data that may sooner or later get out of date, or become unavailable altogether.

http://wiki.flightgear.org/Ground_Services#Canvas_Map
http://wiki.flightgear.org/Talk:Ground_Services
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: 11317
Joined: Tue Mar 25, 2008 8:40 am

Re: Canvas G1000

Postby legoboyvdlp » Tue Oct 30, 2018 4:40 pm

That might be useful for such things as this:

Image
User avatar
legoboyvdlp
 
Posts: 6728
Joined: Sat Jul 26, 2014 1:28 am
Callsign: YV-LEGO
Version: 2018.3.1
OS: Windows 10 HP

PreviousNext

Return to Canvas

Who is online

Users browsing this forum: No registered users and 1 guest