Skip to content

Commit 13c3790

Browse files
committed
rtkrcv, rtknavi: support more input and solution out streams
Move towards the number of input and output streams being a compilation option, adding the RTKSVRNIN, and RTKSVRNSOL defines and also make better use of MAXSTRRTK rather than baking in constants. Move the output streams to the end of the stream index range so that adding more does not affect indices of the input and log streams. rtkrcv and rtknavi now accepts one more input and one more output stream, and rtkrcv now builds with up to 5 input and 6 output streams and could support more by simply adding move config options for them.
1 parent 3d465be commit 13c3790

34 files changed

Lines changed: 1868 additions & 807 deletions

app/consapp/rtkrcv/gcc/makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
BINDIR = /usr/local/bin
44
SRC = ../../../../src
55

6-
CTARGET= -DTRACE -DENAGLO -DENAQZS -DENACMP -DENAGAL -DENAIRN -DNFREQ=4 -DNEXOBS=3 -DSVR_REUSEADDR
6+
CTARGET= -DTRACE -DENAGLO -DENAQZS -DENACMP -DENAGAL -DENAIRN -DNFREQ=4 -DNEXOBS=3 -DSVR_REUSEADDR -DRTKSVRNIN=5 -DRTKSVRNSOL=6
77
#CTARGET= -DENAGLO -DENAQZS -DENACMP -DENAGAL -DENAIRN -DNFREQ=4 -DIERS_MODEL -DSVR_REUSEADDR
88

99
CFLAGS = -std=c99 -Wall -O3 -pedantic -Wno-unused-but-set-variable -I$(SRC) -I.. -DTRACE $(CTARGET) -g

app/consapp/rtkrcv/rtkrcv.c

Lines changed: 139 additions & 79 deletions
Large diffs are not rendered by default.

app/qtapp/rtknavi_qt/instrdlg.cpp

Lines changed: 75 additions & 29 deletions
Large diffs are not rendered by default.

app/qtapp/rtknavi_qt/instrdlg.h

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55

66
#include <QDialog>
77

8+
#include "rtklib.h"
9+
810
namespace Ui {
911
class InputStrDialog;
1012
}
@@ -88,15 +90,19 @@ public slots:
8890
void showStreamOptions1();
8991
void showStreamOptions2();
9092
void showStreamOptions3();
93+
void showStreamOptions4();
9194
void showCommandDialog1();
9295
void showCommandDialog2();
9396
void showCommandDialog3();
97+
void showCommandDialog4();
9498
void selectFile1();
9599
void selectFile2();
96100
void selectFile3();
101+
void selectFile4();
97102
void showReceiverOptions1();
98103
void showReceiverOptions2();
99104
void showReceiverOptions3();
105+
void showReceiverOptions4();
100106
void selectPosition();
101107
void updateEnable();
102108

@@ -116,12 +122,12 @@ public slots:
116122
TcpOptDialog *tcpOptDialog;
117123
FtpOptDialog *ftpOptDialog;
118124

119-
int commandEnable[3][3], commandEnableTcp[3][3];
120-
QString commands[3][3], commandsTcp[3][3];
121-
QString paths[3][4];
125+
int commandEnable[RTKSVRNIN][3], commandEnableTcp[RTKSVRNIN][3];
126+
QString commands[RTKSVRNIN][3], commandsTcp[RTKSVRNIN][3];
127+
QString paths[RTKSVRNIN][4];
122128

123129

124-
QString receiverOptions[3];
130+
QString receiverOptions[RTKSVRNIN];
125131
QString history[10];
126132
int noFormats;
127133
QString stationPositionFile;

app/qtapp/rtknavi_qt/instrdlg.ui

