Offer cumulative as well as current 2-d plot.

git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@2656 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
Joe Taylor 2012-10-11 00:51:16 +00:00
parent a0759bf0ff
commit 47b8c44521
6 changed files with 56 additions and 1 deletions

View File

@ -1,4 +1,4 @@
//---------------------------------------------------------------- MainWindow
//----------------------------------------------------------------- MainWindow
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include "devsetup.h"

View File

@ -125,6 +125,7 @@ void CPlotter::draw(float swide[], int i0) //draw()
painter1.setPen(m_ColorTbl[y1]);
painter1.drawPoint(i,0);
int y2 = 0.7*gain*(y + 54 - m_plotZero);
if(!m_bCurrent) y2=10.0*jt9com_.savg[i];
if (y2<0) y2=0;
if (y2>254) y2=254;
if (swide[i]>1.e29) y2=255;

View File

@ -26,6 +26,7 @@ public:
QSize minimumSizeHint() const;
QSize sizeHint() const;
QColor m_ColorTbl[256];
bool m_bCurrent;
int m_plotZero;
int m_plotGain;
float m_fSpan;

View File

@ -1,5 +1,6 @@
#include "widegraph.h"
#include "ui_widegraph.h"
#include "commons.h"
#define NSMAX 22000
@ -14,6 +15,7 @@ WideGraph::WideGraph(QWidget *parent) :
this->setMaximumWidth(2048);
this->setMaximumHeight(880);
ui->widePlot->setMaximumHeight(800);
ui->widePlot->m_bCurrent=false;
connect(ui->widePlot, SIGNAL(freezeDecode1(int)),this,
SLOT(wideFreezeDecode(int)));
@ -38,6 +40,9 @@ WideGraph::WideGraph(QWidget *parent) :
ui->waterfallAvgSpinBox->setValue(m_waterfallAvg);
m_dialFreq=settings.value("DialFreqMHz",473.000).toDouble();
ui->fDialLineEdit->setText(QString::number(m_dialFreq));
ui->widePlot->m_bCurrent=settings.value("Current",true).toBool();
ui->rbCurrent->setChecked(ui->widePlot->m_bCurrent);
ui->rbCumulative->setChecked(!ui->widePlot->m_bCurrent);
settings.endGroup();
}
@ -62,6 +67,7 @@ void WideGraph::saveSettings()
settings.setValue("FreqSpan",ui->freqSpanSpinBox->value());
settings.setValue("WaterfallAvg",ui->waterfallAvgSpinBox->value());
settings.setValue("DialFreqMHz",m_dialFreq);
settings.setValue("Current",ui->widePlot->m_bCurrent);
settings.endGroup();
}
@ -256,3 +262,13 @@ void WideGraph::setPeriod(int ntrperiod, int nsps)
m_nsps=nsps;
ui->widePlot->setNsps(nsps);
}
void WideGraph::on_rbCurrent_toggled(bool checked)
{
ui->widePlot->m_bCurrent=checked;
}
void WideGraph::on_rbCumulative_toggled(bool checked)
{
ui->widePlot->m_bCurrent=!checked;
}

View File

@ -54,6 +54,10 @@ private slots:
void on_autoZeroPushButton_clicked();
void on_fDialLineEdit_editingFinished();
void on_rbCurrent_toggled(bool checked);
void on_rbCumulative_toggled(bool checked);
private:
qint32 m_waterfallAvg;
qint32 m_fCal;

View File

@ -258,6 +258,39 @@
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_3">
<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="QRadioButton" name="rbCurrent">
<property name="text">
<string>Current</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="rbCumulative">
<property name="text">
<string>Cumulative</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_5">
<property name="orientation">