Update GUI when band change

1.3.0
PianetaRadio 2022-11-18 21:09:44 +01:00 zatwierdzone przez GitHub
rodzic 888c4bb230
commit 81f9ddec86
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
2 zmienionych plików z 30 dodań i 12 usunięć

Wyświetl plik

@ -337,7 +337,7 @@ void MainWindow::guiUpdate()
ui->comboBox_Mode->setCurrentText(rig_strrmode(rigGet.mode));
ui->comboBox_ModeSub->setCurrentText(rig_strrmode(rigGet.modeSub));
if (guiCmd.tabList)
if (guiCmd.tabList) //Select appropriate mode function tab
{
if (rigGet.mode == RIG_MODE_SSB || rigGet.mode == RIG_MODE_USB || rigGet.mode == RIG_MODE_LSB) ui->tabWidget->setCurrentIndex(0); //Clarifier tab
if (rigGet.mode == RIG_MODE_CW || rigGet.mode == RIG_MODE_CWR || rigGet.mode == RIG_MODE_CWN) ui->tabWidget->setCurrentIndex(1); //CW tab
@ -1096,7 +1096,6 @@ void MainWindow::on_vfoDisplaySubValueChanged(int value)
void MainWindow::on_comboBox_Mode_activated(int index)
{
rigSet.mode = rig_parse_mode(ui->comboBox_Mode->itemText(index).toLatin1());
guiCmd.tabList = 1; //update tab
rigCmd.mode = 1;
}

Wyświetl plik

@ -170,7 +170,8 @@ void RigDaemon::rigUpdate()
retcode = rig_set_mode(my_rig, RIG_VFO_CURR, rigSet.mode, RIG_PASSBAND_NOCHANGE);
if (retcode == RIG_OK)
{
guiCmd.bwidthList = 1; //Update BWidth list
guiCmd.bwidthList = 1; //Command update of BW list
guiCmd.tabList = 1; //Command selection of appropriate mode function tab
commandPriority = 0;
//rig_get_mode(my_rig, RIG_VFO_CURR, &rigGet.mode, &rigGet.bwidth); //Get BW
}
@ -280,8 +281,11 @@ void RigDaemon::rigUpdate()
retcode = rig_vfo_op(my_rig, RIG_VFO_CURR, RIG_OP_BAND_UP);
if (retcode == RIG_OK)
{
commandPriority = 0;
guiCmd.bwidthList = 1;
freq_t retfreq;
retcode = rig_get_freq(my_rig, RIG_VFO_CURR, &retfreq); //get VFO Main
if (retcode == RIG_OK) rigGet.freqMain = retfreq;
commandPriority = 1;
}
}
rigCmd.bandUp = 0;
@ -295,8 +299,11 @@ void RigDaemon::rigUpdate()
retcode = rig_vfo_op(my_rig, RIG_VFO_CURR, RIG_OP_BAND_DOWN);
if (retcode == RIG_OK)
{
commandPriority = 0;
guiCmd.bwidthList = 1;
freq_t retfreq;
retcode = rig_get_freq(my_rig, RIG_VFO_CURR, &retfreq); //get VFO Main
if (retcode == RIG_OK) rigGet.freqMain = retfreq;
commandPriority = 1;
}
}
rigCmd.bandDown = 0;
@ -309,13 +316,18 @@ void RigDaemon::rigUpdate()
{
retvalue.i = rigSet.band;
retcode = rig_set_level(my_rig, RIG_VFO_CURR, RIG_LEVEL_BAND_SELECT, retvalue);
if (retcode == RIG_OK) rigGet.band = rigSet.band;
qDebug() << retcode << rigCap.bandChange << rigSet.band;
}
if (retcode == RIG_OK)
{
rigGet.band = rigSet.band;
freq_t retfreq;
retcode = rig_get_freq(my_rig, RIG_VFO_CURR, &retfreq); //get VFO Main
if (retcode == RIG_OK) rigGet.freqMain = retfreq;
commandPriority = 1;
}
}
rigCmd.bandChange = 0;
commandPriority = 0;
//guiCmd.bwidthList = 1;
}
//* Tune
@ -620,9 +632,16 @@ void RigDaemon::rigUpdate()
if ((commandPriority == 1 && !rigGet.ptt && rigCom.fullPoll) || commandPriority == 0)
{
rig_get_mode(my_rig, RIG_VFO_CURR, &rigGet.mode, &rigGet.bwidth);
if (rigGet.bwidth == rig_passband_narrow(my_rig, rigGet.mode)) rigGet.bwNarrow = 1;
else rigGet.bwNarrow = 0;
if (rigGet.mode != rigSet.mode)
{
guiCmd.bwidthList = 1; //Command update of BW list
guiCmd.tabList = 1; //Command selection of appropriate mode function tab
}
if (rigCap.modeSub) rig_get_mode(my_rig, rigGet.vfoSub, &rigGet.modeSub, &rigGet.bwidthSub);
}