Sub VFO and VFO operations improvement

#1 #2
1.1.1
PianetaRadio 2022-03-18 23:44:52 +01:00 zatwierdzone przez GitHub
rodzic 1c872253c1
commit 07b5a29765
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
3 zmienionych plików z 52 dodań i 19 usunięć

Wyświetl plik

@ -3,7 +3,8 @@ CatRadio
(+ New, * Updated, - Removed)
1.1.1 -
* Sub VFO enhancement for non targetable_vfo rigs
* VFO operations: check rig caps before perform VFO operations
* Sub VFO: improve sub VFO functions using targetable_vfo caps
1.1.0 - 2022-03-13
+ AF Gain and Squelch slider

Wyświetl plik

@ -227,15 +227,23 @@ void MainWindow::guiInit()
//ui->comboBox_toneType->addItem("DCS"); //DCS
//check for targetable sub VFO
if (my_rig->caps->targetable_vfo == RIG_TARGETABLE_FREQ) rigCap.freqSub = 1; //targetable frequency
else rigCap.freqSub = 0;
if (my_rig->caps->targetable_vfo == RIG_TARGETABLE_MODE) rigCap.modeSub = 1; //targetable mode
else rigCap.modeSub = 0;
if (my_rig->caps->targetable_vfo == 0)
if (my_rig->caps->rig_model != 2) //Hamlib 4.4 has bug for rigctld and targetable_vfo, skip check
{
if (my_rig->caps->targetable_vfo & RIG_TARGETABLE_FREQ) rigCap.freqSub = 1; //targetable frequency
else rigCap.freqSub = 0;
if (my_rig->caps->targetable_vfo & RIG_TARGETABLE_MODE) rigCap.modeSub = 1; //targetable mode
else rigCap.modeSub = 0;
if (my_rig->caps->targetable_vfo == RIG_TARGETABLE_NONE)
{
rigCap.freqSub = 0; //disable get/set freq for subVFO
rigCap.modeSub = 0; //disable get/set mode for subVFO
ui->radioButton_VFOSub->setCheckable(false); //disable VFOsub radio button
}
}
else //NET rigctl, assume targetable_vfo
{
rigCap.freqSub = 1;
rigCap.modeSub = 1;
}
rigCmd.rangeList = 1; //update range list

Wyświetl plik

@ -67,6 +67,7 @@ int RigDaemon::rigConnect()
{
//myport.type.rig = RIG_PORT_NETWORK;
strncpy(my_rig->state.rigport.pathname, rigCom.rigPort.toLatin1(), HAMLIB_FILPATHLEN - 1);
my_rig->state.vfo_opt = 1;
//strncpy(my_rig->state.rigport.pathname, RIG_FILE, HAMLIB_FILPATHLEN - 1);
}
else
@ -118,7 +119,7 @@ void RigDaemon::rigUpdate()
rigCmd.rangeList = 1;
}
else if (rigCmd.freqSub || rigCap.freqSub) //VFO Sub
else if (rigCmd.freqSub && rigCap.freqSub) //VFO Sub
{
retcode = rig_set_freq(my_rig, rigGet.vfoSub, rigSet.freqSub);
if (retcode == RIG_OK) rigGet.freqSub = rigSet.freqSub;
@ -189,10 +190,21 @@ void RigDaemon::rigUpdate()
//* Split
if (rigCmd.split)
{
retcode = rig_set_split_vfo(my_rig, RIG_VFO_RX, rigSet.split, RIG_VFO_TX);
if (retcode == RIG_OK) rigGet.split = rigSet.split;
freq_t tempFreq = rigGet.freqMain; //temporary save for non targettable sub VFO
if (rigSet.split) retcode = rig_set_split_vfo(my_rig, rigGet.vfoMain, rigSet.split, rigGet.vfoSub); //Split on
else retcode = rig_set_split_vfo(my_rig, rigGet.vfoMain, rigSet.split, rigGet.vfoMain); //Split off
//retcode = rig_set_split_vfo(my_rig, RIG_VFO_RX, rigSet.split, RIG_VFO_TX);
if (retcode == RIG_OK)
{
rigGet.split = rigSet.split;
if (rigGet.split && (my_rig->caps->targetable_vfo & RIG_TARGETABLE_FREQ) == 0) //if non targettable sub VFO
{
rig_get_freq(my_rig, RIG_VFO_CURR, &retfreq);
if (retfreq != tempFreq) rigGet.freqSub = tempFreq; //in this case VFOs were toggled, so print out the right sub VFO frequency
}
}
rigCmd.split = 0;
}
}
//* VFO Exchange
if (rigCmd.vfoXchange)
@ -243,19 +255,31 @@ void RigDaemon::rigUpdate()
//* Band Up
if (rigCmd.bandUp)
{
retcode = rig_vfo_op(my_rig, RIG_VFO_CURR, RIG_OP_BAND_UP);
if (retcode == RIG_OK) commandPriority = 0;
if (my_rig->caps->vfo_ops == RIG_OP_BAND_UP)
{
retcode = rig_vfo_op(my_rig, RIG_VFO_CURR, RIG_OP_BAND_UP);
if (retcode == RIG_OK)
{
commandPriority = 0;
rigCmd.bwidthList = 1;
}
}
rigCmd.bandUp = 0;
rigCmd.bwidthList = 1;
}
//* Band Down
if (rigCmd.bandDown)
{
retcode = rig_vfo_op(my_rig, RIG_VFO_CURR, RIG_OP_BAND_DOWN);
if (retcode == RIG_OK) commandPriority = 0;
if (my_rig->caps->vfo_ops == RIG_OP_BAND_DOWN)
{
retcode = rig_vfo_op(my_rig, RIG_VFO_CURR, RIG_OP_BAND_DOWN);
if (retcode == RIG_OK)
{
commandPriority = 0;
rigCmd.bwidthList = 1;
}
}
rigCmd.bandDown = 0;
rigCmd.bwidthList = 1;
}
//* Band change
@ -470,13 +494,13 @@ void RigDaemon::rigUpdate()
if (rigCap.modeSub) rig_get_mode(my_rig, rigGet.vfoSub, &rigGet.modeSub, &rigGet.bwidthSub);
}
//* Split
//* VFO and Split
if ((commandPriority == 2 && !rigGet.ptt && rigCom.fullPoll) || commandPriority == 0)
{
rig_get_split_vfo(my_rig, RIG_VFO_CURR, &rigGet.split, &rigGet.vfoTx);
//else rig_get_split(my_rig, RIG_VFO_CURR, &rigGet.split);
rig_get_split_vfo(my_rig, RIG_VFO_CURR, &rigGet.split, &rigGet.vfoTx);
rig_get_vfo(my_rig, &rigGet.vfoMain);
qDebug() << "get - " << "Main:" << rigGet.vfoMain << "Sub:" << rigGet.vfoSub << "Tx:" << rigGet.vfoTx << "Curr:" << RIG_VFO_CURR;
}
//* Tuner