Multiple fixes for building
This commit is contained in:
parent
f1ae74f9d3
commit
bb928f6ef7
4 changed files with 21 additions and 14 deletions
|
@ -32,13 +32,15 @@ namespace pt = boost::property_tree;
|
|||
namespace Slic3r {
|
||||
|
||||
MKS::MKS(DynamicPrintConfig* config) :
|
||||
host(config->opt_string("print_host")), console(config->opt_string("print_host"), "8080")
|
||||
host(config->opt_string("print_host")), console_port("8080")
|
||||
{}
|
||||
|
||||
const char* MKS::get_name() const { return "MKS"; }
|
||||
|
||||
bool MKS::test(wxString& msg) const
|
||||
{
|
||||
Utils::TCPConsole console(host, console_port);
|
||||
|
||||
console.enqueue_cmd("M105");
|
||||
bool ret = console.run_queue();
|
||||
|
||||
|
@ -131,6 +133,8 @@ namespace Slic3r {
|
|||
// TODO: Inspect reasons
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(1500));
|
||||
|
||||
Utils::TCPConsole console(host, console_port);
|
||||
|
||||
console.enqueue_cmd(std::string("M23 ") + filename);
|
||||
console.enqueue_cmd("M24");
|
||||
|
||||
|
|
|
@ -8,7 +8,6 @@
|
|||
#include "TCPConsole.hpp"
|
||||
|
||||
namespace Slic3r {
|
||||
|
||||
class DynamicPrintConfig;
|
||||
class Http;
|
||||
|
||||
|
@ -31,7 +30,7 @@ namespace Slic3r {
|
|||
|
||||
private:
|
||||
std::string host;
|
||||
Utils::TCPConsole console;
|
||||
std::string console_port;
|
||||
|
||||
std::string get_upload_url(const std::string& filename) const;
|
||||
std::string timestamp_str() const;
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
#include <TCPConsole.hpp>
|
||||
#include "TCPConsole.hpp"
|
||||
|
||||
using boost::asio::steady_timer;
|
||||
using boost::asio::ip::tcp;
|
||||
|
@ -20,6 +20,18 @@ using boost::asio::ip::tcp;
|
|||
namespace Slic3r {
|
||||
namespace Utils {
|
||||
|
||||
const char* default_newline = "\n";
|
||||
const char* default_done_string = "ok";
|
||||
|
||||
TCPConsole::TCPConsole() : resolver_(io_context_), socket_(io_context_), newline_(default_newline), done_string_(default_done_string) {}
|
||||
|
||||
TCPConsole::TCPConsole(const std::string& host_name, const std::string& port_name) :
|
||||
resolver_(io_context_), socket_(io_context_), newline_(default_newline), done_string_(default_done_string)
|
||||
{
|
||||
set_remote(host_name, port_name);
|
||||
}
|
||||
|
||||
|
||||
void TCPConsole::transmit_next_command()
|
||||
{
|
||||
if (cmd_queue_.empty()) {
|
||||
|
|
|
@ -10,21 +10,13 @@
|
|||
namespace Slic3r {
|
||||
namespace Utils {
|
||||
|
||||
const char* default_newline = "\n";
|
||||
const char* default_done_string = "ok";
|
||||
|
||||
using boost::asio::ip::tcp;
|
||||
|
||||
class TCPConsole
|
||||
{
|
||||
public:
|
||||
TCPConsole() : resolver_(io_context_), socket_(io_context_), newline_(default_newline), done_string_(default_done_string) {}
|
||||
|
||||
TCPConsole(const std::string& host_name, const std::string& port_name) :
|
||||
resolver_(io_context_), socket_(io_context_), newline_(default_newline), done_string_(default_done_string)
|
||||
{
|
||||
set_remote(host_name, port_name);
|
||||
}
|
||||
TCPConsole();
|
||||
TCPConsole(const std::string& host_name, const std::string& port_name);
|
||||
~TCPConsole() {}
|
||||
|
||||
void set_line_delimiter(const std::string& newline) {
|
||||
|
|
Loading…
Reference in a new issue