More progress toward support of IQ+ XT.

git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/map65@3592 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
Joe Taylor 2013-11-03 19:30:00 +00:00
parent 0d0a43cbc6
commit a01b0ddc8c
6 changed files with 332 additions and 249 deletions

View File

@ -17,7 +17,7 @@
<item>
<widget class="QTabWidget" name="ioTabWidget">
<property name="currentIndex">
<number>2</number>
<number>0</number>
</property>
<widget class="QWidget" name="tab">
<attribute name="title">
@ -948,249 +948,6 @@
</layout>
</widget>
</widget>
<widget class="QWidget" name="tab_3">
<attribute name="title">
<string>Si570</string>
</attribute>
<widget class="QWidget" name="">
<property name="geometry">
<rect>
<x>40</x>
<y>40</y>
<width>272</width>
<height>220</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_9">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_19">
<item>
<widget class="QLabel" name="label_24">
<property name="text">
<string>LO Selection:</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="rbSi570">
<property name="text">
<string>IQ+, Generic Si570</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="rbIQXT">
<property name="text">
<string>IQ+ Rx/XT</string>
</property>
<property name="checked">
<bool>false</bool>
</property>
</widget>
</item>
</layout>
</item>
<item>
<spacer name="verticalSpacer_4">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_9">
<item>
<widget class="QLabel" name="label_12">
<property name="text">
<string>Rx frequency multiplier:</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_12">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Preferred</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>47</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QSpinBox" name="mult570SpinBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>80</width>
<height>0</height>
</size>
</property>
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>8</number>
</property>
<property name="value">
<number>2</number>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_20">
<item>
<widget class="QLabel" name="label_25">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Tx frequency multiplier:</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_21">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Preferred</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>47</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QSpinBox" name="mult570TxSpinBox">
<property name="enabled">
<bool>false</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>80</width>
<height>0</height>
</size>
</property>
<property name="value">
<number>1</number>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_10">
<item>
<widget class="QLabel" name="label_13">
<property name="text">
<string>Frequency correction (ppm):</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_13">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Preferred</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>10</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QDoubleSpinBox" name="cal570SpinBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>80</width>
<height>0</height>
</size>
</property>
<property name="decimals">
<number>3</number>
</property>
<property name="minimum">
<double>-200.000000000000000</double>
</property>
<property name="maximum">
<double>200.000000000000000</double>
</property>
</widget>
</item>
</layout>
</item>
<item>
<spacer name="verticalSpacer_5">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QCheckBox" name="cbInitIQplus">
<property name="text">
<string>Initialize IQ+ on startup</string>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
<widget class="QWidget" name="tab_4">
<attribute name="title">
<string>Colors</string>
@ -1700,6 +1457,249 @@
</layout>
</widget>
</widget>
<widget class="QWidget" name="tab_3">
<attribute name="title">
<string>Si570 Control</string>
</attribute>
<widget class="QWidget" name="">
<property name="geometry">
<rect>
<x>40</x>
<y>40</y>
<width>272</width>
<height>220</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_9">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_19">
<item>
<widget class="QLabel" name="label_24">
<property name="text">
<string>LO Selection:</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="rbSi570">
<property name="text">
<string>IQ+, Generic Si570</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="rbIQXT">
<property name="text">
<string>IQ+ Rx/XT</string>
</property>
<property name="checked">
<bool>false</bool>
</property>
</widget>
</item>
</layout>
</item>
<item>
<spacer name="verticalSpacer_4">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_9">
<item>
<widget class="QLabel" name="label_12">
<property name="text">
<string>Rx frequency multiplier:</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_12">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Preferred</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>47</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QSpinBox" name="mult570SpinBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>80</width>
<height>0</height>
</size>
</property>
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>8</number>
</property>
<property name="value">
<number>2</number>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_20">
<item>
<widget class="QLabel" name="label_25">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Tx frequency multiplier:</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_21">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Preferred</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>47</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QSpinBox" name="mult570TxSpinBox">
<property name="enabled">
<bool>false</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>80</width>
<height>0</height>
</size>
</property>
<property name="value">
<number>1</number>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_10">
<item>
<widget class="QLabel" name="label_13">
<property name="text">
<string>Frequency correction (ppm):</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_13">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Preferred</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>10</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QDoubleSpinBox" name="cal570SpinBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>80</width>
<height>0</height>
</size>
</property>
<property name="decimals">
<number>3</number>
</property>
<property name="minimum">
<double>-200.000000000000000</double>
</property>
<property name="maximum">
<double>200.000000000000000</double>
</property>
</widget>
</item>
</layout>
</item>
<item>
<spacer name="verticalSpacer_5">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QCheckBox" name="cbInitIQplus">
<property name="text">
<string>Initialize IQ+ on startup</string>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
</widget>
</item>
<item>

