diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2017-12-03 22:23:08 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2017-12-04 12:19:26 +0100 |
commit | b256886a5cb9f2ae3ebda70a2045b19ed9f4233e (patch) | |
tree | 4fa1e46de224cf834a05824dc1eb86001bdb3300 /proto-fsuipc | |
parent | e89709a801e7874bc02c66848c638c6a0ccc85c1 (diff) |
api: add status check for modules
Diffstat (limited to 'proto-fsuipc')
-rw-r--r-- | proto-fsuipc/ftnoir_protocol_fsuipc.cpp | 19 | ||||
-rw-r--r-- | proto-fsuipc/ftnoir_protocol_fsuipc.h | 7 |
2 files changed, 7 insertions, 19 deletions
diff --git a/proto-fsuipc/ftnoir_protocol_fsuipc.cpp b/proto-fsuipc/ftnoir_protocol_fsuipc.cpp index 959408fe..b5259581 100644 --- a/proto-fsuipc/ftnoir_protocol_fsuipc.cpp +++ b/proto-fsuipc/ftnoir_protocol_fsuipc.cpp @@ -144,23 +144,14 @@ void fsuipc::pose(const double *headpose ) { prevRotZ = virtRotZ; } -bool fsuipc::correct() +module_status fsuipc::check_status() { - qDebug() << "correct says: Starting Function"; - - // - // Load the DLL. - // FSUIPCLib.setFileName( s.LocationOfDLL ); - if (FSUIPCLib.load() != true) { - qDebug() << "correct says: Error loading FSUIPC DLL"; - return false; - } - else { - qDebug() << "correct says: FSUIPC DLL loaded."; - } - return true; + if (FSUIPCLib.load() != true) + return error(QCoreApplication::translate("fsuipc", "Can't load fsuipc at '%1'").arg(s.LocationOfDLL)); + else + return status_ok(); } OPENTRACK_DECLARE_PROTOCOL(fsuipc, FSUIPCControls, fsuipcDll) diff --git a/proto-fsuipc/ftnoir_protocol_fsuipc.h b/proto-fsuipc/ftnoir_protocol_fsuipc.h index cd2ed9a7..54171ce7 100644 --- a/proto-fsuipc/ftnoir_protocol_fsuipc.h +++ b/proto-fsuipc/ftnoir_protocol_fsuipc.h @@ -50,12 +50,9 @@ class fsuipc : public IProtocol public: fsuipc(); ~fsuipc() override; - bool correct(); + module_status check_status() override; void pose(const double* headpose); - QString game_name() - { - return QCoreApplication::translate("fsuipc", "Microsoft Flight Simulator X"); - } + QString game_name() { return QCoreApplication::translate("fsuipc", "Microsoft Flight Simulator X"); } private: QLibrary FSUIPCLib; double prevPosX, prevPosY, prevPosZ, prevRotX, prevRotY, prevRotZ; |