LogQSO now has a confirmation step where you can edit the log entries.

Tx macros are now enabled.
Bug in decoder fixed.


git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@3068 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
Joe Taylor 2013-03-21 22:58:16 +00:00
parent 64f5c2d92d
commit 67cf0fb5c6
9 changed files with 232 additions and 107 deletions

View File

@ -120,6 +120,17 @@ void DevSetup::initDlg()
ui.cbPSKReporter->setChecked(m_pskReporter);
m_paInDevice=m_inDevList[m_nDevIn];
m_paOutDevice=m_outDevList[m_nDevOut];
ui.macro1->setText(m_macro[0].toUpper());
ui.macro2->setText(m_macro[1].toUpper());
ui.macro3->setText(m_macro[2].toUpper());
ui.macro4->setText(m_macro[3].toUpper());
ui.macro5->setText(m_macro[4].toUpper());
ui.macro6->setText(m_macro[5].toUpper());
ui.macro7->setText(m_macro[6].toUpper());
ui.macro8->setText(m_macro[7].toUpper());
ui.macro9->setText(m_macro[8].toUpper());
ui.macro10->setText(m_macro[9].toUpper());
}
//------------------------------------------------------- accept()
@ -144,6 +155,19 @@ void DevSetup::accept()
m_paInDevice=m_inDevList[m_nDevIn];
m_nDevOut=ui.comboBoxSndOut->currentIndex();
m_paOutDevice=m_outDevList[m_nDevOut];
m_macro.clear();
m_macro.append(ui.macro1->text());
m_macro.append(ui.macro2->text());
m_macro.append(ui.macro3->text());
m_macro.append(ui.macro4->text());
m_macro.append(ui.macro5->text());
m_macro.append(ui.macro6->text());
m_macro.append(ui.macro7->text());
m_macro.append(ui.macro8->text());
m_macro.append(ui.macro9->text());
m_macro.append(ui.macro10->text());
QDialog::accept();
}

View File

@ -31,6 +31,8 @@ public:
QString m_saveDir;
QString m_azelDir;
QStringList m_macro;
public slots:
void accept();

View File

@ -17,7 +17,7 @@
<item>
<widget class="QTabWidget" name="ioTabWidget">
<property name="currentIndex">
<number>0</number>
<number>1</number>
</property>
<widget class="QWidget" name="tab">
<attribute name="title">
@ -391,7 +391,7 @@
<attribute name="title">
<string>Tx Macros</string>
</attribute>
<widget class="QWidget" name="">
<widget class="QWidget" name="layoutWidget">
<property name="geometry">
<rect>
<x>110</x>
@ -828,7 +828,7 @@
</widget>
</item>
<item row="9" column="1">
<widget class="QLineEdit" name="macroG10">
<widget class="QLineEdit" name="macro10">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>

View File

