mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-14 16:55:36 +08:00
Ref T275, used "pending" function (FSX/P3D) to check if we can request position data
This commit is contained in:
@@ -155,6 +155,9 @@ namespace BlackSimPlugin
|
|||||||
//! Marked as pending for removal
|
//! Marked as pending for removal
|
||||||
void setPendingRemoved(bool pending);
|
void setPendingRemoved(bool pending);
|
||||||
|
|
||||||
|
//! Pending added or removed?
|
||||||
|
bool isPending() const { return this->isPendingAdded() || this->isPendingRemoved(); }
|
||||||
|
|
||||||
//! Reset the state (like it was a new onject) without affecting interpolator and aircraft
|
//! Reset the state (like it was a new onject) without affecting interpolator and aircraft
|
||||||
void resetState();
|
void resetState();
|
||||||
|
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ namespace BlackSimPlugin
|
|||||||
|
|
||||||
bool CSimulatorFsxCommon::isConnected() const
|
bool CSimulatorFsxCommon::isConnected() const
|
||||||
{
|
{
|
||||||
return m_simConnected;
|
return m_simConnected && m_hSimConnect;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CSimulatorFsxCommon::isSimulating() const
|
bool CSimulatorFsxCommon::isSimulating() const
|
||||||
@@ -1646,8 +1646,7 @@ namespace BlackSimPlugin
|
|||||||
{
|
{
|
||||||
if (this->isShuttingDownOrDisconnected()) { return false; }
|
if (this->isShuttingDownOrDisconnected()) { return false; }
|
||||||
if (!simObject.hasValidRequestAndObjectId()) { return false; }
|
if (!simObject.hasValidRequestAndObjectId()) { return false; }
|
||||||
if (simObject.isPendingRemoved()) { return false; }
|
if (simObject.isPending()) { return false; } // wait until confirmed
|
||||||
if (!m_hSimConnect) { return false; }
|
|
||||||
if (simObject.getSimDataPeriod() == period) { return true; } // already queried like this
|
if (simObject.getSimDataPeriod() == period) { return true; } // already queried like this
|
||||||
|
|
||||||
// always request, not only when something has changed
|
// always request, not only when something has changed
|
||||||
|
|||||||
Reference in New Issue
Block a user