Skip to content

Commit ba053ba

Browse files
committed
Added support for costom baudrates
1 parent 7fa7f0b commit ba053ba

File tree

4 files changed

+31
-26
lines changed

4 files changed

+31
-26
lines changed

src/QtSerialMonitor.pro.user

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!DOCTYPE QtCreatorProject>
3-
<!-- Written by QtCreator 6.0.0, 2021-12-10T18:57:22. -->
3+
<!-- Written by QtCreator 6.0.0, 2021-12-18T16:10:25. -->
44
<qtcreator>
55
<data>
66
<variable>EnvironmentId</variable>
@@ -83,6 +83,9 @@
8383
<valuelist type="QVariantList" key="ClangTools.SuppressedDiagnostics"/>
8484
<value type="bool" key="ClangTools.UseGlobalSettings">true</value>
8585
</valuemap>
86+
<valuemap type="QVariantMap" key="CppEditor.QuickFix">
87+
<value type="bool" key="UseGlobalSettings">true</value>
88+
</valuemap>
8689
</valuemap>
8790
</data>
8891
<data>
@@ -235,23 +238,6 @@
235238
<value type="bool" key="Analyzer.Perf.Settings.UseGlobalSettings">true</value>
236239
<value type="bool" key="Analyzer.QmlProfiler.Settings.UseGlobalSettings">true</value>
237240
<value type="bool" key="Analyzer.Valgrind.Settings.UseGlobalSettings">true</value>
238-
<valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds">
239-
<value type="QString">0</value>
240-
<value type="QString">1</value>
241-
<value type="QString">2</value>
242-
<value type="QString">3</value>
243-
<value type="QString">4</value>
244-
<value type="QString">5</value>
245-
<value type="QString">6</value>
246-
<value type="QString">7</value>
247-
<value type="QString">8</value>
248-
<value type="QString">9</value>
249-
<value type="QString">10</value>
250-
<value type="QString">11</value>
251-
<value type="QString">12</value>
252-
<value type="QString">13</value>
253-
<value type="QString">14</value>
254-
</valuelist>
255241
<valuelist type="QVariantList" key="CustomOutputParsers"/>
256242
<value type="int" key="PE.EnvironmentAspect.Base">2</value>
257243
<valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
@@ -262,7 +248,7 @@
262248
<value type="bool" key="RunConfiguration.UseLibrarySearchPath">true</value>
263249
<value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
264250
<value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
265-
<value type="QString" key="RunConfiguration.WorkingDirectory.default">/home/michal/Pulpit/Projekty/QtSerialMonitor/build-QtSerialMonitor-Desktop-Debug</value>
251+
<value type="QString" key="RunConfiguration.WorkingDirectory.default">/home/michal/Pulpit/Projekty/build-QtSerialMonitor-Desktop-Debug</value>
266252
</valuemap>
267253
<value type="qlonglong" key="ProjectExplorer.Target.RunConfigurationCount">1</value>
268254
</valuemap>

src/config.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#ifndef CONFIG_H
22
#define CONFIG_H
33

4-
#define VERSION "1.52"
4+
#define VERSION "1.53"
55

66
#define CHANGELOG_TEXT "" //"Changelog - version " VERSION ": \n"
77

src/mainwindow.cpp

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1590,18 +1590,29 @@ void MainWindow::on_comboBoxTracerStyle_currentIndexChanged(const QString &arg1)
15901590

15911591
void MainWindow::on_pushButtonSerialConnect_toggled(bool checked)
15921592
{
1593+
bool inputError = false;
1594+
15931595
if (checked)
15941596
{
15951597
if (serial.getAvailiblePorts().count() < 1)
15961598
{
15971599
addLog("App >>\t No devices available", true);
15981600
addLog("App >>\t Unable to open serial port!", true);
15991601
ui->pushButtonSerialConnect->setChecked(false);
1600-
return;
1602+
inputError = true;
16011603
}
16021604

1605+
if (ui->comboBoxBaudRates->currentText().toInt() == 0)
1606+
{
1607+
addLog("App >>\t Invalid baud rate!", true);
1608+
inputError = true;
1609+
}
1610+
1611+
if (inputError)
1612+
return;
1613+
16031614
QString parsedPortName = QSerialPortInfo::availablePorts().at(ui->comboBoxDevices->currentIndex()).portName();
1604-
qint32 parsedBaudRate = ui->comboBoxBaudRates->currentText().toInt();
1615+
uint parsedBaudRate = ui->comboBoxBaudRates->currentText().toInt();
16051616
QString dataBits = ui->comboBoxDataBits->currentText();
16061617
QString stopBits = ui->comboBoxStopBits->currentText();
16071618
QString parity = ui->comboBoxParity->currentText();

src/mainwindow.ui

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@
249249
<x>0</x>
250250
<y>0</y>
251251
<width>648</width>
252-
<height>108</height>
252+
<height>100</height>
253253
</rect>
254254
</property>
255255
<property name="sizePolicy">
@@ -763,8 +763,8 @@ p, li { white-space: pre-wrap; }
763763
<rect>
764764
<x>0</x>
765765
<y>0</y>
766-
<width>1164</width>
767-
<height>103</height>
766+
<width>1136</width>
767+
<height>106</height>
768768
</rect>
769769
</property>
770770
<layout class="QGridLayout" name="gridLayout_24">
@@ -1118,6 +1118,7 @@ p, li { white-space: pre-wrap; }
11181118
</property>
11191119
<property name="font">
11201120
<font>
1121+
<weight>50</weight>
11211122
<italic>false</italic>
11221123
<bold>false</bold>
11231124
<underline>true</underline>
@@ -1920,6 +1921,12 @@ p, li { white-space: pre-wrap; }
19201921
<property name="toolTip">
19211922
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;This list contains baud rates supported by current hardware.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
19221923
</property>
1924+
<property name="editable">
1925+
<bool>true</bool>
1926+
</property>
1927+
<property name="insertPolicy">
1928+
<enum>QComboBox::NoInsert</enum>
1929+
</property>
19231930
</widget>
19241931
</item>
19251932
<item row="1" column="6">
@@ -2917,6 +2924,7 @@ p, li { white-space: pre-wrap; }
29172924
</property>
29182925
<property name="font">
29192926
<font>
2927+
<weight>50</weight>
29202928
<bold>false</bold>
29212929
<underline>true</underline>
29222930
</font>
@@ -3234,7 +3242,7 @@ p, li { white-space: pre-wrap; }
32343242
<x>0</x>
32353243
<y>0</y>
32363244
<width>1797</width>
3237-
<height>19</height>
3245+
<height>20</height>
32383246
</rect>
32393247
</property>
32403248
<widget class="QMenu" name="menuFile">

0 commit comments

Comments
 (0)