mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-31 12:55:33 +08:00
Ref T111, allow to set SELCAL in simulator
This commit is contained in:
committed by
Mathew Sutcliffe
parent
266a418c90
commit
66773d7593
@@ -236,24 +236,20 @@ namespace BlackSimPlugin
|
||||
bool changed = false;
|
||||
if (newCom1.getFrequencyActive() != this->m_simCom1.getFrequencyActive())
|
||||
{
|
||||
// CFrequency newFreq = newCom1.getFrequencyActive();
|
||||
changed = true;
|
||||
|
||||
}
|
||||
if (newCom1.getFrequencyStandby() != this->m_simCom1.getFrequencyStandby())
|
||||
{
|
||||
// CFrequency newFreq = newCom1.getFrequencyStandby();
|
||||
changed = true;
|
||||
}
|
||||
|
||||
if (newCom2.getFrequencyActive() != this->m_simCom2.getFrequencyActive())
|
||||
{
|
||||
// CFrequency newFreq = newCom2.getFrequencyActive();
|
||||
changed = true;
|
||||
}
|
||||
if (newCom2.getFrequencyStandby() != this->m_simCom2.getFrequencyStandby())
|
||||
{
|
||||
// CFrequency newFreq = newCom2.getFrequencyStandby();
|
||||
changed = true;
|
||||
}
|
||||
|
||||
@@ -264,18 +260,33 @@ namespace BlackSimPlugin
|
||||
|
||||
if (newTransponder.getTransponderMode() != this->m_simTransponder.getTransponderMode())
|
||||
{
|
||||
// void
|
||||
changed = true;
|
||||
}
|
||||
|
||||
// avoid changes of cockpit back to old values due to an outdated read back value
|
||||
//! \todo KB 8/2017 set FS9 cockpit values
|
||||
|
||||
// bye
|
||||
return changed;
|
||||
}
|
||||
|
||||
bool CSimulatorFs9::updateOwnSimulatorSelcal(const CSelcal &selcal, const CIdentifier &originator)
|
||||
{
|
||||
if (originator == this->identifier()) { return false; }
|
||||
if (!this->isSimulating()) { return false; }
|
||||
|
||||
bool changed = false;
|
||||
if (selcal != this->m_selcal)
|
||||
{
|
||||
changed = true;
|
||||
}
|
||||
|
||||
//! \todo KB 8/2017 set FS9 SELCAL value
|
||||
return changed;
|
||||
}
|
||||
|
||||
void CSimulatorFs9::displayStatusMessage(const BlackMisc::CStatusMessage &message) const
|
||||
{
|
||||
/* Avoid errors from CDirectPlayPeer as it may end in infinite loop */
|
||||
// Avoid errors from CDirectPlayPeer as it may end in infinite loop
|
||||
if (message.getSeverity() == BlackMisc::CStatusMessage::SeverityError && message.isFromClass<CDirectPlayPeer>())
|
||||
{
|
||||
return;
|
||||
|
||||
@@ -61,6 +61,7 @@ namespace BlackSimPlugin
|
||||
virtual BlackMisc::Aviation::CCallsignSet physicallyRenderedAircraft() const override;
|
||||
virtual bool isPhysicallyRenderedAircraft(const BlackMisc::Aviation::CCallsign &callsign) const override;
|
||||
virtual bool updateOwnSimulatorCockpit(const BlackMisc::Simulation::CSimulatedAircraft &ownAircraft, const BlackMisc::CIdentifier &originator) override;
|
||||
virtual bool updateOwnSimulatorSelcal(const BlackMisc::Aviation::CSelcal &selcal, const BlackMisc::CIdentifier &originator) override;
|
||||
virtual void displayStatusMessage(const BlackMisc::CStatusMessage &message) const override;
|
||||
virtual void displayTextMessage(const BlackMisc::Network::CTextMessage &message) const override;
|
||||
virtual bool setInterpolatorMode(BlackMisc::Simulation::CInterpolatorMulti::Mode mode, const BlackMisc::Aviation::CCallsign &callsign) override;
|
||||
|
||||
@@ -88,6 +88,7 @@ namespace BlackSimPlugin
|
||||
BlackMisc::Aviation::CComSystem m_simCom1; //!< cockpit COM1 state in simulator
|
||||
BlackMisc::Aviation::CComSystem m_simCom2; //!< cockpit COM2 state in simulator
|
||||
BlackMisc::Aviation::CTransponder m_simTransponder; //!< cockpit xpdr state in simulator
|
||||
BlackMisc::Aviation::CSelcal m_selcal; //!< SELCAL as in cockpit
|
||||
};
|
||||
} // namespace
|
||||
} // namespace
|
||||
|
||||
@@ -198,6 +198,16 @@ namespace BlackSimPlugin
|
||||
return changed;
|
||||
}
|
||||
|
||||
bool CSimulatorFsxCommon::updateOwnSimulatorSelcal(const CSelcal &selcal, const CIdentifier &originator)
|
||||
{
|
||||
if (originator == this->identifier()) { return false; }
|
||||
if (!this->isSimulating()) { return false; }
|
||||
|
||||
//! \fixme KB 2017/8 use SELCAL
|
||||
Q_UNUSED(selcal);
|
||||
return false;
|
||||
}
|
||||
|
||||
void CSimulatorFsxCommon::displayStatusMessage(const BlackMisc::CStatusMessage &message) const
|
||||
{
|
||||
QByteArray m = message.getMessage().toLocal8Bit().constData();
|
||||
|
||||
@@ -114,6 +114,7 @@ namespace BlackSimPlugin
|
||||
virtual bool physicallyRemoveRemoteAircraft(const BlackMisc::Aviation::CCallsign &callsign) override;
|
||||
virtual int physicallyRemoveAllRemoteAircraft() override;
|
||||
virtual bool updateOwnSimulatorCockpit(const BlackMisc::Simulation::CSimulatedAircraft &ownAircraft, const BlackMisc::CIdentifier &originator) override;
|
||||
virtual bool updateOwnSimulatorSelcal(const BlackMisc::Aviation::CSelcal &selcal, const BlackMisc::CIdentifier &originator) override;
|
||||
virtual void displayStatusMessage(const BlackMisc::CStatusMessage &message) const override;
|
||||
virtual void displayTextMessage(const BlackMisc::Network::CTextMessage &message) const override;
|
||||
virtual bool isPhysicallyRenderedAircraft(const BlackMisc::Aviation::CCallsign &callsign) const override;
|
||||
|
||||
@@ -415,7 +415,7 @@ namespace BlackSimPlugin
|
||||
|
||||
bool CSimulatorXPlane::updateOwnSimulatorCockpit(const BlackMisc::Simulation::CSimulatedAircraft &aircraft, const CIdentifier &originator)
|
||||
{
|
||||
Q_ASSERT(isConnected());
|
||||
Q_ASSERT(isConnected()); //! \fixme KB 8/2017 would BLACK_VERIFY + return be better?
|
||||
if (originator == this->identifier()) { return false; }
|
||||
auto com1 = CComSystem::getCom1System({ m_xplaneData.com1Active, CFrequencyUnit::kHz() }, { m_xplaneData.com1Standby, CFrequencyUnit::kHz() });
|
||||
auto com2 = CComSystem::getCom2System({ m_xplaneData.com2Active, CFrequencyUnit::kHz() }, { m_xplaneData.com2Standby, CFrequencyUnit::kHz() });
|
||||
@@ -441,6 +441,16 @@ namespace BlackSimPlugin
|
||||
return false;
|
||||
}
|
||||
|
||||
bool CSimulatorXPlane::updateOwnSimulatorSelcal(const CSelcal &selcal, const CIdentifier &originator)
|
||||
{
|
||||
if (!isConnected()) { return false; };
|
||||
if (originator == this->identifier()) { return false; }
|
||||
Q_UNUSED(selcal);
|
||||
|
||||
//! \fixme KB 8/2017 use SELCAL??
|
||||
return false;
|
||||
}
|
||||
|
||||
void CSimulatorXPlane::loadCslPackages()
|
||||
{
|
||||
struct Prefix { QString s; };
|
||||
|
||||
@@ -92,6 +92,7 @@ namespace BlackSimPlugin
|
||||
virtual bool changeRemoteAircraftModel(const BlackMisc::Simulation::CSimulatedAircraft &aircraft) override;
|
||||
virtual bool changeRemoteAircraftEnabled(const BlackMisc::Simulation::CSimulatedAircraft &aircraft) override;
|
||||
virtual bool updateOwnSimulatorCockpit(const BlackMisc::Simulation::CSimulatedAircraft &aircraft, const BlackMisc::CIdentifier &originator) override;
|
||||
virtual bool updateOwnSimulatorSelcal(const BlackMisc::Aviation::CSelcal &selcal, const BlackMisc::CIdentifier &originator) override;
|
||||
virtual void displayStatusMessage(const BlackMisc::CStatusMessage &message) const override;
|
||||
virtual void displayTextMessage(const BlackMisc::Network::CTextMessage &message) const override;
|
||||
virtual BlackMisc::Aviation::CAirportList getAirportsInRange() const override;
|
||||
@@ -136,7 +137,7 @@ namespace BlackSimPlugin
|
||||
void ps_serviceUnregistered();
|
||||
void ps_setAirportsInRange(const QStringList &icaoCodes, const QStringList &names, const BlackMisc::CSequence<double> &lats, const BlackMisc::CSequence<double> &lons, const BlackMisc::CSequence<double> &alts);
|
||||
void ps_emitOwnAircraftModelChanged(const QString &path, const QString &filename, const QString &livery, const QString &icao,
|
||||
const QString &modelString, const QString &name, const QString &distributor, const QString &description);
|
||||
const QString &modelString, const QString &name, const QString &distributor, const QString &description);
|
||||
void ps_fastTimerTimeout();
|
||||
void ps_slowTimerTimeout();
|
||||
void ps_installedModelsUpdated(const QStringList &modelStrings, const QStringList &icaos, const QStringList &airlines, const QStringList &liveries);
|
||||
|
||||
Reference in New Issue
Block a user