Fix invalid filter width being sent to rig by rigctld.

half-duplex
Phil Taylor 2023-01-13 12:26:11 +00:00
rodzic 996c813251
commit 5c210f0699
2 zmienionych plików z 56 dodań i 14 usunięć

Wyświetl plik

@ -897,8 +897,6 @@ void rigCommander::setPassband(quint16 pass)
calc = quint16((pass / 50) - 1);
}
qDebug() << "Setting rig passband" << pass << "Sending" << calc;
char tens = (calc / 10);
char units = (calc - (10 * tens));
@ -4695,7 +4693,7 @@ void rigCommander::stateUpdated()
if (i.value()._valid) {
setDataMode(state.getBool(DATAMODE), state.getChar(FILTER));
}
getDuplexMode();
getDataMode();
break;
case ANTENNA:
case RXANTENNA:

Wyświetl plik

@ -663,20 +663,64 @@ void rigCtlClient::socketReadyRead()
if (passband > 0)
{
if (passband > 1800 && passband < 2700) {
width = 1;
}
else if (passband <= 1800)
{
width = 2;
}
else if (passband >= 2700)
{
width = 0;
switch ((mode_kind)getMode(mode)) {
case modeAM:
if (passband > 6000) {
width = 1;
}
else if (passband > 3000 && passband <= 6000) {
width = 2;
}
else if (passband <= 3000) {
width = 3;
}
break;
case modeFM:
if (passband > 10000) {
width = 1;
}
else if (passband > 7000 && passband <= 10000) {
width = 2;
}
else if (passband <= 7000) {
width = 3;
}
break;
case modeCW:
case modeRTTY:
case modeCW_R:
case modeRTTY_R:
case modePSK:
if (passband > 500) {
width = 1;
}
else if (passband > 250 && passband <= 500) {
width = 2;
}
else if (passband <= 250) {
width = 3;
}
break;
default:
if (passband > 2400) {
width = 1;
}
else if (passband > 1800 && passband <= 2400) {
width = 2;
}
else if (passband <= 1800) {
width = 3;
}
break;
}
rigState->set(FILTER, width, true);
rigState->set(PASSBAND, passband, true);
}
}
}
else if (command[0] == "j" || command[0] == "get_rit")
{