Added option to disable temperature check

This commit is contained in:
NeoTheFox 2015-03-02 18:07:45 +03:00
parent 0bb86f6d83
commit 3b0dd64aac
5 changed files with 31 additions and 22 deletions

View File

@ -29,10 +29,12 @@ MainWindow::MainWindow(QWidget *parent) :
ui->extruderlcd->setPalette(Qt::red);
ui->bedlcd->setPalette(Qt::red);
checkingTemperature = settings.value("core/checktemperature").toBool();
ui->checktemp->setChecked(checkingTemperature);
sending = false;
paused = false;
commandDone = false;
checkingTemperature = true;
injectingCommand = false;
userCommand = "";
currentLine = 0;
@ -63,6 +65,7 @@ MainWindow::~MainWindow()
if(printer.isOpen()) printer.close();
settings.setValue("printer/baudrateIndex", ui->baudbox->currentIndex());
settings.setValue("core/checktemperature", ui->checktemp->isChecked());
settings.beginWriteArray("user/recentfiles");
for(int i = 0; i < recentFiles.size(); i++)
@ -349,23 +352,9 @@ void MainWindow::readSerial()
{
QByteArray data = printer.readLine();
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 = "";
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();
parseStatus(data);
}
else if(data.startsWith("Resend")) //Handle resend if requested
{
@ -562,3 +551,23 @@ void MainWindow::serialError(QSerialPort::SerialPortError error)
ErrorWindow errorwindow(this, errorMsg);
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();
}

View File

@ -66,6 +66,7 @@ private slots:
void checkStatus();
void updateRecent();
void injectCommand(QString command);
void parseStatus(QByteArray data);
void xplus();
void yplus();

View File

@ -122,7 +122,7 @@
<locale language="English" country="UnitedStates"/>
</property>
<property name="minimum">
<double>1.000000000000000</double>
<double>0.100000000000000</double>
</property>
<property name="maximum">
<double>150.000000000000000</double>

View File

@ -7,8 +7,7 @@ SettingsWindow::SettingsWindow(QWidget *parent) :
{
ui->setupUi(this);
if(settings.value("core/senderinterval").toFloat()) ui->senderbox->setValue(settings.value("core/senderinterval").toFloat());
else ui->senderbox->setValue(1);
ui->senderbox->setValue(settings.value("core/senderinterval").toFloat());
if(settings.value("core/statusinterval").toInt()) ui->statusbox->setValue(settings.value("core/statusinterval").toInt());
else ui->senderbox->setValue(3000);

View File

@ -89,7 +89,7 @@
<item row="0" column="1">
<widget class="QDoubleSpinBox" name="senderbox">
<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 name="toolTipDuration">
<number>-1</number>
@ -98,7 +98,7 @@
<locale language="English" country="UnitedStates"/>
</property>
<property name="minimum">
<double>0.100000000000000</double>
<double>0.000000000000000</double>
</property>
<property name="maximum">
<double>999.990000000000009</double>