Ref T410, show number of SB4 packets received under simulator/information

This commit is contained in:
Klaus Basan
2018-11-14 20:18:05 +01:00
parent 3eb46690c0
commit b452cd7530
7 changed files with 36 additions and 1 deletions

View File

@@ -696,6 +696,10 @@ namespace BlackSimPlugin
{
this->physicallyInitAITerrainProbes(position, 2);
}
// SB4 offsets
m_simulatorInternals.setValue(QStringLiteral("fsx/sb4"), boolToEnabledDisabled(m_useSbOffsets));
m_simulatorInternals.setValue(QStringLiteral("fsx/sb4packets"), m_useSbOffsets ? QString::number(m_sbDataReceived) : QStringLiteral("disabled"));
}
m_ownAircraftUpdate++; // with 50updates/sec long enough even for 32bit
@@ -2242,6 +2246,12 @@ namespace BlackSimPlugin
}
}
void CSimulatorFsxCommon::onOwnModelChanged(const CAircraftModel &newModel)
{
m_sbDataReceived = 0;
CSimulatorFsCommon::onOwnModelChanged(newModel);
}
QString CSimulatorFsxCommon::fsxPositionToString(const SIMCONNECT_DATA_INITPOSITION &position)
{
static const QString positionStr("Lat: %1deg lng: %2deg alt: %3ft pitch: %4deg bank: %5deg hdg: %6deg airspeed: %7kts onGround: %8");

View File

@@ -178,6 +178,10 @@ namespace BlackSimPlugin
//! Use SB offset values
void setUsingSbOffsetValues(bool use) { m_useSbOffsets = use; }
//! Number of received SB4 packets
//! \remark if this is increasing, SB4 is supported
int receivedSB4Packets() const { return m_sbDataReceived; }
//! Request for sim data (request in range of sim data)?
static bool isRequestForSimObjAircraft(DWORD requestId) { return requestId >= RequestSimObjAircraftStart && requestId <= RequestSimObjAircraftRangeEnd; }
@@ -217,6 +221,7 @@ namespace BlackSimPlugin
virtual void initSimulatorInternals() override;
virtual void injectWeatherGrid(const BlackMisc::Weather::CWeatherGrid &weatherGrid) override;
virtual void clearAllRemoteAircraftData() override;
virtual void onOwnModelChanged(const BlackMisc::Simulation::CAircraftModel &newModel) override;
//! @}
//! Timer event (our SimConnect event loop), runs dispatch