mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2025-06-02 06:42:25 -04:00
Add user option to set percentage of WideGraph height used for spectrum plot.
git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@6156 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
parent
ad11444c63
commit
55f23a396f
21
plotter.cpp
21
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_Percent2DScreen0 = 0;
|
||||||
m_txFreq=0;
|
m_txFreq=0;
|
||||||
m_fftBinWidth=1500.0/2048.0;
|
m_fftBinWidth=1500.0/2048.0;
|
||||||
m_bScaleOK=false;
|
m_bScaleOK=false;
|
||||||
@ -53,24 +54,26 @@ QSize CPlotter::sizeHint() const
|
|||||||
void CPlotter::resizeEvent(QResizeEvent* ) //resizeEvent()
|
void CPlotter::resizeEvent(QResizeEvent* ) //resizeEvent()
|
||||||
{
|
{
|
||||||
if(!size().isValid()) return;
|
if(!size().isValid()) return;
|
||||||
if( m_Size != size() or (m_bReference != m_bReference0)) {
|
if( m_Size != size() or (m_bReference != m_bReference0) or
|
||||||
|
m_Percent2DScreen != m_Percent2DScreen0) {
|
||||||
m_Size = size();
|
m_Size = size();
|
||||||
m_w = m_Size.width();
|
m_w = m_Size.width();
|
||||||
m_h = m_Size.height();
|
m_h = m_Size.height();
|
||||||
m_h2 = (m_Percent2DScreen)*(m_h)/100;
|
m_h2 = m_Percent2DScreen*m_h/100.0;
|
||||||
if(m_h2>100) m_h2=100;
|
if(m_h2>m_h-30) m_h2=m_h-30;
|
||||||
if(m_bReference) m_h2=m_h-30;
|
if(m_bReference) m_h2=m_h-30;
|
||||||
|
if(m_h2<1) m_h2=1;
|
||||||
m_h1=m_h-m_h2;
|
m_h1=m_h-m_h2;
|
||||||
m_2DPixmap = QPixmap(m_Size.width(), m_h2);
|
m_2DPixmap = QPixmap(m_Size.width(), m_h2);
|
||||||
m_2DPixmap.fill(Qt::black);
|
m_2DPixmap.fill(Qt::black);
|
||||||
m_WaterfallPixmap = QPixmap(m_Size.width(), m_h1);
|
m_WaterfallPixmap = QPixmap(m_Size.width(), m_h1);
|
||||||
m_OverlayPixmap = QPixmap(m_Size.width(), m_h2);
|
m_OverlayPixmap = QPixmap(m_Size.width(), m_h2);
|
||||||
m_OverlayPixmap.fill(Qt::black);
|
m_OverlayPixmap.fill(Qt::black);
|
||||||
|
|
||||||
m_WaterfallPixmap.fill(Qt::black);
|
m_WaterfallPixmap.fill(Qt::black);
|
||||||
m_2DPixmap.fill(Qt::black);
|
m_2DPixmap.fill(Qt::black);
|
||||||
m_ScalePixmap = QPixmap(m_w,30);
|
m_ScalePixmap = QPixmap(m_w,m_h2);
|
||||||
m_ScalePixmap.fill(Qt::white);
|
m_ScalePixmap.fill(Qt::white);
|
||||||
|
m_Percent2DScreen0 = m_Percent2DScreen;
|
||||||
}
|
}
|
||||||
DrawOverlay();
|
DrawOverlay();
|
||||||
}
|
}
|
||||||
@ -603,3 +606,11 @@ void CPlotter::setColours(QVector<QColor> const& cl)
|
|||||||
{
|
{
|
||||||
g_ColorTbl = cl;
|
g_ColorTbl = cl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CPlotter::SetPercent2DScreen(int percent)
|
||||||
|
{
|
||||||
|
m_Percent2DScreen=percent;
|
||||||
|
resizeEvent(NULL);
|
||||||
|
// DrawOverlay();
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
@ -62,7 +62,7 @@ public:
|
|||||||
void setMode(QString mode);
|
void setMode(QString mode);
|
||||||
void setSubMode(int n);
|
void setSubMode(int n);
|
||||||
void setModeTx(QString modeTx);
|
void setModeTx(QString modeTx);
|
||||||
void SetPercent2DScreen(int percent){m_Percent2DScreen=percent;}
|
void SetPercent2DScreen(int percent);
|
||||||
int Fmax();
|
int Fmax();
|
||||||
void setDialFreq(double d);
|
void setDialFreq(double d);
|
||||||
void setCurrent(bool b) {m_bCurrent = b;}
|
void setCurrent(bool b) {m_bCurrent = b;}
|
||||||
@ -147,6 +147,7 @@ private:
|
|||||||
qint32 m_freqPerDiv;
|
qint32 m_freqPerDiv;
|
||||||
qint32 m_nsps;
|
qint32 m_nsps;
|
||||||
qint32 m_Percent2DScreen;
|
qint32 m_Percent2DScreen;
|
||||||
|
qint32 m_Percent2DScreen0;
|
||||||
qint32 m_h;
|
qint32 m_h;
|
||||||
qint32 m_h1;
|
qint32 m_h1;
|
||||||
qint32 m_h2;
|
qint32 m_h2;
|
||||||
|
@ -55,6 +55,8 @@ WideGraph::WideGraph(QSettings * settings, QWidget *parent) :
|
|||||||
ui->bppSpinBox->setValue(n);
|
ui->bppSpinBox->setValue(n);
|
||||||
m_nsmo=m_settings->value("SmoothYellow",1).toInt();
|
m_nsmo=m_settings->value("SmoothYellow",1).toInt();
|
||||||
ui->smoSpinBox->setValue(m_nsmo);
|
ui->smoSpinBox->setValue(m_nsmo);
|
||||||
|
m_Percent2DScreen=m_settings->value("Percent2D",30).toInt();
|
||||||
|
ui->sbPercent2dPlot->setValue(m_Percent2DScreen);
|
||||||
m_waterfallAvg = m_settings->value("WaterfallAvg",5).toInt();
|
m_waterfallAvg = m_settings->value("WaterfallAvg",5).toInt();
|
||||||
ui->waterfallAvgSpinBox->setValue(m_waterfallAvg);
|
ui->waterfallAvgSpinBox->setValue(m_waterfallAvg);
|
||||||
ui->widePlot->setWaterfallAvg(m_waterfallAvg);
|
ui->widePlot->setWaterfallAvg(m_waterfallAvg);
|
||||||
@ -116,6 +118,7 @@ void WideGraph::saveSettings() //saveS
|
|||||||
m_settings->setValue ("PlotWidth", ui->widePlot->plotWidth ());
|
m_settings->setValue ("PlotWidth", ui->widePlot->plotWidth ());
|
||||||
m_settings->setValue ("BinsPerPixel", ui->bppSpinBox->value ());
|
m_settings->setValue ("BinsPerPixel", ui->bppSpinBox->value ());
|
||||||
m_settings->setValue ("SmoothYellow", ui->smoSpinBox->value ());
|
m_settings->setValue ("SmoothYellow", ui->smoSpinBox->value ());
|
||||||
|
m_settings->setValue ("Percent2D",m_Percent2DScreen);
|
||||||
m_settings->setValue ("WaterfallAvg", ui->waterfallAvgSpinBox->value ());
|
m_settings->setValue ("WaterfallAvg", ui->waterfallAvgSpinBox->value ());
|
||||||
m_settings->setValue ("Current", ui->widePlot->current());
|
m_settings->setValue ("Current", ui->widePlot->current());
|
||||||
m_settings->setValue ("Cumulative", ui->widePlot->cumulative());
|
m_settings->setValue ("Cumulative", ui->widePlot->cumulative());
|
||||||
@ -294,13 +297,11 @@ void WideGraph::on_spec2dComboBox_currentIndexChanged(const QString &arg1)
|
|||||||
ui->widePlot->setLinearAvg(false);
|
ui->widePlot->setLinearAvg(false);
|
||||||
ui->widePlot->setReference(false);
|
ui->widePlot->setReference(false);
|
||||||
ui->smoSpinBox->setEnabled(false);
|
ui->smoSpinBox->setEnabled(false);
|
||||||
ui->labSmooth->setEnabled(false);
|
|
||||||
if(arg1=="Current") ui->widePlot->setCurrent(true);
|
if(arg1=="Current") ui->widePlot->setCurrent(true);
|
||||||
if(arg1=="Cumulative") ui->widePlot->setCumulative(true);
|
if(arg1=="Cumulative") ui->widePlot->setCumulative(true);
|
||||||
if(arg1=="Linear Avg") {
|
if(arg1=="Linear Avg") {
|
||||||
ui->widePlot->setLinearAvg(true);
|
ui->widePlot->setLinearAvg(true);
|
||||||
ui->smoSpinBox->setEnabled(true);
|
ui->smoSpinBox->setEnabled(true);
|
||||||
ui->labSmooth->setEnabled(true);
|
|
||||||
}
|
}
|
||||||
if(arg1=="Reference") {
|
if(arg1=="Reference") {
|
||||||
ui->widePlot->setReference(true);
|
ui->widePlot->setReference(true);
|
||||||
@ -441,3 +442,9 @@ void WideGraph::setWSPRtransmitted()
|
|||||||
{
|
{
|
||||||
m_bHaveTransmitted=true;
|
m_bHaveTransmitted=true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void WideGraph::on_sbPercent2dPlot_valueChanged(int n)
|
||||||
|
{
|
||||||
|
m_Percent2DScreen=n;
|
||||||
|
ui->widePlot->SetPercent2DScreen(n);
|
||||||
|
}
|
||||||
|
@ -72,7 +72,8 @@ private slots:
|
|||||||
void on_zeroSlider_valueChanged(int value);
|
void on_zeroSlider_valueChanged(int value);
|
||||||
void on_gain2dSlider_valueChanged(int value);
|
void on_gain2dSlider_valueChanged(int value);
|
||||||
void on_zero2dSlider_valueChanged(int value);
|
void on_zero2dSlider_valueChanged(int value);
|
||||||
void on_smoSpinBox_valueChanged(int n);
|
void on_smoSpinBox_valueChanged(int n);
|
||||||
|
void on_sbPercent2dPlot_valueChanged(int n);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void readPalette();
|
void readPalette();
|
||||||
@ -93,6 +94,7 @@ private:
|
|||||||
qint32 m_fMax;
|
qint32 m_fMax;
|
||||||
qint32 m_nSubMode;
|
qint32 m_nSubMode;
|
||||||
qint32 m_nsmo;
|
qint32 m_nsmo;
|
||||||
|
qint32 m_Percent2DScreen;
|
||||||
|
|
||||||
bool m_lockTxFreq;
|
bool m_lockTxFreq;
|
||||||
bool m_bFlatten;
|
bool m_bFlatten;
|
||||||
|
57
widegraph.ui
57
widegraph.ui
@ -252,22 +252,6 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="9">
|
|
||||||
<widget class="QLabel" name="labSmooth">
|
|
||||||
<property name="enabled">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>65</width>
|
|
||||||
<height>0</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Smoothing</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="7">
|
<item row="0" column="7">
|
||||||
<widget class="QSlider" name="gainSlider">
|
<widget class="QSlider" name="gainSlider">
|
||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
@ -501,13 +485,13 @@
|
|||||||
</property>
|
</property>
|
||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>65</width>
|
<width>75</width>
|
||||||
<height>0</height>
|
<height>0</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="maximumSize">
|
<property name="maximumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>50</width>
|
<width>75</width>
|
||||||
<height>16777215</height>
|
<height>16777215</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
@ -517,6 +501,12 @@
|
|||||||
<property name="alignment">
|
<property name="alignment">
|
||||||
<set>Qt::AlignCenter</set>
|
<set>Qt::AlignCenter</set>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="suffix">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
<property name="prefix">
|
||||||
|
<string>Smooth </string>
|
||||||
|
</property>
|
||||||
<property name="minimum">
|
<property name="minimum">
|
||||||
<number>1</number>
|
<number>1</number>
|
||||||
</property>
|
</property>
|
||||||
@ -540,6 +530,37 @@
|
|||||||
</property>
|
</property>
|
||||||
</spacer>
|
</spacer>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="0" column="9">
|
||||||
|
<widget class="QSpinBox" name="sbPercent2dPlot">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>75</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>75</width>
|
||||||
|
<height>16777215</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="suffix">
|
||||||
|
<string> %</string>
|
||||||
|
</property>
|
||||||
|
<property name="prefix">
|
||||||
|
<string>Spec </string>
|
||||||
|
</property>
|
||||||
|
<property name="maximum">
|
||||||
|
<number>100</number>
|
||||||
|
</property>
|
||||||
|
<property name="singleStep">
|
||||||
|
<number>5</number>
|
||||||
|
</property>
|
||||||
|
<property name="value">
|
||||||
|
<number>30</number>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user