Infobars timeout

This commit is contained in:
jaime 2018-08-04 15:48:59 +00:00
parent 3da519b056
commit b09a9aa6b9
10 changed files with 127 additions and 16 deletions

View File

@ -1,5 +1,6 @@
TBD - 0.9.4
- Check bool DataBase::updateTo012() / there is a return true bypassing everything
- WSJT-X support to receive logged QSO and realtime data.
- Check bool DataBase::updateTo012() / it was always returning true without any action.
- Syncronize RX Freq with the satellite downlink combobox.
- Update process has been improved.
- Bugfix: When adding a QSO, if the QSL is marked as received, KLog showed a SQL error.

1
TODO
View File

@ -27,6 +27,7 @@ Working:
TODO: ADD A TIP ON the DXCC tab stating Prefix, CQ, ITU & Bearing
TODO: Check how to implement qInstallMessageHandler
SAT DB: https://db.satnogs.org/api/
This is a kind of roadmap for KLog development.

View File

@ -1983,6 +1983,9 @@ bool DataProxy_SQLite::addQSOFromWSJTX(const QString _dxcall, const double _freq
{
stringFields = stringFields + "bandid, " ;
stringData = stringData + "'" + QString::number(getBandIdFromFreq(_freq)) + "', ";
stringFields = stringFields + "freq, " ;
stringData = stringData + "'" + QString::number(_freq) + "', ";
}
else
{

View File

@ -70,6 +70,7 @@ MainWindow::MainWindow(const QString _klogDir, const QString tversion)
dxclusterServerToConnect = "dxfun.com";
dxclusterServerPort = 8000;
contestMode = "DX";
infoTimeout = 2000; // default timeout
defaultADIFLogFile = "klog.adi";
@ -153,6 +154,9 @@ MainWindow::MainWindow(const QString _klogDir, const QString tversion)
clublogUser = QString();
clublogPass = QString();
clublogEmail = QString();
infoLabel1T = QString();
infoLabel2T = QString();
/*
db = new DataBase(Q_FUNC_INFO, softwareVersion, util->getKLogDBFile());
if (!db->createConnection())
@ -300,6 +304,9 @@ MainWindow::MainWindow(const QString _klogDir, const QString tversion)
timer = new QTimer(this);
connect(timer, SIGNAL(timeout()), this, SLOT(slotUpdateTime()) );
timer->start(1000);
timerInfoBars = new QTimer(this);
connect(timerInfoBars, SIGNAL(timeout()), this, SLOT(slotTimeOutInfoBars()) );
previousQrz = "";
qrzLineEdit = new QLineEdit;
@ -690,6 +697,12 @@ void MainWindow::createUI()
}
void MainWindow::slotTimeOutInfoBars()
{
infoLabel1->setText(infoLabel1T);
infoLabel2->setText(infoLabel2T);
}
void MainWindow::slotModeComboBoxChanged()
{
//qDebug() << "MainWindow::slotModeComboBoxChanged: " << QString::number(modeComboBox->currentIndex()) << endl;
@ -2578,7 +2591,7 @@ void MainWindow::createActionsCommon(){
// UDPLogServer - WSJT-x
connect(UDPLogServer, SIGNAL(status_update(int, QString, double, QString, QString, QString, QString, QString, QString)), this, SLOT(slotWSJXstatusFromUDPServer(int, QString, double, QString, QString, QString, QString, QString, QString) ) );
connect(UDPLogServer, SIGNAL( logged_qso(int,QString,double,QString,QString,QString,QString,QString,QString,QString,QString,QString)), this, SLOT(slotWSJTXloggedQSO(int,QString,double,QString,QString,QString,QString,QString,QString,QString,QString,QString) ) );
connect(UDPLogServer, SIGNAL( logged_qso(int,QString,double,QString,QString,QString,QString,QString,QString,QString,QString,QString,QString,QString)), this, SLOT(slotWSJTXloggedQSO(int,QString,double,QString,QString,QString,QString,QString,QString,QString,QString,QString,QString,QString) ) );
}
@ -4481,9 +4494,20 @@ bool MainWindow::processConfigLine(const QString _line){
UDPServerStart = false;
}
}
else if (field=="UDPSERVERPORT"){
else if (field=="UDPSERVERPORT")
{
UDPLogServer->setPort(value.toInt());
}
else if (field=="INFOTIMEOUT")
{
int a = value.toInt();
if ((a>0) && (a<=30000))
{
infoTimeout = a;
}
}
else if (field=="LOGFROMWSJTX")
{
if (value.toUpper() == "TRUE")
@ -7080,14 +7104,13 @@ void MainWindow::slotShowQSOsFromDXCCWidget(QList<int> _qsos)
void MainWindow::slotWSJTXloggedQSO(const int _type, const QString _dxcall, const double _freq, const QString _mode,
const QString _dx_grid, const QString _time_off, const QString _report_sent, const QString _report_rec,
const QString _tx_power, const QString _comments, const QString _name, const QString _time_on)
const QString _tx_power, const QString _comments, const QString _name, const QString _time_on, const QString _de_call, const QString _de_grid)
{
qDebug() << "MainWindow::slotWSJTX-loggedQSO type: " << QString::number(_type) << endl;
bool logTheQso = false;
//qDebug() << "MainWindow::slotWSJTX-loggedQSO type: " << QString::number(_type) << endl;
//qDebug() << "MainWindow::slotWSJTX-loggedQSO dxcall: " << _dxcall << endl;
//qDebug() << "MainWindow::slotWSJTX-loggedQSO freq: " << QString::number(_freq/1000000) << endl;
@ -7150,6 +7173,12 @@ void MainWindow::slotWSJTXloggedQSO(const int _type, const QString _dxcall, cons
"<LI>" +
"<b>" + tr("TX Pwr") + ": " + "</b>" + _tx_power +
"</LI>" +
"<LI>" +
"<b>" + tr("Operator") + ": " + "</b>" + _de_call.toUpper() +
"</LI>" +
"<LI>" +
"<b>" + tr("Local-Grid") + ": " + "</b>" + _de_grid +
"</LI>" +
"</UL>" ;
msgBox.setText(aux);
@ -7177,12 +7206,30 @@ void MainWindow::slotWSJTXloggedQSO(const int _type, const QString _dxcall, cons
int dxcc = world->getQRZARRLId(_dxcall);
dxcc = util->getNormalizedDXCCValue(dxcc);
qsoLogged = dataProxy->addQSOFromWSJTX(_dxcall.toUpper(), _freq, _mode, _dx_grid, _time_off, _report_sent, _report_rec, _tx_power, _comments, _name, _time_on, dxcc, operatorQRZ, stationQRZ, myLocator, currentLog);
QString _oper = _de_call;
if (!(util->isValidCall(_oper)))
{
_oper = operatorQRZ;
}
QString _myLoc = _de_grid;
if (!(locator->isValidLocator(_myLoc)))
{
_myLoc = myLocator;
}
qsoLogged = dataProxy->addQSOFromWSJTX(_dxcall.toUpper(), _freq, _mode, _dx_grid, _time_off, _report_sent, _report_rec, _tx_power, _comments, _name, _time_on, dxcc, _oper, stationQRZ, _myLoc, currentLog);
if (qsoLogged)
{
qDebug() << "MainWindow::slotWSJTX-loggedQSO: Logged QSO OK: " << _dxcall << endl;
actionsJustAfterAddingOneQSO();
infoLabel1T = infoLabel1->text();
infoLabel2T = infoLabel2->text();
infoLabel1->setText(tr("QSO logged from WSJTX:"));
infoLabel2->setText(_dxcall + " - " + dataProxy->getBandNameFromFreq(_freq) + "/" + _mode);
timerInfoBars->start(infoTimeout);
}
else
{

View File

@ -202,6 +202,7 @@ private slots:
void slotRQSLExport();
void slotCabrilloExport();
//void slotQSLViaTextChanged();
void slotTimeOutInfoBars(); // Clears the infoLabels when the timeout emits the signal
//TODO: REMOVE EQSL
@ -286,7 +287,7 @@ private slots:
void slotWSJTXloggedQSO(const int _type, const QString _dxcall, const double _freq, const QString _mode,
const QString _dx_grid, const QString _time_off, const QString _report_sent, const QString _report_rec,
const QString _tx_power, const QString _comments, const QString _name, const QString _time_on);
const QString _tx_power, const QString _comments, const QString _name, const QString _time_on, const QString _de_call, const QString _de_grid);
private:
bool maybeSave();
@ -561,8 +562,10 @@ private:
// </CLUSTER>
// </UI>
QTimer *timer;
int infoTimeout; // timeout that temporary info will stay in the infobars
QTimer *timer, *timerInfoBars;
QDateTime *dateTime;
QString infoLabel1T, infoLabel2T;
QString klogDir, ctyDatFile, defaultADIFLogFile, configFileName;
QString softwareVersion;

View File

@ -573,6 +573,7 @@ qDebug() << "SetupDialog::slotOkButtonClicked" << endl;
stream << "LogFromWSJTX=" << UDPPage->getLogFromWSJTx() << ";" << endl;
stream << "LogAutoFromWSJTX=" << UDPPage->getAutoLogFromWSJTx() << ";" << endl;
stream << "RealTimeFromWSJTX=" << UDPPage->getReaDataFromWSJTx() << ";" << endl;
stream << "InfoTimeOut=" << UDPPage->getTimeout() << ";" << endl;
//WSJTX
@ -740,6 +741,10 @@ bool SetupDialog::processConfigLine(const QString _line)
{
UDPPage->setReaDataFromWSJTx(value);
}
else if (tab=="INFOTIMEOUT")
{
UDPPage->setTimeout(value);
}
else if (tab =="NAME")
{
userDataPage->setName(value);
@ -997,6 +1002,7 @@ void SetupDialog::setDefaults()
UDPPage->setUDPServer("FALSE");
UDPPage->setUDPServerPort("2237");
UDPPage->setTimeout("2000");
UDPPage->setLogFromWSJTx("FALSE");
UDPPage->setReaDataFromWSJTx("FALSE");
UDPPage->setAutoLogFromWSJTx("FALSE");

View File

@ -9,6 +9,7 @@ SetupPageUDP::SetupPageUDP(QWidget *parent) : QWidget(parent)
UDPServerCheckBox = new QCheckBox(tr("Start UDP Server"), this);
UDPServerPortSpinBox = new QSpinBox;
miliSecsSpinBox = new QSpinBox;
//wsjtxIPAddress = new QLineEdit(this);
//wsjtxPortNumber = new QLineEdit(this);
@ -16,7 +17,8 @@ SetupPageUDP::SetupPageUDP(QWidget *parent) : QWidget(parent)
//autoLogFromWSJTx = false;
//realDataFromWSJTx = false;
defaultport = 2237;
defaultport = 2237; // Default WSJTX port
defaultTimer = 2000; // 2 secs
createUI();
createActions();
@ -59,7 +61,7 @@ void SetupPageUDP::createUI()
UDPServerPortSpinBox->setMinimum(0);
UDPServerPortSpinBox->setMaximum(65535);
UDPServerPortSpinBox->setValue(2237);
UDPServerPortSpinBox->setValue(defaultport);
QLabel *udpPortLabel = new QLabel(tr("UDP Port"));
udpPortLabel->setBuddy(UDPServerPortSpinBox);
udpPortLabel->setToolTip(labelTip);
@ -70,9 +72,22 @@ void SetupPageUDP::createUI()
UDPLayout1->addWidget(udpPortLabel);
UDPLayout1->addWidget(UDPServerPortSpinBox);
miliSecsSpinBox->setMinimum(0);
miliSecsSpinBox->setMaximum(30000);
miliSecsSpinBox->setValue(defaultTimer);
QLabel *miliSecsSpinBoxLabel = new QLabel(tr("QSO notification timeout (milisecs)"));
miliSecsSpinBox->setToolTip(tr("Miliseconds that the notification of QSO received from WSJTX will be shown."));
miliSecsSpinBoxLabel->setAlignment(Qt::AlignVCenter| Qt::AlignCenter);
miliSecsSpinBoxLabel->setEnabled(true);
miliSecsSpinBox->setEnabled(false);
QHBoxLayout *UDPLayout = new QHBoxLayout;
UDPLayout->addWidget(UDPServerCheckBox);
UDPLayout->addLayout(UDPLayout1);
UDPLayout->addWidget(miliSecsSpinBoxLabel);
UDPLayout->addWidget(miliSecsSpinBox);
//QLabel *IPAddressLabel = new QLabel(tr("WSJT-x IP address"));
@ -116,6 +131,7 @@ void SetupPageUDP::slotUDPServerCheckBoxClicked()
logFromWSJTXCheckbox->setChecked(true);
logAutomaticallyWSJTXCheckbox->setEnabled(true);
realDataFromWSJTXCheckbox->setEnabled(true);
miliSecsSpinBox->setEnabled(true);
}
else
{
@ -125,6 +141,7 @@ void SetupPageUDP::slotUDPServerCheckBoxClicked()
logFromWSJTXCheckbox->setEnabled(false);
logAutomaticallyWSJTXCheckbox->setEnabled(false);
realDataFromWSJTXCheckbox->setEnabled(false);
miliSecsSpinBox->setEnabled(false);
}
}
@ -192,7 +209,34 @@ QString SetupPageUDP::getUDPServerPort()
}
else
{
return "-1";
return QString::number(defaultport);
}
}
void SetupPageUDP::setTimeout(const QString t)
{
if ( (t.toInt()>=0) && (t.toInt()<=30000))
{
miliSecsSpinBox->setValue(t.toInt());
}
else
{
miliSecsSpinBox->setValue(defaultTimer);
}
}
QString SetupPageUDP::getTimeout()
{
int t = miliSecsSpinBox->value();
if ( (t>=0) && (t<=30000) )
{
return QString::number(t);
}
else
{
return QString::number(defaultTimer);
}
}

View File

@ -42,12 +42,14 @@ public:
void setReaDataFromWSJTx(const QString t);
void setUDPServer(const QString t);
void setUDPServerPort(const QString t);
void setTimeout(const QString t);
QString getLogFromWSJTx();
QString getAutoLogFromWSJTx();
QString getReaDataFromWSJTx();
QString getUDPServerPort();
QString getUDPServer();
QString getTimeout();
private:
void createUI();
@ -56,7 +58,9 @@ private:
QCheckBox *logFromWSJTXCheckbox, *logAutomaticallyWSJTXCheckbox, *realDataFromWSJTXCheckbox, *UDPServerCheckBox;
//QLineEdit *wsjtxIPAddress, *wsjtxPortNumber;
QSpinBox *UDPServerPortSpinBox;
int defaultport;
QSpinBox *miliSecsSpinBox;
int defaultport, defaultTimer;
//bool logFromWSJTx, autoLogFromWSJTx, realDataFromWSJTx;

View File

@ -164,10 +164,12 @@ void UDPServer::parse(const QByteArray &msg)
//qDebug() << "UDPServer::parse: - type = " << QString::number(type) << " - OUT - QSO logged" << endl;
if (logging)
{
in >> time_off >> dx_call >> dx_grid >> frequency >> mode >> report_sent >> report_received >> tx_power >> comments >> name >> time_on;
in >> time_off >> dx_call >> dx_grid >> frequency >> mode >> report_sent >> report_received >> tx_power >> comments >> name >> time_on >> de_call >> de_grid;
frequencyDouble = (double)frequency;
frequencyDouble = frequencyDouble/1000000; // Change to MHz
emit logged_qso (type, dx_call, frequencyDouble, mode, dx_grid, time_off.toString("yyyyMMddHHmmss"), report_sent, report_received, tx_power, comments, name, time_on.toString("yyyyMMddHHmmss"));
emit logged_qso (type, dx_call, frequencyDouble, mode, dx_grid,
time_off.toString("yyyyMMddHHmmss"), report_sent, report_received, tx_power, comments,
name, time_on.toString("yyyyMMddHHmmss"), de_call, de_grid);
}
else

View File

@ -38,7 +38,7 @@ signals:
void logged_qso (const int _type, const QString _dxcall, const double _freq, const QString _mode,
const QString _dx_grid, const QString _time_off, const QString _report_sent, const QString _report_rec,
const QString _tx_power, const QString _comments, const QString _name, const QString _time_on);
const QString _tx_power, const QString _comments, const QString _name, const QString _time_on, const QString _de_call, const QString _de_grid);