mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-27 11:05:44 +08:00
Ref T180, formatting and renaming of member/function
This commit is contained in:
@@ -574,7 +574,7 @@ namespace BlackCore
|
|||||||
|
|
||||||
void CSimulatorCommon::clearAllAircraft()
|
void CSimulatorCommon::clearAllAircraft()
|
||||||
{
|
{
|
||||||
m_aircraftToAddAgainWhenRemoved.clear();
|
m_addAgainAircraftWhenRemoved.clear();
|
||||||
m_highlightedAircraft.clear();
|
m_highlightedAircraft.clear();
|
||||||
m_callsignsToBeRendered.clear();
|
m_callsignsToBeRendered.clear();
|
||||||
m_hints.clear();
|
m_hints.clear();
|
||||||
|
|||||||
@@ -220,7 +220,7 @@ namespace BlackCore
|
|||||||
BlackMisc::Simulation::CInterpolationAndRenderingSetup m_interpolationRenderingSetup; //!< logging, rendering etc.
|
BlackMisc::Simulation::CInterpolationAndRenderingSetup m_interpolationRenderingSetup; //!< logging, rendering etc.
|
||||||
|
|
||||||
// some optional functionality which can be used by the sims as needed
|
// some optional functionality which can be used by the sims as needed
|
||||||
BlackMisc::Simulation::CSimulatedAircraftList m_aircraftToAddAgainWhenRemoved; //!< add this model again when removed, normally used to change model
|
BlackMisc::Simulation::CSimulatedAircraftList m_addAgainAircraftWhenRemoved; //!< add this model again when removed, normally used to change model
|
||||||
QHash<BlackMisc::Aviation::CCallsign, BlackMisc::Simulation::CInterpolationHints> m_hints; //!< last ground elevation fetched
|
QHash<BlackMisc::Aviation::CCallsign, BlackMisc::Simulation::CInterpolationHints> m_hints; //!< last ground elevation fetched
|
||||||
|
|
||||||
bool m_isWeatherActivated = false; //!< Is simulator weather activated?
|
bool m_isWeatherActivated = false; //!< Is simulator weather activated?
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ namespace BlackMisc
|
|||||||
for (CAircraftModel &simModel : modelToBeModified)
|
for (CAircraftModel &simModel : modelToBeModified)
|
||||||
{
|
{
|
||||||
if (!force && simModel.hasValidAircraftAndAirlineDesignator()) { continue; } // already done
|
if (!force && simModel.hasValidAircraftAndAirlineDesignator()) { continue; } // already done
|
||||||
CAircraftModel vPilotModel(vPilotModels.findFirstByModelStringOrDefault(simModel.getModelString()));
|
const CAircraftModel vPilotModel(vPilotModels.findFirstByModelStringOrDefault(simModel.getModelString()));
|
||||||
if (!vPilotModel.hasValidDbKey())
|
if (!vPilotModel.hasValidDbKey())
|
||||||
{
|
{
|
||||||
continue; // not found
|
continue; // not found
|
||||||
|
|||||||
@@ -235,7 +235,7 @@ namespace BlackSimPlugin
|
|||||||
CCallsignSet CSimulatorFsxCommon::physicallyRenderedAircraft() const
|
CCallsignSet CSimulatorFsxCommon::physicallyRenderedAircraft() const
|
||||||
{
|
{
|
||||||
CCallsignSet callsigns(m_simConnectObjects.keys());
|
CCallsignSet callsigns(m_simConnectObjects.keys());
|
||||||
callsigns.push_back(m_aircraftToAddAgainWhenRemoved.getCallsigns()); // not really rendered right now, but very soon
|
callsigns.push_back(m_addAgainAircraftWhenRemoved.getCallsigns()); // not really rendered right now, but very soon
|
||||||
callsigns.push_back(m_addPendingAircraft.getCallsigns()); // not really rendered, but for the logic it should look like it is
|
callsigns.push_back(m_addPendingAircraft.getCallsigns()); // not really rendered, but for the logic it should look like it is
|
||||||
return CCallsignSet(m_simConnectObjects.keys());
|
return CCallsignSet(m_simConnectObjects.keys());
|
||||||
}
|
}
|
||||||
@@ -539,7 +539,7 @@ namespace BlackSimPlugin
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
this->removeFromPendingAndAddAgainAircraft(callsign);
|
this->removeFromAddPendingAndAddAgainAircraft(callsign);
|
||||||
msg = CLogMessage(this).info("Callsign '%1' removed in meantime and no longer in range") << callsign.toQString();
|
msg = CLogMessage(this).info("Callsign '%1' removed in meantime and no longer in range") << callsign.toQString();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -578,7 +578,7 @@ namespace BlackSimPlugin
|
|||||||
this->requestDataForSimObject(simObject);
|
this->requestDataForSimObject(simObject);
|
||||||
this->requestLightsForSimObject(simObject);
|
this->requestLightsForSimObject(simObject);
|
||||||
|
|
||||||
this->removeFromPendingAndAddAgainAircraft(callsign); // no longer try to add
|
this->removeFromAddPendingAndAddAgainAircraft(callsign); // no longer try to add
|
||||||
const bool updated = this->updateAircraftRendered(callsign, true);
|
const bool updated = this->updateAircraftRendered(callsign, true);
|
||||||
if (updated)
|
if (updated)
|
||||||
{
|
{
|
||||||
@@ -633,7 +633,7 @@ namespace BlackSimPlugin
|
|||||||
|
|
||||||
// no longer required to be added
|
// no longer required to be added
|
||||||
m_addPendingAircraft.removeByCallsigns(toBeRemovedCallsigns);
|
m_addPendingAircraft.removeByCallsigns(toBeRemovedCallsigns);
|
||||||
m_aircraftToAddAgainWhenRemoved.removeByCallsigns(toBeRemovedCallsigns);
|
m_addAgainAircraftWhenRemoved.removeByCallsigns(toBeRemovedCallsigns);
|
||||||
|
|
||||||
// add aircraft, but "non blocking"
|
// add aircraft, but "non blocking"
|
||||||
if (!toBeAddedAircraft.isEmpty())
|
if (!toBeAddedAircraft.isEmpty())
|
||||||
@@ -646,11 +646,11 @@ namespace BlackSimPlugin
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSimulatorFsxCommon::removeFromPendingAndAddAgainAircraft(const CCallsign &callsign)
|
void CSimulatorFsxCommon::removeFromAddPendingAndAddAgainAircraft(const CCallsign &callsign)
|
||||||
{
|
{
|
||||||
if (callsign.isEmpty()) { return; }
|
if (callsign.isEmpty()) { return; }
|
||||||
m_addPendingAircraft.removeByCallsign(callsign);
|
m_addPendingAircraft.removeByCallsign(callsign);
|
||||||
m_aircraftToAddAgainWhenRemoved.removeByCallsign(callsign);
|
m_addAgainAircraftWhenRemoved.removeByCallsign(callsign);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CSimulatorFsxCommon::simulatorReportedObjectRemoved(DWORD objectID)
|
bool CSimulatorFsxCommon::simulatorReportedObjectRemoved(DWORD objectID)
|
||||||
@@ -696,10 +696,10 @@ namespace BlackSimPlugin
|
|||||||
}
|
}
|
||||||
|
|
||||||
// models we have to add again after removing
|
// models we have to add again after removing
|
||||||
if (m_aircraftToAddAgainWhenRemoved.containsCallsign(callsign))
|
if (m_addAgainAircraftWhenRemoved.containsCallsign(callsign))
|
||||||
{
|
{
|
||||||
const CSimulatedAircraft aircraftAddAgain = m_aircraftToAddAgainWhenRemoved.findFirstByCallsign(callsign);
|
const CSimulatedAircraft aircraftAddAgain = m_addAgainAircraftWhenRemoved.findFirstByCallsign(callsign);
|
||||||
m_aircraftToAddAgainWhenRemoved.removeByCallsign(callsign);
|
m_addAgainAircraftWhenRemoved.removeByCallsign(callsign);
|
||||||
QTimer::singleShot(2500, this, [ = ]
|
QTimer::singleShot(2500, this, [ = ]
|
||||||
{
|
{
|
||||||
this->physicallyAddRemoteAircraftImpl(aircraftAddAgain, AddedAfterRemoved);
|
this->physicallyAddRemoteAircraftImpl(aircraftAddAgain, AddedAfterRemoved);
|
||||||
@@ -844,7 +844,7 @@ namespace BlackSimPlugin
|
|||||||
}
|
}
|
||||||
|
|
||||||
this->physicallyRemoveRemoteAircraft(newRemoteAircraft.getCallsign());
|
this->physicallyRemoveRemoteAircraft(newRemoteAircraft.getCallsign());
|
||||||
m_aircraftToAddAgainWhenRemoved.replaceOrAddByCallsign(newRemoteAircraft);
|
m_addAgainAircraftWhenRemoved.replaceOrAddByCallsign(newRemoteAircraft);
|
||||||
if (this->showDebugLogMessage()) { this->debugLogMessage(Q_FUNC_INFO, QString("Cs: '%1' re-added changed model '%2', will be added again").arg(newRemoteAircraft.getCallsignAsString(), newModelString)); }
|
if (this->showDebugLogMessage()) { this->debugLogMessage(Q_FUNC_INFO, QString("Cs: '%1' re-added changed model '%2', will be added again").arg(newRemoteAircraft.getCallsignAsString(), newModelString)); }
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -856,7 +856,7 @@ namespace BlackSimPlugin
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
this->removeFromPendingAndAddAgainAircraft(callsign);
|
this->removeFromAddPendingAndAddAgainAircraft(callsign);
|
||||||
|
|
||||||
// create AI
|
// create AI
|
||||||
bool adding = false;
|
bool adding = false;
|
||||||
@@ -892,7 +892,7 @@ namespace BlackSimPlugin
|
|||||||
Q_ASSERT_X(CThreadUtils::isCurrentThreadObjectThread(this), Q_FUNC_INFO, "wrong thread");
|
Q_ASSERT_X(CThreadUtils::isCurrentThreadObjectThread(this), Q_FUNC_INFO, "wrong thread");
|
||||||
if (callsign.isEmpty()) { return false; } // can happen if an object is not an aircraft
|
if (callsign.isEmpty()) { return false; } // can happen if an object is not an aircraft
|
||||||
|
|
||||||
this->removeFromPendingAndAddAgainAircraft(callsign);
|
this->removeFromAddPendingAndAddAgainAircraft(callsign);
|
||||||
if (!m_simConnectObjects.contains(callsign)) { return false; } // already fully removed or not yet added
|
if (!m_simConnectObjects.contains(callsign)) { return false; } // already fully removed or not yet added
|
||||||
|
|
||||||
CSimConnectObject &simObject = m_simConnectObjects[callsign];
|
CSimConnectObject &simObject = m_simConnectObjects[callsign];
|
||||||
|
|||||||
@@ -208,7 +208,7 @@ namespace BlackSimPlugin
|
|||||||
void addPendingAircraft(AircraftAddMode mode);
|
void addPendingAircraft(AircraftAddMode mode);
|
||||||
|
|
||||||
//! Remove as m_addPendingAircraft and m_aircraftToAddAgainWhenRemoved
|
//! Remove as m_addPendingAircraft and m_aircraftToAddAgainWhenRemoved
|
||||||
void removeFromPendingAndAddAgainAircraft(const BlackMisc::Aviation::CCallsign &callsign);
|
void removeFromAddPendingAndAddAgainAircraft(const BlackMisc::Aviation::CCallsign &callsign);
|
||||||
|
|
||||||
//! Call this method to declare the simulator connected
|
//! Call this method to declare the simulator connected
|
||||||
void setSimConnected();
|
void setSimConnected();
|
||||||
|
|||||||
Reference in New Issue
Block a user