refs #441 Rename COriginator to CIdentifier and rename COriginatorAware to CIdentifiable.

This commit is contained in:
Mathew Sutcliffe
2015-06-05 12:57:40 +01:00
parent a4ca75c5c7
commit d4d862927e
90 changed files with 503 additions and 500 deletions

View File

@@ -118,8 +118,8 @@ namespace BlackSimPlugin
// matched models
CAircraftModel aircraftModel = getClosestMatch(newRemoteAircraftCopy);
Q_ASSERT(newRemoteAircraft.getCallsign() == aircraftModel.getCallsign());
updateAircraftModel(newRemoteAircraft.getCallsign(), aircraftModel, originator());
updateAircraftRendered(newRemoteAircraft.getCallsign(), true, originator());
updateAircraftModel(newRemoteAircraft.getCallsign(), aircraftModel, identifier());
updateAircraftRendered(newRemoteAircraft.getCallsign(), true, identifier());
CSimulatedAircraft aircraftAfterModelApplied(getAircraftInRangeForCallsign(newRemoteAircraft.getCallsign()));
aircraftAfterModelApplied.setRendered(true);
emit modelMatchingCompleted(aircraftAfterModelApplied);
@@ -130,7 +130,7 @@ namespace BlackSimPlugin
client->start();
m_hashFs9Clients.insert(callsign, client);
updateAircraftRendered(callsign, true, this->originator());
updateAircraftRendered(callsign, true, this->identifier());
CLogMessage(this).info("FS9: Added aircraft %1") << callsign.toQString();
return true;
}
@@ -142,7 +142,7 @@ namespace BlackSimPlugin
auto fs9Client = m_hashFs9Clients.value(callsign);
fs9Client->quit();
m_hashFs9Clients.remove(callsign);
updateAircraftRendered(callsign, false, this->originator());
updateAircraftRendered(callsign, false, this->identifier());
CLogMessage(this).info("FS9: Removed aircraft %1") << callsign.toQString();
return true;
}
@@ -165,9 +165,9 @@ namespace BlackSimPlugin
return CCollection<CCallsign>(this->m_hashFs9Clients.keys());
}
bool CSimulatorFs9::updateOwnSimulatorCockpit(const CAircraft &ownAircraft, const COriginator &originator)
bool CSimulatorFs9::updateOwnSimulatorCockpit(const CAircraft &ownAircraft, const CIdentifier &originator)
{
if (originator == this->originator()) { return false; }
if (originator == this->identifier()) { return false; }
if (!this->isSimulating()) { return false; }
// actually those data should be the same as ownAircraft
@@ -301,7 +301,7 @@ namespace BlackSimPlugin
simDataOwnAircraft.getCom1System(),
simDataOwnAircraft.getCom2System(),
simDataOwnAircraft.getTransponder(),
this->originator());
this->identifier());
}
void CSimulatorFs9::disconnectAllClients()

View File

@@ -71,7 +71,7 @@ namespace BlackSimPlugin
virtual bool isPhysicallyRenderedAircraft(const BlackMisc::Aviation::CCallsign &callsign) const override;
//! \copydoc ISimulator::updateOwnSimulatorCockpit()
virtual bool updateOwnSimulatorCockpit(const BlackMisc::Aviation::CAircraft &ownAircraft, const BlackMisc::COriginator &originator) override;
virtual bool updateOwnSimulatorCockpit(const BlackMisc::Aviation::CAircraft &ownAircraft, const BlackMisc::CIdentifier &originator) override;
//! \copydoc ISimulator::displayStatusMessage()
virtual void displayStatusMessage(const BlackMisc::CStatusMessage &message) const override;

View File

