@@ -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+ // ---------------------------------------------------------------------------
7891void 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// ---------------------------------------------------------------------------
134158void 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// ---------------------------------------------------------------------------
147171void 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// ---------------------------------------------------------------------------
186214void 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// ---------------------------------------------------------------------------
195223int 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// ---------------------------------------------------------------------------
203231void 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// ---------------------------------------------------------------------------
213241int 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// ---------------------------------------------------------------------------
221249void 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// ---------------------------------------------------------------------------
241269QString 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