Warning: these changes have not yet been thoroughly tested!

1. Correct the TxMode label on program startup.
2. Insert TxMode (not RxMode) into the "Transmitting..." lines in ALL.TXT.
3. Put TxMode in wsjtx_status.txt.
4. F4 clears Az, Dist, and all Tx messages as well as DxCall and DxGrid.
5. Make it possible to decode JT9 in the "JT65 region", and vice-versa, with
   directed double-click on signal in waterfall.
6. Improved logic for enabling/disabling TestPTT button on setup screen.
7. Do not call getFreq() when TestPTT is activated under CAT control.


git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@3463 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
Joe Taylor 2013-07-08 19:57:01 +00:00
parent 3dc6abc0c1
commit a4cc4f4101
6 changed files with 73 additions and 37 deletions

View File

@ -12,7 +12,7 @@ CAboutDlg::CAboutDlg(QWidget *parent, QString Revision) :
m_Str += "WSJT-X implements experimental mode JT9 for <br>";
m_Str += "Amateur Radio communication at HF, MF, and LF. <br><br>";
m_Str += "Copyright 2001-2013 by Joe Taylor, K1JT. Additional <br>";
m_Str += "contributions from AC6SL, AE4JY, G4KLA, PY2SDR, <br>";
m_Str += "contributions from AC6SL, AE4JY, G4KLA, K3WYC, PY2SDR, <br>";
m_Str += "and VK4BDJ.<br>";
ui->labelTxt->setText(m_Str);
}

View File

@ -381,8 +381,8 @@ void DevSetup::on_cbEnableCAT_toggled(bool b)
{
m_catEnabled=b;
enableWidgets();
bool b2=(m_pttMethodIndex==1 or m_pttMethodIndex==2 or m_catEnabled) and
!(m_pttMethodIndex==3);
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);
}
@ -424,6 +424,26 @@ void DevSetup::on_cbID73_toggled(bool checked)
}
void DevSetup::on_testCATButton_clicked()
{
openRig();
if(!m_catEnabled) return;
QString t;
double fMHz=rig->getFreq(RIG_VFO_CURR)/1000000.0;
if(fMHz>0.0) {
t.sprintf("Rig control appears to be working.\nDial Frequency: %.6f MHz",
fMHz);
} else {
t.sprintf("Rig control error %d\nFailed to read frequency.",
int(1000000.0*fMHz));
if(m_poll>0) {
m_catEnabled=false;
ui.cbEnableCAT->setChecked(false);
}
}
msgBox(t);
}
void DevSetup::openRig()
{
QString t;
int ret;
@ -440,6 +460,7 @@ void DevSetup::on_testCATButton_clicked()
if(m_rig<9900) {
if (!rig->init(m_rig)) {
msgBox("Rig init failure");
m_catEnabled=false;
return;
}
QString sCATport=m_catPort;
@ -471,32 +492,17 @@ void DevSetup::on_testCATButton_clicked()
ui.cbEnableCAT->setChecked(false);
return;
}
double fMHz=rig->getFreq(RIG_VFO_CURR)/1000000.0;
if(fMHz>0.0) {
t.sprintf("Rig control appears to be working.\nDial Frequency: %.6f MHz",
fMHz);
} else {
t.sprintf("Rig control error %d\nFailed to read frequency.",
int(1000000.0*fMHz));
if(m_poll>0) {
m_catEnabled=false;
ui.cbEnableCAT->setChecked(false);
}
}
msgBox(t);
}
void DevSetup::on_testPTTButton_clicked()
{
m_test=1-m_test;
if(m_pttMethodIndex==1 or m_pttMethodIndex==2) {
// qDebug() << "devsetup line 492:" << m_pttPort << m_test << &g2_iptt << &g2_COMportOpen;
ptt(m_pttPort,m_test,&g2_iptt,&g2_COMportOpen);
// qDebug() << "devsetup line 494:" << m_pttPort << m_test << &g2_iptt << &g2_COMportOpen;
}
if(m_pttMethodIndex==0 and !m_bRigOpen) {
on_testCATButton_clicked();
// on_testCATButton_clicked();
openRig();
}
if(m_pttMethodIndex==0 and m_bRigOpen) {
if(m_test==0) rig->setPTT(RIG_PTT_OFF, RIG_VFO_CURR);
@ -525,6 +531,7 @@ void DevSetup::on_pollSpinBox_valueChanged(int n)
void DevSetup::on_pttComboBox_currentIndexChanged(int index)
{
m_pttPort=index;
enableWidgets();
}
void DevSetup::on_pttMethodComboBox_currentIndexChanged(int index)
@ -566,10 +573,10 @@ void DevSetup::enableWidgets()
ui.pollSpinBox->setEnabled(m_catEnabled);
bool b1=(m_pttMethodIndex==1 or m_pttMethodIndex==2);
ui.pttComboBox->setEnabled(b1);
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);
// ui.testPTTButton->setEnabled(b1 or b2);
ui.testPTTButton->setEnabled(b1 or b2 or b3); //Include PTT via HRD or Commander
}

