• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

FS2004 enroute waypoints

Messages
37
Country
switzerland
Dear all,

First let me introduce me on this forum as I'm a new user. I'm Laurent Hadorn from Switzerland, 41 yo. I did the EC145 for FS2004/FS9 a long time ago.
Actually I'm trying to built a FS2004 Boeing 787 cockpit. At this point I could realize all the gauges with XML coding, but I'm a little bit stuck at this moment. I would like to make a ND with enroute waypoints as you can see on the picture (with waypoints I want to do circled in red).



I went through a lot of forums and read both "CustomDraw fs9gps: Map" and "FS9GPS Module" by Bob McELRATH.
Unfortunately I can't go ahead, because I just don't know how to proceed. All I could do is what you see in the second picture...



So is there any possibility to make enroute waypoints with XML coding? If yes I would really appreciate some (a lot of) help!...

Thank you all in advance for any answer. Best regards

Laurent Hadorn
 
Hi,


It is possible.
Quite a lot of work.....

Something like this?
(Minipanel 787 with pop-ups)

From where is the first picture?
 

Attachments

  • 787 ALL.jpg
    787 ALL.jpg
    410.8 KB · Views: 703
Last edited:
I Jan,
Thank you for your reply, the good news is that's possible to make it, the bad news is I don't know how. Do you have an idea about a tutorial or at least something that put me on the right way?
The first picture is an sample I took on the web to show what I want to do, I don't remember where it is exactly from...

Best regards.
 
Hi Laurent,

Jan's work is great, isn't it?

Have you seen these threads?

http://forum.avsim.net/topic/71886-moving-map-display/

http://forum.avsim.net/topic/71886-moving-map-display/page-3?hl=hud#entry1776186

http://forum.avsim.net/topic/383214-steer-me-in-the-right-direction/

In those discussions, Jan mentions that he makes minimal use of layers in fs9gps:map. Instead, map symbols such as the waypoint star are drawn using <Polyline>, <Polygon>, and <Circle> - the waypoint star being a 9 point polygon. The symbols can be placed in <Element> as an overlay at the correct location on the fs9gps:map using <Shift><Value> and <Rotate><Value>. You need a scale algorithm that is a function of zoom to derive the <Value> numbers based on lat and lon, or distance and relative bearing from your aircraft, of the map element you wish to draw. Each gauge update cycle, the relative position of the your aircraft to that symbol will change, causing the numbers in <Value> to change, and the symbol will move.

If your navigation display will not ever show terrain or airspace, just a pure black background, then you really don't even need fs9gps:map and that could simplify the scaling part (but it's a trade-off because then you have to draw everything, including flight plan path). On the other hand, if you intend to overlay XML generated symbols on a fs9gps:map base, then X and Y scaling needs to be accurate. If your gauge unit (gauge pixel) aspect ratio is 1:1, it's straight-forward (page 105 CustomDraw guidebook). But there are times when it is not, and extra work is involved to get the scales right.

If you decide to use bmp's for some of the elements rather than drawing polygons, then the gauge graphics might look even better. Lots of flexibility.

It is indeed a lot of work and requires clever XML scripting and working knowledge of the gps module to access the lat/lons, distances and bearings of pertinent elements. It certainly can all be done using XML, although there are few people around as good at that as Jan.

Bob
 
Last edited:
Hi Bob an Jan,

Yes Jan's work is just amazing... The ND is exactly what I want to do, but I didn't expect that it will be so complicated. As i'm pretty beginner with XML coding, it's my first panel, I'll need more than help, I'll need private classes, and I'm not sure it will be enough!!!
Here you can see my project so far.

viewer.php



So if you guys are interested on it and helping me, it will be very helpful for me. The idea is to make a freeware panel for FS2004.

All the best and thank you in advance...
 
