kopia lustrzana https://github.com/PianetaRadio/CatRadio
rodzic
7fe09861b4
commit
2c3b14e2d0
|
@ -5,7 +5,7 @@ CatRadio
|
||||||
1.4.0 - 2023-mm-dd
|
1.4.0 - 2023-mm-dd
|
||||||
+ Meter peak hold indicator
|
+ Meter peak hold indicator
|
||||||
+ Debug mode
|
+ Debug mode
|
||||||
* Power status improvement
|
* Bug fix: Power status
|
||||||
* Bug fix: COM port list
|
* Bug fix: COM port list
|
||||||
* Updated to library Hamlib 4.5.4
|
* Updated to library Hamlib 4.5.4
|
||||||
|
|
||||||
|
|
|
@ -377,7 +377,12 @@ void MainWindow::guiInit()
|
||||||
void MainWindow::guiUpdate()
|
void MainWindow::guiUpdate()
|
||||||
{
|
{
|
||||||
//* Power button
|
//* Power button
|
||||||
if (rigGet.onoff == RIG_POWER_ON || rigGet.onoff == RIG_POWER_UNKNOWN) ui->pushButton_Power->setChecked(true);
|
if (rigGet.onoff == RIG_POWER_ON) ui->pushButton_Power->setChecked(true);
|
||||||
|
else if (rigGet.onoff == RIG_POWER_OFF)
|
||||||
|
{
|
||||||
|
if(timer->isActive()) timer->stop();
|
||||||
|
ui->pushButton_Power->setChecked(false);
|
||||||
|
}
|
||||||
|
|
||||||
//* VFOs
|
//* VFOs
|
||||||
if (!rigCmd.freqMain) ui->lineEdit_vfoMain->setValue(rigGet.freqMain);
|
if (!rigCmd.freqMain) ui->lineEdit_vfoMain->setValue(rigGet.freqMain);
|
||||||
|
@ -742,7 +747,11 @@ void MainWindow::on_pushButton_Connect_toggled(bool checked)
|
||||||
{
|
{
|
||||||
freq_t retfreq;
|
freq_t retfreq;
|
||||||
retcode = rig_get_freq(my_rig, RIG_VFO_CURR, &retfreq); //double check if rig is on by getting the current frequency
|
retcode = rig_get_freq(my_rig, RIG_VFO_CURR, &retfreq); //double check if rig is on by getting the current frequency
|
||||||
if (retcode == RIG_OK) timer->start(rigCom.rigRefresh);
|
if (retcode == RIG_OK)
|
||||||
|
{
|
||||||
|
rigGet.onoff = RIG_POWER_ON; //force it for rigCap.onoff = 0 || rigGet.onoff = RIG_POWER_UNKNOWN
|
||||||
|
timer->start(rigCom.rigRefresh);
|
||||||
|
}
|
||||||
else rigGet.onoff = RIG_POWER_OFF;
|
else rigGet.onoff = RIG_POWER_OFF;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -750,7 +759,7 @@ void MainWindow::on_pushButton_Connect_toggled(bool checked)
|
||||||
else if (rigCom.connected) //Button unchecked
|
else if (rigCom.connected) //Button unchecked
|
||||||
{
|
{
|
||||||
rigCom.connected = 0;
|
rigCom.connected = 0;
|
||||||
timer->stop();
|
if(timer->isActive()) timer->stop();
|
||||||
rig_close(my_rig); //Close the communication to the rig
|
rig_close(my_rig); //Close the communication to the rig
|
||||||
connectMsg = "Disconnected";
|
connectMsg = "Disconnected";
|
||||||
//rig_cleanup(my_rig); //Release rig handle and free associated memory
|
//rig_cleanup(my_rig); //Release rig handle and free associated memory
|
||||||
|
@ -773,12 +782,13 @@ void MainWindow::on_pushButton_Power_toggled(bool checked)
|
||||||
}
|
}
|
||||||
else if (!checked && rigGet.onoff)
|
else if (!checked && rigGet.onoff)
|
||||||
{
|
{
|
||||||
retcode = rig_set_powerstat(my_rig, RIG_POWER_OFF);
|
rigCmd.onoff = 1;
|
||||||
if (retcode == RIG_OK)
|
//retcode = rig_set_powerstat(my_rig, RIG_POWER_OFF);
|
||||||
{
|
//if (retcode == RIG_OK)
|
||||||
ui->pushButton_Power->setChecked(false); //Uncheck the button
|
//{
|
||||||
timer->stop();
|
// ui->pushButton_Power->setChecked(false); //Uncheck the button
|
||||||
}
|
// timer->stop();
|
||||||
|
//}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -159,6 +159,14 @@ void RigDaemon::rigUpdate(RIG *my_rig)
|
||||||
//***** Command execution *****
|
//***** Command execution *****
|
||||||
if (!rigGet.ptt && !rigSet.ptt)
|
if (!rigGet.ptt && !rigSet.ptt)
|
||||||
{
|
{
|
||||||
|
//* Power off
|
||||||
|
if (rigCmd.onoff && rigCap.onoff)
|
||||||
|
{
|
||||||
|
retcode = rig_set_powerstat(my_rig, RIG_POWER_OFF);
|
||||||
|
if (retcode == RIG_OK) rigGet.onoff = RIG_POWER_OFF;
|
||||||
|
}
|
||||||
|
rigCmd.onoff = 0;
|
||||||
|
|
||||||
//* Mode
|
//* Mode
|
||||||
if (rigCmd.mode && rigSet.mode != RIG_MODE_NONE) //VFO Main
|
if (rigCmd.mode && rigSet.mode != RIG_MODE_NONE) //VFO Main
|
||||||
{
|
{
|
||||||
|
|
Ładowanie…
Reference in New Issue