Board index FlightGear Development Canvas

svg.nas in v2016.4.3 ,bug or intentionally modified ?

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.

svg.nas in v2016.4.3 ,bug or intentionally modified ?

Postby yanes » Tue Dec 20, 2016 12:26 am

Hi guys ,
while developping the Su-27SK canvas hud on the 3.4 (ubuntu x64) , every thing was going well , and my HUD seem to work as expected ,
today (as of Dec 20, 2016),I did the step forward and updated to "2016.4.3" , honestly , I loved it !!
but my HUD didn't work and only the cavas paths elements was shown ,
the console showed the following :
Code: Select all
parsesvg: non-scalar in string context
  at /usr/share/games/flightgear/Nasal/canvas/svg.nas, line 540
  called from: /usr/share/games/flightgear/Nasal/canvas/svg.nas, line 723
  [path='/usr/share/games/flightgear/Aircraft/SU-27SK/Models/Interior/Instruments/hud/hudSymbol.svg']
Failed to locate heading-scale in SVG
Failed to locate Nav-director in SVG
Failed to locate Rdr-Indicator in SVG
Failed to locate accel-pointer in SVG
Failed to locate tgt1-marker in SVG
Failed to locate tgt2-marker in SVG
Failed to locate tgt3-marker in SVG
Failed to locate tgt4-marker in SVG
Failed to locate tgt5-marker in SVG
Failed to locate tgt6-marker in SVG
Failed to locate tgt7-marker in SVG
Failed to locate tgt8-marker in SVG
Failed to locate tgt9-marker in SVG
Failed to locate tgt10-marker in SVG
Nasal runtime error: non-objects have no members
  at /usr/share/games/flightgear/Aircraft/SU-27SK/Nasal/hud.nas, line 226
  called from: /usr/share/games/flightgear/Aircraft/SU-27SK/Nasal/hud.nas, line 408
  called from: /usr/share/games/flightgear/Nasal/globals.nas, line 119


