Added commands injection in printing time (for temperature check)
This commit is contained in:
parent
139d92b0db
commit
f70f209bbc
@ -33,6 +33,8 @@ MainWindow::MainWindow(QWidget *parent) :
|
||||
paused = false;
|
||||
commandDone = false;
|
||||
checkingTemperature = true;
|
||||
injectingCommand = false;
|
||||
userCommand = "";
|
||||
currentLine = 0;
|
||||
|
||||
serialupdate();
|
||||
@ -419,7 +421,14 @@ void MainWindow::on_sendBtn_clicked()
|
||||
|
||||
void MainWindow::sendNext()
|
||||
{
|
||||
if(sending && !paused && printer.bytesToWrite() < 100 && commandDone)
|
||||
if(injectingCommand && commandDone && printer.bytesToWrite() < 100)
|
||||
{
|
||||
sendLine(userCommand);
|
||||
commandDone=false;
|
||||
injectingCommand=false;
|
||||
return;
|
||||
}
|
||||
else if(sending && !paused && printer.bytesToWrite() < 100 && commandDone)
|
||||
{
|
||||
if(currentLine >= gcode.size()) //check if we are at the end of array
|
||||
{
|
||||
@ -454,7 +463,7 @@ void MainWindow::on_pauseBtn_clicked()
|
||||
|
||||
void MainWindow::checkStatus()
|
||||
{
|
||||
if(checkingTemperature && (sinceLastTemp.elapsed() < statusTimer.interval())) sendLine("M105");
|
||||
if(checkingTemperature && (sinceLastTemp.elapsed() < statusTimer.interval())) injectCommand("M105");
|
||||
}
|
||||
|
||||
void MainWindow::on_checktemp_stateChanged(int arg1)
|
||||
@ -482,6 +491,12 @@ void MainWindow::on_actionAbout_triggered()
|
||||
aboutwindow.exec();
|
||||
}
|
||||
|
||||
void MainWindow::injectCommand(QString command)
|
||||
{
|
||||
injectingCommand = true;
|
||||
userCommand = command;
|
||||
}
|
||||
|
||||
void MainWindow::updateRecent()
|
||||
{
|
||||
|
||||
|
||||
@ -46,7 +46,9 @@ private:
|
||||
bool paused;
|
||||
bool commandDone;
|
||||
bool checkingTemperature;
|
||||
bool injectingCommand;
|
||||
int currentLine;
|
||||
QString userCommand;
|
||||
|
||||
|
||||
private slots:
|
||||
@ -61,6 +63,7 @@ private slots:
|
||||
void sendNext();
|
||||
void checkStatus();
|
||||
void updateRecent();
|
||||
void injectCommand(QString command);
|
||||
|
||||
void xplus();
|
||||
void yplus();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user