Prusa Slicer 2.6.0
Loading...
Searching...
No Matches
Slic3r::GCodeSender Class Reference

#include <src/libslic3r/GCodeSender.hpp>

+ Inheritance diagram for Slic3r::GCodeSender:
+ Collaboration diagram for Slic3r::GCodeSender:

Public Member Functions

 GCodeSender ()
 
 ~GCodeSender ()
 
bool connect (std::string devname, unsigned int baud_rate)
 
void send (const std::vector< std::string > &lines, bool priority=false)
 
void send (const std::string &s, bool priority=false)
 
void disconnect ()
 
bool error_status () const
 
bool is_connected () const
 
bool wait_connected (unsigned int timeout=3) const
 
size_t queue_size () const
 
void pause_queue ()
 
void resume_queue ()
 
void purge_queue (bool priority=false)
 
std::vector< std::string > purge_log ()
 
std::string getT () const
 
std::string getB () const
 
void set_DTR (bool on)
 
void reset ()
 

Private Member Functions

void set_baud_rate (unsigned int baud_rate)
 
void set_error_status (bool e)
 
void do_send ()
 
void on_write (const boost::system::error_code &error, size_t bytes_transferred)
 
void do_close ()
 
void do_read ()
 
void on_read (const boost::system::error_code &error, size_t bytes_transferred)
 
void send ()
 

Private Attributes

asio::io_service io
 
asio::serial_port serial
 
boost::thread background_thread
 
boost::asio::streambuf read_buffer
 
boost::asio::streambuf write_buffer
 
bool open
 
bool connected
 
bool error
 
boost::mutex error_mutex
 
boost::mutex queue_mutex
 
std::queue< std::string > queue
 
std::list< std::string > priqueue
 
bool can_send
 
bool queue_paused
 
size_t sent
 
std::deque< std::string > last_sent
 
boost::mutex log_mutex
 
std::queue< std::string > log
 
std::string T
 
std::string B
 

Detailed Description

Constructor & Destructor Documentation

◆ GCodeSender()

Slic3r::GCodeSender::GCodeSender ( )
55 : io(), serial(io), can_send(false), sent(0), open(false), error(false),
56 connected(false), queue_paused(false)
57{
58#ifdef DEBUG_SERIAL
59 std::srand(std::time(nullptr));
60#endif
61}
asio::io_service io
Definition GCodeSender.hpp:38
bool can_send
Definition GCodeSender.hpp:51
bool connected
Definition GCodeSender.hpp:43
bool queue_paused
Definition GCodeSender.hpp:52
bool open
Definition GCodeSender.hpp:42
size_t sent
Definition GCodeSender.hpp:53
bool error
Definition GCodeSender.hpp:44
asio::serial_port serial
Definition GCodeSender.hpp:39

◆ ~GCodeSender()

Slic3r::GCodeSender::~GCodeSender ( )
64{
65 this->disconnect();
66}
void disconnect()
Definition GCodeSender.cpp:162

References disconnect().

+ Here is the call graph for this function:

Member Function Documentation

◆ connect()

bool Slic3r::GCodeSender::connect ( std::string  devname,
unsigned int  baud_rate 
)
70{
71 this->disconnect();
72
73 this->set_error_status(false);
74 try {
75 this->serial.open(devname);
76
77 this->serial.set_option(boost::asio::serial_port_base::parity(boost::asio::serial_port_base::parity::odd));
78 this->serial.set_option(boost::asio::serial_port_base::character_size(boost::asio::serial_port_base::character_size(8)));
79 this->serial.set_option(boost::asio::serial_port_base::flow_control(boost::asio::serial_port_base::flow_control::none));
80 this->serial.set_option(boost::asio::serial_port_base::stop_bits(boost::asio::serial_port_base::stop_bits::one));
81 this->set_baud_rate(baud_rate);
82
83 this->serial.close();
84 this->serial.open(devname);
85 this->serial.set_option(boost::asio::serial_port_base::parity(boost::asio::serial_port_base::parity::none));
86
87 // set baud rate again because set_option overwrote it
88 this->set_baud_rate(baud_rate);
89 this->open = true;
90 this->reset();
91 } catch (boost::system::system_error &) {
92 this->set_error_status(true);
93 return false;
94 }
95
96 // a reset firmware expect line numbers to start again from 1
97 this->sent = 0;
98 this->last_sent.clear();
99
100 /* Initialize debugger */
101#ifdef DEBUG_SERIAL
102 fs.open("serial.txt", std::fstream::out | std::fstream::trunc);
103#endif
104
105 // this gives some work to the io_service before it is started
106 // (post() runs the supplied function in its thread)
107 this->io.post(boost::bind(&GCodeSender::do_read, this));
108
109 // start reading in the background thread
110 boost::thread t(boost::bind(&boost::asio::io_service::run, &this->io));
111 this->background_thread.swap(t);
112
113 // always send a M105 to check for connection because firmware might be silent on connect
114 //FIXME Vojtech: This is being sent too early, leading to line number synchronization issues,
115 // from which the GCodeSender never recovers.
116 // this->send("M105", true);
117
118 return true;
119}
void do_read()
Definition GCodeSender.cpp:295
std::deque< std::string > last_sent
Definition GCodeSender.hpp:54
boost::thread background_thread
Definition GCodeSender.hpp:40
void reset()
Definition GCodeSender.cpp:570
void set_error_status(bool e)
Definition GCodeSender.cpp:281
void set_baud_rate(unsigned int baud_rate)
Definition GCodeSender.cpp:122
Definition Utils.hpp:15