It was clear that the new svg has some problems and the line 540 mentioned in the console (and it's containing method) seems to be fine
so I downloaded thev3.4 svg.nas and replaced the
file shipped along with v2016.4.3 , and every thing went back to normal work and No errors were reported (neither the hud or any other file ) ,
so what to do now ?
Thanks in advance ,

some scrshots :

My working HUD(with replaced svg.nas from FGv3.4):
Image
what I get with the v2016.4.3 svg.nas :
Image

Please, I need some other members to test and report the results ,

Regards,
Yanes ,
Last edited by yanes on Tue Jan 03, 2017 6:23 am, edited 2 times in total.
User avatar
yanes
 
Posts: 135
Joined: Tue Sep 02, 2014 2:14 pm
Location: Tunisia
Callsign: YANES
Version: 2018.2.2
OS: Linux

Re: svg.nas in v2016.4.3 ,bug or intentionally modified ?

Postby zakalawe » Tue Dec 20, 2016 2:06 am

Can you share the hud.nas file? And the accompanying SVG too.
zakalawe
 
Posts: 1259
Joined: Sat Jul 19, 2008 5:48 pm
Location: Edinburgh, Scotland
Callsign: G-ZKLW
Version: next
OS: Mac

Re: svg.nas in v2016.4.3 ,bug or intentionally modified ?

Postby yanes » Tue Dec 20, 2016 5:35 pm

Thanks for replying zakalawe ,
this zip contains the hud.nas & the svg symbols file
https://drive.google.com/file/d/0B9hT-m ... sp=sharing
User avatar
yanes
 
Posts: 135
Joined: Tue Sep 02, 2014 2:14 pm
Location: Tunisia
Callsign: YANES
Version: 2018.2.2
OS: Linux

Re: svg.nas in v2016.4.3 ,bug or intentionally modified ?

Postby zakalawe » Tue Dec 20, 2016 6:11 pm

Thanks - got quite a backlog of things to look at but will try to find time this week!
zakalawe
 
Posts: 1259
Joined: Sat Jul 19, 2008 5:48 pm
Location: Edinburgh, Scotland
Callsign: G-ZKLW
Version: next
OS: Mac

Re: svg.nas in v2016.4.3 ,bug or intentionally modified ?

Postby yanes » Tue Dec 20, 2016 10:20 pm

Ok buddy ,
But I still advice to look first at the changes committed to svg.nas in the two versions ,
I have the NavDiplaly framework (which uses svg graphics as well ) and they are all working well with the V3.4 svg.nas
Regards
User avatar
yanes
 
Posts: 135
Joined: Tue Sep 02, 2014 2:14 pm
Location: Tunisia
Callsign: YANES
Version: 2018.2.2
OS: Linux

Re: svg.nas in v2016.4.3 ,bug or intentionally modified ?

Postby yanes » Wed Jan 04, 2017 2:36 am

No solution yet ?
Please, I need some other members to test and report the results ,

Regards,
Yanes ,
User avatar
yanes
 
Posts: 135
Joined: Tue Sep 02, 2014 2:14 pm
Location: Tunisia
Callsign: YANES
Version: 2018.2.2
OS: Linux

Re: svg.nas in v2016.4.3 ,bug or intentionally modified ?

Postby zakalawe » Thu Jan 05, 2017 3:56 pm

Sorry I ran out of time, taking a look now. But, I could use some hint, how to actually test - do I need to install the Su-27 or can I test with the UFO?
zakalawe
 
Posts: 1259
Joined: Sat Jul 19, 2008 5:48 pm
Location: Edinburgh, Scotland
Callsign: G-ZKLW
Version: next
OS: Mac

Re: svg.nas in v2016.4.3 ,bug or intentionally modified ?

Postby yanes » Fri Jan 06, 2017 6:33 pm

You can test even with a bicycle :D :D , by changing 3 props in the hud.nas .

BTW, I tried to create a new HudSymbols.svg (from scratch) using inkscape 0.92 and the problem was persisting .
So is there a specific requirement or I need a specific Inkscape version .
since the F-15 & F-16 was working so I modded the the F-15 hud.svg .
the question now is : Why this svg works and the others sucks ?
User avatar
yanes
 
Posts: 135
Joined: Tue Sep 02, 2014 2:14 pm
Location: Tunisia
Callsign: YANES
Version: 2018.2.2
OS: Linux

Re: svg.nas in v2016.4.3 ,bug or intentionally modified ?

Postby Thorsten » Fri Jan 06, 2017 7:13 pm

It's only certain elements which are affected by the change, so if the HUD doesn't use those it's okay.
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: svg.nas in v2016.4.3 ,bug or intentionally modified ?

Postby yanes » Fri Jan 06, 2017 8:30 pm

I'm currently , redesigning my HUD from the scratch , (You may understand what waste of time is this , instead of adding something new ).
some elements with multiple paths weren't shown correctly (the first path only appeared) .
we (as canvas svg platform users ) need a small guide or docs of the features (may be even a howto ).
(I promise to write a guide or a wiki article if I get the informations :D :lol: )
User avatar
yanes
 
Posts: 135
Joined: Tue Sep 02, 2014 2:14 pm
Location: Tunisia
Callsign: YANES
Version: 2018.2.2
OS: Linux

Re: svg.nas in v2016.4.3 ,bug or intentionally modified ?

Postby Hooray » Sun Jan 08, 2017 7:51 pm

yanes wrote in Fri Jan 06, 2017 8:30 pm:some elements with multiple paths weren't shown correctly (the first path only appeared) .
we (as canvas svg platform users ) need a small guide or docs of the features (may be even a howto ).
(I promise to write a guide or a wiki article if I get the informations :D :lol: )


For the corresponding background info, refer to:

Subject: Canvas arcs

Hooray wrote:It might be worth noting that many SVG related problems that people report here are due to the svg.nas parser not supporting the corresponding higher-level SVG elements, so that people currently need to resort to "simplify path".

However, it is rather straightforward to modify/extend the parser, especially for people already familiar with Nasal - I think James recently also made a few additions. A while ago, I began documenting how the parser can be extended to support additional tags. The tutorial demonstrates how to add support for the <image> tag to map it to the corresponding Canvas::Image element:

http://wiki.flightgear.org/Howto:Extend ... SVG_module
Image

Note that such, and similar, additions would be generally useful - i.e. because people could design their avionics/MFDs (or whatever else) using mainly Inkscape instead of having to use tons of custom Nasal coding to work around certain limitations.

The same could be said to also apply to refining the corresponding Nasal APIs for some of the more common 2D drawing purposes.

I think it was Thorsten who was once hinting at helping create/shape a corresponding API for procedurally creating such MFD elements
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: svg.nas in v2016.4.3 ,bug or intentionally modified ?

Postby yanes » Mon Jan 09, 2017 7:48 pm

Thank you hooray ,
it was all redesigned by trial and error , :shock:
It works now , finally Thank you
Image
User avatar
yanes
 
Posts: 135
Joined: Tue Sep 02, 2014 2:14 pm
Location: Tunisia
Callsign: YANES
Version: 2018.2.2
OS: Linux

Re: svg.nas in v2016.4.3 ,bug or intentionally modified ?

Postby zakalawe » Tue Jan 10, 2017 6:56 pm

I would like to fix more of these cases in the SVG parser (with the understanding that some higher-level features may not map directly!) - for example support some if the SVG shapes directly. If people can send me stand-alone test cases (i.e working with the UFO / C172), I can look at extending the parser code, and adding test-cases.
zakalawe
 
Posts: 1259
Joined: Sat Jul 19, 2008 5:48 pm
Location: Edinburgh, Scotland
Callsign: G-ZKLW
Version: next
OS: Mac

Re: svg.nas in v2016.4.3 ,bug or intentionally modified ?

Postby yanes » Tue Jan 10, 2017 7:40 pm

Ok , you have a tester(in fact a fan of your work also ),
my notes :
*Support for circular shapes (InkScape "ellipses") is missing and is a un-negligible need .
The SU-27SK attitude symbol doesn't show and cause the "Can't get element in svg" , until we do a "Path-->Combine".
User avatar
yanes
 
Posts: 135
Joined: Tue Sep 02, 2014 2:14 pm
Location: Tunisia
Callsign: YANES
Version: 2018.2.2
OS: Linux

Re: svg.nas in v2016.4.3 ,bug or intentionally modified ?

Postby zakalawe » Wed Jan 11, 2017 12:19 pm

yanes wrote in Tue Jan 10, 2017 7:40 pm: Support for circular shapes (InkScape "ellipses") is missing and is a un-negligible need .

This is pretty doable, I can look into doing it. (Converting to paths inside the rendering code)

yanes wrote in Tue Jan 10, 2017 7:40 pm:The SU-27SK attitude symbol doesn't show and cause the "Can't get element in svg" , until we do a "Path-->Combine".

It would help if you can isolate the particular SVG structure which causes this, since that file looks to be quite large.
zakalawe
 
Posts: 1259
Joined: Sat Jul 19, 2008 5:48 pm
Location: Edinburgh, Scotland
Callsign: G-ZKLW
Version: next
OS: Mac

Next

Return to Canvas

Who is online

Users browsing this forum: No registered users and 4 guests