FIX:Access code and ip input and interaction logic

JIRA: STUDIO-3970
Change-Id: If7a33d6a70b09dda9f50d774d6cec732af923e71
This commit is contained in:
hu.wang 2023-09-06 17:09:45 +08:00 committed by Lane.Wei
parent 66242d765a
commit c8cf950155
6 changed files with 144 additions and 55 deletions

View File

@ -142,7 +142,7 @@ void SendJob::process()
result = m_agent->start_send_gcode_to_sdcard(params, nullptr, nullptr);
if (result != 0) {
BOOST_LOG_TRIVIAL(error) << "access code is invalid";
m_enter_ip_address_fun_fail();
m_enter_ip_address_fun_fail(result);
m_job_finished = true;
return;
}
@ -392,7 +392,7 @@ void SendJob::on_success(std::function<void()> success)
m_success_fun = success;
}
void SendJob::on_check_ip_address_fail(std::function<void()> func)
void SendJob::on_check_ip_address_fail(std::function<void(int)> func)
{
m_enter_ip_address_fun_fail = func;
}

View File

@ -23,7 +23,7 @@ class SendJob : public PlaterJob
bool m_is_check_mode{false};
bool m_check_and_continue{false};
std::function<void()> m_success_fun{nullptr};
std::function<void()> m_enter_ip_address_fun_fail{nullptr};
std::function<void(int)> m_enter_ip_address_fun_fail{nullptr};
std::function<void()> m_enter_ip_address_fun_success{nullptr};
protected:
@ -60,7 +60,7 @@ public:
bool is_finished() { return m_job_finished; }
void process() override;
void on_success(std::function<void()> success);
void on_check_ip_address_fail(std::function<void()> func);
void on_check_ip_address_fail(std::function<void(int)> func);
void on_check_ip_address_success(std::function<void()> func);
void finalize() override;
void set_project_name(std::string name);

View File