@@ -180,18 +180,18 @@ namespace BlackSimPlugin
return empty;
}
bool CSimulatorFsCommon::changeRemoteAircraftModel(const CSimulatedAircraft &aircraft, const COriginator &originator)
bool CSimulatorFsCommon::changeRemoteAircraftModel(const CSimulatedAircraft &aircraft, const CIdentifier &originator)
{
if (originator == this->originator()) { return false; }
if (originator == this->identifier()) { return false; }
// remove upfront, and then enable / disable again
this->physicallyRemoveRemoteAircraft(aircraft.getCallsign());
return this->changeRemoteAircraftEnabled(aircraft, originator);
}
bool CSimulatorFsCommon::changeRemoteAircraftEnabled(const CSimulatedAircraft &aircraft, const COriginator &originator)
bool CSimulatorFsCommon::changeRemoteAircraftEnabled(const CSimulatedAircraft &aircraft, const CIdentifier &originator)
{
if (originator == this->originator()) { return false; }
if (originator == this->identifier()) { return false; }
if (aircraft.isEnabled())
{
this->physicallyAddRemoteAircraft(aircraft);

View File

@@ -68,10 +68,10 @@ namespace BlackSimPlugin
virtual BlackMisc::CPixmap iconForModel(const QString &modelString) const override;
//! \copydoc ISimulator::changeRenderedAircraftModel
virtual bool changeRemoteAircraftModel(const BlackMisc::Simulation::CSimulatedAircraft &aircraft, const BlackMisc::COriginator &originator) override;
virtual bool changeRemoteAircraftModel(const BlackMisc::Simulation::CSimulatedAircraft &aircraft, const BlackMisc::CIdentifier &originator) override;
//! \copydoc ISimulator::changeAircraftEnabled
virtual bool changeRemoteAircraftEnabled(const BlackMisc::Simulation::CSimulatedAircraft &aircraft, const BlackMisc::COriginator &originator) override;
virtual bool changeRemoteAircraftEnabled(const BlackMisc::Simulation::CSimulatedAircraft &aircraft, const BlackMisc::CIdentifier &originator) override;
//! \copydoc ISimulator::enableDebuggingMessages
virtual void enableDebugMessages(bool driver, bool interpolator) override;

View File

@@ -149,7 +149,7 @@ namespace BlackSimPlugin
CAircraftModel aircraftModel = getClosestMatch(newRemoteAircraft);
Q_ASSERT_X(newRemoteAircraft.getCallsign() == aircraftModel.getCallsign(), Q_FUNC_INFO, "mismatching callsigns");
this->updateAircraftModel(callsign, aircraftModel, originator());
this->updateAircraftModel(callsign, aircraftModel, identifier());
CSimulatedAircraft aircraftAfterModelApplied(getAircraftInRangeForCallsign(newRemoteAircraft.getCallsign()));
// create AI
@@ -173,15 +173,15 @@ namespace BlackSimPlugin
}
aircraftAfterModelApplied.setRendered(rendered);
this->updateAircraftRendered(callsign, rendered, originator());
this->updateAircraftRendered(callsign, rendered, identifier());
emit modelMatchingCompleted(aircraftAfterModelApplied);
return rendered;
}
bool CSimulatorFsx::updateOwnSimulatorCockpit(const CAircraft &ownAircraft, const COriginator &originator)
bool CSimulatorFsx::updateOwnSimulatorCockpit(const CAircraft &ownAircraft, const CIdentifier &originator)
{
if (originator == this->originator()) { return false; }
if (originator == this->identifier()) { return false; }
if (!this->isSimulating()) { return false; }
// actually those data should be the same as ownAircraft
@@ -419,7 +419,7 @@ namespace BlackSimPlugin
if (changedCom1 || changedCom2 || changedXpr)
{
this->updateCockpit(com1, com2, transponder, originator());
this->updateCockpit(com1, com2, transponder, identifier());
}
}
else
@@ -444,7 +444,7 @@ namespace BlackSimPlugin
if (!changed) { return; }
CTransponder xpdr = myAircraft.getTransponder();
xpdr.setTransponderMode(newMode);
this->updateCockpit(myAircraft.getCom1System(), myAircraft.getCom2System(), xpdr, this->originator());
this->updateCockpit(myAircraft.getCom1System(), myAircraft.getCom2System(), xpdr, this->identifier());
}
void CSimulatorFsx::setSimConnectObjectID(DWORD requestID, DWORD objectID)
@@ -529,7 +529,7 @@ namespace BlackSimPlugin
CCallsign callsign(simObject.getCallsign());
m_simConnectObjects.remove(callsign);
SimConnect_AIRemoveObject(m_hSimConnect, static_cast<SIMCONNECT_OBJECT_ID>(simObject.getObjectId()), static_cast<SIMCONNECT_DATA_REQUEST_ID>(simObject.getRequestId()));
updateAircraftRendered(callsign, false, originator());
updateAircraftRendered(callsign, false, identifier());
CLogMessage(this).info("FSX: Removed aircraft %1") << simObject.getCallsign().toQString();
return true;
}

View File

@@ -103,7 +103,7 @@ namespace BlackSimPlugin
virtual int physicallyRemoveAllRemoteAircraft() override;
//! \copydoc ISimulator::updateOwnCockpit
virtual bool updateOwnSimulatorCockpit(const BlackMisc::Aviation::CAircraft &ownAircraft, const BlackMisc::COriginator &originator) override;
virtual bool updateOwnSimulatorCockpit(const BlackMisc::Aviation::CAircraft &ownAircraft, const BlackMisc::CIdentifier &originator) override;
//! \copydoc ISimulator::displayStatusMessage
virtual void displayStatusMessage(const BlackMisc::CStatusMessage &message) const override;

View File

