From 0d0a43cbc6af72177de764c560daab2066679aec Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Sat, 2 Nov 2013 20:52:10 +0000 Subject: [PATCH] Starting to implement support for the HB9DRI "IQ+ XT". This will require setting the Si570 to different frequencies for Rx and Tx. Not finished yet!! git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/map65@3591 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- devsetup.cpp | 18 ++++++ devsetup.h | 5 ++ devsetup.ui | 159 +++++++++++++++++++++++++++++++++++++++++++++---- mainwindow.cpp | 11 +++- mainwindow.h | 2 + plotter.cpp | 9 +-- plotter.h | 1 + widegraph.h | 1 + 8 files changed, 191 insertions(+), 15 deletions(-) diff --git a/devsetup.cpp b/devsetup.cpp index 951d428a1..bf98ae204 100644 --- a/devsetup.cpp +++ b/devsetup.cpp @@ -96,6 +96,9 @@ void DevSetup::initDlg() ui.soundCardRadioButton->setChecked(!m_network); ui.rb96000->setChecked(m_fs96000); ui.rb95238->setChecked(!m_fs96000); + ui.rbIQXT->setChecked(m_bIQxt); + ui.rbSi570->setChecked(!m_bIQxt); + ui.mult570TxSpinBox->setEnabled(m_bIQxt); ui.comboBoxSndIn->setEnabled(!m_network); ui.comboBoxSndIn->setCurrentIndex(m_nDevIn); ui.comboBoxSndOut->setCurrentIndex(m_nDevOut); @@ -104,6 +107,7 @@ void DevSetup::initDlg() ui.cb10db->setChecked(m_10db); ui.cbInitIQplus->setChecked(m_initIQplus); ui.mult570SpinBox->setValue(m_mult570); + ui.mult570TxSpinBox->setValue(m_mult570Tx); ui.cal570SpinBox->setValue(m_cal570); sscanf(m_colors.toAscii(),"%2x%2x%2x%2x%2x%2x%2x%2x%2x%2x%2x%2x%2x%2x%2x", &r,&g,&b,&r0,&g0,&b0,&r1,&g1,&b1,&r2,&g2,&b2,&r3,&g3,&b3); @@ -162,6 +166,7 @@ void DevSetup::accept() m_fAdd=ui.faddEntry->text().toDouble(); m_network=ui.networkRadioButton->isChecked(); m_fs96000=ui.rb96000->isChecked(); + m_bIQxt=ui.rbIQXT->isChecked(); m_nDevIn=ui.comboBoxSndIn->currentIndex(); m_paInDevice=m_inDevList[m_nDevIn]; m_nDevOut=ui.comboBoxSndOut->currentIndex(); @@ -171,6 +176,7 @@ void DevSetup::accept() m_10db=ui.cb10db->isChecked(); m_initIQplus=ui.cbInitIQplus->isChecked(); m_mult570=ui.mult570SpinBox->value(); + m_mult570Tx=ui.mult570TxSpinBox->value(); m_cal570=ui.cal570SpinBox->value(); QDialog::accept(); @@ -325,3 +331,15 @@ void DevSetup::on_pushButton_5_clicked() if (color.isValid()) { } } + +void DevSetup::on_mult570TxSpinBox_valueChanged(int n) +{ + m_mult570Tx=n; +} + +void DevSetup::on_rbIQXT_toggled(bool checked) +{ + m_bIQxt=checked; + ui.mult570TxSpinBox->setEnabled(m_bIQxt); + ui.label_25->setEnabled(m_bIQxt); +} diff --git a/devsetup.h b/devsetup.h index a9ec6407c..494e340e9 100644 --- a/devsetup.h +++ b/devsetup.h @@ -26,6 +26,7 @@ public: qint32 m_udpPort; qint32 m_astroFont; qint32 m_mult570; + qint32 m_mult570Tx; double m_fAdd; double m_cal570; @@ -39,6 +40,7 @@ public: bool m_restartSoundOut; bool m_10db; bool m_initIQplus; + bool m_bIQxt; QString m_myCall; QString m_myGrid; @@ -75,6 +77,9 @@ private slots: void on_sbGreen3_valueChanged(int arg1); void on_sbBlue3_valueChanged(int arg1); void on_pushButton_5_clicked(); + void on_mult570TxSpinBox_valueChanged(int arg1); + + void on_rbIQXT_toggled(bool checked); private: int r,g,b,r0,g0,b0,r1,g1,b1,r2,g2,b2,r3,g3,b3; diff --git a/devsetup.ui b/devsetup.ui index 180ee095a..935cf2abf 100644 --- a/devsetup.ui +++ b/devsetup.ui @@ -17,13 +17,13 @@ - 0 + 2 Station - + 10 @@ -952,22 +952,69 @@ Si570 - + - 70 - 90 - 228 - 111 + 40 + 40 + 272 + 220 + + + + + + LO Selection: + + + + + + + IQ+, Generic Si570 + + + true + + + + + + + IQ+ Rx/XT + + + false + + + + + + + + + Qt::Vertical + + + QSizePolicy::Fixed + + + + 20 + 40 + + + + - Frequency multiplier: + Rx frequency multiplier: @@ -977,7 +1024,7 @@ Qt::Horizontal - QSizePolicy::Fixed + QSizePolicy::Preferred @@ -989,6 +1036,18 @@ + + + 0 + 0 + + + + + 80 + 0 + + 1 @@ -1002,6 +1061,58 @@ + + + + + + false + + + Tx frequency multiplier: + + + + + + + Qt::Horizontal + + + QSizePolicy::Preferred + + + + 47 + 20 + + + + + + + + false + + + + 0 + 0 + + + + + 80 + 0 + + + + 1 + + + + + @@ -1017,7 +1128,7 @@ Qt::Horizontal - QSizePolicy::Fixed + QSizePolicy::Preferred @@ -1029,6 +1140,18 @@ + + + 0 + 0 + + + + + 80 + 0 + + 3 @@ -1042,6 +1165,22 @@ + + + + Qt::Vertical + + + QSizePolicy::Fixed + + + + 20 + 40 + + + + diff --git a/mainwindow.cpp b/mainwindow.cpp index 26348b34d..641b1d08d 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -240,6 +240,7 @@ MainWindow::MainWindow(QWidget *parent) : if(m_fs96000) g_pWideGraph->setFsample(96000); if(!m_fs96000) g_pWideGraph->setFsample(95238); g_pWideGraph->m_mult570=m_mult570; + g_pWideGraph->m_mult570Tx=m_mult570Tx; g_pWideGraph->m_cal570=m_cal570; if(m_initIQplus) g_pWideGraph->initIQplus(); @@ -342,6 +343,7 @@ void MainWindow::writeSettings() settings.setValue("paOutDevice",m_paOutDevice); settings.setValue("IQswap",m_IQswap); settings.setValue("Plus10dB",m_10db); + settings.setValue("IQxt",m_bIQxt); settings.setValue("InitIQplus",m_initIQplus); settings.setValue("UDPport",m_udpPort); settings.setValue("PaletteCuteSDR",ui->actionCuteSDR->isChecked()); @@ -361,6 +363,7 @@ void MainWindow::writeSettings() settings.setValue("PhaseX",(double)m_phasex); settings.setValue("PhaseY",(double)m_phasey); settings.setValue("Mult570",m_mult570); + settings.setValue("Mult570Tx",m_mult570Tx); settings.setValue("Cal570",m_cal570); settings.setValue("Colors",m_colors); settings.endGroup(); @@ -420,6 +423,7 @@ void MainWindow::readSettings() m_IQswap = settings.value("IQswap",false).toBool(); m_10db = settings.value("Plus10dB",false).toBool(); m_initIQplus = settings.value("InitIQplus",false).toBool(); + m_bIQxt = settings.value("IQxt",false).toBool(); m_udpPort = settings.value("UDPport",50004).toInt(); soundInThread.setSwapIQ(m_IQswap); soundInThread.set10db(m_10db); @@ -450,6 +454,7 @@ void MainWindow::readSettings() m_phasex=settings.value("PhaseX",0.0).toFloat(); m_phasey=settings.value("PhaseY",0.0).toFloat(); m_mult570=settings.value("Mult570",2).toInt(); + m_mult570Tx=settings.value("Mult570Tx",1).toInt(); m_cal570=settings.value("Cal570",0.0).toDouble(); m_colors=settings.value("Colors","000066ff0000ffff00969696646464").toString(); settings.endGroup(); @@ -612,8 +617,10 @@ void MainWindow::on_actionDeviceSetup_triggered() //Setup Dialog dlg.m_IQswap=m_IQswap; dlg.m_10db=m_10db; dlg.m_initIQplus=m_initIQplus; + dlg.m_bIQxt=m_bIQxt; dlg.m_cal570=m_cal570; dlg.m_mult570=m_mult570; + dlg.m_mult570Tx=m_mult570Tx; dlg.m_colors=m_colors; dlg.initDlg(); @@ -646,12 +653,14 @@ void MainWindow::on_actionDeviceSetup_triggered() //Setup Dialog m_IQswap=dlg.m_IQswap; m_10db=dlg.m_10db; m_initIQplus=dlg.m_initIQplus; + m_bIQxt=dlg.m_bIQxt; m_colors=dlg.m_colors; g_pMessages->setColors(m_colors); g_pBandMap->setColors(m_colors); m_cal570=dlg.m_cal570; - m_mult570=dlg.m_mult570; + m_mult570Tx=dlg.m_mult570Tx; g_pWideGraph->m_mult570=m_mult570; + g_pWideGraph->m_mult570Tx=m_mult570Tx; g_pWideGraph->m_cal570=m_cal570; soundInThread.setSwapIQ(m_IQswap); soundInThread.set10db(m_10db); diff --git a/mainwindow.h b/mainwindow.h index 7ba21a246..1d1b26290 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -162,6 +162,7 @@ private: qint32 m_adjustIQ; qint32 m_applyIQcal; qint32 m_mult570; + qint32 m_mult570Tx; qint32 m_nfast; qint32 m_nsum; qint32 m_nsave; @@ -195,6 +196,7 @@ private: bool m_IQswap; bool m_10db; bool m_initIQplus; + bool m_bIQxt; float m_gainx; float m_gainy; diff --git a/plotter.cpp b/plotter.cpp index ca71ba51a..7e86b6a38 100644 --- a/plotter.cpp +++ b/plotter.cpp @@ -547,10 +547,11 @@ void CPlotter::mousePressEvent(QMouseEvent *event) //mousePressEvent int h = (m_Size.height()-60)/2; int x=event->x(); int y=event->y(); - if(y < h+30) { - setFQSO(x,false); // Wideband waterfall - } else { - m_DF=int(m_ZoomStartFreq + x*m_fSample/32768.0); // Zoomed waterfall + int button=event->button(); + if(y < h+30) { // Wideband waterfall + if(button==1) setFQSO(x,false); + } else { // Zoomed waterfall + if(button==1) m_DF=int(m_ZoomStartFreq + x*m_fSample/32768.0); DrawOverlay(); update(); } diff --git a/plotter.h b/plotter.h index 4e3763a32..3432d26e3 100644 --- a/plotter.h +++ b/plotter.h @@ -56,6 +56,7 @@ public: void setBinsPerPixel(int n); int binsPerPixel(); void setFQSO(int n, bool bf); +// void setTxFreq(int) void setFcal(int n); void setNkhz(int n); void DrawOverlay(); diff --git a/widegraph.h b/widegraph.h index becdcedd2..3750d92b6 100644 --- a/widegraph.h +++ b/widegraph.h @@ -16,6 +16,7 @@ public: bool m_bForceCenterFreq; qint32 m_mult570; + qint32 m_mult570Tx; double m_dForceCenterFreq; double m_cal570;