Lines changed: 111 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,13 @@
169169
</property>
170170
</widget>
171171
</item>
172+
<item row="4" column="0">
173+
<widget class="QLabel" name="label_4">
174+
<property name="text">
175+
<string>(4)</string>
176+
</property>
177+
</widget>
178+
</item>
172179
<item row="0" column="0" colspan="2">
173180
<widget class="QLabel" name="lblInputFilePath">
174181
<property name="toolTip">
@@ -189,6 +196,13 @@
189196
</property>
190197
</widget>
191198
</item>
199+
<item row="4" column="1">
200+
<widget class="QLineEdit" name="lEFilePath4">
201+
<property name="toolTip">
202+
<string>Specify file name for correction data</string>
203+
</property>
204+
</widget>
205+
</item>
192206
</layout>
193207
</widget>
194208
</item>
@@ -724,7 +738,96 @@
724738
</item>
725739
</widget>
726740
</item>
727-
</layout>
741+
<item row="4" column="0">
742+
<widget class="QCheckBox" name="cBStreamC4">
743+
<property name="toolTip">
744+
<string>Activate data input stream for additional corrections</string>
745+
</property>
746+
<property name="text">
747+
<string>(4) Correction</string>
748+
</property>
749+
</widget>
750+
</item>
751+
<item row="4" column="1">
752+
<widget class="QComboBox" name="cBStream4">
753+
<property name="toolTip">
754+
<string>Select input stream type for corrections</string>
755+
</property>
756+
<item>
757+
<property name="text">
758+
<string>Serial</string>
759+
</property>
760+
</item>
761+
<item>
762+
<property name="text">
763+
<string>TCP Client</string>
764+
</property>
765+
</item>
766+
<item>
767+
<property name="text">
768+
<string>TCP Server</string>
769+
</property>
770+
</item>
771+
<item>
772+
<property name="text">
773+
<string>NTRIP Client</string>
774+
</property>
775+
</item>
776+
<item>
777+
<property name="text">
778+
<string>File</string>
779+
</property>
780+
</item>
781+
<item>
782+
<property name="text">
783+
<string>FTP</string>
784+
</property>
785+
</item>
786+
<item>
787+
<property name="text">
788+
<string>HTTP</string>
789+
</property>
790+
</item>
791+
</widget>
792+
</item>
793+
<item row="4" column="2">
794+
<widget class="QPushButton" name="btnStream4">
795+
<property name="toolTip">
796+
<string>Select options for the correction data stream</string>
797+
</property>
798+
<property name="text">
799+
<string>...</string>
800+
</property>
801+
</widget>
802+
</item>
803+
<item row="4" column="3">
804+
<widget class="QPushButton" name="btnCmd4">
805+
<property name="toolTip">
806+
<string>Specify additional commands for the correction data stream</string>
807+
</property>
808+
<property name="text">
809+
<string>...</string>
810+
</property>
811+
</widget>
812+
</item>
813+
<item row="4" column="4">
814+
<widget class="QComboBox" name="cBFormat4">
815+
<property name="toolTip">
816+
<string>Select correction data stream format</string>
817+
</property>
818+
</widget>
819+
</item>
820+
<item row="4" column="5">
821+
<widget class="QPushButton" name="btnReceiverOptions4">
822+
<property name="toolTip">
823+
<string>Define additional options for the receiver</string>
824+
</property>
825+
<property name="text">
826+
<string>...</string>
827+
</property>
828+
</widget>
829+
</item>
830+
</layout>
728831
</widget>
729832
</item>
730833
</layout>
@@ -748,6 +851,12 @@
748851
<tabstop>btnCmd3</tabstop>
749852
<tabstop>cBFormat3</tabstop>
750853
<tabstop>btnReceiverOptions3</tabstop>
854+
<tabstop>cBStreamC4</tabstop>
855+
<tabstop>cBStream4</tabstop>
856+
<tabstop>btnStream4</tabstop>
857+
<tabstop>btnCmd4</tabstop>
858+
<tabstop>cBFormat4</tabstop>
859+
<tabstop>btnReceiverOptions4</tabstop>
751860
<tabstop>cBNmeaRequestType</tabstop>
752861
<tabstop>sBNmeaPosition1</tabstop>
753862
<tabstop>sBNmeaPosition2</tabstop>
@@ -758,6 +867,7 @@
758867
<tabstop>lEFilePath1</tabstop>
759868
<tabstop>lEFilePath2</tabstop>
760869
<tabstop>lEFilePath3</tabstop>
870+
<tabstop>lEFilePath4</tabstop>
761871
<tabstop>cBTimeTag</tabstop>
762872
<tabstop>cBTimeSpeed</tabstop>
763873
<tabstop>cB64Bit</tabstop>

app/qtapp/rtknavi_qt/logstrdlg.cpp

