"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
This commit is contained in:
Joe Taylor 2013-04-25 22:57:08 +00:00
parent 62bb024bd5
commit 37ee325aa2
5 changed files with 58 additions and 7 deletions

View File

@ -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;
}

View File

@ -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;

View File

@ -934,6 +934,39 @@
</item>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_14">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QRadioButton" name="rbData">
<property name="text">
<string>Data</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="rbMic">
<property name="text">
<string>Mic</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_6">
<property name="orientation">

View File

@ -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);

View File

@ -256,6 +256,7 @@ private:
bool m_bRigOpen;
bool m_bMultipleOK;
bool m_bDTRoff;
bool m_pttData;
char m_decoded[80];