View File

@ -32,6 +32,7 @@ CPlotter::CPlotter(QWidget *parent) : //CPlotter Constructor
m_line = 0;
m_fSample = 96000;
m_paintAllZoom = false;
m_TxDF=0;
}
CPlotter::~CPlotter() { } // Destructor
@ -317,6 +318,10 @@ void CPlotter::DrawOverlay() //DrawOverlay()
painter0.setPen(pen0);
x = XfromFreq(float(fQSO()));
painter0.drawLine(x,15,x,30);
QPen pen3(Qt::red, 3); //Mark Tx freq (kHz) with red tick
painter0.setPen(pen3);
x = XfromFreq(float(m_TXkHz));
painter0.drawLine(x,0,x,15);
}
// Now make the zoomed scale, using m_ZoomScalePixmap and painter3
@ -352,7 +357,7 @@ void CPlotter::DrawOverlay() //DrawOverlay()
df=m_fSample/32768.0;
x = (m_DF + m_mode65*66*11025.0/4096.0 - m_ZoomStartFreq)/df;
QPen pen2(Qt::red, 3); //Mark top JT65B tone with red tick
QPen pen2(Qt::darkGreen, 3); //Mark top JT65B tone with dark Green tick
painter3.setPen(pen2);
painter3.drawLine(x,15,x,30);
x = (m_DF - m_ZoomStartFreq)/df;
@ -367,6 +372,12 @@ void CPlotter::DrawOverlay() //DrawOverlay()
int x2=(m_DF + m_tol - m_ZoomStartFreq)/df;
pen1.setWidth(6);
painter3.drawLine(x1,28,x2,28);
pen1.setWidth(3);
pen1.setColor(Qt::red); //Mark Tx DF with red tick
painter3.setPen(pen1);
x = (m_TxDF - m_ZoomStartFreq)/df;
painter3.drawLine(x,0,x,15);
}
void CPlotter::MakeFrequencyStrs() //MakeFrequencyStrs
@ -549,16 +560,30 @@ void CPlotter::mousePressEvent(QMouseEvent *event) //mousePressEvent
int y=event->y();
int button=event->button();
if(y < h+30) { // Wideband waterfall
if(button==1) setFQSO(x,false);
if(button==1) {
setFQSO(x,false);
if(m_bLockTxRx) m_TXkHz=m_fQSO;
qDebug() << "c" << m_bLockTxRx << m_fQSO << m_TXkHz;
}
if(button==2 and !m_bLockTxRx) {
if(x<0) x=0; // x is pixel number
if(x>m_Size.width()) x=m_Size.width();
m_TXkHz = int(FreqfromX(x)+0.5);
m_TXfreq = floor(datcom_.fcenter) + 0.001*m_TXkHz;
setTxFreq(m_TXfreq);
}
} else { // Zoomed waterfall
if(button==1) m_DF=int(m_ZoomStartFreq + x*m_fSample/32768.0);
DrawOverlay();
update();
if(button==2 and !m_bLockTxRx) m_TxDF=int(m_ZoomStartFreq + x*m_fSample/32768.0);
if(m_bLockTxRx) m_TxDF=m_DF;
}
DrawOverlay();
update();
}
void CPlotter::mouseDoubleClickEvent(QMouseEvent *event) //mouse2click
{
if(event->button()!=1) return; //Act only on left double-click
int h = (m_Size.height()-60)/2;
int x=event->x();
int y=event->y();
@ -715,3 +740,20 @@ double CPlotter::fGreen()
{
return m_fGreen;
}
void CPlotter::setTxFreq(double dfreq)
{
qDebug() << "SetTxFreq()" << dfreq;
}
void CPlotter::setLockTxRx(bool b)
{
m_bLockTxRx=b;
if(m_bLockTxRx) {
m_TXkHz=m_fQSO;
m_TXfreq=floor(m_TXfreq) + 0.001*m_TXkHz;
m_TxDF=m_DF;
DrawOverlay(); //Redraw scales and ticks
update(); //trigger a new paintEvent}
}
}

View File

@ -56,7 +56,7 @@ public:
void setBinsPerPixel(int n);
int binsPerPixel();
void setFQSO(int n, bool bf);
// void setTxFreq(int)
void setTxFreq(double dfreq);
void setFcal(int n);
void setNkhz(int n);
void DrawOverlay();
@ -68,6 +68,7 @@ public:
void setMode65(int n);
void set2Dspec(bool b);
double fGreen();
void setLockTxRx(bool b);
signals:
void freezeDecode0(int n);
@ -99,8 +100,10 @@ private:
bool m_paintEventBusy;
bool m_2Dspec;
bool m_paintAllZoom;
bool m_bLockTxRx;
double m_CenterFreq;
double m_fGreen;
double m_TXfreq;
qint64 m_StartFreq;
qint64 m_ZoomStartFreq;
qint64 m_FreqOffset;
@ -119,6 +122,8 @@ private:
qint32 m_mode65;
qint32 m_i0;
qint32 m_xClick;
qint32 m_TXkHz;
qint32 m_TxDF;
private slots:
void mousePressEvent(QMouseEvent *event);

View File

@ -40,7 +40,10 @@ WideGraph::WideGraph(QWidget *parent) :
m_bForceCenterFreq=settings.value("ForceCenterFreqBool",false).toBool();
m_dForceCenterFreq=settings.value("ForceCenterFreqMHz",144.125).toDouble();
ui->cbFcenter->setChecked(m_bForceCenterFreq);
ui->cbLockTxRx->setChecked(m_bLockTxRx);
ui->fCenterLineEdit->setText(QString::number(m_dForceCenterFreq));
m_bLockTxRx=settings.value("LockTxRx",false).toBool();
ui->cbLockTxRx->setChecked(m_bLockTxRx);
settings.endGroup();
}
@ -67,6 +70,7 @@ void WideGraph::saveSettings()
settings.setValue("FreqOffset",ui->widePlot->freqOffset());
settings.setValue("ForceCenterFreqBool",m_bForceCenterFreq);
settings.setValue("ForceCenterFreqMHz",m_dForceCenterFreq);
settings.setValue("LockTxRx",m_bLockTxRx);
settings.endGroup();
}
@ -321,3 +325,9 @@ void WideGraph::setPeriod(int n)
{
m_TRperiod=n;
}
void WideGraph::on_cbLockTxRx_stateChanged(int n)
{
m_bLockTxRx = (n!=0);
ui->widePlot->setLockTxRx(m_bLockTxRx);
}

View File

@ -15,6 +15,7 @@ public:
~WideGraph();
bool m_bForceCenterFreq;
bool m_bLockTxRx;
qint32 m_mult570;
qint32 m_mult570Tx;
double m_dForceCenterFreq;
@ -63,6 +64,8 @@ private slots:
void on_pbSetRxHardware_clicked();
void on_cbSpec2d_toggled(bool checked);
void on_cbLockTxRx_stateChanged(int arg1);
private:
qint32 m_waterfallAvg;
qint32 m_fCal;

View File

@ -347,6 +347,29 @@
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_9">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Preferred</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QCheckBox" name="cbLockTxRx">
<property name="text">
<string>Lock Tx=Rx Freq</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_5">
<property name="orientation">