Lines changed: 45 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ LogStrDialog::LogStrDialog(QWidget *parent)
3232
ui->lEFilePath1->setCompleter(new QCompleter(fileModel, this));
3333
ui->lEFilePath2->setCompleter(new QCompleter(fileModel, this));
3434
ui->lEFilePath3->setCompleter(new QCompleter(fileModel, this));
35+
ui->lEFilePath4->setCompleter(new QCompleter(fileModel, this));
3536

3637
// line edit actions
3738
QAction *aclEFilePath1Select = ui->lEFilePath1->addAction(QIcon(":/buttons/folder"), QLineEdit::TrailingPosition);
@@ -40,22 +41,28 @@ LogStrDialog::LogStrDialog(QWidget *parent)
4041
aclEFilePath2Select->setToolTip(tr("Select File"));
4142
QAction *aclEFilePath3Select = ui->lEFilePath3->addAction(QIcon(":/buttons/folder"), QLineEdit::TrailingPosition);
4243
aclEFilePath3Select->setToolTip(tr("Select File"));
44+
QAction *aclEFilePath4Select = ui->lEFilePath4->addAction(QIcon(":/buttons/folder"), QLineEdit::TrailingPosition);
45+
aclEFilePath4Select->setToolTip(tr("Select File"));
4346

4447
connect(ui->buttonBox, &QDialogButtonBox::accepted, this, &LogStrDialog::accept);
4548
connect(ui->buttonBox, &QDialogButtonBox::rejected, this, &LogStrDialog::reject);
4649
connect(ui->btnKey, &QPushButton::clicked, this, &LogStrDialog::showKeyDialog);
4750
connect(aclEFilePath1Select, &QAction::triggered, this, &LogStrDialog::selectFile1);
4851
connect(aclEFilePath2Select, &QAction::triggered, this, &LogStrDialog::selectFile2);
4952
connect(aclEFilePath3Select, &QAction::triggered, this, &LogStrDialog::selectFile3);
53+
connect(aclEFilePath4Select, &QAction::triggered, this, &LogStrDialog::selectFile4);
5054
connect(ui->btnStream1, &QPushButton::clicked, this, &LogStrDialog::showStreamOptions1);
5155
connect(ui->btnStream2, &QPushButton::clicked, this, &LogStrDialog::showStreamOptions2);
5256
connect(ui->btnStream3, &QPushButton::clicked, this, &LogStrDialog::showStreamOptions3);
57+
connect(ui->btnStream4, &QPushButton::clicked, this, &LogStrDialog::showStreamOptions4);
5358
connect(ui->cBStream1, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, &LogStrDialog::updateEnable);
5459
connect(ui->cBStream2, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, &LogStrDialog::updateEnable);
5560
connect(ui->cBStream3, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, &LogStrDialog::updateEnable);
61+
connect(ui->cBStream4, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, &LogStrDialog::updateEnable);
5662
connect(ui->cBStream1C, &QCheckBox::clicked, this, &LogStrDialog::updateEnable);
5763
connect(ui->cBStream2C, &QCheckBox::clicked, this, &LogStrDialog::updateEnable);
5864
connect(ui->cBStream3C, &QCheckBox::clicked, this, &LogStrDialog::updateEnable);
65+
connect(ui->cBStream4C, &QCheckBox::clicked, this, &LogStrDialog::updateEnable);
5966