Hi Jan,
As I told you I'm pretty beginner with map drawing. So I understood to leave layers as they're limited, then it's a bit complex, because I don't know from which part I have to start. <Polygon> <Shift> <Rotate> and >Value> seems ok, but then how do I insert them? with macro? I start to learn macro as well through different forums, but I don't find a concrete tutorial actually.
I guess it will be a long way to get the final result, but I try to learn and discover xml as much as possible.
So I'm missing a lot at this point. The good thing would be to have a start point to begin in the right way, without searching what could be useful or not, to get a first result even if it's not accurate, then I could try to adjust and scale the elements.

I would like to use bmp's as well.

So, as I told you, a lot of work ahead!...

Thank you in advance for any help.

Best regards
 
OK

This is stone-age old, quite simple code and can probably much better with new macros and modules.
In the code each waypoint is an element containing another one.
Using FormattedText makes it possible to use a value/function in it,
also the use of an image instead of a polygon, see msgps.
The code uses some macros and in the click (EFIS) you need to do something for the zoom of the map and the waypoints.
First the macros:

Code:
<Macro Name="position">
(A:PLANE LATITUDE,RADIANS) (>@c:GeoCalcLatitude1,RADIANS)
(A:PLANE LONGITUDE,RADIANS) (>@c:GeoCalcLongitude1,RADIANS)
(@c:FlightPlanIsActiveApproach)
if{
(@c:FlightPlanWaypointApproachLatitude,RADIANS) (>@c:GeoCalcLatitude2,RADIANS)
(@c:FlightPlanWaypointApproachLongitude,RADIANS) (>@c:GeoCalcLongitude2,RADIANS)
}
els{
(@c:FlightPlanWaypointLatitude,RADIANS) (>@c:GeoCalcLatitude2,RADIANS)
(@c:FlightPlanWaypointLongitude,RADIANS) (>@c:GeoCalcLongitude2,RADIANS)
}
</Macro>

<Macro Name="shift1">
(@c:GeoCalcBearing,radians) (A:PLANE HEADING DEGREES TRUE,radians) -
cos (@c:GeoCalcDistance,nmiles) (L:Zoomfactor,number) * * -1 *
</Macro>

<Macro Name="shift2">
(@c:GeoCalcBearing,radians) (A:PLANE HEADING DEGREES TRUE,radians) -
sin (@c:GeoCalcDistance,nmiles) (L:Zoomfactor,number) * *
</Macro>

<Macro Name="eta">
%((@c:FlightPlanWaypointETA,hours) flr 100 % )%!02d!%((@c:FlightPlanWaypointETA,minutes) flr 60 %)%!02d!z
</Macro>

As you can see you have to do something with the "zoomfactor".

@position gives distance and bearing from plane to waypoint, the result visible in @shift1 and 2, a little bit Pythagoras.
@eta is just ETA at waypoint in zulu time.

Now the element:
Mind that the numbers of shift and clip depends on the dimensions of ND, Map, scale and what you want to be visible.

