More work toward changes for IQ+ Tx: in particular, code for the txTune

window.  Still need to implement actions in soundout for Tx image rejection,
and action of the Tune button.


git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/map65@3632 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
Joe Taylor 2014-01-10 20:11:30 +00:00
parent ba4f27518a
commit 93b6755e4b
7 changed files with 209 additions and 79 deletions

View File

@ -17,6 +17,7 @@
short int iwave[2*60*11025]; //Wave file for Tx audio short int iwave[2*60*11025]; //Wave file for Tx audio
int nwave; //Length of Tx waveform int nwave; //Length of Tx waveform
bool btxok; //True if OK to transmit bool btxok; //True if OK to transmit
bool bTune;
double outputLatency; //Latency in seconds double outputLatency; //Latency in seconds
double txPower; double txPower;
double iqAmp; double iqAmp;
@ -150,6 +151,7 @@ MainWindow::MainWindow(QWidget *parent) :
m_colors="000066ff0000ffff00969696646464"; m_colors="000066ff0000ffff00969696646464";
m_nfast=1; m_nfast=1;
m_nsave=0; m_nsave=0;
bTune=false;
txPower=1.0; txPower=1.0;
iqAmp=1.0; iqAmp=1.0;
iqPhase=0.0; iqPhase=0.0;
@ -337,8 +339,8 @@ void MainWindow::writeSettings()
settings.setValue("Editor",m_editorCommand); settings.setValue("Editor",m_editorCommand);
settings.setValue("DXCCpfx",m_dxccPfx); settings.setValue("DXCCpfx",m_dxccPfx);
settings.setValue("Timeout",m_timeout); settings.setValue("Timeout",m_timeout);
settings.setValue("IQamp",m_IQamp); settings.setValue("IQamp",iqAmp);
settings.setValue("IQphase",m_IQphase); settings.setValue("IQphase",iqPhase);
settings.setValue("ApplyIQcal",m_applyIQcal); settings.setValue("ApplyIQcal",m_applyIQcal);
settings.setValue("dPhi",m_dPhi); settings.setValue("dPhi",m_dPhi);
settings.setValue("Fcal",m_fCal); settings.setValue("Fcal",m_fCal);
@ -414,8 +416,8 @@ void MainWindow::readSettings()
m_editorCommand=settings.value("Editor","notepad").toString(); m_editorCommand=settings.value("Editor","notepad").toString();
m_dxccPfx=settings.value("DXCCpfx","").toString(); m_dxccPfx=settings.value("DXCCpfx","").toString();
m_timeout=settings.value("Timeout",20).toInt(); m_timeout=settings.value("Timeout",20).toInt();
m_IQamp=settings.value("IQamp",1.0000).toDouble(); iqAmp=settings.value("IQamp",1.0000).toDouble();
m_IQphase=settings.value("IQphase",0.0).toDouble(); iqPhase=settings.value("IQphase",0.0).toDouble();
m_applyIQcal=settings.value("ApplyIQcal",0).toInt(); m_applyIQcal=settings.value("ApplyIQcal",0).toInt();
ui->actionApply_IQ_Calibration->setChecked(m_applyIQcal!=0); ui->actionApply_IQ_Calibration->setChecked(m_applyIQcal!=0);
m_dPhi=settings.value("dPhi",0).toInt(); m_dPhi=settings.value("dPhi",0).toInt();
@ -2114,13 +2116,8 @@ void MainWindow::on_actionTx_Tune_triggered()
{ {
if(g_pTxTune==NULL) { if(g_pTxTune==NULL) {
g_pTxTune = new TxTune(0); 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->set_iqAmp(iqAmp);
g_pTxTune->set_iqPhase(iqPhase);
g_pTxTune->show(); g_pTxTune->show();
} }

View File

@ -164,8 +164,8 @@ private:
qint32 m_TRperiod; qint32 m_TRperiod;
double m_fAdd; double m_fAdd;
double m_IQamp; // double m_IQamp;
double m_IQphase; // double m_IQphase;
double m_cal570; double m_cal570;
bool m_monitoring; bool m_monitoring;

View File

@ -1,6 +1,6 @@
[Setup] [Setup]
AppName=MAP65 AppName=MAP65
AppVerName=MAP65 Version 2.5 r3597 AppVerName=MAP65 Version 2.5 r3603
AppCopyright=Copyright (C) 2001-2013 by Joe Taylor, K1JT AppCopyright=Copyright (C) 2001-2013 by Joe Taylor, K1JT
DefaultDirName=c:\MAP65 DefaultDirName=c:\MAP65
DefaultGroupName=MAP65 DefaultGroupName=MAP65

View File

@ -11,6 +11,7 @@ extern float gran(); //Noise generator (for tests only)
extern short int iwave[2*60*11025]; //Wave file for Tx audio extern short int iwave[2*60*11025]; //Wave file for Tx audio
extern int nwave; extern int nwave;
extern bool btxok; extern bool btxok;
extern bool bTune;
extern double outputLatency; extern double outputLatency;
extern double txPower; extern double txPower;
extern double iqAmp; extern double iqAmp;
@ -39,12 +40,18 @@ extern "C" int d2aCallback(const void *inputBuffer, void *outputBuffer,
int nsec; int nsec;
int nTRperiod=udata->nTRperiod; int nTRperiod=udata->nTRperiod;
// qDebug() << txPower << iqAmp << iqPhase;
// Get System time // Get System time
qint64 ms = QDateTime::currentMSecsSinceEpoch() % 86400000; qint64 ms = QDateTime::currentMSecsSinceEpoch() % 86400000;
tsec = 0.001*ms; tsec = 0.001*ms;
nsec = ms/1000; nsec = ms/1000;
static int nsec0=0;
if(nsec!=nsec0) {
qDebug() << txPower << iqAmp << iqPhase << bTune;
nsec0=nsec;
}
if(btxok and !btxok0) { //Start (or re-start) a transmission if(btxok and !btxok0) { //Start (or re-start) a transmission
n=nsec/nTRperiod; n=nsec/nTRperiod;
tstart=tsec - n*nTRperiod - 1.0; tstart=tsec - n*nTRperiod - 1.0;

View File

@ -5,6 +5,7 @@
extern double txPower; extern double txPower;
extern double iqAmp; extern double iqAmp;
extern double iqPhase; extern double iqPhase;
extern bool bTune;
TxTune::TxTune(QWidget *parent) : TxTune::TxTune(QWidget *parent) :
QDialog(parent), QDialog(parent),
@ -26,9 +27,56 @@ void TxTune::on_pwrSlider_valueChanged(int n)
void TxTune::on_ampSlider_valueChanged(int n) void TxTune::on_ampSlider_valueChanged(int n)
{ {
iqAmp=1.0 + 0.001*n; iqAmp=1.0 + 0.001*n;
ui->ampSpinBox->setValue(iqAmp);
} }
void TxTune::on_phaSlider_valueChanged(int n) void TxTune::on_phaSlider_valueChanged(int n)
{ {
iqPhase=0.1*n; iqPhase=0.1*n;
ui->phaSpinBox->setValue(iqPhase);
}
void TxTune::on_ampSpinBox_valueChanged(double d)
{
iqAmp=d;
int n=1000.0*(iqAmp-1.0);
ui->ampSlider->setValue(n);
}
void TxTune::on_phaSpinBox_valueChanged(double d)
{
iqPhase=d;
int n=10.0*iqPhase;
ui->phaSlider->setValue(n);
}
void TxTune::set_iqAmp(double d)
{
ui->ampSpinBox->setValue(d);
}
void TxTune::set_iqPhase(double d)
{
ui->phaSpinBox->setValue(d);
}
void TxTune::on_cbTxImage_toggled(bool b)
{
ui->ampSlider->setEnabled(b);
ui->ampSpinBox->setEnabled(b);
ui->labAmp->setEnabled(b);
ui->phaSlider->setEnabled(b);
ui->phaSpinBox->setEnabled(b);
ui->labPha->setEnabled(b);
}
void TxTune::on_pbTune_clicked()
{
bTune = !bTune;
if(bTune) {
QString style="QPushButton{background-color: red;}";
ui->pbTune->setStyleSheet(style);
} else {
ui->pbTune->setStyleSheet("");
}
} }

View File

@ -19,6 +19,14 @@ private slots:
void on_pwrSlider_valueChanged(int n); void on_pwrSlider_valueChanged(int n);
void on_ampSlider_valueChanged(int n); void on_ampSlider_valueChanged(int n);
void on_phaSlider_valueChanged(int n); void on_phaSlider_valueChanged(int n);
void on_ampSpinBox_valueChanged(double d);
void on_phaSpinBox_valueChanged(double d);
void on_cbTxImage_toggled(bool b);
void on_pbTune_clicked();
public:
void set_iqAmp(double d);
void set_iqPhase(double d);
private: private:
Ui::TxTune *ui; Ui::TxTune *ui;

198
txtune.ui
View File

@ -35,9 +35,9 @@
<widget class="QWidget" name=""> <widget class="QWidget" name="">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>20</x> <x>12</x>
<y>40</y> <y>64</y>
<width>331</width> <width>371</width>
<height>141</height> <height>141</height>
</rect> </rect>
</property> </property>
@ -55,67 +55,6 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="0">
<widget class="QLabel" name="label_2">
<property name="minimumSize">
<size>
<width>70</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>I/Q Amplitude:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QSlider" name="ampSlider">
<property name="minimum">
<number>-100</number>
</property>
<property name="maximum">
<number>100</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="tickPosition">
<enum>QSlider::TicksBelow</enum>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_3">
<property name="minimumSize">
<size>
<width>70</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>I/Q Phase:</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QSlider" name="phaSlider">
<property name="minimum">
<number>-100</number>
</property>
<property name="maximum">
<number>100</number>
</property>
<property name="value">
<number>0</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="tickPosition">
<enum>QSlider::TicksBelow</enum>
</property>
</widget>
</item>
<item row="0" column="1"> <item row="0" column="1">
<widget class="QSlider" name="pwrSlider"> <widget class="QSlider" name="pwrSlider">
<property name="maximum"> <property name="maximum">
@ -135,6 +74,137 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="2">
<widget class="QPushButton" name="pbTune">
<property name="text">
<string>Tune</string>
</property>
</widget>
</item>
<item row="1" column="0" colspan="3">
<widget class="QCheckBox" name="cbTxImage">
<property name="text">
<string>Enable Tx Image Adjustment</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="labAmp">
<property name="enabled">
<bool>false</bool>
</property>
<property name="minimumSize">
<size>
<width>70</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>I/Q Amplitude:</string>
</property>
</widget>
</item>
<item row="2" column="2">
<widget class="QDoubleSpinBox" name="ampSpinBox">
<property name="enabled">
<bool>false</bool>
</property>
<property name="decimals">
<number>3</number>
</property>
<property name="minimum">
<double>0.950000000000000</double>
</property>
<property name="maximum">
<double>1.050000000000000</double>
</property>
<property name="singleStep">
<double>0.001000000000000</double>
</property>
<property name="value">
<double>1.000000000000000</double>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="labPha">
<property name="enabled">
<bool>false</bool>
</property>
<property name="minimumSize">
<size>
<width>70</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>I/Q Phase:</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QSlider" name="phaSlider">
<property name="enabled">
<bool>false</bool>
</property>
<property name="minimum">
<number>-100</number>
</property>
<property name="maximum">
<number>100</number>
</property>
<property name="value">
<number>0</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="tickPosition">
<enum>QSlider::TicksBelow</enum>
</property>
</widget>
</item>
<item row="3" column="2">
<widget class="QDoubleSpinBox" name="phaSpinBox">
<property name="enabled">
<bool>false</bool>
</property>
<property name="decimals">
<number>1</number>
</property>
<property name="minimum">
<double>-10.000000000000000</double>
</property>
<property name="maximum">
<double>10.000000000000000</double>
</property>
<property name="singleStep">
<double>0.100000000000000</double>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QSlider" name="ampSlider">
<property name="enabled">
<bool>false</bool>
</property>
<property name="minimum">
<number>-50</number>
</property>
<property name="maximum">
<number>50</number>
</property>
<property name="value">
<number>0</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="tickPosition">
<enum>QSlider::TicksBelow</enum>
</property>
</widget>
</item>
</layout> </layout>
</widget> </widget>
</widget> </widget>