Skip to content

Commit

Permalink
Add option to disable reset after connect
Browse files Browse the repository at this point in the history
Signed-off-by: Patrick Felixberger <robomaniac8@googlemail.com>
  • Loading branch information
Schildkroet committed Mar 8, 2024
1 parent 66a5569 commit 2ad3200
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/frmmain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -653,6 +653,11 @@ void frmMain::GrblReset()
{
qDebug() << "GRBL Reset";

if(!m_settings->ResetAfterConnect())
{
return;
}

ui->txtConsole->clear();

// Reset: 0x18
Expand Down
2 changes: 1 addition & 1 deletion src/frmmain_processresponse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -856,8 +856,8 @@ void frmMain::ProcessGRBL1_1()

void frmMain::ProcessGRBL_ETH(QString data)
{
//while(SerialIf_CanReadLine())
{
// Remove CRLF
data = data.trimmed();

//qDebug() << "-- " << data << " --";
Expand Down
1 change: 1 addition & 0 deletions src/frmmain_settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
10 changes: 10 additions & 0 deletions src/frmsettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 2 additions & 0 deletions src/frmsettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
7 changes: 7 additions & 0 deletions src/frmsettings.ui
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,13 @@ QGroupBox {
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="chkResetConnect">
<property name="text">
<string>Reset after Connect</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
Expand Down

0 comments on commit 2ad3200

Please sign in to comment.