References background_thread, disconnect(), do_read(), io, last_sent, open, reset(), sent, serial, set_baud_rate(), and set_error_status().

+ Here is the call graph for this function:

◆ disconnect()

void Slic3r::GCodeSender::disconnect ( )
163{
164 if (!this->open) return;
165 this->open = false;
166 this->connected = false;
167 this->io.post(boost::bind(&GCodeSender::do_close, this));
168 this->background_thread.join();
169 this->io.reset();
170 /*
171 if (this->error_status()) {
172 throw(boost::system::system_error(boost::system::error_code(),
173 "Error while closing the device"));
174 }
175 */
176
177#ifdef DEBUG_SERIAL
178 fs << "DISCONNECTED" << std::endl << std::flush;
179 fs.close();
180#endif
181}
void do_close()
Definition GCodeSender.cpp:270

References background_thread, connected, do_close(), io, and open.

Referenced by ~GCodeSender(), and connect().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ do_close()

void Slic3r::GCodeSender::do_close ( )
private
271{
272 this->set_error_status(false);
273 boost::system::error_code ec;
274 this->serial.cancel(ec);
275 if (ec) this->set_error_status(true);
276 this->serial.close(ec);
277 if (ec) this->set_error_status(true);
278}

References serial, and set_error_status().

Referenced by disconnect(), on_read(), and on_write().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ do_read()

void Slic3r::GCodeSender::do_read ( )
private
296{
297 // read one line
298 boost::asio::async_read_until(
299 this->serial,
300 this->read_buffer,
301 '\n',
302 boost::bind(
304 this,
305 boost::asio::placeholders::error,
306 boost::asio::placeholders::bytes_transferred
307 )
308 );
309}
boost::asio::streambuf read_buffer
Definition GCodeSender.hpp:41
void on_read(const boost::system::error_code &error, size_t bytes_transferred)
Definition GCodeSender.cpp:312

References on_read(), read_buffer, and serial.

Referenced by connect(), and on_read().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ do_send()

void Slic3r::GCodeSender::do_send ( )
private
465{
466 boost::lock_guard<boost::mutex> l(this->queue_mutex);
467
468 // printer is not connected or we're still waiting for the previous ack
469 if (!this->can_send) return;
470
471 std::string line;
472 while (!this->priqueue.empty() || (!this->queue.empty() && !this->queue_paused)) {
473 if (!this->priqueue.empty()) {
474 line = this->priqueue.front();
475 this->priqueue.pop_front();
476 } else {
477 line = this->queue.front();
478 this->queue.pop();
479 }
480
481 // strip comments
482 size_t comment_pos = line.find_first_of(';');
483 if (comment_pos != std::string::npos)
484 line.erase(comment_pos, std::string::npos);
485 boost::algorithm::trim(line);
486
487 // if line is not empty, send it
488 if (!line.empty()) break;
489 // if line is empty, process next item in queue
490 }
491 if (line.empty()) return;
492
493 // compute full line
494 ++ this->sent;
495#ifndef DEBUG_SERIAL
496 const auto line_num = this->sent;
497#else
498 // In DEBUG_SERIAL mode, test line re-synchronization by sending bad line number 1/4 of the time
499 const auto line_num = std::rand() < RAND_MAX/4 ? 0 : this->sent;
500#endif
501 std::string full_line = "N" + boost::lexical_cast<std::string>(line_num) + " " + line;
502
503 // calculate checksum
504 int cs = 0;
505 for (std::string::const_iterator it = full_line.begin(); it != full_line.end(); ++it)
506 cs = cs ^ *it;
507
508 // write line to device
509 full_line += "*";
510 full_line += boost::lexical_cast<std::string>(cs);
511 full_line += "\n";
512
513#ifdef DEBUG_SERIAL
514 fs << ">> " << full_line << std::flush;
515#endif
516
517 this->last_sent.push_back(line);
518 this->can_send = false;
519
520 while (this->last_sent.size() > KEEP_SENT) {
521 this->last_sent.pop_front();
522 }
523
524 // we can't supply boost::asio::buffer(full_line) to async_write() because full_line is on the
525 // stack and the buffer would lose its underlying storage causing memory corruption
526 std::ostream os(&this->write_buffer);
527 os << full_line;
528 boost::asio::async_write(this->serial, this->write_buffer, boost::bind(&GCodeSender::on_write, this, boost::asio::placeholders::error,
529 boost::asio::placeholders::bytes_transferred));
530}
#define KEEP_SENT
Definition GCodeSender.cpp:50
boost::mutex queue_mutex
Definition GCodeSender.hpp:48
boost::asio::streambuf write_buffer
Definition GCodeSender.hpp:41
void on_write(const boost::system::error_code &error, size_t bytes_transferred)
Definition GCodeSender.cpp:533
std::queue< std::string > queue
Definition GCodeSender.hpp:49
std::list< std::string > priqueue
Definition GCodeSender.hpp:50

References can_send, KEEP_SENT, last_sent, on_write(), priqueue, queue, queue_mutex, sent, serial, and write_buffer.

Referenced by on_write(), and send().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ error_status()

bool Slic3r::GCodeSender::error_status ( ) const
289{
290 boost::lock_guard<boost::mutex> l(this->error_mutex);
291 return this->error;
292}
boost::mutex error_mutex
Definition GCodeSender.hpp:45

References error, and error_mutex.

◆ getB()

std::string Slic3r::GCodeSender::getB ( ) const
264{
265 boost::lock_guard<boost::mutex> l(this->log_mutex);
266 return this->B;
267}
boost::mutex log_mutex
Definition GCodeSender.hpp:57
std::string B
Definition GCodeSender.hpp:59

References B, and log_mutex.

◆ getT()

std::string Slic3r::GCodeSender::getT ( ) const
257{
258 boost::lock_guard<boost::mutex> l(this->log_mutex);
259 return this->T;
260}
std::string T
Definition GCodeSender.hpp:59

References log_mutex, and T.

◆ is_connected()

bool Slic3r::GCodeSender::is_connected ( ) const
185{
186 return this->connected;
187}

References connected.

◆ on_read()

