From 5c790251c1b03c9673e1b6bf966c4ce2f4221db9 Mon Sep 17 00:00:00 2001 From: NeoTheFox Date: Sat, 16 Apr 2016 12:56:30 +0300 Subject: [PATCH] Added log buffe settings (should also fix the memory leak) --- mainwindow.cpp | 4 ++ settingswindow.cpp | 2 + settingswindow.ui | 113 ++++++++++++++++++++++++++------------------- 3 files changed, 71 insertions(+), 48 deletions(-) diff --git a/mainwindow.cpp b/mainwindow.cpp index 5e94410..12ae90a 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -82,6 +82,8 @@ MainWindow::MainWindow(QWidget *parent) : ui->btmpspin->setValue(settings.value("user/bedtemp", 60).toInt()); ui->stepspin->setValue(settings.value("user/step", 1).toInt()); ui->estepspin->setValue(settings.value("user/estep", 1).toInt()); + ui->terminal->document()->setMaximumBlockCount( + settings.value("core/logbuffersize", 1000).toInt()); echo = settings.value("core/echo", 0).toBool(); autolock = settings.value("core/lockcontrols", 0).toBool(); chekingSDStatus = settings.value("core/checksdstatus", 1).toBool(); @@ -954,6 +956,8 @@ void MainWindow::updatesettings() statusTimer->setInterval(settings.value("core/statusinterval", 3000).toInt()); feedrate = settings.value("feedrate", 1500).toInt(); extruderFeedrate = settings.value("extruderfeedrate", 200).toInt(); + ui->terminal->document()->setMaximumBlockCount( + settings.value("core/logbuffersize", 1000).toInt()); } //Needed for keypress handling diff --git a/settingswindow.cpp b/settingswindow.cpp index 0984411..99a8984 100644 --- a/settingswindow.cpp +++ b/settingswindow.cpp @@ -26,6 +26,7 @@ SettingsWindow::SettingsWindow(QWidget *parent) : ui->sdbox->setChecked(settings.value("core/checksdstatus", 1).toBool()); ui->dtrbox->setChecked(settings.value("core/dtr", 1).toBool()); ui->supresswaitbox->setChecked(settings.value("user/supresswait").toBool()); + ui->bufferbox->setValue(settings.value("core/logbuffersize", 1000).toInt()); ui->firmwarecombo->addItem("Marlin"); //0 ui->firmwarecombo->addItem("Repetier"); //1 @@ -62,6 +63,7 @@ void SettingsWindow::on_buttonBox_accepted() settings.setValue("core/dtr", ui->dtrbox->isChecked()); settings.setValue("printer/firmware", ui->firmwarecombo->currentIndex()); settings.setValue("user/supresswait", ui->supresswaitbox->isChecked()); + settings.setValue("core/logbuffersize", ui->bufferbox->value()); emit updatesettings(); } diff --git a/settingswindow.ui b/settingswindow.ui index bbad3f6..f1c92c2 100644 --- a/settingswindow.ui +++ b/settingswindow.ui @@ -7,7 +7,7 @@ 0 0 484 - 357 + 429 @@ -24,48 +24,6 @@ Internal - - - - Sender - - - - - - - - - - - - - - Flow control - - - - - - - DTR - - - - - - - ms - - - - - - - ms - - - @@ -114,7 +72,7 @@ - + true @@ -124,7 +82,7 @@ - + Check SD printing status @@ -153,14 +111,56 @@ - + + + + Flow control + + + + + + + DTR + + + + + + + ms + + + + + + + ms + + + + + + + Sender + + + + + + + + + + + Lock controls when printing - + true @@ -173,13 +173,30 @@ - + Supress "wait" responce + + + + Log buffer + + + + + + + 100000 + + + 1000 + + +