refs #793, added function to reset model (after it was manually changed)

* located in context since context owns matcher object
* call from GUI
* some code formatting to indicate the cross simulator slots connected in runtime

refs #780
This commit is contained in:
Klaus Basan
2016-10-31 16:33:24 +01:00
parent 55020277b5
commit 72fdf7c5bc
9 changed files with 65 additions and 25 deletions

View File

@@ -483,7 +483,7 @@ namespace BlackCore
}
}
void CContextSimulator::ps_addRemoteAircraft(const CSimulatedAircraft &remoteAircraft)
void CContextSimulator::ps_addedRemoteAircraft(const CSimulatedAircraft &remoteAircraft)
{
if (!isSimulatorSimulating()) { return; }
Q_ASSERT(!remoteAircraft.getCallsign().isEmpty());
@@ -522,7 +522,7 @@ namespace BlackCore
for (const CSimulatedAircraft &simulatedAircraft : aircrafts)
{
Q_ASSERT(!simulatedAircraft.getCallsign().isEmpty());
ps_addRemoteAircraft(simulatedAircraft);
ps_addedRemoteAircraft(simulatedAircraft);
}
m_initallyAddAircrafts = false;
}
@@ -653,6 +653,15 @@ namespace BlackCore
m_simulatorPlugin.second->highlightAircraft(aircraftToHighlight, enableHighlight, displayTime);
}
bool CContextSimulator::resetToModelMatchingAircraft(const CCallsign &callsign)
{
CSimulatedAircraft aircraft = getAircraftInRangeForCallsign(callsign);
if (aircraft.getCallsign() != callsign) { return false; } // not found
aircraft.setModel(aircraft.getNetworkModel());
ps_addedRemoteAircraft(aircraft);
return true;
}
void CContextSimulator::requestWeatherGrid(const Weather::CWeatherGrid &weatherGrid, const CIdentifier &identifier)
{
if (m_debugEnabled) { CLogMessage(this, CLogCategory::contextSlot()).debug() << Q_FUNC_INFO << identifier; }