mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-23 15:25:35 +08:00
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user