From c1ffad33bd320058e1e0eb1c4d81bae3d6f9b4a2 Mon Sep 17 00:00:00 2001 From: Klaus Basan Date: Sat, 25 May 2019 17:10:35 +0200 Subject: [PATCH] Ref T650, using FSX SimulatedObject type decrease exeption counter when successfully added * normally adding the SimObject fails first, * then the workaround is used (but exception counter is 1) * this means a 2nd time the object cannot be changed, as there is already a counter number > 0 --- src/plugins/simulator/fsxcommon/simconnectobject.h | 3 +++ src/plugins/simulator/fsxcommon/simulatorfsxcommon.cpp | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/plugins/simulator/fsxcommon/simconnectobject.h b/src/plugins/simulator/fsxcommon/simconnectobject.h index 79044b0a2..d2087cbad 100644 --- a/src/plugins/simulator/fsxcommon/simconnectobject.h +++ b/src/plugins/simulator/fsxcommon/simconnectobject.h @@ -250,6 +250,9 @@ namespace BlackSimPlugin //! Increase adding exception void increaseAddingExceptions() { m_addingExceptions++; } + //! Decrease adding exception + void decreaseAddingExceptions() { if (m_addingExceptions > 0) { m_addingExceptions--; } ; } + //! Adding and directly removed int getAddingDirectlyRemoved() const { return m_addingDirectlyRemoved; } diff --git a/src/plugins/simulator/fsxcommon/simulatorfsxcommon.cpp b/src/plugins/simulator/fsxcommon/simulatorfsxcommon.cpp index 8c7e71e2e..d7b9f5516 100644 --- a/src/plugins/simulator/fsxcommon/simulatorfsxcommon.cpp +++ b/src/plugins/simulator/fsxcommon/simulatorfsxcommon.cpp @@ -1006,9 +1006,9 @@ namespace BlackSimPlugin if (simObject.isConfirmedAdded() && simObject.getType() == CSimConnectObject::AircraftSimulatedObject) { - const CStatusMessage soMsg = CLogMessage(this).warning(u"Confirm added model '%1' '%2', but as '%3'") << remoteAircraft.getCallsignAsString() << remoteAircraft.getModelString() << simObject.getTypeAsString(); - this->triggerAutoTraceSendId(); // trace for some time (issues regarding this workaround) - Q_UNUSED(soMsg); + CLogMessage(this).warning(u"Confirm added model '%1' '%2', but as '%3'") << remoteAircraft.getCallsignAsString() << remoteAircraft.getModelString() << simObject.getTypeAsString(); + this->triggerAutoTraceSendId(); // trace for some time (issues regarding this workaround?) + simObject.decreaseAddingExceptions(); // if previously increased and now working, reset } } while (false);