diff --git a/devsetup.cpp b/devsetup.cpp index 1264ff593..9e4b8da5d 100644 --- a/devsetup.cpp +++ b/devsetup.cpp @@ -139,6 +139,7 @@ void DevSetup::initDlg() m_paInDevice=m_inDevList[m_nDevIn]; m_paOutDevice=m_outDevList[m_nDevOut]; ui.cbEnableCAT->setChecked(m_catEnabled); + ui.cbDTRoff->setChecked(m_bDTRoff); ui.catPortComboBox->setEnabled(m_catEnabled); ui.rigComboBox->setEnabled(m_catEnabled); ui.serialRateComboBox->setEnabled(m_catEnabled); @@ -397,12 +398,16 @@ void DevSetup::on_testCATButton_clicked() sprintf(buf,"%d",m_stopBits); rig->setConf("stop_bits",buf); rig->setConf("serial_handshake",m_handshake.toAscii().data()); + if(m_bDTRoff) { + rig->setConf("rts_state","OFF"); + rig->setConf("dtr_state","OFF"); + } rig->open(); m_bRigOpen=true; } catch (const RigException &Ex) { m_bRigOpen=false; - msgBox("Failed to open rig (A)"); + msgBox("Failed to open rig (devsetup)"); return; } double fMHz=rig->getFreq(RIG_VFO_CURR)/1000000.0; @@ -413,7 +418,6 @@ void DevSetup::on_testCATButton_clicked() void DevSetup::on_testPTTButton_clicked() { - int iret=0; m_test=1-m_test; if(m_pttMethodIndex==1 or m_pttMethodIndex==2) { ptt(m_pttPort,m_test,&m_iptt,&m_COMportOpen); @@ -422,3 +426,8 @@ void DevSetup::on_testPTTButton_clicked() rig->setPTT((ptt_t)m_iptt, RIG_VFO_CURR); } } + +void DevSetup::on_cbDTRoff_toggled(bool checked) +{ + m_bDTRoff=checked; +} diff --git a/devsetup.h b/devsetup.h index c9186f6ec..65477bc80 100644 --- a/devsetup.h +++ b/devsetup.h @@ -5,7 +5,7 @@ #include #include #include "ui_devsetup.h" -#include "mainwindow.h" +#include class DevSetup : public QDialog { @@ -46,6 +46,7 @@ public: bool m_catEnabled; bool m_After73; bool m_bRigOpen; + bool m_bDTRoff; QString m_myCall; QString m_myGrid; @@ -57,8 +58,6 @@ public: QStringList m_macro; QStringList m_dFreq; - Rig* rig; - QProcess p4; QMessageBox msgBox0; @@ -85,9 +84,14 @@ private slots: void on_testPTTButton_clicked(); + void on_cbDTRoff_toggled(bool checked); + private: + Rig* rig; void msgBox(QString t); Ui::DialogSndCard ui; }; +extern int ptt(int nport, int ntx, int* iptt, int* nopen); + #endif // DEVSETUP_H diff --git a/devsetup.ui b/devsetup.ui index 33119f228..29af0e20c 100644 --- a/devsetup.ui +++ b/devsetup.ui @@ -772,6 +772,26 @@ + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + RTS/DTR OFF + + + diff --git a/mainwindow.cpp b/mainwindow.cpp index 79d21dfe4..da48c366a 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -17,6 +17,7 @@ static int nc1=1; wchar_t buffer[256]; bool btxok; //True if OK to transmit bool btxMute; +bool bDTRoff; double outputLatency; //Latency in seconds double dFreq[]={0.136,0.4742,1.838,3.578,5.357,7.078,10.130,14.078, 18.104,21.078,24.918,28.078,50.293,70.091,144.489,432.178}; @@ -400,6 +401,7 @@ void MainWindow::writeSettings() settings.setValue("Runaway",m_runaway); settings.setValue("Tx2QSO",m_tx2QSO); settings.setValue("MultipleOK",m_bMultipleOK); + settings.setValue("DTRoff",bDTRoff); settings.endGroup(); } @@ -512,6 +514,7 @@ void MainWindow::readSettings() ui->actionTx2QSO->setChecked(m_tx2QSO); m_bMultipleOK=settings.value("MultipleOK",false).toBool(); ui->actionAllow_multiple_instances->setChecked(m_bMultipleOK); + bDTRoff=settings.value("DTRoff",false).toBool(); if(!ui->actionLinrad->isChecked() && !ui->actionCuteSDR->isChecked() && !ui->actionAFMHot->isChecked() && !ui->actionBlue->isChecked()) { @@ -619,6 +622,7 @@ void MainWindow::on_actionDeviceSetup_triggered() //Setup Dialog dlg.m_stopBitsIndex=m_stopBitsIndex; dlg.m_handshake=m_handshake; dlg.m_handshakeIndex=m_handshakeIndex; + dlg.m_bDTRoff=bDTRoff; if(m_bRigOpen) { rig->close(); @@ -654,6 +658,7 @@ void MainWindow::on_actionDeviceSetup_triggered() //Setup Dialog m_stopBitsIndex=dlg.m_stopBitsIndex; m_handshake=dlg.m_handshake; m_handshakeIndex=dlg.m_handshakeIndex; + bDTRoff=dlg.m_bDTRoff; #ifdef WIN32 if(dlg.m_pskReporter!=m_pskReporter) { @@ -2621,13 +2626,17 @@ void MainWindow::rigOpen() sprintf(buf,"%d",m_stopBits); rig->setConf("stop_bits",buf); rig->setConf("serial_handshake",m_handshake.toAscii().data()); + if(bDTRoff) { + rig->setConf("rts_state","OFF"); + rig->setConf("dtr_state","OFF"); + } rig->open(); m_bRigOpen=true; } catch (const RigException &Ex) { m_catEnabled=false; m_bRigOpen=false; - msgBox("Failed to open rig (B)"); + msgBox("Failed to open rig (mainwindow)"); delete rig; } } diff --git a/mainwindow.h b/mainwindow.h index 6740b7179..d43cc06e7 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -255,6 +255,8 @@ private: bool m_tune; bool m_bRigOpen; bool m_bMultipleOK; +// bool junk999; + char m_decoded[80]; float m_pctZap;