From 034525316ed799d8dd463f7be7b044133bbb08e3 Mon Sep 17 00:00:00 2001 From: Klaus Basan Date: Tue, 20 Nov 2018 17:39:33 +0100 Subject: [PATCH] Ref T437, fixed missing update of "m_simTransponder" which caused SB area changes to be ignored * also added SELCAL hints * sync m_simTransponder --- src/plugins/simulator/fs9/simulatorfs9.cpp | 4 +++- .../simulator/fsxcommon/simulatorfsxcommon.cpp | 13 ++++++++++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/plugins/simulator/fs9/simulatorfs9.cpp b/src/plugins/simulator/fs9/simulatorfs9.cpp index 63f8e3dd4..76e01d7d5 100644 --- a/src/plugins/simulator/fs9/simulatorfs9.cpp +++ b/src/plugins/simulator/fs9/simulatorfs9.cpp @@ -255,10 +255,12 @@ namespace BlackSimPlugin bool changed = false; if (selcal != m_selcal) { + //! KB 2018-11 that would need to go to updateOwnAircraftFromSimulator if the simulator ever supports SELCAL + //! KB 2018-11 als we would need to send the value to FS9/FSX (currently we only deal with it on FS9/FSX level) + m_selcal = selcal; changed = true; } - //! \todo KB 8/2017 set FS9 SELCAL value return changed; } diff --git a/src/plugins/simulator/fsxcommon/simulatorfsxcommon.cpp b/src/plugins/simulator/fsxcommon/simulatorfsxcommon.cpp index 4cf8678eb..6556320ea 100644 --- a/src/plugins/simulator/fsxcommon/simulatorfsxcommon.cpp +++ b/src/plugins/simulator/fsxcommon/simulatorfsxcommon.cpp @@ -204,12 +204,13 @@ namespace BlackSimPlugin this->triggerAutoTraceSendId(); CLogMessage(this).warning("Setting transponder mode failed (SB offsets)"); } + changed = true; } else if (m_useFsuipc && m_fsuipc) { m_fsuipc->write(newTransponder); + changed = true; } - changed = true; } // avoid changes of cockpit back to old values due to an outdated read back value @@ -224,8 +225,9 @@ namespace BlackSimPlugin if (originator == this->identifier()) { return false; } if (!this->isSimulating()) { return false; } - //! \fixme KB 2017/8 use SELCAL - Q_UNUSED(selcal); + //! KB 2018-11 that would need to go to updateOwnAircraftFromSimulator if the simulator ever supports SELCAL + //! KB 2018-11 als we would need to send the value to FS9/FSX (currently we only deal with it on FS9/FSX level) + m_selcal = selcal; return false; } @@ -666,6 +668,11 @@ namespace BlackSimPlugin CTransponder transponder(myAircraft.getTransponder()); transponder.setTransponderCode(qRound(simulatorOwnAircraft.transponderCode)); + m_simTransponder = transponder; + + // if the simulator ever sends SELCAL, add it here. + // m_selcal SELCAL sync.would go here + const bool changedXpr = (myAircraft.getTransponderCode() != transponder.getTransponderCode()); if (changedCom1 || changedCom2 || changedXpr)