mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-30 11:55:35 +08:00
Formatting, comments, minor tweaks, typos, Doxygen
This commit is contained in:
@@ -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