void Slic3r::GCodeSender::on_read ( const boost::system::error_code &  error,
size_t  bytes_transferred 
)
private
314{
315 this->set_error_status(false);
316 if (error) {
317 #ifdef __APPLE__
318 if (error.value() == 45) {
319 // OS X bug: http://osdir.com/ml/lib.boost.asio.user/2008-08/msg00004.html
320 this->do_read();
321 return;
322 }
323 #endif
324
325 // printf("ERROR: [%d] %s\n", error.value(), error.message().c_str());
326 // error can be true even because the serial port was closed.
327 // In this case it is not a real error, so ignore.
328 if (this->open) {
329 this->do_close();
330 this->set_error_status(true);
331 }
332 return;
333 }
334
335 std::istream is(&this->read_buffer);
336 std::string line;
337 std::getline(is, line);
338 if (!line.empty()) {
339#ifdef DEBUG_SERIAL
340 fs << "<< " << line << std::endl << std::flush;
341#endif
342
343 // note that line might contain \r at its end
344 // parse incoming line
345 if (!this->connected
346 && (boost::starts_with(line, "start")
347 || boost::starts_with(line, "Grbl ")
348 || boost::starts_with(line, "ok")
349 || boost::contains(line, "T:"))) {
350 this->connected = true;
351 {
352 boost::lock_guard<boost::mutex> l(this->queue_mutex);
353 this->can_send = true;
354 }
355 this->send();
356 } else if (boost::starts_with(line, "ok")) {
357 {
358 boost::lock_guard<boost::mutex> l(this->queue_mutex);
359 this->can_send = true;
360 }
361 this->send();
362 } else if (boost::istarts_with(line, "resend") // Marlin uses "Resend: "
363 || boost::istarts_with(line, "rs")) {
364 // extract the first number from line
365 boost::algorithm::trim_left_if(line, !boost::algorithm::is_digit());
366 size_t toresend = boost::lexical_cast<size_t>(line.substr(0, line.find_first_not_of("0123456789")));
367
368#ifdef DEBUG_SERIAL
369 fs << "!! line num out of sync: toresend = " << toresend << ", sent = " << sent << ", last_sent.size = " << last_sent.size() << std::endl;
370#endif
371
372 if (toresend > this->sent - this->last_sent.size() && toresend <= this->sent) {
373 {
374 boost::lock_guard<boost::mutex> l(this->queue_mutex);
375
376 const auto lines_to_resend = this->sent - toresend + 1;
377#ifdef DEBUG_SERIAL
378 fs << "!! resending " << lines_to_resend << " lines" << std::endl;
379#endif
380 // move the unsent lines to priqueue
381 this->priqueue.insert(
382 this->priqueue.begin(), // insert at the beginning
383 this->last_sent.begin() + this->last_sent.size() - lines_to_resend,
384 this->last_sent.end()
385 );
386
387 // we can empty last_sent because it's not useful anymore
388 this->last_sent.clear();
389
390 // start resending with the requested line number
391 this->sent = toresend - 1;
392 this->can_send = true;
393 }
394 this->send();
395 } else {
396 printf("Cannot resend %zu (oldest we have is %zu)\n", toresend, this->sent - this->last_sent.size());
397 }
398 } else if (boost::starts_with(line, "wait")) {
399 // ignore
400 } else {
401 // push any other line into the log
402 boost::lock_guard<boost::mutex> l(this->log_mutex);
403 this->log.push(line);
404 }
405
406 // parse temperature info
407 {
408 size_t pos = line.find("T:");
409 if (pos != std::string::npos && line.size() > pos + 2) {
410 // we got temperature info
411 boost::lock_guard<boost::mutex> l(this->log_mutex);
412 this->T = line.substr(pos+2, line.find_first_not_of("0123456789.", pos+2) - (pos+2));
413
414 pos = line.find("B:");
415 if (pos != std::string::npos && line.size() > pos + 2) {
416 // we got bed temperature info
417 this->B = line.substr(pos+2, line.find_first_not_of("0123456789.", pos+2) - (pos+2));
418 }
419 }
420 }
421 }
422 this->do_read();
423}
void send()
Definition GCodeSender.cpp:458
std::queue< std::string > log
Definition GCodeSender.hpp:58
Vec3d pos(const Pt &p)
Definition ReprojectPointsOnMesh.hpp:14

References B, can_send, connected, do_close(), do_read(), error, last_sent, log, log_mutex, open, priqueue, queue_mutex, read_buffer, send(), sent, set_error_status(), and T.

Referenced by do_read().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ on_write()

void Slic3r::GCodeSender::on_write ( const boost::system::error_code &  error,
size_t  bytes_transferred 
)
private
535{
536 this->set_error_status(false);
537 if (error) {
538 if (this->open) {
539 this->do_close();
540 this->set_error_status(true);
541 }
542 return;
543 }
544
545 this->do_send();
546}
void do_send()
Definition GCodeSender.cpp:464

References do_close(), do_send(), open, and set_error_status().

Referenced by do_send().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ pause_queue()

void Slic3r::GCodeSender::pause_queue ( )
210{
211 boost::lock_guard<boost::mutex> l(this->queue_mutex);
212 this->queue_paused = true;
213}

References queue_mutex, and queue_paused.

◆ purge_log()

std::vector< std::string > Slic3r::GCodeSender::purge_log ( )
244{
245 boost::lock_guard<boost::mutex> l(this->log_mutex);
246 std::vector<std::string> retval;
247 retval.reserve(this->log.size());
248 while (!this->log.empty()) {
249 retval.push_back(this->log.front());
250 this->log.pop();
251 }
252 return retval;
253}

References log, and log_mutex.

◆ purge_queue()

