From 8ee38b8b3a67229e47ffe47ec45b79299d51dd88 Mon Sep 17 00:00:00 2001 From: PianetaRadio <78976006+PianetaRadio@users.noreply.github.com> Date: Wed, 8 Feb 2023 19:59:07 +0100 Subject: [PATCH] Power status --- ChangeLog.txt | 4 +++- mainwindow.cpp | 8 +++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 87c28cc..0ec6732 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -2,8 +2,10 @@ CatRadio (+ New, * Updated, - Removed) -1.4.0 - 2022-mm-dd +1.4.0 - 2023-mm-dd + + Meter peak indicator + Debug mode + * Power status improvement * Bug fix: COM port list * Updated to library Hamlib 4.5.4 diff --git a/mainwindow.cpp b/mainwindow.cpp index 23c942b..fed1b1c 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -730,7 +730,13 @@ void MainWindow::on_pushButton_Connect_toggled(bool checked) guiInit(); connectMsg = "Connected to "; connectMsg.append(my_rig->caps->model_name); - if (rigCap.onoff == 0 || rigGet.onoff == RIG_POWER_ON || rigGet.onoff == RIG_POWER_UNKNOWN) timer->start(rigCom.rigRefresh); + if (rigCap.onoff == 0 || rigGet.onoff == RIG_POWER_ON || rigGet.onoff == RIG_POWER_UNKNOWN) + { + 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); + else rigGet.onoff = RIG_POWER_OFF; + } } } else if (rigCom.connected) //Button unchecked