@ -86,52 +86,41 @@ subroutine decoder(ss,c0)
i1=max(nint((nfqso-1000)/df3 - 10),ia)
i2=min(nint((nfqso-1000)/df3 + 10),ib)
ii=maxloc(ccfred(i1:i2))
i=ii(1) + i1 - 1
go to 12
i00=ii(1) + i1 - 1
10 ii=maxloc(ccfred(ia:ib))
i=ii(1) + ia - 1
12 f=(i-1)*df3
if((i.eq.ipk .or. (ccfred(i).ge.3.0) .and. abs(f-fgood).gt.10.0*df8 .and. &
ccfok(i))) then
call timer('decode9a',0)
fpk=1000.0 + df3*(i-1)
c1(1:npts8)=conjg(c0(1:npts8))
call decode9a(c1,npts8,nsps8,fpk,syncpk,snrdb,xdt,freq,drift,i1SoftSymbols)
call timer('decode9a',1)
do j=ia,ib
i=j
if(i.eq.i1) i=i00
f=(i-1)*df3
if(.not.ccfok(i)) cycle
if((i.eq.ipk .or. (ccfred(i).ge.3.0) .and. abs(f-fgood).gt.10.0*df8)) then
call timer('decode9a',0)
fpk=1000.0 + df3*(i-1)
c1(1:npts8)=conjg(c0(1:npts8))
call decode9a(c1,npts8,nsps8,fpk,syncpk,snrdb,xdt,freq,drift, &
i1SoftSymbols)
call timer('decode9a',1)
call timer('decode9 ',0)
call decode9(i1SoftSymbols,limit,nlim,msg)
call timer('decode9 ',1)
call timer('decode9 ',0)
call decode9(i1SoftSymbols,limit,nlim,msg)
call timer('decode9 ',1)
sync=(syncpk-1.0)/2.0
if(sync.lt.0.0 .or. snrdb.lt.dblim-2.0) sync=0.0
nsync=sync
if(nsync.gt.10) nsync=10
nsnr=nint(snrdb)
ndrift=nint(drift/df3)
if(sync.gt.sbest .and. fgood.eq.0.0) then
sbest=sync
write(line,fmt) nutc,nsync,nsnr,xdt,freq,ndrift
if(nsync.gt.0) nsynced=1
sync=(syncpk-1.0)/2.0
if(sync.lt.0.0 .or. snrdb.lt.dblim-2.0) sync=0.0
nsync=sync
if(nsync.gt.10) nsync=10
nsnr=nint(snrdb)
ndrift=nint(drift/df3)
if(msg.ne.' ') then
write(*,fmt) nutc,nsync,nsnr,xdt,freq,ndrift,msg
fgood=f
nsynced=1
ndecoded=1
! ccfred(max(ia,i-3):min(ib,i+11))=0.
ccfok(max(ia,i-3):min(ib,i+11))=.false.
endif
endif
if(msg.ne.' ') then
write(*,fmt) nutc,nsync,nsnr,xdt,freq,ndrift,msg
fgood=f
nsynced=1
ndecoded=1
ccfred(max(ia,i-3):min(ib,i+11))=0.
endif
endif
ccfred(i)=0.
if(maxval(ccfred(ia:ib)).gt.3.0) go to 10
if(fgood.eq.0.0) then
write(*,1020) line
1020 format(a33)
endif
enddo
write(*,1010) nsynced,ndecoded
1010 format('<DecodeFinished>',2i4)

View File

