mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-23 14:44:19 -06:00
Initial work for G-code sender and more intensive usage of Boost
This commit is contained in:
parent
43cbad8867
commit
11dd67ab34
1649 changed files with 1860 additions and 1642 deletions
33
xs/src/libslic3r/GCodeSender.hpp
Normal file
33
xs/src/libslic3r/GCodeSender.hpp
Normal file
|
@ -0,0 +1,33 @@
|
|||
#ifndef slic3r_GCodeSender_hpp_
|
||||
#define slic3r_GCodeSender_hpp_
|
||||
#ifdef BOOST_LIBS
|
||||
|
||||
#include <myinit.h>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <boost/asio.hpp>
|
||||
|
||||
namespace Slic3r {
|
||||
|
||||
namespace asio = boost::asio;
|
||||
|
||||
class GCodeSender {
|
||||
public:
|
||||
GCodeSender(std::string devname, unsigned int baud_rate);
|
||||
void send(const std::vector<std::string> &lines);
|
||||
void send(const std::string &s);
|
||||
|
||||
|
||||
private:
|
||||
asio::io_service io;
|
||||
asio::serial_port serial;
|
||||
std::vector<std::string> lines;
|
||||
|
||||
void send_line(const std::string &line);
|
||||
void read_line(std::string* line);
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue