6 #ifndef SWIFT_SIMPLUGIN_FSUIPC_H
7 #define SWIFT_SIMPLUGIN_FSUIPC_H
14 namespace swift::simplugin::fscommon
23 CFsuipc(QObject *parent =
nullptr);
29 bool open(
bool force =
false);
35 bool isOpened()
const;
44 bool setSimulatorTime(
int hour,
int minute);
47 QString getVersion()
const;
61 static const QStringList errors({
63 "Attempt to Open when already Open",
64 "Cannot link to FSUIPC or WideClient",
65 "Failed to Register common message with Windows",
66 "Failed to create Atom for mapping filename",
67 "Failed to create a file mapping object",
68 "Failed to open a view to the file map",
69 "Incorrect version of FSUIPC, or not FSUIPC",
70 "Sim is not version requested",
71 "Call cannot execute, link not Open",
72 "Call cannot execute: no requests accumulated",
73 "IPC timed out all retries",
74 "IPC sendmessage failed all retries",
75 "IPC request contains bad data",
76 "Maybe running on WideClient, but FS not running on Server, or wrong FSUIPC",
77 "Read or Write request cannot be added, memory for Process is full",
85 if (index >= 0 && index < errorMessages().size()) {
return errorMessages().at(index); }
86 static const QString unknown(
"Unknown error message index");
93 static const QStringList sims(
94 {
"any",
"FS98",
"FS2000",
"CFS2",
"CFS1",
"Fly!",
"FS2002",
"FS2004",
"FSX",
"ESP",
"P3D" });
101 if (index >= 0 && index < simulators().size()) {
return simulators().at(index); }
102 static const QString unknown(
"Unknown simulator index");
107 bool m_opened =
false;
109 int m_closeCount = 0;
110 int m_lastErrorIndex = 0;
111 QString m_lastErrorMessage;
112 QString m_fsuipcVersion;
114 unsigned int m_lastTimestamp = 0;
117 static double intToFractional(
double fractional);
Comprehensive information of an aircraft.
Class representing a FSUIPC "interface".
static const QString & simulator(int index)
Simulator for index.
static const QStringList & errorMessages()
Error messages.
static const QString & errorMessage(int index)
Message for index.
static const QStringList & simulators()
Simulators.
#define FSCOMMON_EXPORT
FSCommon Export Macro.