Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not able to XC any frequency. #246

Closed
ImAlex28 opened this issue Dec 31, 2024 · 3 comments
Closed

Not able to XC any frequency. #246

ImAlex28 opened this issue Dec 31, 2024 · 3 comments

Comments

@ImAlex28
Copy link

Issue Summary: Unable to select to XC a frequency from the UI by right clicking XCA; the XCA button remains unchanged. However, XCA left click functionality works without issues.

Steps to Reproduce:

  1. Right click XCA button of a FREQ while connected as ATC.
  2. Observe that the button does not change, XC is not applied neither.

Expected Behavior: The button should change when selecting XC, and the transceivers of that FREQ should be coupled.

Actual Behavior: The button remains the same when attempting to select XC and transceivers are not coupled.

@GeorgeBarlow
Copy link
Collaborator

GeorgeBarlow commented Jan 1, 2025

The issue seems to be with how we are setting XCA or XC on the C++ side.

if (UserSession::xy) {
mClient->SetTx(newState.frequency, newState.tx);
mClient->SetXc(newState.frequency, newState.xc);
mClient->SetCrossCoupleAcross(newState.frequency, newState.xca);
} else {
mClient->SetTx(newState.frequency, false);
mClient->SetXc(newState.frequency, false);
mClient->SetCrossCoupleAcross(newState.frequency, false);
}

https://github.com/pierr3/afv-native/blob/def3739684b8b0e66f5023cc582ab35ebdbef51c/src/afv/ATCRadioSimulation.cpp#L817-L839

The faulty line seems to be https://github.com/pierr3/afv-native/blob/def3739684b8b0e66f5023cc582ab35ebdbef51c/src/afv/ATCRadioSimulation.cpp#L833

Since when we click XC and trigger SetRadioState in RadioHelper and call both

mClient->SetXc(newState.frequency, newState.xc);
mClient->SetCrossCoupleAcross(newState.frequency, newState.xca);

we are initially setting XC to true on the radio state inside afv-native, using SetXc, but we are then setting it back to false as when we call SetCrossCoupleAcross we use the value of XCA as the parameter crossCoupleAcross and XCA, of course, has to be false when setting XC to true. Therefore the line mRadioState[freq].xc = crossCoupleAcross; inside SetCrossCoupleAcross reverts the XC property back to false.

TLDR: @pierr3 can we get rid of mRadioState[freq].xc = crossCoupleAcross; inside SetCrossCoupleAcross

@pierr3
Copy link
Owner

pierr3 commented Jan 15, 2025

Did not manage to get this fixed in this release, but it will be in the next!

@pierr3
Copy link
Owner

pierr3 commented Jan 15, 2025

Nevermind, this is fixed in the upcoming beta 5

@pierr3 pierr3 closed this as completed Jan 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants