From cc1c17cd64e3720c8a7e062c7d07d8425be9f278 Mon Sep 17 00:00:00 2001 From: Murray Curtis Date: Tue, 23 Jul 2013 10:28:22 +0000 Subject: [PATCH] Band settings with multiple antenna descriptions for PSK reporter git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@3499 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- devsetup.cpp | 105 +++- devsetup.h | 6 +- devsetup.ui | 1373 +++++++++++++++++++++++---------------------- mainwindow.cpp | 77 ++- mainwindow.h | 5 +- mainwindow.ui | 1381 +++++++++++++++++++++++----------------------- psk_reporter.cpp | 1 + 7 files changed, 1536 insertions(+), 1412 deletions(-) diff --git a/devsetup.cpp b/devsetup.cpp index 018a1882f..240317410 100644 --- a/devsetup.cpp +++ b/devsetup.cpp @@ -142,7 +142,6 @@ 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); @@ -238,6 +237,41 @@ void DevSetup::initDlg() ui.f14->setText(m_dFreq[13]); ui.f15->setText(m_dFreq[14]); ui.f16->setText(m_dFreq[15]); + + ui.AntDescription1->setText(m_antDescription[0]); + ui.AntDescription2->setText(m_antDescription[1]); + ui.AntDescription3->setText(m_antDescription[2]); + ui.AntDescription4->setText(m_antDescription[3]); + ui.AntDescription5->setText(m_antDescription[4]); + ui.AntDescription6->setText(m_antDescription[5]); + ui.AntDescription7->setText(m_antDescription[6]); + ui.AntDescription8->setText(m_antDescription[7]); + ui.AntDescription9->setText(m_antDescription[8]); + ui.AntDescription10->setText(m_antDescription[9]); + ui.AntDescription11->setText(m_antDescription[10]); + ui.AntDescription12->setText(m_antDescription[11]); + ui.AntDescription13->setText(m_antDescription[12]); + ui.AntDescription14->setText(m_antDescription[13]); + ui.AntDescription15->setText(m_antDescription[14]); + ui.AntDescription16->setText(m_antDescription[15]); + + ui.Band1->setText(m_bandDescription[0]); + ui.Band2->setText(m_bandDescription[1]); + ui.Band3->setText(m_bandDescription[2]); + ui.Band4->setText(m_bandDescription[3]); + ui.Band5->setText(m_bandDescription[4]); + ui.Band6->setText(m_bandDescription[5]); + ui.Band7->setText(m_bandDescription[6]); + ui.Band8->setText(m_bandDescription[7]); + ui.Band9->setText(m_bandDescription[8]); + ui.Band10->setText(m_bandDescription[9]); + ui.Band11->setText(m_bandDescription[10]); + ui.Band12->setText(m_bandDescription[11]); + ui.Band13->setText(m_bandDescription[12]); + ui.Band14->setText(m_bandDescription[13]); + ui.Band15->setText(m_bandDescription[14]); + ui.Band16->setText(m_bandDescription[15]); + } //------------------------------------------------------- accept() @@ -255,7 +289,6 @@ 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(); @@ -295,6 +328,43 @@ void DevSetup::accept() m_dFreq.append(ui.f15->text()); m_dFreq.append(ui.f16->text()); + m_antDescription.clear(); + m_antDescription.append(ui.AntDescription1->text()); + m_antDescription.append(ui.AntDescription2->text()); + m_antDescription.append(ui.AntDescription3->text()); + m_antDescription.append(ui.AntDescription4->text()); + m_antDescription.append(ui.AntDescription5->text()); + m_antDescription.append(ui.AntDescription6->text()); + m_antDescription.append(ui.AntDescription7->text()); + m_antDescription.append(ui.AntDescription8->text()); + m_antDescription.append(ui.AntDescription9->text()); + m_antDescription.append(ui.AntDescription10->text()); + m_antDescription.append(ui.AntDescription11->text()); + m_antDescription.append(ui.AntDescription12->text()); + m_antDescription.append(ui.AntDescription13->text()); + m_antDescription.append(ui.AntDescription14->text()); + m_antDescription.append(ui.AntDescription15->text()); + m_antDescription.append(ui.AntDescription16->text()); + + m_bandDescription.clear(); + m_bandDescription.append(ui.Band1->text()); + m_bandDescription.append(ui.Band2->text()); + m_bandDescription.append(ui.Band3->text()); + m_bandDescription.append(ui.Band4->text()); + m_bandDescription.append(ui.Band5->text()); + m_bandDescription.append(ui.Band6->text()); + m_bandDescription.append(ui.Band7->text()); + m_bandDescription.append(ui.Band8->text()); + m_bandDescription.append(ui.Band9->text()); + m_bandDescription.append(ui.Band10->text()); + m_bandDescription.append(ui.Band11->text()); + m_bandDescription.append(ui.Band12->text()); + m_bandDescription.append(ui.Band13->text()); + m_bandDescription.append(ui.Band14->text()); + m_bandDescription.append(ui.Band15->text()); + m_bandDescription.append(ui.Band16->text()); + + if(m_bRigOpen) { rig->close(); if(m_rig<9900) delete rig; @@ -358,11 +428,34 @@ void DevSetup::on_myGridEntry_editingFinished() ui.myGridEntry->setText(t); } +void DevSetup::setEnableAntennaDescriptions(bool enable) +{ + ui.AntDescription1->setEnabled(enable); + ui.AntDescription2->setEnabled(enable); + ui.AntDescription3->setEnabled(enable); + ui.AntDescription4->setEnabled(enable); + ui.AntDescription5->setEnabled(enable); + ui.AntDescription6->setEnabled(enable); + ui.AntDescription7->setEnabled(enable); + ui.AntDescription8->setEnabled(enable); + ui.AntDescription9->setEnabled(enable); + ui.AntDescription10->setEnabled(enable); + ui.AntDescription11->setEnabled(enable); + ui.AntDescription12->setEnabled(enable); + ui.AntDescription13->setEnabled(enable); + ui.AntDescription14->setEnabled(enable); + ui.AntDescription15->setEnabled(enable); + ui.AntDescription16->setEnabled(enable); + if (enable) + ui.AntDescriptionColumnLabel->setText("Antenna description"); + else + ui.AntDescriptionColumnLabel->setText("Antenna description (enable PSK Reporter)"); +} + void DevSetup::on_cbPSKReporter_clicked(bool b) { m_pskReporter=b; - ui.label_8->setEnabled(m_pskReporter); - ui.pskReporterAntenna->setEnabled(m_pskReporter); + setEnableAntennaDescriptions(m_pskReporter); } void DevSetup::on_pttMethodComboBox_activated(int index) @@ -541,9 +634,6 @@ 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); @@ -580,6 +670,7 @@ void DevSetup::enableWidgets() (m_catEnabled and m_pttMethodIndex==2 and m_rig<9900); bool b3 = (m_catEnabled and m_pttMethodIndex==0); ui.testPTTButton->setEnabled(b1 or b2 or b3); //Include PTT via HRD or Commander + setEnableAntennaDescriptions(m_pskReporter); } void DevSetup::on_cbSplit_toggled(bool checked) diff --git a/devsetup.h b/devsetup.h index f4834701d..838371a35 100644 --- a/devsetup.h +++ b/devsetup.h @@ -57,10 +57,11 @@ public: QString m_azelDir; QString m_catPort; QString m_handshake; - QString m_pskAntenna; QStringList m_macro; - QStringList m_dFreq; + QStringList m_dFreq; // per band frequency in MHz as a string + QStringList m_antDescription; // per band antenna description + QStringList m_bandDescription; // per band description QProcess p4; QMessageBox msgBox0; @@ -100,6 +101,7 @@ private slots: private: Rig* rig; void msgBox(QString t); + void setEnableAntennaDescriptions(bool enable); void enableWidgets(); void openRig(); Ui::DialogSndCard ui; diff --git a/devsetup.ui b/devsetup.ui index b1a31cd80..857ab809b 100644 --- a/devsetup.ui +++ b/devsetup.ui @@ -6,14 +6,26 @@ 0 0 - 569 - 493 + 588 + 557 - 569 - 493 + 588 + 557 + + + + + 0 + 1 + + + + + 0 + 0 @@ -325,13 +337,13 @@ - 146 + 160 0 - 146 + 160 16777215 @@ -416,20 +428,6 @@ - - - - - - Antenna for PSK Reporter: - - - - - - - - @@ -1828,665 +1826,664 @@ - Default Frequencies + Band Settings - - - Qt::Vertical + + + true - - - 20 - 40 - - - - - - - - - - 6 m - - - - - - - - 0 - 0 - - - - - 90 - 27 - - - - - 90 - 16777215 - - - - 50.293 - - - Qt::AlignCenter - - - - - - - Band - - - - - - - Freq (MHz) - - - - - - - - 0 - 0 - - - - - 90 - 27 - - - - - 90 - 16777215 - - - - 24.9246 - - - Qt::AlignCenter - - - - - - - 80 m - - - - - - - 15 m - - - - - - - - 0 - 0 - - - - - 90 - 27 - - - - - 90 - 16777215 - - - - 21.078 - - - Qt::AlignCenter - - - - - - - 10 m - - - - - - - 2200 m - - - - - - - 12 m - - - - - - - - 0 - 0 - - - - - 90 - 27 - - - - - 90 - 16777215 - - - - 28.078 - - - Qt::AlignCenter - - - - - - - - 0 - 0 - - - - - 90 - 27 - - - - - 90 - 16777215 - - - - 70.091 - - - Qt::AlignCenter - - - - - - - 60 m - - - - - - - 40 m - - - - - - - 4 m - - - - - - - 17 m - - - - - - - Band - - - - - - - Freq (MHz) - - - - - - - 30 m - - - - - - - - 0 - 0 - - - - - 90 - 27 - - - - - 90 - 16777215 - - - - 432.178 - - - Qt::AlignCenter - - - - - - - 160 m - - - - - - - 630 m - - - - - - - 20 m - - - - - - - Other - - - - - - - - 0 - 0 - - - - - 90 - 27 - - - - - 90 - 16777215 - - - - 18.1046 - - - Qt::AlignCenter - - - - - - - - 0 - 0 - - - - - 90 - 27 - - - - - 90 - 16777215 - - - - 0.4742 - - - Qt::AlignCenter - - - - - - - 2 m - - - - - - - - 0 - 0 - - - - - 90 - 27 - - - - - 90 - 16777215 - - - - 144.489 - - - Qt::AlignCenter - - - - - - - - 0 - 0 - - - - - 90 - 27 - - - - - 90 - 16777215 - - - - 0.136 - - - Qt::AlignCenter - - - - - - - - 0 - 0 - - - - - 90 - 27 - - - - - 90 - 16777215 - - - - 1.838 - - - Qt::AlignCenter - - - - - - - - 0 - 0 - - - - - 90 - 27 - - - - - 90 - 16777215 - - - - 5.2872 - - - Qt::AlignCenter - - - - - - - - 0 - 0 - - - - - 90 - 27 - - - - - 90 - 16777215 - - - - 3.578 - - - Qt::AlignCenter - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 0 - 0 - - - - - 90 - 27 - - - - - 90 - 16777215 - - - - 10.130 - - - Qt::AlignCenter - - - - - - - - 0 - 0 - - - - - 90 - 27 - - - - - 90 - 16777215 - - - - 7.078 - - - Qt::AlignCenter - - - - - - - - 0 - 0 - - - - - 90 - 27 - - - - - 90 - 16777215 - - - - 14.078 - - - Qt::AlignCenter - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - + + + + 0 + 0 + 527 + 554 + + + + + + + 0 + + + 6 + + + + + + 0 + 0 + + + + + 90 + 27 + + + + + 90 + 16777215 + + + + 5.2872 + + + Qt::AlignCenter + + + + + + + + 90 + 27 + + + + Qt::AlignCenter + + + + + + + + 90 + 27 + + + + Qt::AlignCenter + + + + + + + + 0 + 0 + + + + + 90 + 16777215 + + + + 2200 m + + + Qt::AlignCenter + + + + + + + + 0 + 0 + + + + + 90 + 27 + + + + + 90 + 16777215 + + + + 1.838 + + + Qt::AlignCenter + + + + + + + + 90 + 27 + + + + Qt::AlignCenter + + + + + + + + + + + 90 + 27 + + + + Qt::AlignCenter + + + + + + + + + + Freq (MHz) + + + + + + + + 0 + 0 + + + + + 90 + 27 + + + + + 90 + 16777215 + + + + 14.076 + + + Qt::AlignCenter + + + + + + + + 0 + 0 + + + + + 90 + 27 + + + + + 90 + 16777215 + + + + 3.578 + + + Qt::AlignCenter + + + + + + + + 0 + 0 + + + + + 90 + 27 + + + + + 90 + 16777215 + + + + 10.130 + + + Qt::AlignCenter + + + + + + + + 90 + 27 + + + + Qt::AlignCenter + + + + + + + + 90 + 16777215 + + + + Qt::AlignCenter + + + + + + + + 90 + 16777215 + + + + Qt::AlignCenter + + + + + + + + 90 + 16777215 + + + + Qt::AlignCenter + + + + + + + + + + + 90 + 16777215 + + + + Qt::AlignCenter + + + + + + + + + + + 90 + 27 + + + + Qt::AlignCenter + + + + + + + + 0 + 0 + + + + + 90 + 27 + + + + + 90 + 16777215 + + + + 0.4742 + + + Qt::AlignCenter + + + + + + + + + + + 0 + 0 + + + + + 90 + 27 + + + + + 90 + 16777215 + + + + 7.078 + + + Qt::AlignCenter + + + + + + + + + + + 90 + 27 + + + + Qt::AlignCenter + + + + + + + + 90 + 27 + + + + Qt::AlignCenter + + + + + + + + 90 + 16777215 + + + + Qt::AlignCenter + + + + + + + + 0 + 0 + + + + + 90 + 27 + + + + + 90 + 16777215 + + + + 0.136 + + + Qt::AlignCenter + + + + + + + + + + + 90 + 16777215 + + + + 20 m + + + Qt::AlignCenter + + + + + + + Band + + + + + + + My Antenna + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + + + <html><head/><body><p>Antenna description</p></body></html> + + + + + + + + 90 + 27 + + + + Qt::AlignCenter + + + + + + + + 90 + 16777215 + + + + Qt::AlignCenter + + + + + + + + 90 + 16777215 + + + + Qt::AlignCenter + + + + + + + + 90 + 16777215 + + + + Qt::AlignCenter + + + + + + + + 90 + 16777215 + + + + Qt::AlignCenter + + + + + + + + 90 + 16777215 + + + + Qt::AlignCenter + + + + + + + + 90 + 16777215 + + + + Qt::AlignCenter + + + + + + + + 90 + 16777215 + + + + Qt::AlignCenter + + + + + + + + 90 + 16777215 + + + + Qt::AlignCenter + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -2518,7 +2515,6 @@ cbPSKReporter cbID73 idIntSpinBox - pskReporterAntenna cbEnableCAT rigComboBox catPortComboBox @@ -2542,24 +2538,7 @@ macro8 macro9 macro10 - f1 - f2 - f3 - f4 - f5 - f6 - f7 - f8 - f9 - f10 - f11 - f12 - f13 - f14 - f15 - f16 buttonBox - ioTabWidget @@ -2570,8 +2549,8 @@ accept() - 248 - 254 + 257 + 483 157 @@ -2586,8 +2565,8 @@ reject() - 316 - 260 + 325 + 483 286 diff --git a/mainwindow.cpp b/mainwindow.cpp index 4340593ba..a3f9445b1 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -26,8 +26,7 @@ wchar_t buffer[256]; bool btxok; //True if OK to transmit bool btxMute; double outputLatency; //Latency in seconds -double dFreq[]={0.13613,0.4742,1.838,3.576,5.357,7.076,10.138,14.076, - 18.102,21.076,24.917,28.076,50.276,70.091,144.489,432.178}; + WideGraph* g_pWideGraph = NULL; LogQSO* logDlg = NULL; @@ -46,6 +45,7 @@ MainWindow::MainWindow(QSharedMemory *shdmem, QString *thekey, QWidget *parent) ui(new Ui::MainWindow) { ui->setupUi(this); + on_EraseButton_clicked(); QActionGroup* paletteGroup = new QActionGroup(this); ui->actionCuteSDR->setActionGroup(paletteGroup); @@ -203,15 +203,6 @@ MainWindow::MainWindow(QSharedMemory *shdmem, QString *thekey, QWidget *parent) mem_jt9 = shdmem; // Multiple instances: mykey_jt9 = thekey; - readSettings(); //Restore user's setup params - if(m_dFreq.length()<=1) { //Use the startup default frequencies - m_dFreq.clear(); - for(int i=0; i<16; i++) { - QString t; - t.sprintf("%f",dFreq[i]); - m_dFreq.append(t); - } - } #ifdef WIN32 if(!m_bMultipleOK) { @@ -224,6 +215,34 @@ MainWindow::MainWindow(QSharedMemory *shdmem, QString *thekey, QWidget *parent) } #endif + //Band Settings + readSettings(); //Restore user's setup params + if(m_dFreq.length()<=1) { //Use the startup default frequencies and band descriptions + // default bands and JT65 frequencies + const double dFreq[]={0.13613,0.4742,1.838,3.576,5.357,7.076,10.138,14.076, + 18.102,21.076,24.917,28.076,50.276,70.091,144.489,432.178}; + const QStringList dBandDescription = QStringList() << "2200 m" << "630 m" << "160 m" + << "80 m" << "60 m" << "40 m" + << "30 m" << "20 m" << "17 m" + << "15 m" << "12 m" << "10 m" + << "6 m" << "4 m" << "2 m" + << "other"; + m_dFreq.clear(); + m_antDescription.clear(); + m_bandDescription.clear(); + for(int i=0; i<16; i++) { + QString t; + t.sprintf("%f",dFreq[i]); + m_dFreq.append(t); + m_antDescription.append(""); + m_bandDescription.append(dBandDescription[i]); + } + } + + ui->bandComboBox->clear(); + ui->bandComboBox->addItems(m_bandDescription); + ui->bandComboBox->setCurrentIndex(m_band); + QFile lockFile(m_appDir + "/.lock"); //Create .lock so jt9 will wait lockFile.open(QIODevice::ReadWrite); //QFile quitFile(m_appDir + "/.lock"); @@ -322,7 +341,7 @@ MainWindow::MainWindow(QSharedMemory *shdmem, QString *thekey, QWidget *parent) #ifdef UNIX psk_Reporter = new PSK_Reporter(this); - psk_Reporter->setLocalStation(m_myCall,m_myGrid, m_pskAntenna, "WSJT-X r" + rev.mid(6,4) ); + psk_Reporter->setLocalStation(m_myCall,m_myGrid, m_antDescription[m_band], "WSJT-X r" + rev.mid(6,4) ); #endif ui->label_9->setStyleSheet("QLabel{background-color: #aabec8}"); @@ -416,7 +435,10 @@ void MainWindow::writeSettings() settings.setValue("PSKReporter",m_pskReporter); settings.setValue("After73",m_After73); settings.setValue("Macros",m_macro); - settings.setValue("DefaultFreqs",m_dFreq); + //Band Settings + settings.setValue("BandFrequencies",m_dFreq); + settings.setValue("BandDescriptions",m_bandDescription); + settings.setValue("AntennaDescriptions",m_antDescription); settings.setValue("toRTTY",m_toRTTY); settings.setValue("NoSuffix",m_noSuffix); settings.setValue("dBtoComments",m_dBtoComments); @@ -454,7 +476,6 @@ void MainWindow::writeSettings() settings.setValue("SaveComments",m_saveComments); settings.setValue("TxPower",m_txPower); settings.setValue("LogComments",m_logComments); - settings.setValue("PSKantenna",m_pskAntenna); settings.setValue("Fmin",m_fMin); settings.setValue("TxSplit",m_bSplit); settings.setValue("UseXIT",m_bXIT); @@ -548,7 +569,10 @@ void MainWindow::readSettings() m_pskReporter=settings.value("PSKReporter",false).toBool(); m_After73=settings.value("After73",false).toBool(); m_macro=settings.value("Macros","TNX 73 GL").toStringList(); - m_dFreq=settings.value("DefaultFreqs","").toStringList(); + //Band Settings + m_dFreq=settings.value("BandFrequencies","").toStringList(); + m_bandDescription=settings.value("BandDescriptions","").toStringList(); + m_antDescription=settings.value("AntennaDescriptions","").toStringList(); m_toRTTY=settings.value("toRTTY",false).toBool(); ui->actionConvert_JT9_x_to_RTTY->setChecked(m_toRTTY); m_noSuffix=settings.value("NoSuffix",false).toBool(); @@ -602,7 +626,6 @@ 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(); m_fMin=settings.value("fMin",2500).toInt(); m_bSplit=settings.value("TxSplit",false).toBool(); m_bXIT=settings.value("UseXit",false).toBool(); @@ -689,7 +712,6 @@ 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; @@ -700,6 +722,8 @@ void MainWindow::on_actionDeviceSetup_triggered() //Setup Dialog dlg.m_After73=m_After73; dlg.m_macro=m_macro; dlg.m_dFreq=m_dFreq; + dlg.m_antDescription=m_antDescription; + dlg.m_bandDescription=m_bandDescription; dlg.m_catEnabled=m_catEnabled; dlg.m_rig=m_rig; dlg.m_rigIndex=m_rigIndex; @@ -733,7 +757,6 @@ 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; @@ -742,6 +765,8 @@ void MainWindow::on_actionDeviceSetup_triggered() //Setup Dialog m_paOutDevice=dlg.m_paOutDevice; m_macro=dlg.m_macro; m_dFreq=dlg.m_dFreq; + m_antDescription=dlg.m_antDescription; + m_bandDescription=dlg.m_bandDescription; m_catEnabled=dlg.m_catEnabled; m_rig=dlg.m_rig; m_rigIndex=dlg.m_rigIndex; @@ -759,6 +784,11 @@ void MainWindow::on_actionDeviceSetup_triggered() //Setup Dialog m_pttData=dlg.m_pttData; m_poll=dlg.m_poll; + //Band Settings + ui->bandComboBox->clear(); + ui->bandComboBox->addItems(dlg.m_bandDescription); + ui->bandComboBox->setCurrentIndex(m_band); + #ifdef WIN32 if(dlg.m_pskReporter!=m_pskReporter) { if(dlg.m_pskReporter) { @@ -780,7 +810,7 @@ void MainWindow::on_actionDeviceSetup_triggered() //Setup Dialog #ifdef UNIX if(m_pskReporter) { - psk_Reporter->setLocalStation(m_myCall, m_myGrid, m_pskAntenna, "WSJT-X r" + rev.mid(6,4) ); + psk_Reporter->setLocalStation(m_myCall, m_myGrid, m_antDescription[m_band], "WSJT-X r" + rev.mid(6,4) ); } #endif @@ -1504,7 +1534,8 @@ void MainWindow::readFromStdout() //readFromStdout QString local="station_callsign#" + m_myCall + "#" + "my_gridsquare#" + m_myGrid + "#"; - if(m_pskAntenna!="") local += "my_antenna#" + m_pskAntenna + "#"; + if (m_antDescription[m_band]!="") + local += "my_antenna#" + m_antDescription[m_band] + "#"; local += "programid#WSJT-X#programversion#" + rev.mid(6,4) + "##"; wchar_t tlocal[256]; local.toWCharArray(tlocal); @@ -1521,7 +1552,7 @@ void MainWindow::readFromStdout() //readFromStdout } #else if(m_pskReporter and b and !m_diskData and okToPost) { - psk_Reporter->setLocalStation(m_myCall, m_myGrid, m_pskAntenna, "WSJT-X r" + rev.mid(6,4) ); + psk_Reporter->setLocalStation(m_myCall, m_myGrid, m_antDescription[m_band], "WSJT-X r" + rev.mid(6,4) ); QString freq = QString::number(nfreq); QString snr= QString::number(nsnr); if(gridOK(g2)) { @@ -1991,7 +2022,6 @@ void MainWindow::on_txb6_clicked() //txb6 void MainWindow::doubleClickOnCall2(bool shift, bool ctrl) { - m_decodedText2=true; doubleClickOnCall(shift,ctrl); m_decodedText2=false; @@ -2736,6 +2766,9 @@ void MainWindow::on_bandComboBox_activated(int index) out << QDateTime::currentDateTimeUtc().toString("yyyy-MMM-dd hh:mm") << " " << m_dialFreq << " MHz " << m_mode << endl; f2.close(); +#ifdef UNIX + psk_Reporter->setLocalStation(m_myCall, m_myGrid, m_antDescription[m_band], "WSJT-X r" + rev.mid(6,4) ); +#endif } void MainWindow::on_actionPrompt_to_log_QSO_triggered(bool checked) diff --git a/mainwindow.h b/mainwindow.h index 51e0b41af..62c787b5b 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -323,10 +323,11 @@ private: QString m_QSOmsg; QString m_txPower; QString m_logComments; - QString m_pskAntenna; QStringList m_macro; - QStringList m_dFreq; + QStringList m_dFreq; // per band frequency in MHz as a string + QStringList m_antDescription; // per band antenna description + QStringList m_bandDescription; // per band description QDateTime m_dateTimeQSO; diff --git a/mainwindow.ui b/mainwindow.ui index 5c58f212c..a742aac3c 100644 --- a/mainwindow.ui +++ b/mainwindow.ui @@ -526,22 +526,6 @@ p, li { white-space: pre-wrap; } - - - - - 50 - 0 - - - - QFrame::StyledPanel - - - QFrame::Raised - - - @@ -576,110 +560,315 @@ p, li { white-space: pre-wrap; } - - - - Select operating band + + + + + 0 + 0 + - - 7 - - - - 2200 m - - - - - 630 m - - - - - 160 m - - - - - 80 m - - - - - 60 m - - - - - 40 m - - - - - 30 m - - - - - 20 m - - - - - 17 m - - - - - 15 m - - - - - 12 m - - - - - 10 m - - - - - 6 m - - - - - 4 m - - - - - 2 m - - - - - Other - - - - - - - 15 - 15 + 74 + 16777215 - If orange, click to read dial frequency once + Add callsign and locator to database + + + Add + + + + + + + Lock Tx=Rx + + + + + + + Qt::Horizontal + + + QSizePolicy::Expanding + + + + 13 + 20 + + + + + + + + + 0 + 0 + + + + + 0 + 23 + + + + + 16777215 + 23 + + + Qt::AlignCenter + + + + + + + + 0 + 0 + + + + + 113 + 20 + + + + Hz + + + Rx + + + 200 + + + 5000 + + + 1500 + + + + + + + + 0 + 0 + + + + + 0 + 23 + + + + + 16777215 + 16777215 + + + + + + + + + 252 + 252 + 252 + + + + + + + 159 + 175 + 213 + + + + + + + + + 252 + 252 + 252 + + + + + + + 159 + 175 + 213 + + + + + + + + + 159 + 175 + 213 + + + + + + + 159 + 175 + 213 + + + + + + + + true + + + DX Grid + + + Qt::AlignCenter + + + 2 + + + + + + + + 0 + 0 + + + + + 70 + 27 + + + + + 74 + 16777215 + + + + Callsign of station to be worked + + + + + + Qt::AlignCenter + + + + + + + + 0 + 0 + + + + + 74 + 16777215 + + + + Search for callsign in database + + + &Lookup + + + + + + + + 50 + 0 + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + + + + 0 + 0 + + + + + 113 + 0 + + + + + 105 + 16777215 + + + + Audio Tx frequency + + + Hz + + + Tx + + + 200 + + + 5000 + + + 1500 + @@ -720,6 +909,163 @@ p, li { white-space: pre-wrap; } + + + + + 0 + 0 + + + + + 70 + 27 + + + + + 74 + 16777215 + + + + Locator of station to be worked + + + + + + Qt::AlignCenter + + + + + + + + 0 + 0 + + + + + 0 + 23 + + + + + + + + + 252 + 252 + 252 + + + + + + + 159 + 175 + 213 + + + + + + + + + 252 + 252 + 252 + + + + + + + 159 + 175 + 213 + + + + + + + + + 159 + 175 + 213 + + + + + + + 159 + 175 + 213 + + + + + + + + true + + + DX Call + + + Qt::AlignCenter + + + 2 + + + + + + + + 0 + 0 + + + + + 0 + 160 + + + + + 20 + 160 + + + + Digital gain for audio input + + + -50 + + + 50 + + + Qt::Vertical + + + @@ -742,6 +1088,105 @@ p, li { white-space: pre-wrap; } + + + + 5 + + + + + + 0 + 0 + + + + Report + + + + + + + + 0 + 0 + + + + + 55 + 0 + + + + + 55 + 16777215 + + + + Signal report (dB0 + + + -50 + + + 49 + + + -15 + + + + + + + + + + 0 + 0 + + + + + 130 + 60 + + + + + 158 + 60 + + + + + 16 + + + + QFrame::StyledPanel + + + QFrame::Sunken + + + 2 + + + 0 + + + 01:23:45 + + + Qt::AlignCenter + + + @@ -869,7 +1314,7 @@ p, li { white-space: pre-wrap; } - buttonGroup + buttonGroup @@ -903,7 +1348,7 @@ p, li { white-space: pre-wrap; } true - buttonGroup + buttonGroup @@ -934,7 +1379,7 @@ p, li { white-space: pre-wrap; } - buttonGroup + buttonGroup @@ -1102,7 +1547,7 @@ p, li { white-space: pre-wrap; } - buttonGroup + buttonGroup @@ -1250,7 +1695,7 @@ p, li { white-space: pre-wrap; } - buttonGroup + buttonGroup @@ -1281,7 +1726,7 @@ p, li { white-space: pre-wrap; } - buttonGroup + buttonGroup @@ -1543,484 +1988,6 @@ p, li { white-space: pre-wrap; } - - - - +2 kHz - - - - - - - - 0 - 0 - - - - - 0 - 23 - - - - - - - - - 252 - 252 - 252 - - - - - - - 159 - 175 - 213 - - - - - - - - - 252 - 252 - 252 - - - - - - - 159 - 175 - 213 - - - - - - - - - 159 - 175 - 213 - - - - - - - 159 - 175 - 213 - - - - - - - - true - - - DX Call - - - Qt::AlignCenter - - - 2 - - - - - - - - 0 - 0 - - - - - 0 - 23 - - - - - 16777215 - 16777215 - - - - - - - - - 252 - 252 - 252 - - - - - - - 159 - 175 - 213 - - - - - - - - - 252 - 252 - 252 - - - - - - - 159 - 175 - 213 - - - - - - - - - 159 - 175 - 213 - - - - - - - 159 - 175 - 213 - - - - - - - - true - - - DX Grid - - - Qt::AlignCenter - - - 2 - - - - - - - false - - - Tx JT9 - - - - - - - - 0 - 0 - - - - - 0 - 160 - - - - - 20 - 160 - - - - Digital gain for audio input - - - -50 - - - 50 - - - Qt::Vertical - - - - - - - - 0 - 0 - - - - - 70 - 27 - - - - - 74 - 16777215 - - - - Callsign of station to be worked - - - - - - Qt::AlignCenter - - - - - - - - 0 - 0 - - - - - 70 - 27 - - - - - 74 - 16777215 - - - - Locator of station to be worked - - - - - - Qt::AlignCenter - - - - - - - - 0 - 0 - - - - - 113 - 0 - - - - - 105 - 16777215 - - - - Audio Tx frequency - - - Hz - - - Tx - - - 200 - - - 5000 - - - 1500 - - - - - - - - 0 - 0 - - - - - 0 - 23 - - - - - 16777215 - 23 - - - - - - - Qt::AlignCenter - - - - - - - Qt::Horizontal - - - QSizePolicy::Expanding - - - - 33 - 20 - - - - - - - - - 0 - 0 - - - - - 113 - 20 - - - - Hz - - - Rx - - - 200 - - - 5000 - - - 1500 - - - - - - - Qt::Horizontal - - - QSizePolicy::Expanding - - - - 13 - 20 - - - - - - - - - 0 - 0 - - - - - 74 - 16777215 - - - - Search for callsign in database - - - &Lookup - - - - - - - - 0 - 0 - - - - - 74 - 16777215 - - - - Add callsign and locator to database - - - Add - - - @@ -2075,111 +2042,162 @@ p, li { white-space: pre-wrap; } - - + + + + false + + + Tx JT9 + + + + + + + Qt::Horizontal + + + QSizePolicy::Expanding + + + + 33 + 20 + + + + + + + + +2 kHz + + + + + + + + 15 + 15 + + + + If orange, click to read dial frequency once + + + + + + + + - + 0 0 - 130 - 60 + 100 + 0 - 158 - 60 + 100 + 16777215 - - - 16 - + + Select operating band - - QFrame::StyledPanel - - - QFrame::Sunken - - - 2 - - - 0 - - - 01:23:45 - - - Qt::AlignCenter - - - - - - - Lock Tx=Rx - - - - - - - 5 + + 7 - - - - 0 - 0 - - - - Report - - + + 2200 m + - - - - 0 - 0 - - - - - 55 - 0 - - - - - 55 - 16777215 - - - - Signal report (dB0 - - - -50 - - - 49 - - - -15 - - + + 630 m + - + + + 160 m + + + + + 80 m + + + + + 60 m + + + + + 40 m + + + + + 30 m + + + + + 20 m + + + + + 17 m + + + + + 15 m + + + + + 12 m + + + + + 10 m + + + + + 6 m + + + + + 4 m + + + + + 2 m + + + + + Other + + + @@ -2191,7 +2209,7 @@ p, li { white-space: pre-wrap; } 0 0 760 - 21 + 22 @@ -2854,7 +2872,6 @@ p, li { white-space: pre-wrap; } stopTxButton tuneButton bandComboBox - readFreq inGain dxCallEntry dxGridEntry diff --git a/psk_reporter.cpp b/psk_reporter.cpp index 15b56b767..595d5db17 100644 --- a/psk_reporter.cpp +++ b/psk_reporter.cpp @@ -45,6 +45,7 @@ void PSK_Reporter::setLocalStation(QString call, QString gridSquare, QString ant m_rxGrid = gridSquare; m_rxAnt = antenna; m_progId = programInfo; + //qDebug() << "PSK_Reporter::setLocalStation. Antenna:" << antenna; } void PSK_Reporter::addRemoteStation(QString call, QString grid, QString freq, QString mode, QString snr, QString time )