Skip to content

Commit

Permalink
fix time tag extraction for input, output, and log stream in rtknavi_qt
Browse files Browse the repository at this point in the history
update stream formats in option dialog of rtknavi_qt and rtkpost_qt
  • Loading branch information
JensReimann committed May 15, 2024
1 parent bf9284d commit 68a355b
Show file tree
Hide file tree
Showing 7 changed files with 69 additions and 22 deletions.
12 changes: 12 additions & 0 deletions app/qtapp/appcmn_qt/navi_post_opt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
22 changes: 18 additions & 4 deletions app/qtapp/rtknavi_qt/instrdlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -301,27 +301,41 @@ 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("::")));
};
}
//---------------------------------------------------------------------------
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;

Expand Down
4 changes: 2 additions & 2 deletions app/qtapp/rtknavi_qt/instrdlg.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
12 changes: 10 additions & 2 deletions app/qtapp/rtknavi_qt/logstrdlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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("::")));
};
}
//---------------------------------------------------------------------------
Expand All @@ -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);
Expand Down
3 changes: 2 additions & 1 deletion app/qtapp/rtknavi_qt/navimain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -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;
Expand Down
18 changes: 15 additions & 3 deletions app/qtapp/rtknavi_qt/outstrdlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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("::")));
};
}
//---------------------------------------------------------------------------
Expand All @@ -238,15 +246,19 @@ 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);
}
//---------------------------------------------------------------------------
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)
Expand Down
20 changes: 10 additions & 10 deletions app/qtapp/rtknavi_qt/outstrdlg.ui
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>747</width>
<height>260</height>
<height>268</height>
</rect>
</property>
<property name="windowTitle">
Expand Down Expand Up @@ -55,7 +55,7 @@
<string>Select swap interval for output data. Use specific keys (see &quot;?&quot; button) in the file path to generate unique filenames.</string>
</property>
<property name="sizeAdjustPolicy">
<enum>QComboBox::AdjustToContents</enum>
<enum>QComboBox::SizeAdjustPolicy::AdjustToContents</enum>
</property>
<item>
<property name="text">
Expand All @@ -64,37 +64,37 @@
</item>
<item>
<property name="text">
<string>0.25</string>
<string>0.25 h</string>
</property>
</item>
<item>
<property name="text">
<string>0.5</string>
<string>0.5 h</string>
</property>
</item>
<item>
<property name="text">
<string>1</string>
<string>1 h</string>
</property>
</item>
<item>
<property name="text">
<string>3</string>
<string>3 h</string>
</property>
</item>
<item>
<property name="text">
<string>6</string>
<string>6 h</string>
</property>
</item>
<item>
<property name="text">
<string>12</string>
<string>12 h</string>
</property>
</item>
<item>
<property name="text">
<string>24</string>
<string>24 h</string>
</property>
</item>
</widget>
Expand All @@ -115,7 +115,7 @@
<item row="2" column="1">
<widget class="QDialogButtonBox" name="buttonBox">
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
<set>QDialogButtonBox::StandardButton::Cancel|QDialogButtonBox::StandardButton::Ok</set>
</property>
</widget>
</item>
Expand Down

0 comments on commit 68a355b

Please sign in to comment.