From 7f8f9ed5288a5e95903ff49fc817f174860a6d57 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Wed, 3 Apr 2013 21:32:21 +0000 Subject: [PATCH] "Clear call and grid after logging" is now optional. Option to display distance in miles. Remove (or reduce?) negative red spikes at start of Rx period. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@3128 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- lib/redsync.f90 | 3 +-- mainwindow.cpp | 44 ++++++++++++++++++++++++++++++++------------ mainwindow.h | 6 ++++++ mainwindow.ui | 26 ++++++++++++++++++++++++-- 4 files changed, 63 insertions(+), 16 deletions(-) diff --git a/lib/redsync.f90 b/lib/redsync.f90 index 5a790094f..588d3b833 100644 --- a/lib/redsync.f90 +++ b/lib/redsync.f90 @@ -25,13 +25,12 @@ subroutine redsync(ss,ntrperiod,ihsym,iz,red) enddo red(i)=smax enddo - call pctile(red,iz,50,xmed) + call pctile(red,iz,40,xmed) if(xmed.le.0.0) xmed=1.0 red=red/xmed smax=0. do i=1,iz red(i)=0.2*db(red(i)) -! red(i)=2.0*sqrt(red(i)) smax=max(smax,red(i)) enddo h=10. diff --git a/mainwindow.cpp b/mainwindow.cpp index 5655722a4..b4e75bdab 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -161,6 +161,8 @@ MainWindow::MainWindow(QWidget *parent) : m_promptToLog=false; m_blankLine=false; m_insertBlank=false; + m_clearCallGrid=false; + m_bMiles=false; m_fMin=1000; ui->fMinSpinBox->setValue(m_fMin); decodeBusy(false); @@ -367,6 +369,8 @@ void MainWindow::writeSettings() settings.setValue("BandIndex",m_band); settings.setValue("PromptToLog",m_promptToLog); settings.setValue("InsertBlank",m_insertBlank); + settings.setValue("ClearCallGrid",m_clearCallGrid); + settings.setValue("Miles",m_bMiles); settings.endGroup(); } @@ -461,8 +465,10 @@ void MainWindow::readSettings() ui->actionPrompt_to_log_QSO->setChecked(m_promptToLog); m_insertBlank=settings.value("InsertBlank",false).toBool(); ui->actionBlank_line_between_decoding_periods->setChecked(m_insertBlank); - - settings.endGroup(); + m_clearCallGrid=settings.value("ClearCallGrid",false).toBool(); + ui->actionClear_DX_Call_and_Grid_after_logging->setChecked(m_clearCallGrid); + m_bMiles=settings.value("Miles",false).toBool(); + ui->actionDisplay_distance_in_miles->setChecked(m_bMiles); if(!ui->actionLinrad->isChecked() && !ui->actionCuteSDR->isChecked() && !ui->actionAFMHot->isChecked() && !ui->actionBlue->isChecked()) { @@ -1156,7 +1162,7 @@ void MainWindow::readFromStdout() //readFromStdout QTextCursor cursor; QTextBlockFormat bf; if(m_insertBlank and m_blankLine) { - QString bg="#9fb6cd"; + QString bg="#d3d3d3"; bf.setBackground(QBrush(QColor(bg))); QString s = "
" + " " + "
"; @@ -1928,7 +1934,8 @@ void MainWindow::on_dxGridEntry_textChanged(const QString &t) //dxGrid changed QString t; t.sprintf("Az: %d",nAz); ui->labAz->setText(t); - t.sprintf("%d km",nDkm); + if(m_bMiles) t.sprintf("%d mi",int(0.621371*nDkm)); + if(!m_bMiles) t.sprintf("%d km",nDkm); ui->labDist->setText(t); } else { ui->labAz->setText(""); @@ -1965,14 +1972,16 @@ void MainWindow::on_logQSOButton_clicked() //Log QSO button m_noSuffix,m_toRTTY,m_dBtoComments); if(logDlg.exec() == QDialog::Accepted) { } - m_hisCall=""; - ui->dxCallEntry->setText(""); - m_hisGrid=""; - ui->dxGridEntry->setText(""); - m_rptSent=""; - m_rptRcvd=""; - m_qsoStart=""; - m_qsoStop=""; + if(m_clearCallGrid) { + m_hisCall=""; + ui->dxCallEntry->setText(""); + m_hisGrid=""; + ui->dxGridEntry->setText(""); + m_rptSent=""; + m_rptRcvd=""; + m_qsoStart=""; + m_qsoStop=""; + } } void MainWindow::on_actionJT9_1_triggered() @@ -2248,3 +2257,14 @@ void MainWindow::on_fMaxSpinBox_valueChanged(int n) m_fMax=n; g_pWideGraph->setRxRange(m_fMin,m_fMax); } + +void MainWindow::on_actionClear_DX_Call_and_Grid_after_logging_triggered(bool checked) +{ + m_clearCallGrid=checked; +} + +void MainWindow::on_actionDisplay_distance_in_miles_triggered(bool checked) +{ + m_bMiles=checked; + on_dxGridEntry_textChanged(m_hisGrid); +} diff --git a/mainwindow.h b/mainwindow.h index e27993ee3..1482d3a57 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -134,6 +134,10 @@ private slots: void on_fMinSpinBox_valueChanged(int n); void on_fMaxSpinBox_valueChanged(int n); + void on_actionClear_DX_Call_and_Grid_after_logging_triggered(bool checked); + + void on_actionDisplay_distance_in_miles_triggered(bool checked); + private: Ui::MainWindow *ui; @@ -214,6 +218,8 @@ private: bool m_promptToLog; bool m_blankLine; bool m_insertBlank; + bool m_clearCallGrid; + bool m_bMiles; char m_decoded[80]; diff --git a/mainwindow.ui b/mainwindow.ui index fe2d0e6f4..a0f0bf41e 100644 --- a/mainwindow.ui +++ b/mainwindow.ui @@ -526,7 +526,7 @@ p, li { white-space: pre-wrap; } 1 - + 2 @@ -1711,12 +1711,13 @@ p, li { white-space: pre-wrap; } - + + @@ -2213,6 +2214,27 @@ p, li { white-space: pre-wrap; } Blank line between decoding periods + + + true + + + Clear DX Call and Grid after logging + + + + + Distance in miles + + + + + true + + + Display distance in miles + +