xpnet icon indicating copy to clipboard operation
xpnet copied to clipboard

can not get the latitude of aircraft

Open lanceji opened this issue 4 years ago • 4 comments

When I use the following code, the airplane position keeps changing every second. why?

    private FlightLoopTime OnFlightLoopHook(TimeSpan elapsedTimeSinceLastCall, TimeSpan elapsedTimeSinceLastFlightLoop, int counter)
    {
        double dAirplaneLatitude = m_api.Data.GetDouble("sim/flightmodel/position/latitude").Value;
        m_api.Log.Log("latitude:" + dAirplaneLatitude.ToString());

        return FlightLoopTime.FromSeconds(1.0f);
    }

lanceji avatar Mar 02 '20 15:03 lanceji

The plane stay at the parking spot

lanceji avatar Mar 02 '20 15:03 lanceji

@lanceji can you post here some of the log output? A minute's worth or so?

jaurenq avatar Mar 02 '20 21:03 jaurenq

The upper left corner of the picture is the location of the aircraft. The location of the log output does not seem to be correct. The .zip file is the project. Please help me.....thank you very much.

20200303124251 mytextplugin.zip xpnet.log

lanceji avatar Mar 03 '20 04:03 lanceji

Hi, tried the same but failed - use GetFloat() the XPlane API servs both. I.e. GetFloat works on doubles too. But GetDouble() in this (otherwise great working..) library seems to be bugged. Regs

bm98 avatar May 02 '20 21:05 bm98