From 25e13f79d4ab75fb2758255ae7cf527b1bf66d76 Mon Sep 17 00:00:00 2001 From: PianetaRadio <78976006+PianetaRadio@users.noreply.github.com> Date: Sun, 27 Mar 2022 13:56:20 +0200 Subject: [PATCH] Repeater offset #7 --- CatRadio.pro.user | 2 +- mainwindow.cpp | 6 ++++++ mainwindow.h | 2 ++ mainwindow.ui | 35 +++++++++++++++++++++++++++++------ rigdaemon.cpp | 8 ++++++++ rigdata.h | 7 ++++--- 6 files changed, 50 insertions(+), 10 deletions(-) diff --git a/CatRadio.pro.user b/CatRadio.pro.user index 796ad70..fa206f4 100644 --- a/CatRadio.pro.user +++ b/CatRadio.pro.user @@ -1,6 +1,6 @@ - + EnvironmentId diff --git a/mainwindow.cpp b/mainwindow.cpp index eacd035..c8e4ccf 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -447,6 +447,7 @@ void MainWindow::guiUpdate() if (rigGet.rptShift == RIG_RPT_SHIFT_MINUS) ui->radioButton_RPTshiftMinus->setChecked(true); //- else if (rigGet.rptShift == RIG_RPT_SHIFT_PLUS) ui->radioButton_RPTshiftPlus->setChecked(true); //+ else ui->radioButton_RPTshiftSimplex->setChecked(true); //Simplex + ui->spinBox_RPToffset->setValue(rigGet.rptOffset/1000); //Offset (kHz) ui->comboBox_toneType->setCurrentIndex(rigGet.toneType); if (rigGet.toneType == 2 || rigGet.toneType ==3) ui->comboBox_toneFreq->setCurrentText(QString::number(rigGet.tone/10.0)); //CTCSS @@ -920,6 +921,11 @@ void MainWindow::on_spinBox_WPM_valueChanged(int arg1) rigCmd.wpm = 1; } +void MainWindow::on_spinBox_RPToffset_valueChanged(int arg1) +{ + rigSet.rptOffset = arg1*1000; + rigCmd.rptOffset = 1; +} //***** Slider ***** diff --git a/mainwindow.h b/mainwindow.h index b97bdee..1cf4a1d 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -156,6 +156,8 @@ private slots: void on_comboBox_toneFreq_activated(int index); + void on_spinBox_RPToffset_valueChanged(int arg1); + private: Ui::MainWindow *ui; QTimer *timer; diff --git a/mainwindow.ui b/mainwindow.ui index da5fa15..1efa003 100644 --- a/mainwindow.ui +++ b/mainwindow.ui @@ -52,6 +52,9 @@ + + 10 + @@ -1469,7 +1472,7 @@ - + @@ -1501,10 +1504,17 @@ + + + + 10000 + + + - - + + @@ -1515,11 +1525,24 @@ + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + - - - diff --git a/rigdaemon.cpp b/rigdaemon.cpp index ba8521f..754b056 100644 --- a/rigdaemon.cpp +++ b/rigdaemon.cpp @@ -430,6 +430,13 @@ void RigDaemon::rigUpdate() if (retcode == RIG_OK) rigGet.rptShift = rigSet.rptShift; rigCmd.rptShift = 0; } + //* Repeater offset + if (rigCmd.rptOffset) + { + retcode = rig_set_rptr_offs(my_rig, RIG_VFO_CURR, rigSet.rptOffset); + if (retcode == RIG_OK) rigGet.rptOffset = rigSet.rptOffset; + rigCmd.rptOffset = 0; + } //* Tone if (rigCmd.tone) { @@ -597,6 +604,7 @@ void RigDaemon::rigUpdate() if ((commandPriority == 17 && !rigGet.ptt && rigCom.fullPoll) || commandPriority == 0) //&& mode=FM { rig_get_rptr_shift(my_rig, RIG_VFO_CURR, &rigGet.rptShift); //Repeater Shift + rig_get_rptr_offs(my_rig, RIG_VFO_CURR, &rigGet.rptOffset); //Repeater Offset int status = false; if (!(my_rig->caps->has_get_func & RIG_FUNC_TONE)) status = 1; //If get cap is not available skip diff --git a/rigdata.h b/rigdata.h index 960a6a6..e33cee9 100644 --- a/rigdata.h +++ b/rigdata.h @@ -39,7 +39,7 @@ typedef struct { typedef struct { powerstat_t onoff; //on/off status - freq_t freqMain, freqSub; //Frequency + freq_t freqMain, freqSub; //Frequency (Hz) rmode_t mode, modeSub; //Mode pbwidth_t bwidth, bwidthSub; //IF filter bandwidth int bwNarrow; //IF narrow filter @@ -69,7 +69,8 @@ typedef struct { int notchFilter; int ifShift; rptr_shift_t rptShift; //Repeater shift - int toneType; //0 none, 1 burst 1750, 2 CTCSS, 3 CTCSS SQL, 4 DCS, 5 DCS SQL + 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 } rigSettings; @@ -104,7 +105,7 @@ typedef struct { int noiseReduction, noiseReductionLevel; int notchFilter; int ifShift; - int rptShift; + int rptShift, rptOffset; int tone; int antList; int rangeList;