void Slic3r::GCodeSender::purge_queue ( bool  priority = false)
227{
228 boost::lock_guard<boost::mutex> l(this->queue_mutex);
229 if (priority) {
230 // clear priority queue
231 std::list<std::string> empty;
232 std::swap(this->priqueue, empty);
233 } else {
234 // clear queue
235 std::queue<std::string> empty;
236 std::swap(this->queue, empty);
237 this->queue_paused = false;
238 }
239}
bool empty(const BoundingBoxBase< PointType, PointsType > &bb)
Definition BoundingBox.hpp:229

References Slic3r::empty(), priqueue, queue, queue_mutex, and queue_paused.

+ Here is the call graph for this function:

◆ queue_size()

size_t Slic3r::GCodeSender::queue_size ( ) const
203{
204 boost::lock_guard<boost::mutex> l(this->queue_mutex);
205 return this->queue.size();
206}

References queue, and queue_mutex.

◆ reset()

void Slic3r::GCodeSender::reset ( )
571{
572 set_DTR(false);
573 std::this_thread::sleep_for(std::chrono::milliseconds(200));
574 set_DTR(true);
575 std::this_thread::sleep_for(std::chrono::milliseconds(200));
576 set_DTR(false);
577 std::this_thread::sleep_for(std::chrono::milliseconds(500));
578}
void set_DTR(bool on)
Definition GCodeSender.cpp:549

References set_DTR().

Referenced by connect().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ resume_queue()

void Slic3r::GCodeSender::resume_queue ( )
217{
218 {
219 boost::lock_guard<boost::mutex> l(this->queue_mutex);
220 this->queue_paused = false;
221 }
222 this->send();
223}

References queue_mutex, queue_paused, and send().

+ Here is the call graph for this function:

◆ send() [1/3]

void Slic3r::GCodeSender::send ( )
private
459{
460 this->io.post(boost::bind(&GCodeSender::do_send, this));
461}

References do_send(), and io.

Referenced by on_read(), resume_queue(), send(), and send().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ send() [2/3]

void Slic3r::GCodeSender::send ( const std::string &  s,
bool  priority = false 
)
444{
445 // append line to queue
446 {
447 boost::lock_guard<boost::mutex> l(this->queue_mutex);
448 if (priority) {
449 this->priqueue.push_back(line);
450 } else {
451 this->queue.push(line);
452 }
453 }
454 this->send();
455}

References priqueue, queue, queue_mutex, and send().

+ Here is the call graph for this function:

◆ send() [3/3]

void Slic3r::GCodeSender::send ( const std::vector< std::string > &  lines,
bool  priority = false 
)
427{
428 // append lines to queue
429 {
430 boost::lock_guard<boost::mutex> l(this->queue_mutex);
431 for (std::vector<std::string>::const_iterator line = lines.begin(); line != lines.end(); ++line) {
432 if (priority) {
433 this->priqueue.push_back(*line);
434 } else {
435 this->queue.push(*line);
436 }
437 }
438 }
439 this->send();
440}

References priqueue, queue, queue_mutex, and send().

+ Here is the call graph for this function:

◆ set_baud_rate()

void Slic3r::GCodeSender::set_baud_rate ( unsigned int  baud_rate)
private
123{
124 try {
125 // This does not support speeds > 115200
126 this->serial.set_option(boost::asio::serial_port_base::baud_rate(baud_rate));
127 } catch (boost::system::system_error &) {
128 boost::asio::serial_port::native_handle_type handle = this->serial.native_handle();
129
130#if __APPLE__
131 termios ios;
132 ::tcgetattr(handle, &ios);
133 ::cfsetspeed(&ios, baud_rate);
134 speed_t newSpeed = baud_rate;
135 ioctl(handle, IOSSIOSPEED, &newSpeed);
136 ::tcsetattr(handle, TCSANOW, &ios);
137#elif __linux__
138 termios2 ios;
139 if (ioctl(handle, TCGETS2, &ios))
140 printf("Error in TCGETS2: %s\n", strerror(errno));
141 ios.c_ispeed = ios.c_ospeed = baud_rate;
142 ios.c_cflag &= ~CBAUD;
143 ios.c_cflag |= BOTHER | CLOCAL | CREAD;
144 ios.c_cc[VMIN] = 1; // Minimum of characters to read, prevents eof errors when 0 bytes are read
145 ios.c_cc[VTIME] = 1;
146 if (ioctl(handle, TCSETS2, &ios))
147 printf("Error in TCSETS2: %s\n", strerror(errno));
148
149#elif __OpenBSD__
150 struct termios ios;
151 ::tcgetattr(handle, &ios);
152 ::cfsetspeed(&ios, baud_rate);
153 if (::tcsetattr(handle, TCSAFLUSH, &ios) != 0)
154 printf("Failed to set baud rate: %s\n", strerror(errno));
155#else
156 //throw Slic3r::InvalidArgument("OS does not currently support custom bauds");
157#endif
158 }
159}

