kopia lustrzana https://github.com/PianetaRadio/CatRadio
Power button
rodzic
a2fda861ce
commit
97f2b54ab8
|
@ -377,12 +377,30 @@ void MainWindow::guiInit()
|
||||||
void MainWindow::guiUpdate()
|
void MainWindow::guiUpdate()
|
||||||
{
|
{
|
||||||
//* Power button
|
//* Power button
|
||||||
if (rigGet.onoff == RIG_POWER_ON) ui->pushButton_Power->setChecked(true);
|
if (rigGet.onoff == RIG_POWER_ON)
|
||||||
|
{
|
||||||
|
ui->pushButton_Power->setChecked(true);
|
||||||
|
//ui->pushButton_Power->setStyleSheet("QPushButton {color: limegreen;}");
|
||||||
|
}
|
||||||
else if (rigGet.onoff == RIG_POWER_OFF)
|
else if (rigGet.onoff == RIG_POWER_OFF)
|
||||||
{
|
{
|
||||||
if(timer->isActive()) timer->stop();
|
if(timer->isActive())
|
||||||
ui->pushButton_Power->setChecked(false);
|
{
|
||||||
ui->statusbar->showMessage("Radio off");
|
timer->stop();
|
||||||
|
|
||||||
|
ui->pushButton_Power->setChecked(false);
|
||||||
|
//ui->pushButton_Power->setStyleSheet("");
|
||||||
|
|
||||||
|
//Reset Smeter
|
||||||
|
rigGet.sMeter.i = -54;
|
||||||
|
ui->progressBar_Smeter->resetPeakValue();
|
||||||
|
|
||||||
|
//Reset VFOs
|
||||||
|
rigGet.freqMain = 0;
|
||||||
|
rigGet.freqSub = 0;
|
||||||
|
|
||||||
|
ui->statusbar->showMessage("Radio off");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//* VFOs
|
//* VFOs
|
||||||
|
@ -769,6 +787,7 @@ void MainWindow::on_pushButton_Connect_toggled(bool checked)
|
||||||
|
|
||||||
//Reset meters
|
//Reset meters
|
||||||
ui->progressBar_Smeter->setValue(-54);
|
ui->progressBar_Smeter->setValue(-54);
|
||||||
|
ui->progressBar_Smeter->resetPeakValue();
|
||||||
setSubMeter();
|
setSubMeter();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -800,12 +819,7 @@ void MainWindow::on_pushButton_Power_toggled(bool checked)
|
||||||
else if (!checked && rigGet.onoff)
|
else if (!checked && rigGet.onoff)
|
||||||
{
|
{
|
||||||
rigCmd.onoff = 1;
|
rigCmd.onoff = 1;
|
||||||
//retcode = rig_set_powerstat(my_rig, RIG_POWER_OFF);
|
//Note: the onoff command works only if the PTT is off (see rigdaemon.cpp)
|
||||||
//if (retcode == RIG_OK)
|
|
||||||
//{
|
|
||||||
// ui->pushButton_Power->setChecked(false); //Uncheck the button
|
|
||||||
// timer->stop();
|
|
||||||
//}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue