Kilian Kurt Hofmann 9a11896358 OnGround now works
MISSING:
Send of rev only if on ground
Send not more than max forwards / max reverse (ON ARDUINO?)
2017-01-15 22:46:02 +01:00

73 lines
1.3 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_ON_GROUND,
DEFINITION_AC_DATA,
DEFINITION_ENGINE_ONE,
DEFINITION_ENGINE_TWO,
DEFINITION_ENGINE_THREE,
DEFINITION_ENGINE_FOUR,
};
// Request IDs
static enum REQUEST_ID {
AC_DATA_REQUEST,
AC_ON_GROUND_REQUEST,
};
// Struct for ac data
struct aircraftData {
double numEngines;
double lowerThrottleLimit;
};
struct acOnGround {
double onGround;
};
// Structs for engines
struct engineAll {
double throttlePercent;
double propellerPrecent;
double mixturePercent;
};