From 816d56056d5bfc408b1f53bc3aa9c426ad41e7c8 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Tue, 9 Jun 2015 14:42:53 +0000 Subject: [PATCH] Further progress for Echo mode. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@5561 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- echoplot.cpp | 9 ++++++--- echoplot.h | 1 - mainwindow.cpp | 4 ++++ plotter.cpp | 30 +++++++++++++++--------------- widegraph.cpp | 1 + 5 files changed, 26 insertions(+), 19 deletions(-) diff --git a/echoplot.cpp b/echoplot.cpp index c0e314422..3a9a472be 100644 --- a/echoplot.cpp +++ b/echoplot.cpp @@ -30,7 +30,6 @@ EPlotter::EPlotter(QWidget *parent) : //EPlotter Constructor m_TxFreq = 1500; m_line = 0; m_dBStepSize=10; - m_Percent2DScreen = 89; //percent of screen used for 2D display } EPlotter::~EPlotter() { } // Destructor @@ -52,8 +51,10 @@ void EPlotter::resizeEvent(QResizeEvent* ) //resizeEvent() m_Size = size(); m_w = m_Size.width(); m_h = m_Size.height(); - m_h1 = (100-m_Percent2DScreen)*(m_Size.height())/100; - m_h2 = (m_Percent2DScreen)*(m_Size.height())/100; + m_h1=30; + m_h2=m_h-m_h1; + + qDebug() << m_h << m_h1 << m_h2; m_2DPixmap = QPixmap(m_Size.width(), m_h2); m_2DPixmap.fill(Qt::black); @@ -288,5 +289,7 @@ int EPlotter::getSmooth() //getSmooth() { return m_smooth; } + int EPlotter::plotWidth(){return m_2DPixmap.width();} + void EPlotter::UpdateOverlay() {DrawOverlay();} diff --git a/echoplot.h b/echoplot.h index 27c51779e..5ed6d7411 100644 --- a/echoplot.h +++ b/echoplot.h @@ -75,7 +75,6 @@ private: qint32 m_hdivs; qint32 m_line; qint32 m_freqPerDiv; - qint32 m_Percent2DScreen; qint32 m_h; qint32 m_h1; qint32 m_h2; diff --git a/mainwindow.cpp b/mainwindow.cpp index dc785e30b..91e8de2a6 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -3230,6 +3230,10 @@ void MainWindow::on_actionEcho_triggered() m_toneSpacing=1.0; switch_mode(Modes::Echo); m_modeTx="Echo"; + m_wideGraph->setMode(m_mode); + m_wideGraph->setModeTx(m_modeTx); + ui->TxFreqSpinBox->setValue(1500); + ui->TxFreqSpinBox->setEnabled (false); statusChanged(); if(!m_echoGraph->isVisible()) m_echoGraph->show(); mode_label->setStyleSheet("QLabel{background-color: #7cfc00}"); diff --git a/plotter.cpp b/plotter.cpp index 2e4ae2b18..bc0208f59 100644 --- a/plotter.cpp +++ b/plotter.cpp @@ -331,23 +331,23 @@ void CPlotter::DrawOverlay() //DrawOverlay() } - if(m_mode != "JT4") { - QPen pen0(Qt::green, 3); //Mark Rx Freq with green - painter0.setPen(pen0); - if(m_mode=="WSPR-2") { //### WSPR-15 code needed here, too ### - x1=XfromFreq(1400); - x2=XfromFreq(1600); - painter0.drawLine(x1,29,x2,29); - } else { - x1=XfromFreq(m_rxFreq); - x2=XfromFreq(m_rxFreq+bw); - painter0.drawLine(x1,24,x1,30); - painter0.drawLine(x1,28,x2,28); - painter0.drawLine(x2,24,x2,30); - } + QPen pen0(Qt::green, 3); //Mark Rx Freq with green + painter0.setPen(pen0); + if(m_mode=="WSPR-2") { //### WSPR-15 code needed here, too ### + x1=XfromFreq(1400); + x2=XfromFreq(1600); + painter0.drawLine(x1,29,x2,29); + } + if(m_mode=="JT9" or m_mode=="JT65" or m_mode=="JT9+JT65") { + x1=XfromFreq(m_rxFreq); + x2=XfromFreq(m_rxFreq+bw); + painter0.drawLine(x1,24,x1,30); + painter0.drawLine(x1,28,x2,28); + painter0.drawLine(x2,24,x2,30); } - if(m_mode != "JT4") { + if(m_mode=="JT9" or m_mode=="JT65" or m_mode=="JT9+JT65" or + m_mode.mid(0,4)=="WSPR") { QPen pen1(Qt::red, 3); //Mark Tx freq with red painter0.setPen(pen1); x1=XfromFreq(m_txFreq); diff --git a/widegraph.cpp b/widegraph.cpp index a92cffd05..7bb93374e 100644 --- a/widegraph.cpp +++ b/widegraph.cpp @@ -266,6 +266,7 @@ void WideGraph::setMode(QString mode) //setMode ui->widePlot->setMode(mode); ui->widePlot->DrawOverlay(); ui->widePlot->update(); + qDebug() << "WideGraph::setMode" << m_mode; } void WideGraph::setSubMode(int n) //setSubMode