Fixes on serial connection
This commit is contained in:
parent
f920b8cf34
commit
49e011ac85
@ -192,6 +192,8 @@ void MainWindow::serialconnect()
|
||||
ui->progressBar->setValue(0);
|
||||
ui->controlBox->setDisabled(false);
|
||||
ui->consoleGroup->setDisabled(false);
|
||||
commandDone = true;
|
||||
if(checkingTemperature) injectCommand("M105");
|
||||
}
|
||||
}
|
||||
|
||||
@ -352,10 +354,7 @@ void MainWindow::readSerial()
|
||||
{
|
||||
QByteArray data = printer.readLine();
|
||||
if(data.startsWith("ok") || data.startsWith("wait")) commandDone = true; //Can send next command
|
||||
else if(checkingTemperature && data.startsWith("T:")) //Parse temperature readings if any
|
||||
{
|
||||
parseStatus(data);
|
||||
}
|
||||
else if(checkingTemperature && data.startsWith("T:")) parseStatus(data); //Parse temperature readings if any
|
||||
else if(data.startsWith("Resend")) //Handle resend if requested
|
||||
{
|
||||
if(currentLine > 0) currentLine -= data.split(':')[1].toInt();
|
||||
@ -571,3 +570,8 @@ void MainWindow::parseStatus(QByteArray data)
|
||||
sinceLastTemp.restart();
|
||||
}
|
||||
|
||||
|
||||
void MainWindow::on_actionPrint_from_SD_triggered()
|
||||
{
|
||||
//TODO
|
||||
}
|
||||
|
||||
@ -98,6 +98,7 @@ private slots:
|
||||
void on_releasebtn_clicked();
|
||||
void on_actionAbout_triggered();
|
||||
void serialError(QSerialPort::SerialPortError error);
|
||||
void on_actionPrint_from_SD_triggered();
|
||||
};
|
||||
|
||||
#endif // MAINWINDOW_H
|
||||
|
||||
@ -129,13 +129,6 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="7" colspan="2">
|
||||
<widget class="QPushButton" name="etmpoff">
|
||||
<property name="text">
|
||||
<string>OFF</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="5" colspan="2">
|
||||
<widget class="QPushButton" name="etmpset">
|
||||
<property name="text">
|
||||
@ -348,6 +341,13 @@
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="6" column="7" colspan="2">
|
||||
<widget class="QPushButton" name="etmpoff">
|
||||
<property name="text">
|
||||
<string>OFF</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
@ -539,7 +539,17 @@
|
||||
</property>
|
||||
<addaction name="actionAbout"/>
|
||||
</widget>
|
||||
<widget class="QMenu" name="menuTools">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Tools</string>
|
||||
</property>
|
||||
<addaction name="actionPrint_from_SD"/>
|
||||
</widget>
|
||||
<addaction name="menuFile"/>
|
||||
<addaction name="menuTools"/>
|
||||
<addaction name="menuAbout"/>
|
||||
</widget>
|
||||
<widget class="QStatusBar" name="statusBar"/>
|
||||
@ -580,6 +590,14 @@
|
||||
<string>About</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionPrint_from_SD">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Print from SD...</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<layoutdefault spacing="6" margin="11"/>
|
||||
<resources>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user