Jump to content
The simFlight Network Forums

Guillaume-FR-

Members
  • Posts

    12
  • Joined

  • Last visited

Posts posted by Guillaume-FR-

  1. Hello,

    I’m modifying the FSD server with their source code , I’ve added some functions like FSHOST (?where ?hop…). I want to add a command for send the heading from the pilot to the airport

    I’ve found it [C/C++]:

    double GetCap(double Latclient, double Longclient,double Latdest, double Longdest)
    {
    double LaA;double LaB;double LonA;double LonB;
    double P;float Pi; double m;double brg;
    
    Pi = 3.14159265358979323846;
    
    int deg=(int)Latclient;
    float Min=(Latclient-deg)*60;
    LaA = (deg + Min / 60.0) / 180.0 * Pi;
    
    deg=(int)Latdest;
    Min=(Latdest-deg)*60.0;
    
    LaB = (deg + Min / 60.0) / 180.0 * Pi;
    
    deg=(int)Longclient;
    Min=(Longclient-deg)*60.0;
    
    LonA = (deg + Min / 60.0) / 180.0 * Pi;
    
    deg=(int)Longdest;
    Min=(Longdest-deg)*60.0;
    
    LonB = (deg + Min / 60.0) / 180.0 * Pi;
    
    P = LonB - LonA;
    
    m = acos(sin(LaA) * sin(LaB) * cos(LonB - LonA) + cos(LaA) * cos(LaB));
    
    brg = acos(sin(LaB) / (sin(m) * cos(LaA)) - tan(LaA) / tan(m));
    
    if(P < 0)brg = 2 * Pi - brg;
    
    brg = brg / Pi * 180;
    
    return brg;
    
    }
    

    but I get 83 instead of 89 (in FSNAV) for the same airport.

    Please, could you send me your function for the heading ?

    Thanking you in advance for your help (and for FSNAV !).

    EDIT : found it ! I didn't add the mag. variation ! how to calculate ?

    Thanking you in advance.

    ----

    Sorry for my french, i'm french !

  2. Hi ,

    I’m programming a FS module in C.

    It’s like a Flight Recorder, I save the position of plane each 5 seconds (~5s to ~30s).

    I need to display the flight plan in FSNAVIGATOR (the data of the position which have been saved) (export to .FSN format from my module.)

    Where can I find the library , or the code to decrypt(and crypt) a .fsn format ?

    Thanks

    Sorry for my English I’m French....

  3. Hi

    Sorry for my English I am French (and to understand the SDK with my English ....,I am 14 :cry: ...)

    I am programming in C++ (with DEVC++).

    And I want to read some data of Flight Simulator (altitude, speed ...).

    But I can read some variable (with “expression”)

    For example : for altitude (0570, S64) the expression is “#*3.28084/(65536*65536)” and with this :

    int altint;
    char alt[8],alting[8];
    ......  
    if (!FSUIPC_Read(0x0840, 8, alt, &dwResult) || !FSUIPC_Process(&dwResult)) fTimeOk = FALSE;
    wsprintf(alting, "%d", alt[0]);
    altint=atoi(alting);
    altint=altint*3.28084/(65536*65536);
    wsprintf(alting, "%d", altint);
    

    and I get : -2147483648 :(

    Why ?

    Other question :

    How to know the nearest airport of the plane ? (ICAO)

    Thanks in advance. :wink:

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.