diff --git a/mainwindow.cpp b/mainwindow.cpp index 85d04ce7f..b209f6fa1 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -8,6 +8,7 @@ #include "widegraph.h" #include "messages.h" #include "bandmap.h" +#include "txtune.h" #include "sleep.h" #include @@ -17,12 +18,16 @@ short int iwave[2*60*11025]; //Wave file for Tx audio int nwave; //Length of Tx waveform bool btxok; //True if OK to transmit double outputLatency; //Latency in seconds +double txPower; +double iqAmp; +double iqPhase; qint16 id[4*60*96000]; Astro* g_pAstro = NULL; WideGraph* g_pWideGraph = NULL; Messages* g_pMessages = NULL; BandMap* g_pBandMap = NULL; +TxTune* g_pTxTune = NULL; QSharedMemory mem_m65("mem_m65"); QString rev="$Rev$"; @@ -145,6 +150,9 @@ MainWindow::MainWindow(QWidget *parent) : m_colors="000066ff0000ffff00969696646464"; m_nfast=1; m_nsave=0; + txPower=1.0; + iqAmp=1.0; + iqPhase=0.0; ui->xThermo->setFillBrush(Qt::green); ui->yThermo->setFillBrush(Qt::magenta); @@ -2101,3 +2109,18 @@ void MainWindow::on_actionEdit_wsjt_log_triggered() QString cmnd=m_editorCommand + " " + m_appDir + "/wsjt.log"; proc_editor.start(QDir::toNativeSeparators(cmnd)); } + +void MainWindow::on_actionTx_Tune_triggered() +{ + if(g_pTxTune==NULL) { + g_pTxTune = new TxTune(0); + /* + g_pTxTune->setWindowTitle("Astronomical Data"); + Qt::WindowFlags flags = Qt::Dialog | Qt::WindowCloseButtonHint | + Qt::WindowMinimizeButtonHint; + g_pTxTune->setWindowFlags(flags); + g_pTxTune->setGeometry(m_astroGeom); + */ + } + g_pTxTune->show(); +} diff --git a/mainwindow.h b/mainwindow.h index 1d1b26290..bf72ebd6a 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -118,18 +118,13 @@ private slots: void on_NBslider_valueChanged(int value); void on_actionAdjust_IQ_Calibration_triggered(); void on_actionApply_IQ_Calibration_triggered(); - void on_actionAFMHot_triggered(); - void on_actionBlue_triggered(); - void on_actionFUNcube_Dongle_triggered(); - void on_actionJT65B2_triggered(); - void on_actionJT65C2_triggered(); - void on_actionEdit_wsjt_log_triggered(); + void on_actionTx_Tune_triggered(); private: Ui::MainWindow *ui; diff --git a/mainwindow.ui b/mainwindow.ui index af5319e06..b603c5e28 100644 --- a/mainwindow.ui +++ b/mainwindow.ui @@ -1167,6 +1167,7 @@ p, li { white-space: pre-wrap; } + @@ -1540,7 +1541,7 @@ p, li { white-space: pre-wrap; } - Adjust I/Q Calibration + Adjust Rx I/Q Calibration @@ -1548,7 +1549,7 @@ p, li { white-space: pre-wrap; } true - Apply I/Q Calibration + Apply Rx I/Q Calibration @@ -1596,6 +1597,14 @@ p, li { white-space: pre-wrap; } Alt+Shift+E + + + Tx Tune + + + Alt+T + + diff --git a/map65.pro b/map65.pro index b79d4e5a2..a1d54e88d 100644 --- a/map65.pro +++ b/map65.pro @@ -35,7 +35,8 @@ QMAKE_EXTRA_COMPILERS += gfortran SOURCES += main.cpp mainwindow.cpp plotter.cpp about.cpp \ soundin.cpp soundout.cpp devsetup.cpp \ widegraph.cpp getfile.cpp messages.cpp bandmap.cpp \ - astro.cpp displaytext.cpp getdev.cpp + astro.cpp displaytext.cpp getdev.cpp \ + txtune.cpp win32 { SOURCES += killbyname.cpp set570.cpp @@ -44,11 +45,13 @@ SOURCES += killbyname.cpp set570.cpp HEADERS += mainwindow.h plotter.h soundin.h soundout.h \ about.h devsetup.h widegraph.h getfile.h messages.h \ bandmap.h commons.h sleep.h astro.h displaytext.h \ + txtune.h DEFINES += __cplusplus FORMS += mainwindow.ui about.ui devsetup.ui widegraph.ui \ - messages.ui bandmap.ui astro.ui + messages.ui bandmap.ui astro.ui \ + txtune.ui RC_FILE = map65.rc diff --git a/plotter.cpp b/plotter.cpp index 43fddbd43..a115132c7 100644 --- a/plotter.cpp +++ b/plotter.cpp @@ -357,6 +357,7 @@ void CPlotter::DrawOverlay() //DrawOverlay() } df=m_fSample/32768.0; + if(m_bLockTxRx) m_TxDF=m_DF; x = (m_DF + m_mode65*66*11025.0/4096.0 - m_ZoomStartFreq)/df; QPen pen2(Qt::darkGreen, 3); //Mark top JT65B tone with dark Green tick painter3.setPen(pen2); diff --git a/soundout.cpp b/soundout.cpp index 55f4ce33f..fefa24cf9 100644 --- a/soundout.cpp +++ b/soundout.cpp @@ -12,6 +12,9 @@ extern short int iwave[2*60*11025]; //Wave file for Tx audio extern int nwave; extern bool btxok; extern double outputLatency; +extern double txPower; +extern double iqAmp; +extern double iqPhase; typedef struct //Parameters sent to or received from callback function { @@ -36,6 +39,7 @@ extern "C" int d2aCallback(const void *inputBuffer, void *outputBuffer, int nsec; int nTRperiod=udata->nTRperiod; +// qDebug() << txPower << iqAmp << iqPhase; // Get System time qint64 ms = QDateTime::currentMSecsSinceEpoch() % 86400000; tsec = 0.001*ms; diff --git a/txtune.cpp b/txtune.cpp new file mode 100644 index 000000000..12b18c869 --- /dev/null +++ b/txtune.cpp @@ -0,0 +1,34 @@ +#include "txtune.h" +#include "ui_txtune.h" +#include + +extern double txPower; +extern double iqAmp; +extern double iqPhase; + +TxTune::TxTune(QWidget *parent) : + QDialog(parent), + ui(new Ui::TxTune) +{ + ui->setupUi(this); +} + +TxTune::~TxTune() +{ + delete ui; +} + +void TxTune::on_pwrSlider_valueChanged(int n) +{ + txPower=0.01*n; +} + +void TxTune::on_ampSlider_valueChanged(int n) +{ + iqAmp=1.0 + 0.001*n; +} + +void TxTune::on_phaSlider_valueChanged(int n) +{ + iqPhase=0.1*n; +} diff --git a/txtune.h b/txtune.h new file mode 100644 index 000000000..f9a448aa1 --- /dev/null +++ b/txtune.h @@ -0,0 +1,27 @@ +#ifndef TXTUNE_H +#define TXTUNE_H + +#include + +namespace Ui { +class TxTune; +} + +class TxTune : public QDialog +{ + Q_OBJECT + +public: + explicit TxTune(QWidget *parent = 0); + ~TxTune(); + +private slots: + void on_pwrSlider_valueChanged(int n); + void on_ampSlider_valueChanged(int n); + void on_phaSlider_valueChanged(int n); + +private: + Ui::TxTune *ui; +}; + +#endif // TXTUNE_H diff --git a/txtune.ui b/txtune.ui new file mode 100644 index 000000000..7345d35e1 --- /dev/null +++ b/txtune.ui @@ -0,0 +1,176 @@ + + + TxTune + + + + 0 + 0 + 400 + 300 + + + + Tx Tune + + + + + 30 + 240 + 341 + 32 + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + false + + + + + + 20 + 40 + 331 + 141 + + + + + + + + 70 + 0 + + + + Tx Power: + + + + + + + + 70 + 0 + + + + I/Q Amplitude: + + + + + + + -100 + + + 100 + + + Qt::Horizontal + + + QSlider::TicksBelow + + + + + + + + 70 + 0 + + + + I/Q Phase: + + + + + + + -100 + + + 100 + + + 0 + + + Qt::Horizontal + + + QSlider::TicksBelow + + + + + + + 100 + + + 100 + + + Qt::Horizontal + + + QSlider::TicksBelow + + + 10 + + + + + + + + + + buttonBox + accepted() + TxTune + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttonBox + rejected() + TxTune + reject() + + + 316 + 260 + + + 286 + 274 + + + + + diff --git a/widegraph.cpp b/widegraph.cpp index 13509434d..b4edd9d64 100644 --- a/widegraph.cpp +++ b/widegraph.cpp @@ -58,12 +58,9 @@ WideGraph::~WideGraph() void WideGraph::resizeEvent(QResizeEvent* ) //resizeEvent() { if(!size().isValid()) return; -// m_Size = size(); int w = size().width(); int h = size().height(); -// qDebug() << "A" << w << h << ui->labFreq->geometry(); ui->labFreq->setGeometry(QRect(w-160,h-100,131,41)); -// qDebug() << "B" << w << h << ui->labFreq->geometry(); } void WideGraph::saveSettings()