Board index FlightGear Development Canvas

NavDisplay & MapStructure discussion (previously via PM)

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: NavDisplay & MapStructure discussion (previously via PM)

Postby Hooray » Sun Feb 16, 2014 1:31 pm

Hey, very good job !!
If you think that we missed anything in our instructions, it would be great if you could review and extend them accordingly, so that other aircraft developers can more easily integrate things.

Regarding the radar, we've been working on related changes in the topics/radar branch - thanks to Philosopher's TFC work, you can basically start with a new TARGET/RADAR layer now and integrate xiii's code.

PS: Feel free to add some of those screen shots to the wiki (aircraft article and/or newsletter)
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: NavDisplay & MapStructure discussion (previously via PM)

Postby Philosopher » Sun Feb 16, 2014 6:57 pm

Great work! I'll have to check out the Mirage soon :).

TFC is basically fixed now, though there's probably some other things I could tune ;). Also just fixed the 747-400 in our branch. (For those who don't know, Hooray set up a team clone that we're using, branch topics/canvar-radar.)

@Hooray or Tom: do you get the same crash as mentioned in my TFC commit ? Could it be an error in what we're doing, or Canvas?
Philosopher
 
Posts: 1593
Joined: Sun Aug 12, 2012 7:29 pm

Re: NavDisplay & MapStructure discussion (previously via PM)

Postby Hooray » Sun Feb 16, 2014 7:07 pm

yeah, kinda - I've been getting a few segfaults when testing the latest MapStructure layers - according to gdb, most of them happen either 1) inside Canvas or inside 2) Nasal/props handling - especially, closing/reopening (reloading) dialogs (layers) seems a bit fragile at the moment - but those are obviously C++ issues primarily, i.e. a few ghosts seem to become invalid then, while still being referenced/used obviously.
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: NavDisplay & MapStructure discussion (previously via PM)

Postby Philosopher » Sun Feb 16, 2014 7:15 pm

If that's the case, I could make the .del() methods total destructors, i.e. "I am no longer an object", see if we're leaking something here... I mean, it is on the border of C++ classes, without quite the same infrastructure obviously. We really don't want these issues when just opening/closing dialogs.
Philosopher
 
Posts: 1593
Joined: Sun Aug 12, 2012 7:29 pm

Re: NavDisplay & MapStructure discussion (previously via PM)

Postby Hooray » Sun Feb 16, 2014 7:40 pm

To help with optimizing MapStructure/NavDisplay, I have generalized things a bit more, so that we can now easily profile each layer using systime()-benchmarking and live-plotting - by using kuijfe09's fgplot code, you can see the APT (red) and DME (green) layers being plotted here:
Image


Also, plotting is a great opportunity to confirm that TFC really is our most complex layer (plotted in blue):

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: NavDisplay & MapStructure discussion (previously via PM)

Postby Soitanen » Tue Feb 18, 2014 10:08 am

Some new bug found:
Image
APP mode.
1. Course is not displayed correctly. It looks like magnetic variation is applied twice (true heading of RWY is 286, course 277, actual magvar from sim is 10.05 deg)
2. Glideslope marker is still misaligned.
3. I started with basic weather and then switched to Advanced weather. Wind shows negative heading.
4. Current heading pointer is missed (little white triangle, must be right under central rectangle).
5. Green arc must not be shown in APP mode. FCOM of 737NG say, that it appears only in MAP and MAP CTR modes.
Boeing 737-300. Reworked cockpit, FDM, autopilot and much more. WIP.
Boeing 737-800. WIP. Canvas PFD and ND.
Antonov An-24B. Made from scratch. Very good FDM. 3D model by Adrian. WIP.
Project Russia (some cities, based on OSM with custom objects).
Soitanen
 
Posts: 489
Joined: Sat Jun 16, 2012 7:50 am
Location: Saint-Petersburg, Russia
Version: git
OS: Linux Mint 17

Re: NavDisplay & MapStructure discussion (previously via PM)

Postby Hooray » Tue Feb 18, 2014 11:36 am

