[RESOLVED] access values through STRUCT LONGLATALT

mer
Posts: 24
Joined: Fri Aug 31, 2018 10:52 am

[RESOLVED] access values through STRUCT LONGLATALT

Postby mer » Sat Sep 15, 2018 2:48 pm

Hello,

Does STRUCT LATLONALT return the same set of values as

PLANE LATITUDE, PLANE LONGITUDE and PLANE ALTITUDE?

For the code below, i got matching values for latitude and longitude but altitude values were different. Could anyone guide me on what to set right?

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 1)]
struct Struct1
{
// this is how you declare a fixed size string
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)]
public String title;
public double lat;
public double lon;
public double alt;
public SIMCONNECT_DATA_LATLONALT latLonAlt;


};

enum DEFINITIONS
{
Struct1
}


enum DATA_REQUESTS
{
REQUEST_1,

}



simconnect.AddToDataDefinition(DEFINITIONS.Struct1, "Title", null, SIMCONNECT_DATATYPE.STRING256, 0.0f, SimConnect.SIMCONNECT_UNUSED);
simconnect.AddToDataDefinition(DEFINITIONS.Struct1, "PLANE LATITUDE", "degrees", SIMCONNECT_DATATYPE.FLOAT64, 0.0f, SimConnect.SIMCONNECT_UNUSED);
simconnect.AddToDataDefinition(DEFINITIONS.Struct1, "PLANE LONGITUDE", "degrees", SIMCONNECT_DATATYPE.FLOAT64, 0.0f, SimConnect.SIMCONNECT_UNUSED);
simconnect.AddToDataDefinition(DEFINITIONS.Struct1, "PLANE ALTITUDE", "feet", SIMCONNECT_DATATYPE.FLOAT64, 0.000f, SimConnect.SIMCONNECT_UNUSED);
simconnect.AddToDataDefinition(DEFINITIONS.Struct1, "STRUCT LATLONALT", null, SIMCONNECT_DATATYPE.LATLONALT, 0, SimConnect.SIMCONNECT_UNUSED);


simconnect.RegisterDataDefineStruct<Struct1>(DEFINITIONS.Struct1);

simconnect.OnRecvSimobjectDataBytype += new SimConnect.RecvSimobjectDataBytypeEventHandler(simconnect_OnRecvSimobjectDataBytype);


simconnect.RequestDataOnSimObjectType(DATA_REQUESTS.REQUEST_1, DEFINITIONS.Struct1, 0, SIMCONNECT_SIMOBJECT_TYPE.USER);
simconnect.ReceiveMessage();



Thank you

User avatar
WarpD
Posts: 1311
Joined: Mon Feb 14, 2011 5:29 am

Re: access values through STRUCT LONGLATALT

Postby WarpD » Sun Sep 16, 2018 12:40 am

This was answered at FSDeveloper.
Ed Wilson
Senior Developer
Mindstar Aviation

mer
Posts: 24
Joined: Fri Aug 31, 2018 10:52 am

Re: access values through STRUCT LONGLATALT

Postby mer » Mon Sep 17, 2018 5:59 am



Return to “SimConnect Interface Questions”

Who is online

Users browsing this forum: No registered users and 13 guests