@ -1020,10 +1020,12 @@ InputIpAddressDialog::InputIpAddressDialog(wxWindow* parent)
SetIcon(wxIcon(encode_path(icon_path.c_str()), wxBITMAP_TYPE_ICO));
SetBackgroundColour(*wxWHITE);
m_result = -1;
wxBoxSizer* m_sizer_body = new wxBoxSizer(wxVERTICAL);
wxBoxSizer* m_sizer_main = new wxBoxSizer(wxHORIZONTAL);
wxBoxSizer* m_sizer_main_left = new wxBoxSizer(wxVERTICAL);
wxBoxSizer* m_sizer_main_right = new wxBoxSizer(wxVERTICAL);
wxBoxSizer* m_sizer_msg = new wxBoxSizer(wxHORIZONTAL);
auto m_line_top = new wxPanel(this, wxID_ANY, wxDefaultPosition, wxSize(-1, 1));
m_line_top->SetBackgroundColour(wxColour(166, 169, 170));
@ -1072,31 +1074,45 @@ InputIpAddressDialog::InputIpAddressDialog(wxWindow* parent)
m_input_area->Add(0, 0, 0, wxLEFT, FromDIP(16));
m_input_area->Add(m_input_access_code, 0, wxALIGN_CENTER, 0);
m_error_msg = new Label(this, Label::Body_13, wxEmptyString, LB_AUTO_WRAP);
m_error_msg->SetForegroundColour(wxColour(208,27,27));
m_error_msg->Hide();
m_test_right_msg = new Label(this, Label::Body_13, wxEmptyString, LB_AUTO_WRAP);
m_test_right_msg->SetForegroundColour(wxColour(61, 203, 115));
m_test_right_msg->Hide();
m_test_wrong_msg = new Label(this, Label::Body_13, wxEmptyString, LB_AUTO_WRAP);
m_test_wrong_msg->SetForegroundColour(wxColour(208, 27, 27));
m_test_wrong_msg->Hide();
m_tip3 = new Label(this, Label::Body_12, _L("Where to find your printer's IP and Access Code?"), LB_AUTO_WRAP);
m_tip3->SetMinSize(wxSize(FromDIP(352), -1));
m_tip3->SetMaxSize(wxSize(FromDIP(352), -1));
m_tip4 = new Label(this, ::Label::Body_13, "Step 3: Ping the IP address to check for packet loss and latency.", LB_AUTO_WRAP);
m_tip4->SetMinSize(wxSize(FromDIP(352), -1));
m_tip4->SetMaxSize(wxSize(FromDIP(352), -1));
m_trouble_shoot = new wxHyperlinkCtrl(this, wxID_ANY, "How to trouble shooting", "");
m_img_help1 = new wxStaticBitmap(this, wxID_ANY, create_scaled_bitmap("lan_mode_help_x1", this, 198), wxDefaultPosition, wxSize(FromDIP(352), FromDIP(198)), 0);
m_img_help2 = new wxStaticBitmap(this, wxID_ANY, create_scaled_bitmap("input_access_code_p1p_en", this, 118), wxDefaultPosition, wxSize(FromDIP(352), FromDIP(118)), 0);
m_img_help3 = new wxStaticBitmap(this, wxID_ANY, create_scaled_bitmap("input_access_code_n1_en", this, 198), wxDefaultPosition, wxSize(FromDIP(352), FromDIP(118)), 0);
m_img_help1->Hide();
m_img_help2->Hide();
m_img_help3->Hide();
auto sizer_button = new wxBoxSizer(wxHORIZONTAL);
auto m_sizer_button = new wxBoxSizer(wxHORIZONTAL);
StateColor btn_bg_green(std::pair<wxColour, int>(wxColour(27, 136, 68), StateColor::Pressed), std::pair<wxColour, int>(wxColour(61, 203, 115), StateColor::Hovered),
StateColor btn_bg_green(std::pair<wxColour, int>(wxColour(61, 203, 115), StateColor::Pressed), std::pair<wxColour, int>(wxColour(61, 203, 115), StateColor::Hovered),
std::pair<wxColour, int>(AMS_CONTROL_BRAND_COLOUR, StateColor::Normal));
StateColor btn_bg_white(std::pair<wxColour, int>(wxColour(206, 206, 206), StateColor::Pressed), std::pair<wxColour, int>(wxColour(238, 238, 238), StateColor::Hovered),
std::pair<wxColour, int>(*wxWHITE, StateColor::Normal));
m_button_ok = new Button(this, _L("OK"));
m_button_ok = new Button(this, _L("Test"));
m_button_ok->SetBackgroundColor(btn_bg_green);
m_button_ok->SetBorderColor(*wxWHITE);
m_button_ok->SetTextColor(wxColour(0xFFFFFE));
@ -1108,7 +1124,7 @@ InputIpAddressDialog::InputIpAddressDialog(wxWindow* parent)
m_button_ok->Bind(wxEVT_LEFT_DOWN, &InputIpAddressDialog::on_ok, this);
auto m_button_cancel = new Button(this, _L("Cancel"));
auto m_button_cancel = new Button(this, _L("Close"));
m_button_cancel->SetBackgroundColor(btn_bg_white);
m_button_cancel->SetBorderColor(wxColour(38, 46, 48));
m_button_cancel->SetFont(Label::Body_12);
@ -1120,9 +1136,11 @@ InputIpAddressDialog::InputIpAddressDialog(wxWindow* parent)
on_cancel();
});
sizer_button->AddStretchSpacer();
sizer_button->Add(m_button_ok, 0, wxALL, FromDIP(5));
sizer_button->Add(m_button_cancel, 0, wxALL, FromDIP(5));
m_sizer_button->AddStretchSpacer();
//m_sizer_button->Add(m_button_ok, 0, wxALL, FromDIP(5));
m_sizer_button->Add(m_button_cancel, 0, wxALL, FromDIP(5));
m_sizer_button->Layout();
m_status_bar = std::make_shared<BBLStatusBarSend>(this);
m_status_bar->get_panel()->Hide();
@ -1130,12 +1148,14 @@ InputIpAddressDialog::InputIpAddressDialog(wxWindow* parent)
auto m_step_icon_panel1 = new wxWindow(this, wxID_ANY);
auto m_step_icon_panel2 = new wxWindow(this, wxID_ANY);
m_step_icon_panel1->SetBackgroundColour(*wxWHITE);
m_step_icon_panel2->SetBackgroundColour(*wxWHITE);
auto m_sizer_step_icon_panel1 = new wxBoxSizer(wxVERTICAL);
auto m_sizer_step_icon_panel2 = new wxBoxSizer(wxVERTICAL);
m_img_step1 = new wxStaticBitmap(m_step_icon_panel1, wxID_ANY, create_scaled_bitmap("ip_address_step", this, 6), wxDefaultPosition, wxSize(FromDIP(6), FromDIP(6)), 0);
@ -1143,6 +1163,7 @@ InputIpAddressDialog::InputIpAddressDialog(wxWindow* parent)
auto m_line_tips_left = new wxPanel(m_step_icon_panel1, wxID_ANY, wxDefaultPosition, wxSize(-1, 1));
m_line_tips_left->SetBackgroundColour(wxColour(0xEEEEEE));
m_img_step2 = new wxStaticBitmap(m_step_icon_panel2, wxID_ANY, create_scaled_bitmap("ip_address_step", this, 6), wxDefaultPosition, wxSize(FromDIP(6), FromDIP(6)), 0);
m_img_step3 = new wxStaticBitmap(this, wxID_ANY, create_scaled_bitmap("ip_address_step", this, 6), wxDefaultPosition, wxSize(FromDIP(6), FromDIP(6)), 0);
m_sizer_step_icon_panel1->Add(m_img_step1, 0, wxALIGN_CENTER|wxALL, FromDIP(5));
@ -1156,17 +1177,30 @@ InputIpAddressDialog::InputIpAddressDialog(wxWindow* parent)
m_step_icon_panel2->Fit();
m_sizer_step_icon_panel2->Add(m_img_step2, 0, wxALIGN_CENTER|wxALL, FromDIP(5));
//m_sizer_step_icon_panel3->Add(m_img_step3, 0, wxALIGN_CENTER|wxALL, FromDIP(5));
m_step_icon_panel1->SetMinSize(wxSize(-1, m_tip1->GetBestSize().y));
m_step_icon_panel1->SetMaxSize(wxSize(-1, m_tip1->GetBestSize().y));
m_sizer_msg->Add(0, 0, 0, wxALIGN_CENTER, FromDIP(20));
m_sizer_msg->Add(m_img_step3, 0, wxALIGN_CENTER | wxALL, FromDIP(5));
m_sizer_msg->Add(0, 0, 0, wxALIGN_CENTER, FromDIP(8));
m_sizer_msg->Add(m_tip4, 0, wxALIGN_CENTER | wxEXPAND | wxLEFT, FromDIP(5));
m_img_step3->Hide();
m_tip4->Hide();
m_sizer_msg->Layout();
m_sizer_main_left->Add(m_step_icon_panel1, 0, wxEXPAND, 0);
m_sizer_main_left->Add(0, 0, 0, wxTOP, FromDIP(20));
m_sizer_main_left->Add(m_line_tips_left, 1, wxEXPAND, 0);
m_sizer_main_left->Add(0, 0, 0, wxTOP, FromDIP(20));
m_sizer_main_left->Add(m_step_icon_panel2, 0, wxEXPAND, 0);
m_sizer_main_left->Layout();
m_trouble_shoot->Hide();
m_sizer_main_right->Add(m_tip1, 0, wxRIGHT|wxEXPAND, FromDIP(18));
m_sizer_main_right->Add(0, 0, 0, wxTOP, FromDIP(20));
@ -1174,19 +1208,21 @@ InputIpAddressDialog::InputIpAddressDialog(wxWindow* parent)
m_sizer_main_right->Add(0, 0, 0, wxTOP, FromDIP(20));
m_sizer_main_right->Add(m_tip2, 0, wxRIGHT|wxEXPAND, FromDIP(18));
m_sizer_main_right->Add(0, 0, 0, wxTOP, FromDIP(12));
m_sizer_main_right->Add(m_input_tip_area, 0, wxRIGHT|wxEXPAND, FromDIP(18));
m_sizer_main_right->Add(0, 0, 0, wxTOP, FromDIP(4));
m_sizer_main_right->Add(m_input_area, 0, wxRIGHT|wxEXPAND, FromDIP(18));
m_sizer_main_right->Add(m_error_msg, 0, wxRIGHT|wxEXPAND, FromDIP(18));
m_sizer_main_right->Add(0, 0, 0, wxTOP, FromDIP(16));
m_sizer_main_right->Add(m_tip3, 0, wxRIGHT|wxEXPAND, FromDIP(18));
m_sizer_main_right->Add(m_tip3, 0, wxRIGHT | wxEXPAND, FromDIP(18));
m_sizer_main_right->Add(0, 0, 0, wxTOP, FromDIP(4));
m_sizer_main_right->Add(m_img_help1, 0, 0, 0);
m_sizer_main_right->Add(m_img_help2, 0, 0, 0);
m_sizer_main_right->Add(0, 0, 0, wxTOP, FromDIP(30));
m_sizer_main_right->Add(sizer_button, 1, wxRIGHT|wxEXPAND, FromDIP(18));
m_sizer_main_right->Add(m_img_help3, 0, 0, 0);
m_sizer_main_right->Add(0, 0, 0, wxTOP, FromDIP(12));
m_sizer_main_right->Add(m_input_tip_area, 0, wxRIGHT|wxEXPAND, FromDIP(18));
m_sizer_main_right->Add(0, 0, 0, wxTOP, FromDIP(4));
m_sizer_main_right->Add(m_input_area, 0, wxRIGHT|wxEXPAND, FromDIP(18));
m_sizer_main_right->Add(0, 0, 0, wxTOP, FromDIP(4));
m_sizer_main_right->Add(m_button_ok, 0, wxRIGHT, FromDIP(18));
m_sizer_main_right->Add(0, 0, 0, wxTOP, FromDIP(4));
m_sizer_main_right->Add(m_test_right_msg, 0, wxRIGHT|wxEXPAND, FromDIP(18));
m_sizer_main_right->Add(m_test_wrong_msg, 0, wxRIGHT|wxEXPAND, FromDIP(18));
m_sizer_main_right->Add(0, 0, 0, wxTOP, FromDIP(16));
m_sizer_main_right->Add(m_status_bar->get_panel(), 0,wxRIGHT|wxEXPAND, FromDIP(18));
m_sizer_main_right->Layout();
@ -1198,7 +1234,15 @@ InputIpAddressDialog::InputIpAddressDialog(wxWindow* parent)
m_sizer_body->Add(m_line_top, 0, wxEXPAND, 0);
m_sizer_body->Add(0, 0, 0, wxTOP, FromDIP(20));
m_sizer_body->Add(m_sizer_main, 0, wxEXPAND, 0);
m_sizer_body->Add(0, 0, 0, wxTOP, FromDIP(4));
m_sizer_body->Add(m_sizer_msg, 0, wxLEFT|wxEXPAND, FromDIP(18));
m_sizer_body->Add(0, 0, 0, wxTOP, FromDIP(4));
m_sizer_body->Add(m_trouble_shoot, 0, wxLEFT | wxRIGHT | wxEXPAND, FromDIP(40));
m_sizer_body->Add(0, 0, 0, wxTOP, FromDIP(8));
m_sizer_body->Add(m_sizer_button, 0, wxRIGHT | wxEXPAND, FromDIP(18));
m_sizer_body->Layout();
SetSizer(m_sizer_body);
Layout();
Fit();
@ -1214,6 +1258,7 @@ InputIpAddressDialog::InputIpAddressDialog(wxWindow* parent)
EndModal(wxID_YES);
});
Bind(wxEVT_CLOSE_WINDOW, [this](auto& e) {on_cancel();});
}
void InputIpAddressDialog::on_cancel()
@ -1224,7 +1269,11 @@ void InputIpAddressDialog::on_cancel()
m_send_job->join();
}
}
this->EndModal(wxID_CANCEL);
if (m_result == 0){
this->EndModal(wxID_YES);
}else {
this->EndModal(wxID_CANCEL);
}
}
@ -1242,17 +1291,24 @@ void InputIpAddressDialog::set_machine_obj(MachineObject* obj)
if (m_obj->printer_type == "C11" || m_obj->printer_type == "C12") {
m_img_help1->Hide();
m_img_help2->Show();
m_img_help3->Hide();
}
else if (m_obj->printer_type == "BL-P001" || m_obj->printer_type == "BL-P002") {
m_img_help1->Show();
m_img_help2->Hide();
m_img_help3->Hide();
}
else if (m_obj->printer_type == "N1") {
m_img_help1->Hide();
m_img_help2->Hide();
m_img_help3->Show();
}
auto str_ip = m_input_ip->GetTextCtrl()->GetValue();
auto str_access_code = m_input_access_code->GetTextCtrl()->GetValue();
if (isIp(str_ip.ToStdString()) && str_access_code.Length() == 8) {
m_button_ok->Enable(true);
StateColor btn_bg_green(std::pair<wxColour, int>(wxColour(27, 136, 68), StateColor::Pressed), std::pair<wxColour, int>(wxColour(61, 203, 115), StateColor::Hovered),
StateColor btn_bg_green(std::pair<wxColour, int>(wxColour(61, 203, 115), StateColor::Pressed), std::pair<wxColour, int>(wxColour(61, 203, 115), StateColor::Hovered),
std::pair<wxColour, int>(AMS_CONTROL_BRAND_COLOUR, StateColor::Normal));
m_button_ok->SetTextColor(StateColor::darkModeColorFor("#FFFFFE"));
m_button_ok->SetBackgroundColor(btn_bg_green);
@ -1267,16 +1323,27 @@ void InputIpAddressDialog::set_machine_obj(MachineObject* obj)
Fit();
}
void InputIpAddressDialog::update_error_msg(wxString msg)
void InputIpAddressDialog::update_test_msg(wxString msg,bool connected)
{
if (msg.empty()) {
m_error_msg->Hide();
m_test_right_msg->Hide();
m_test_wrong_msg->Hide();
}
else {
m_error_msg->Show();
m_error_msg->SetLabelText(msg);
m_error_msg->SetMinSize(wxSize(FromDIP(352), -1));
m_error_msg->SetMaxSize(wxSize(FromDIP(352), -1));
if(connected){
m_test_right_msg->Show();
m_test_right_msg->SetLabelText(msg);
m_test_right_msg->SetMinSize(wxSize(FromDIP(352), -1));
m_test_right_msg->SetMaxSize(wxSize(FromDIP(352), -1));
}
else{
m_test_wrong_msg->Show();
m_test_wrong_msg->SetLabelText(msg);
m_test_wrong_msg->SetMinSize(wxSize(FromDIP(352), -1));
m_test_wrong_msg->SetMaxSize(wxSize(FromDIP(352), -1));
}
}
Layout();
@ -1301,6 +1368,13 @@ bool InputIpAddressDialog::isIp(std::string ipstr)
void InputIpAddressDialog::on_ok(wxMouseEvent& evt)
{
m_test_right_msg->Hide();
m_test_wrong_msg->Hide();
m_img_step3->Hide();
m_tip4->Hide();
m_trouble_shoot->Hide();
Layout();
Fit();
wxString ip = m_input_ip->GetTextCtrl()->GetValue();
wxString str_access_code = m_input_access_code->GetTextCtrl()->GetValue();
@ -1360,8 +1434,8 @@ void InputIpAddressDialog::on_ok(wxMouseEvent& evt)
m_send_job->set_check_mode();
m_send_job->set_project_name("verify_job");
m_send_job->on_check_ip_address_fail([this]() {
this->check_ip_address_failed();
m_send_job->on_check_ip_address_fail([this](int result) {
this->check_ip_address_failed(result);
});
m_send_job->on_check_ip_address_success([this, ip, str_access_code]() {
@ -1370,26 +1444,39 @@ void InputIpAddressDialog::on_ok(wxMouseEvent& evt)
event.SetString(input_str);
event.SetEventObject(this);
wxPostEvent(this, event);
auto event_close = wxCommandEvent(EVT_CLOSE_IPADDRESS_DLG);
event_close.SetEventObject(this);
wxPostEvent(this, event_close);
m_result = 0;
update_test_msg("IP and Access Code Verified! You may close the window", true);
});
m_send_job->start();
}
void InputIpAddressDialog::check_ip_address_failed()
void InputIpAddressDialog::check_ip_address_failed(int result)
{
auto evt = new wxCommandEvent(EVT_CHECK_IP_ADDRESS_FAILED);
evt->SetInt(result);
wxQueueEvent(this, evt);
}
void InputIpAddressDialog::on_check_ip_address_failed(wxCommandEvent& evt)
{
update_error_msg(_L("Error: IP or Access Code are not correct"));
m_result = evt.GetInt();
if (m_result == -2) {
update_test_msg(_L("Connection failed, please double check IP and Access Code"), false);
}
else {
update_test_msg(_L("Connection failed! If your IP and Access Code is correct, \nplease move to step 3 for troubleshooting network issues"), false);
m_img_step3->Show();
m_tip4->Show();
m_trouble_shoot->Show();
Layout();
Fit();
}
m_button_ok->Enable(true);
StateColor btn_bg_green(std::pair<wxColour, int>(wxColour(27, 136, 68), StateColor::Pressed), std::pair<wxColour, int>(wxColour(61, 203, 115), StateColor::Hovered),
StateColor btn_bg_green(std::pair<wxColour, int>(wxColour(61, 203, 115), StateColor::Pressed), std::pair<wxColour, int>(wxColour(61, 203, 115), StateColor::Hovered),
std::pair<wxColour, int>(AMS_CONTROL_BRAND_COLOUR, StateColor::Normal));
m_button_ok->SetTextColor(StateColor::darkModeColorFor("#FFFFFE"));
m_button_ok->SetBackgroundColor(btn_bg_green);
@ -1402,7 +1489,7 @@ void InputIpAddressDialog::on_text(wxCommandEvent& evt)
if (isIp(str_ip.ToStdString()) && str_access_code.Length() == 8) {
m_button_ok->Enable(true);
StateColor btn_bg_green(std::pair<wxColour, int>(wxColour(27, 136, 68), StateColor::Pressed), std::pair<wxColour, int>(wxColour(61, 203, 115), StateColor::Hovered),
StateColor btn_bg_green(std::pair<wxColour, int>(wxColour(61, 203, 115), StateColor::Pressed), std::pair<wxColour, int>(wxColour(61, 203, 115), StateColor::Hovered),
std::pair<wxColour, int>(AMS_CONTROL_BRAND_COLOUR, StateColor::Normal));
m_button_ok->SetTextColor(StateColor::darkModeColorFor("#FFFFFE"));
m_button_ok->SetBackgroundColor(btn_bg_green);

View File

@ -24,6 +24,7 @@
#include <wx/wrapsizer.h>
#include <wx/event.h>
#include <wx/hyperlink.h>
#include <wx/richtext/richtextctrl.h>
#include "AmsMappingPopup.hpp"
#include "GUI_Utils.hpp"
@ -199,6 +200,7 @@ public:
Label* m_tip1{ nullptr };
Label* m_tip2{ nullptr };
Label* m_tip3{ nullptr };
Label* m_tip4{ nullptr };
InputIpAddressDialog(wxWindow* parent = nullptr);
~InputIpAddressDialog();
@ -206,24 +208,28 @@ public:
Button* m_button_ok{ nullptr };
Label* m_tips_ip{ nullptr };
Label* m_tips_access_code{ nullptr };
Label* m_error_msg{ nullptr };
Label* m_test_right_msg{ nullptr };
Label* m_test_wrong_msg{ nullptr };
TextInput* m_input_ip{ nullptr };
TextInput* m_input_access_code{ nullptr };
wxStaticBitmap* m_img_help1{ nullptr };
wxStaticBitmap* m_img_help2{ nullptr };
wxStaticBitmap* m_img_help3{ nullptr };
wxStaticBitmap* m_img_step1{ nullptr };
wxStaticBitmap* m_img_step2{ nullptr };
wxStaticBitmap* m_img_step3{ nullptr };
wxHyperlinkCtrl* m_trouble_shoot{ nullptr };
bool m_show_access_code{ false };
int m_result;
std::shared_ptr<SendJob> m_send_job{nullptr};
std::shared_ptr<BBLStatusBarSend> m_status_bar;
void on_cancel();
void update_title(wxString title);
void set_machine_obj(MachineObject* obj);
void update_error_msg(wxString msg);
void update_test_msg(wxString msg, bool connected);
bool isIp(std::string ipstr);
void check_ip_address_failed();
void check_ip_address_failed(int result);
void on_check_ip_address_failed(wxCommandEvent& evt);
void on_ok(wxMouseEvent& evt);
void on_text(wxCommandEvent& evt);

View File

@ -2242,6 +2242,7 @@ void SelectMachineDialog::show_errors(wxString &info)
void SelectMachineDialog::on_ok_btn(wxCommandEvent &event)
{
bool has_slice_warnings = false;
DeviceManager* dev = Slic3r::GUI::wxGetApp().getDeviceManager();
@ -2488,7 +2489,6 @@ void SelectMachineDialog::on_send_print()
}
}
if (m_print_type == PrintFromType::FROM_NORMAL) {
result = m_plater->send_gcode(m_print_plate_idx, [this](int export_stage, int current, int total, bool& cancel) {
if (this->m_is_canceled) return;

View File

@ -797,7 +797,7 @@ void SendToPrinterDialog::on_ok(wxCommandEvent &event)
enable_prepare_mode = false;
m_send_job->on_check_ip_address_fail([this]() {
m_send_job->on_check_ip_address_fail([this](int result) {
wxCommandEvent* evt = new wxCommandEvent(EVT_CLEAR_IPADDRESS);
wxQueueEvent(this, evt);
wxGetApp().show_ip_address_enter_dialog();
@ -1042,7 +1042,7 @@ void SendToPrinterDialog::update_show_status()
if (!obj_->is_info_ready()) {
if (is_timeout()) {
(PrintDialogStatus::PrintStatusReadingTimeout);
show_status(PrintDialogStatus::PrintStatusReadingTimeout);
return;
}
else {
@ -1073,10 +1073,6 @@ void SendToPrinterDialog::update_show_status()
return;
}
if (obj_->dev_ip.empty()) {
show_status(PrintDialogStatus::PrintStatusNotOnTheSameLAN);
return;
}
if (!obj_->is_support_send_to_sdcard) {
show_status(PrintDialogStatus::PrintStatusNotSupportedSendToSDCard);