Formating
This commit is contained in:
@@ -57,21 +57,50 @@ struct data {
|
||||
double gForce; // G FORCE IN G
|
||||
};
|
||||
|
||||
struct Port {
|
||||
struct port {
|
||||
double headingTrue; // PLANE HEADING DEGREES TRUE
|
||||
double latitude; // PLANE LATITUDE
|
||||
double longitude; // PLANE LONGITUDE
|
||||
};
|
||||
|
||||
struct airport {
|
||||
double lat;
|
||||
double lon;
|
||||
char name[32];
|
||||
};
|
||||
struct runway {
|
||||
double lat;
|
||||
double lon;
|
||||
float heading;
|
||||
float length;
|
||||
float width;
|
||||
int pNum;
|
||||
int pDeg;
|
||||
int sNum;
|
||||
int sDeg;
|
||||
};
|
||||
struct parking {
|
||||
int type;
|
||||
int name;
|
||||
int suffix;
|
||||
unsigned int number;
|
||||
float heading;
|
||||
float radius;
|
||||
float x;
|
||||
float z;
|
||||
};
|
||||
|
||||
#pragma pack(pop)
|
||||
|
||||
enum DEFINITIONS {
|
||||
D_DATA,
|
||||
D_FACILITY,
|
||||
D_PORT,
|
||||
};
|
||||
|
||||
enum REQUESTS {
|
||||
R_DATA,
|
||||
R_FACILITY,
|
||||
R_ACFT,
|
||||
R_DIALOG,
|
||||
R_PORT,
|
||||
|
||||
+4
-1
@@ -146,7 +146,7 @@ WINBOOL addNotifyIcon(HWND hWnd)
|
||||
GetSystemMetrics(SM_CYSMICON),
|
||||
LR_SHARED);
|
||||
if (icon == NULL) {
|
||||
toLog("error icon " + std::to_string(GetLastError()));
|
||||
toLog("Error icon " + std::to_string(GetLastError()));
|
||||
}
|
||||
niData.cbSize = sizeof(NOTIFYICONDATA);
|
||||
niData.uVersion = NOTIFYICON_VERSION_4;
|
||||
@@ -187,6 +187,9 @@ WINBOOL createMenu(HWND hWnd)
|
||||
version.append(SimConnect::resolveVersion(simConnect->getVersion()));
|
||||
AppendMenu(hMenu, MF_STRING | MF_GRAYED, NULL, version.c_str());
|
||||
}
|
||||
if (!recorder->getSupportedState()) {
|
||||
AppendMenu(hMenu, MF_STRING | MF_GRAYED, NULL, "Sim unsupported");
|
||||
}
|
||||
AppendMenu(hMenu, MF_SEPARATOR, NULL, NULL);
|
||||
AppendMenu(hMenu, MF_STRING, IDM_EXIT, "Exit");
|
||||
|
||||
|
||||
+110
-41
@@ -19,48 +19,52 @@ SimConnect::SimConnect(
|
||||
this->toLog("SimConnect_Close: Connection opened");
|
||||
|
||||
// Setup SimConnect
|
||||
SimConnect_SubscribeToSystemEvent(simConnect, EVENTS::E_PAUSE, "Pause");
|
||||
SimConnect_SubscribeToSystemEvent(simConnect, EVENTS::E_STATUS, "Sim");
|
||||
SimConnect_SubscribeToSystemEvent(this->simConnect,
|
||||
EVENTS::E_PAUSE,
|
||||
"Pause");
|
||||
SimConnect_SubscribeToSystemEvent(this->simConnect,
|
||||
EVENTS::E_STATUS,
|
||||
"Sim");
|
||||
|
||||
SimConnect_MapClientEventToSimEvent(simConnect,
|
||||
SimConnect_MapClientEventToSimEvent(this->simConnect,
|
||||
EVENTS::E_TIMESEC,
|
||||
"CLOCK_SECONDS_ZERO");
|
||||
SimConnect_AddClientEventToNotificationGroup(simConnect,
|
||||
SimConnect_AddClientEventToNotificationGroup(this->simConnect,
|
||||
GROUPS::G_TIME,
|
||||
EVENTS::E_TIMESEC,
|
||||
false);
|
||||
SimConnect_SetNotificationGroupPriority(simConnect,
|
||||
SimConnect_SetNotificationGroupPriority(this->simConnect,
|
||||
GROUPS::G_TIME,
|
||||
SIMCONNECT_GROUP_PRIORITY_HIGHEST);
|
||||
SimConnect_MapClientEventToSimEvent(simConnect,
|
||||
SimConnect_MapClientEventToSimEvent(this->simConnect,
|
||||
EVENTS::E_TIMEMIN,
|
||||
"ZULU_MINUTES_SET");
|
||||
SimConnect_AddClientEventToNotificationGroup(simConnect,
|
||||
SimConnect_AddClientEventToNotificationGroup(this->simConnect,
|
||||
GROUPS::G_TIME,
|
||||
EVENTS::E_TIMEMIN,
|
||||
false);
|
||||
SimConnect_SetNotificationGroupPriority(simConnect,
|
||||
SimConnect_SetNotificationGroupPriority(this->simConnect,
|
||||
GROUPS::G_TIME,
|
||||
SIMCONNECT_GROUP_PRIORITY_HIGHEST);
|
||||
SimConnect_MapClientEventToSimEvent(simConnect,
|
||||
SimConnect_MapClientEventToSimEvent(this->simConnect,
|
||||
EVENTS::E_TIMEHRS,
|
||||
"ZULU_HOURS_SET");
|
||||
SimConnect_AddClientEventToNotificationGroup(simConnect,
|
||||
SimConnect_AddClientEventToNotificationGroup(this->simConnect,
|
||||
GROUPS::G_TIME,
|
||||
EVENTS::E_TIMEHRS,
|
||||
false);
|
||||
SimConnect_SetNotificationGroupPriority(simConnect,
|
||||
SimConnect_SetNotificationGroupPriority(this->simConnect,
|
||||
GROUPS::G_TIME,
|
||||
SIMCONNECT_GROUP_PRIORITY_HIGHEST);
|
||||
|
||||
SimConnect_AddToDataDefinition(simConnect,
|
||||
SimConnect_AddToDataDefinition(this->simConnect,
|
||||
DEFINITIONS::D_DATA,
|
||||
"BRAKE PARKING INDICATOR",
|
||||
"BOOL",
|
||||
SIMCONNECT_DATATYPE_FLOAT64,
|
||||
0,
|
||||
SIMCONNECT_UNUSED);
|
||||
SimConnect_AddToDataDefinition(simConnect,
|
||||
SimConnect_AddToDataDefinition(this->simConnect,
|
||||
DEFINITIONS::D_DATA,
|
||||
"SIM ON GROUND",
|
||||
"BOOL",
|
||||
@@ -68,14 +72,14 @@ SimConnect::SimConnect(
|
||||
0,
|
||||
SIMCONNECT_UNUSED);
|
||||
|
||||
SimConnect_AddToDataDefinition(simConnect,
|
||||
SimConnect_AddToDataDefinition(this->simConnect,
|
||||
DEFINITIONS::D_DATA,
|
||||
"EMPTY WEIGHT",
|
||||
"KILOGRAMS",
|
||||
SIMCONNECT_DATATYPE_FLOAT64,
|
||||
0,
|
||||
SIMCONNECT_UNUSED);
|
||||
SimConnect_AddToDataDefinition(simConnect,
|
||||
SimConnect_AddToDataDefinition(this->simConnect,
|
||||
DEFINITIONS::D_DATA,
|
||||
"TOTAL WEIGHT",
|
||||
"KILOGRAMS",
|
||||
@@ -83,7 +87,7 @@ SimConnect::SimConnect(
|
||||
0,
|
||||
SIMCONNECT_UNUSED);
|
||||
|
||||
SimConnect_AddToDataDefinition(simConnect,
|
||||
SimConnect_AddToDataDefinition(this->simConnect,
|
||||
DEFINITIONS::D_DATA,
|
||||
"FUEL TOTAL QUANTITY WEIGHT",
|
||||
"KILOGRAMS",
|
||||
@@ -91,14 +95,14 @@ SimConnect::SimConnect(
|
||||
0,
|
||||
SIMCONNECT_UNUSED);
|
||||
|
||||
SimConnect_AddToDataDefinition(simConnect,
|
||||
SimConnect_AddToDataDefinition(this->simConnect,
|
||||
DEFINITIONS::D_DATA,
|
||||
"PLANE HEADING DEGREES TRUE",
|
||||
"DEGREES",
|
||||
SIMCONNECT_DATATYPE_FLOAT64,
|
||||
0,
|
||||
SIMCONNECT_UNUSED);
|
||||
SimConnect_AddToDataDefinition(simConnect,
|
||||
SimConnect_AddToDataDefinition(this->simConnect,
|
||||
DEFINITIONS::D_DATA,
|
||||
"PLANE HEADING DEGREES MAGNETIC",
|
||||
"DEGREES",
|
||||
@@ -106,21 +110,21 @@ SimConnect::SimConnect(
|
||||
0,
|
||||
SIMCONNECT_UNUSED);
|
||||
|
||||
SimConnect_AddToDataDefinition(simConnect,
|
||||
SimConnect_AddToDataDefinition(this->simConnect,
|
||||
DEFINITIONS::D_DATA,
|
||||
"GROUND VELOCITY",
|
||||
"KNOTS",
|
||||
SIMCONNECT_DATATYPE_FLOAT64,
|
||||
0,
|
||||
SIMCONNECT_UNUSED);
|
||||
SimConnect_AddToDataDefinition(simConnect,
|
||||
SimConnect_AddToDataDefinition(this->simConnect,
|
||||
DEFINITIONS::D_DATA,
|
||||
"AIRSPEED INDICATED",
|
||||
"KNOTS",
|
||||
SIMCONNECT_DATATYPE_FLOAT64,
|
||||
0,
|
||||
SIMCONNECT_UNUSED);
|
||||
SimConnect_AddToDataDefinition(simConnect,
|
||||
SimConnect_AddToDataDefinition(this->simConnect,
|
||||
DEFINITIONS::D_DATA,
|
||||
"AIRSPEED BARBER POLE",
|
||||
"KNOTS",
|
||||
@@ -128,28 +132,28 @@ SimConnect::SimConnect(
|
||||
0,
|
||||
SIMCONNECT_UNUSED);
|
||||
|
||||
SimConnect_AddToDataDefinition(simConnect,
|
||||
SimConnect_AddToDataDefinition(this->simConnect,
|
||||
DEFINITIONS::D_DATA,
|
||||
"VELOCITY WORLD Y",
|
||||
"FEET/MINUTE",
|
||||
SIMCONNECT_DATATYPE_FLOAT64,
|
||||
0,
|
||||
SIMCONNECT_UNUSED);
|
||||
SimConnect_AddToDataDefinition(simConnect,
|
||||
SimConnect_AddToDataDefinition(this->simConnect,
|
||||
DEFINITIONS::D_DATA,
|
||||
"VERTICAL SPEED",
|
||||
"FEET/MINUTE",
|
||||
SIMCONNECT_DATATYPE_FLOAT64,
|
||||
0,
|
||||
SIMCONNECT_UNUSED);
|
||||
SimConnect_AddToDataDefinition(simConnect,
|
||||
SimConnect_AddToDataDefinition(this->simConnect,
|
||||
DEFINITIONS::D_DATA,
|
||||
"PLANE ALTITUDE",
|
||||
"FEET",
|
||||
SIMCONNECT_DATATYPE_FLOAT64,
|
||||
0,
|
||||
SIMCONNECT_UNUSED);
|
||||
SimConnect_AddToDataDefinition(simConnect,
|
||||
SimConnect_AddToDataDefinition(this->simConnect,
|
||||
DEFINITIONS::D_DATA,
|
||||
"PLANE ALT ABOVE GROUND",
|
||||
"FEET",
|
||||
@@ -157,14 +161,14 @@ SimConnect::SimConnect(
|
||||
0,
|
||||
SIMCONNECT_UNUSED);
|
||||
|
||||
SimConnect_AddToDataDefinition(simConnect,
|
||||
SimConnect_AddToDataDefinition(this->simConnect,
|
||||
DEFINITIONS::D_DATA,
|
||||
"PLANE LATITUDE",
|
||||
"DEGREES",
|
||||
SIMCONNECT_DATATYPE_FLOAT64,
|
||||
0,
|
||||
SIMCONNECT_UNUSED);
|
||||
SimConnect_AddToDataDefinition(simConnect,
|
||||
SimConnect_AddToDataDefinition(this->simConnect,
|
||||
DEFINITIONS::D_DATA,
|
||||
"PLANE LONGITUDE",
|
||||
"DEGREES",
|
||||
@@ -172,7 +176,7 @@ SimConnect::SimConnect(
|
||||
0,
|
||||
SIMCONNECT_UNUSED);
|
||||
|
||||
SimConnect_AddToDataDefinition(simConnect,
|
||||
SimConnect_AddToDataDefinition(this->simConnect,
|
||||
DEFINITIONS::D_DATA,
|
||||
"ABSOLUTE TIME",
|
||||
"SECONDS",
|
||||
@@ -180,28 +184,28 @@ SimConnect::SimConnect(
|
||||
0,
|
||||
SIMCONNECT_UNUSED);
|
||||
|
||||
SimConnect_AddToDataDefinition(simConnect,
|
||||
SimConnect_AddToDataDefinition(this->simConnect,
|
||||
DEFINITIONS::D_DATA,
|
||||
"ENG FUEL FLOW PPH:1",
|
||||
"KILOGRAMS PER SECOND",
|
||||
SIMCONNECT_DATATYPE_FLOAT64,
|
||||
0,
|
||||
SIMCONNECT_UNUSED);
|
||||
SimConnect_AddToDataDefinition(simConnect,
|
||||
SimConnect_AddToDataDefinition(this->simConnect,
|
||||
DEFINITIONS::D_DATA,
|
||||
"ENG FUEL FLOW PPH:2",
|
||||
"KILOGRAMS PER SECOND",
|
||||
SIMCONNECT_DATATYPE_FLOAT64,
|
||||
0,
|
||||
SIMCONNECT_UNUSED);
|
||||
SimConnect_AddToDataDefinition(simConnect,
|
||||
SimConnect_AddToDataDefinition(this->simConnect,
|
||||
DEFINITIONS::D_DATA,
|
||||
"ENG FUEL FLOW PPH:3",
|
||||
"KILOGRAMS PER SECOND",
|
||||
SIMCONNECT_DATATYPE_FLOAT64,
|
||||
0,
|
||||
SIMCONNECT_UNUSED);
|
||||
SimConnect_AddToDataDefinition(simConnect,
|
||||
SimConnect_AddToDataDefinition(this->simConnect,
|
||||
DEFINITIONS::D_DATA,
|
||||
"ENG FUEL FLOW PPH:4",
|
||||
"KILOGRAMS PER SECOND",
|
||||
@@ -209,21 +213,21 @@ SimConnect::SimConnect(
|
||||
0,
|
||||
SIMCONNECT_UNUSED);
|
||||
|
||||
SimConnect_AddToDataDefinition(simConnect,
|
||||
SimConnect_AddToDataDefinition(this->simConnect,
|
||||
DEFINITIONS::D_DATA,
|
||||
"BRAKE INDICATOR",
|
||||
"POSITION",
|
||||
SIMCONNECT_DATATYPE_INT32,
|
||||
0,
|
||||
SIMCONNECT_UNUSED);
|
||||
SimConnect_AddToDataDefinition(simConnect,
|
||||
SimConnect_AddToDataDefinition(this->simConnect,
|
||||
DEFINITIONS::D_DATA,
|
||||
"BRAKE PARKING POSITION",
|
||||
"POSITION",
|
||||
SIMCONNECT_DATATYPE_INT32,
|
||||
0,
|
||||
SIMCONNECT_UNUSED);
|
||||
SimConnect_AddToDataDefinition(simConnect,
|
||||
SimConnect_AddToDataDefinition(this->simConnect,
|
||||
DEFINITIONS::D_DATA,
|
||||
"BRAKE LEFT POSITION",
|
||||
"POSITION",
|
||||
@@ -231,7 +235,7 @@ SimConnect::SimConnect(
|
||||
0,
|
||||
SIMCONNECT_UNUSED);
|
||||
|
||||
SimConnect_AddToDataDefinition(simConnect,
|
||||
SimConnect_AddToDataDefinition(this->simConnect,
|
||||
DEFINITIONS::D_DATA,
|
||||
"ZULU TIME",
|
||||
"SECONDS",
|
||||
@@ -239,7 +243,7 @@ SimConnect::SimConnect(
|
||||
0,
|
||||
SIMCONNECT_UNUSED);
|
||||
|
||||
SimConnect_AddToDataDefinition(simConnect,
|
||||
SimConnect_AddToDataDefinition(this->simConnect,
|
||||
DEFINITIONS::D_DATA,
|
||||
"G FORCE",
|
||||
"GForce",
|
||||
@@ -247,21 +251,21 @@ SimConnect::SimConnect(
|
||||
0,
|
||||
SIMCONNECT_UNUSED);
|
||||
|
||||
SimConnect_AddToDataDefinition(simConnect,
|
||||
SimConnect_AddToDataDefinition(this->simConnect,
|
||||
DEFINITIONS::D_PORT,
|
||||
"PLANE HEADING DEGREES TRUE",
|
||||
"DEGREES",
|
||||
SIMCONNECT_DATATYPE_FLOAT64,
|
||||
0,
|
||||
SIMCONNECT_UNUSED);
|
||||
SimConnect_AddToDataDefinition(simConnect,
|
||||
SimConnect_AddToDataDefinition(this->simConnect,
|
||||
DEFINITIONS::D_PORT,
|
||||
"PLANE LATITUDE",
|
||||
"DEGREES",
|
||||
SIMCONNECT_DATATYPE_FLOAT64,
|
||||
0,
|
||||
SIMCONNECT_UNUSED);
|
||||
SimConnect_AddToDataDefinition(simConnect,
|
||||
SimConnect_AddToDataDefinition(this->simConnect,
|
||||
DEFINITIONS::D_PORT,
|
||||
"PLANE LONGITUDE",
|
||||
"DEGREES",
|
||||
@@ -269,7 +273,67 @@ SimConnect::SimConnect(
|
||||
0,
|
||||
SIMCONNECT_UNUSED);
|
||||
|
||||
SimConnect_RequestDataOnSimObject(simConnect,
|
||||
#ifdef MSFS
|
||||
SimConnect_AddToFacilityDefinition(this->simConnect,
|
||||
D_FACILITY,
|
||||
"OPEN AIRPORT");
|
||||
SimConnect_AddToFacilityDefinition(this->simConnect,
|
||||
D_FACILITY,
|
||||
"LATITUDE");
|
||||
SimConnect_AddToFacilityDefinition(this->simConnect,
|
||||
D_FACILITY,
|
||||
"LONGITUDE");
|
||||
SimConnect_AddToFacilityDefinition(this->simConnect, D_FACILITY, "NAME");
|
||||
|
||||
SimConnect_AddToFacilityDefinition(this->simConnect,
|
||||
D_FACILITY,
|
||||
"OPEN RUNWAY");
|
||||
SimConnect_AddToFacilityDefinition(this->simConnect,
|
||||
D_FACILITY,
|
||||
"LATITUDE");
|
||||
SimConnect_AddToFacilityDefinition(this->simConnect,
|
||||
D_FACILITY,
|
||||
"LONGITUDE");
|
||||
SimConnect_AddToFacilityDefinition(this->simConnect, D_FACILITY, "HEADING");
|
||||
SimConnect_AddToFacilityDefinition(this->simConnect, D_FACILITY, "LENGTH");
|
||||
SimConnect_AddToFacilityDefinition(this->simConnect, D_FACILITY, "WIDTH");
|
||||
SimConnect_AddToFacilityDefinition(this->simConnect,
|
||||
D_FACILITY,
|
||||
"PRIMARY_NUMBER");
|
||||
SimConnect_AddToFacilityDefinition(this->simConnect,
|
||||
D_FACILITY,
|
||||
"PRIMARY_DESIGNATOR");
|
||||
SimConnect_AddToFacilityDefinition(this->simConnect,
|
||||
D_FACILITY,
|
||||
"SECONDARY_NUMBER");
|
||||
SimConnect_AddToFacilityDefinition(this->simConnect,
|
||||
D_FACILITY,
|
||||
"SECONDARY_DESIGNATOR");
|
||||
SimConnect_AddToFacilityDefinition(this->simConnect,
|
||||
D_FACILITY,
|
||||
"CLOSE RUNWAY");
|
||||
|
||||
SimConnect_AddToFacilityDefinition(this->simConnect,
|
||||
D_FACILITY,
|
||||
"OPEN TAXI_PARKING");
|
||||
SimConnect_AddToFacilityDefinition(this->simConnect, D_FACILITY, "TYPE");
|
||||
SimConnect_AddToFacilityDefinition(this->simConnect, D_FACILITY, "NAME");
|
||||
SimConnect_AddToFacilityDefinition(this->simConnect, D_FACILITY, "SUFFIX");
|
||||
SimConnect_AddToFacilityDefinition(this->simConnect, D_FACILITY, "NUMBER");
|
||||
SimConnect_AddToFacilityDefinition(this->simConnect, D_FACILITY, "HEADING");
|
||||
SimConnect_AddToFacilityDefinition(this->simConnect, D_FACILITY, "RADIUS");
|
||||
SimConnect_AddToFacilityDefinition(this->simConnect, D_FACILITY, "BIAS_X");
|
||||
SimConnect_AddToFacilityDefinition(this->simConnect, D_FACILITY, "BIAS_Z");
|
||||
SimConnect_AddToFacilityDefinition(this->simConnect,
|
||||
D_FACILITY,
|
||||
"CLOSE TAXI_PARKING");
|
||||
|
||||
SimConnect_AddToFacilityDefinition(this->simConnect,
|
||||
D_FACILITY,
|
||||
"CLOSE AIRPORT");
|
||||
#endif
|
||||
|
||||
SimConnect_RequestDataOnSimObject(this->simConnect,
|
||||
REQUESTS::R_DATA,
|
||||
DEFINITIONS::D_DATA,
|
||||
SIMCONNECT_OBJECT_ID_USER,
|
||||
@@ -340,6 +404,11 @@ void SimConnect::handleMessage(std::function<void(int)> callbackOpen,
|
||||
callbackData();
|
||||
break;
|
||||
}
|
||||
#ifdef MSFS
|
||||
case SIMCONNECT_RECV_ID_FACILITY_DATA: {
|
||||
this->toLog("NavData API MSFS Message received");
|
||||
}
|
||||
#endif
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user