@ -1,7 +1,9 @@
#include "logqso.h"
#include "ui_logqso.h"
#include <QString>
#include <QDebug>
LogQSO::LogQSO(QWidget *parent) :
QDialog(parent),
ui(new Ui::LogQSO)
@ -14,13 +16,97 @@ LogQSO::~LogQSO()
delete ui;
}
void LogQSO::initLogQSO()
void LogQSO::initLogQSO(QString hisCall, QString hisGrid, QString mode,
QString rptSent, QString rptRcvd, QString date,
QString qsoStart, QString qsoStop, double dialFreq,
QString myCall, QString myGrid)
{
qDebug() << "A";
ui->call->setText(hisCall);
ui->grid->setText(hisGrid);
ui->mode->setText(mode);
ui->sent->setText(rptSent);
ui->rcvd->setText(rptRcvd);
date=date.mid(0,4) + "-" + date.mid(4,2) + "-" + date.mid(6,2);
ui->date->setText(date);
ui->time->setText(qsoStart);
m_dialFreq=dialFreq;
m_myCall=myCall;
m_myGrid=myGrid;
QString band="";
if(dialFreq>0.135 and dialFreq<0.139) band="2200m";
if(dialFreq>0.45 and dialFreq<0.55) band="630m";
if(dialFreq>1.8 and dialFreq<2.0) band="160m";
if(dialFreq>3.5 and dialFreq<4.0) band="80m";
if(dialFreq>5.1 and dialFreq<5.45) band="60m";
if(dialFreq>7.0 and dialFreq<7.3) band="40m";
if(dialFreq>10.0 and dialFreq<10.15) band="30m";
if(dialFreq>14.0 and dialFreq<14.35) band="20m";
if(dialFreq>18.068 and dialFreq<18.168) band="17m";
if(dialFreq>21.0 and dialFreq<21.45) band="15m";
if(dialFreq>24.890 and dialFreq<24.990) band="12m";
if(dialFreq>28.0 and dialFreq<29.7) band="10m";
if(dialFreq>50.0 and dialFreq<54.0) band="6m";
if(dialFreq>70.0 and dialFreq<71.0) band="4m";
if(dialFreq>144.0 and dialFreq<148.0) band="2m";
if(dialFreq>222.0 and dialFreq<225.0) band="1.25m";
if(dialFreq>420.0 and dialFreq<450.0) band="70cm";
if(dialFreq>902.0 and dialFreq<928.0) band="33cm";
if(dialFreq>1240.0 and dialFreq<1300.0) band="23cm";
if(dialFreq>2300.0 and dialFreq<2450.0) band="13cm";
if(dialFreq>3300.0 and dialFreq<3500.0) band="9cm";
if(dialFreq>5650.0 and dialFreq<5925.0) band="6cm";
if(dialFreq>10000.0 and dialFreq<10500.0) band="3cm";
if(dialFreq>24000.0 and dialFreq<24250.0) band="1.25cm";
if(dialFreq>47000.0 and dialFreq<47200.0) band="6mm";
if(dialFreq>75500.0 and dialFreq<81000.0) band="4mm";
ui->band->setText(band);
}
void LogQSO::accept()
{
qDebug() << "Z";
QFile f2("wsjtx_log.adi");
if(!f2.open(QIODevice::Text | QIODevice::Append)) {
QMessageBox m;
m.setText("Cannot open file \"wsjtx_log.adi\".");
m.exec();
} else {
QString hisCall,hisGrid,mode,rptSent,rptRcvd,date,qsoStart,band;
// if(qsoStart=="") qsoStart=qsoStop;
// if(qsoStop=="") qsoStop=qsoStart;
hisCall=ui->call->text();
hisGrid=ui->grid->text();
mode=ui->mode->text();
rptSent=ui->sent->text();
rptRcvd=ui->rcvd->text();
date=ui->date->text();
date=date.mid(0,4) + date.mid(5,2) + date.mid(8,2);
qsoStart=ui->time->text();
band=ui->band->text();
QString strDialFreq(QString::number(m_dialFreq,'f',6));
QTextStream out(&f2);
if(f2.size()==0) out << "WSJT-X ADIF Export<eoh>" << endl;
QString t;
t="<call:" + QString::number(hisCall.length()) + ">" + hisCall;
t+=" <gridsquare:" + QString::number(hisGrid.length()) + ">" + hisGrid;
t+=" <mode:" + QString::number(mode.length()) + ">" + mode;
t+=" <rst_sent:" + QString::number(rptSent.length()) + ">" + rptSent;
t+=" <rst_rcvd:" + QString::number(rptRcvd.length()) + ">" + rptRcvd;
t+=" <qso_date:8>" + date;
t+=" <time_on:4>" + qsoStart;
// t+=" <time_off:4>" + qsoStop;
t+=" <band:" + QString::number(band.length()) + ">" + band;
t+=" <freq:" + QString::number(strDialFreq.length()) + ">" + strDialFreq;
t+=" <station_callsign:" + QString::number(m_myCall.length()) + ">" +
m_myCall;
t+=" <my_gridsquare:" + QString::number(m_myGrid.length()) + ">" +
m_myGrid;
t+=" <eor>";
out << t << endl;
f2.close();
}
QDialog::accept();
}

View File

