kopia lustrzana https://github.com/PianetaRadio/CatRadio
Sub VFO enhancement for non targetable_vfo rigs
rodzic
a4874aefab
commit
eb528fe85e
|
@ -2,6 +2,9 @@ CatRadio
|
|||
|
||||
(+ New, * Updated, - Removed)
|
||||
|
||||
1.1.1 -
|
||||
* Sub VFO enhancement for non targetable_vfo rigs
|
||||
|
||||
1.1.0 - 2022-03-13
|
||||
+ AF Gain and Squelch slider
|
||||
+ Tab with CW and FM functions
|
||||
|
|
|
@ -69,7 +69,8 @@ MainWindow::MainWindow(QWidget *parent)
|
|||
timer = new QTimer(this); //timer for rigDaemon thread call
|
||||
|
||||
//* Debug
|
||||
rig_set_debug_level(RIG_DEBUG_WARN);
|
||||
rig_set_debug_level(RIG_DEBUG_WARN); //normal
|
||||
//rig_set_debug_level(RIG_DEBUG_TRACE); //debug
|
||||
rig_set_debug_time_stamp(true);
|
||||
if ((debugFile=fopen("debug.log","w+")) == NULL) rig_set_debug_level(RIG_DEBUG_NONE);
|
||||
else rig_set_debug_file(debugFile);
|
||||
|
@ -132,7 +133,7 @@ void MainWindow::guiInit()
|
|||
{
|
||||
ui->statusbar->showMessage(my_rig->caps->model_name);
|
||||
|
||||
if (rig_has_set_func(my_rig, RIG_FUNCTION_SET_POWERSTAT)==0) //Power pushbutton
|
||||
if (my_rig->caps->set_powerstat == NULL) //Power pushbutton
|
||||
{
|
||||
ui->pushButton_Power->setDisabled(true);
|
||||
rigCap.onoff = 0;
|
||||
|
@ -143,7 +144,7 @@ void MainWindow::guiInit()
|
|||
rigCap.onoff = 1;
|
||||
}
|
||||
|
||||
if (rig_has_set_func(my_rig, RIG_FUNCTION_SET_PTT)==0) //PTT pushbutton
|
||||
if (my_rig->caps->set_ptt == NULL) //PTT pushbutton
|
||||
{
|
||||
ui->pushButton_PTT->setDisabled(true);
|
||||
rigCap.ptt = 0;
|
||||
|
@ -223,29 +224,29 @@ void MainWindow::guiInit()
|
|||
ui->comboBox_toneType->addItem("1750Hz"); //Burst 1750 Hz
|
||||
ui->comboBox_toneType->addItem("TONE"); //CTCSS Tx
|
||||
ui->comboBox_toneType->addItem("TSQL"); //CTCSS Tx + Rx squelch
|
||||
//ui->comboBox_toneType->addItem("DTONE"); //DCS Tx
|
||||
//ui->comboBox_toneType->addItem("DTSQL"); //DCS Tx + Rx squelch
|
||||
//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)
|
||||
{
|
||||
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
|
||||
}
|
||||
|
||||
rigCmd.rangeList = 1; //update range list
|
||||
rigCmd.antList = 1; //update antenna list
|
||||
rigCmd.toneList = 1; //update tone list
|
||||
|
||||
rigCap.modeSub = 1; //assume targetable mode for sub VFO, will be checked later
|
||||
|
||||
/*
|
||||
if (my_rig->caps->targetable_vfo) //check for targetable sub VFO
|
||||
rigCap.modeSub = 1; //assume also targetable mode for sub VFO, will be checked later
|
||||
else
|
||||
{
|
||||
rigCap.modeSub = 0; //disable get/set mode for subVFO
|
||||
ui->radioButton_VFOSub->setCheckable(false); //disable VFOsub radio button
|
||||
}*/
|
||||
}
|
||||
|
||||
void MainWindow::guiUpdate()
|
||||
{
|
||||
//* Power button
|
||||
if (rigGet.onoff == RIG_POWER_ON) ui->pushButton_Power->setChecked(true);
|
||||
if (rigGet.onoff == RIG_POWER_ON || rigGet.onoff == RIG_POWER_UNKNOWN) ui->pushButton_Power->setChecked(true);
|
||||
|
||||
//* VFOs
|
||||
ui->lineEdit_vfoMain->setValue(rigGet.freqMain);
|
||||
|
@ -491,7 +492,7 @@ void MainWindow::on_pushButton_Connect_toggled(bool checked)
|
|||
{
|
||||
rigCom.connected = 1;
|
||||
guiInit();
|
||||
if (rigCap.onoff == 0 || rigGet.onoff == RIG_POWER_ON) timer->start(rigCom.rigRefresh);
|
||||
if (rigCap.onoff == 0 || rigGet.onoff == RIG_POWER_ON || rigGet.onoff == RIG_POWER_UNKNOWN) timer->start(rigCom.rigRefresh);
|
||||
}
|
||||
}
|
||||
else if (rigCom.connected) //Button unchecked
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
#define RELEASE_DATE __DATE__
|
||||
#define VERSION_MAJ 1
|
||||
#define VERSION_MIN 1
|
||||
#define VERSION_MIC 0
|
||||
#define VERSION_MIC 1
|
||||
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
|
|
@ -87,7 +87,8 @@ int RigDaemon::rigConnect()
|
|||
if (retcode != RIG_OK) return retcode; //Rig not connected
|
||||
else //Rig connected
|
||||
{
|
||||
rig_get_powerstat(my_rig, &rigGet.onoff);
|
||||
if (my_rig->caps->get_powerstat != NULL) rig_get_powerstat(my_rig, &rigGet.onoff);
|
||||
else rigGet.onoff = RIG_POWER_UNKNOWN;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -117,7 +118,7 @@ void RigDaemon::rigUpdate()
|
|||
rigCmd.rangeList = 1;
|
||||
}
|
||||
|
||||
else if (rigCmd.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;
|
||||
|
@ -130,11 +131,11 @@ void RigDaemon::rigUpdate()
|
|||
freq_t retfreq;
|
||||
retcode = rig_get_freq(my_rig, RIG_VFO_CURR, &retfreq); //get VFO Main
|
||||
if (retcode == RIG_OK) rigGet.freqMain = retfreq;
|
||||
//if (my_rig->caps->targetable_vfo) //get VFO Sub if targetable
|
||||
//{
|
||||
if (rigCap.freqSub) //get sub VFO freq if targetable
|
||||
{
|
||||
retcode = rig_get_freq(my_rig, rigGet.vfoSub, &retfreq);
|
||||
if (retcode == RIG_OK) rigGet.freqSub = retfreq;
|
||||
//}
|
||||
}
|
||||
|
||||
//* PTT
|
||||
ptt_t retptt;
|
||||
|
@ -196,23 +197,47 @@ void RigDaemon::rigUpdate()
|
|||
//* VFO Exchange
|
||||
if (rigCmd.vfoXchange)
|
||||
{
|
||||
int tempMode = rigGet.mode;
|
||||
retcode = rig_vfo_op(my_rig, RIG_VFO_CURR, RIG_OP_XCHG);
|
||||
if (retcode == RIG_OK)
|
||||
if (my_rig->caps->vfo_ops == RIG_OP_XCHG)
|
||||
{
|
||||
if (rigCap.modeSub == 0) rigGet.modeSub = tempMode;
|
||||
commandPriority = 0;
|
||||
mode_t tempMode = rigGet.mode;
|
||||
retcode = rig_vfo_op(my_rig, RIG_VFO_CURR, RIG_OP_XCHG);
|
||||
if (retcode == RIG_OK)
|
||||
{
|
||||
if (rigCap.modeSub == 0) rigGet.modeSub = tempMode; //If mode sub VFO not targettable, use buffer
|
||||
commandPriority = 0;
|
||||
rigCmd.bwidthList = 1;
|
||||
}
|
||||
}
|
||||
|
||||
else if (my_rig->caps->vfo_ops == RIG_OP_TOGGLE)
|
||||
{
|
||||
freq_t tempFreq = rigGet.freqMain;
|
||||
mode_t tempMode = rigGet.mode;
|
||||
retcode = rig_vfo_op(my_rig, RIG_VFO_CURR, RIG_OP_TOGGLE);
|
||||
if (retcode == RIG_OK)
|
||||
{
|
||||
if (rigCap.freqSub == 0) rigGet.freqSub = tempFreq; //If freq sub VFO not targettable, use buffer
|
||||
if (rigCap.modeSub == 0) rigGet.modeSub = tempMode; //If mode sub VFO not targettable, use buffer
|
||||
commandPriority = 0;
|
||||
rigCmd.bwidthList = 1;
|
||||
}
|
||||
}
|
||||
rigCmd.vfoXchange = 0;
|
||||
rigCmd.bwidthList = 1;
|
||||
}
|
||||
|
||||
//* VFO Copy
|
||||
if (rigCmd.vfoCopy)
|
||||
{
|
||||
rig_vfo_op(my_rig, RIG_VFO_CURR, RIG_OP_CPY);
|
||||
if (my_rig->caps->vfo_ops == RIG_OP_CPY)
|
||||
{
|
||||
retcode = rig_vfo_op(my_rig, RIG_VFO_CURR, RIG_OP_CPY);
|
||||
if (retcode == RIG_OK)
|
||||
{
|
||||
if (rigCap.freqSub == 0) rigGet.freqSub = rigGet.freqMain;
|
||||
if (rigCap.modeSub == 0) rigGet.modeSub = rigGet.mode;
|
||||
}
|
||||
}
|
||||
rigCmd.vfoCopy = 0;
|
||||
if (rigCap.modeSub == 0) rigGet.modeSub = rigGet.mode;
|
||||
}
|
||||
|
||||
//* Band Up
|
||||
|
@ -442,15 +467,7 @@ void RigDaemon::rigUpdate()
|
|||
if (rigGet.bwidth == rig_passband_narrow(my_rig, rigGet.mode)) rigGet.bwNarrow = 1;
|
||||
else rigGet.bwNarrow = 0;
|
||||
|
||||
if (rigCap.modeSub)
|
||||
{
|
||||
retcode = rig_get_mode(my_rig, rigGet.vfoSub, &rigGet.modeSub, &rigGet.bwidthSub);
|
||||
if (retcode != RIG_OK)
|
||||
{
|
||||
rigCap.modeSub = 0; //mode not targetable
|
||||
rigGet.modeSub = RIG_MODE_NONE;
|
||||
}
|
||||
}
|
||||
if (rigCap.modeSub) rig_get_mode(my_rig, rigGet.vfoSub, &rigGet.modeSub, &rigGet.bwidthSub);
|
||||
}
|
||||
|
||||
//* Split
|
||||
|
|
Ładowanie…
Reference in New Issue