mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-05-05 17:55:45 +08:00
Ref T650, also remember SB offset setting
This commit is contained in:
@@ -645,7 +645,8 @@ namespace BlackMisc
|
|||||||
QString CFsxP3DSettings::convertToQString(bool i18n) const
|
QString CFsxP3DSettings::convertToQString(bool i18n) const
|
||||||
{
|
{
|
||||||
Q_UNUSED(i18n);
|
Q_UNUSED(i18n);
|
||||||
return u"SimulatedObject: " % boolToYesNo(m_useSimulatedObjectAdding);
|
return u"SimulatedObject: " % boolToYesNo(m_useSimulatedObjectAdding) %
|
||||||
|
u" SB offsets: " % boolToYesNo(m_useSbOffsets);
|
||||||
}
|
}
|
||||||
|
|
||||||
CVariant CFsxP3DSettings::propertyByIndex(const CPropertyIndex &index) const
|
CVariant CFsxP3DSettings::propertyByIndex(const CPropertyIndex &index) const
|
||||||
|
|||||||
@@ -128,12 +128,24 @@ namespace BlackMisc
|
|||||||
//! Default constructor
|
//! Default constructor
|
||||||
CFsxP3DSettings() {}
|
CFsxP3DSettings() {}
|
||||||
|
|
||||||
|
//! Constructor
|
||||||
|
CFsxP3DSettings(bool simulatedObject, bool sbOffsets) :
|
||||||
|
m_useSimulatedObjectAdding(simulatedObject),
|
||||||
|
m_useSbOffsets(sbOffsets)
|
||||||
|
{}
|
||||||
|
|
||||||
//! Use simulated object adding
|
//! Use simulated object adding
|
||||||
void setAddingAsSimulatedObjectEnabled(bool enable) { m_useSimulatedObjectAdding = enable; }
|
void setAddingAsSimulatedObjectEnabled(bool enable) { m_useSimulatedObjectAdding = enable; }
|
||||||
|
|
||||||
//! Use simulated object adding
|
//! Use simulated object adding
|
||||||
bool isAddingAsSimulatedObjectEnabled() const { return m_useSimulatedObjectAdding; }
|
bool isAddingAsSimulatedObjectEnabled() const { return m_useSimulatedObjectAdding; }
|
||||||
|
|
||||||
|
//! Use SB offsets?
|
||||||
|
void setSbOffsetsEnabled(bool enable) { m_useSbOffsets = enable; }
|
||||||
|
|
||||||
|
//! Are SB offsets enabled
|
||||||
|
bool isSbOffsetsEnabled() const { return m_useSbOffsets; }
|
||||||
|
|
||||||
//! \copydoc BlackMisc::Mixin::String::toQString
|
//! \copydoc BlackMisc::Mixin::String::toQString
|
||||||
QString convertToQString(bool i18n = false) const;
|
QString convertToQString(bool i18n = false) const;
|
||||||
|
|
||||||
@@ -144,11 +156,13 @@ namespace BlackMisc
|
|||||||
void setPropertyByIndex(const CPropertyIndex &index, const CVariant &variant);
|
void setPropertyByIndex(const CPropertyIndex &index, const CVariant &variant);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool m_useSimulatedObjectAdding = false; //!< COM integration
|
bool m_useSimulatedObjectAdding = false; //!< COM integration
|
||||||
|
bool m_useSbOffsets = true; //!< use the SB offset
|
||||||
|
|
||||||
BLACK_METACLASS(
|
BLACK_METACLASS(
|
||||||
CFsxP3DSettings,
|
CFsxP3DSettings,
|
||||||
BLACK_METAMEMBER(useSimulatedObjectAdding)
|
BLACK_METAMEMBER(useSimulatedObjectAdding),
|
||||||
|
BLACK_METAMEMBER(useSbOffsets)
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -302,7 +316,7 @@ namespace BlackMisc
|
|||||||
//! \copydoc BlackMisc::TSettingTrait::defaultValue
|
//! \copydoc BlackMisc::TSettingTrait::defaultValue
|
||||||
static const CFsxP3DSettings &defaultValue()
|
static const CFsxP3DSettings &defaultValue()
|
||||||
{
|
{
|
||||||
static const CFsxP3DSettings d;
|
static const CFsxP3DSettings d(true, true);
|
||||||
return d;
|
return d;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -319,7 +333,7 @@ namespace BlackMisc
|
|||||||
//! \copydoc BlackMisc::TSettingTrait::defaultValue
|
//! \copydoc BlackMisc::TSettingTrait::defaultValue
|
||||||
static const CFsxP3DSettings &defaultValue()
|
static const CFsxP3DSettings &defaultValue()
|
||||||
{
|
{
|
||||||
static const CFsxP3DSettings d;
|
static const CFsxP3DSettings d(false, true);
|
||||||
return d;
|
return d;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ namespace BlackSimPlugin
|
|||||||
const bool localSim = fsxOrP3D;
|
const bool localSim = fsxOrP3D;
|
||||||
if (fsxOrP3D)
|
if (fsxOrP3D)
|
||||||
{
|
{
|
||||||
ui->cb_TraceSimConnectCalls->setChecked(fsxOrP3D->isTracingSendId());
|
ui->cb_TraceSimConnectCalls->setChecked(fsxOrP3D->isTraceSendId());
|
||||||
ui->cb_EnableTerrainProbe->setChecked(fsxOrP3D->isUsingFsxTerrainProbe());
|
ui->cb_EnableTerrainProbe->setChecked(fsxOrP3D->isUsingFsxTerrainProbe());
|
||||||
ui->cb_SBOffsets->setChecked(fsxOrP3D->isUsingSbOffsetValues());
|
ui->cb_SBOffsets->setChecked(fsxOrP3D->isUsingSbOffsetValues());
|
||||||
ui->cb_UseFsuipc->setChecked(fsxOrP3D->isFsuipcOpened());
|
ui->cb_UseFsuipc->setChecked(fsxOrP3D->isFsuipcOpened());
|
||||||
|
|||||||
@@ -347,6 +347,15 @@ namespace BlackSimPlugin
|
|||||||
m_detailsSettings.setSettings(settings, sim);
|
m_detailsSettings.setSettings(settings, sim);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CSimulatorFsxCommon::setUsingSbOffsetValues(bool enabled)
|
||||||
|
{
|
||||||
|
m_useSbOffsets = enabled;
|
||||||
|
const CSimulatorInfo sim = this->getSimulatorInfo();
|
||||||
|
CFsxP3DSettings settings = m_detailsSettings.getSettings(sim);
|
||||||
|
settings.setSbOffsetsEnabled(enabled);
|
||||||
|
m_detailsSettings.setSettings(settings, sim);
|
||||||
|
}
|
||||||
|
|
||||||
void CSimulatorFsxCommon::resetAircraftStatistics()
|
void CSimulatorFsxCommon::resetAircraftStatistics()
|
||||||
{
|
{
|
||||||
m_dispatchProcCount = 0;
|
m_dispatchProcCount = 0;
|
||||||
@@ -449,7 +458,10 @@ namespace BlackSimPlugin
|
|||||||
if (referenceTs != m_simulatingChangedTs) { return; } // changed, so no longer valid
|
if (referenceTs != m_simulatingChangedTs) { return; } // changed, so no longer valid
|
||||||
m_simSimulating = true; // only place where this should be set to true
|
m_simSimulating = true; // only place where this should be set to true
|
||||||
m_simConnected = true;
|
m_simConnected = true;
|
||||||
m_useAddSimulatedObj = m_detailsSettings.getSettings(this->getSimulatorInfo()).isAddingAsSimulatedObjectEnabled();
|
|
||||||
|
const CFsxP3DSettings settings = m_detailsSettings.getSettings(this->getSimulatorInfo());
|
||||||
|
m_useAddSimulatedObj = settings.isAddingAsSimulatedObjectEnabled();
|
||||||
|
m_useSbOffsets = settings.isSbOffsetsEnabled();
|
||||||
|
|
||||||
HRESULT hr1 = this->logAndTraceSendId(
|
HRESULT hr1 = this->logAndTraceSendId(
|
||||||
SimConnect_RequestDataOnSimObject(m_hSimConnect, CSimConnectDefinitions::RequestOwnAircraft,
|
SimConnect_RequestDataOnSimObject(m_hSimConnect, CSimConnectDefinitions::RequestOwnAircraft,
|
||||||
|
|||||||
@@ -159,9 +159,12 @@ namespace BlackSimPlugin
|
|||||||
//! \sa CSimulatorFsxCommon::is
|
//! \sa CSimulatorFsxCommon::is
|
||||||
virtual bool requestElevation(const BlackMisc::Geo::ICoordinateGeodetic &reference, const BlackMisc::Aviation::CCallsign &aircraftCallsign) override;
|
virtual bool requestElevation(const BlackMisc::Geo::ICoordinateGeodetic &reference, const BlackMisc::Aviation::CCallsign &aircraftCallsign) override;
|
||||||
|
|
||||||
//! Tracing?
|
//! Tracing right now?
|
||||||
bool isTracingSendId() const;
|
bool isTracingSendId() const;
|
||||||
|
|
||||||
|
//! Trace enable (can be auto enable also)
|
||||||
|
bool isTraceSendId() const { return m_traceSendId; }
|
||||||
|
|
||||||
//! Set tracing on/off
|
//! Set tracing on/off
|
||||||
void setTractingSendId(bool trace);
|
void setTractingSendId(bool trace);
|
||||||
|
|
||||||
@@ -176,7 +179,7 @@ namespace BlackSimPlugin
|
|||||||
bool isUsingSbOffsetValues() const { return m_useSbOffsets; }
|
bool isUsingSbOffsetValues() const { return m_useSbOffsets; }
|
||||||
|
|
||||||
//! Use SB offset values
|
//! Use SB offset values
|
||||||
void setUsingSbOffsetValues(bool use) { m_useSbOffsets = use; }
|
void setUsingSbOffsetValues(bool use);
|
||||||
|
|
||||||
//! Number of received SB4 packets
|
//! Number of received SB4 packets
|
||||||
//! \remark if this is increasing, SB4 is supported
|
//! \remark if this is increasing, SB4 is supported
|
||||||
|
|||||||
Reference in New Issue
Block a user