View File

@ -101,6 +101,7 @@ private:
Rig* rig;
void msgBox(QString t);
void enableWidgets();
void openRig();
Ui::DialogSndCard ui;
};

View File

@ -81,11 +81,11 @@ subroutine decoder(ss,id2)
if(nqd.eq.1) then
limit=100000
ccfok(ia:ib)=.true.
nfa1=nfqso-ntol
nfb1=nfqso+ntol
ia=max(1,nint((nfa1-nf0)/df3))
ib=min(NSMAX,nint((nfb1-nf0)/df3))
ccfok(ia:ib)=.true.
ia1=ia
ib1=ib
else
@ -102,7 +102,8 @@ subroutine decoder(ss,id2)
fgood=0.
do i=ia,ib
f=(i-1)*df3
if(done(i) .or. (.not.ccfok(i)) .or. (ccfred(i).lt.ccflim-1.0)) cycle
if(done(i) .or. (.not.ccfok(i)) .or. &
(nqd.eq.0 .and. (ccfred(i).lt.ccflim-1.0))) cycle
if(nqd.eq.1 .or. &
(ccfred(i).ge.ccflim .and. abs(f-fgood).gt.10.0*df8)) then

View File

@ -513,8 +513,8 @@ void MainWindow::readSettings()
"PaletteBlue",false).toBool());
m_mode=settings.value("Mode","JT9").toString();
m_modeTx=settings.value("ModeTx","JT9").toString();
if(m_mode=="JT9") ui->pbTxMode->setText("Tx JT9 @");
if(m_mode=="JT65") ui->pbTxMode->setText("Tx JT65 #");
if(m_modeTx=="JT9") ui->pbTxMode->setText("Tx JT9 @");
if(m_modeTx=="JT65") ui->pbTxMode->setText("Tx JT65 #");
ui->actionNone->setChecked(settings.value("SaveNone",true).toBool());
ui->actionSave_decoded->setChecked(settings.value(
"SaveDecoded",false).toBool());
@ -980,8 +980,7 @@ void MainWindow::statusChanged()
if(f.open(QFile::WriteOnly | QIODevice::Text)) {
QTextStream out(&f);
out << m_dialFreq << ";" << m_mode << ";" << m_hisCall << ";"
<< ui->rptSpinBox->value() << endl;
// out << m_dialFreq << ";" << m_mode << ";" << m_hisCall << endl;
<< ui->rptSpinBox->value() << m_modeTx << endl;
f.close();
} else {
msgBox("Cannot open file \"wsjtx_status.txt\".");
@ -1629,7 +1628,7 @@ void MainWindow::guiUpdate()
f.open(QIODevice::WriteOnly | QIODevice::Text | QIODevice::Append);
QTextStream out(&f);
out << QDateTime::currentDateTimeUtc().toString("hhmm")
<< " Transmitting " << m_dialFreq << " MHz " << m_mode
<< " Transmitting " << m_dialFreq << " MHz " << m_modeTx
<< ": " << t << endl;
f.close();
if(m_tx2QSO) displayTxMsg(t);
@ -1704,7 +1703,7 @@ void MainWindow::guiUpdate()
f.open(QIODevice::WriteOnly | QIODevice::Text | QIODevice::Append);
QTextStream out(&f);
out << QDateTime::currentDateTimeUtc().toString("hhmm")
<< " Transmitting " << m_dialFreq << " MHz " << m_mode
<< " Transmitting " << m_dialFreq << " MHz " << m_modeTx
<< ": " << t << endl;
f.close();
}
@ -2004,12 +2003,12 @@ void MainWindow::doubleClickOnCall(bool shift, bool ctrl)
if(t4.at(4)=="@") {
m_modeTx="JT9";
ui->pbTxMode->setText("Tx JT9 @");
ui->pbTxMode->setText("Tx JT9 @");
g_pWideGraph->setModeTx(m_modeTx);
}
if(t4.at(4)=="#") {
m_modeTx="JT65";
ui->pbTxMode->setText("Tx JT65 #");
ui->pbTxMode->setText("Tx JT65 #");
g_pWideGraph->setModeTx(m_modeTx);
}
QString firstcall=t4.at(5);
@ -2107,6 +2106,19 @@ void MainWindow::genStdMsgs(QString rpt) //genStdMsgs()
{
QString hisCall=ui->dxCallEntry->text().toUpper().trimmed();
ui->dxCallEntry->setText(hisCall);
if(hisCall=="") {
ui->labAz->setText("");
ui->labDist->setText("");
ui->tx1->setText("");
ui->tx2->setText("");
ui->tx3->setText("");
ui->tx4->setText("");
ui->tx5->setText("");
ui->tx6->setText("");
ui->genMsg->setText("");
ui->freeTextMsg->setText("");
return;
}
QString hisBase=baseCall(hisCall);
QString myBase=baseCall(m_myCall);
QString t0=hisBase + " " + myBase + " ";
@ -2359,7 +2371,19 @@ void MainWindow::on_dxCallEntry_textChanged(const QString &t) //dxCall changed
void MainWindow::on_dxGridEntry_textChanged(const QString &t) //dxGrid changed
{
int n=t.length();
if(n!=4 and n!=6) return;
if(n!=4 and n!=6) {
ui->labAz->setText("");
ui->labDist->setText("");
ui->tx1->setText("");
ui->tx2->setText("");
ui->tx3->setText("");
ui->tx4->setText("");
ui->tx5->setText("");
ui->tx6->setText("");
ui->genMsg->setText("");
ui->freeTextMsg->setText("");
return;
}
if(!t[0].isLetter() or !t[1].isLetter()) return;
if(!t[2].isDigit() or !t[3].isDigit()) return;
if(n==4) m_hisGrid=t.mid(0,2).toUpper() + t.mid(2,2);
@ -2652,6 +2676,9 @@ 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);
if(m_bSplit or m_bXIT) setXIT(m_txFreq);
// ret=rig->setSplitFreq(MHz(m_dialFreq)+xit,RIG_VFO_B);
bumpFqso(11);
bumpFqso(12);
if(ret!=RIG_OK) {
@ -2922,10 +2949,10 @@ void MainWindow::on_pbTxMode_clicked()
{
if(m_modeTx=="JT9") {
m_modeTx="JT65";
ui->pbTxMode->setText("Tx JT65 #");
ui->pbTxMode->setText("Tx JT65 #");
} else {
m_modeTx="JT9";
ui->pbTxMode->setText("Tx JT9 @");
ui->pbTxMode->setText("Tx JT9 @");
}
g_pWideGraph->setModeTx(m_modeTx);
}

View File

@ -743,7 +743,7 @@ p, li { white-space: pre-wrap; }
<enum>QTabWidget::Triangular</enum>
</property>
<property name="currentIndex">
<number>0</number>
<number>1</number>
</property>
<widget class="QWidget" name="tab">
<attribute name="title">
@ -1887,7 +1887,7 @@ p, li { white-space: pre-wrap; }
<bool>true</bool>
</property>
<property name="text">
<string>Az</string>
<string/>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
@ -1918,7 +1918,7 @@ p, li { white-space: pre-wrap; }
</size>
</property>
<property name="text">
<string>Dist</string>
<string/>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>