Frontend to the famous GRBL.

probingoptionsdialog.cpp 2.0KB

    /* Part of x2grbl * * Copyright Johann Wilhelm <johann.wilhelm@9mal6.de> 2015 * * see Readme.md for detailed license and usage information! */ #include "probingoptionsdialog.h" #include "ui_probingoptionsdialog.h" #include <QSettings> ProbingOptionsDialog::ProbingOptionsDialog(QWidget *parent) : QDialog(parent), ui(new Ui::ProbingOptionsDialog) { ui->setupUi(this); QSettings settings(QSettings::IniFormat, QSettings::UserScope, QString("2.5d Grbl-Commander")); settings.beginGroup("Probing"); if (settings.contains(QString("ProbingGrid"))) ui->probingGrid->setValue(settings.value("ProbingGrid").toDouble()); if (settings.contains(QString("ProbingFeedrate"))) ui->probingFeedrate->setValue(settings.value("ProbingFeedrate").toDouble()); if (settings.contains(QString("MovingFeedrate"))) ui->movingFeedrate->setValue(settings.value("MovingFeedrate").toDouble()); if (settings.contains(QString("Zhigh"))) ui->Zhigh->setValue(settings.value("Zhigh").toDouble()); if (settings.contains(QString("Zlow"))) ui->Zlow->setValue(settings.value("Zlow").toDouble()); if (settings.contains(QString("RapidMotionSeek"))) ui->rapidSeek->setChecked(settings.value("RapidMotionSeek").toBool()); settings.endGroup(); } ProbingOptionsDialog::~ProbingOptionsDialog() { delete ui; } void ProbingOptionsDialog::accept() { QSettings settings(QSettings::IniFormat, QSettings::UserScope, QString("2.5d Grbl-Commander")); settings.beginGroup("Probing"); settings.setValue("ProbingGrid", ui->probingGrid->value()); settings.setValue("ProbingFeedrate", ui->probingFeedrate->value()); settings.setValue("MovingFeedrate", ui->movingFeedrate->value()); settings.setValue("Zhigh", ui->Zhigh->value()); settings.setValue("Zlow", ui->Zlow->value()); settings.setValue("RapidMotionSeek", ui->rapidSeek->isChecked()); settings.endGroup(); QDialog::accept(); }