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

@@ -305,13 +305,15 @@ namespace BlackGui
if (!sGui->getIContextSimulator()->isSimulatorSimulating()) { return; }
const CCallsign callsign(this->validateRenderedCallsign());
if (callsign.isEmpty()) { return; }
const CSimulatedAircraft aircraftFromBackend = sGui->getIContextNetwork()->getAircraftInRangeForCallsign(callsign);
if (aircraftFromBackend.getCallsign() != callsign) { return; }
bool changed = sGui->getIContextNetwork()->updateAircraftModel(callsign, aircraftFromBackend.getModel(), identifier());
if (changed)
bool reset = sGui->getIContextSimulator()->resetToModelMatchingAircraft(callsign);
if (reset)
{
CLogMessage(this).info("Model reset for '%1'") << callsign.toQString();
}
else
{
CLogMessage(this).info("Reset failed for '%1'") << callsign.toQString();
}
}
void CMappingComponent::ps_onModelPreviewChanged(int state)