mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-31 12:55:33 +08:00
Ref T669, also interpolation Ref T668, remove last sent values if aircraft is removed
This commit is contained in:
committed by
Mat Sutcliffe
parent
f1ff410e64
commit
a86e98ca3a
@@ -172,8 +172,7 @@ namespace BlackCore
|
||||
// rendering related stuff
|
||||
m_addAgainAircraftWhenRemoved.clear();
|
||||
m_callsignsToBeRendered.clear();
|
||||
m_lastSentParts.clear();
|
||||
m_lastSentSituations.clear();
|
||||
this->resetLastSentValues(); // clear all last sent values
|
||||
m_updateRemoteAircraftInProgress = false;
|
||||
|
||||
this->clearInterpolationSetupsPerCallsign();
|
||||
@@ -759,6 +758,12 @@ namespace BlackCore
|
||||
}
|
||||
}
|
||||
|
||||
bool ISimulator::physicallyRemoveRemoteAircraft(const CCallsign &callsign)
|
||||
{
|
||||
this->resetLastSentValues(callsign);
|
||||
return true;
|
||||
}
|
||||
|
||||
int ISimulator::physicallyRemoveMultipleRemoteAircraft(const CCallsignSet &callsigns)
|
||||
{
|
||||
if (callsigns.isEmpty()) { return 0; }
|
||||
|
||||
@@ -316,6 +316,7 @@ namespace BlackSimPlugin
|
||||
m_interpolators.remove(callsign);
|
||||
const int c = m_renderedAircraft.removeByCallsign(callsign);
|
||||
this->updateAircraftRendered(callsign, false); // in provider
|
||||
CSimulatorPluginCommon::physicallyRemoveRemoteAircraft(callsign);
|
||||
return c > 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -566,7 +566,7 @@ namespace BlackSimPlugin
|
||||
m_pendingToBeAddedAircraft.removeByCallsign(callsign);
|
||||
|
||||
// bye
|
||||
return true;
|
||||
return CSimulatorPluginCommon::physicallyRemoveRemoteAircraft(callsign);
|
||||
}
|
||||
|
||||
int CSimulatorFlightgear::physicallyRemoveAllRemoteAircraft()
|
||||
|
||||
@@ -199,7 +199,7 @@ namespace BlackSimPlugin
|
||||
m_hashFs9Clients.remove(callsign);
|
||||
updateAircraftRendered(callsign, false);
|
||||
CLogMessage(this).info(u"FS9: Removed aircraft %1") << callsign.toQString();
|
||||
return true;
|
||||
return CSimulatorFsCommon::physicallyRemoveRemoteAircraft(callsign);
|
||||
}
|
||||
|
||||
int CSimulatorFs9::physicallyRemoveAllRemoteAircraft()
|
||||
|
||||
@@ -1745,7 +1745,7 @@ namespace BlackSimPlugin
|
||||
QTimer::singleShot(2000, this, [ = ]
|
||||
{
|
||||
if (!myself) { return; }
|
||||
CLogMessage(this).info(u"Next trail to remove '%1'") << callsign.asString();
|
||||
CLogMessage(this).info(u"Next trial to remove '%1'") << callsign.asString();
|
||||
myself->physicallyRemoveRemoteAircraft(callsign);
|
||||
});
|
||||
return false; // not yet deleted
|
||||
@@ -1785,7 +1785,7 @@ namespace BlackSimPlugin
|
||||
this->physicallyRemoveAircraftNotInProviderAsync();
|
||||
|
||||
// bye
|
||||
return true;
|
||||
return CSimulatorPluginCommon::physicallyRemoveRemoteAircraft(callsign);
|
||||
}
|
||||
|
||||
int CSimulatorFsxCommon::physicallyRemoveAllRemoteAircraft()
|
||||
@@ -1992,7 +1992,7 @@ namespace BlackSimPlugin
|
||||
const CCallsign cs = simObject.getCallsign();
|
||||
if (result.getPartsStatus().isReusedParts() || this->isEqualLastSent(parts, cs)) { return true; }
|
||||
|
||||
DataDefinitionRemoteAircraftPartsWithoutLights ddRemoteAircraftPartsWithoutLights(parts); // no init, all values will be set
|
||||
DataDefinitionRemoteAircraftPartsWithoutLights ddRemoteAircraftPartsWithoutLights(parts); // all values will be set
|
||||
const bool ok = this->sendRemoteAircraftPartsToSimulator(simObject, ddRemoteAircraftPartsWithoutLights, parts.getAdjustedLights());
|
||||
if (ok) { this->rememberLastSent(parts, cs); }
|
||||
return ok;
|
||||
@@ -2039,7 +2039,7 @@ namespace BlackSimPlugin
|
||||
|
||||
const DWORD objectId = simObject.getObjectId();
|
||||
const bool traceId = this->isTracingSendId();
|
||||
const bool simObjectAircraftType = simObject.isAircraftSimulatedObject();
|
||||
const bool simObjectAircraftType = simObject.isAircraftSimulatedObject(); // no real aircraft type
|
||||
|
||||
// in case we sent, we sent everything
|
||||
const HRESULT hr1 = simObjectAircraftType ?
|
||||
|
||||
@@ -641,7 +641,7 @@ namespace BlackSimPlugin
|
||||
|
||||
bool CSimulatorXPlane::physicallyRemoveRemoteAircraft(const CCallsign &callsign)
|
||||
{
|
||||
Q_ASSERT(isConnected());
|
||||
Q_ASSERT(this->isConnected());
|
||||
|
||||
// only remove from sim
|
||||
Q_ASSERT_X(CThreadUtils::isCurrentThreadObjectThread(this), Q_FUNC_INFO, "wrong thread");
|
||||
@@ -692,7 +692,7 @@ namespace BlackSimPlugin
|
||||
m_pendingToBeAddedAircraft.removeByCallsign(callsign);
|
||||
|
||||
// bye
|
||||
return true;
|
||||
return CSimulatorPluginCommon::physicallyRemoveRemoteAircraft(callsign);
|
||||
}
|
||||
|
||||
int CSimulatorXPlane::physicallyRemoveAllRemoteAircraft()
|
||||
|
||||
Reference in New Issue
Block a user