From b954f1d85d3c914a53d2dfd274993b00106cc895 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Thu, 25 Apr 2013 22:57:08 +0000 Subject: [PATCH] "Data" and "Mic" options for PTT via CAT control. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@3223 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- devsetup.cpp | 16 ++++++++++++++-- devsetup.h | 4 ++-- devsetup.ui | 33 +++++++++++++++++++++++++++++++++ mainwindow.cpp | 11 ++++++++--- mainwindow.h | 1 + 5 files changed, 58 insertions(+), 7 deletions(-) diff --git a/devsetup.cpp b/devsetup.cpp index 3dc91b8d5..7bc1f2921 100644 --- a/devsetup.cpp +++ b/devsetup.cpp @@ -155,13 +155,13 @@ void DevSetup::initDlg() ui.dataBitsComboBox->setEnabled(m_catEnabled); ui.stopBitsComboBox->setEnabled(m_catEnabled); ui.handshakeComboBox->setEnabled(m_catEnabled); - ui.rigComboBox->setCurrentIndex(m_rigIndex); ui.catPortComboBox->setCurrentIndex(m_catPortIndex); ui.serialRateComboBox->setCurrentIndex(m_serialRateIndex); ui.dataBitsComboBox->setCurrentIndex(m_dataBitsIndex); ui.stopBitsComboBox->setCurrentIndex(m_stopBitsIndex); ui.handshakeComboBox->setCurrentIndex(m_handshakeIndex); + ui.rbData->setChecked(m_pttData); // PY2SDR -- Per OS serial port names ui.catPortComboBox->clear(); @@ -436,8 +436,15 @@ void DevSetup::on_testPTTButton_clicked() if(m_pttMethodIndex==1 or m_pttMethodIndex==2) { ptt(m_pttPort,m_test,&m_iptt,&m_COMportOpen); } + if(m_pttMethodIndex==0 and !m_bRigOpen) { + on_testCATButton_clicked(); + } if(m_pttMethodIndex==0 and m_bRigOpen) { - rig->setPTT((ptt_t)m_iptt, RIG_VFO_CURR); + if(m_test==0) rig->setPTT(RIG_PTT_OFF, RIG_VFO_CURR); + if(m_test==1) { + if(m_pttData) rig->setPTT(RIG_PTT_ON_DATA, RIG_VFO_CURR); + if(!m_pttData) rig->setPTT(RIG_PTT_ON_MIC, RIG_VFO_CURR); + } } } @@ -445,3 +452,8 @@ void DevSetup::on_cbDTRoff_toggled(bool checked) { m_bDTRoff=checked; } + +void DevSetup::on_rbData_toggled(bool checked) +{ + m_pttData=checked; +} diff --git a/devsetup.h b/devsetup.h index 65477bc80..35e618bb9 100644 --- a/devsetup.h +++ b/devsetup.h @@ -47,6 +47,7 @@ public: bool m_After73; bool m_bRigOpen; bool m_bDTRoff; + bool m_pttData; QString m_myCall; QString m_myGrid; @@ -81,10 +82,9 @@ private slots: void on_rigComboBox_activated(int index); void on_cbID73_toggled(bool checked); void on_testCATButton_clicked(); - void on_testPTTButton_clicked(); - void on_cbDTRoff_toggled(bool checked); + void on_rbData_toggled(bool checked); private: Rig* rig; diff --git a/devsetup.ui b/devsetup.ui index 29af0e20c..1ec6625ae 100644 --- a/devsetup.ui +++ b/devsetup.ui @@ -934,6 +934,39 @@ + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 40 + 20 + + + + + + + + Data + + + + + + + Mic + + + true + + + diff --git a/mainwindow.cpp b/mainwindow.cpp index fddf71f3d..a7c78f9ad 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -401,6 +401,7 @@ void MainWindow::writeSettings() settings.setValue("Tx2QSO",m_tx2QSO); settings.setValue("MultipleOK",m_bMultipleOK); settings.setValue("DTRoff",m_bDTRoff); + settings.setValue("pttData",m_pttData); settings.endGroup(); } @@ -514,6 +515,7 @@ void MainWindow::readSettings() m_bMultipleOK=settings.value("MultipleOK",false).toBool(); ui->actionAllow_multiple_instances->setChecked(m_bMultipleOK); m_bDTRoff=settings.value("DTRoff",false).toBool(); + m_pttData=settings.value("pttData",false).toBool(); if(!ui->actionLinrad->isChecked() && !ui->actionCuteSDR->isChecked() && !ui->actionAFMHot->isChecked() && !ui->actionBlue->isChecked()) { @@ -622,6 +624,7 @@ void MainWindow::on_actionDeviceSetup_triggered() //Setup Dialog dlg.m_handshake=m_handshake; dlg.m_handshakeIndex=m_handshakeIndex; dlg.m_bDTRoff=m_bDTRoff; + dlg.m_pttData=m_pttData; if(m_bRigOpen) { rig->close(); @@ -658,6 +661,7 @@ void MainWindow::on_actionDeviceSetup_triggered() //Setup Dialog m_handshake=dlg.m_handshake; m_handshakeIndex=dlg.m_handshakeIndex; m_bDTRoff=dlg.m_bDTRoff; + m_pttData=dlg.m_pttData; #ifdef WIN32 if(dlg.m_pskReporter!=m_pskReporter) { @@ -1450,7 +1454,8 @@ void MainWindow::guiUpdate() //Raise PTT if(m_catEnabled and m_bRigOpen and m_pttMethodIndex==0) { m_iptt=1; - rig->setPTT((ptt_t)m_iptt, RIG_VFO_CURR); //CAT control for PTT=1 + if(m_pttData) rig->setPTT(RIG_PTT_ON_DATA, RIG_VFO_CURR); + if(!m_pttData) rig->setPTT(RIG_PTT_ON_MIC, RIG_VFO_CURR); } if(m_pttMethodIndex==1 or m_pttMethodIndex==2) { //DTR or RTS ptt(m_pttPort,1,&m_iptt,&m_COMportOpen); @@ -1579,7 +1584,7 @@ void MainWindow::guiUpdate() //Lower PTT if(m_catEnabled and m_bRigOpen and m_pttMethodIndex==0) { m_iptt=0; - rig->setPTT((ptt_t)m_iptt, RIG_VFO_CURR); //CAT control for PTT=1 + rig->setPTT(RIG_PTT_OFF, RIG_VFO_CURR); //CAT control for PTT=0 } if(m_pttMethodIndex==1 or m_pttMethodIndex==2) { //DTR-RTS ptt(m_pttPort,0,&m_iptt,&m_COMportOpen); @@ -1708,7 +1713,7 @@ void MainWindow::stopTx2() { //Lower PTT if(m_catEnabled and m_bRigOpen and m_pttMethodIndex==0) { - rig->setPTT((ptt_t)m_iptt, RIG_VFO_CURR); //CAT control for PTT=0 + rig->setPTT(RIG_PTT_OFF, RIG_VFO_CURR); //CAT control for PTT=0 } if(m_pttMethodIndex==1 or m_pttMethodIndex==2) { ptt(m_pttPort,0,&m_iptt,&m_COMportOpen); diff --git a/mainwindow.h b/mainwindow.h index aea181521..872f22033 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -256,6 +256,7 @@ private: bool m_bRigOpen; bool m_bMultipleOK; bool m_bDTRoff; + bool m_pttData; char m_decoded[80];