81 lines
1.4 KiB
C
81 lines
1.4 KiB
C
// stdafx.h : include file for standard system include files,
|
|
// or project specific include files that are used frequently, but
|
|
// are changed infrequently
|
|
//
|
|
|
|
#pragma once
|
|
|
|
#include <windows.h>
|
|
#include <tchar.h>
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <strsafe.h>
|
|
#include <inttypes.h>
|
|
|
|
#include "SimConnect.h"
|
|
#include "SerialPort.h"
|
|
#include "targetver.h"
|
|
|
|
#pragma comment(lib, "SimConnect.lib")
|
|
|
|
typedef struct initialization {
|
|
uint8_t numModes;
|
|
int8_t maxRev;
|
|
char modes[3][5];
|
|
} initialization;
|
|
|
|
typedef struct values {
|
|
uint8_t mode;
|
|
int8_t leverValuesInPercent[4];
|
|
} values;
|
|
|
|
char *trimwhitespace(char *str);
|
|
char *readLine(FILE *file);
|
|
|
|
// Event IDs
|
|
static enum EVENT_ID {
|
|
EVENT_SIM_START,
|
|
REQUEST_SYSTEM_STATE,
|
|
};
|
|
|
|
// Data definition IDs, engines dynamically added
|
|
static enum DATA_DEFINE_ID {
|
|
DEFINITION_AC_DATA,
|
|
DEFINITION_ENGINE_ONE,
|
|
DEFINITION_ENGINE_TWO,
|
|
DEFINITION_ENGINE_THREE,
|
|
DEFINITION_ENGINE_FOUR,
|
|
};
|
|
|
|
// Request IDs
|
|
static enum REQUEST_ID {
|
|
AC_DATA_REQUEST,
|
|
};
|
|
|
|
// Struct for ac data
|
|
struct aircraftData {
|
|
double numEngines;
|
|
double lowerThrottleLimit;
|
|
};
|
|
|
|
// Structs for engines
|
|
struct engineJustThrottle {
|
|
double throttlePercent;
|
|
};
|
|
|
|
struct engineThrottleAndPropeller {
|
|
double throttlePercent;
|
|
double propellerPercent;
|
|
};
|
|
|
|
struct engineThrottleAndMixture {
|
|
double throttlePercent;
|
|
double mixturePercent;
|
|
};
|
|
|
|
struct engineAll {
|
|
double throttlePercent;
|
|
double propellerPrecent;
|
|
double mixturePercent;
|
|
};
|