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:
Joe Taylor
2015-11-22 23:38:42 +00:00
parent 2740cdfb53
commit a8d0e2eeeb
5 changed files with 69 additions and 27 deletions
+16 -5
View File
@@ -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_Percent2DScreen0 = 0;
m_txFreq=0;
m_fftBinWidth=1500.0/2048.0;
m_bScaleOK=false;
@@ -53,24 +54,26 @@ QSize CPlotter::sizeHint() const
void CPlotter::resizeEvent(QResizeEvent* ) //resizeEvent()
{
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_w = m_Size.width();
m_h = m_Size.height();
m_h2 = (m_Percent2DScreen)*(m_h)/100;
if(m_h2>100) m_h2=100;
m_h2 = m_Percent2DScreen*m_h/100.0;
if(m_h2>m_h-30) 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_2DPixmap = QPixmap(m_Size.width(), m_h2);
m_2DPixmap.fill(Qt::black);
m_WaterfallPixmap = QPixmap(m_Size.width(), m_h1);
m_OverlayPixmap = QPixmap(m_Size.width(), m_h2);
m_OverlayPixmap.fill(Qt::black);
m_WaterfallPixmap.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_Percent2DScreen0 = m_Percent2DScreen;
}
DrawOverlay();
}
@@ -603,3 +606,11 @@ void CPlotter::setColours(QVector<QColor> const& cl)
{
g_ColorTbl = cl;
}
void CPlotter::SetPercent2DScreen(int percent)
{
m_Percent2DScreen=percent;
resizeEvent(NULL);
// DrawOverlay();
update();
}