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