Code:
<Element>
<FormattedText X="100" Y="40" Bright="Yes" FontSize="12" Font="Arial" Adjust="left" Color="%('#ff00ff' 'silver' (@c:FlightPlanisActiveWaypoint) ?)" VerticalAdjust="Center">
<String>\{bo}
%((@c:FlightPlanIsActiveApproach))
%{if}%((@c:FlightPlanActiveApproachWaypoint) (>@c:FlightPlanWaypointApproachIndex) @position)
%((@c:FlightPlanWaypointApproachType))%{case}%{:1}%((@c:FlightPlanWaypointApproachName))%!s!%{:2}PROC.TURN L%{:3}PROC.TURN R%{:4}DME ARC L%{:5}DME ARC R%{:6}HOLD L%{:7}HOLD R%{:8}%((@c:FlightPlanWaypointApproachTarget,nmiles))%!0.1f! NM%{:9}%((@c:FlightPlanWaypointApproachTarget,feet))%!d! FT%{:10}MAN SEQ%{:11}%((@c:FlightPlanWaypointApproachName))%!s!%{end}
%{else}%((@c:FlightPlanActiveWaypoint) (>@c:FlightPlanWaypointIndex) @position)
%((@c:FlightPlanWaypointIdent))%!s!\n\{lsp=11}@eta
%{end}
</String>
<Axis X="-4" Y="-2"/>
</FormattedText>
<Element>
<Polygon Color="%('#ff00ff' 'silver' (@c:FlightPlanisActiveWaypoint) ?)" Bright="Yes"><Point X= "2" Y="-2"/><Point X= "0" Y="-9"/><Point X="-2" Y="-2"/><Point X="-9" Y= "0"/><Point X="-2" Y= "2"/><Point X= "0" Y= "9"/><Point X= "2" Y= "2"/><Point X= "9" Y= "0"/><Point X= "2" Y="-2"/></Polygon>
<Clip Top="50" Left="60" Right="580" Bottom="400"/>
</Element>
<Shift>
<Value>@shift1</Value>
<Nonlinearity>
<Item Value="-20" Y=  "50"/>
<Item Value=   "0" Y="370"/>
<Item Value= "20" Y="690"/>
</Nonlinearity>
</Shift>
<Shift>
<Value>@shift2</Value>
<Nonlinearity>
<Item Value="-20" X=   "0"/>
<Item Value=   "0" X="320"/>
<Item Value= "20" X="640"/>
</Nonlinearity>
</Shift>
<Clip Top="50" Left="60" Right="580" Bottom="400"/>
</Element>

This is the Active Waypoint!

Now it becomes simply:
Previous - or next wpt is same code except:
(c:FlightPlanActiveApproachWaypoint) 1 - (>@c:FlightPlanWaypointApproachIndex)
(c:FlightPlanActiveApproachWaypoint) 2 - (>@c:FlightPlanWaypointApproachIndex)
or
(@c:FlightPlanActiveWaypoint) 1 - (>@c:FlightPlanWaypointIndex)
(@c:FlightPlanActiveWaypoint) 2 - (>@c:FlightPlanWaypointIndex)
etc.
and
(c:FlightPlanActiveApproachWaypoint) 1 + (>@c:FlightPlanWaypointApproachIndex)
(c:FlightPlanActiveApproachWaypoint) 2 + (>@c:FlightPlanWaypointApproachIndex)
or
(@c:FlightPlanActiveWaypoint) 1 + (>@c:FlightPlanWaypointIndex)
(@c:FlightPlanActiveWaypoint) 2 + (>@c:FlightPlanWaypointIndex)

etc.

Succes!
 
Hi Jan,

Thank you for your reply and the codes... Greatly appreciated as it gives me a right start. I'll now figure out how all of this works and then as soon as I get something concrete, I'll publish a picture, if of course I arrive to complete something! :-)
For sure I'll let you know about the progress.

Thank you again for your help.

Best regards.
 
Hi Jan,

So working on the waypoints.



At this time, I'm experiencing problems with zoomfactors (?)... As you can see I have the waypoint, but it remains stuck behind my virtual aircraft or focal point It's not travelling accross the screen. I went through the zoom factor topic, but cannot figure out how to manage to put this waypoint at the right place. So in summary, 2 things, the waypoint is not at the right place and then it's only following the focal point instead of travelling... and the zoom has no effect on its position.
Could you give me a hint on that one, too? please.

Thank you and best regards.
 
Hi,

I cannot see what the problem is. No code.
But here is an old working one.
Have a look, use it etc.
It is no xml, just tekst! (PLAN mode)
 

Attachments

Last edited:
By the way Jan, this reminds me ... I might put up a wiki on <Clip> and <RelClip>. I've needed them in the (recent) past, but instead used clunky masking rectangles because I was unaware of or forgotten them. I see <RelClip> in the stock gps500 gauge however, so I could have figured it out, I know, and there are a couple of threads in AVSIM and here that discuss them. At one point, Nike Pike wondered if <Clip> could be used for circles. Have you ever tried?

As far as I know, these useful XML sub-elements aren't documented in any SDK - going all the way back to FS2002. I know SDKs are a bit incomplete and occasionally/infrequently wrong (speaking for XML anyway), but I wonder, has anyone ever tabulated a list of "things you don't find in the SDK"? Maybe that's a thankless undertaking.

