diff --git a/WSJT-X_Users_Guide.docx b/WSJT-X_Users_Guide.docx index 9715404f3..83b86a1eb 100644 Binary files a/WSJT-X_Users_Guide.docx and b/WSJT-X_Users_Guide.docx differ diff --git a/devsetup.cpp b/devsetup.cpp index 412b802ef..3aa245ecc 100644 --- a/devsetup.cpp +++ b/devsetup.cpp @@ -36,18 +36,6 @@ void DevSetup::initDlg() char pa_device_name[128]; char pa_device_hostapi[128]; - if(m_firstCall) { - QString t; - for(int i=14; i<100; i++) { - t.sprintf("COM%d",i); - ui.pttComboBox->addItem(t); - } - for(int i=0; i<10; i++) { - m_macro.append(""); - } - m_firstCall=false; - } - k=0; for(id=0; idsetValue(m_idInt); ui.pttMethodComboBox->setCurrentIndex(m_pttMethodIndex); - ui.pttComboBox->setCurrentIndex(m_pttPort); + ui.pttPortEntry->setText(m_pttPort); ui.saveDirEntry->setText(m_saveDir); ui.comboBoxSndIn->setCurrentIndex(m_nDevIn); ui.comboBoxSndOut->setCurrentIndex(m_nDevOut); @@ -238,7 +226,7 @@ void DevSetup::accept() m_myGrid=ui.myGridEntry->text(); m_idInt=ui.idIntSpinBox->value(); m_pttMethodIndex=ui.pttMethodComboBox->currentIndex(); - m_pttPort=ui.pttComboBox->currentIndex(); + m_pttPort=ui.pttPortEntry->text(); m_saveDir=ui.saveDirEntry->text(); m_nDevIn=ui.comboBoxSndIn->currentIndex(); m_paInDevice=m_inDevList[m_nDevIn]; @@ -346,7 +334,9 @@ void DevSetup::on_cbPSKReporter_clicked(bool b) void DevSetup::on_pttMethodComboBox_activated(int index) { m_pttMethodIndex=index; - bool b=m_pttMethodIndex==1 or m_pttMethodIndex==2 or + bool b=(m_pttMethodIndex==1 or m_pttMethodIndex==2); + ui.pttPortEntry->setEnabled(b); + b=m_pttMethodIndex==1 or m_pttMethodIndex==2 or (m_catEnabled and m_pttMethodIndex==0); ui.testPTTButton->setEnabled(b); } @@ -503,7 +493,7 @@ void DevSetup::on_pollSpinBox_valueChanged(int n) m_poll=n; } -void DevSetup::on_pttComboBox_currentIndexChanged(int index) +void DevSetup::on_pttPortEntry_editingFinished() { - m_pttPort=index; + m_pttPort=ui.pttPortEntry->text(); } diff --git a/devsetup.h b/devsetup.h index e922198f0..8b3c93cdb 100644 --- a/devsetup.h +++ b/devsetup.h @@ -18,7 +18,6 @@ public: qint32 m_idInt; qint32 m_pttMethodIndex; - qint32 m_pttPort; qint32 m_nDevIn; qint32 m_nDevOut; qint32 m_inDevList[100]; @@ -56,6 +55,7 @@ public: QString m_azelDir; QString m_catPort; QString m_handshake; + QString m_pttPort; QStringList m_macro; QStringList m_dFreq; @@ -88,7 +88,7 @@ private slots: void on_cbDTRoff_toggled(bool checked); void on_rbData_toggled(bool checked); void on_pollSpinBox_valueChanged(int n); - void on_pttComboBox_currentIndexChanged(int index); + void on_pttPortEntry_editingFinished(); private: Rig* rig; @@ -96,6 +96,6 @@ private: Ui::DialogSndCard ui; }; -extern int ptt(int nport, int ntx, int* iptt, int* nopen); +extern int ptt(QString pttPort, int ntx, int* iptt, int* nopen); #endif // DEVSETUP_H diff --git a/devsetup.ui b/devsetup.ui index e4189f498..65f4be342 100644 --- a/devsetup.ui +++ b/devsetup.ui @@ -148,7 +148,7 @@ - 60 + 80 16777215 @@ -273,7 +273,7 @@ - + 0 @@ -288,95 +288,10 @@ - 60 + 80 16777215 - - - None - - - - - COM1 - - - - - COM2 - - - - - COM3 - - - - - COM4 - - - - - COM5 - - - - - COM6 - - - - - COM7 - - - - - COM8 - - - - - COM9 - - - - - COM10 - - - - - COM11 - - - - - COM12 - - - - - COM13 - - - - - COM14 - - - - - COM15 - - - - - USB - - @@ -2458,7 +2373,6 @@ myCallEntry myGridEntry pttMethodComboBox - pttComboBox idIntSpinBox cbID73 cbPSKReporter diff --git a/getfile.cpp b/getfile.cpp index 59a1729ac..737f09a0a 100644 --- a/getfile.cpp +++ b/getfile.cpp @@ -121,57 +121,15 @@ float gran() return v2*fac; } -/* -int ptt(int nport, int ntx, int *iptt) -{ -#ifdef WIN32 - static HANDLE hFile; - static int open=0; - char s[10]; - int i3=1,i4=1,i5=1,i6=1,i9=1,i00=1; - - if(nport==0) { - *iptt=ntx; - return(0); - } - - if(ntx && (!open)) { - sprintf(s,"\\\\.\\COM%d",nport); - hFile=CreateFile(TEXT(s),GENERIC_WRITE,0,NULL,OPEN_EXISTING, - FILE_ATTRIBUTE_NORMAL,NULL); - if(hFile==INVALID_HANDLE_VALUE) { - // printf("PTT: Cannot open COM port %d.\n",nport); - return 1; - } - open=1; - } - - if(ntx && open) { - i3=EscapeCommFunction(hFile,SETRTS); - i5=EscapeCommFunction(hFile,SETDTR); - *iptt=1; - } - - else { - i4=EscapeCommFunction(hFile,CLRRTS); - i6=EscapeCommFunction(hFile,CLRDTR); - i9=EscapeCommFunction(hFile,CLRBREAK); - i00=CloseHandle(hFile); - *iptt=0; - open=0; - } - return 0; -#endif -} -*/ - -int ptt(int nport, int ntx, int* iptt, int* nopen) +int ptt(QString pttPort, int ntx, int* iptt, int* nopen) { #ifdef WIN32 + int nport; static HANDLE hFile; char s[10]; int i3=1,i4=1,i5=1,i6=1,i9=1,i00=1; + nport=pttPort.mid(3).toInt(); if(nport==0) { *iptt=ntx; return(0); @@ -206,8 +164,3 @@ int ptt(int nport, int ntx, int* iptt, int* nopen) return 0; #endif } - -int hamlibError(int retcode) -{ - qDebug() << "Hamlib error" << retcode; -} diff --git a/getfile.h b/getfile.h index 2d4ffed07..0a2923a74 100644 --- a/getfile.h +++ b/getfile.h @@ -8,7 +8,7 @@ void getfile(QString fname, int ntrperiod); float gran(); //int ptt(int* nport, int* ntx, int* iptt); -int ptt(int nport, int ntx, int* iptt, int* nopen); +int ptt(QString pttPort, int ntx, int* iptt, int* nopen); #endif // GETFILE_H diff --git a/mainwindow.cpp b/mainwindow.cpp index ae8f4ad95..ad3eba10e 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -182,6 +182,7 @@ MainWindow::MainWindow(QSharedMemory *shdmem, QWidget *parent) : m_dontReadFreq=false; ui->readFreq->setEnabled(false); m_QSOmsg=""; + m_pttPort="None"; decodeBusy(false); ui->xThermo->setFillBrush(Qt::green); @@ -439,7 +440,7 @@ void MainWindow::readSettings() m_myGrid=settings.value("MyGrid","").toString(); m_idInt=settings.value("IDint",0).toInt(); m_pttMethodIndex=settings.value("PTTmethod",1).toInt(); - m_pttPort=settings.value("PTTport",0).toInt(); + m_pttPort=settings.value("PTTport","None").toString(); m_saveDir=settings.value("SaveDir",m_appDir + "/save").toString(); m_nDevIn = settings.value("SoundInIndex", 0).toInt(); m_paInDevice = settings.value("paInDevice",0).toInt(); @@ -552,8 +553,6 @@ void MainWindow::dataSink(int k) static int npts8; static float px=0.0; static float df3; - static uchar lstrong[1024]; - static float slimit; if(m_diskData) { jt9com_.ndiskdat=1; diff --git a/mainwindow.h b/mainwindow.h index 2680262db..984d260e7 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -171,7 +171,6 @@ private: qint32 m_pttMethodIndex; qint32 m_QSOfreq0; qint32 m_ntx; - qint32 m_pttPort; qint32 m_timeout; qint32 m_txFreq; qint32 m_setftx; @@ -315,6 +314,7 @@ private: QString m_msgSent0; QString m_fileToSave; QString m_QSOmsg; + QString m_pttPort; QStringList m_macro; QStringList m_dFreq;