Board index FlightGear Development Canvas

Form follows function: Canvas Inkscape Extension (WIP)

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.

What kind of features should such an Inkscape extension provide ?

Poll ended at Tue Mar 06, 2018 9:19 pm

Support for creating MFDs (MFD pages and elements)
1
20%
Support for the Emesary framework
0
No votes
Support for the MapStructure framework
1
20%
Support for growing a library of reusable MFD elements
1
20%
Support for low-level Canvas primitives (text, image, path, map)
0
No votes
Support for live-interfacing with fgfs, e.g. to preview/test MFDs interactively
1
20%
Other (please provide additional information in your response below)
1
20%
 
Total votes : 5

Form follows function: Canvas Inkscape Extension (WIP)

Postby Hooray » Fri Jan 05, 2018 9:19 pm

Hooray wrote:http://wiki.flightgear.org/FG1000
Stuart wrote: ... pretty happy with the overall architecture now, so if anyone wants to create some of the pages they are very welcome to do so


This was originally mentioned by TheTom (Canvas) - i.e. using a custom Inkscape extension (probably written in Python) to create Canvas resources for different avionics/MFDs procedurally, i.e. with some kind of wizard:

QML and other GUI markup languages
TheTom wrote:For cockpit instruments using Inkscape with maybe a plugin will probably fit better. I'm always looking for any suggestions and ideas :)



Given that Stuart has now made so much progress with the FG1000, I was wondering if you (Stuart) could help identify some "generic" building blocks that could serve as a template for some kind of semi-automated page creation/customization ?

Note that this was one of the primary reasons why I suggested to make animation stuff a first-class concept, i.e. so that we can support it trivially without the Inkscape extension having to know anything about FlightGear/Canvas or Nasal scripting.

For starters, it would be helpful to have some boilerplate XML code (SVG) and the Nasal boilerplate binding everything together - such an extension would be simple to write, and it could help bootstrap not just the FG1000, but also the extension itself, given that we have so many contributors around here who are obviously familiar with Python.

I am sure that you can come up with a few ideas on how something like this could be useful ?

Like I said, for now, it should suffice to come up with a simple wizard that would help create MFD pages procedurally using a template and a few custom inputs, to get the whole thing going.

Based on a few experiments I did, even just spending a single weekend refining the plugin should be much less work than creating all remaining pages from scratch, what do you think ?

Note that I am not asking you here to do anything at this point, other than provide a little feedback - I am prepared to come up with a useful prototype and "relese this into the wild" to see if/how this may prove to be useful over time.

http://wiki.flightgear.org/Howto:Hackin ... as_support
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: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Re: Form follows function: Canvas Inkscape Extension (WIP)

Postby stuart » Sat Jan 06, 2018 5:30 pm

Hi Hooray,

I think this could be very interesting.

I've created some primitives in Nasal/canvas/PFD. Just having some python to auto-generate the appropriate SVG elements for the DataEntryElement and GroupElements (which have very specific naming requirments) would be useful.

I think more will become apparent as I create further pages - I'll pay attention to what takes the time.

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

Re: Form follows function: Canvas Inkscape Extension (WIP)

Postby Hooray » Sat Jan 06, 2018 5:34 pm

thanks, like you say, it would be most useful to identify recurring steps and "patterns" - i.e. anything that could benefit from being semi-automated using a simple "wizard".
I have also been in touch with Richard to see if it makes sense exploring if Emesary could be directly support - either at the DOM level (SVG events) or using a separate PropertyList/XML to contain a mapping to SVG IDs and "events".

The way inkscape extensions work, it is pretty straightforward to get a handle to the document's DOM and insert/modify custom DOM elements there, which is where I think it would be most useful to have a few "template files" that would then be dynamically customized using a few placeholder variables that are then procedurally filled in with values from the wizard/UI dialog.

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: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Re: Form follows function: Canvas Inkscape Extension (WIP)

Postby Michat » Sat Jan 20, 2018 5:09 pm

I vote for other. Clock generator.
User avatar
Michat
 
Posts: 1226
Joined: Mon Jan 25, 2010 7:24 pm
Location: Spain
Version: 191b
OS: MX 21 Fluxbox oniMac

Re: Form follows function: Canvas Inkscape Extension (WIP)

Postby jsb » Sun Apr 15, 2018 11:14 pm

I wonder what those nasal*stub options are? Any wiki pages I should read on that topic? :)
jsb
 
Posts: 285
Joined: Sat Oct 25, 2014 9:17 pm
Location: Hamburg, Germany
Callsign: D-JSB
Version: next
OS: Win7/Linux


Return to Canvas

Who is online

Users browsing this forum: No registered users and 5 guests