mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-18 20:28:08 -06:00
More work on print controller
This commit is contained in:
parent
c06ce3b58c
commit
2c0d216c1a
15 changed files with 626 additions and 63 deletions
|
@ -23,7 +23,8 @@ namespace Slic3r {
|
|||
namespace asio = boost::asio;
|
||||
|
||||
GCodeSender::GCodeSender()
|
||||
: io(), serial(io), can_send(false), sent(0), error(false), connected(false)
|
||||
: io(), serial(io), can_send(false), sent(0), error(false), connected(false),
|
||||
queue_paused(false)
|
||||
{}
|
||||
|
||||
GCodeSender::~GCodeSender()
|
||||
|
@ -140,6 +141,23 @@ GCodeSender::queue_size() const
|
|||
return this->queue.size();
|
||||
}
|
||||
|
||||
void
|
||||
GCodeSender::pause_queue()
|
||||
{
|
||||
boost::lock_guard<boost::mutex> l(this->queue_mutex);
|
||||
this->queue_paused = true;
|
||||
}
|
||||
|
||||
void
|
||||
GCodeSender::resume_queue()
|
||||
{
|
||||
{
|
||||
boost::lock_guard<boost::mutex> l(this->queue_mutex);
|
||||
this->queue_paused = false;
|
||||
}
|
||||
this->send();
|
||||
}
|
||||
|
||||
void
|
||||
GCodeSender::do_close()
|
||||
{
|
||||
|
@ -260,6 +278,7 @@ GCodeSender::send()
|
|||
{
|
||||
// printer is not connected or we're still waiting for the previous ack
|
||||
if (!this->can_send) return;
|
||||
if (this->queue_paused) return;
|
||||
|
||||
boost::lock_guard<boost::mutex> l(this->queue_mutex);
|
||||
if (this->queue.empty()) return;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue