Added option to disable temperature check
This commit is contained in:
parent
0bb86f6d83
commit
3b0dd64aac
@ -29,10 +29,12 @@ MainWindow::MainWindow(QWidget *parent) :
|
|||||||
ui->extruderlcd->setPalette(Qt::red);
|
ui->extruderlcd->setPalette(Qt::red);
|
||||||
ui->bedlcd->setPalette(Qt::red);
|
ui->bedlcd->setPalette(Qt::red);
|
||||||
|
|
||||||
|
checkingTemperature = settings.value("core/checktemperature").toBool();
|
||||||
|
ui->checktemp->setChecked(checkingTemperature);
|
||||||
|
|
||||||
sending = false;
|
sending = false;
|
||||||
paused = false;
|
paused = false;
|
||||||
commandDone = false;
|
commandDone = false;
|
||||||
checkingTemperature = true;
|
|
||||||
injectingCommand = false;
|
injectingCommand = false;
|
||||||
userCommand = "";
|
userCommand = "";
|
||||||
currentLine = 0;
|
currentLine = 0;
|
||||||
@ -63,6 +65,7 @@ MainWindow::~MainWindow()
|
|||||||
if(printer.isOpen()) printer.close();
|
if(printer.isOpen()) printer.close();
|
||||||
|
|
||||||
settings.setValue("printer/baudrateIndex", ui->baudbox->currentIndex());
|
settings.setValue("printer/baudrateIndex", ui->baudbox->currentIndex());
|
||||||
|
settings.setValue("core/checktemperature", ui->checktemp->isChecked());
|
||||||
|
|
||||||
settings.beginWriteArray("user/recentfiles");
|
settings.beginWriteArray("user/recentfiles");
|
||||||
for(int i = 0; i < recentFiles.size(); i++)
|
for(int i = 0; i < recentFiles.size(); i++)
|
||||||
@ -349,23 +352,9 @@ void MainWindow::readSerial()
|
|||||||
{
|
{
|
||||||
QByteArray data = printer.readLine();
|
QByteArray data = printer.readLine();
|
||||||
if(data.startsWith("ok") || data.startsWith("wait")) commandDone = true; //Can send next command
|
if(data.startsWith("ok") || data.startsWith("wait")) commandDone = true; //Can send next command
|
||||||
else if(data.startsWith("T:")) //Parse temperature readings if any
|
else if(checkingTemperature && data.startsWith("T:")) //Parse temperature readings if any
|
||||||
{
|
{
|
||||||
QString extmp = "";
|
parseStatus(data);
|
||||||
QString btmp = "";
|
|
||||||
|
|
||||||
for(int i = 2; data.at(i) != '/'; i++)
|
|
||||||
{
|
|
||||||
extmp+=data.at(i);
|
|
||||||
}
|
|
||||||
for(int i = data.indexOf("B:")+2; data.at(i) != '/'; i++)
|
|
||||||
{
|
|
||||||
btmp+=data.at(i);
|
|
||||||
}
|
|
||||||
|
|
||||||
ui->extruderlcd->display(extmp.toDouble());
|
|
||||||
ui->bedlcd->display(btmp.toDouble());
|
|
||||||
sinceLastTemp.restart();
|
|
||||||
}
|
}
|
||||||
else if(data.startsWith("Resend")) //Handle resend if requested
|
else if(data.startsWith("Resend")) //Handle resend if requested
|
||||||
{
|
{
|
||||||
@ -562,3 +551,23 @@ void MainWindow::serialError(QSerialPort::SerialPortError error)
|
|||||||
ErrorWindow errorwindow(this, errorMsg);
|
ErrorWindow errorwindow(this, errorMsg);
|
||||||
errorwindow.exec();
|
errorwindow.exec();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MainWindow::parseStatus(QByteArray data)
|
||||||
|
{
|
||||||
|
QString extmp = "";
|
||||||
|
QString btmp = "";
|
||||||
|
|
||||||
|
for(int i = 2; data.at(i) != '/'; i++)
|
||||||
|
{
|
||||||
|
extmp+=data.at(i);
|
||||||
|
}
|
||||||
|
for(int i = data.indexOf("B:")+2; data.at(i) != '/'; i++)
|
||||||
|
{
|
||||||
|
btmp+=data.at(i);
|
||||||
|
}
|
||||||
|
|
||||||
|
ui->extruderlcd->display(extmp.toDouble());
|
||||||
|
ui->bedlcd->display(btmp.toDouble());
|
||||||
|
sinceLastTemp.restart();
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@ -66,6 +66,7 @@ private slots:
|
|||||||
void checkStatus();
|
void checkStatus();
|
||||||
void updateRecent();
|
void updateRecent();
|
||||||
void injectCommand(QString command);
|
void injectCommand(QString command);
|
||||||
|
void parseStatus(QByteArray data);
|
||||||
|
|
||||||
void xplus();
|
void xplus();
|
||||||
void yplus();
|
void yplus();
|
||||||
|
|||||||
@ -122,7 +122,7 @@
|
|||||||
<locale language="English" country="UnitedStates"/>
|
<locale language="English" country="UnitedStates"/>
|
||||||
</property>
|
</property>
|
||||||
<property name="minimum">
|
<property name="minimum">
|
||||||
<double>1.000000000000000</double>
|
<double>0.100000000000000</double>
|
||||||
</property>
|
</property>
|
||||||
<property name="maximum">
|
<property name="maximum">
|
||||||
<double>150.000000000000000</double>
|
<double>150.000000000000000</double>
|
||||||
|
|||||||
@ -7,8 +7,7 @@ SettingsWindow::SettingsWindow(QWidget *parent) :
|
|||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
|
||||||
if(settings.value("core/senderinterval").toFloat()) ui->senderbox->setValue(settings.value("core/senderinterval").toFloat());
|
ui->senderbox->setValue(settings.value("core/senderinterval").toFloat());
|
||||||
else ui->senderbox->setValue(1);
|
|
||||||
|
|
||||||
if(settings.value("core/statusinterval").toInt()) ui->statusbox->setValue(settings.value("core/statusinterval").toInt());
|
if(settings.value("core/statusinterval").toInt()) ui->statusbox->setValue(settings.value("core/statusinterval").toInt());
|
||||||
else ui->senderbox->setValue(3000);
|
else ui->senderbox->setValue(3000);
|
||||||
|
|||||||
@ -89,7 +89,7 @@
|
|||||||
<item row="0" column="1">
|
<item row="0" column="1">
|
||||||
<widget class="QDoubleSpinBox" name="senderbox">
|
<widget class="QDoubleSpinBox" name="senderbox">
|
||||||
<property name="toolTip">
|
<property name="toolTip">
|
||||||
<string>A good default is 2, lower = fater, higher = less CPU load</string>
|
<string>A good default is 2, lower = fater, higher = less CPU load. 0 would execute as soon as possible.</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="toolTipDuration">
|
<property name="toolTipDuration">
|
||||||
<number>-1</number>
|
<number>-1</number>
|
||||||
@ -98,7 +98,7 @@
|
|||||||
<locale language="English" country="UnitedStates"/>
|
<locale language="English" country="UnitedStates"/>
|
||||||
</property>
|
</property>
|
||||||
<property name="minimum">
|
<property name="minimum">
|
||||||
<double>0.100000000000000</double>
|
<double>0.000000000000000</double>
|
||||||
</property>
|
</property>
|
||||||
<property name="maximum">
|
<property name="maximum">
|
||||||
<double>999.990000000000009</double>
|
<double>999.990000000000009</double>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user