From 5483e378b003ef361359f8f835a7c8274b0fefe3 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Fri, 12 Apr 2013 17:57:20 +0000 Subject: [PATCH] 1. Option to send Tx message (highlighted in yellow) to QSO window. 2. Setup | Options changed to Setup | Configuration 3. Alt-V causes save-to-file of the most recently completed Rx sequence. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@3161 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- mainwindow.cpp | 51 +++++++++++++++++++++++++++++++++++++++++++++----- mainwindow.h | 8 +++++++- mainwindow.ui | 13 +++++++++++-- 3 files changed, 64 insertions(+), 8 deletions(-) diff --git a/mainwindow.cpp b/mainwindow.cpp index acbf49956..923e006ff 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -131,6 +131,10 @@ MainWindow::MainWindow(QWidget *parent) : logQSOTimer->setSingleShot(true); connect(logQSOTimer, SIGNAL(timeout()), this, SLOT(on_logQSOButton_clicked())); + killFileTimer = new QTimer(this); + killFileTimer->setSingleShot(true); + connect(killFileTimer, SIGNAL(timeout()), this, SLOT(killFile())); + m_auto=false; m_waterfallAvg = 1; m_txFirst=false; @@ -389,6 +393,7 @@ void MainWindow::writeSettings() settings.setValue("LeftColor",m_leftColor); settings.setValue("73TxDisable",m_73TxDisable); settings.setValue("Runaway",m_runaway); + settings.setValue("Tx2QSO",m_tx2QSO); settings.endGroup(); } @@ -497,6 +502,8 @@ void MainWindow::readSettings() ui->action_73TxDisable->setChecked(m_73TxDisable); m_runaway=settings.value("Runaway",false).toBool(); ui->actionRunaway_Tx_watchdog->setChecked(m_runaway); + m_tx2QSO=settings.value("Tx2QSO",false).toBool(); + ui->actionTx2QSO->setChecked(m_tx2QSO); if(!ui->actionLinrad->isChecked() && !ui->actionCuteSDR->isChecked() && !ui->actionAFMHot->isChecked() && !ui->actionBlue->isChecked()) { @@ -784,6 +791,11 @@ void MainWindow::keyPressEvent( QKeyEvent *e ) //keyPressEvent genStdMsgs(m_rpt); break; } + case Qt::Key_V: + if(e->modifiers() & Qt::AltModifier) { + m_fileToSave=m_fname; + break; + } } } @@ -1188,10 +1200,7 @@ void MainWindow::readFromStdout() //readFromStdout m_bdecoded = (t.mid(23,1).toInt()==1); bool keepFile=m_saveAll or (m_saveSynced and m_bsynced) or (m_saveDecoded and m_bdecoded); - if(!keepFile and !m_diskData) { - QFile savedFile(m_fname); - savedFile.remove(); - } + if(!keepFile and !m_diskData) killFileTimer->start(45*1000); //Kill in 45 s jt9com_.nagain=0; jt9com_.ndiskdat=0; QFile lockFile(m_appDir + "/.lock"); @@ -1203,7 +1212,6 @@ void MainWindow::readFromStdout() //readFromStdout m_blankLine=true; return; } else { - QFile f("ALL.TXT"); f.open(QIODevice::WriteOnly | QIODevice::Text | QIODevice::Append); QTextStream out(&f); @@ -1330,6 +1338,15 @@ void MainWindow::readFromStdout() //readFromStdout } } +void MainWindow::killFile() +{ + if(m_fname==m_fileToSave) { + } else { + QFile savedFile(m_fname); + savedFile.remove(); + } +} + void MainWindow::on_EraseButton_clicked() //Erase { qint64 ms=QDateTime::currentMSecsSinceEpoch(); @@ -1431,7 +1448,9 @@ void MainWindow::guiUpdate() out << QDateTime::currentDateTimeUtc().toString("hhmm") << " Transmitting: " << t << endl; f.close(); + displayTxMsg(t); } + QStringList w=t.split(" ",QString::SkipEmptyParts); t=""; if(w.length()==3) t=w[2]; @@ -1501,6 +1520,7 @@ void MainWindow::guiUpdate() out << QDateTime::currentDateTimeUtc().toString("hhmm") << " Transmitting: " << t << endl; f.close(); + displayTxMsg(t); } if(!btxok && btxok0 && m_iptt==1) stopTx(); @@ -1580,6 +1600,22 @@ void MainWindow::guiUpdate() btxok0=btxok; } //End of GUIupdate +void MainWindow::displayTxMsg(QString t) +{ + QString bg="yellow"; + QTextBlockFormat bf; + QTextCursor cursor; + t=QDateTime::currentDateTimeUtc().toString("hhmmss Tx: ") + t; + QString s = "
" + t + "
"; + cursor = ui->decodedTextBrowser->textCursor(); + cursor.movePosition(QTextCursor::End); + bf = cursor.blockFormat(); + bf.setBackground(QBrush(QColor(bg))); + cursor.insertHtml(s); + ui->decodedTextBrowser->setTextCursor(cursor); +} + QString MainWindow::rig_command() { QString cmnd1,cmnd2; @@ -2492,3 +2528,8 @@ void MainWindow::on_actionRunaway_Tx_watchdog_triggered(bool checked) { m_runaway=checked; } + +void MainWindow::on_actionTx2QSO_triggered(bool checked) +{ + m_tx2QSO=checked; +} diff --git a/mainwindow.h b/mainwindow.h index 39558b893..443300a4e 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -147,8 +147,9 @@ private slots: void on_rptSpinBox_valueChanged(int n); void on_actionColor_highlighting_in_left_window_triggered(bool checked); void on_action_73TxDisable_triggered(bool checked); - void on_actionRunaway_Tx_watchdog_triggered(bool checked); + void on_actionTx2QSO_triggered(bool checked); + void killFile(); private: Ui::MainWindow *ui; @@ -242,6 +243,7 @@ private: bool m_73TxDisable; bool m_sent73; bool m_runaway; + bool m_tx2QSO; char m_decoded[80]; @@ -271,6 +273,8 @@ private: QTimer* ptt1Timer; //StartTx delay QTimer* ptt0Timer; //StopTx delay QTimer* logQSOTimer; + QTimer* killFileTimer; + QString m_path; QString m_pbdecoding_style1; @@ -297,6 +301,7 @@ private: QString m_handshake; QString m_cmnd; QString m_msgSent0; + QString m_fileToSave; QStringList m_macro; QStringList m_dFreq; @@ -318,6 +323,7 @@ private: void statusChanged(); void dialFreqChanged2(double f); void freeText(); + void displayTxMsg(QString t); bool gridOK(QString g); QString rig_command(); QString baseCall(QString t); diff --git a/mainwindow.ui b/mainwindow.ui index 7973c7cc6..8acf14c2a 100644 --- a/mainwindow.ui +++ b/mainwindow.ui @@ -1998,6 +1998,7 @@ p, li { white-space: pre-wrap; } + @@ -2068,10 +2069,10 @@ p, li { white-space: pre-wrap; } - false + true - Options + Configuration F2 @@ -2547,6 +2548,14 @@ p, li { white-space: pre-wrap; } Runaway Tx watchdog + + + true + + + Tx messages echoed to QSO window + +