From 68a355b415453693a1f6f53b759dcd80519c62fb Mon Sep 17 00:00:00 2001 From: Jens Reimann Date: Wed, 15 May 2024 21:03:38 +0200 Subject: [PATCH] fix time tag extraction for input, output, and log stream in rtknavi_qt update stream formats in option dialog of rtknavi_qt and rtkpost_qt --- app/qtapp/appcmn_qt/navi_post_opt.cpp | 12 ++++++++++++ app/qtapp/rtknavi_qt/instrdlg.cpp | 22 ++++++++++++++++++---- app/qtapp/rtknavi_qt/instrdlg.h | 4 ++-- app/qtapp/rtknavi_qt/logstrdlg.cpp | 12 ++++++++++-- app/qtapp/rtknavi_qt/navimain.cpp | 3 ++- app/qtapp/rtknavi_qt/outstrdlg.cpp | 18 +++++++++++++++--- app/qtapp/rtknavi_qt/outstrdlg.ui | 20 ++++++++++---------- 7 files changed, 69 insertions(+), 22 deletions(-) diff --git a/app/qtapp/appcmn_qt/navi_post_opt.cpp b/app/qtapp/appcmn_qt/navi_post_opt.cpp index 10408f13e..fc3807ed0 100644 --- a/app/qtapp/appcmn_qt/navi_post_opt.cpp +++ b/app/qtapp/appcmn_qt/navi_post_opt.cpp @@ -50,6 +50,18 @@ OptDialog::OptDialog(QWidget *parent, int opts) processingOptions = prcopt_default; solutionOptions = solopt_default; + fileOptions.blq[0] = '\0'; + fileOptions.dcb[0] = '\0'; + fileOptions.eop[0] = '\0'; + fileOptions.geexe[0] = '\0'; + fileOptions.geoid[0] = '\0'; + fileOptions.iono[0] = '\0'; + fileOptions.rcvantp[0] = '\0'; + fileOptions.satantp[0] = '\0'; + fileOptions.solstat[0] = '\0'; + fileOptions.stapos[0] = '\0'; + fileOptions.tempdir[0] = '\0'; + fileOptions.trace[0] = '\0'; appOptions = nullptr; diff --git a/app/qtapp/rtknavi_qt/instrdlg.cpp b/app/qtapp/rtknavi_qt/instrdlg.cpp index 040b638e0..a267ad7d9 100644 --- a/app/qtapp/rtknavi_qt/instrdlg.cpp +++ b/app/qtapp/rtknavi_qt/instrdlg.cpp @@ -301,9 +301,23 @@ void InputStrDialog::setPath(int stream, int type, const QString & path) { QLineEdit *edits[] = {ui->lEFilePath1, ui->lEFilePath2, ui->lEFilePath3}; paths[stream][type] = path; + ui->cBTimeTag->setChecked(path.contains("::T")); + ui->cB64Bit->setChecked(path.contains("::P=8")); + if (path.contains("::+")) + { + int startPos = path.indexOf("::+")+3; + QString startTime = path.mid(startPos, path.indexOf("::", startPos)-startPos); + ui->sBTimeStart->setValue(startTime.toInt()); + }; + if (path.contains("::x")) + { + int startPos = path.indexOf("::x")+3; + QString speed = path.mid(startPos, path.indexOf("::", startPos)-startPos); + ui->cBTimeSpeed->setCurrentText(speed); + } if (type == 2) { - edits[stream]->setText(path); + edits[stream]->setText(path.mid(0, path.indexOf("::"))); }; } //--------------------------------------------------------------------------- @@ -311,17 +325,17 @@ QString InputStrDialog::getPath(int stream, int type) { QLineEdit *edits[] = {ui->lEFilePath1, ui->lEFilePath2, ui->lEFilePath3}; if (type == 2) - return setFilePath(edits[stream]->text()); + return makePath(edits[stream]->text()); return paths[stream][type]; } //--------------------------------------------------------------------------- -QString InputStrDialog::getFilePath(const QString &path) +QString InputStrDialog::extractFilePath(const QString &path) { return path.mid(0, path.indexOf("::")); } //--------------------------------------------------------------------------- -QString InputStrDialog::setFilePath(const QString &p) +QString InputStrDialog::makePath(const QString &p) { QString path = p; diff --git a/app/qtapp/rtknavi_qt/instrdlg.h b/app/qtapp/rtknavi_qt/instrdlg.h index d1e246cbd..b64f26112 100644 --- a/app/qtapp/rtknavi_qt/instrdlg.h +++ b/app/qtapp/rtknavi_qt/instrdlg.h @@ -101,8 +101,8 @@ public slots: void updateEnable(); private: - QString getFilePath(const QString &path); - QString setFilePath(const QString &path); + QString extractFilePath(const QString &path); + QString makePath(const QString &path); void showSerialOptionsDialog(int index, int opt); void showTcpOptionsDialog(int index, int opt); void showFtpOptionsDialog(int index, int opt); diff --git a/app/qtapp/rtknavi_qt/logstrdlg.cpp b/app/qtapp/rtknavi_qt/logstrdlg.cpp index eb7ba8e1d..3762c824b 100644 --- a/app/qtapp/rtknavi_qt/logstrdlg.cpp +++ b/app/qtapp/rtknavi_qt/logstrdlg.cpp @@ -214,9 +214,16 @@ void LogStrDialog::setPath(int stream, int type, const QString &path) QLineEdit *edits[] = {ui->lEFilePath1, ui->lEFilePath2, ui->lEFilePath3}; if (stream > 3) return; paths[stream][type] = path; + ui->cBTimeTag->setChecked(path.contains("::T")); + if (path.contains("::S=")) + { + int startPos = path.indexOf("::S=")+4; + QString startTime = path.mid(startPos, path.indexOf("::", startPos)-startPos); + ui->cBSwapInterval->setCurrentText(startTime); + }; if (type == 2) { - edits[stream]->setText(path); + edits[stream]->setText(path.mid(0, path.indexOf("::"))); }; } //--------------------------------------------------------------------------- @@ -241,7 +248,8 @@ bool LogStrDialog::getLogTimeTagEnabled(){ //--------------------------------------------------------------------------- void LogStrDialog::setSwapInterval(const QString & swapInterval) { - QString interval_str = swapInterval + " h"; + QString interval_str = swapInterval; + if (!interval_str.isEmpty()) interval_str += " h"; if (ui->cBSwapInterval->findText(interval_str) == -1) ui->cBSwapInterval->insertItem(0, interval_str); ui->cBSwapInterval->setCurrentText(interval_str); diff --git a/app/qtapp/rtknavi_qt/navimain.cpp b/app/qtapp/rtknavi_qt/navimain.cpp index e400edbff..62a45c97c 100644 --- a/app/qtapp/rtknavi_qt/navimain.cpp +++ b/app/qtapp/rtknavi_qt/navimain.cpp @@ -96,7 +96,7 @@ static int strfmt[] = { /* stream formats */ #define FLGOPT "0:off,1:std+2:age/ratio/ns" #define ISTOPT "0:off,1:serial,2:file,3:tcpsvr,4:tcpcli,6:ntripcli,7:ftp,8:http" #define OSTOPT "0:off,1:serial,2:file,3:tcpsvr,4:tcpcli,5:ntripsvr,9:ntripcas" -#define FMTOPT "0:rtcm2,1:rtcm3,2:oem4,3:oem3,4:ubx,5:swift,6:hemis,7:skytraq,8:javad,9:nvs,10:binex,11:rt17,12:sbf,14,15:sp3" +#define FMTOPT "0:rtcm2,1:rtcm3,2:oem4,3:oem3,4:ubx,5:ss2,6:hemis,7:skytraq,8:javad,9:nvs,10:binex,11:rt17,12:sbf,13:tersus,14:rinex,15:sp3,16:clk,17:sbas,18:nmea" #define NMEOPT "0:off,1:latlon,2:single" #define SOLOPT "0:llh,1:xyz,2:enu,3:nmea,4:stat" @@ -2355,6 +2355,7 @@ void MainWindow::saveNavigation(nav_t *nav) trace(3, "saveNavigation\n"); if (nav == NULL) return; + if (nav->eph == NULL) return; for (i = 0; i < MAXSAT*2; i++) { if (nav->eph[i].ttr.time == 0) continue; diff --git a/app/qtapp/rtknavi_qt/outstrdlg.cpp b/app/qtapp/rtknavi_qt/outstrdlg.cpp index 81fead733..79a1456bf 100644 --- a/app/qtapp/rtknavi_qt/outstrdlg.cpp +++ b/app/qtapp/rtknavi_qt/outstrdlg.cpp @@ -211,9 +211,17 @@ void OutputStrDialog::setPath(int stream, int type, const QString &path) QLineEdit *edits[] = {ui->lEFilePath1, ui->lEFilePath2}; if (stream > 2) return; paths[stream][type] = path; + ui->cBTimeTag->setChecked(path.contains("::T")); + if (path.contains("::S=")) + { + int startPos = path.indexOf("::S=")+4; + QString startTime = path.mid(startPos, path.indexOf("::", startPos)-startPos); + ui->cBSwapInterval->setCurrentText(startTime + " h"); + }; + if (type == 2) { - edits[stream]->setText(path); + edits[stream]->setText(path.mid(0, path.indexOf("::"))); }; } //--------------------------------------------------------------------------- @@ -238,7 +246,8 @@ bool OutputStrDialog::getTimeTagEnabled(){ //--------------------------------------------------------------------------- void OutputStrDialog::setSwapInterval(const QString & swapInterval) { - QString interval_str = swapInterval + " h"; + QString interval_str = swapInterval; + if (!interval_str.isEmpty()) interval_str += " h"; if (ui->cBSwapInterval->findText(interval_str) == -1) ui->cBSwapInterval->insertItem(0, interval_str); ui->cBSwapInterval->setCurrentText(interval_str); @@ -246,7 +255,10 @@ void OutputStrDialog::setSwapInterval(const QString & swapInterval) //--------------------------------------------------------------------------- QString OutputStrDialog::getSwapInterval() { - return ui->cBSwapInterval->currentText().split(' ', Qt::SkipEmptyParts).first(); + QStringList tokens = ui->cBSwapInterval->currentText().split(' ', Qt::SkipEmptyParts); + if (tokens.size() > 1) + return tokens.first(); + else return ""; }; //--------------------------------------------------------------------------- void OutputStrDialog::setHistory(int i, const QString &history) diff --git a/app/qtapp/rtknavi_qt/outstrdlg.ui b/app/qtapp/rtknavi_qt/outstrdlg.ui index 3168ff26a..81fd7d1cc 100644 --- a/app/qtapp/rtknavi_qt/outstrdlg.ui +++ b/app/qtapp/rtknavi_qt/outstrdlg.ui @@ -7,7 +7,7 @@ 0 0 747 - 260 + 268 @@ -55,7 +55,7 @@ Select swap interval for output data. Use specific keys (see "?" button) in the file path to generate unique filenames. - QComboBox::AdjustToContents + QComboBox::SizeAdjustPolicy::AdjustToContents @@ -64,37 +64,37 @@ - 0.25 + 0.25 h - 0.5 + 0.5 h - 1 + 1 h - 3 + 3 h - 6 + 6 h - 12 + 12 h - 24 + 24 h @@ -115,7 +115,7 @@ - QDialogButtonBox::Cancel|QDialogButtonBox::Ok + QDialogButtonBox::StandardButton::Cancel|QDialogButtonBox::StandardButton::Ok