Bob
 
Last edited:
By the way Jan, this reminds me ... I might put up a wiki on <Clip> and <RelClip>. I've needed them in the (recent) past, but instead used clunky masking rectangles because I was unaware of or forgotten them. I see <RelClip> in the stock gps500 gauge however, so I could have figured it out, I know, and there are a couple of threads in AVSIM and here that discuss them. At one point, Nike Pike wondered if <Clip> could be used for circles. Have you ever tried?

Bob,

<Clip> and <RelClip> are subproperties of an <Element> and as such they affect whatever the element displays: an image, a text, a rectange, a circle, etc. They can clip only rectangular sections of the display.

Tom
 
Hi Jan,

At this point I could center the waypoint in the middle of the map, then it is not moving, see the picture and the codes below. I went through a lot of tests, but I cannot make it with my basic knowledge. So at this point, is it a right start already, what is the next step. Thank you again for your help.
 

Attachments

  • nd787.jpg
    nd787.jpg
    112.7 KB · Views: 536
  • code.txt
    code.txt
    7.9 KB · Views: 641
Hi,

As far as i can see your problem is the zoomfactor.
You need a factor in the map and the flightplan line and another, different one, in the shift macros.
So the range knob should contain something like:


Code:
<Area Left="435" Top="810" Width="35" Height="35">
<Tooltip>RANGE</Tooltip>
<Cursor Type="Hand"/>
<Click Kind="LeftSingle+RightSingle" Repeat="Yes">
(M:Event) 'LeftSingle' scmp 0 ==
if{
(L:map zoom,number) (L:map zoom,number) 2 / - 10 max (>L:map zoom,number)
(L:Zoomfactor,number) 2 * + 4 min (>L:Zoomfactor,number)
}
(M:Event) 'RightSingle' scmp 0 ==
if{
(L:map zoom,number) 2 * + 320 min (>L:map zoom,number)
(L:Zoomfactor,number) (L:Zoomfactor,number) 2 / - 0.125 max (>L:Zoomfactor,number)
}
</Click>
</Area>


and the map and flightplan this:

Code:
<Zoom>(L:map zoom,number) 1852 * 2 / </Zoom>

Then you can use zoomfactor in the shift macros.
 
Hi Jan,

Huge progress!... The points are correponding to the route:), now I have to adjust the zoomfactor. Will do it tomorrow.
Thank you very much!...
 

Attachments

  • 787nd2.jpg
    787nd2.jpg
    139.8 KB · Views: 500
Hi Jan,
Well I improved a bit I guess. As you can see on the 1st screen, the waypoints are at the right place. But then when the aircraft is turning, they start floating!... (see screen 2). My idea is that my map scale isn't good. Then with an accurate map scale, I might get a correct zoomfactor. Do you agree with me? If not, in what direction should I go? Here are my codes again, too...
Again, thank you in advance.
 

Attachments

  • 787mfd1.jpg
    787mfd1.jpg
    129.9 KB · Views: 549
  • 787mfd2.jpg
    787mfd2.jpg
    136.9 KB · Views: 526
  • code.txt
    code.txt
    21.3 KB · Views: 603
Hi,

Ok, the flightplan rotates when turning and the waypoints don't?
Do the waypoints rorate at all??
If not the problem seems to be the shift formula.
 
Hi Jan,
The waypoints are turning, too, but with a slight delay. Another thing, the points a pretty accurate at the start of the flight, but longer the flight is and less the points are accurate, see pthe pics.
 

Attachments

  • 7871.jpg
    7871.jpg
    80.2 KB · Views: 520
  • 7872.jpg
    7872.jpg
    78.9 KB · Views: 528
indeed something with scaling(?)
Also try some changes in the nonlinearity values (-20,0,20;-200+x,x,200+x)
i think the problem is the dimension of the map and the amount of shift.
 
Back
Top