From 0577b42f43287e6d687677f342aeed0aba8d80ae Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Mon, 15 Apr 2013 21:13:31 +0000 Subject: [PATCH] Backed out the changes from r3171 to r3172 -- too buggy at present. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@3173 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- devsetup.cpp | 38 - devsetup.h | 7 - devsetup.ui | 2011 ++++++++++++++++++++++----------------------- lib/rig_control.c | 3 - mainwindow.cpp | 48 +- mainwindow.h | 11 +- mainwindow.ui | 2 +- 7 files changed, 986 insertions(+), 1134 deletions(-) diff --git a/devsetup.cpp b/devsetup.cpp index fea72030e..e03f7adfa 100644 --- a/devsetup.cpp +++ b/devsetup.cpp @@ -14,9 +14,6 @@ DevSetup::DevSetup(QWidget *parent) : QDialog(parent) m_restartSoundIn=false; m_restartSoundOut=false; m_firstCall=true; - m_count=0; - m_iptt=0; - m_bRigOpen=false; } DevSetup::~DevSetup() @@ -372,38 +369,3 @@ void DevSetup::on_cbID73_toggled(bool checked) { m_After73=checked; } - -void DevSetup::on_testCATButton_clicked() -{ - if(!m_catEnabled) return; - if(!m_bRigOpen) { - QString conf_parms; - conf_parms.sprintf("data_bits=%d,stop_bits=%d,serial_handshake=", - m_dataBits,m_stopBits); - conf_parms+=m_handshake; - int iret=rigOpen(0,m_rig,m_catPort.toAscii().data(),m_serialRate, - conf_parms.toAscii().data()); - if(iret!=0) { - msgBox("Failed to open connection to radio."); - return; - } - m_bRigOpen=true; - } - m_count=1-m_count; - int freq=10130000; - if(m_count!=1) freq=14078000; - rigSetFreq(freq); -} - -void DevSetup::on_testPTTButton_clicked() -{ - int iret=0; - m_iptt=1-m_iptt; - if(m_pttMethodIndex==1 or m_pttMethodIndex==2) { - int iptt=m_iptt; - ptt(m_pttPort,iptt,&m_iptt,&m_COMportOpen); - } - if(m_pttMethodIndex==0 and m_bRigOpen) { - iret=rigSetPTT(m_iptt); - } -} diff --git a/devsetup.h b/devsetup.h index d27ad8a13..137efdcdb 100644 --- a/devsetup.h +++ b/devsetup.h @@ -34,9 +34,6 @@ public: qint32 m_stopBits; qint32 m_stopBitsIndex; qint32 m_handshakeIndex; - qint32 m_count; - qint32 m_iptt; - qint32 m_COMportOpen; bool m_restartSoundIn; bool m_restartSoundOut; @@ -44,7 +41,6 @@ public: bool m_firstCall; bool m_catEnabled; bool m_After73; - bool m_bRigOpen; QString m_myCall; QString m_myGrid; @@ -78,9 +74,6 @@ private slots: void on_stopBitsComboBox_activated(int index); void on_rigComboBox_activated(int index); void on_cbID73_toggled(bool checked); - void on_testCATButton_clicked(); - - void on_testPTTButton_clicked(); private: void msgBox(QString t); diff --git a/devsetup.ui b/devsetup.ui index 33119f228..bd400cc0d 100644 --- a/devsetup.ui +++ b/devsetup.ui @@ -35,1051 +35,40 @@ Station - + - + - - - - 0 - 0 - - - - - 80 - 20 - - - - - 80 - 16777215 - - - - My Call: - - - - - - - - 0 - 0 - - - - - 90 - 0 - - - - - 90 - 16777215 - - - - - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 0 - 0 - - - - - 80 - 20 - - - - - 80 - 16777215 - - - - My Grid: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - 0 - 0 - - - - - 60 - 0 - - - - - 60 - 16777215 - - - - - - - - - - - - - - - - 0 - 0 - - - - - 80 - 0 - - - - - 80 - 16777215 - - - - PTT method: - - - - - - - - 0 - 0 - - - - - 90 - 0 - - - - - 90 - 16777215 - - - - 1 - + - - CAT - - - - - DTR - - - - - RTS - - - - - VOX - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 0 - 0 - - - - - 80 - 0 - - - - - 80 - 16777215 - - - - PTT Port: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - 0 - 0 - - - - - 60 - 0 - - - - - 60 - 16777215 - - - - - None - - - - - COM1 - - - - - COM2 - - - - - COM3 - - - - - COM4 - - - - - COM5 - - - - - COM6 - - - - - COM7 - - - - - COM8 - - - - - COM9 - - - - - COM10 - - - - - COM11 - - - - - COM12 - - - - - COM13 - - - - - COM14 - - - - - COM15 - - - - - USB - - - - - - - - - - - - - 0 - 20 - - - - ID Interval (min): - - - - - - - true - - - - 60 - 16777215 - - - - -20 - - - 10 - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - ID after 73 - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 0 - 0 - - - - - 146 - 0 - - - - - 146 - 16777215 - - - - Enable PSK Reporter - - - - - - - - - Qt::Vertical - - - - 20 - 13 - - - - - - - - - - - 0 - 0 - - - - - 100 - 0 - - - - - 100 - 16777215 - - - - Enable CAT - - - - - - - - 0 - 0 - - - - - 20 - 0 - - - - - 20 - 16777215 - - - - Rig: - - - - - - - - 0 - 0 - - - - - 200 - 0 - - - - - - - - - - - - - 0 - 0 - - - - - 100 - 0 - - - - - 100 - 16777215 - - - - CAT port: - - - - - - - - 0 - 0 - - - - - 90 - 0 - - - - - 90 - 16777215 - - - - 0 - - - - None - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 0 - 0 - - - - - 60 - 0 - - - - - 60 - 16777215 - - - - Data bits: - - - - - - - - 0 - 0 - - - - - 50 - 0 - - - - - 50 - 16777215 - - - - 1 - - - - 7 - - - - - 8 - - - - - - - - - - - - - 0 - 0 - - - - - 100 - 0 - - - - - 100 - 16777215 - - - - Serial rate: - - - - - - - - 0 - 0 - - - - - 90 - 0 - - - - - 90 - 16777215 - - - - 1 - - - - 1200 - - - - - 4800 - - - - - 9600 - - - - - 19200 - - - - - 38400 - - - - - 57600 - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 0 - 0 - - - - - 60 - 0 - - - - - 60 - 16777215 - - - - Stop bits: - - - - - - - - 0 - 0 - - - - - 50 - 0 - - - - - 50 - 16777215 - - - - 1 - - - - 1 - - - - - 2 - - - - - - - - - - - - - 0 - 0 - - - - - 100 - 0 - - - - - 100 - 16777215 - - - - Handshake: - - - - - - - - 0 - 0 - - - - - 90 - 0 - - - - - 90 - 16777215 - - - - 2 - - - - None - - - - - XonXoff - - - - - Hardware - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - - - 0 - 0 - - - - - 100 - 0 - - - - - 100 - 16777215 - - - - Test CAT Control - - - - - - - - 0 - 0 - - - - - 90 - 0 - - - - - 90 - 16777215 - - - - Test PTT - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - Qt::Vertical - - - - 20 - 13 - - - - - - - - - - - 90 - 0 - - - - - 90 - 16777215 - - - - Dev Channel - - - - - - - API Name - - - Qt::AlignCenter - - - - - - - - - - - + + + + 0 + 0 + + - 90 - 0 + 80 + 20 - 75 + 80 16777215 - Audio In: + My Call: - - - true - - - - - - - - - + - + 0 0 @@ -1092,26 +81,117 @@ - 75 + 90 16777215 - Audio Out: + - + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + + 80 + 20 + + + + + 80 + 16777215 + + + + My Grid: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 0 + 0 + + + + + 60 + 0 + + + + + 60 + 16777215 + + + + + + - + - + - + + 0 + 0 + + + + + 80 + 0 + + + + + 80 + 16777215 + + + + PTT method: + + + + + + + 0 0 @@ -1119,21 +199,878 @@ 90 + 0 + + + + + 90 + 16777215 + + + + 1 + + + + CAT + + + + + DTR + + + + + RTS + + + + + VOX + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + + 80 + 0 + + + + + 80 + 16777215 + + + + PTT Port: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 0 + 0 + + + + + 60 + 0 + + + + + 60 + 16777215 + + + + + None + + + + + COM1 + + + + + COM2 + + + + + COM3 + + + + + COM4 + + + + + COM5 + + + + + COM6 + + + + + COM7 + + + + + COM8 + + + + + COM9 + + + + + COM10 + + + + + COM11 + + + + + COM12 + + + + + COM13 + + + + + COM14 + + + + + COM15 + + + + + USB + + + + + + + + + + + + + 0 20 - Save Directory: + ID Interval (min): - - - C:\Users\joe\wsjt\map65\save + + + true + + + + 60 + 16777215 + + + + -20 + + + 10 + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + ID after 73 + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + + 146 + 0 + + + + + 146 + 16777215 + + + + Enable PSK Reporter + + + + + + + + + Qt::Vertical + + + + 20 + 15 + + + + + + + + + + + 0 + 0 + + + + + 100 + 0 + + + + + 100 + 16777215 + + + + Enable CAT + + + + + + + + 0 + 0 + + + + + 20 + 0 + + + + + 20 + 16777215 + + + + Rig: + + + + + + + + 0 + 0 + + + + + 200 + 0 + + + + + + + + + + + + + 0 + 0 + + + + + 100 + 0 + + + + + 100 + 16777215 + + + + CAT port: + + + + + + + + 0 + 0 + + + + + 90 + 0 + + + + + 90 + 16777215 + + + + 0 + + + + None + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + + 60 + 0 + + + + + 60 + 16777215 + + + + Data bits: + + + + + + + + 0 + 0 + + + + + 50 + 0 + + + + + 50 + 16777215 + + + + 1 + + + + 7 + + + + + 8 + + + + + + + + + + + + + 0 + 0 + + + + + 100 + 0 + + + + + 100 + 16777215 + + + + Serial rate: + + + + + + + + 0 + 0 + + + + + 90 + 0 + + + + + 90 + 16777215 + + + + 1 + + + + 1200 + + + + + 4800 + + + + + 9600 + + + + + 19200 + + + + + 38400 + + + + + 57600 + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + + 60 + 0 + + + + + 60 + 16777215 + + + + Stop bits: + + + + + + + + 0 + 0 + + + + + 50 + 0 + + + + + 50 + 16777215 + + + + 1 + + + + 1 + + + + + 2 + + + + + + + + + + + + + 0 + 0 + + + + + 100 + 0 + + + + + 100 + 16777215 + + + + Handshake: + + + + + + + + 0 + 0 + + + + + 90 + 0 + + + + + 90 + 16777215 + + + + 2 + + + + None + + + + + XonXoff + + + + + Hardware + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + Qt::Vertical + + + + 20 + 15 + + + + + + + + + + + 90 + 0 + + + + + 90 + 16777215 + + + + Dev Channel + + + + + + + API Name + + + Qt::AlignCenter + + + + + + + + + + + + + + 90 + 0 + + + + + 75 + 16777215 + + + + Audio In: + + + + + + + true + + + + + + + + + + + + 0 + 0 + + + + + 90 + 0 + + + + + 75 + 16777215 + + + + Audio Out: + + + + + + + + + + + + + + + 0 + 0 + + + + + 90 + 20 + + + + Save Directory: + + + + + + + C:\Users\joe\wsjt\map65\save + + + + + diff --git a/lib/rig_control.c b/lib/rig_control.c index 2fb364619..7c8b2f628 100644 --- a/lib/rig_control.c +++ b/lib/rig_control.c @@ -23,9 +23,6 @@ int set_conf(RIG *my_rig, char *conf_parms) *q++ = '\0'; n = strchr(q, ','); if (n) *n++ = '\0'; - - printf("%s %s\n",p,q); - iret = rig_set_conf(my_rig, rig_token_lookup(my_rig, p), q); if (iret != RIG_OK) return iret; diff --git a/mainwindow.cpp b/mainwindow.cpp index 72aaa4b12..ffb972844 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -177,7 +177,6 @@ MainWindow::MainWindow(QSharedMemory *shdmem, QWidget *parent) : m_watchdogLimit=5; m_tune=false; m_repeatMsg=0; - m_bRigOpen=false; decodeBusy(false); ui->xThermo->setFillBrush(Qt::green); @@ -286,23 +285,6 @@ MainWindow::MainWindow(QSharedMemory *shdmem, QWidget *parent) : } } #endif - -//### - if(m_catEnabled) { - QString conf_parms; - conf_parms.sprintf("data_bits=%d,stop_bits=%d,serial_handshake=", - m_dataBits,m_stopBits); - conf_parms+=m_handshake; - int iret=rigOpen(0,m_rig,m_catPort.toAscii().data(),m_serialRate, - conf_parms.toAscii().data()); - if(iret!=0) { - msgBox("Failed to open connection to radio."); - return; - } - m_bRigOpen=true; - } -//### - } // End of MainWindow constructor //--------------------------------------------------- MainWindow destructor @@ -617,7 +599,6 @@ void MainWindow::on_actionDeviceSetup_triggered() //Setup Dialog dlg.m_stopBitsIndex=m_stopBitsIndex; dlg.m_handshake=m_handshake; dlg.m_handshakeIndex=m_handshakeIndex; - dlg.m_bRigOpen=m_bRigOpen; dlg.initDlg(); if(dlg.exec() == QDialog::Accepted) { @@ -646,7 +627,6 @@ void MainWindow::on_actionDeviceSetup_triggered() //Setup Dialog m_stopBitsIndex=dlg.m_stopBitsIndex; m_handshake=dlg.m_handshake; m_handshakeIndex=dlg.m_handshakeIndex; - m_bRigOpen=dlg.m_bRigOpen; #ifdef WIN32 if(dlg.m_pskReporter!=m_pskReporter) { @@ -1426,8 +1406,8 @@ void MainWindow::guiUpdate() //Raise PTT if(m_pttMethodIndex==0) { //CAT control for PTT m_cmnd=rig_command() + " T 1"; -// p3.start(m_cmnd); -// p3.waitForFinished(); + p3.start(m_cmnd); + p3.waitForFinished(); m_iptt=1; } if(m_pttMethodIndex==1 or m_pttMethodIndex==2) { //DTR or RTS @@ -1559,8 +1539,8 @@ void MainWindow::guiUpdate() //Lower PTT if(m_pttMethodIndex==0) { //CAT m_cmnd=rig_command() + " T 0"; -// p3.start(m_cmnd); -// p3.waitForFinished(); + p3.start(m_cmnd); + p3.waitForFinished(); } if(m_pttMethodIndex==1 or m_pttMethodIndex==2) { //DTR-RTS ptt(m_pttPort,0,&m_iptt,&m_COMportOpen); @@ -1618,20 +1598,12 @@ void MainWindow::guiUpdate() } m_hsym0=khsym; m_sec0=nsec; -/* + if(m_catEnabled) { m_cmnd=rig_command() + " f"; p3.start(m_cmnd); p3.waitForFinished(); } -*/ - if(m_bRigOpen) { - int fHz; - int iret=rigFreq(&fHz); - double fMHz=fHz/1000000.0; - int d=1000000.0*(fMHz-m_dialFreq); - if(abs(d)>0) dialFreqChanged2(fMHz); - } } iptt0=m_iptt; @@ -1703,8 +1675,8 @@ void MainWindow::stopTx2() //Lower PTT if(m_pttMethodIndex==0) { m_cmnd=rig_command() + " T 0"; -// p3.start(m_cmnd); -// p3.waitForFinished(); + p3.start(m_cmnd); + p3.waitForFinished(); } if(m_pttMethodIndex==1 or m_pttMethodIndex==2) { ptt(m_pttPort,0,&m_iptt,&m_COMportOpen); @@ -2435,9 +2407,8 @@ void MainWindow::on_bandComboBox_currentIndexChanged(int index) m_dialFreq=t.toDouble(); dialFreqChanged2(m_dialFreq); m_repeatMsg=0; - int nHz=int(1000000.0*m_dialFreq + 0.5); -/* if(m_catEnabled) { + int nHz=int(1000000.0*m_dialFreq + 0.5); QString cmnd1,cmnd3; cmnd1=rig_command(); cmnd3.sprintf(" F %d",nHz); @@ -2445,9 +2416,6 @@ void MainWindow::on_bandComboBox_currentIndexChanged(int index) p3.start(m_cmnd); p3.waitForFinished(); } -*/ - - if(m_bRigOpen) rigSetFreq(nHz); } void MainWindow::on_actionPrompt_to_log_QSO_triggered(bool checked) diff --git a/mainwindow.h b/mainwindow.h index f7bee54a3..89b9b471a 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -247,7 +247,6 @@ private: bool m_runaway; bool m_tx2QSO; bool m_tune; - bool m_bRigOpen; char m_decoded[80]; @@ -342,7 +341,7 @@ extern int killbyname(const char* progName); extern void getDev(int* numDevices,char hostAPI_DeviceName[][50], int minChan[], int maxChan[], int minSpeed[], int maxSpeed[]); -extern int ptt(int nport, int itx, int* iptt, int* nopen); +extern int ptt(int nport, int itx, int* iptt); //extern int ReporterInitialize(char* hostname, char* port); @@ -366,13 +365,9 @@ void morse_(char* msg, int* icw, int* ncw, int len); //void rig_control(int nrig, int verbose); -int rigOpen(int vervose, int nrig, const char* rig_file, int serial_rate, - const char* conf_parms); - +int rigOpen(int nrig, int verbose); void rigSetFreq(int fHz); -int rigFreq(int *fHz); -int rigSetPTT(int iptt); -void rigClose(); +int rigFreq(); } diff --git a/mainwindow.ui b/mainwindow.ui index 8a8b0016c..15c351b70 100644 --- a/mainwindow.ui +++ b/mainwindow.ui @@ -2097,7 +2097,7 @@ answer callers - false + true Configuration