diff --git a/src/frmmain.cpp b/src/frmmain.cpp index 2d14e97..1046b0e 100644 --- a/src/frmmain.cpp +++ b/src/frmmain.cpp @@ -653,6 +653,11 @@ void frmMain::GrblReset() { qDebug() << "GRBL Reset"; + if(!m_settings->ResetAfterConnect()) + { + return; + } + ui->txtConsole->clear(); // Reset: 0x18 diff --git a/src/frmmain_processresponse.cpp b/src/frmmain_processresponse.cpp index 42ca5fb..afd8e5a 100644 --- a/src/frmmain_processresponse.cpp +++ b/src/frmmain_processresponse.cpp @@ -856,8 +856,8 @@ void frmMain::ProcessGRBL1_1() void frmMain::ProcessGRBL_ETH(QString data) { - //while(SerialIf_CanReadLine()) { + // Remove CRLF data = data.trimmed(); //qDebug() << "-- " << data << " --"; diff --git a/src/frmmain_settings.cpp b/src/frmmain_settings.cpp index 779b790..10cf1c2 100644 --- a/src/frmmain_settings.cpp +++ b/src/frmmain_settings.cpp @@ -35,6 +35,7 @@ void frmMain::loadSettings() m_settings->setAutoLine(set.value("autoLine", true).toBool()); m_settings->setUseM6(set.value("useM6", false).toBool()); m_settings->setUseRotaryAxis(set.value("useRotary", false).toBool()); + m_settings->setResetAfterConnect(set.value("resetConnect", true).toBool()); m_settings->setToolDiameter(set.value("toolDiameter", 3).toDouble()); m_settings->setToolLength(set.value("toolLength", 15).toDouble()); m_settings->setAntialiasing(set.value("antialiasing", true).toBool()); diff --git a/src/frmsettings.cpp b/src/frmsettings.cpp index 77e8190..f73ac79 100644 --- a/src/frmsettings.cpp +++ b/src/frmsettings.cpp @@ -617,6 +617,16 @@ void frmSettings::setUseRotaryAxis(bool value) ui->chkEnableRotaryAxis->setChecked(value); } +bool frmSettings::ResetAfterConnect() +{ + return ui->chkResetConnect->isChecked(); +} + +void frmSettings::setResetAfterConnect(bool value) +{ + ui->chkResetConnect->setChecked(value); +} + QColor frmSettings::tool() { return ui->clpTool->color(); diff --git a/src/frmsettings.h b/src/frmsettings.h index 9ce62f6..1885299 100644 --- a/src/frmsettings.h +++ b/src/frmsettings.h @@ -126,6 +126,8 @@ class frmSettings : public QDialog void setUseM6(bool value); bool UseRotaryAxis(); void setUseRotaryAxis(bool value); + bool ResetAfterConnect(); + void setResetAfterConnect(bool value); QColor tool(); void setTool(const QColor& color); diff --git a/src/frmsettings.ui b/src/frmsettings.ui index 579ae34..5b7ef9d 100644 --- a/src/frmsettings.ui +++ b/src/frmsettings.ui @@ -268,6 +268,13 @@ QGroupBox { + + + + Reset after Connect + + +