From 1fd596ce606eaab757683df5deeaeed2f6bea51e Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Mon, 8 Jul 2013 23:08:25 +0000 Subject: [PATCH] 1. Changes outlined for r3463 are now tested and appear to be OK. 2. Setting frequencies above 100 MHz now OK. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@3464 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- devsetup.cpp | 12 ++++++++---- mainwindow.cpp | 15 ++++++++++++--- rigclass.cpp | 3 ++- 3 files changed, 22 insertions(+), 8 deletions(-) diff --git a/devsetup.cpp b/devsetup.cpp index 7acd4af20..bad3670d8 100644 --- a/devsetup.cpp +++ b/devsetup.cpp @@ -381,9 +381,9 @@ void DevSetup::on_cbEnableCAT_toggled(bool b) { m_catEnabled=b; enableWidgets(); - bool b2=m_pttMethodIndex==0 and m_catEnabled; - b2=b2 or ((m_pttMethodIndex==1 or m_pttMethodIndex==2) and m_pttPort!=0); - ui.testPTTButton->setEnabled(b2); +// bool b2=m_pttMethodIndex==0 and m_catEnabled; +// b2=b2 or ((m_pttMethodIndex==1 or m_pttMethodIndex==2) and m_pttPort!=0); +// ui.testPTTButton->setEnabled(b2); } void DevSetup::on_serialRateComboBox_activated(int index) @@ -576,8 +576,12 @@ void DevSetup::enableWidgets() b1=b1 and (m_pttPort!=0); bool b2 = (m_catEnabled and m_pttMethodIndex==1 and m_rig<9900) or (m_catEnabled and m_pttMethodIndex==2 and m_rig<9900); - bool b3 = (m_catEnabled and m_pttMethodIndex==0 and m_rig>=9900); + bool b3 = (m_catEnabled and m_pttMethodIndex==0); ui.testPTTButton->setEnabled(b1 or b2 or b3); //Include PTT via HRD or Commander + +// bool b2=m_pttMethodIndex==0 and m_catEnabled; +// b2=b2 or ((m_pttMethodIndex==1 or m_pttMethodIndex==2) and m_pttPort!=0); +// ui.testPTTButton->setEnabled(b2); } void DevSetup::on_cbSplit_toggled(bool checked) diff --git a/mainwindow.cpp b/mainwindow.cpp index eca1d5046..85cc24dfb 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -744,8 +744,6 @@ void MainWindow::on_actionDeviceSetup_triggered() //Setup Dialog m_bDTRoff=dlg.m_bDTRoff; m_pttData=dlg.m_pttData; m_poll=dlg.m_poll; - m_bSplit=dlg.m_bSplit; - m_bXIT=dlg.m_bXIT; #ifdef WIN32 if(dlg.m_pskReporter!=m_pskReporter) { @@ -794,6 +792,15 @@ void MainWindow::on_actionDeviceSetup_triggered() //Setup Dialog } else { ui->readFreq->setStyleSheet(""); } + + if(dlg.m_bSplit!=m_bSplit or dlg.m_bXIT!=m_bXIT) { + m_bSplit=dlg.m_bSplit; + m_bXIT=dlg.m_bXIT; + if(m_bSplit or m_bXIT) setXIT(m_txFreq); + int ret; + if(m_bRigOpen and !m_bSplit) ret=rig->setSplitFreq(MHz(m_dialFreq),RIG_VFO_B); + } + } void MainWindow::on_monitorButton_clicked() //Monitor @@ -980,7 +987,7 @@ void MainWindow::statusChanged() if(f.open(QFile::WriteOnly | QIODevice::Text)) { QTextStream out(&f); out << m_dialFreq << ";" << m_mode << ";" << m_hisCall << ";" - << ui->rptSpinBox->value() << m_modeTx << endl; + << ui->rptSpinBox->value() << ";" << m_modeTx << endl; f.close(); } else { msgBox("Cannot open file \"wsjtx_status.txt\"."); @@ -2676,6 +2683,7 @@ void MainWindow::on_bandComboBox_activated(int index) m_dontReadFreq=true; ret=rig->setFreq(MHz(m_dialFreq)); // ret=rig->setSplitFreq(MHz(m_dialFreq),RIG_VFO_B); + qDebug() << "A" << m_dialFreq << m_txFreq; if(m_bSplit or m_bXIT) setXIT(m_txFreq); // ret=rig->setSplitFreq(MHz(m_dialFreq)+xit,RIG_VFO_B); @@ -2955,6 +2963,7 @@ void MainWindow::on_pbTxMode_clicked() ui->pbTxMode->setText("Tx JT9 @"); } g_pWideGraph->setModeTx(m_modeTx); + statusChanged(); } void MainWindow::setXIT(int n) diff --git a/rigclass.cpp b/rigclass.cpp index a4c06850a..6ce774b84 100644 --- a/rigclass.cpp +++ b/rigclass.cpp @@ -101,6 +101,7 @@ int Rig::open(int n) { } } if(n==9998) { +// qDebug() << "A" << socket->state(); socket->connectToHost(QHostAddress::LocalHost, 52002); if(!socket->waitForConnected(1000)) { return -1; @@ -163,7 +164,7 @@ int Rig::setFreq(freq_t freq, vfo_t vfo) { } else if(m_cmndr) { QString t; qint32 nkHz=int(0.001*freq); - t.sprintf("CmdSetFreq%5d",nkHz); + t.sprintf("CmdSetFreq%6d",nkHz); QByteArray ba = t.toLocal8Bit(); const char* buf=ba.data(); socket->write(buf);