From 846293a019c4646d7a30b58deaad641147e8004d Mon Sep 17 00:00:00 2001 From: PianetaRadio <78976006+PianetaRadio@users.noreply.github.com> Date: Sun, 30 Oct 2022 16:20:53 +0100 Subject: [PATCH] Yaesu band stack #23 --- CatRadio.pro.user | 6 +- ChangeLog.txt | 2 + mainwindow.cpp | 16 +- mainwindow.ui | 376 ++++++++++++++++++++++++++++------------------ rigcommand.cpp | 70 ++++++--- rigdaemon.cpp | 15 +- rigdata.h | 5 + 7 files changed, 314 insertions(+), 176 deletions(-) diff --git a/CatRadio.pro.user b/CatRadio.pro.user index f171841..8738be0 100644 --- a/CatRadio.pro.user +++ b/CatRadio.pro.user @@ -1,6 +1,6 @@ - + EnvironmentId @@ -94,7 +94,7 @@ Desktop Qt 6.2.4 MinGW 64-bit Desktop Qt 6.2.4 MinGW 64-bit qt.qt6.624.win64_mingw_kit - 0 + 1 0 0 @@ -247,7 +247,7 @@ true false true - C:/Users/Johnny/Documents/QT/build-CatRadio-Desktop_Qt_6_2_4_MinGW_64_bit-Debug + C:/Users/Johnny/Documents/QT/build-CatRadio-Desktop_Qt_6_2_4_MinGW_64_bit-Release 1 diff --git a/ChangeLog.txt b/ChangeLog.txt index 120869b..af52d88 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -3,6 +3,8 @@ CatRadio (+ New, * Updated, - Removed) 1.3.0 - 2022-xx-xx + + Band stack for supported Yaesu radios + * Updated to library Hamlib 4.5 + Save/restore window settings 1.2.0 - 2022-04-13 diff --git a/mainwindow.cpp b/mainwindow.cpp index dd4ce50..719f170 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -145,9 +145,11 @@ void MainWindow::guiInit() { ui->statusbar->showMessage(my_rig->caps->model_name); - if (my_rig->caps->set_powerstat == NULL) //Power pushbutton + //* Power on/off cap + //if (rig_has_set_func(my_rig, RIG_FUNCTION_SET_POWERSTAT)==0) + if (my_rig->caps->set_powerstat == NULL) { - ui->pushButton_Power->setDisabled(true); + ui->pushButton_Power->setDisabled(true); //Power pushbutton disabled rigCap.onoff = 0; } else @@ -156,9 +158,11 @@ void MainWindow::guiInit() rigCap.onoff = 1; } - if (my_rig->caps->set_ptt == NULL) //PTT pushbutton + //* PTT cap + //if (rig_has_set_func(my_rig, RIG_FUNCTION_SET_PTT)==0) + if (my_rig->caps->set_ptt == NULL) { - ui->pushButton_PTT->setDisabled(true); + ui->pushButton_PTT->setDisabled(true); //PTT pushbutton disabled rigCap.ptt = 0; } else @@ -167,6 +171,10 @@ void MainWindow::guiInit() rigCap.ptt = 1; } + //* Band select cap + if (rig_has_set_level(my_rig, RIG_LEVEL_BAND_SELECT)) rigCap.bandChange = 1; + else rigCap.bandChange = 0; + //* Mode combobox if (my_rig->state.mode_list == RIG_MODE_NONE) { diff --git a/mainwindow.ui b/mainwindow.ui index d733d9f..ec180c9 100644 --- a/mainwindow.ui +++ b/mainwindow.ui @@ -771,156 +771,120 @@ 480 220 - 121 - 191 + 123 + 204 Filter - - - - 10 - 30 - 51 - 22 - - - - Noise Blanking - - - NB - - - - - - 10 - 60 - 51 - 22 - - - - Noise Reduction - - - NR - - - - - - 10 - 90 - 51 - 22 - - - - Notch Filter - - - NF - - - - - - 70 - 60 - 46 - 25 - - - - 1 - - - 15 - - - - - - 10 - 120 - 61 - 22 - - - - BW Narrow - - - NAR - - - - - - 10 - 170 - 101 - 18 - - - - -1200 - - - 1200 - - - 10 - - - 100 - - - false - - - Qt::Horizontal - - - - - - 10 - 150 - 55 - 16 - - - - IF-Shift - - - horizontalSlider_IFshift - - - - - true - - - - 70 - 150 - 41 - 16 - - - - 0 - - - Qt::AlignCenter - - + + + + + Noise Blanking + + + NB + + + + + + + false + + + NB2 + + + + + + + Noise Reduction + + + NR + + + + + + + 1 + + + 15 + + + + + + + Notch Filter + + + NF + + + + + + + BW Narrow + + + NAR + + + + + + + IF-Shift + + + horizontalSlider_IFshift + + + + + + + true + + + 0 + + + Qt::AlignCenter + + + + + + + -1200 + + + 1200 + + + 10 + + + 100 + + + false + + + Qt::Horizontal + + + + @@ -1401,6 +1365,9 @@ + + true + 280 @@ -1410,7 +1377,7 @@ - 0 + 3 @@ -1660,6 +1627,115 @@ + + + false + + + + + + true + + + MIC + + + + + 13 + 10 + 291 + 81 + + + + + + + Gain + + + horizontalSlider_micGain + + + + + + + 100 + + + Qt::Horizontal + + + + + + + + 40 + 0 + + + + 0 + + + Qt::AlignCenter + + + + + + + Comp + + + + + + + Monitor + + + + + + + 100 + + + Qt::Horizontal + + + + + + + + 40 + 0 + + + + 0 + + + Qt::AlignCenter + + + + + + + Mon + + + + + + frame_2 frame @@ -1692,10 +1768,11 @@ + + - @@ -1731,6 +1808,11 @@ CatRadio homepage + + + Radio Info + + diff --git a/rigcommand.cpp b/rigcommand.cpp index ffd3802..fa6cb77 100644 --- a/rigcommand.cpp +++ b/rigcommand.cpp @@ -31,29 +31,57 @@ extern rigCommand rigCap; void set_band (int band) { - freq_t freq; - - switch (band) + if (rigCap.bandChange==0) { - case 160: freq = 1840000; break; - case 80: freq = 3600000; break; - case 60: freq = 5355000; break; - case 40: freq = 7100000; break; - case 30: freq = 10130000; break; - case 20: freq = 14100000; break; - case 17: freq = 18120000; break; - case 15: freq = 21150000; break; - case 12: freq = 24940000; break; - case 10: freq = 28320000; break; - case 6: freq = 50150000; break; - case 2: freq = 144300000; break; - case 70: freq = 432200000; break; - default: freq = rigSet.freqMain; break; - } + freq_t freq; - rigSet.freqMain = freq; - rigCmd.freqMain = 1; - rigCmd.bandChange = 1; + switch (band) + { + case 160: freq = 1840000; break; + case 80: freq = 3600000; break; + case 60: freq = 5355000; break; + case 40: freq = 7100000; break; + case 30: freq = 10130000; break; + case 20: freq = 14100000; break; + case 17: freq = 18120000; break; + case 15: freq = 21150000; break; + case 12: freq = 24940000; break; + case 10: freq = 28320000; break; + case 6: freq = 50150000; break; + case 2: freq = 144300000; break; + case 70: freq = 432200000; break; + case 1: freq = 5000000; break; //General + default: freq = rigSet.freqMain; break; + } + + rigSet.freqMain = freq; + rigCmd.freqMain = 1; + } + else + { + int bandt; + switch (band) + { + case 160: bandt = RIG_BAND_160M; break; + case 80: bandt = RIG_BAND_80M; break; + case 60: bandt = RIG_BAND_60M; break; + case 40: bandt = RIG_BAND_40M; break; + case 30: bandt = RIG_BAND_30M; break; + case 20: bandt = RIG_BAND_20M; break; + case 17: bandt = RIG_BAND_17M; break; + case 15: bandt = RIG_BAND_15M; break; + case 12: bandt = RIG_BAND_12M; break; + case 10: bandt = RIG_BAND_10M; break; + case 6: bandt = RIG_BAND_6M; break; + case 2: bandt = RIG_BAND_144MHZ; break; + case 70: bandt = RIG_BAND_430MHZ; break; + case 1: bandt = RIG_BAND_GEN; break; + default: bandt = RIG_BAND_20M; break; + } + + rigSet.band = bandt; + rigCmd.bandChange = 1; + } } void quick_split () diff --git a/rigdaemon.cpp b/rigdaemon.cpp index 7c0bd50..904b9cb 100644 --- a/rigdaemon.cpp +++ b/rigdaemon.cpp @@ -77,6 +77,10 @@ int RigDaemon::rigConnect() //myport.type.rig = RIG_PORT_SERIAL; strncpy(my_rig->state.rigport.pathname, rigCom.rigPort.toLatin1(), HAMLIB_FILPATHLEN - 1); my_rig->state.rigport.parm.serial.rate = rigCom.serialSpeed; + //qDebug() << my_rig->state.rigport.parm.serial.stop_bits << my_rig->caps->serial_stop_bits; + //qDebug() << my_rig->state.rigport.parm.serial.parity << my_rig->caps->serial_parity; + //qDebug() << my_rig->state.rigport.parm.serial.handshake << my_rig->caps->serial_handshake; + if (rigCom.civAddr) //CI-V address Icom { std::string civaddrS = std::to_string(rigCom.civAddr); //Convert int to string @@ -301,8 +305,17 @@ void RigDaemon::rigUpdate() //* Band change if (rigCmd.bandChange) { + if (rigCap.bandChange) + { + retvalue.i = rigSet.band; + retcode = rig_set_level(my_rig, RIG_VFO_CURR, RIG_LEVEL_BAND_SELECT, retvalue); + if (retcode == RIG_OK) rigGet.band = rigSet.band; + qDebug() << retcode << rigCap.bandChange << rigSet.band; + } + + rigCmd.bandChange = 0; commandPriority = 0; - guiCmd.bwidthList = 1; + //guiCmd.bwidthList = 1; } //* Tune diff --git a/rigdata.h b/rigdata.h index efba46e..4a1cd17 100644 --- a/rigdata.h +++ b/rigdata.h @@ -40,6 +40,7 @@ typedef struct { typedef struct { powerstat_t onoff; //on/off status freq_t freqMain, freqSub; //Frequency (Hz) + int band; //Band rmode_t mode, modeSub; //Mode pbwidth_t bwidth, bwidthSub; //IF filter bandwidth int bwNarrow; //IF narrow filter @@ -74,6 +75,8 @@ typedef struct { shortfreq_t rptOffset; //Repeater offset (Hz) int toneType; //0 none, 1 burst 1750, 2 CTCSS, 3 CTCSS SQL, 4 DCS tone_t tone; //CTCSS or DCS tone + int micComp, micMon; //Flag MIC Compressor, MIC Monitor + float micGain, micMonLevel; //Level MIC Gain, MIC Monitor } rigSettings; typedef struct { @@ -108,4 +111,6 @@ typedef struct { int clar; int rptShift, rptOffset; int tone; + int micComp, micMon; + int micGain, micMonLevel; } rigCommand;