diff --git a/repeatersetup.cpp b/repeatersetup.cpp index 78c3d4a..4e8a220 100644 --- a/repeatersetup.cpp +++ b/repeatersetup.cpp @@ -395,3 +395,48 @@ void repeaterSetup::on_debugBtn_clicked() //emit getDTCS(); emit getRptAccessMode(); } + +quint64 repeaterSetup::calcTransmitFreq(quint64 fOffset, bool isPlus) +{ + quint64 txfcalc = 0; + if(isPlus) + txfcalc = currentMainFrequency + fOffset; + else + txfcalc = currentMainFrequency - fOffset; + return txfcalc; +} + +void repeaterSetup::on_splitOffsetSetBtn_clicked() +{ + freqt txFreq; + bool ok = true; + txFreq.Hz = ui->splitTransmitFreqEdit->text().toDouble(&ok) * 1E6; + emit setTransmitFrequency(txFreq); +} + +void repeaterSetup::on_splitEnableChk_clicked(bool enabled) +{ + emit setSplitModeEnabled(enabled); +} + +void repeaterSetup::on_splitPlusButton_clicked() +{ + bool ok = true; + quint64 fOffset = ui->splitOffsetEdit->text().toDouble(&ok) * 1E6; + quint64 f; + if(ok) + { + f = calcTransmitFreq(fOffset, true); + ui->splitTransmitFreqEdit->setText(QString("%1").arg(QString::number(f/(double)1E6, 'f', 2))); + } +} + +void repeaterSetup::on_splitMinusBtn_clicked() +{ + +} + +void repeaterSetup::on_splitTxFreqSetBtn_clicked() +{ + +} diff --git a/repeatersetup.h b/repeatersetup.h index 2763a12..f00e954 100644 --- a/repeatersetup.h +++ b/repeatersetup.h @@ -31,6 +31,10 @@ signals: void getDTCS(); void setRptAccessMode(rptAccessTxRx tmode); void getRptAccessMode(); + void getSplitModeEnabled(); + void getTransmitFrequency(); + void setSplitModeEnabled(bool splitEnabled); + void setTransmitFrequency(freqt transmitFreq); public slots: void receiveDuplexMode(duplexMode dm); @@ -38,6 +42,9 @@ public slots: void handleTone(quint16 tone); void handleTSQL(quint16 tsql); void handleDTCS(quint16 dcscode, bool tinv, bool rinv); + void handleSplitMode(bool splitEnabled); + void handleSplitFrequency(freqt transmitFreq); + void handleUpdateCurrentMainFrequency(freqt mainfreq); private slots: void on_rptSimplexBtn_clicked(); @@ -51,13 +58,20 @@ private slots: void on_toneNone_clicked(); void on_toneTone_clicked(); void on_toneTSQL_clicked(); - void on_toneDTCS_clicked(); + void on_toneDTCS_clicked(); + void on_splitOffsetSetBtn_clicked(); + void on_splitEnableChk_clicked(bool enabled); + void on_splitPlusButton_clicked(); + void on_splitMinusBtn_clicked(); + + void on_splitTxFreqSetBtn_clicked(); private: Ui::repeaterSetup *ui; - + freqt currentMainFrequency; void populateTones(); void populateDTCS(); + quint64 calcTransmitFreq(quint64 fOffset, bool isPlus); rigCapabilities rig; bool haveRig = false; duplexMode currentdm; diff --git a/repeatersetup.ui b/repeatersetup.ui index ffb72f5..c86d1ee 100644 --- a/repeatersetup.ui +++ b/repeatersetup.ui @@ -6,7 +6,7 @@ 0 0 - 800 + 922 217 @@ -71,7 +71,7 @@ 0 - + Repeater Duplex @@ -119,6 +119,97 @@ + + + + Split Mode + + + + + + Split Enable + + + + + + + + + Offset (MHz): + + + + + + + + 120 + 0 + + + + + 120 + 16777215 + + + + + + + + + + + + + + + + - + + + + + + + + + + + Tx Freq (MHz): + + + + + + + + 120 + 0 + + + + + 120 + 16777215 + + + + + + + + Set + + + + + + + + @@ -231,7 +322,7 @@ - +