From 0fe2869799f3cea5b74bb8551a0b6f2b4550ac73 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Thu, 6 Jun 2013 17:40:09 +0000 Subject: [PATCH] Add optional antenna description for PSK Reporter. (Presently implemented only for Windows.) git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@3344 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- devsetup.cpp | 7 ++++ devsetup.h | 1 + devsetup.ui | 88 ++++++++++++++++++++++++++++---------------------- mainwindow.cpp | 33 +++++++++++-------- mainwindow.h | 1 + 5 files changed, 79 insertions(+), 51 deletions(-) diff --git a/devsetup.cpp b/devsetup.cpp index 51779fd74..f8cb16dde 100644 --- a/devsetup.cpp +++ b/devsetup.cpp @@ -127,6 +127,7 @@ void DevSetup::initDlg() ui.myGridEntry->setPalette(pal); ui.myCallEntry->setText(m_myCall); ui.myGridEntry->setText(m_myGrid); + ui.pskReporterAntenna->setText(m_pskAntenna); ui.idIntSpinBox->setValue(m_idInt); ui.pttMethodComboBox->setCurrentIndex(m_pttMethodIndex); @@ -237,6 +238,7 @@ void DevSetup::accept() m_myCall=ui.myCallEntry->text(); m_myGrid=ui.myGridEntry->text(); + m_pskAntenna=ui.pskReporterAntenna->text(); m_idInt=ui.idIntSpinBox->value(); m_pttMethodIndex=ui.pttMethodComboBox->currentIndex(); m_pttPort=ui.pttComboBox->currentIndex(); @@ -342,6 +344,8 @@ void DevSetup::on_myGridEntry_editingFinished() void DevSetup::on_cbPSKReporter_clicked(bool b) { m_pskReporter=b; + ui.label_8->setEnabled(m_pskReporter); + ui.pskReporterAntenna->setEnabled(m_pskReporter); } void DevSetup::on_pttMethodComboBox_activated(int index) @@ -509,6 +513,9 @@ void DevSetup::on_pttMethodComboBox_currentIndexChanged(int index) void DevSetup::enableWidgets() { + ui.label_8->setEnabled(m_pskReporter); + ui.pskReporterAntenna->setEnabled(m_pskReporter); + ui.cbEnableCAT->setChecked(m_catEnabled); ui.cbDTRoff->setChecked(m_bDTRoff); ui.rigComboBox->setEnabled(m_catEnabled); diff --git a/devsetup.h b/devsetup.h index f72d5757f..d5a2649f6 100644 --- a/devsetup.h +++ b/devsetup.h @@ -57,6 +57,7 @@ public: QString m_azelDir; QString m_catPort; QString m_handshake; + QString m_pskAntenna; QStringList m_macro; QStringList m_dFreq; diff --git a/devsetup.ui b/devsetup.ui index 8dd4514b5..d102e49db 100644 --- a/devsetup.ui +++ b/devsetup.ui @@ -7,13 +7,13 @@ 0 0 548 - 521 + 493 - 548 - 521 + 569 + 493 @@ -316,37 +316,30 @@ - + + + + 0 + 0 + + - 0 - 20 + 146 + 0 - - ID Interval (min): - - - - - - - true - - 60 + 146 16777215 - Select CW ID interval (0 for none) + Send spots to PSK Reporter web site - - 0 - - - 10 + + Enable PSK Reporter @@ -387,35 +380,56 @@ - - - - 0 - 0 - - + - 146 - 0 + 0 + 20 + + ID Interval (min): + + + + + + + true + - 146 + 60 16777215 - Send spots to PSK Reporter web site + Select CW ID interval (0 for none) - - Enable PSK Reporter + + 0 + + + 10 + + + + + + Antenna for PSK Reporter: + + + + + + + + @@ -2435,8 +2449,6 @@ pttMethodComboBox pttComboBox idIntSpinBox - cbID73 - cbPSKReporter cbEnableCAT rigComboBox catPortComboBox diff --git a/mainwindow.cpp b/mainwindow.cpp index ff8fda987..eb1abc915 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -421,7 +421,8 @@ void MainWindow::writeSettings() settings.setValue("SaveTxPower",m_saveTxPower); settings.setValue("SaveComments",m_saveComments); settings.setValue("TxPower",m_txPower); - settings.value("LogComments",m_logComments); + settings.setValue("LogComments",m_logComments); + settings.setValue("PSKantenna",m_pskAntenna); settings.endGroup(); } @@ -551,6 +552,7 @@ void MainWindow::readSettings() m_saveComments=settings.value("SaveComments",false).toBool(); m_txPower=settings.value("TxPower","").toString(); m_logComments=settings.value("LogComments","").toString(); + m_pskAntenna=settings.value("PSKantenna","").toString(); settings.endGroup(); if(!ui->actionLinrad->isChecked() && !ui->actionCuteSDR->isChecked() && @@ -630,6 +632,7 @@ void MainWindow::on_actionDeviceSetup_triggered() //Setup Dialog DevSetup dlg(this); dlg.m_myCall=m_myCall; dlg.m_myGrid=m_myGrid; + dlg.m_pskAntenna=m_pskAntenna; dlg.m_idInt=m_idInt; dlg.m_pttMethodIndex=m_pttMethodIndex; dlg.m_pttPort=m_pttPort; @@ -670,6 +673,7 @@ void MainWindow::on_actionDeviceSetup_triggered() //Setup Dialog if(dlg.exec() == QDialog::Accepted) { m_myCall=dlg.m_myCall; m_myGrid=dlg.m_myGrid; + m_pskAntenna=dlg.m_pskAntenna; m_idInt=dlg.m_idInt; m_pttMethodIndex=dlg.m_pttMethodIndex; m_pttPort=dlg.m_pttPort; @@ -1441,8 +1445,9 @@ void MainWindow::readFromStdout() //readFromStdout remote.toWCharArray(tremote); QString local="station_callsign," + m_myCall + "," + - "my_gridsquare," + m_myGrid + "," + - "programid,WSJT-X,programversion," + rev.mid(6,4) + ",,"; + "my_gridsquare," + m_myGrid + ","; + if(m_pskAntenna!="") local += "my_antenna," + m_pskAntenna + ","; + local += "programid,WSJT-X,programversion," + rev.mid(6,4) + ",,"; wchar_t tlocal[256]; local.toWCharArray(tlocal); @@ -1461,16 +1466,18 @@ void MainWindow::readFromStdout() //readFromStdout } #else if(b and !m_diskData and okToPost) { - int i1=msg.indexOf(" "); - QString c2=msg.mid(i1+1); - int i2=c2.indexOf(" "); - QString g2=c2.mid(i2+1,4); - c2=c2.mid(0,i2); - int nHz=t.mid(22,4).toInt(); - QString freq = QString::number((int)(1000000.0*m_dialFreq + nHz + 0.5)); - QString snr= QString::number(t.mid(10,3).toInt()); - if(gridOK(g2)) - psk_Reporter->addRemoteStation(c2,g2,freq,"JT9",snr,QString::number(QDateTime::currentDateTime().toTime_t())); + int i1=msg.indexOf(" "); + QString c2=msg.mid(i1+1); + int i2=c2.indexOf(" "); + QString g2=c2.mid(i2+1,4); + c2=c2.mid(0,i2); + int nHz=t.mid(22,4).toInt(); + QString freq = QString::number((int)(1000000.0*m_dialFreq + + nHz + 0.5)); + QString snr= QString::number(t.mid(10,3).toInt()); + if(gridOK(g2)) + psk_Reporter->addRemoteStation(c2,g2,freq,"JT9",snr, + QString::number(QDateTime::currentDateTime().toTime_t())); } #endif } diff --git a/mainwindow.h b/mainwindow.h index 49a50a237..792230ace 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -322,6 +322,7 @@ private: QString m_QSOmsg; QString m_txPower; QString m_logComments; + QString m_pskAntenna; QStringList m_macro; QStringList m_dFreq;