Not sure what Gijs or Hyde are thinking here - but originally this was about the MapStructure side of things, which is the back-end used by the ND code (well by parts of it) - so far, most ND issues have been reported via the issue tracker or the wiki (see the wiki article) - so I would suggest to keep it that way. The MapStructure layer itself is not specific to the ND.

Feel free to make feature requests via: http://wiki.flightgear.org/Canvas_ND_Framework

Finally, let me say one thing very clearly: It is great that so many people are contributing to this by testing things and reporting bugs and making feature requests, but PLEASE don't think that this is all you can do - adding a new feature or fixing a bug will now typically require 5-20 lines of Nasal code, and there's very little that you can break. So if you have previously done ANY kind of scripting/programming, you will find this extremely straightforward to do, and I would suggest to get in touch with Gijs and Hyde to help with things. Some of you seem to have access to the corresponding AOMs (manuals), so we really only need to document how to add new feaures, to enable others to help maintain the whole thing - which really is the only sane way to deal with the amount of feedback we've been getting. Please do not expect Gijs to shoulder all this on his own - instead, get in touch so that we can tell you how to implement new features, and help fixing bugs.

It should really only take us 30-45 minutes to document the current process, so that things become better scalable, because we could have more people working on this, not just Gijs ... :D

If you are able to run, test the ND and identify bugs, then you are also able to help fix them - simple as that, this really isn't rocket science anylonger.
Typically, it will only involve 5-10 different "commands" (Nasal functions like setprop/getprop) and ~20 lines of code, most of it being purely declarative.


just my 2c obviously ...
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: NavDisplay & MapStructure discussion (previously via PM)

Postby 5H1N0B1 » Tue Feb 18, 2014 8:18 pm

Seriously dudes, perhaps I'm retarded but I re read all note again and cannot access to the GIT/whatever...

1) I use the compilation script to update my fgdata. http://wiki.flightgear.org/Scripted_Compilation_on_Linux_Debian/Ubuntu#Fast_updating
2) I Started Flightgear, and nothing in the Debug menu...
3)I try to use this commands :
Code: Select all
    git add remote canvas-hackers git@gitorious.org:fg/canvas-hackers-fgdata.git
    git fetch canvas-hackers
    git checkout --track -b canvas-radar canvas-hackers/topics/canvas-radar


It return me this :
Code: Select all
fabien@Epson-Aspire-7735:/media/Data/FGFS-Git/fg-download-and-compile-fgmeta/install/fgfs/fgdata$ git add remote canvas-hackers git@gitorious.org:fg/canvas-hackers-fgdata.git
fatal: pathspec 'remote' did not match any files


This annoy me a little cause I can't read or write any code... (kind of frustrated...)
Any advice ? Which part already written I am missing ?
Do you use a GUI for git ? (or console like me ?)

Thanks in advance.

5H1N0B1
5H1N0B1
"Each day, with every person you meet, there is something to learn"
5H1N0B1
 
Posts: 222
Joined: Thu Aug 30, 2012 10:36 am
Location: France
Callsign: 5H1N0B1
IRC name: _5H1N0B1
Version: GIT
OS: Ubuntu

Re: NavDisplay & MapStructure discussion (previously via PM)

Postby Hooray » Tue Feb 18, 2014 8:22 pm

it's "git remote add", see git help (man git)
sorry if there's a typo somewhere in what I wrote ... will fix it ASAP

just checked the wiki: right, my bad ... thanks for testing my instructions and providing feedback :oops:
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: NavDisplay & MapStructure discussion (previously via PM)

Postby TheTom » Thu Feb 20, 2014 1:07 am

Philosopher wrote in Sun Feb 16, 2014 6:57 pm:do you get the same crash as mentioned in my TFC commit ? Could it be an error in what we're doing, or Canvas?

Just using the Canvas should never lead to a crash. What do I need to do to reproduce the crash? Checking out the 'umo' or 'topics/canvas-radar' branch and opening the map multiple times does not crash for me...
TheTom
 
