Skip to content

Commit 3de12a7

Browse files
authored
Merge pull request #4 from albymor/master
Add selection of implicit line endings
2 parents bd23e67 + f41e373 commit 3de12a7

File tree

4 files changed

+139
-101
lines changed

4 files changed

+139
-101
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
src/mainwindow.cpp.autosave
22
/QtSerialMonitor/src/QtSerialMonitor.pro.user
33
/build/*
4-
4+
/build*

src/QtSerialMonitor.pro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ SOURCES += \
4242
serial.cpp
4343

4444
HEADERS += \
45-
../../../../../../Downloads/QCustomPlot.tar/qcustomplot/qcustomplot.h \
45+
qcustomplot.h \
4646
codeeditor.h \
4747
config.h \
4848
filereader.h \

src/mainwindow.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,7 @@ void MainWindow::settingsLoadAll()
263263
ui->checkBoxAutoSizeColumnsLogTable->setChecked(appSettings.value("GUI_Elements/checkBoxAutoSizeColumnsLogTable.isChecked", true).value<bool>());
264264
ui->checkBoxScrollLogEnableSorting->setChecked(appSettings.value("GUI_Elements/checkBoxScrollLogEnableSorting.isChecked", true).value<bool>()); ui->checkBoxScrollLogEnableSorting->setChecked(appSettings.value("GUI_Elements/checkBoxScrollLogEnableSorting.isChecked", true).value<bool>());
265265
ui->comboBoxAddTextMode->setCurrentIndex(appSettings.value("GUI_Elements/comboBoxAddTextMode.currentIndex").value<int>());
266+
ui->comboBoxLineEnding->setCurrentIndex(appSettings.value("GUI_Elements/comboBoxLineEnding.currentIndex").value<int>());
266267
ui->comboBoxBaudRates->setCurrentIndex(appSettings.value("GUI_Elements/comboBoxBaudRates.currentIndex").value<int>());
267268
ui->comboBoxClockSource->setCurrentIndex(appSettings.value("GUI_Elements/comboBoxClockSource.currentIndex").value<int>());
268269
ui->comboBoxDataBits->setCurrentIndex(appSettings.value("GUI_Elements/comboBoxDataBits.currentIndex").value<int>());
@@ -374,6 +375,7 @@ void MainWindow::settingsSaveAll()
374375
appSettings.setValue("GUI_Elements/checkBoxAutoSizeColumnsLogTable.isChecked", ui->checkBoxAutoSizeColumnsLogTable->isChecked());
375376
appSettings.setValue("GUI_Elements/checkBoxAutoScrollLogTable.isChecked", ui->checkBoxAutoScrollLogTable->isChecked());
376377
appSettings.setValue("GUI_Elements/comboBoxAddTextMode.currentIndex", ui->comboBoxAddTextMode->currentIndex());
378+
appSettings.setValue("GUI_Elements/comboBoxLineEnding.currentIndex", ui->comboBoxLineEnding->currentIndex());
377379
appSettings.setValue("GUI_Elements/comboBoxBaudRates.currentIndex", ui->comboBoxBaudRates->currentIndex());
378380
appSettings.setValue("GUI_Elements/comboBoxClockSource.currentIndex", ui->comboBoxClockSource->currentIndex());
379381
appSettings.setValue("GUI_Elements/comboBoxDataBits.currentIndex", ui->comboBoxDataBits->currentIndex());
@@ -1306,6 +1308,18 @@ void MainWindow::sendMessageKeyEvent(QKeyEvent *event)
13061308

13071309
void MainWindow::sendSerial(QString message) // TODO - move to serial - error via signal/slot
13081310
{
1311+
if (ui->comboBoxLineEnding->currentIndex() == 1)
1312+
{
1313+
message = message + "\n";
1314+
}
1315+
else if (ui->comboBoxLineEnding->currentIndex() == 2)
1316+
{
1317+
message = message + "\r";
1318+
}
1319+
else if (ui->comboBoxLineEnding->currentIndex() == 3)
1320+
{
1321+
message = message + "\r\n";
1322+
}
13091323
if (!serial.send(message))
13101324
this->addLog("App >>\t Unable to send! Serial port closed !", true);
13111325
}

0 commit comments

Comments
 (0)