mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-30 20:15:35 +08:00
Formatting, comments, minor tweaks, typos, Doxygen
This commit is contained in:
@@ -93,11 +93,11 @@ namespace BlackCore
|
||||
void statusMessage(const BlackMisc::CStatusMessage &message);
|
||||
|
||||
//! Send status messages
|
||||
//! \remarks not to be called directly, use IContextApplication::sendStatusMessages
|
||||
//! \remarks not to be called directly, use IContextApplication::sendStatusMessage(s)
|
||||
void statusMessages(const BlackMisc::CStatusMessageList &messages);
|
||||
|
||||
//! Redirect output streams as by qDebug(), qWarning(), qCritical()
|
||||
//! \remarks context mode is an important means to avoid infinite redirect loops
|
||||
//! \remarks context id is an important means to avoid infinite redirect loops
|
||||
//! never output redirected stream messages from the same context again
|
||||
void redirectedOutput(const BlackMisc::CStatusMessage &message, qint64 contextId);
|
||||
|
||||
|
||||
@@ -223,7 +223,6 @@ namespace BlackCore
|
||||
Q_ASSERT(this->m_voice);
|
||||
if (this->getRuntime()->isSlotLogForAudioEnabled()) this->getRuntime()->logSlot(Q_FUNC_INFO);
|
||||
CCallsignList callsigns = this->m_voice->getVoiceRoomCallsigns(IVoice::COM1);
|
||||
qDebug() << "1" << callsigns;
|
||||
return callsigns;
|
||||
}
|
||||
|
||||
@@ -235,7 +234,6 @@ namespace BlackCore
|
||||
Q_ASSERT(this->m_voice);
|
||||
if (this->getRuntime()->isSlotLogForAudioEnabled()) this->getRuntime()->logSlot(Q_FUNC_INFO);
|
||||
CCallsignList callsigns = this->m_voice->getVoiceRoomCallsigns(IVoice::COM2);
|
||||
qDebug() << "2" << callsigns;
|
||||
return callsigns;
|
||||
}
|
||||
|
||||
|
||||
@@ -69,7 +69,7 @@ namespace BlackCore
|
||||
this->m_network->sendIcaoCodesQuery(callsign);
|
||||
this->m_network->sendCapabilitiesQuery(callsign);
|
||||
this->m_network->sendServerQuery(callsign);
|
||||
this->sendFsipirCustomPackage(callsign);
|
||||
this->sendFsipirCustomPackage(callsign); // own aircraft model
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@@ -53,9 +53,9 @@ namespace BlackCore
|
||||
dataFileUrls << "http://info.vroute.net/vatsim-data.txt";
|
||||
this->m_vatsimDataFileReader = new CVatsimDataFileReader(dataFileUrls, this);
|
||||
this->connect(this->m_vatsimDataFileReader, &CVatsimDataFileReader::dataRead, this, &CContextNetwork::psDataFileRead);
|
||||
this->m_vatsimDataFileReader->setInterval(5 * 1000); // first read
|
||||
this->m_vatsimDataFileReader->setInterval(5 * 1000); // first read, will be fixed when first read to longer period
|
||||
|
||||
// 5. Update timer for data
|
||||
// 5. Update timer for data (network data such as frequency)
|
||||
this->m_dataUpdateTimer = new QTimer(this);
|
||||
this->connect(this->m_dataUpdateTimer, &QTimer::timeout, this, &CContextNetwork::requestDataUpdates);
|
||||
this->m_dataUpdateTimer->start(30 * 1000);
|
||||
@@ -126,7 +126,7 @@ namespace BlackCore
|
||||
{
|
||||
msgs.push_back(CStatusMessage(CStatusMessage::TypeTrafficNetwork, CStatusMessage::SeverityWarning, "Invalid user credentials"));
|
||||
}
|
||||
else if (!this->ownAircraft().getIcaoInfo().hasAircraftAndAirlineDsignator())
|
||||
else if (!this->ownAircraft().getIcaoInfo().hasAircraftAndAirlineDesignator())
|
||||
{
|
||||
msgs.push_back(CStatusMessage(CStatusMessage::TypeTrafficNetwork, CStatusMessage::SeverityWarning, "Invalid ICAO data for own aircraft"));
|
||||
}
|
||||
@@ -453,6 +453,7 @@ namespace BlackCore
|
||||
if (this->getRuntime()->isSlotLogForNetworkEnabled()) this->getRuntime()->logSlot(Q_FUNC_INFO);
|
||||
const int interval = 60 * 1000;
|
||||
if (this->m_vatsimDataFileReader->interval() < interval) this->m_vatsimDataFileReader->setInterval(interval);
|
||||
this->getIContextApplication()->sendStatusMessage(CStatusMessage::getInfoMessage("Read VATSIM data file", CStatusMessage::TypeTrafficNetwork));
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -71,6 +71,7 @@ namespace BlackCore
|
||||
|
||||
private slots:
|
||||
//! Station has been changed, needed to tune in/out voice room
|
||||
//! Set in runtime
|
||||
void changedAtcStationOnlineConnectionStatus(const BlackMisc::Aviation::CAtcStation &atcStation, bool connected);
|
||||
|
||||
private:
|
||||
|
||||
@@ -164,15 +164,15 @@ namespace BlackCore
|
||||
// connect signal / slots when enabled
|
||||
QMetaObject::Connection con;
|
||||
con = QObject::connect(this->getIContextOwnAircraft(), &IContextOwnAircraft::changedAircraftSituation,
|
||||
[this](const BlackMisc::Aviation::CAircraft & aircraft, const QString & originator) { QStringList l; l << "changedAircraftSituation" << aircraft.toQString() << originator; this->logSignal(this->getIContextApplication(), l);});
|
||||
[this](const BlackMisc::Aviation::CAircraft & aircraft, const QString & originator) { QStringList l; l << "changedAircraftSituation" << aircraft.toQString() << originator; this->logSignal(this->getIContextOwnAircraft(), l);});
|
||||
this->m_logSignalConnections.insert("ownaircraft", con);
|
||||
|
||||
con = QObject::connect(this->getIContextOwnAircraft(), &IContextOwnAircraft::changedAircraftCockpit,
|
||||
[this](const BlackMisc::Aviation::CAircraft & aircraft, const QString & originator) { QStringList l; l << "changedAircraftCockpit" << aircraft.toQString() << originator; this->logSignal(this->getIContextApplication(), l);});
|
||||
[this](const BlackMisc::Aviation::CAircraft & aircraft, const QString & originator) { QStringList l; l << "changedAircraftCockpit" << aircraft.toQString() << originator; this->logSignal(this->getIContextOwnAircraft(), l);});
|
||||
this->m_logSignalConnections.insert("ownaircraft", con);
|
||||
|
||||
con = QObject::connect(this->getIContextOwnAircraft(), &IContextOwnAircraft::changedAircraftPosition,
|
||||
[this](const BlackMisc::Aviation::CAircraft & aircraft, const QString & originator) { QStringList l; l << "changedAircraftPosition" << aircraft.toQString() << originator; this->logSignal(this->getIContextApplication(), l);});
|
||||
[this](const BlackMisc::Aviation::CAircraft & aircraft, const QString & originator) { QStringList l; l << "changedAircraftPosition" << aircraft.toQString() << originator; this->logSignal(this->getIContextOwnAircraft(), l);});
|
||||
this->m_logSignalConnections.insert("ownaircraft", con);
|
||||
}
|
||||
else
|
||||
@@ -431,13 +431,21 @@ namespace BlackCore
|
||||
Q_ASSERT(c);
|
||||
}
|
||||
|
||||
if (this->m_contextSimulator && this->m_contextSimulator->usingLocalObjects() && this->m_contextNetwork)
|
||||
if (this->m_contextSimulator && this->m_contextSimulator->usingLocalObjects() && this->getCContextSimulator()->m_simulator)
|
||||
{
|
||||
// only connect if simulator running locally, no round trips
|
||||
if (this->getCContextSimulator()->m_simulator)
|
||||
if (this->m_contextNetwork && this->m_contextNetwork->usingLocalObjects())
|
||||
{
|
||||
c = connect(this->m_contextNetwork, &IContextNetwork::changedAircraftSituation,
|
||||
this->getCContextSimulator()->m_simulator, &ISimulator::addAircraftSituation);
|
||||
this->getCContextSimulator(), &CContextSimulator::addAircraftSituation);
|
||||
Q_ASSERT(c);
|
||||
}
|
||||
|
||||
// only if own aircraft running locally
|
||||
if (this->m_contextOwnAircraft && this->m_contextOwnAircraft->usingLocalObjects())
|
||||
{
|
||||
c = connect(this->m_contextOwnAircraft, &IContextOwnAircraft::changedAircraftCockpit,
|
||||
this->getCContextSimulator(), &CContextSimulator::updateCockpitFromContext);
|
||||
Q_ASSERT(c);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -124,10 +124,30 @@ namespace BlackCore
|
||||
{
|
||||
Q_ASSERT(this->getIContextOwnAircraft());
|
||||
CAircraft aircraft = m_simulator->getOwnAircraft();
|
||||
|
||||
// the methods will check, if an update is really required
|
||||
// these are local (non DBus) calls
|
||||
this->getIContextOwnAircraft()->updateOwnSituation(aircraft.getSituation(), IContextSimulator::InterfaceName());
|
||||
this->getIContextOwnAircraft()->updateOwnCockpit(aircraft.getCom1System(), aircraft.getCom2System(), aircraft.getTransponder(), IContextSimulator::InterfaceName());
|
||||
}
|
||||
|
||||
void CContextSimulator::addAircraftSituation(const CCallsign &callsign, const CAircraftSituation &initialSituation)
|
||||
{
|
||||
Q_ASSERT(this->m_simulator);
|
||||
this->m_simulator->addAircraftSituation(callsign, initialSituation);
|
||||
}
|
||||
|
||||
void CContextSimulator::updateCockpitFromContext(const CAircraft &ownAircraft, const QString &originator)
|
||||
{
|
||||
Q_ASSERT(this->m_simulator);
|
||||
|
||||
// avoid loops
|
||||
if (originator.isEmpty() || originator == IContextSimulator::InterfaceName()) return;
|
||||
|
||||
// update
|
||||
this->m_simulator->updateOwnCockpit(ownAircraft);
|
||||
}
|
||||
|
||||
void CContextSimulator::setConnectionStatus(ISimulator::Status status)
|
||||
{
|
||||
if (status == ISimulator::Connected)
|
||||
@@ -156,7 +176,8 @@ namespace BlackCore
|
||||
if (!QLibrary::isLibrary(fileName))
|
||||
continue;
|
||||
|
||||
QPluginLoader loader(m_pluginsDir.absoluteFilePath(fileName));
|
||||
QString pluginPath = m_pluginsDir.absoluteFilePath(fileName);
|
||||
QPluginLoader loader(pluginPath);
|
||||
QObject *plugin = loader.instance();
|
||||
if (plugin)
|
||||
{
|
||||
@@ -172,6 +193,7 @@ namespace BlackCore
|
||||
else
|
||||
{
|
||||
qDebug() << loader.errorString();
|
||||
qDebug() << "Also check if required dll/libs of plugin exists";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,6 +65,10 @@ namespace BlackCore
|
||||
|
||||
//! \copydoc IContextSimulator::unloadSimulatorPlugin()
|
||||
virtual void unloadSimulatorPlugin() override;
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
} // namespace BlackCore
|
||||
|
||||
@@ -102,4 +102,4 @@ namespace BlackCore
|
||||
|
||||
Q_DECLARE_INTERFACE(BlackCore::ISimulatorFactory, "net.vatsim.PilotClient.BlackCore.SimulatorInterface")
|
||||
|
||||
#endif // BLACKCORE_SIMULATOR_H
|
||||
#endif // guard
|
||||
|
||||
@@ -56,7 +56,7 @@ namespace BlackCore
|
||||
this->m_outputEnabled.insert(COM2, true);
|
||||
this->m_currentInputDevice = this->defaultAudioInputDevice();
|
||||
this->m_currentOutputDevice = this->defaultAudioOutputDevice();
|
||||
this->m_audioOutput->setVolume(1.0);
|
||||
this->m_audioOutput->setVolume(1.0); // make sure the overall sound is not muted
|
||||
|
||||
// do processing
|
||||
this->startTimer(10);
|
||||
@@ -805,7 +805,7 @@ namespace BlackCore
|
||||
this->setVoiceRoomForUnit(comUnit, vr);
|
||||
}
|
||||
|
||||
// for disconnecting the voice room will already be
|
||||
// disconnecting the voice room will already be
|
||||
// set in leave voice room
|
||||
|
||||
m_connectionStatus.insert(comUnit, newStatus);
|
||||
|
||||
@@ -36,8 +36,8 @@ namespace BlackMisc
|
||||
const BlackMisc::PhysicalQuantities::CAngle &pitch = BlackMisc::PhysicalQuantities::CAngle(),
|
||||
const BlackMisc::PhysicalQuantities::CAngle &bank = BlackMisc::PhysicalQuantities::CAngle(),
|
||||
const BlackMisc::PhysicalQuantities::CSpeed &gs = BlackMisc::PhysicalQuantities::CSpeed())
|
||||
: m_position(position), m_altitude(altitude), m_heading(heading), m_pitch(pitch), m_bank(bank), m_groundspeed(gs),
|
||||
m_timestamp(QDateTime::currentDateTimeUtc()) {}
|
||||
: m_position(position), m_altitude(altitude), m_heading(heading), m_pitch(pitch),
|
||||
m_bank(bank), m_groundspeed(gs), m_timestamp(QDateTime::currentDateTimeUtc()) {}
|
||||
|
||||
//! \brief Properties by index
|
||||
enum ColumnIndex
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#ifndef BLACKMISC_SETTINGS_SERVER_H
|
||||
#define BLACKMISC_SETTINGS_SERVER_H
|
||||
#ifndef BLACKMISC_SETTINGS_NETWORK_H
|
||||
#define BLACKMISC_SETTINGS_NETWORK_H
|
||||
|
||||
#include "nwserverlist.h"
|
||||
#include "valueobject.h"
|
||||
@@ -18,39 +18,39 @@ namespace BlackMisc
|
||||
|
||||
namespace Settings
|
||||
{
|
||||
//! \brief Value object encapsulating information of network related settings.
|
||||
//! Value object encapsulating information of network related settings.
|
||||
//! \remarks Not only traffic network settings, but also URLs, DBus address, ...
|
||||
class CSettingsNetwork : public BlackMisc::CValueObject
|
||||
{
|
||||
public:
|
||||
//! \brief Default constructor.
|
||||
//! Default constructor.
|
||||
CSettingsNetwork();
|
||||
|
||||
//! \brief Destructor.
|
||||
//! Destructor.
|
||||
virtual ~CSettingsNetwork() {}
|
||||
|
||||
//! \brief Update
|
||||
//! Update
|
||||
static const QString &CmdSetCurrentServer()
|
||||
{
|
||||
static const QString cmd("currenttrafficserver");
|
||||
return cmd;
|
||||
}
|
||||
|
||||
//! \brief Path
|
||||
//! Path
|
||||
static const QString &ValueTrafficServers()
|
||||
{
|
||||
static const QString value("trafficservers");
|
||||
return value;
|
||||
}
|
||||
|
||||
//! \brief Path
|
||||
//! Path
|
||||
static const QString &ValueBookingServiceUrl()
|
||||
{
|
||||
static const QString value("bookingserviceurl");
|
||||
return value;
|
||||
}
|
||||
|
||||
//! \brief Path
|
||||
//! Path
|
||||
static const QString &ValueDBusServerAddress()
|
||||
{
|
||||
static const QString value("dbuserveraddress");
|
||||
@@ -63,28 +63,28 @@ namespace BlackMisc
|
||||
return QVariant::fromValue(*this);
|
||||
}
|
||||
|
||||
//! \brief Value object, traffic network server objects
|
||||
//! Value object, traffic network server objects
|
||||
BlackMisc::Network::CServerList getTrafficNetworkServers() const { return m_trafficNetworkServers; }
|
||||
|
||||
//! \brief Selected traffic network server
|
||||
//! Selected traffic network server
|
||||
BlackMisc::Network::CServer getCurrentTrafficNetworkServer() const { return m_trafficNetworkServerCurrent; }
|
||||
|
||||
//! \brief URL of booking service
|
||||
//! URL of booking service
|
||||
QString getBookingServiceUrl() const { return m_bookingServiceUrl; }
|
||||
|
||||
//! \brief Address for DBus Server
|
||||
//! Address for DBus Server
|
||||
QString getDBusServerAddress() const { return m_dbusServerAddress; }
|
||||
|
||||
//! \brief Selected traffic network server
|
||||
//! Selected traffic network server
|
||||
bool setCurrentNetworkServer(const BlackMisc::Network::CServer ¤tServer);
|
||||
|
||||
//! \brief Traffic network server objects
|
||||
//! Traffic network server objects
|
||||
void addTrafficNetworkServer(const BlackMisc::Network::CServer &server) { m_trafficNetworkServers.push_back(server); }
|
||||
|
||||
//! \brief Equal operator ==
|
||||
//! Equal operator ==
|
||||
bool operator ==(const CSettingsNetwork &other) const;
|
||||
|
||||
//! \brief Unequal operator !=
|
||||
//! Unequal operator !=
|
||||
bool operator !=(const CSettingsNetwork &other) const;
|
||||
|
||||
//! \copydoc BlackCore::IContextSettings
|
||||
@@ -99,10 +99,10 @@ namespace BlackMisc
|
||||
//! \copydoc CValueObject::fromJson
|
||||
virtual void fromJson(const QJsonObject &json) override;
|
||||
|
||||
//! \brief init with meaningful default values
|
||||
//! Init with meaningful default values
|
||||
void initDefaultValues();
|
||||
|
||||
//! \brief Register metadata
|
||||
//! \copydoc CValueObject::registerMetadata
|
||||
static void registerMetadata();
|
||||
|
||||
//! \copydoc TupleConverter<>::jsonMembers()
|
||||
|
||||
@@ -27,21 +27,13 @@ namespace BlackMisc
|
||||
class CVoiceRoomList : public CSequence<CVoiceRoom>
|
||||
{
|
||||
public:
|
||||
/*!
|
||||
* \brief Default constructor.
|
||||
*/
|
||||
//! Default constructor.
|
||||
CVoiceRoomList();
|
||||
|
||||
/*!
|
||||
* \brief Construct from a base class object.
|
||||
* \param other
|
||||
*/
|
||||
//! Construct from a base class object.
|
||||
CVoiceRoomList(const CSequence &other);
|
||||
|
||||
/*!
|
||||
* \brief QVariant, required for DBus QVariant lists
|
||||
* \return
|
||||
*/
|
||||
//! \copydoc CValueObject::asQVariant
|
||||
virtual QVariant asQVariant() const
|
||||
{
|
||||
return QVariant::fromValue(*this);
|
||||
|
||||
@@ -24,7 +24,6 @@ else: PRE_TARGETDEPS += ../../lib/libblackmisc.a
|
||||
|
||||
HEADERS += *.h
|
||||
SOURCES += *.cpp
|
||||
|
||||
HEADERS += $$PWD/fscommon/*.h
|
||||
SOURCES += $$PWD/fscommon/*.cpp
|
||||
|
||||
|
||||
@@ -19,6 +19,8 @@ namespace BlackSimPlugin
|
||||
namespace Fsx
|
||||
{
|
||||
//! \brief Data struct of our own aircraft
|
||||
//! \sa SimConnect variables http://msdn.microsoft.com/en-us/library/cc526981.aspx
|
||||
//! \sa SimConnect events http://msdn.microsoft.com/en-us/library/cc526980.aspx
|
||||
struct DataDefinitionOwnAircraft
|
||||
{
|
||||
double latitude; //!< Latitude
|
||||
@@ -36,25 +38,26 @@ namespace BlackSimPlugin
|
||||
double com2StandbyMHz; //!< COM1 standby frequency
|
||||
};
|
||||
|
||||
//! \brief Data struct of aircraft position
|
||||
//! Data struct of aircraft position
|
||||
struct DataDefinitionRemoteAircraftSituation
|
||||
{
|
||||
SIMCONNECT_DATA_INITPOSITION position; //!< Position struct
|
||||
};
|
||||
|
||||
//! \brief Data struct of aircraft position
|
||||
//! Data struct of aircraft position
|
||||
struct DataDefinitionGearHandlePosition
|
||||
{
|
||||
qint32 gearHandlePosition; //!< Bool, 1 if gear handle is applied otherwise 0
|
||||
};
|
||||
|
||||
//! \brief Handles SimConnect data definitions
|
||||
//! Handles SimConnect data definitions
|
||||
class CSimConnectDataDefinition
|
||||
{
|
||||
public:
|
||||
|
||||
//! \brief SimConnect definiton ID's
|
||||
enum DataDefiniton {
|
||||
//! SimConnect definiton IDs
|
||||
enum DataDefiniton
|
||||
{
|
||||
DataOwnAircraft,
|
||||
DataDefinitionRemoteAircraftSituation,
|
||||
DataDefinitionGearHandlePosition
|
||||
@@ -66,38 +69,23 @@ namespace BlackSimPlugin
|
||||
RequestRemoveAircraft = 2000
|
||||
};
|
||||
|
||||
//! \brief Constructor
|
||||
|
||||
//! Constructor
|
||||
CSimConnectDataDefinition();
|
||||
|
||||
/*!
|
||||
* \brief Initialize all data definitions
|
||||
* \param hSimConnect
|
||||
* \return
|
||||
*/
|
||||
//! Initialize all data definitions
|
||||
static HRESULT initDataDefinitions(const HANDLE hSimConnect);
|
||||
|
||||
/*!
|
||||
* \brief Initialize data definition for our own aircraft
|
||||
* \param hSimConnect
|
||||
* \return
|
||||
*/
|
||||
//! Initialize data definition for our own aircraft
|
||||
static HRESULT initOwnAircraft(const HANDLE hSimConnect);
|
||||
|
||||
/*!
|
||||
* \brief Initialize data definition for remote aircrafts
|
||||
* \param hSimConnect
|
||||
* \return
|
||||
*/
|
||||
//! Initialize data definition for remote aircrafts
|
||||
static HRESULT initRemoteAircraftSituation(const HANDLE hSimConnect);
|
||||
|
||||
/*!
|
||||
* \brief Initialize data definition for remote aircraft configuration
|
||||
* \param hSimConnect
|
||||
* \return
|
||||
*/
|
||||
//! Initialize data definition for remote aircraft configuration
|
||||
static HRESULT initGearHandlePosition(const HANDLE hSimConnect);
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // BLACKSIMPLUGIN_FSX_SIMCONNECT_DATADEFINITION_H
|
||||
#endif // guard
|
||||
|
||||
@@ -317,7 +317,7 @@ namespace BlackSimPlugin
|
||||
}
|
||||
}
|
||||
|
||||
if ( it == m_simConnectObjects.end() )
|
||||
if (it == m_simConnectObjects.end())
|
||||
return;
|
||||
|
||||
(*it).setObjectId(objectID);
|
||||
@@ -347,7 +347,7 @@ namespace BlackSimPlugin
|
||||
|
||||
void CSimulatorFsx::connectToFinished()
|
||||
{
|
||||
if( m_watcherConnect.result() )
|
||||
if (m_watcherConnect.result())
|
||||
{
|
||||
initSystemEvents();
|
||||
initDataDefinitions();
|
||||
|
||||
@@ -27,7 +27,7 @@ namespace BlackSimPlugin
|
||||
{
|
||||
namespace Fsx
|
||||
{
|
||||
//! \brief Factory implementation to create CSimulatorFsx instances
|
||||
//! Factory implementation to create CSimulatorFsx instances
|
||||
class Q_DECL_EXPORT CSimulatorFsxFactory : public QObject, public BlackCore::ISimulatorFactory
|
||||
{
|
||||
Q_OBJECT
|
||||
@@ -42,7 +42,7 @@ namespace BlackSimPlugin
|
||||
virtual BlackSim::CSimulatorInfo getSimulatorInfo() const override;
|
||||
};
|
||||
|
||||
//! \brief SimConnect Event ID's
|
||||
//! SimConnect Event ID's
|
||||
enum EVENT_ID
|
||||
{
|
||||
EVENT_SIM_STATUS,
|
||||
@@ -55,12 +55,12 @@ namespace BlackSimPlugin
|
||||
EVENT_FREEZEATT
|
||||
};
|
||||
|
||||
//! \brief FSX Simulator Implementation
|
||||
//! FSX Simulator Implementation
|
||||
class CSimulatorFsx : public BlackCore::ISimulator
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
//! \brief Constructor
|
||||
//! Constructor
|
||||
CSimulatorFsx(QObject *parent = nullptr);
|
||||
|
||||
virtual ~CSimulatorFsx();
|
||||
@@ -71,12 +71,7 @@ namespace BlackSimPlugin
|
||||
//! \copydoc ISimulator::canConnect()
|
||||
virtual bool canConnect() override;
|
||||
|
||||
/*!
|
||||
* \brief SimConnect Callback
|
||||
* \param pData
|
||||
* \param cbData
|
||||
* \param pContext
|
||||
*/
|
||||
//! SimConnect Callback
|
||||
static void CALLBACK SimConnectProc(SIMCONNECT_RECV *pData, DWORD cbData, void *pContext);
|
||||
|
||||
public slots:
|
||||
@@ -131,34 +126,29 @@ namespace BlackSimPlugin
|
||||
void onSimExit();
|
||||
|
||||
protected:
|
||||
//! \brief Timer event
|
||||
//! Timer event
|
||||
virtual void timerEvent(QTimerEvent *event);
|
||||
|
||||
private slots:
|
||||
|
||||
//! \brief Dispatch SimConnect messages
|
||||
//! Dispatch SimConnect messages
|
||||
void dispatch();
|
||||
|
||||
//! \brief Called when asynchronous connection to Simconnect has finished
|
||||
//! Called when asynchronous connection to Simconnect has finished
|
||||
void connectToFinished();
|
||||
|
||||
private:
|
||||
|
||||
//! Remove a remote aircraft
|
||||
void removeRemoteAircraft(const CSimConnectObject &simObject);
|
||||
|
||||
/*!
|
||||
* \brief Initialize SimConnect system events
|
||||
* \return
|
||||
*/
|
||||
//! Initialize SimConnect system events
|
||||
HRESULT initSystemEvents();
|
||||
|
||||
/*!
|
||||
* \brief Initialize SimConnect data definitions
|
||||
* \return
|
||||
*/
|
||||
//! Initialize SimConnect data definitions
|
||||
HRESULT initDataDefinitions();
|
||||
|
||||
void update();
|
||||
void update(); // TODO: @RW, please rename, update is meaningless
|
||||
|
||||
bool m_isConnected; //!< Is sim connected
|
||||
bool m_simRunning; //!< Sim running.
|
||||
|
||||
Reference in New Issue
Block a user