mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2024-11-20 02:52:00 -05:00
Correct the mouse-click actions on wide graph.
git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@2673 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
parent
8d8c950c08
commit
a20f66d4ac
@ -18,20 +18,25 @@ subroutine decoder(ntrSeconds,c0)
|
|||||||
|
|
||||||
ntrMinutes=ntrSeconds/60
|
ntrMinutes=ntrSeconds/60
|
||||||
newdat=1
|
newdat=1
|
||||||
nb=0
|
|
||||||
nbslider=100
|
|
||||||
|
|
||||||
nsps=0
|
nsps=0
|
||||||
if(ntrMinutes.eq.1) nsps=6912
|
if(ntrMinutes.eq.1) then
|
||||||
if(ntrMinutes.eq.2) then
|
nsps=6912
|
||||||
|
df3=1500.0/2048.0
|
||||||
|
else if(ntrMinutes.eq.2) then
|
||||||
nsps=15360
|
nsps=15360
|
||||||
df3=0.7324219
|
df3=1500.0/2048.0
|
||||||
|
else if(ntrMinutes.eq.5) then
|
||||||
|
nsps=40960
|
||||||
|
df3=1500.0/6144.0
|
||||||
|
else if(ntrMinutes.eq.10) then
|
||||||
|
nsps=82944
|
||||||
|
df3=1500.0/12288.0
|
||||||
|
else if(ntrMinutes.eq.30) then
|
||||||
|
nsps=252000
|
||||||
|
df3=1500.0/32768.0
|
||||||
endif
|
endif
|
||||||
if(ntrMinutes.eq.5) nsps=40960
|
if(nsps.eq.0) stop 'Error: bad TRperiod' !Better: return an error code###
|
||||||
if(ntrMinutes.eq.10) nsps=82944
|
|
||||||
if(ntrMinutes.eq.30) nsps=252000
|
|
||||||
if(nsps.eq.0) stop 'Error: bad TRperiod'
|
|
||||||
|
|
||||||
|
|
||||||
! Now do the decoding
|
! Now do the decoding
|
||||||
nutc=0
|
nutc=0
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
//--------------------------------------------------------------- MainWindow
|
//---------------------------------------------------------------- MainWindow
|
||||||
#include "mainwindow.h"
|
#include "mainwindow.h"
|
||||||
#include "ui_mainwindow.h"
|
#include "ui_mainwindow.h"
|
||||||
#include "devsetup.h"
|
#include "devsetup.h"
|
||||||
|
15
plotter.cpp
15
plotter.cpp
@ -179,7 +179,6 @@ void CPlotter::DrawOverlay() //DrawOverlay()
|
|||||||
int nHzDiv[11]={0,50,100,200,200,200,500,500,500,500,500};
|
int nHzDiv[11]={0,50,100,200,200,200,500,500,500,500,500};
|
||||||
float pixperdiv;
|
float pixperdiv;
|
||||||
|
|
||||||
//###
|
|
||||||
QRect rect;
|
QRect rect;
|
||||||
QPainter painter(&m_OverlayPixmap);
|
QPainter painter(&m_OverlayPixmap);
|
||||||
painter.initFrom(this);
|
painter.initFrom(this);
|
||||||
@ -190,11 +189,10 @@ void CPlotter::DrawOverlay() //DrawOverlay()
|
|||||||
painter.drawRect(0, 0, m_w, m_h2);
|
painter.drawRect(0, 0, m_w, m_h2);
|
||||||
painter.setBrush(Qt::SolidPattern);
|
painter.setBrush(Qt::SolidPattern);
|
||||||
|
|
||||||
//draw vertical grids
|
|
||||||
double df = m_binsPerPixel*m_fftBinWidth;
|
double df = m_binsPerPixel*m_fftBinWidth;
|
||||||
pixperdiv = m_freqPerDiv/df;
|
pixperdiv = m_freqPerDiv/df;
|
||||||
y = m_h2 - m_h2/VERT_DIVS;
|
y = m_h2 - m_h2/VERT_DIVS;
|
||||||
for( int i=1; i<m_hdivs; i++)
|
for( int i=1; i<m_hdivs; i++) //draw vertical grids
|
||||||
{
|
{
|
||||||
x = (int)( (float)i*pixperdiv );
|
x = (int)( (float)i*pixperdiv );
|
||||||
painter.setPen(QPen(Qt::white, 1,Qt::DotLine));
|
painter.setPen(QPen(Qt::white, 1,Qt::DotLine));
|
||||||
@ -202,10 +200,9 @@ void CPlotter::DrawOverlay() //DrawOverlay()
|
|||||||
painter.drawLine(x, m_h2-5, x , m_h2);
|
painter.drawLine(x, m_h2-5, x , m_h2);
|
||||||
}
|
}
|
||||||
|
|
||||||
//draw horizontal grids
|
|
||||||
pixperdiv = (float)m_h2 / (float)VERT_DIVS;
|
pixperdiv = (float)m_h2 / (float)VERT_DIVS;
|
||||||
painter.setPen(QPen(Qt::white, 1,Qt::DotLine));
|
painter.setPen(QPen(Qt::white, 1,Qt::DotLine));
|
||||||
for( int i=1; i<VERT_DIVS; i++)
|
for( int i=1; i<VERT_DIVS; i++) //draw horizontal grids
|
||||||
{
|
{
|
||||||
y = (int)( (float)i*pixperdiv );
|
y = (int)( (float)i*pixperdiv );
|
||||||
painter.drawLine(0, y, w, y);
|
painter.drawLine(0, y, w, y);
|
||||||
@ -223,8 +220,8 @@ void CPlotter::DrawOverlay() //DrawOverlay()
|
|||||||
painter.drawStaticText(5, y-1, QString::number(dB)+" dB");
|
painter.drawStaticText(5, y-1, QString::number(dB)+" dB");
|
||||||
dB -= m_dBStepSize;
|
dB -= m_dBStepSize;
|
||||||
}
|
}
|
||||||
// m_MindB = m_MaxdB - (VERT_DIVS)*m_dBStepSize;
|
|
||||||
|
|
||||||
|
/*
|
||||||
if(!m_Running)
|
if(!m_Running)
|
||||||
{ //if not running so is no data updates to draw to screen
|
{ //if not running so is no data updates to draw to screen
|
||||||
//copy into 2Dbitmap the overlay bitmap.
|
//copy into 2Dbitmap the overlay bitmap.
|
||||||
@ -232,7 +229,7 @@ void CPlotter::DrawOverlay() //DrawOverlay()
|
|||||||
//trigger a new paintEvent
|
//trigger a new paintEvent
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
//###
|
*/
|
||||||
|
|
||||||
QRect rect0;
|
QRect rect0;
|
||||||
QPainter painter0(&m_ScalePixmap);
|
QPainter painter0(&m_ScalePixmap);
|
||||||
@ -305,6 +302,7 @@ void CPlotter::DrawOverlay() //DrawOverlay()
|
|||||||
pen0.setWidth(6);
|
pen0.setWidth(6);
|
||||||
painter0.drawLine(x1,28,x2,28);
|
painter0.drawLine(x1,28,x2,28);
|
||||||
|
|
||||||
|
/*
|
||||||
df = 12000.0/m_nsps;
|
df = 12000.0/m_nsps;
|
||||||
int nlabs=df*w/m_freqPerDiv + 1.0;
|
int nlabs=df*w/m_freqPerDiv + 1.0;
|
||||||
// m_LowerScalePixmap.fill(Qt::white);
|
// m_LowerScalePixmap.fill(Qt::white);
|
||||||
@ -316,6 +314,7 @@ void CPlotter::DrawOverlay() //DrawOverlay()
|
|||||||
if ((i%10) == 0) y=18;
|
if ((i%10) == 0) y=18;
|
||||||
// painter3.drawLine(x,y,x,30);
|
// painter3.drawLine(x,y,x,30);
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
void CPlotter::MakeFrequencyStrs() //MakeFrequencyStrs
|
void CPlotter::MakeFrequencyStrs() //MakeFrequencyStrs
|
||||||
@ -429,9 +428,7 @@ int CPlotter::DF() {return m_DF;} // get DF
|
|||||||
|
|
||||||
void CPlotter::mousePressEvent(QMouseEvent *event) //mousePressEvent
|
void CPlotter::mousePressEvent(QMouseEvent *event) //mousePressEvent
|
||||||
{
|
{
|
||||||
// int h = (m_Size.height()-60)/2;
|
|
||||||
int x=event->x();
|
int x=event->x();
|
||||||
int y=event->y();
|
|
||||||
setFQSO(x,false); // Wideband waterfall
|
setFQSO(x,false); // Wideband waterfall
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user