mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2026-06-10 01:49:21 -04:00
Reintegrate the wsjtx_exp branch into the trunk
This merge brings the WSPR feature development into the main line ready for release in a future v1.6 release. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@5424 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
+43
-33
@@ -37,6 +37,7 @@ CPlotter::CPlotter(QWidget *parent) : //CPlotter Constructor
|
||||
m_Percent2DScreen = 30; //percent of screen used for 2D display
|
||||
m_txFreq=0;
|
||||
m_fftBinWidth=1500.0/2048.0;
|
||||
m_bScaleOK=false;
|
||||
}
|
||||
|
||||
CPlotter::~CPlotter() { } // Destructor
|
||||
@@ -92,8 +93,10 @@ void CPlotter::draw(float swide[], bool bScroll) //dr
|
||||
int j,j0,y2;
|
||||
float y;
|
||||
|
||||
double gain = pow(10.0,0.02*m_plotGain);
|
||||
double fac = sqrt(m_binsPerPixel*m_waterfallAvg/15.0);
|
||||
double gain = fac*pow(10.0,0.02*m_plotGain);
|
||||
double gain2d = pow(10.0,0.02*(m_plot2dGain));
|
||||
qDebug() << m_binsPerPixel << m_waterfallAvg << m_plotGain << gain;
|
||||
|
||||
//move current data down one line (must do this before attaching a QPainter object)
|
||||
if(bScroll) m_WaterfallPixmap.scroll(0,1,0,0,m_w,m_h1);
|
||||
@@ -159,7 +162,7 @@ void CPlotter::draw(float swide[], bool bScroll) //dr
|
||||
}
|
||||
}
|
||||
|
||||
if(m_bLinearAvg) { //Linear Avg
|
||||
if(m_bLinearAvg) { //Linear Avg (yellow)
|
||||
float sum=0.0;
|
||||
int j=j0+m_binsPerPixel*i;
|
||||
for(int k=0; k<m_binsPerPixel; k++) {
|
||||
@@ -179,9 +182,9 @@ void CPlotter::draw(float swide[], bool bScroll) //dr
|
||||
if(swide[0]>1.0e29) m_line=0;
|
||||
m_line++;
|
||||
if(m_line == 13) {
|
||||
UTCstr();
|
||||
painter1.setPen(Qt::white);
|
||||
painter1.drawText(5,10,m_sutc);
|
||||
QString t=QDateTime::currentDateTimeUtc().toString("hh:mm") + " " + m_rxBand;
|
||||
painter1.drawText(5,10,t);
|
||||
}
|
||||
|
||||
if(m_mode=="JT4") {
|
||||
@@ -189,7 +192,6 @@ void CPlotter::draw(float swide[], bool bScroll) //dr
|
||||
painter2D.setPen(pen3);
|
||||
Font.setWeight(QFont::Bold);
|
||||
painter2D.setFont(Font);
|
||||
// qDebug() << "B" << m_rxFreq;
|
||||
int x1=XfromFreq(m_rxFreq);
|
||||
y=0.2*m_h2;
|
||||
painter2D.drawText(x1-4,y,"T");
|
||||
@@ -201,22 +203,7 @@ void CPlotter::draw(float swide[], bool bScroll) //dr
|
||||
painter2D.drawText(x1-4,y,"73");
|
||||
}
|
||||
update(); //trigger a new paintEvent
|
||||
}
|
||||
|
||||
void CPlotter::UTCstr() //UTCstr
|
||||
{
|
||||
int ihr,imin;
|
||||
if(jt9com_.ndiskdat != 0) {
|
||||
ihr=jt9com_.nutc/100;
|
||||
imin=jt9com_.nutc % 100;
|
||||
} else {
|
||||
qint64 ms = QDateTime::currentMSecsSinceEpoch() % 86400000;
|
||||
imin=ms/60000;
|
||||
ihr=imin/60;
|
||||
imin=imin % 60;
|
||||
imin=imin - (imin % (m_TRperiod/60));
|
||||
}
|
||||
sprintf(m_sutc,"%2.2d:%2.2d",ihr,imin);
|
||||
m_bScaleOK=true;
|
||||
}
|
||||
|
||||
void CPlotter::DrawOverlay() //DrawOverlay()
|
||||
@@ -225,7 +212,6 @@ void CPlotter::DrawOverlay() //DrawOverlay()
|
||||
if(m_WaterfallPixmap.isNull()) return;
|
||||
int w = m_WaterfallPixmap.width();
|
||||
int x,y,x1,x2;
|
||||
// int nHzDiv[11]={0,50,100,200,200,200,500,500,500,500,500};
|
||||
float pixperdiv;
|
||||
|
||||
double df = m_binsPerPixel*m_fftBinWidth;
|
||||
@@ -233,7 +219,7 @@ void CPlotter::DrawOverlay() //DrawOverlay()
|
||||
{
|
||||
QPainter painter(&m_OverlayPixmap);
|
||||
painter.initFrom(this);
|
||||
QLinearGradient gradient(0, 0, 0 ,m_h2); //fill background with gradient
|
||||
QLinearGradient gradient(0, 0, 0 ,m_h2); //fill background with gradient
|
||||
gradient.setColorAt(1, Qt::black);
|
||||
gradient.setColorAt(0, Qt::darkBlue);
|
||||
painter.setBrush(gradient);
|
||||
@@ -293,13 +279,13 @@ void CPlotter::DrawOverlay() //DrawOverlay()
|
||||
|
||||
//draw tick marks on upper scale
|
||||
pixperdiv = m_freqPerDiv/df;
|
||||
for( int i=0; i<m_hdivs; i++) { //major ticks
|
||||
for( int i=0; i<m_hdivs; i++) { //major ticks
|
||||
x = (int)((m_xOffset+i)*pixperdiv );
|
||||
painter0.drawLine(x,18,x,30);
|
||||
}
|
||||
int minor=5;
|
||||
if(m_freqPerDiv==200) minor=4;
|
||||
for( int i=1; i<minor*m_hdivs; i++) { //minor ticks
|
||||
for( int i=1; i<minor*m_hdivs; i++) { //minor ticks
|
||||
x = i*pixperdiv/minor;
|
||||
painter0.drawLine(x,24,x,30);
|
||||
}
|
||||
@@ -311,10 +297,10 @@ void CPlotter::DrawOverlay() //DrawOverlay()
|
||||
painter0.drawText(rect0, Qt::AlignHCenter|Qt::AlignVCenter,m_HDivText[i]);
|
||||
}
|
||||
|
||||
float bw=9.0*12000.0/m_nsps; //JT9
|
||||
float bw=9.0*12000.0/m_nsps; //JT9
|
||||
|
||||
if(m_mode=="JT4") { //JT4
|
||||
bw=3*11025.0/2520.0; //NB: this is max tone spacing, 3/4 of actual BW
|
||||
if(m_mode=="JT4") { //JT4
|
||||
bw=3*11025.0/2520.0; //Max tone spacing (3/4 of actual BW)
|
||||
if(m_nSubMode==1) bw=2*bw;
|
||||
if(m_nSubMode==2) bw=4*bw;
|
||||
if(m_nSubMode==3) bw=9*bw;
|
||||
@@ -347,19 +333,33 @@ void CPlotter::DrawOverlay() //DrawOverlay()
|
||||
if(m_nSubMode==2) bw=4*bw;
|
||||
}
|
||||
|
||||
|
||||
if(m_mode != "JT4") {
|
||||
QPen pen0(Qt::green, 3); //Mark Rx Freq with green
|
||||
painter0.setPen(pen0);
|
||||
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=="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);
|
||||
}
|
||||
}
|
||||
|
||||
if(m_mode != "JT4") {
|
||||
QPen pen1(Qt::red, 3); //Mark Tx freq with red
|
||||
painter0.setPen(pen1);
|
||||
x1=XfromFreq(m_txFreq);
|
||||
x2=XfromFreq(m_txFreq+bw);
|
||||
if(m_mode=="WSPR-2") { //### WSPR-15 code needed here, too
|
||||
bw=4*12000.0/8192.0; //WSPR
|
||||
x1=XfromFreq(m_txFreq-0.5*bw);
|
||||
x2=XfromFreq(m_txFreq+0.5*bw);
|
||||
}
|
||||
painter0.drawLine(x1,17,x1,21);
|
||||
painter0.drawLine(x1,17,x2,17);
|
||||
painter0.drawLine(x2,17,x2,21);
|
||||
@@ -491,6 +491,11 @@ int CPlotter::binsPerPixel() //binsPerPixel
|
||||
return m_binsPerPixel;
|
||||
}
|
||||
|
||||
void CPlotter::setWaterfallAvg(int n) //setBinsPerPixel
|
||||
{
|
||||
m_waterfallAvg = n;
|
||||
}
|
||||
|
||||
void CPlotter::setRxFreq (int x) //setRxFreq
|
||||
{
|
||||
m_rxFreq = x; // x is freq in Hz
|
||||
@@ -572,6 +577,11 @@ void CPlotter::setDialFreq(double d)
|
||||
update();
|
||||
}
|
||||
|
||||
void CPlotter::setRxBand(QString band)
|
||||
{
|
||||
m_rxBand=band;
|
||||
}
|
||||
|
||||
void CPlotter::setFlatten(bool b)
|
||||
{
|
||||
m_Flatten=0;
|
||||
|
||||
Reference in New Issue
Block a user