xpnteam/xpnet

can not get the latitude of aircraft

Opened this issue · 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);
    }

The plane stay at the parking spot

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

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

bm98 commented

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