@@ -110,7 +110,7 @@ namespace BlackSimPlugin
Aviation::CComSystem::getCom1System({ m_xplaneData.com1Active, CFrequencyUnit::kHz() }, { m_xplaneData.com1Standby, CFrequencyUnit::kHz() }),
Aviation::CComSystem::getCom2System({ m_xplaneData.com2Active, CFrequencyUnit::kHz() }, { m_xplaneData.com2Standby, CFrequencyUnit::kHz() }),
Aviation::CTransponder::getStandardTransponder(m_xplaneData.xpdrCode, xpdrMode(m_xplaneData.xpdrMode, m_xplaneData.xpdrIdent)),
originator()
identifier()
);
}
}
@@ -307,10 +307,10 @@ namespace BlackSimPlugin
return getAircraftInRangeForCallsign(callsign).isRendered();
}
bool CSimulatorXPlane::updateOwnSimulatorCockpit(const BlackMisc::Aviation::CAircraft &aircraft, const COriginator &originator)
bool CSimulatorXPlane::updateOwnSimulatorCockpit(const BlackMisc::Aviation::CAircraft &aircraft, const CIdentifier &originator)
{
Q_ASSERT(isConnected());
if (originator == this->originator()) { return false; }
if (originator == this->identifier()) { return false; }
auto com1 = Aviation::CComSystem::getCom1System({ m_xplaneData.com1Active, CFrequencyUnit::kHz() }, { m_xplaneData.com1Standby, CFrequencyUnit::kHz() });
auto com2 = Aviation::CComSystem::getCom2System({ m_xplaneData.com2Active, CFrequencyUnit::kHz() }, { m_xplaneData.com2Standby, CFrequencyUnit::kHz() });
auto xpdr = Aviation::CTransponder::getStandardTransponder(m_xplaneData.xpdrCode, xpdrMode(m_xplaneData.xpdrMode, m_xplaneData.xpdrIdent));
@@ -344,7 +344,7 @@ namespace BlackSimPlugin
// Is there any model matching required ????
CAircraftIcaoData icao = newRemoteAircraft.getIcaoInfo();
m_traffic->addPlane(newRemoteAircraft.getCallsign().asString(), icao.getAircraftDesignator(), icao.getAirlineDesignator(), icao.getLivery());
updateAircraftRendered(newRemoteAircraft.getCallsign(), true, originator());
updateAircraftRendered(newRemoteAircraft.getCallsign(), true, identifier());
CLogMessage(this).info("XP: Added aircraft %1") << newRemoteAircraft.getCallsign().toQString();
return true;
}
@@ -379,7 +379,7 @@ namespace BlackSimPlugin
{
Q_ASSERT(isConnected());
m_traffic->removePlane(callsign.asString());
updateAircraftRendered(callsign, false, originator());
updateAircraftRendered(callsign, false, identifier());
CLogMessage(this).info("XP: Removed aircraft %1") << callsign.toQString();
return true;
}
@@ -389,7 +389,7 @@ namespace BlackSimPlugin
//! \todo XP driver obtain number of removed aircraft
int r = getAircraftInRangeCount();
m_traffic->removeAllPlanes();
updateMarkAllAsNotRendered(originator());
updateMarkAllAsNotRendered(identifier());
CLogMessage(this).info("XP: Removed all aircraft");
return r;
}
@@ -400,7 +400,7 @@ namespace BlackSimPlugin
return getAircraftInRange().findByRendered(true).getCallsigns(); // just a poor workaround
}
bool CSimulatorXPlane::changeRemoteAircraftModel(const CSimulatedAircraft &aircraft, const COriginator &originator)
bool CSimulatorXPlane::changeRemoteAircraftModel(const CSimulatedAircraft &aircraft, const CIdentifier &originator)
{
return this->changeRemoteAircraftEnabled(aircraft, originator);
}
@@ -411,9 +411,9 @@ namespace BlackSimPlugin
return CAircraftIcaoData();
}
bool CSimulatorXPlane::changeRemoteAircraftEnabled(const CSimulatedAircraft &aircraft, const COriginator &originator)
bool CSimulatorXPlane::changeRemoteAircraftEnabled(const CSimulatedAircraft &aircraft, const CIdentifier &originator)
{
if (originator == this->originator()) { return false; }
if (originator == this->identifier()) { return false; }
if (aircraft.isEnabled())
{
this->physicallyAddRemoteAircraft(aircraft);

View File

@@ -67,13 +67,13 @@ namespace BlackSimPlugin
virtual bool isPhysicallyRenderedAircraft(const BlackMisc::Aviation::CCallsign &callsign) const override;
//! \copydoc ISimulator::changeRenderedAircraftModel
virtual bool changeRemoteAircraftModel(const BlackMisc::Simulation::CSimulatedAircraft &aircraft, const BlackMisc::COriginator &originator) override;
virtual bool changeRemoteAircraftModel(const BlackMisc::Simulation::CSimulatedAircraft &aircraft, const BlackMisc::CIdentifier &originator) override;
//! \copydoc ISimulator::changeAircraftEnabled
virtual bool changeRemoteAircraftEnabled(const BlackMisc::Simulation::CSimulatedAircraft &aircraft, const BlackMisc::COriginator &originator) override;
virtual bool changeRemoteAircraftEnabled(const BlackMisc::Simulation::CSimulatedAircraft &aircraft, const BlackMisc::CIdentifier &originator) override;
//! \copydoc BlackCore::ISimulator::updateOwnSimulatorCockpit
virtual bool updateOwnSimulatorCockpit(const BlackMisc::Aviation::CAircraft &aircraft, const BlackMisc::COriginator &originator) override;
virtual bool updateOwnSimulatorCockpit(const BlackMisc::Aviation::CAircraft &aircraft, const BlackMisc::CIdentifier &originator) override;
//! \copydoc BlackCore::ISimulator::displayStatusMessage
virtual void displayStatusMessage(const BlackMisc::CStatusMessage &message) const override;