Porównaj commity

...

3 Commity

Autor SHA1 Wiadomość Data
PianetaRadio 068922c6b6
Power off msg
#19
2023-02-10 20:34:28 +01:00
PianetaRadio 2c3b14e2d0
Power status
#36
2023-02-10 19:52:33 +01:00
PianetaRadio 7fe09861b4
Sub meter peak hold
#35
2023-02-10 19:14:31 +01:00
3 zmienionych plików z 34 dodań i 12 usunięć

Wyświetl plik

@ -5,7 +5,7 @@ CatRadio
1.4.0 - 2023-mm-dd
+ Meter peak hold indicator
+ Debug mode
* Power status improvement
* Bug fix: Power status
* Bug fix: COM port list
* Updated to library Hamlib 4.5.4

Wyświetl plik

@ -377,7 +377,13 @@ void MainWindow::guiInit()
void MainWindow::guiUpdate()
{
//* 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);
ui->statusbar->showMessage("Power off");
}
//* VFOs
if (!rigCmd.freqMain) ui->lineEdit_vfoMain->setValue(rigGet.freqMain);
@ -574,10 +580,13 @@ void MainWindow::guiUpdate()
ui->progressBar_Smeter->setTx(false);
ui->progressBar_Smeter->setValue(-54);
ui->progressBar_Smeter->resetPeakValue();
if (rigSet.meter == RIG_LEVEL_SWR) ui->progressBar_subMeter->setValue(1.0);
else ui->progressBar_subMeter->setValue(0.0);
//if (rigSet.meter == RIG_LEVEL_SWR) ui->progressBar_subMeter->setValue(1.0);
//else ui->progressBar_subMeter->setValue(0.0);
//ui->progressBar_subMeter->resetPeakValue();
}
ui->progressBar_Smeter->setValue(rigGet.sMeter.i);
if (rigSet.meter == RIG_LEVEL_SWR) ui->progressBar_subMeter->setValue(1.0);
else ui->progressBar_subMeter->setValue(0.0);
}
//* Levels
@ -739,7 +748,11 @@ void MainWindow::on_pushButton_Connect_toggled(bool checked)
{
freq_t retfreq;
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;
}
}
@ -747,7 +760,7 @@ void MainWindow::on_pushButton_Connect_toggled(bool checked)
else if (rigCom.connected) //Button unchecked
{
rigCom.connected = 0;
timer->stop();
if(timer->isActive()) timer->stop();
rig_close(my_rig); //Close the communication to the rig
connectMsg = "Disconnected";
//rig_cleanup(my_rig); //Release rig handle and free associated memory
@ -770,12 +783,13 @@ void MainWindow::on_pushButton_Power_toggled(bool checked)
}
else if (!checked && rigGet.onoff)
{
retcode = rig_set_powerstat(my_rig, RIG_POWER_OFF);
if (retcode == RIG_OK)
{
ui->pushButton_Power->setChecked(false); //Uncheck the button
timer->stop();
}
rigCmd.onoff = 1;
//retcode = rig_set_powerstat(my_rig, RIG_POWER_OFF);
//if (retcode == RIG_OK)
//{
// ui->pushButton_Power->setChecked(false); //Uncheck the button
// timer->stop();
//}
}
}

Wyświetl plik

@ -159,6 +159,14 @@ void RigDaemon::rigUpdate(RIG *my_rig)
//***** Command execution *****
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
if (rigCmd.mode && rigSet.mode != RIG_MODE_NONE) //VFO Main
{