6067
ui->cBSwapInterval->setValidator(new QDoubleValidator(this));
6168
}
@@ -75,6 +82,12 @@ void LogStrDialog::selectFile3()
7582
ui->lEFilePath3->setText(QDir::toNativeSeparators(QFileDialog::getSaveFileName(this, tr("Open..."), ui->lEFilePath3->text())));
7683
}
7784
//---------------------------------------------------------------------------
85+
void LogStrDialog::selectFile4()
86+
{
87+
QString filename = QFileDialog::getSaveFileName(this, tr("Open..."), ui->lEFilePath4->text());
88+
if (!filename.isEmpty()) ui->lEFilePath4->setText(QDir::toNativeSeparators(filename));
89+
}
90+
//---------------------------------------------------------------------------
7891
void LogStrDialog::showKeyDialog()
7992
{
8093
keyDialog->show();
@@ -98,7 +111,7 @@ void LogStrDialog::showStreamOptions2()
98111
case 1: showTcpOptions(1, 1); break;
99112
case 2: showTcpOptions(1, 0); break;
100113
case 3: showTcpOptions(1, 2); break;
101-
case 4: showTcpOptions(0, 4); break;
114+
case 4: showTcpOptions(1, 4); break;
102115
}
103116
}
104117
//---------------------------------------------------------------------------
@@ -109,7 +122,18 @@ void LogStrDialog::showStreamOptions3()
109122
case 1: showTcpOptions(2, 1); break;
110123
case 2: showTcpOptions(2, 0); break;
111124
case 3: showTcpOptions(2, 2); break;
112-
case 4: showTcpOptions(0, 4); break;
125+
case 4: showTcpOptions(2, 4); break;
126+
}
127+
}
128+
//---------------------------------------------------------------------------
129+
void LogStrDialog::showStreamOptions4()
130+
{
131+
switch (ui->cBStream4->currentIndex()) {
132+
case 0: showSerialOptions(3, 0); break;
133+
case 1: showTcpOptions(3, 1); break;
134+
case 2: showTcpOptions(3, 0); break;
135+
case 3: showTcpOptions(3, 2); break;
136+
case 4: showTcpOptions(3, 4); break;
113137
}
114138
}
115139
//---------------------------------------------------------------------------
@@ -133,7 +157,7 @@ QString LogStrDialog::setFilePath(const QString &p)
133157
//---------------------------------------------------------------------------
134158
void LogStrDialog::showSerialOptions(int index, int opt)
135159
{
136-
if ((index < 0) || (index > 2)) return;
160+
if ((index < 0) || (index >= RTKSVRNIN)) return;
137161

138162
serialOptDialog->setOptions(opt);
139163
serialOptDialog->setPath(paths[index][0]);
@@ -146,7 +170,7 @@ void LogStrDialog::showSerialOptions(int index, int opt)
146170
//---------------------------------------------------------------------------
147171
void LogStrDialog::showTcpOptions(int index, int opt)
148172
{
149-
if ((index < 0) || (index > 2)) return;
173+
if ((index < 0) || (index >= RTKSVRNIN)) return;
150174

151175
tcpOptDialog->setOptions(opt);
152176
tcpOptDialog->setHistory(history, 10);
@@ -165,17 +189,21 @@ void LogStrDialog::updateEnable()
165189
{
166190
int ena = (ui->cBStream1C->isChecked() && ui->cBStream1->currentIndex() == 5) ||
167191
(ui->cBStream2C->isChecked() && ui->cBStream2->currentIndex() == 5) ||
168-
(ui->cBStream3C->isChecked() && ui->cBStream3->currentIndex() == 5);
192+
(ui->cBStream3C->isChecked() && ui->cBStream3->currentIndex() == 5) ||
193+
(ui->cBStream4C->isChecked() && ui->cBStream4->currentIndex() == 5);
169194

170195
ui->cBStream1->setEnabled(ui->cBStream1C->isChecked());
171196
ui->cBStream2->setEnabled(ui->cBStream2C->isChecked());
172197
ui->cBStream3->setEnabled(ui->cBStream3C->isChecked());
198+
ui->cBStream4->setEnabled(ui->cBStream4C->isChecked());
173199
ui->btnStream1->setEnabled(ui->cBStream1C->isChecked() && ui->cBStream1->currentIndex() <= 4);
174200
ui->btnStream2->setEnabled(ui->cBStream2C->isChecked() && ui->cBStream2->currentIndex() <= 4);
175201
ui->btnStream3->setEnabled(ui->cBStream3C->isChecked() && ui->cBStream3->currentIndex() <= 4);
202+
ui->btnStream4->setEnabled(ui->cBStream4C->isChecked() && ui->cBStream4->currentIndex() <= 4);
176203
ui->lEFilePath1->setEnabled(ui->cBStream1C->isChecked() && ui->cBStream1->currentIndex() == 5);
177204
ui->lEFilePath2->setEnabled(ui->cBStream2C->isChecked() && ui->cBStream2->currentIndex() == 5);
178205
ui->lEFilePath3->setEnabled(ui->cBStream3C->isChecked() && ui->cBStream3->currentIndex() == 5);
206+
ui->lEFilePath4->setEnabled(ui->cBStream4C->isChecked() && ui->cBStream4->currentIndex() == 5);
179207
ui->lblSwapInterval->setEnabled(ena);
180208
ui->lblF1->setEnabled(ena);
181209
ui->cBTimeTag->setEnabled(ena);
@@ -185,25 +213,25 @@ void LogStrDialog::updateEnable()
185213
//---------------------------------------------------------------------------
186214
void LogStrDialog::setStreamEnabled(int stream, int enabled)
187215
{
188-
QCheckBox *cBStreamC[] = {ui->cBStream1C, ui->cBStream2C, ui->cBStream3C};
189-
if ((stream < 0 ) || (stream > 2)) return;
216+
QCheckBox *cBStreamC[] = {ui->cBStream1C, ui->cBStream2C, ui->cBStream3C, ui->cBStream4C};
217+
if ((stream < 0 ) || (stream >= RTKSVRNIN)) return;
190218

191219
cBStreamC[stream]->setChecked(enabled);
192220
updateEnable();
193221
}
194222
//---------------------------------------------------------------------------
195223
int LogStrDialog::getStreamEnabled(int stream)
196224
{
197-
QCheckBox *cBStreamC[] = {ui->cBStream1C, ui->cBStream2C, ui->cBStream3C};
198-
if ((stream < 0 ) || (stream > 2)) return false;
225+
QCheckBox *cBStreamC[] = {ui->cBStream1C, ui->cBStream2C, ui->cBStream3C, ui->cBStream4C};
226+
if ((stream < 0 ) || (stream >= RTKSVRNIN)) return false;
199227

200228
return cBStreamC[stream]->isChecked();
201229
}
202230
//---------------------------------------------------------------------------
203231
void LogStrDialog::setStreamType(int stream, int type)
204232
{
205-
QComboBox *cBStream[] = {ui->cBStream1, ui->cBStream2, ui->cBStream3};
206-
if ((stream < 0 ) || (stream > 2)) return;
233+
QComboBox *cBStream[] = {ui->cBStream1, ui->cBStream2, ui->cBStream3, ui->cBStream4};
234+
if ((stream < 0 ) || (stream >= RTKSVRNIN)) return;
207235

208236
cBStream[stream]->setCurrentIndex(type);
209237

@@ -212,16 +240,16 @@ void LogStrDialog::setStreamType(int stream, int type)
212240
//---------------------------------------------------------------------------
213241
int LogStrDialog::getStreamType(int stream)
214242
{
215-
QComboBox *cBStream[] = {ui->cBStream1, ui->cBStream2, ui->cBStream3};
216-
if ((stream < 0 ) || (stream > 2)) return STR_NONE;
243+
QComboBox *cBStream[] = {ui->cBStream1, ui->cBStream2, ui->cBStream3, ui->cBStream4};
244+
if ((stream < 0 ) || (stream >= RTKSVRNIN)) return STR_NONE;
217245

218246
return cBStream[stream]->currentIndex();
219247
};
220248
//---------------------------------------------------------------------------
221249
void LogStrDialog::setPath(int stream, int type, const QString &path)
222250
{
223-
QLineEdit *edits[] = {ui->lEFilePath1, ui->lEFilePath2, ui->lEFilePath3};
224-
if ((stream < 0 ) || (stream > 2)) return;
251+
QLineEdit *edits[] = {ui->lEFilePath1, ui->lEFilePath2, ui->lEFilePath3, ui->lEFilePath4};
252+
if ((stream < 0 ) || (stream >= RTKSVRNIN)) return;
225253
if ((type < 0 ) || (type > 3)) return;
226254

227255
paths[stream][type] = path;
@@ -240,8 +268,8 @@ void LogStrDialog::setPath(int stream, int type, const QString &path)
240268
//---------------------------------------------------------------------------
241269
QString LogStrDialog::getPath(int stream, int type)
242270
{
243-
QLineEdit *edits[] = {ui->lEFilePath1, ui->lEFilePath2, ui->lEFilePath3};
244-
if ((stream < 0 ) || (stream > 2)) return "";
271+
QLineEdit *edits[] = {ui->lEFilePath1, ui->lEFilePath2, ui->lEFilePath3, ui->lEFilePath4};
272+
if ((stream < 0 ) || (stream >= RTKSVRNIN)) return "";
245273
if ((type < 0 ) || (type > 3)) return "";
246274

247275
if (type == 2)

0 commit comments

Comments
 (0)