mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2024-11-23 12:48:40 -05:00
TxFreq tracks fQSO unless CTRL is held down.
Red marker for TxFreq. Max Tol = 500. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@2763 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
parent
35fe0a92c2
commit
7a43d28e68
@ -164,6 +164,7 @@ MainWindow::MainWindow(QWidget *parent) :
|
|||||||
border-color: black; min-width: 5em; padding: 3px;}";
|
border-color: black; min-width: 5em; padding: 3px;}";
|
||||||
genStdMsgs("-30");
|
genStdMsgs("-30");
|
||||||
on_actionWide_Waterfall_triggered(); //###
|
on_actionWide_Waterfall_triggered(); //###
|
||||||
|
g_pWideGraph->setTxFreq(m_txFreq);
|
||||||
if(m_mode=="JT9-1") on_actionJT9_1_triggered();
|
if(m_mode=="JT9-1") on_actionJT9_1_triggered();
|
||||||
if(m_mode=="JT9-2") on_actionJT9_2_triggered();
|
if(m_mode=="JT9-2") on_actionJT9_2_triggered();
|
||||||
if(m_mode=="JT9-5") on_actionJT9_5_triggered();
|
if(m_mode=="JT9-5") on_actionJT9_5_triggered();
|
||||||
@ -189,7 +190,7 @@ MainWindow::MainWindow(QWidget *parent) :
|
|||||||
soundInThread.setMonitoring(m_monitoring);
|
soundInThread.setMonitoring(m_monitoring);
|
||||||
m_diskData=false;
|
m_diskData=false;
|
||||||
g_pWideGraph->setTol(m_tol);
|
g_pWideGraph->setTol(m_tol);
|
||||||
static int ntol[] = {1,2,5,10,20,50,100,200,500,1000};
|
static int ntol[] = {1,2,5,10,20,50,100,200,500};
|
||||||
for (int i=0; i<10; i++) {
|
for (int i=0; i<10; i++) {
|
||||||
if(ntol[i]==m_tol) ui->tolSpinBox->setValue(i);
|
if(ntol[i]==m_tol) ui->tolSpinBox->setValue(i);
|
||||||
}
|
}
|
||||||
@ -508,6 +509,7 @@ void MainWindow::on_stopTxButton_clicked() //Stop Tx
|
|||||||
|
|
||||||
void MainWindow::keyPressEvent( QKeyEvent *e ) //keyPressEvent
|
void MainWindow::keyPressEvent( QKeyEvent *e ) //keyPressEvent
|
||||||
{
|
{
|
||||||
|
int n;
|
||||||
switch(e->key())
|
switch(e->key())
|
||||||
{
|
{
|
||||||
case Qt::Key_F3:
|
case Qt::Key_F3:
|
||||||
@ -526,20 +528,14 @@ void MainWindow::keyPressEvent( QKeyEvent *e ) //keyPressEvent
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case Qt::Key_F11:
|
case Qt::Key_F11:
|
||||||
if(e->modifiers() & Qt::ShiftModifier) {
|
n=11;
|
||||||
} else {
|
if(e->modifiers() & Qt::ControlModifier) n+=100;
|
||||||
int n=g_pWideGraph->QSOfreq();
|
bumpFqso(n);
|
||||||
n--;
|
|
||||||
g_pWideGraph->setQSOfreq(n);
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case Qt::Key_F12:
|
case Qt::Key_F12:
|
||||||
if(e->modifiers() & Qt::ShiftModifier) {
|
n=12;
|
||||||
} else {
|
if(e->modifiers() & Qt::ControlModifier) n+=100;
|
||||||
int n=g_pWideGraph->QSOfreq();
|
bumpFqso(n);
|
||||||
n++;
|
|
||||||
g_pWideGraph->setQSOfreq(n);
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case Qt::Key_G:
|
case Qt::Key_G:
|
||||||
if(e->modifiers() & Qt::AltModifier) {
|
if(e->modifiers() & Qt::AltModifier) {
|
||||||
@ -555,6 +551,22 @@ void MainWindow::keyPressEvent( QKeyEvent *e ) //keyPressEvent
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MainWindow::bumpFqso(int n) //bumpFqso()
|
||||||
|
{
|
||||||
|
if((n%100)==11) {
|
||||||
|
int i=g_pWideGraph->QSOfreq();
|
||||||
|
i--;
|
||||||
|
g_pWideGraph->setQSOfreq(i);
|
||||||
|
if(n<100) g_pWideGraph->setTxFreq(i);
|
||||||
|
}
|
||||||
|
if((n%100)==12) {
|
||||||
|
int i=g_pWideGraph->QSOfreq();
|
||||||
|
i++;
|
||||||
|
g_pWideGraph->setQSOfreq(i);
|
||||||
|
if(n<100) g_pWideGraph->setTxFreq(i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool MainWindow::eventFilter(QObject *object, QEvent *event) //eventFilter()
|
bool MainWindow::eventFilter(QObject *object, QEvent *event) //eventFilter()
|
||||||
{
|
{
|
||||||
if (event->type() == QEvent::KeyPress) {
|
if (event->type() == QEvent::KeyPress) {
|
||||||
@ -601,7 +613,7 @@ void MainWindow::createStatusBar() //createStatusBar
|
|||||||
|
|
||||||
void MainWindow::on_tolSpinBox_valueChanged(int i) //tolSpinBox
|
void MainWindow::on_tolSpinBox_valueChanged(int i) //tolSpinBox
|
||||||
{
|
{
|
||||||
static int ntol[] = {1,2,5,10,20,50,100,200,500,1000};
|
static int ntol[] = {1,2,5,10,20,50,100,200,500};
|
||||||
m_tol=ntol[i];
|
m_tol=ntol[i];
|
||||||
g_pWideGraph->setTol(m_tol);
|
g_pWideGraph->setTol(m_tol);
|
||||||
ui->labTol1->setText(QString::number(ntol[i]));
|
ui->labTol1->setText(QString::number(ntol[i]));
|
||||||
@ -668,6 +680,8 @@ void MainWindow::on_actionWide_Waterfall_triggered() //Display Waterfalls
|
|||||||
g_pWideGraph->setWindowFlags(flags);
|
g_pWideGraph->setWindowFlags(flags);
|
||||||
connect(g_pWideGraph, SIGNAL(freezeDecode2(int)),this,
|
connect(g_pWideGraph, SIGNAL(freezeDecode2(int)),this,
|
||||||
SLOT(freezeDecode(int)));
|
SLOT(freezeDecode(int)));
|
||||||
|
connect(g_pWideGraph, SIGNAL(f11f12(int)),this,
|
||||||
|
SLOT(bumpFqso(int)));
|
||||||
}
|
}
|
||||||
g_pWideGraph->show();
|
g_pWideGraph->show();
|
||||||
}
|
}
|
||||||
@ -852,7 +866,7 @@ void MainWindow::on_DecodeButton_clicked() //Decode request
|
|||||||
|
|
||||||
void MainWindow::freezeDecode(int n) //freezeDecode()
|
void MainWindow::freezeDecode(int n) //freezeDecode()
|
||||||
{
|
{
|
||||||
static int ntol[] = {1,2,5,10,20,50,100,200,500,1000};
|
static int ntol[] = {1,2,5,10,20,50,100,200,500};
|
||||||
if(!m_decoderBusy) {
|
if(!m_decoderBusy) {
|
||||||
jt9com_.newdat=0;
|
jt9com_.newdat=0;
|
||||||
jt9com_.nagain=1;
|
jt9com_.nagain=1;
|
||||||
@ -1690,6 +1704,7 @@ void MainWindow::on_NBslider_valueChanged(int n)
|
|||||||
void MainWindow::on_TxFreqSpinBox_valueChanged(int n)
|
void MainWindow::on_TxFreqSpinBox_valueChanged(int n)
|
||||||
{
|
{
|
||||||
m_txFreq=n;
|
m_txFreq=n;
|
||||||
|
if(g_pWideGraph!=NULL) g_pWideGraph->setTxFreq(n);
|
||||||
soundOutThread.setTxFreq(n);
|
soundOutThread.setTxFreq(n);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -108,6 +108,7 @@ private slots:
|
|||||||
void on_actionMediumDecode_triggered();
|
void on_actionMediumDecode_triggered();
|
||||||
void on_actionDeepestDecode_triggered();
|
void on_actionDeepestDecode_triggered();
|
||||||
void on_inGain_valueChanged(int n);
|
void on_inGain_valueChanged(int n);
|
||||||
|
void bumpFqso(int n);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::MainWindow *ui;
|
Ui::MainWindow *ui;
|
||||||
|
@ -349,7 +349,7 @@ p, li { white-space: pre-wrap; }
|
|||||||
<string>SetMsgs</string>
|
<string>SetMsgs</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QWidget" name="">
|
<widget class="QWidget" name="layoutWidget">
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>8</x>
|
<x>8</x>
|
||||||
@ -710,7 +710,7 @@ p, li { white-space: pre-wrap; }
|
|||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="maximum">
|
<property name="maximum">
|
||||||
<number>9</number>
|
<number>8</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="value">
|
<property name="value">
|
||||||
<number>5</number>
|
<number>5</number>
|
||||||
|
23
plotter.cpp
23
plotter.cpp
@ -33,6 +33,7 @@ CPlotter::CPlotter(QWidget *parent) : //CPlotter Constructor
|
|||||||
m_nsps=6912;
|
m_nsps=6912;
|
||||||
m_dBStepSize=10;
|
m_dBStepSize=10;
|
||||||
m_Percent2DScreen = 30; //percent of screen used for 2D display
|
m_Percent2DScreen = 30; //percent of screen used for 2D display
|
||||||
|
m_txFreq=0;
|
||||||
}
|
}
|
||||||
|
|
||||||
CPlotter::~CPlotter() { } // Destructor
|
CPlotter::~CPlotter() { } // Destructor
|
||||||
@ -136,8 +137,6 @@ void CPlotter::draw(float swide[], float red[], int i0) //draw()
|
|||||||
if(!strong0) painter2D.setPen(Qt::green);
|
if(!strong0) painter2D.setPen(Qt::green);
|
||||||
}
|
}
|
||||||
LineBuf[j].setX(i);
|
LineBuf[j].setX(i);
|
||||||
// y2 = m_h*float(i)/m_w;
|
|
||||||
// if(m_line==10) qDebug() << i << FreqfromX(i) << m_h << y2 << m_h-y2;
|
|
||||||
LineBuf[j].setY(m_h-(y2+0.8*m_h));
|
LineBuf[j].setY(m_h-(y2+0.8*m_h));
|
||||||
j++;
|
j++;
|
||||||
}
|
}
|
||||||
@ -285,13 +284,20 @@ void CPlotter::DrawOverlay() //DrawOverlay()
|
|||||||
|
|
||||||
QPen pen0(Qt::green, 3); //Mark QSO Freq with green tick
|
QPen pen0(Qt::green, 3); //Mark QSO Freq with green tick
|
||||||
painter0.setPen(pen0);
|
painter0.setPen(pen0);
|
||||||
x = m_xClick;
|
x=XfromFreq(m_fQSO);
|
||||||
painter0.drawLine(x,15,x,30);
|
painter0.drawLine(x,17,x,30);
|
||||||
int x1=x - m_tol/df;
|
int x1=x - m_tol/df;
|
||||||
int x2=x + m_tol/df;
|
int x2=x + m_tol/df;
|
||||||
pen0.setWidth(6);
|
pen0.setWidth(6);
|
||||||
painter0.drawLine(x1,28,x2,28);
|
painter0.drawLine(x1,28,x2,28);
|
||||||
|
|
||||||
|
QPen pen1(Qt::red, 3); //Mark TxFreq with red tick
|
||||||
|
painter0.setPen(pen1);
|
||||||
|
x = XfromFreq(m_txFreq);
|
||||||
|
painter0.drawLine(x,0,x,13);
|
||||||
|
painter0.drawLine(x,13,x-2,11);
|
||||||
|
painter0.drawLine(x,13,x+2,11);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
df = 12000.0/m_nsps;
|
df = 12000.0/m_nsps;
|
||||||
int nlabs=df*w/m_freqPerDiv + 1.0;
|
int nlabs=df*w/m_freqPerDiv + 1.0;
|
||||||
@ -421,6 +427,8 @@ void CPlotter::mousePressEvent(QMouseEvent *event) //mousePressEvent
|
|||||||
{
|
{
|
||||||
int x=event->x();
|
int x=event->x();
|
||||||
setFQSO(x,false); // Wideband waterfall
|
setFQSO(x,false); // Wideband waterfall
|
||||||
|
bool ctrl = (event->modifiers() & 0x4000000);
|
||||||
|
if(!ctrl) setTxFreq(m_fQSO);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CPlotter::mouseDoubleClickEvent(QMouseEvent *event) //mouse2click
|
void CPlotter::mouseDoubleClickEvent(QMouseEvent *event) //mouse2click
|
||||||
@ -560,3 +568,10 @@ void CPlotter::setNsps(int ntrperiod, int nsps)
|
|||||||
DrawOverlay(); //Redraw scales and ticks
|
DrawOverlay(); //Redraw scales and ticks
|
||||||
update(); //trigger a new paintEvent}
|
update(); //trigger a new paintEvent}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CPlotter::setTxFreq(int n) //setTol()
|
||||||
|
{
|
||||||
|
m_txFreq=n;
|
||||||
|
DrawOverlay();
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
@ -62,6 +62,7 @@ public:
|
|||||||
void setPalette(QString palette);
|
void setPalette(QString palette);
|
||||||
void setFsample(int n);
|
void setFsample(int n);
|
||||||
void setNsps(int ntrperiod, int nsps);
|
void setNsps(int ntrperiod, int nsps);
|
||||||
|
void setTxFreq(int n);
|
||||||
double fGreen();
|
double fGreen();
|
||||||
void SetPercent2DScreen(int percent){m_Percent2DScreen=percent;}
|
void SetPercent2DScreen(int percent){m_Percent2DScreen=percent;}
|
||||||
|
|
||||||
@ -115,6 +116,7 @@ private:
|
|||||||
qint32 m_h2;
|
qint32 m_h2;
|
||||||
qint32 m_tol;
|
qint32 m_tol;
|
||||||
qint32 m_TRperiod;
|
qint32 m_TRperiod;
|
||||||
|
qint32 m_txFreq;
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void mousePressEvent(QMouseEvent *event);
|
void mousePressEvent(QMouseEvent *event);
|
||||||
|
@ -156,11 +156,16 @@ void WideGraph::keyPressEvent(QKeyEvent *e)
|
|||||||
{
|
{
|
||||||
switch(e->key())
|
switch(e->key())
|
||||||
{
|
{
|
||||||
|
int n;
|
||||||
case Qt::Key_F11:
|
case Qt::Key_F11:
|
||||||
emit f11f12(11);
|
n=11;
|
||||||
|
if(e->modifiers() & Qt::ControlModifier) n+=100;
|
||||||
|
emit f11f12(n);
|
||||||
break;
|
break;
|
||||||
case Qt::Key_F12:
|
case Qt::Key_F12:
|
||||||
emit f11f12(12);
|
n=12;
|
||||||
|
if(e->modifiers() & Qt::ControlModifier) n+=100;
|
||||||
|
emit f11f12(n);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
e->ignore();
|
e->ignore();
|
||||||
@ -268,3 +273,8 @@ void WideGraph::on_rbJT9Sync_clicked()
|
|||||||
ui->widePlot->m_bCumulative=false;
|
ui->widePlot->m_bCumulative=false;
|
||||||
ui->widePlot->m_bJT9Sync=true;
|
ui->widePlot->m_bJT9Sync=true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void WideGraph::setTxFreq(int n)
|
||||||
|
{
|
||||||
|
ui->widePlot->setTxFreq(n);
|
||||||
|
}
|
||||||
|
@ -30,6 +30,7 @@ public:
|
|||||||
void setPalette(QString palette);
|
void setPalette(QString palette);
|
||||||
void setFsample(int n);
|
void setFsample(int n);
|
||||||
void setPeriod(int ntrperiod, int nsps);
|
void setPeriod(int ntrperiod, int nsps);
|
||||||
|
void setTxFreq(int n);
|
||||||
double fGreen();
|
double fGreen();
|
||||||
|
|
||||||
qint32 m_qsoFreq;
|
qint32 m_qsoFreq;
|
||||||
|
Loading…
Reference in New Issue
Block a user