mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-31 21:15:33 +08:00
Formatting, renaming, Doxygen, minor UI adjustments
This commit is contained in:
committed by
Mathew Sutcliffe
parent
7ddb69825a
commit
68dccbefa6
@@ -139,7 +139,7 @@ namespace BlackSimPlugin
|
||||
{
|
||||
m_fsuipc->connect(); // connect FSUIPC too
|
||||
}
|
||||
initInternalsObject();
|
||||
initSimulatorInternals();
|
||||
m_dispatchTimerId = startTimer(50);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -38,23 +38,24 @@ namespace BlackSimPlugin
|
||||
|
||||
CSimulatorFsCommon::~CSimulatorFsCommon() { }
|
||||
|
||||
void CSimulatorFsCommon::initInternalsObject()
|
||||
void CSimulatorFsCommon::initSimulatorInternals()
|
||||
{
|
||||
CSimulatorInternals s;
|
||||
s.setSimulatorName(this->m_simulatorName);
|
||||
s.setSimulatorVersion(this->m_simulatorVersion);
|
||||
s.setValue("fscommon/fsuipc", boolToOnOff(m_useFsuipc));
|
||||
if (m_fsuipc)
|
||||
s.setValue("fscommon/fsuipc", boolToOnOff(this->m_useFsuipc));
|
||||
if (this->m_fsuipc)
|
||||
{
|
||||
const QString v(m_fsuipc->getVersion());
|
||||
const QString v(this->m_fsuipc->getVersion());
|
||||
if (!v.isEmpty()) { s.setValue("fscommon/fsuipcversion", v); }
|
||||
s.setValue("fscommon/fsuipcconnect", boolToYesNo(m_fsuipc->isConnected()));
|
||||
s.setValue("fscommon/fsuipcconnect", boolToYesNo(this->m_fsuipc->isConnected()));
|
||||
}
|
||||
this->m_simulatorInternals = s;
|
||||
}
|
||||
|
||||
bool CSimulatorFsCommon::parseDetails(const CSimpleCommandParser &parser)
|
||||
{
|
||||
// .driver fsuipc on|off
|
||||
if (parser.matchesPart(1, "fsuipc") && parser.hasPart(2))
|
||||
{
|
||||
const bool on = parser.toBool(2);
|
||||
|
||||
@@ -59,10 +59,16 @@ namespace BlackSimPlugin
|
||||
BlackMisc::Weather::IWeatherGridProvider *weatherGridProvider,
|
||||
QObject *parent = nullptr);
|
||||
|
||||
//! Init the internals objects
|
||||
virtual void initInternalsObject();
|
||||
//! Init the internal objects
|
||||
virtual void initSimulatorInternals();
|
||||
|
||||
//! \copydoc BlackCore::CSimulatorCommon::parseDetails
|
||||
//! \ingroup commandline
|
||||
//! @{
|
||||
//! <pre>
|
||||
//! .plugin fsuipc on|off FSUIPC on/off
|
||||
//! </pre>
|
||||
//! @}
|
||||
virtual bool parseDetails(const BlackMisc::CSimpleCommandParser &parser) override;
|
||||
|
||||
QString m_simulatorName; //!< name of simulator
|
||||
|
||||
@@ -309,12 +309,12 @@ namespace BlackSimPlugin
|
||||
void CSimulatorFsx::setSimConnected()
|
||||
{
|
||||
m_simConnected = true;
|
||||
this->initInternalsObject();
|
||||
this->initSimulatorInternals();
|
||||
emitSimulatorCombinedStatus();
|
||||
|
||||
// Internals depends on sim data which take a while to be read
|
||||
// this is a trich and I re-init again after a while (which is not really expensive)
|
||||
QTimer::singleShot(1000, this, [this] { this->initInternalsObject(); });
|
||||
QTimer::singleShot(1000, this, [this] { this->initSimulatorInternals(); });
|
||||
}
|
||||
|
||||
void CSimulatorFsx::onSimRunning()
|
||||
@@ -1081,9 +1081,9 @@ namespace BlackSimPlugin
|
||||
return false;
|
||||
}
|
||||
|
||||
void CSimulatorFsx::initInternalsObject()
|
||||
void CSimulatorFsx::initSimulatorInternals()
|
||||
{
|
||||
CSimulatorFsCommon::initInternalsObject();
|
||||
CSimulatorFsCommon::initSimulatorInternals();
|
||||
CSimulatorInternals s = this->m_simulatorInternals;
|
||||
const QString fsxPath = CFsCommonUtil::fsxDirFromRegistry(); // can be empty for remote FSX
|
||||
if (!fsxPath.isEmpty()) { s.setSimulatorInstallationDirectory(fsxPath); }
|
||||
|
||||
@@ -113,7 +113,7 @@ namespace BlackSimPlugin
|
||||
//! @{
|
||||
virtual void reset() override;
|
||||
virtual void clearAllAircraft() override;
|
||||
virtual void initInternalsObject() override;
|
||||
virtual void initSimulatorInternals() override;
|
||||
virtual void injectWeatherGrid(const BlackMisc::Weather::CWeatherGrid &weatherGrid) override;
|
||||
//! @}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user