mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2024-11-23 20:58:55 -05:00
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
This commit is contained in:
parent
3c0a6b9694
commit
cc1c17cd64
105
devsetup.cpp
105
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)
|
||||
|
@ -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;
|
||||
|
1079
devsetup.ui
1079
devsetup.ui
File diff suppressed because it is too large
Load Diff
@ -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)
|
||||
|
@ -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;
|
||||
|
||||
|
1351
mainwindow.ui
1351
mainwindow.ui
File diff suppressed because it is too large
Load Diff
@ -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 )
|
||||
|
Loading…
Reference in New Issue
Block a user