Posts: 322
Joined: Sun Oct 09, 2011 11:20 am

Re: NavDisplay & MapStructure discussion (previously via PM)

Postby Philosopher » Thu Feb 20, 2014 1:12 am

Set: /canvas/by-index/texture[2]/group/map/range=200 (each time you open it) This ensures that the traffic (aka carrier :)) is added, which is what caused the crash for me. Enable log-level=info for more information on what it's doing.

P.S. I tested at KSMF, hence the 200 range - it might be different for KSFO, but probably smaller.
Philosopher
 
Posts: 1593
Joined: Sun Aug 12, 2012 7:29 pm

Re: NavDisplay & MapStructure discussion (previously via PM)

Postby Hooray » Thu Feb 20, 2014 8:08 am

TheTom wrote in Thu Feb 20, 2014 1:07 am:
Philosopher wrote in Sun Feb 16, 2014 6:57 pm:do you get the same crash as mentioned in my TFC commit ? Could it be an error in what we're doing, or Canvas?

Just using the Canvas should never lead to a crash. What do I need to do to reproduce the crash? Checking out the 'umo' or 'topics/canvas-radar' branch and opening the map multiple times does not crash for me...


lol, is there a really a umo branch anywhere ?
If so, that's because I used another computer and simply checked out a fresh copy, and didn't feel like typing the whole thing ... :oops:
but I was really under the impression that I pushed this to topics/canvas-radar :mrgreen:

EDIT: right, there were a few unnecessary branches, deleted them ...
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: NavDisplay & MapStructure discussion (previously via PM)

Postby Soitanen » Fri Feb 21, 2014 7:12 pm

Ok. I have fixed all 5 bugs, that I mentioned above. Here is link to bugfixes.patch: http://yadi.sk/d/e7KdDr3cJKgoa
Could you merge this into git?

Also I will make some improvements according to 737NG FCOM, if you don't mind.
Boeing 737-300. Reworked cockpit, FDM, autopilot and much more. WIP.
Boeing 737-800. WIP. Canvas PFD and ND.
Antonov An-24B. Made from scratch. Very good FDM. 3D model by Adrian. WIP.
Project Russia (some cities, based on OSM with custom objects).
Soitanen
 
Posts: 489
Joined: Sat Jun 16, 2012 7:50 am
Location: Saint-Petersburg, Russia
Version: git
OS: Linux Mint 17

Re: NavDisplay & MapStructure discussion (previously via PM)

Postby Hooray » Fri Feb 21, 2014 7:17 pm

Code: Select all
diff --git a/Nasal/canvas/map/navdisplay.mfd b/Nasal/canvas/map/navdisplay.mfd
index 5c4c5e2..2adef81 100644
--- a/Nasal/canvas/map/navdisplay.mfd
+++ b/Nasal/canvas/map/navdisplay.mfd
@@ -1,4 +1,4 @@
-# ==============================================================================
+## ==============================================================================
 # Boeing Navigation Display by Gijs de Rooy
 # ==============================================================================
 
@@ -499,7 +499,7 @@ var NDStyles = {
                predicate: func(nd) (nd.in_mode('toggle_display_mode', ['APP','VOR']) and !nd.get_switch('toggle_centered')),
                is_true: func(nd) {
                   nd.symbols.vorCrsPtr.show();
-                  nd.symbols.vorCrsPtr.setRotation((getprop("instrumentation/nav/radials/selected-deg")-nd.aircraft_source.get_hdg_tru())*D2R);
+                  nd.symbols.vorCrsPtr.setRotation((getprop("instrumentation/nav/radials/selected-deg")-nd.aircraft_source.get_hdg_mag())*D2R);
                },
                is_false: func(nd) nd.symbols.vorCrsPtr.hide(),
             },
