From a035ca57720b064cf843a37b92f67fb9146390ea Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Sun, 3 Nov 2013 20:28:14 +0000 Subject: [PATCH] More progress toward support of IQ+ XT. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/map65@3593 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- mainwindow.cpp | 4 ++++ plotter.cpp | 5 +++++ plotter.h | 1 + widegraph.cpp | 31 +++++++++++++++++++++++++++++++ widegraph.h | 2 ++ 5 files changed, 43 insertions(+) diff --git a/mainwindow.cpp b/mainwindow.cpp index 641b1d08d..bc696259e 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -1401,6 +1401,9 @@ void MainWindow::guiUpdate() sprintf(s,"Cannot open COM%d",m_pttPort); msgBox(s); } + + if(m_bIQxt) g_pWideGraph->tx570(); // Set Si570 to Tx Freq + if(!soundOutThread.isRunning()) { soundOutThread.start(QThread::HighPriority); } @@ -1465,6 +1468,7 @@ void MainWindow::guiUpdate() if(!btxok && btxok0 && iptt==1) nc0=-11; //RxDelay = 1.0 s if(nc0 <= 0) nc0++; if(nc0 == 0) { + if(m_bIQxt) g_pWideGraph->rx570(); // Set Si570 back to Rx Freq int itx=0; ptt_(&m_pttPort,&itx,&iptt); // Lower PTT if(!m_txMute) soundOutThread.quitExecution=true; diff --git a/plotter.cpp b/plotter.cpp index f7abff1f1..297b6b99d 100644 --- a/plotter.cpp +++ b/plotter.cpp @@ -757,3 +757,8 @@ void CPlotter::setLockTxRx(bool b) update(); //trigger a new paintEvent} } } + +double CPlotter::txFreq() +{ + return m_TXfreq + 0.000001*m_TxDF; +} diff --git a/plotter.h b/plotter.h index 387e61bcd..6bce409da 100644 --- a/plotter.h +++ b/plotter.h @@ -69,6 +69,7 @@ public: void set2Dspec(bool b); double fGreen(); void setLockTxRx(bool b); + double txFreq(); signals: void freezeDecode0(int n); diff --git a/widegraph.cpp b/widegraph.cpp index ff5409e30..67b00d979 100644 --- a/widegraph.cpp +++ b/widegraph.cpp @@ -331,3 +331,34 @@ void WideGraph::on_cbLockTxRx_stateChanged(int n) m_bLockTxRx = (n!=0); ui->widePlot->setLockTxRx(m_bLockTxRx); } + +void WideGraph::rx570() +{ + double f=m_mult570*(1.0+0.000001*m_cal570)*m_dForceCenterFreq; + qDebug() << "Set Rx Freq" << m_dForceCenterFreq << f; +#ifdef WIN32 + int iret=set570(f); + if(iret != 0) { + QMessageBox mb; + if(iret==-1) mb.setText("Failed to open Si570."); + if(iret==-2) mb.setText("Frequency out of permitted range."); + mb.exec(); + } +#endif +} + +void WideGraph::tx570() +{ + double f=floor(datcom_.fcenter) + ui->widePlot->txFreq(); + double f1=m_mult570Tx*(1.0+0.000001*m_cal570) * f; + qDebug() << "Set Tx Freq" << f << f1; +#ifdef WIN32 + int iret=set570(f1); + if(iret != 0) { + QMessageBox mb; + if(iret==-1) mb.setText("Failed to open Si570."); + if(iret==-2) mb.setText("Frequency out of permitted range."); + mb.exec(); + } +#endif +} diff --git a/widegraph.h b/widegraph.h index 1521a4815..656edc91d 100644 --- a/widegraph.h +++ b/widegraph.h @@ -38,6 +38,8 @@ public: void setMode65(int n); void setPeriod(int n); double fGreen(); + void rx570(); + void tx570(); qint32 m_qsoFreq;