Jump to content

You're browsing the 2004-2023 VATSIM Forums archive. All content is preserved in a read-only fashion.
For the latest forum posts, please visit https://forum.vatsim.net.

Need to find something? Use the Google search below.

Quick question about plug-in handling route


Joao Pereira 1256632
 Share

Recommended Posts

Joao Pereira 1256632
Posted
Posted

So, i print to a file all the points in the Extracted Route like this

 

EuroScopePlugIn::CAircraftExtractedRoute ext_route=Aircraft.GetExtractedRoute();

 

for(int j=0;j

textfile<

 

and for a given airplane it's the following:

BEDRA 4520N 4027N 3530N 3033N 2536N 2038N 1340N

 

Airplane is on fix BEDRA, as it was drew there. So why is it that when i do this:

ext_route.GetPointName(ext_route.GetPointsCalculatedIndex())

 

the given fix is 4520N?

 

The function GetPointsCaldulatedIndex says on EursocopePlugIn:

" Return :

// The index of point in the extracted route that edge is the

// closest to the actual plane position. The return value is

// between 0 and point number - 2.

// The value may be -1 indicating invalid state.

//-----------------------------------------------------------------"

 

And also, what's the meaning of this:

 

" const char * GetPointName ( int Index ) const ;

//-----------------------------------------------------------------

// Parameters :

// => Index - the index of the requested point. It must be

// between 0 and point number - 1.

//

// Return :

// The name of the point in the extracted route array.

//-----------------------------------------------------------------"

 

It must be between 0 and point number - 1??

 

Thank you in advance

Link to comment
Share on other sites

Gergely Csernak
Posted
Posted

Joao,

 

ES calculates the points along the route from the flight plan. It puts them to an array. When we have n points, the indexes are 0, 1, ... n-1. If you have n points then it defines n-1 edges between them. The edge indexes are therefore 0, 1, ... n-2. Edge 0 is between point 0 and 2, ... edge n-2 is between points n-2 and n-1. When ES have these points it select the closest one to the plane and uses its index at GetPointsCaldulatedIndex.

Gergely.

EuroScope developer

Link to comment
Share on other sites

Joao Pereira 1256632
Posted
Posted

I'm sorry Gergely, i'm not following.

 

Firstly: when you say this

Edge 0 is between point 0 and 2, ... edge n-2 is between points n-2 and n-1.

 

You said first edge is between point 0 and 2 so by order of logic, do you mean "edge n-2 is between points n-1 and n-3" ?

 

Secondly:so you are telling me that ES defines edges between points is the array of points. So GetPointsCaldulatedIndex gives the index of the closest edge? Why is it a point then..

 

Thank you for the help

Link to comment
Share on other sites

  • 3 weeks later...
Gergely Csernak
Posted
Posted

Surely it is a typing error. The first edge is between point 0 and 1.

The name GetPointsCaldulatedIndex is just based on GetPointsNumber.

Gergely.

EuroScope developer

Link to comment
Share on other sites

 Share