diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e5a8413cf..e42ed8fd4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -486,7 +486,7 @@ jobs: swiftinstaller-linux-64-${{ needs.preBuild.outputs.version }}.run swiftinstaller-windows-64-${{ needs.preBuild.outputs.version }}.exe swiftinstaller-macos-64-${{ needs.preBuild.outputs.version }}.dmg - xswiftbus-fat-allos-${{ needs.preBuild.outputs.version }}.7z + xswiftbus-fat-allos-${{ needs.preBuild.outputs.version }}.zip swiftsymbols-allos-${{ needs.preBuild.outputs.version }}:swiftsymbols - name: Publish doxygen uses: actions/deploy-pages@v4 diff --git a/src/gui/components/cockpitcomcomponent.cpp b/src/gui/components/cockpitcomcomponent.cpp index 864b958da..e8fb64914 100644 --- a/src/gui/components/cockpitcomcomponent.cpp +++ b/src/gui/components/cockpitcomcomponent.cpp @@ -64,8 +64,6 @@ namespace swift::gui::components // Relay COM form signals connect(ui->editor_Com, &CCockpitComForm::transponderModeChanged, this, &CCockpitComComponent::transponderModeChanged); - connect(ui->editor_Com, &CCockpitComForm::transponderStateIdentEnded, this, - &CCockpitComComponent::transponderStateIdentEnded); // hook up with changes from own aircraft context if (sGui) @@ -149,8 +147,18 @@ namespace swift::gui::components // unavailable context during shutdown possible // mostly when client runs with DBus, but DBus is down if (!sGui || sGui->isShuttingDown() || !sGui->getIContextOwnAircraft()) { return false; } - return sGui->getIContextOwnAircraft()->updateCockpit(ownAircraft.getCom1System(), ownAircraft.getCom2System(), - ownAircraft.getTransponder(), identifier()); + + // The CockpitComForm triggering this slot only includes frequencies and transponder mode/code. + // Everything else is left as default default (especially radio volume and TX/RX state). + CComSystem com1 = sGui->getIContextOwnAircraft()->getOwnAircraft().getCom1System(); + CComSystem com2 = sGui->getIContextOwnAircraft()->getOwnAircraft().getCom2System(); + com1.setFrequencyActive(ownAircraft.getCom1System().getFrequencyActive()); + com1.setFrequencyStandby(ownAircraft.getCom1System().getFrequencyStandby()); + com2.setFrequencyActive(ownAircraft.getCom2System().getFrequencyActive()); + com2.setFrequencyStandby(ownAircraft.getCom2System().getFrequencyStandby()); + + return sGui->getIContextOwnAircraft()->updateCockpit(com1, com2, + ownAircraft.getTransponder(), identifier()); } void CCockpitComComponent::forceCockpitUpdateFromOwnAircraftContext() diff --git a/src/gui/components/cockpitcomcomponent.h b/src/gui/components/cockpitcomcomponent.h index 12dcfc3fe..087cc5584 100644 --- a/src/gui/components/cockpitcomcomponent.h +++ b/src/gui/components/cockpitcomcomponent.h @@ -52,9 +52,6 @@ namespace swift::gui::components //! \copydoc swift::gui::components::CTransponderModeSelector::transponderModeChanged void transponderModeChanged(swift::misc::aviation::CTransponder::TransponderMode newMode); - //! \copydoc swift::gui::components::CTransponderModeSelector::transponderStateIdentEnded - void transponderStateIdentEnded(); - //! @{ //! Request COM text messages void requestCom1TextMessage(); diff --git a/src/gui/components/transpondermodeselector.cpp b/src/gui/components/transpondermodeselector.cpp index d0c24e6f5..3882e925b 100644 --- a/src/gui/components/transpondermodeselector.cpp +++ b/src/gui/components/transpondermodeselector.cpp @@ -59,18 +59,17 @@ namespace swift::gui::components { if (mode != CTransponder::StateIdent) { m_resetMode = mode; } if (m_currentMode == mode) { return; } - if (m_currentMode == CTransponder::StateIdent) { emit this->transponderStateIdentEnded(); } m_currentMode = mode; const QString m = CTransponder::modeAsString(mode); QComboBox::setCurrentText(m); if (mode == CTransponder::StateIdent) { m_resetTimer.start(); } else { m_resetTimer.stop(); } - emit this->transponderModeChanged(m_currentMode); } void CTransponderModeSelector::setSelectedTransponderModeStateIdent() { this->setSelectedTransponderMode(swift::misc::aviation::CTransponder::StateIdent); + emit this->transponderModeChanged(m_currentMode); } void CTransponderModeSelector::setSelectedTransponderModeAsString(const QString &mode) @@ -78,11 +77,13 @@ namespace swift::gui::components CTransponder::TransponderMode m = CTransponder::modeFromString(mode); if (m_currentMode == m) return; // nothing to change this->setSelectedTransponderMode(m); + emit this->transponderModeChanged(m_currentMode); } void CTransponderModeSelector::resetTransponderMode() { if (!this->isIdentSelected()) return; // avoid unnecessary events this->setSelectedTransponderMode(m_resetMode); + emit this->transponderModeChanged(m_currentMode); } } // namespace swift::gui::components diff --git a/src/gui/components/transpondermodeselector.h b/src/gui/components/transpondermodeselector.h index 106153cf2..89926f0b5 100644 --- a/src/gui/components/transpondermodeselector.h +++ b/src/gui/components/transpondermodeselector.h @@ -44,9 +44,6 @@ namespace swift::gui::components //! Ident selected bool isIdentSelected() const; - //! reset to last mode (unequal ident) - void resetTransponderMode(); - //! Selected transponder mode void setSelectedTransponderModeAsString(const QString &mode); @@ -60,10 +57,10 @@ namespace swift::gui::components //! Mode / state has been changed void transponderModeChanged(swift::misc::aviation::CTransponder::TransponderMode newMode); - //! Ident phase ended - void transponderStateIdentEnded(); - private: + //! reset to last mode (unequal ident) + void resetTransponderMode(); + swift::misc::aviation::CTransponder::TransponderMode m_currentMode = swift::misc::aviation::CTransponder::StateStandby; swift::misc::aviation::CTransponder::TransponderMode m_resetMode = diff --git a/src/gui/editors/cockpitcomform.cpp b/src/gui/editors/cockpitcomform.cpp index 92f8e58c8..0345c34f0 100644 --- a/src/gui/editors/cockpitcomform.cpp +++ b/src/gui/editors/cockpitcomform.cpp @@ -38,8 +38,6 @@ namespace swift::gui::editors // XPDR connect(ui->cbp_ComPanelTransponderMode, &CTransponderModeSelector::transponderModeChanged, this, &CCockpitComForm::transponderModeChanged); - connect(ui->cbp_ComPanelTransponderMode, &CTransponderModeSelector::transponderStateIdentEnded, this, - &CCockpitComForm::transponderStateIdentEnded); // COM GUI events connect(ui->tb_ComPanelCom1Toggle, &QPushButton::clicked, this, &CCockpitComForm::onGuiChangedCockpitValues); diff --git a/src/gui/editors/cockpitcomform.h b/src/gui/editors/cockpitcomform.h index 089298a3a..db9097997 100644 --- a/src/gui/editors/cockpitcomform.h +++ b/src/gui/editors/cockpitcomform.h @@ -64,9 +64,6 @@ namespace swift::gui::editors //! \copydoc swift::gui::components::CTransponderModeSelector::transponderModeChanged void transponderModeChanged(swift::misc::aviation::CTransponder::TransponderMode newMode); - //! \copydoc swift::gui::components::CTransponderModeSelector::transponderStateIdentEnded - void transponderStateIdentEnded(); - //! Request to test SELCAL void testSelcal(); diff --git a/src/plugins/simulator/fsxcommon/simconnectdatadefinition.cpp b/src/plugins/simulator/fsxcommon/simconnectdatadefinition.cpp index 1ee57e99f..3a3428b4e 100644 --- a/src/plugins/simulator/fsxcommon/simconnectdatadefinition.cpp +++ b/src/plugins/simulator/fsxcommon/simconnectdatadefinition.cpp @@ -81,8 +81,7 @@ namespace swift::simplugin::fsxcommon hr += initRemoteAircraftSimDataSet(hSimConnect); hr += initSimulatorEnvironment(hSimConnect); hr += initSbDataArea(hSimConnect); - if (simInfo.isMSFS()) { hr += initMSFSTransponder(hSimConnect); } - if (simInfo.isMSFS2024()) { hr += initMSFS2024Transponder(hSimConnect); } + if (simInfo.isMSFS() || simInfo.isMSFS2024()) { hr += initMSFSTransponder(hSimConnect); } return hr; } @@ -179,9 +178,18 @@ namespace swift::simplugin::fsxcommon "ROTATION VELOCITY BODY Y", "Radians per second"); hr += SimConnect_AddToDataDefinition(hSimConnect, CSimConnectDefinitions::DataOwnAircraft, "ROTATION VELOCITY BODY Z", "Radians per second"); - // FS2020 + // MSFS 2020/2024 only. Placed at the end because non-MSFS simulators fail with these and skip them. + // Only access the members when using MSFS! hr += SimConnect_AddToDataDefinition(hSimConnect, CSimConnectDefinitions::DataOwnAircraft, "INDICATED ALTITUDE CALIBRATED", "Feet"); + hr += SimConnect_AddToDataDefinition(hSimConnect, CSimConnectDefinitions::DataOwnAircraft, + "TRANSPONDER STATE:1", "Enum"); + hr += SimConnect_AddToDataDefinition(hSimConnect, CSimConnectDefinitions::DataOwnAircraft, + "TRANSPONDER IDENT:1", "Bool"); + hr += SimConnect_AddToDataDefinition(hSimConnect, CSimConnectDefinitions::DataOwnAircraft, + "COM VOLUME:1", "Percent"); + hr += SimConnect_AddToDataDefinition(hSimConnect, CSimConnectDefinitions::DataOwnAircraft, + "COM VOLUME:2", "Percent"); hr += SimConnect_AddToDataDefinition(hSimConnect, CSimConnectDefinitions::DataOwnAircraftTitle, "TITLE", nullptr, SIMCONNECT_DATATYPE_STRING256); @@ -412,28 +420,11 @@ namespace swift::simplugin::fsxcommon HRESULT hr = s_ok(); hr += SimConnect_AddToDataDefinition(hSimConnect, CSimConnectDefinitions::DataTransponderModeMSFS, "TRANSPONDER STATE:1", "Enum"); - hr += SimConnect_AddToDataDefinition(hSimConnect, CSimConnectDefinitions::DataTransponderModeMSFS, - "TRANSPONDER IDENT:1", "Bool"); - if (isFailure(hr)) - { - CLogMessage(static_cast(nullptr)) - .error(u"SimConnect error: MSFS transponder data definitions %1") - << hr; - } - return hr; - } - HRESULT CSimConnectDefinitions::initMSFS2024Transponder(const HANDLE hSimConnect) - { - HRESULT hr = s_ok(); - hr += SimConnect_AddToDataDefinition(hSimConnect, CSimConnectDefinitions::DataTransponderModeMSFS, - "TRANSPONDER STATE:1", "Enum"); - hr += SimConnect_AddToDataDefinition(hSimConnect, CSimConnectDefinitions::DataTransponderModeMSFS, - "TRANSPONDER IDENT:1", "Bool"); if (isFailure(hr)) { CLogMessage(static_cast(nullptr)) - .error(u"SimConnect error: MSFS2024 transponder data definitions %1") + .error(u"SimConnect error: MSFS transponder data definitions %1") << hr; } return hr; diff --git a/src/plugins/simulator/fsxcommon/simconnectdatadefinition.h b/src/plugins/simulator/fsxcommon/simconnectdatadefinition.h index d23a3497c..1073e6cbf 100644 --- a/src/plugins/simulator/fsxcommon/simconnectdatadefinition.h +++ b/src/plugins/simulator/fsxcommon/simconnectdatadefinition.h @@ -76,9 +76,11 @@ namespace swift::simplugin::fsxcommon double rotationVelocityBodyX; //!< Rotation Velocity Body X double rotationVelocityBodyY; //!< Rotation Velocity Body Y double rotationVelocityBodyZ; //!< Rotation Velocity Body Z - // 44 - double altitudeCalibratedFt; //!< Altitude without temperature effect (ft, FS2020) - // 45 + double altitudeCalibratedFt; //!< Altitude without temperature effect (ft, MSFS) + double transponderMode; //!< transponder state (MSFS) + double ident; //!< ident (MSFS) + double com1Volume; //!< COM1 volume (MSFS) + double com2Volume; //!< COM2 volume (MSFS) }; //! Data struct of aircraft position @@ -253,9 +255,9 @@ namespace swift::simplugin::fsxcommon struct DataDefinitionMSFSTransponderMode { double transponderMode = 1; //!< transponder state simvar - double ident = 0; //!< ident }; + //! Client areas enum ClientAreaId { @@ -293,7 +295,6 @@ namespace swift::simplugin::fsxcommon RequestOwnAircraft, RequestOwnAircraftTitle, RequestSbData, //!< SB client area / XPDR mode - RequestMSFSTransponder, //!< MSFS XPDR mode/ident RequestFacility, RequestEndMarker //!< free request ids can start here }; @@ -345,9 +346,6 @@ namespace swift::simplugin::fsxcommon //! Initialize data definition for MSFS transponder static HRESULT initMSFSTransponder(const HANDLE hSimConnect); - - //! Initialize data definition for MSFS transponder - static HRESULT initMSFS2024Transponder(const HANDLE hSimConnect); }; } // namespace swift::simplugin::fsxcommon diff --git a/src/plugins/simulator/fsxcommon/simulatorfsxcommon.cpp b/src/plugins/simulator/fsxcommon/simulatorfsxcommon.cpp index e130562a6..4670505a7 100644 --- a/src/plugins/simulator/fsxcommon/simulatorfsxcommon.cpp +++ b/src/plugins/simulator/fsxcommon/simulatorfsxcommon.cpp @@ -204,7 +204,6 @@ namespace swift::simplugin::fsxcommon { DataDefinitionMSFSTransponderMode t; t.transponderMode = (newTransponder.isInStandby() ? 1 : 4); - t.ident = newTransponder.isIdentifying(); HRESULT hr = s_ok(); @@ -528,7 +527,6 @@ namespace swift::simplugin::fsxcommon SIMCONNECT_PERIOD_SECOND, SIMCONNECT_DATA_REQUEST_FLAG_CHANGED), "Cannot request title", Q_FUNC_INFO, "SimConnect_RequestDataOnSimObject"); - // TODO TZ use MSFS2024 FSUIPC? if (!this->getSimulatorPluginInfo().getSimulatorInfo().isMSFS() && !this->getSimulatorPluginInfo().getSimulatorInfo().isMSFS2024()) { @@ -542,15 +540,6 @@ namespace swift::simplugin::fsxcommon SIMCONNECT_CLIENT_DATA_REQUEST_FLAG_CHANGED), "Cannot request client data", Q_FUNC_INFO, "SimConnect_RequestClientData"); } - else - { - hr += this->logAndTraceSendId( - SimConnect_RequestDataOnSimObject(m_hSimConnect, CSimConnectDefinitions::RequestMSFSTransponder, - CSimConnectDefinitions::DataTransponderModeMSFS, - SIMCONNECT_OBJECT_ID_USER, SIMCONNECT_PERIOD_VISUAL_FRAME, - SIMCONNECT_DATA_REQUEST_FLAG_CHANGED), - "Cannot request MSFS transponder data", Q_FUNC_INFO, "SimConnect_RequestDataOnSimObject"); - } if (isFailure(hr)) { return; } this->emitSimulatorCombinedStatus(); // force sending status @@ -693,6 +682,20 @@ namespace swift::simplugin::fsxcommon CAltitude(simulatorOwnAircraft.altitudeFt, CAltitude::MeanSeaLevel, CLengthUnit::ft())); } + void CSimulatorFsxCommon::setTransponderMode( + [[maybe_unused]] swift::misc::aviation::CTransponder &transponder, + [[maybe_unused]] const swift::simplugin::fsxcommon::DataDefinitionOwnAircraft &simulatorOwnAircraft) + { /* Do not modify the transponder mode by default. Only MSFS allows to read it from SimVars */ } + + void CSimulatorFsxCommon::setComVolume( + [[maybe_unused]] swift::misc::aviation::CComSystem &com, + [[maybe_unused]] const swift::simplugin::fsxcommon::DataDefinitionOwnAircraft &simulatorOwnAircraft, + [[maybe_unused]] swift::misc::aviation::CComSystem::ComUnit unit) + { + /* Do not modify the COM volume by default. Only MSFS allows to read it from SimVars */ + } + + void CSimulatorFsxCommon::updateOwnAircraftFromSimulator(const DataDefinitionOwnAircraft &simulatorOwnAircraft) { const qint64 ts = QDateTime::currentMSecsSinceEpoch(); @@ -797,6 +800,8 @@ namespace swift::simplugin::fsxcommon if (!changedCom1Standby) { com1.setFrequencyStandby(myAircraft.getCom1System().getFrequencyStandby()); } else { m_lastCom1Standby.setNull(); } + setComVolume(com1, simulatorOwnAircraft, CComSystem::Com1); + const bool changedCom1 = myAircraft.getCom1System() != com1; m_simCom1 = com1; @@ -825,6 +830,8 @@ namespace swift::simplugin::fsxcommon if (!changedCom2Standby) { com2.setFrequencyStandby(myAircraft.getCom2System().getFrequencyStandby()); } else { m_lastCom2Standby.setNull(); } + setComVolume(com2, simulatorOwnAircraft, CComSystem::Com2); + const bool changedCom2 = myAircraft.getCom2System() != com2; m_simCom2 = com2; @@ -832,12 +839,13 @@ namespace swift::simplugin::fsxcommon CTransponder transponder(myAircraft.getTransponder()); transponder.setTransponderCode(qRound(simulatorOwnAircraft.transponderCode)); + setTransponderMode(transponder, simulatorOwnAircraft); 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()); + const bool changedXpr = (myAircraft.getTransponder() != transponder); if (changedCom1 || changedCom2 || changedXpr) { @@ -1009,17 +1017,6 @@ namespace swift::simplugin::fsxcommon this->updateCockpit(myAircraft.getCom1System(), myAircraft.getCom2System(), myXpdr, this->identifier()); } - void CSimulatorFsxCommon::updateMSFSTransponderMode(const DataDefinitionMSFSTransponderMode transponderMode) - { - auto mode = CTransponder::StateIdent; - if (!transponderMode.ident) - { - qRound(transponderMode.transponderMode) >= 3 ? mode = CTransponder::ModeC : - mode = CTransponder::StateStandby; - } - this->updateTransponderMode(mode); - } - bool CSimulatorFsxCommon::simulatorReportedObjectAdded(DWORD objectId) { if (this->isShuttingDownOrDisconnected()) { return true; } // pretend everything is fine diff --git a/src/plugins/simulator/fsxcommon/simulatorfsxcommon.h b/src/plugins/simulator/fsxcommon/simulatorfsxcommon.h index 5cb1976eb..35600d83c 100644 --- a/src/plugins/simulator/fsxcommon/simulatorfsxcommon.h +++ b/src/plugins/simulator/fsxcommon/simulatorfsxcommon.h @@ -503,6 +503,17 @@ namespace swift::simplugin::fsxcommon setTrueAltitude(swift::misc::aviation::CAircraftSituation &aircraftSituation, const swift::simplugin::fsxcommon::DataDefinitionOwnAircraft &simulatorOwnAircraft); + //! Customization point for changing the transponder mode + virtual void + setTransponderMode(swift::misc::aviation::CTransponder &transponder, + const swift::simplugin::fsxcommon::DataDefinitionOwnAircraft &simulatorOwnAircraft); + + //! Customization point for changing the COM volume + virtual void + setComVolume(swift::misc::aviation::CComSystem &com, + const swift::simplugin::fsxcommon::DataDefinitionOwnAircraft &simulatorOwnAircraft, + swift::misc::aviation::CComSystem::ComUnit unit); + //! Called when data about our own aircraft are received void updateOwnAircraftFromSimulator(const DataDefinitionOwnAircraft &simulatorOwnAircraft); @@ -514,9 +525,6 @@ namespace swift::simplugin::fsxcommon //! \threadsafe void updateTransponderMode(const misc::aviation::CTransponder::TransponderMode xpdrMode); - //! Update transponder mode from MSFS - void updateMSFSTransponderMode(const DataDefinitionMSFSTransponderMode transponderMode); - //! An AI aircraft was added in the simulator bool simulatorReportedObjectAdded(DWORD objectId); diff --git a/src/plugins/simulator/fsxcommon/simulatorfsxsimconnectproc.cpp b/src/plugins/simulator/fsxcommon/simulatorfsxsimconnectproc.cpp index 68643c4aa..4f7cd4f97 100644 --- a/src/plugins/simulator/fsxcommon/simulatorfsxsimconnectproc.cpp +++ b/src/plugins/simulator/fsxcommon/simulatorfsxsimconnectproc.cpp @@ -81,6 +81,13 @@ namespace swift::simplugin::fsxcommon switch (exceptionId) { case SIMCONNECT_EXCEPTION_OPERATION_INVALID_FOR_OBJECT_TYPE: break; + case SIMCONNECT_EXCEPTION_NAME_UNRECOGNIZED: + { + // MSFS-specific SimVars might fail on P3D. + // Silently ignore them as they are not accessed. + logGenericExceptionInfo = false; + break; + } case SIMCONNECT_EXCEPTION_UNRECOGNIZED_ID: break; // Specifies that the client event, request ID, data definition ID, or object ID was not // recognized @@ -126,7 +133,7 @@ namespace swift::simplugin::fsxcommon const QString exceptionString( CSimConnectUtilities::simConnectExceptionToString(static_cast(exception->dwException))); const QString sendIdDetails = simulatorFsxP3D->getSendIdTraceDetails(sendId); - CLogMessage(simulatorFsxP3D).warning(u"Caught simConnect exception: '%1' '%2' | send details: '%3'") + CLogMessage(simulatorFsxP3D).warning(u"Caught SimConnect exception: '%1' '%2' | send details: '%3'") << exceptionString << ex << (sendIdDetails.isEmpty() ? "N/A" : sendIdDetails); } break; // SIMCONNECT_RECV_ID_EXCEPTION @@ -245,7 +252,7 @@ namespace swift::simplugin::fsxcommon { case CSimConnectDefinitions::RequestOwnAircraft: { - static_assert(sizeof(DataDefinitionOwnAircraft) == 45 * sizeof(double), + static_assert(sizeof(DataDefinitionOwnAircraft) == 49 * sizeof(double), "DataDefinitionOwnAircraft has an incorrect size."); const DataDefinitionOwnAircraft *ownAircaft = reinterpret_cast(&pObjData->dwData); @@ -260,13 +267,6 @@ namespace swift::simplugin::fsxcommon simulatorFsxP3D->reverseLookupAndUpdateOwnAircraftModel(model); break; } - case CSimConnectDefinitions::RequestMSFSTransponder: - { - const DataDefinitionMSFSTransponderMode *transponderMode = - reinterpret_cast(&pObjData->dwData); - simulatorFsxP3D->updateMSFSTransponderMode(*transponderMode); - break; - } default: { const DWORD objectId = pObjData->dwObjectID; diff --git a/src/plugins/simulator/msfs/simulatormsfs.cpp b/src/plugins/simulator/msfs/simulatormsfs.cpp index 4bd3d6897..279e74b28 100644 --- a/src/plugins/simulator/msfs/simulatormsfs.cpp +++ b/src/plugins/simulator/msfs/simulatormsfs.cpp @@ -41,6 +41,29 @@ namespace swift::simplugin::msfs CLengthUnit::ft() }; } + void CSimulatorMsFs::setTransponderMode( + swift::misc::aviation::CTransponder& transponder, + const swift::simplugin::fsxcommon::DataDefinitionOwnAircraft& simulatorOwnAircraft) + { + auto mode = CTransponder::StateIdent; + if (!simulatorOwnAircraft.ident) + { + qRound(simulatorOwnAircraft.transponderMode) >= 3 ? mode = CTransponder::ModeC : + mode = CTransponder::StateStandby; + } + transponder.setTransponderMode(mode); + } + + void CSimulatorMsFs::setComVolume( + swift::misc::aviation::CComSystem& com, + const swift::simplugin::fsxcommon::DataDefinitionOwnAircraft& simulatorOwnAircraft, + swift::misc::aviation::CComSystem::ComUnit unit) + { + if (unit == CComSystem::Com1) { com.setVolumeReceive(simulatorOwnAircraft.com1Volume);} + if (unit == CComSystem::Com2) { com.setVolumeReceive(simulatorOwnAircraft.com2Volume); } + } + + void CSimulatorMsFsListener::startImpl() { if (!loadAndResolveMSFSimConnect()) { return; } diff --git a/src/plugins/simulator/msfs/simulatormsfs.h b/src/plugins/simulator/msfs/simulatormsfs.h index 1f78a2d64..91a7d4b65 100644 --- a/src/plugins/simulator/msfs/simulatormsfs.h +++ b/src/plugins/simulator/msfs/simulatormsfs.h @@ -30,6 +30,15 @@ namespace swift::simplugin::msfs virtual void setTrueAltitude(swift::misc::aviation::CAircraftSituation &aircraftSituation, const swift::simplugin::fsxcommon::DataDefinitionOwnAircraft &simulatorOwnAircraft) override; + + void + setTransponderMode(swift::misc::aviation::CTransponder &transponder, + const swift::simplugin::fsxcommon::DataDefinitionOwnAircraft &simulatorOwnAircraft) override; + + void setComVolume(swift::misc::aviation::CComSystem &com, + const swift::simplugin::fsxcommon::DataDefinitionOwnAircraft &simulatorOwnAircraft, + swift::misc::aviation::CComSystem::ComUnit unit) override; + }; //! Listener for MSFS