mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2024-11-27 06:38:44 -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;}";
|
||||
genStdMsgs("-30");
|
||||
on_actionWide_Waterfall_triggered(); //###
|
||||
g_pWideGraph->setTxFreq(m_txFreq);
|
||||
if(m_mode=="JT9-1") on_actionJT9_1_triggered();
|
||||
if(m_mode=="JT9-2") on_actionJT9_2_triggered();
|
||||
if(m_mode=="JT9-5") on_actionJT9_5_triggered();
|
||||
@ -189,7 +190,7 @@ MainWindow::MainWindow(QWidget *parent) :
|
||||
soundInThread.setMonitoring(m_monitoring);
|
||||
m_diskData=false;
|
||||
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++) {
|
||||
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
|
||||
{
|
||||
int n;
|
||||
switch(e->key())
|
||||
{
|
||||
case Qt::Key_F3:
|
||||
@ -526,20 +528,14 @@ void MainWindow::keyPressEvent( QKeyEvent *e ) //keyPressEvent
|
||||
}
|
||||
break;
|
||||
case Qt::Key_F11:
|
||||
if(e->modifiers() & Qt::ShiftModifier) {
|
||||
} else {
|
||||
int n=g_pWideGraph->QSOfreq();
|
||||
n--;
|
||||
g_pWideGraph->setQSOfreq(n);
|
||||
}
|
||||
n=11;
|
||||
if(e->modifiers() & Qt::ControlModifier) n+=100;
|
||||
bumpFqso(n);
|
||||
break;
|
||||
case Qt::Key_F12:
|
||||
if(e->modifiers() & Qt::ShiftModifier) {
|
||||
} else {
|
||||
int n=g_pWideGraph->QSOfreq();
|
||||
n++;
|
||||
g_pWideGraph->setQSOfreq(n);
|
||||
}
|
||||
n=12;
|
||||
if(e->modifiers() & Qt::ControlModifier) n+=100;
|
||||
bumpFqso(n);
|
||||
break;
|
||||
case Qt::Key_G:
|
||||
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()
|
||||
{
|
||||
if (event->type() == QEvent::KeyPress) {
|
||||
@ -601,7 +613,7 @@ void MainWindow::createStatusBar() //createStatusBar
|
||||
|
||||
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];
|
||||
g_pWideGraph->setTol(m_tol);
|
||||
ui->labTol1->setText(QString::number(ntol[i]));
|
||||
@ -668,6 +680,8 @@ void MainWindow::on_actionWide_Waterfall_triggered() //Display Waterfalls
|
||||
g_pWideGraph->setWindowFlags(flags);
|
||||
connect(g_pWideGraph, SIGNAL(freezeDecode2(int)),this,
|
||||
SLOT(freezeDecode(int)));
|
||||
connect(g_pWideGraph, SIGNAL(f11f12(int)),this,
|
||||
SLOT(bumpFqso(int)));
|
||||
}
|
||||
g_pWideGraph->show();
|
||||
}
|
||||
@ -852,7 +866,7 @@ void MainWindow::on_DecodeButton_clicked() //Decode request
|
||||
|
||||
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) {
|
||||
jt9com_.newdat=0;
|
||||
jt9com_.nagain=1;
|
||||
@ -1690,6 +1704,7 @@ void MainWindow::on_NBslider_valueChanged(int n)
|
||||
void MainWindow::on_TxFreqSpinBox_valueChanged(int n)
|
||||
{
|
||||
m_txFreq=n;
|
||||
if(g_pWideGraph!=NULL) g_pWideGraph->setTxFreq(n);
|
||||
soundOutThread.setTxFreq(n);
|
||||
}
|
||||
|
||||
|
@ -108,6 +108,7 @@ private slots:
|
||||
void on_actionMediumDecode_triggered();
|
||||
void on_actionDeepestDecode_triggered();
|
||||
void on_inGain_valueChanged(int n);
|
||||
void bumpFqso(int n);
|
||||
|
||||
private:
|
||||
Ui::MainWindow *ui;
|
||||
|
@ -349,7 +349,7 @@ p, li { white-space: pre-wrap; }
|
||||
<string>SetMsgs</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QWidget" name="">
|
||||
<widget class="QWidget" name="layoutWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>8</x>
|
||||
@ -710,7 +710,7 @@ p, li { white-space: pre-wrap; }
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>9</number>
|
||||
<number>8</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>5</number>
|
||||
|
23
plotter.cpp
23
plotter.cpp
@ -33,6 +33,7 @@ CPlotter::CPlotter(QWidget *parent) : //CPlotter Constructor
|
||||
m_nsps=6912;
|
||||
m_dBStepSize=10;
|
||||
m_Percent2DScreen = 30; //percent of screen used for 2D display
|
||||
m_txFreq=0;
|
||||
}
|
||||
|
||||
CPlotter::~CPlotter() { } // Destructor
|
||||
@ -136,8 +137,6 @@ void CPlotter::draw(float swide[], float red[], int i0) //draw()
|
||||
if(!strong0) painter2D.setPen(Qt::green);
|
||||
}
|
||||
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));
|
||||
j++;
|
||||
}
|
||||
@ -285,13 +284,20 @@ void CPlotter::DrawOverlay() //DrawOverlay()
|
||||
|
||||
QPen pen0(Qt::green, 3); //Mark QSO Freq with green tick
|
||||
painter0.setPen(pen0);
|
||||
x = m_xClick;
|
||||
painter0.drawLine(x,15,x,30);
|
||||
x=XfromFreq(m_fQSO);
|
||||
painter0.drawLine(x,17,x,30);
|
||||
int x1=x - m_tol/df;
|
||||
int x2=x + m_tol/df;
|
||||
pen0.setWidth(6);
|
||||
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;
|
||||
int nlabs=df*w/m_freqPerDiv + 1.0;
|
||||
@ -421,6 +427,8 @@ void CPlotter::mousePressEvent(QMouseEvent *event) //mousePressEvent
|
||||
{
|
||||
int x=event->x();
|
||||
setFQSO(x,false); // Wideband waterfall
|
||||
bool ctrl = (event->modifiers() & 0x4000000);
|
||||
if(!ctrl) setTxFreq(m_fQSO);
|
||||
}
|
||||
|
||||
void CPlotter::mouseDoubleClickEvent(QMouseEvent *event) //mouse2click
|
||||
@ -560,3 +568,10 @@ void CPlotter::setNsps(int ntrperiod, int nsps)
|
||||
DrawOverlay(); //Redraw scales and ticks
|
||||
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 setFsample(int n);
|
||||
void setNsps(int ntrperiod, int nsps);
|
||||
void setTxFreq(int n);
|
||||
double fGreen();
|
||||
void SetPercent2DScreen(int percent){m_Percent2DScreen=percent;}
|
||||
|
||||
@ -115,6 +116,7 @@ private:
|
||||
qint32 m_h2;
|
||||
qint32 m_tol;
|
||||
qint32 m_TRperiod;
|
||||
qint32 m_txFreq;
|
||||
|
||||
private slots:
|
||||
void mousePressEvent(QMouseEvent *event);
|
||||
|
@ -156,11 +156,16 @@ void WideGraph::keyPressEvent(QKeyEvent *e)
|
||||
{
|
||||
switch(e->key())
|
||||
{
|
||||
int n;
|
||||
case Qt::Key_F11:
|
||||
emit f11f12(11);
|
||||
n=11;
|
||||
if(e->modifiers() & Qt::ControlModifier) n+=100;
|
||||
emit f11f12(n);
|
||||
break;
|
||||
case Qt::Key_F12:
|
||||
emit f11f12(12);
|
||||
n=12;
|
||||
if(e->modifiers() & Qt::ControlModifier) n+=100;
|
||||
emit f11f12(n);
|
||||
break;
|
||||
default:
|
||||
e->ignore();
|
||||
@ -268,3 +273,8 @@ void WideGraph::on_rbJT9Sync_clicked()
|
||||
ui->widePlot->m_bCumulative=false;
|
||||
ui->widePlot->m_bJT9Sync=true;
|
||||
}
|
||||
|
||||
void WideGraph::setTxFreq(int n)
|
||||
{
|
||||
ui->widePlot->setTxFreq(n);
|
||||
}
|
||||
|
@ -30,6 +30,7 @@ public:
|
||||
void setPalette(QString palette);
|
||||
void setFsample(int n);
|
||||
void setPeriod(int ntrperiod, int nsps);
|
||||
void setTxFreq(int n);
|
||||
double fGreen();
|
||||
|
||||
qint32 m_qsoFreq;
|
||||
|
Loading…
Reference in New Issue
Block a user