@@ -67,7 +67,7 @@ void MainWindow::setupGUI()
67
67
else
68
68
ui->textBrowserLogs ->setLineWrapMode (QPlainTextEdit::LineWrapMode::NoWrap);
69
69
70
- // highlighter = new Highlighter(ui->textBrowserLogs->document());
70
+ // highlighter = new Highlighter(ui->textBrowserLogs->document());
71
71
}
72
72
73
73
// ui->comboBoxBaudRates
@@ -80,7 +80,6 @@ void MainWindow::setupGUI()
80
80
81
81
connect (ui->comboBoxSend ->lineEdit (), SIGNAL (returnPressed ()), this , SLOT (on_comboBoxSendReturnPressedSlot ()));
82
82
83
-
84
83
ui->comboBoxTracerStyle ->addItem (" Crosshair" );
85
84
ui->comboBoxTracerStyle ->addItem (" Circle" );
86
85
ui->comboBoxTracerStyle ->setCurrentIndex (0 );
@@ -134,7 +133,7 @@ void MainWindow::setupGUI()
134
133
135
134
if (ui->checkBoxAutoRefresh ->isChecked ())
136
135
{
137
- serialDeviceCheckTimer->start (500 );
136
+ serialDeviceCheckTimer->start (SERIAL_DEVICE_CHECK_TIMER_INTERVAL );
138
137
ui->pushButtonRefresh ->setEnabled (false );
139
138
}
140
139
else
@@ -253,7 +252,7 @@ void MainWindow::settingsLoadAll()
253
252
}
254
253
255
254
if (appSettings.value (" Info/organizationName" ).value <QString>() != appSettings.organizationName () ||
256
- appSettings.value (" Info/applicationName" ).value <QString>() != appSettings.applicationName ())
255
+ appSettings.value (" Info/applicationName" ).value <QString>() != appSettings.applicationName ())
257
256
{
258
257
qDebug () << " Abort loading settings ! organizationName or applicationName incorrect. Config file might be missing." ;
259
258
addLog (" App >>\t Error loading settings. Config file incorrect !" );
@@ -781,9 +780,9 @@ void MainWindow::on_tracerShowPointValue(QMouseEvent *event)
781
780
" <td>Y: %L3</td>"
782
781
" </tr>"
783
782
" </table>" )
784
- .arg (graph->name ())
785
- .arg (QTime::fromMSecsSinceStartOfDay (temp.x () * 1000 ).toString (" hh:mm:ss:zzz" ))
786
- .arg (QString::number (temp.y (), ' f' , 5 )),
783
+ .arg (graph->name ())
784
+ .arg (QTime::fromMSecsSinceStartOfDay (temp.x () * 1000 ).toString (" hh:mm:ss:zzz" ))
785
+ .arg (QString::number (temp.y (), ' f' , 5 )),
787
786
ui->widgetChart , ui->widgetChart ->rect ());
788
787
}
789
788
@@ -821,14 +820,12 @@ void MainWindow::on_chartMouseMoveHandler(QMouseEvent *event)
821
820
822
821
void MainWindow::on_updateSerialDeviceList ()
823
822
{
824
- QList<QSerialPortInfo> devices = QSerialPortInfo::availablePorts ();
823
+ QList<QSerialPortInfo> devices = serial. getAvailiblePorts ();
825
824
QList<QString> portNames;
826
825
static QList<QString> portNamesOld;
827
826
828
827
foreach (auto item, devices)
829
- {
830
828
portNames.append (item.portName ());
831
- }
832
829
833
830
if ((devices.count () >= 1 ) && (!(portNames.toSet ().intersects (portNamesOld.toSet ())) || (portNames.count () != portNamesOld.count ())))
834
831
{
@@ -848,7 +845,7 @@ void MainWindow::on_updateSerialDeviceList()
848
845
849
846
portNamesOld = portNames;
850
847
851
- this ->radioButtonTimer ->start (100 );
848
+ this ->radioButtonTimer ->start (RADIO_BUTTON_UPDATE_SERIAL_DEVICES_ON_INTERVAL );
852
849
ui->radioButtonDeviceUpdate ->setChecked (true );
853
850
}
854
851
@@ -1020,7 +1017,7 @@ void MainWindow::sendUDPDatagram(QString message)
1020
1017
networkUDP.write (message, QHostAddress (ui->lineEditUDPTargetIP ->text ()), ui->spinBoxUDPTargetPort ->value ());
1021
1018
}
1022
1019
1023
- // addLog("UDP >>\t" + message);
1020
+ // addLog("UDP >>\t" + message);
1024
1021
}
1025
1022
1026
1023
void MainWindow::processChart (QStringList labelList, QList<double > numericDataList, QList<long > timeStampsList)
@@ -1046,9 +1043,9 @@ void MainWindow::processChart(QStringList labelList, QList<double> numericDataLi
1046
1043
}
1047
1044
1048
1045
if (canAddGraph && ui->widgetChart ->graphCount () < ui->spinBoxMaxGraphs ->value () &&
1049
- ((ui->comboBoxGraphDisplayMode ->currentIndex () == 0 ) ||
1050
- (ui->comboBoxGraphDisplayMode ->currentIndex () == 1 &&
1051
- ui->lineEditCustomParsingRules ->text ().simplified ().contains (label, Qt::CaseSensitivity::CaseSensitive))))
1046
+ ((ui->comboBoxGraphDisplayMode ->currentIndex () == 0 ) ||
1047
+ (ui->comboBoxGraphDisplayMode ->currentIndex () == 1 &&
1048
+ ui->lineEditCustomParsingRules ->text ().simplified ().contains (label, Qt::CaseSensitivity::CaseSensitive))))
1052
1049
{
1053
1050
ui->widgetChart ->addGraph ();
1054
1051
ui->widgetChart ->graph ()->setName (label);
@@ -1294,7 +1291,7 @@ void MainWindow::on_checkBoxAutoRefresh_toggled(bool checked)
1294
1291
if (checked == true )
1295
1292
{
1296
1293
ui->pushButtonRefresh ->setEnabled (false );
1297
- serialDeviceCheckTimer->start (500 );
1294
+ serialDeviceCheckTimer->start (SERIAL_DEVICE_CHECK_TIMER_INTERVAL );
1298
1295
}
1299
1296
else
1300
1297
{
@@ -1554,9 +1551,7 @@ void MainWindow::on_pushButtonSerialConnect_toggled(bool checked)
1554
1551
return ;
1555
1552
}
1556
1553
1557
- // clearGraphData(true);
1558
-
1559
- QString parsedPortName = ui->comboBoxDevices ->currentText ().mid (ui->comboBoxDevices ->currentText ().indexOf (" COM" ), ui->comboBoxDevices ->currentText ().indexOf (" )" ) - 1 );
1554
+ QString parsedPortName = QSerialPortInfo::availablePorts ().at (ui->comboBoxDevices ->currentIndex ()).portName ();
1560
1555
qint32 parsedBaudRate = ui->comboBoxBaudRates ->currentText ().toInt ();
1561
1556
QString dataBits = ui->comboBoxDataBits ->currentText ();
1562
1557
QString stopBits = ui->comboBoxStopBits ->currentText ();
0 commit comments