mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-16 18:45:52 +08:00
Small adaptation and formatting
This commit is contained in:
parent
869b8c8c66
commit
f1ae74f9d3
@ -83,7 +83,8 @@ bool MKS::upload(PrintHostUpload upload_data, ProgressFn prorgess_fn, ErrorFn er
|
|||||||
BOOST_LOG_TRIVIAL(error) << boost::format("MKS: Request completed but error code was received: %1%") % err_code;
|
BOOST_LOG_TRIVIAL(error) << boost::format("MKS: Request completed but error code was received: %1%") % err_code;
|
||||||
error_fn(format_error(body, L("Unknown error occured"), 0));
|
error_fn(format_error(body, L("Unknown error occured"), 0));
|
||||||
res = false;
|
res = false;
|
||||||
} else if (upload_data.start_print) {
|
}
|
||||||
|
else if (upload_data.start_print) {
|
||||||
wxString errormsg;
|
wxString errormsg;
|
||||||
res = start_print(errormsg, upload_data.upload_path.string());
|
res = start_print(errormsg, upload_data.upload_path.string());
|
||||||
if (!res) {
|
if (!res) {
|
||||||
@ -107,7 +108,10 @@ bool MKS::upload(PrintHostUpload upload_data, ProgressFn prorgess_fn, ErrorFn er
|
|||||||
.perform_sync();
|
.perform_sync();
|
||||||
|
|
||||||
if (res && upload_data.start_print) {
|
if (res && upload_data.start_print) {
|
||||||
start_print(upload_data.upload_path);
|
wxString msg;
|
||||||
|
if (!start_print(msg, upload_data.upload_path.string())) {
|
||||||
|
error_fn(wxString("Can't start printing: ") + msg);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
@ -127,7 +131,7 @@ bool MKS::start_print(wxString &msg, const std::string &filename) const
|
|||||||
// TODO: Inspect reasons
|
// TODO: Inspect reasons
|
||||||
std::this_thread::sleep_for(std::chrono::milliseconds(1500));
|
std::this_thread::sleep_for(std::chrono::milliseconds(1500));
|
||||||
|
|
||||||
console.enqueue_cmd("M23 " + upload_data.upload_path.string());
|
console.enqueue_cmd(std::string("M23 ") + filename);
|
||||||
console.enqueue_cmd("M24");
|
console.enqueue_cmd("M24");
|
||||||
|
|
||||||
bool ret = console.run_queue();
|
bool ret = console.run_queue();
|
||||||
|
@ -81,7 +81,8 @@ void TCPConsole::handle_read(
|
|||||||
% ec.message();
|
% ec.message();
|
||||||
|
|
||||||
io_context_.stop();
|
io_context_.stop();
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
std::string line = extract_next_line();
|
std::string line = extract_next_line();
|
||||||
boost::trim(line);
|
boost::trim(line);
|
||||||
|
|
||||||
@ -94,7 +95,8 @@ void TCPConsole::handle_read(
|
|||||||
|
|
||||||
if (line == done_string_) {
|
if (line == done_string_) {
|
||||||
transmit_next_command();
|
transmit_next_command();
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
wait_next_line();
|
wait_next_line();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -112,7 +114,8 @@ void TCPConsole::handle_write(
|
|||||||
% ec.message();
|
% ec.message();
|
||||||
|
|
||||||
io_context_.stop();
|
io_context_.stop();
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
wait_next_line();
|
wait_next_line();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -128,7 +131,8 @@ void TCPConsole::handle_connect(const boost::system::error_code& ec)
|
|||||||
% ec.message();
|
% ec.message();
|
||||||
|
|
||||||
io_context_.stop();
|
io_context_.stop();
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
BOOST_LOG_TRIVIAL(info) << boost::format("TCPConsole: connected to %1%:%2%")
|
BOOST_LOG_TRIVIAL(info) << boost::format("TCPConsole: connected to %1%:%2%")
|
||||||
% host_name_
|
% host_name_
|
||||||
% port_name_;
|
% port_name_;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user