ENH:display error msg when connecting to the printer fails

Change-Id: I483d6c00bdd623e34bce5b087bfbcb9a5e876fa3
This commit is contained in:
tao wang 2023-05-22 15:07:33 +08:00 committed by Lane.Wei
parent 4fd8a2b957
commit 6f2839b641
25 changed files with 378 additions and 127 deletions

View file

@ -106,6 +106,18 @@ void BindJob::process()
if (result < 0) {
BOOST_LOG_TRIVIAL(trace) << "login: result = " << result;
int error_code;
wxString error_msg;
try
{
error_code = stoi(result_info);
result_info = wxGetApp().get_hms_query()->query_print_error_msg(error_code).ToStdString();
}
catch (...) {
;
}
post_fail_event(result_code, result_info);
return;
}

View file

@ -182,7 +182,7 @@ void PrintJob::process()
params.password = m_access_code;
// check access code and ip address
if (this->connection_type == "lan") {
if (this->connection_type == "lan" && m_print_type == "from_normal") {
params.dev_id = m_dev_id;
params.project_name = "verify_job";
params.filename = job_data._temp_path.string();
@ -495,4 +495,10 @@ void PrintJob::on_check_ip_address_success(std::function<void()> func)
m_enter_ip_address_fun_success = func;
}
void PrintJob::connect_to_local_mqtt()
{
this->update_status(0, "1111111");
}
}} // namespace Slic3r::GUI

View file

@ -97,6 +97,7 @@ public:
void set_project_name(std::string name);
void on_check_ip_address_fail(std::function<void()> func);
void on_check_ip_address_success(std::function<void()> func);
void connect_to_local_mqtt();
};
}} // namespace Slic3r::GUI