@ -1,7 +1,8 @@
#ifndef LogQSO_H
#define LogQSO_H
#include <QDialog>
#include <QtGui>
//#include <QDialog>
namespace Ui {
class LogQSO;
@ -14,7 +15,14 @@ class LogQSO : public QDialog
public:
explicit LogQSO(QWidget *parent = 0);
~LogQSO();
void initLogQSO();
void initLogQSO(QString hisCall, QString hisGrid, QString mode,
QString rptSent, QString rptRcvd, QString date,
QString qsoStart, QString qsoStop, double dialFreq,
QString myCall, QString myGrid);
double m_dialFreq;
QString m_myCall;
QString m_myGrid;
public slots:
void accept();

View File

@ -29,7 +29,7 @@
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
</widget>
<widget class="QWidget" name="">
<widget class="QWidget" name="layoutWidget">
<property name="geometry">
<rect>
<x>10</x>
@ -199,7 +199,7 @@
<item>
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<widget class="QLineEdit" name="lineEdit">
<widget class="QLineEdit" name="call">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
@ -221,7 +221,7 @@
</widget>
</item>
<item>
<widget class="QLineEdit" name="lineEdit_2">
<widget class="QLineEdit" name="date">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
@ -243,7 +243,7 @@
</widget>
</item>
<item>
<widget class="QLineEdit" name="lineEdit_3">
<widget class="QLineEdit" name="time">
<property name="minimumSize">
<size>
<width>50</width>
@ -259,7 +259,7 @@
</widget>
</item>
<item>
<widget class="QLineEdit" name="lineEdit_4">
<widget class="QLineEdit" name="mode">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
@ -281,7 +281,7 @@
</widget>
</item>
<item>
<widget class="QLineEdit" name="lineEdit_5">
<widget class="QLineEdit" name="band">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
@ -436,7 +436,7 @@
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLineEdit" name="lineEdit_6">
<widget class="QLineEdit" name="sent">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
@ -458,7 +458,7 @@
</widget>
</item>
<item>
<widget class="QLineEdit" name="lineEdit_7">
<widget class="QLineEdit" name="rcvd">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
@ -480,7 +480,7 @@
</widget>
</item>
<item>
<widget class="QLineEdit" name="lineEdit_8">
<widget class="QLineEdit" name="grid">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
@ -502,7 +502,7 @@
</widget>
</item>
<item>
<widget class="QLineEdit" name="lineEdit_9">
<widget class="QLineEdit" name="name">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
@ -548,7 +548,7 @@
</widget>
</item>
<item>
<widget class="QLineEdit" name="lineEdit_10"/>
<widget class="QLineEdit" name="comments"/>
</item>
</layout>
</item>

View File

@ -304,6 +304,7 @@ void MainWindow::writeSettings()
settings.setValue("Tol",m_tol);
settings.setValue("InGain",m_inGain);
settings.setValue("PSKReporter",m_pskReporter);
settings.setValue("Macros",m_macro);
settings.endGroup();
}
@ -367,6 +368,7 @@ void MainWindow::readSettings()
m_monitorStartOFF=settings.value("MonitorOFF",false).toBool();
ui->actionMonitor_OFF_at_startup->setChecked(m_monitorStartOFF);
m_pskReporter=settings.value("PSKReporter",false).toBool();
m_macro=settings.value("Macros","").toStringList();
settings.endGroup();
if(!ui->actionLinrad->isChecked() && !ui->actionCuteSDR->isChecked() &&
@ -457,6 +459,7 @@ void MainWindow::on_actionDeviceSetup_triggered() //Setup Dialog
dlg.m_nDevIn=m_nDevIn;
dlg.m_nDevOut=m_nDevOut;
dlg.m_pskReporter=m_pskReporter;
dlg.m_macro=m_macro;
dlg.initDlg();
if(dlg.exec() == QDialog::Accepted) {
@ -469,6 +472,8 @@ void MainWindow::on_actionDeviceSetup_triggered() //Setup Dialog
m_paInDevice=dlg.m_paInDevice;
m_nDevOut=dlg.m_nDevOut;
m_paOutDevice=dlg.m_paOutDevice;
m_macro=dlg.m_macro;
#ifdef WIN32
if(dlg.m_pskReporter!=m_pskReporter) {
if(dlg.m_pskReporter) {
@ -1008,7 +1013,7 @@ void MainWindow::readFromStdout() //readFromStdout
m_bdecoded = (t.mid(23,1).toInt()==1);
bool keepFile=m_saveAll or (m_saveSynced and m_bsynced) or
(m_saveDecoded and m_bdecoded);
if(!keepFile) {
if(!keepFile and !m_diskData) {
QFile savedFile(m_fname);
savedFile.remove();
}
@ -1718,46 +1723,19 @@ void MainWindow::on_logQSOButton_clicked() //Log QSO button
QString::number(dialFreq) + "," + m_mode + "," +
m_rptSent + "," + m_rptRcvd;
QTextStream out(&f);
// out << logEntry << "\r\n";
out << logEntry << endl;
f.close();
}
QFile f2("wsjtx_log.adi");
if(!f2.open(QIODevice::Text | QIODevice::Append)) {
msgBox("Cannot open file \"wsjtx_log.adi\".");
} else {
QTextStream out(&f2);
if(f2.size()==0) out << "WSJT-X ADIF Export<eoh>" << endl;
if(m_qsoStop=="") m_qsoStop=m_qsoStart;
if(m_qsoStart=="") m_qsoStart=m_qsoStop;
QString strDialFreq(QString::number(m_dialFreq,'f',6));
QString t;
t="<call:" + QString::number(m_hisCall.length()) + ">" + m_hisCall;
t+=" <gridsquare:" + QString::number(m_hisGrid.length()) + ">" + m_hisGrid;
t+=" <mode:" + QString::number(m_mode.length()) + ">" + m_mode;
t+=" <rst_sent:" + QString::number(m_rptSent.length()) + ">" + m_rptSent;
t+=" <rst_rcvd:" + QString::number(m_rptRcvd.length()) + ">" + m_rptRcvd;
t+=" <qso_date:8>" + date;
t+=" <time_on:4>" + m_qsoStart;
t+=" <time_off:4>" + m_qsoStop;
t+=" <freq:" + QString::number(strDialFreq.length()) + ">" + strDialFreq;
t+=" <station_callsign:" + QString::number(m_myCall.length()) + ">" + m_myCall;
t+=" <my_gridsquare:" + QString::number(m_myGrid.length()) + ">" + m_myGrid;
t+=" <eor>";
out << t << endl;
f2.close();
LogQSO logDlg(this);
logDlg.initLogQSO();
if(logDlg.exec() == QDialog::Accepted) {
qDebug() << "ZZ";
}
LogQSO logDlg(this);
logDlg.initLogQSO(m_hisCall,m_hisGrid,m_mode,m_rptSent,m_rptRcvd,date,
m_qsoStart,m_qsoStop,m_dialFreq,m_myCall,m_myGrid);
if(logDlg.exec() == QDialog::Accepted) {
}
m_rptSent="";
m_rptRcvd="";
m_qsoStart="";
m_qsoStop="";
}
void MainWindow::on_actionJT9_1_triggered()
@ -1915,24 +1893,52 @@ void MainWindow::showMacros(const QPoint &pos)
{
QPoint globalPos = ui->tx5->mapToGlobal(pos);
QMenu popupMenu;
QAction* popup1 = new QAction("5W DIP 73 GL",ui->tx5);
QAction* popup2 = new QAction("TNX 73 GL",ui->tx5);
popupMenu.addAction(popup1);
popupMenu.addAction(popup2);
QAction* popup1 = new QAction(m_macro[0],ui->tx5);
QAction* popup2 = new QAction(m_macro[1],ui->tx5);
QAction* popup3 = new QAction(m_macro[2],ui->tx5);
QAction* popup4 = new QAction(m_macro[3],ui->tx5);
QAction* popup5 = new QAction(m_macro[4],ui->tx5);
QAction* popup6 = new QAction(m_macro[5],ui->tx5);
QAction* popup7 = new QAction(m_macro[6],ui->tx5);
QAction* popup8 = new QAction(m_macro[7],ui->tx5);
QAction* popup9 = new QAction(m_macro[8],ui->tx5);
QAction* popup10 = new QAction(m_macro[9],ui->tx5);
if(m_macro[0]!="") popupMenu.addAction(popup1);
if(m_macro[1]!="") popupMenu.addAction(popup2);
if(m_macro[2]!="") popupMenu.addAction(popup3);
if(m_macro[3]!="") popupMenu.addAction(popup4);
if(m_macro[4]!="") popupMenu.addAction(popup5);
if(m_macro[5]!="") popupMenu.addAction(popup6);
if(m_macro[6]!="") popupMenu.addAction(popup7);
if(m_macro[7]!="") popupMenu.addAction(popup8);
if(m_macro[8]!="") popupMenu.addAction(popup9);
if(m_macro[9]!="") popupMenu.addAction(popup10);
connect(popup1,SIGNAL(triggered()), this, SLOT(onPopup1()));
connect(popup2,SIGNAL(triggered()), this, SLOT(onPopup2()));
connect(popup3,SIGNAL(triggered()), this, SLOT(onPopup3()));
connect(popup4,SIGNAL(triggered()), this, SLOT(onPopup4()));
connect(popup5,SIGNAL(triggered()), this, SLOT(onPopup5()));
connect(popup6,SIGNAL(triggered()), this, SLOT(onPopup6()));
connect(popup7,SIGNAL(triggered()), this, SLOT(onPopup7()));
connect(popup8,SIGNAL(triggered()), this, SLOT(onPopup8()));
connect(popup9,SIGNAL(triggered()), this, SLOT(onPopup9()));
connect(popup10,SIGNAL(triggered()), this, SLOT(onPopup10()));
popupMenu.exec(globalPos);
}
void MainWindow::onPopup1()
{
ui->tx5->setText("5W DIP 73 GL");
}
void MainWindow::onPopup1() { ui->tx5->setText(m_macro[0]); }
void MainWindow::onPopup2() { ui->tx5->setText(m_macro[1]); }
void MainWindow::onPopup3() { ui->tx5->setText(m_macro[2]); }
void MainWindow::onPopup4() { ui->tx5->setText(m_macro[3]); }
void MainWindow::onPopup5() { ui->tx5->setText(m_macro[4]); }
void MainWindow::onPopup6() { ui->tx5->setText(m_macro[5]); }
void MainWindow::onPopup7() { ui->tx5->setText(m_macro[6]); }
void MainWindow::onPopup8() { ui->tx5->setText(m_macro[7]); }
void MainWindow::onPopup9() { ui->tx5->setText(m_macro[8]); }
void MainWindow::onPopup10() { ui->tx5->setText(m_macro[9]); }
void MainWindow::onPopup2()
{
ui->tx5->setText("TNX 73 GL");
}
bool MainWindow::gridOK(QString g)
{

View File

@ -117,6 +117,14 @@ private slots:
void showMacros(const QPoint& pos);
void onPopup1();
void onPopup2();
void onPopup3();
void onPopup4();
void onPopup5();
void onPopup6();
void onPopup7();
void onPopup8();
void onPopup9();
void onPopup10();
private:
Ui::MainWindow *ui;
@ -218,6 +226,8 @@ private slots:
QString m_qsoStart;
QString m_qsoStop;
QStringList m_macro;
SoundInThread soundInThread; //Instantiate the audio threads
SoundOutThread soundOutThread;