diff --git a/fastgraph.cpp b/fastgraph.cpp index aa086cb5d..299a20392 100644 --- a/fastgraph.cpp +++ b/fastgraph.cpp @@ -83,6 +83,12 @@ void FastGraph::on_greenZeroSlider_valueChanged(int value) ui->fastPlot->draw(); } +void FastGraph::setTRperiod(int n) +{ + m_TRperiod=n; + ui->fastPlot->setTRperiod(m_TRperiod); +} + void FastGraph::on_pbAutoLevel_clicked() { float sum=0.0; diff --git a/fastgraph.h b/fastgraph.h index 356011462..acec826ba 100644 --- a/fastgraph.h +++ b/fastgraph.h @@ -23,6 +23,7 @@ public: void plotSpec(); void saveSettings(); + void setTRperiod(int n); signals: void fastPick(int x0, int x1, int y); @@ -36,6 +37,7 @@ private slots: private: QSettings * m_settings; float m_ave; + qint32 m_TRperiod; QScopedPointer ui; }; diff --git a/fastplot.cpp b/fastplot.cpp index c9934f9f2..b2c0a118d 100644 --- a/fastplot.cpp +++ b/fastplot.cpp @@ -129,6 +129,12 @@ void FPlotter::setGreenZero(int n) m_bPaint2=true; } +void FPlotter::setTRperiod(int n) +{ + m_TRperiod=n; +} + + void FPlotter::draw() //draw() { QPainter painter1(&m_HorizPixmap); @@ -214,7 +220,10 @@ void FPlotter::mousePressEvent(QMouseEvent *event) //mousePressEvent QPainter painter(&m_HorizPixmap); int x0=x-n*m_pixPerSecond; int x1=x+n*m_pixPerSecond; + int xmax=m_TRperiod*m_pixPerSecond; if(x0 < 0) x0=0; + qDebug() << "a" << xmax; + if(x1 > xmax) x1=xmax; if(x1 > 702) x1=702; Q_EMIT fastPick (x0,x1,y); int y0=64; diff --git a/fastplot.h b/fastplot.h index 4ae8655f4..988015b01 100644 --- a/fastplot.h +++ b/fastplot.h @@ -32,6 +32,7 @@ public: void setPlotZero(int plotZero); void setPlotGain(int plotGain); void setGreenZero(int n); + void setTRperiod(int n); void drawScale(); signals: @@ -65,6 +66,7 @@ private: qint32 m_h2; QPixmap m_HorizPixmap; qint32 m_jh0; + qint32 m_TRperiod; bool m_bPaint2; }; diff --git a/mainwindow.cpp b/mainwindow.cpp index 2f818bc14..f868d2d74 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -3973,8 +3973,8 @@ void MainWindow::on_actionMSK144_triggered() ui->cbShMsgs->setVisible(true); ui->actionMSK144->setChecked(true); - ui->rptSpinBox->setMinimum(-3); - ui->rptSpinBox->setMaximum(16); + ui->rptSpinBox->setMinimum(-8); + ui->rptSpinBox->setMaximum(24); ui->rptSpinBox->setValue(0); ui->rptSpinBox->setSingleStep(1); ui->sbFtol->setMinimum(23); @@ -5161,6 +5161,7 @@ void MainWindow::on_sbTR_valueChanged(int index) m_modulator->setPeriod(m_TRperiod); // TODO - not thread safe m_detector->setPeriod(m_TRperiod); // TODO - not thread safe m_wideGraph->setPeriod(m_TRperiod,m_nsps); + m_fastGraph->setTRperiod(m_TRperiod); } void MainWindow::on_sbSubmode_valueChanged(int n)