References serial.

Referenced by connect().

+ Here is the caller graph for this function:

◆ set_DTR()

void Slic3r::GCodeSender::set_DTR ( bool  on)
550{
551#if defined(_WIN32) && !defined(__SYMBIAN32__)
552 boost::asio::serial_port_service::native_handle_type handle = this->serial.native_handle();
553 if (on)
554 EscapeCommFunction(handle, SETDTR);
555 else
556 EscapeCommFunction(handle, CLRDTR);
557#else
558 int fd = this->serial.native_handle();
559 int status;
560 ioctl(fd, TIOCMGET, &status);
561 if (on)
562 status |= TIOCM_DTR;
563 else
564 status &= ~TIOCM_DTR;
565 ioctl(fd, TIOCMSET, &status);
566#endif
567}

References serial.

Referenced by reset().

+ Here is the caller graph for this function:

◆ set_error_status()

void Slic3r::GCodeSender::set_error_status ( bool  e)
private
282{
283 boost::lock_guard<boost::mutex> l(this->error_mutex);
284 this->error = e;
285}

References error, and error_mutex.

Referenced by connect(), do_close(), on_read(), and on_write().

+ Here is the caller graph for this function:

◆ wait_connected()

bool Slic3r::GCodeSender::wait_connected ( unsigned int  timeout = 3) const
191{
192 using namespace boost::posix_time;
193 ptime t0 = second_clock::local_time() + seconds(timeout);
194 while (!this->connected) {
195 if (second_clock::local_time() > t0) return false;
196 boost::this_thread::sleep(boost::posix_time::milliseconds(100));
197 }
198 return true;
199}

References connected.

Member Data Documentation

◆ B

std::string Slic3r::GCodeSender::B
private

Referenced by getB(), and on_read().

◆ background_thread

boost::thread Slic3r::GCodeSender::background_thread
private

Referenced by connect(), and disconnect().

◆ can_send

bool Slic3r::GCodeSender::can_send
private

Referenced by do_send(), and on_read().

◆ connected

bool Slic3r::GCodeSender::connected
private

◆ error

bool Slic3r::GCodeSender::error
private

◆ error_mutex

boost::mutex Slic3r::GCodeSender::error_mutex
mutableprivate

Referenced by error_status(), and set_error_status().

◆ io

asio::io_service Slic3r::GCodeSender::io
private

Referenced by connect(), disconnect(), and send().

◆ last_sent

std::deque<std::string> Slic3r::GCodeSender::last_sent
private

Referenced by connect(), do_send(), and on_read().

◆ log

std::queue<std::string> Slic3r::GCodeSender::log
private

Referenced by on_read(), and purge_log().

◆ log_mutex

boost::mutex Slic3r::GCodeSender::log_mutex
mutableprivate

Referenced by getB(), getT(), on_read(), and purge_log().

◆ open

bool Slic3r::GCodeSender::open
private

Referenced by connect(), disconnect(), on_read(), and on_write().

◆ priqueue

std::list<std::string> Slic3r::GCodeSender::priqueue
private

Referenced by do_send(), on_read(), purge_queue(), send(), and send().

◆ queue

std::queue<std::string> Slic3r::GCodeSender::queue
private

◆ queue_mutex

boost::mutex Slic3r::GCodeSender::queue_mutex
mutableprivate

◆ queue_paused

bool Slic3r::GCodeSender::queue_paused
private

◆ read_buffer

boost::asio::streambuf Slic3r::GCodeSender::read_buffer
private

Referenced by do_read(), and on_read().

◆ sent

size_t Slic3r::GCodeSender::sent
private

Referenced by connect(), do_send(), and on_read().

◆ serial

asio::serial_port Slic3r::GCodeSender::serial
private

◆ T

std::string Slic3r::GCodeSender::T
private

Referenced by getT(), and on_read().

◆ write_buffer

boost::asio::streambuf Slic3r::GCodeSender::write_buffer
private

Referenced by do_send().


The documentation for this class was generated from the following files: