mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-07-20 03:14:30 +08:00
Allow GCodeSender to be reused after disconnection
This commit is contained in:
parent
3518a97e4c
commit
bfd86c36df
@ -70,6 +70,10 @@ GCodeSender::connect(std::string devname, unsigned int baud_rate)
|
|||||||
this->open = true;
|
this->open = true;
|
||||||
this->reset();
|
this->reset();
|
||||||
|
|
||||||
|
// a reset firmware expect line numbers to start again from 1
|
||||||
|
this->sent = 0;
|
||||||
|
this->last_sent.clear();
|
||||||
|
|
||||||
/* Initialize debugger */
|
/* Initialize debugger */
|
||||||
#ifdef DEBUG_SERIAL
|
#ifdef DEBUG_SERIAL
|
||||||
fs.open("serial.txt", std::fstream::out | std::fstream::trunc);
|
fs.open("serial.txt", std::fstream::out | std::fstream::trunc);
|
||||||
@ -153,6 +157,7 @@ GCodeSender::disconnect()
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef DEBUG_SERIAL
|
#ifdef DEBUG_SERIAL
|
||||||
|
fs << "DISCONNECTED" << std::endl << std::flush;
|
||||||
fs.close();
|
fs.close();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user