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

Fix bug preventing 60 meter frequencies from using USB with DIGU/DIGL disabled #589

Merged
merged 3 commits into from Oct 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions USER_MANUAL.md
Expand Up @@ -913,6 +913,7 @@ LDPC | Low Density Parity Check Codes - a family of powerful FEC codes

1. Bugfixes:
* Fix bug preventing frequency updates from being properly suppressed when frequency control is in focus. (PR #585)
* Fix bug preventing 60 meter frequencies from using USB with DIGU/DIGL disabled. (PR #589)

## V1.9.4 October 2023

Expand Down
35 changes: 12 additions & 23 deletions src/ongui.cpp
Expand Up @@ -835,36 +835,25 @@ void MainFrame::togglePTT(void) {

HamlibRigController::Mode MainFrame::getCurrentMode_()
{
// Widest 60 meter allocation is 5.250-5.450 MHz per https://en.wikipedia.org/wiki/60-meter_band.
bool is60MeterBand =
wxGetApp().appConfiguration.reportingConfiguration.reportingFrequency >= 5250000 &&
wxGetApp().appConfiguration.reportingConfiguration.reportingFrequency <= 5450000;

bool useAnalog =
wxGetApp().appConfiguration.rigControlConfiguration.hamlibUseAnalogModes || g_analog;
HamlibRigController::Mode lsbMode = useAnalog ? HamlibRigController::LSB : HamlibRigController::DIGL;
HamlibRigController::Mode usbMode = useAnalog ? HamlibRigController::USB : HamlibRigController::DIGU;

HamlibRigController::Mode newMode;
if (useAnalog)
if (wxGetApp().appConfiguration.reportingConfiguration.reportingFrequency < 10000000 &&
!is60MeterBand)
{
if (wxGetApp().appConfiguration.reportingConfiguration.reportingFrequency < 10000000)
{
newMode = HamlibRigController::LSB;
}
else
{
newMode = HamlibRigController::USB;
}
newMode = lsbMode;
}
else
{
// Widest 60 meter allocation is 5.250-5.450 MHz per https://en.wikipedia.org/wiki/60-meter_band.
bool is60MeterBand =
wxGetApp().appConfiguration.reportingConfiguration.reportingFrequency >= 5250000 &&
wxGetApp().appConfiguration.reportingConfiguration.reportingFrequency <= 5450000;

if (wxGetApp().appConfiguration.reportingConfiguration.reportingFrequency < 10000000 &&
!is60MeterBand)
{
newMode = HamlibRigController::DIGL;
}
else
{
newMode = HamlibRigController::DIGU;
}
newMode = usbMode;
}

return newMode;
Expand Down