Skip to content

Commit 32bdab8

Browse files
committed
[FSX/MSFS] Fix COM TX/RX sync
After the 8.33 kHz commits, changes of the TX/RX status were only transmitted from the sim to GUI if frequencies changed.
1 parent 1f2abdc commit 32bdab8

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/plugins/simulator/fsxcommon/simulatorfsxcommon.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -741,7 +741,6 @@ namespace BlackSimPlugin::FsxCommon
741741

742742
const bool changedCom1Active = myAircraft.getCom1System().getFrequencyActive() != com1.getFrequencyActive() && com1.getFrequencyActive() != m_lastCom1Active;
743743
const bool changedCom1Standby = myAircraft.getCom1System().getFrequencyStandby() != com1.getFrequencyStandby() && com1.getFrequencyStandby() != m_lastCom1Standby;
744-
const bool changedCom1 = changedCom1Active || changedCom1Standby;
745744

746745
// Avoid overwrite of 8.33 kHz frequency with data from simulator
747746
if (!changedCom1Active)
@@ -762,6 +761,8 @@ namespace BlackSimPlugin::FsxCommon
762761
m_lastCom1Standby.setNull();
763762
}
764763

764+
const bool changedCom1 = myAircraft.getCom1System() != com1;
765+
765766
m_simCom1 = com1;
766767
Q_UNUSED(com1Test)
767768

@@ -774,7 +775,6 @@ namespace BlackSimPlugin::FsxCommon
774775
com2.setReceiveEnabled(com2Status == 0 && (comReceiveAll || com2Transmit));
775776
const bool changedCom2Active = myAircraft.getCom2System().getFrequencyActive() != com2.getFrequencyActive() && com2.getFrequencyActive() != m_lastCom2Active;
776777
const bool changedCom2Standby = myAircraft.getCom2System().getFrequencyStandby() != com2.getFrequencyStandby() && com2.getFrequencyStandby() != m_lastCom2Standby;
777-
const bool changedCom2 = changedCom2Active || changedCom2Standby;
778778

779779
// Avoid overwrite of 8.33 kHz frequency with data from simulator
780780
if (!changedCom2Active)
@@ -795,6 +795,8 @@ namespace BlackSimPlugin::FsxCommon
795795
m_lastCom2Standby.setNull();
796796
}
797797

798+
const bool changedCom2 = myAircraft.getCom2System() != com2;
799+
798800
m_simCom2 = com2;
799801
Q_UNUSED(com2Test)
800802

0 commit comments

Comments
 (0)