@@ -511,7 +511,7 @@ var NDStyles = {
                predicate: func(nd) (nd.in_mode('toggle_display_mode', ['APP','VOR']) and nd.get_switch('toggle_centered')),
                is_true: func(nd) {
                   nd.symbols.vorCrsPtr2.show();
-                  nd.symbols.vorCrsPtr2.setRotation((getprop("instrumentation/nav/radials/selected-deg")-nd.aircraft_source.get_hdg_tru())*D2R);
+                  nd.symbols.vorCrsPtr2.setRotation((getprop("instrumentation/nav/radials/selected-deg")-nd.aircraft_source.get_hdg_mag())*D2R);
                },
                is_false: func(nd) nd.symbols.vorCrsPtr2.hide(),
             },
@@ -523,7 +523,7 @@ var NDStyles = {
                predicate: func(nd) nd.in_mode('toggle_display_mode', ['APP']),
                is_true: func(nd) {
                   if(getprop("instrumentation/nav/gs-needle-deflection-norm") != nil)
-                     nd.symbols.gsDiamond.setTranslation(-getprop("instrumentation/nav/gs-needle-deflection-norm")*150,0);
+                     nd.symbols.gsDiamond.setTranslation(getprop("instrumentation/nav/gs-needle-deflection-norm")*150,0);
                },
                is_false: func(nd) nd.symbols.gsGroup.hide(),
             },
@@ -571,7 +571,7 @@ var NDStyles = {
                   var windDir = getprop("environment/wind-from-heading-deg");
                   if(!nd.get_switch('toggle_true_north'))
                      windDir = windDir + getprop("environment/magnetic-variation-deg");
-                  nd.symbols.wind.setText(sprintf("%03.0f / %02.0f",windDir,getprop("environment/wind-speed-kt")));
+                  nd.symbols.wind.setText(sprintf("%03.0f / %02.0f",geo.normdeg(windDir),getprop("environment/wind-speed-kt")));
                },
                is_false: NOTHING,
             },
@@ -1143,7 +1143,7 @@ var NavDisplay = {
          me.symbols.compass.show();
       }
 
-      var staPtrVis = !me.in_mode('toggle_display_mode', ['APP','PLAN']);
+      var staPtrVis = !me.in_mode('toggle_display_mode', ['PLAN']);
       var magVar = getprop("environment/magnetic-variation-deg");
       if(me.in_mode('toggle_display_mode', ['APP','MAP','VOR','PLAN']))
       {
@@ -1237,7 +1237,7 @@ var NavDisplay = {
             me.symbols.TrkBugLCD2.hide();
             me.symbols.HdgBugCRT2.setVisible(staPtrVis and !dispLCD);
             me.symbols.HdgBugLCD2.setVisible(staPtrVis and dispLCD);
-            me.symbols.selHdgLine2.setVisible(staPtrVis and hdg_bug_active);
+            me.symbols.selHdgLine2.setVisible(!me.in_mode('toggle_display_mode', ['APP','VOR', 'PLAN']));
          }
       }
 
@@ -1257,7 +1257,7 @@ var NavDisplay = {
                   altRangePx = 700;
                me.symbols.altArc.setTranslation(0,-altRangePx);
             }
-            me.symbols.altArc.show();
+            me.symbols.altArc.setVisible(me.in_mode('toggle_display_mode', ['MAP']) and !me.get_switch('toggle_centered'));
          } else
             me.symbols.altArc.hide();
       } else {




thank you for working on the ND!
But please coordinate all further additions to navdisplay.mfd with Gijs and/or Hyde, preferably by using a gitorious merge request, so that they can easily review your changes.
Again, thank you!
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: NavDisplay & MapStructure discussion (previously via PM)

Postby TheTom » Sat Feb 22, 2014 11:59 am

Philosopher wrote in Thu Feb 20, 2014 1:12 am:Set: /canvas/by-index/texture[2]/group/map/range=200 (each time you open it) This ensures that the traffic (aka carrier :)) is added, which is what caused the crash for me. Enable log-level=info for more information on what it's doing.


Should be fixed now. I've found another problem, but it should not affect this crash.
TheTom
 
Posts: 322
Joined: Sun Oct 09, 2011 11:20 am

PreviousNext

Return to Canvas

Who is online

Users browsing this forum: No registered users and 2 guests