diff --git a/src/slic3r/GUI/BindDialog.cpp b/src/slic3r/GUI/BindDialog.cpp index 0b3e989e8b..3f4d3562b7 100644 --- a/src/slic3r/GUI/BindDialog.cpp +++ b/src/slic3r/GUI/BindDialog.cpp @@ -2,10 +2,10 @@ #include "GUI_App.hpp" #include +#include #include #include #include "wx/evtloop.h" -#include #include #include #include diff --git a/src/slic3r/GUI/DeviceManager.cpp b/src/slic3r/GUI/DeviceManager.cpp index 2024e9451b..d978442267 100644 --- a/src/slic3r/GUI/DeviceManager.cpp +++ b/src/slic3r/GUI/DeviceManager.cpp @@ -2668,7 +2668,6 @@ std::string MachineObject::setting_id_to_type(std::string setting_id, std::strin if (type.empty()) { type = tray_type; } BOOST_LOG_TRIVIAL(info) << "The values of tray_info_idx and tray_type do not match tray_info_idx " << setting_id << " tray_type " << tray_type << " system_type" << type; } - return type; } @@ -2700,7 +2699,6 @@ int MachineObject::parse_json(std::string payload, bool key_field_only) if (j_pre.empty()) { return 0; } - if (j_pre.contains("print")) { if (m_active_state == NotActive) m_active_state = Active; if (j_pre["print"].contains("command")) { @@ -3083,9 +3081,7 @@ int MachineObject::parse_json(std::string payload, bool key_field_only) } } - if (jj.contains("command")) { - if (jj["command"].get() == "ams_change_filament") { if (jj.contains("errno")) { if (jj["errno"].is_number()) { @@ -3117,8 +3113,6 @@ int MachineObject::parse_json(std::string payload, bool key_field_only) } } } - - if (jj["command"].get() == "push_status") { m_push_count++; last_push_time = last_update_time; @@ -3283,7 +3277,7 @@ int MachineObject::parse_json(std::string payload, bool key_field_only) if (jj.contains("project_id") && jj.contains("profile_id") && jj.contains("subtask_id") - ){ + ) { obj_subtask_id = jj["subtask_id"].get(); int plate_index = -1; @@ -3314,7 +3308,6 @@ int MachineObject::parse_json(std::string payload, bool key_field_only) } } - #pragma endregion #pragma region status @@ -3584,13 +3577,14 @@ int MachineObject::parse_json(std::string payload, bool key_field_only) && jj["upgrade_state"]["dis_state"].get() == 3) { GUI::wxGetApp().CallAfter([this] { this->command_get_version(); - }); + }); } if (upgrade_display_hold_count > 0) upgrade_display_hold_count--; else upgrade_display_state = jj["upgrade_state"]["dis_state"].get(); - } else { + } + else { if (upgrade_display_hold_count > 0) upgrade_display_hold_count--; else { @@ -3641,7 +3635,8 @@ int MachineObject::parse_json(std::string payload, bool key_field_only) new_ver_list.insert(std::make_pair(ver_info.name, ver_info)); } - } else { + } + else { new_ver_list.clear(); } } @@ -5331,6 +5326,8 @@ void DeviceManager::check_pushing() } } + + void DeviceManager::on_machine_alive(std::string json_str) { try { @@ -5855,7 +5852,7 @@ void DeviceManager::parse_user_print_info(std::string body) } } } - catch (std::exception&) { + catch (std::exception& e) { ; } } @@ -6094,15 +6091,11 @@ void DeviceManager::check_filaments_in_blacklist(std::string tag_vendor, std::st { vendor = prohibited_filament["vendor"].get(); type = prohibited_filament["type"].get(); - - if (GUI::wxGetApp().app_config->get("skip_ams_blacklist_check") == "true") { - - action = "warning"; - } - else { - - action = prohibited_filament["action"].get(); - } + if (GUI::wxGetApp().app_config->get("skip_ams_blacklist_check") == "true") { + action = "warning"; + } else { + action = prohibited_filament["action"].get(); + } description = prohibited_filament["description"].get(); description = blacklist_prompt[description].ToUTF8().data(); diff --git a/src/slic3r/GUI/DeviceManager.hpp b/src/slic3r/GUI/DeviceManager.hpp index ec8f9abd21..085d6356ca 100644 --- a/src/slic3r/GUI/DeviceManager.hpp +++ b/src/slic3r/GUI/DeviceManager.hpp @@ -2,11 +2,11 @@ #define slic3r_DeviceManager_hpp_ #include +#include #include #include #include #include -#include #include #include #include "nlohmann/json.hpp" diff --git a/src/slic3r/GUI/GUI_App.cpp b/src/slic3r/GUI/GUI_App.cpp index 0e17f0dcd1..dbf08d54ad 100644 --- a/src/slic3r/GUI/GUI_App.cpp +++ b/src/slic3r/GUI/GUI_App.cpp @@ -1028,7 +1028,7 @@ void GUI_App::post_init() std::time_t lw_t = boost::filesystem::last_write_time(temp_path) ; files_vec.push_back({ lw_t, temp_path.filename().string() }); } - } catch (const std::exception &ex) { + } catch (const std::exception &) { } } std::sort(files_vec.begin(), files_vec.end(), []( diff --git a/src/slic3r/GUI/GUI_App.hpp b/src/slic3r/GUI/GUI_App.hpp index 34428d1705..5358795595 100644 --- a/src/slic3r/GUI/GUI_App.hpp +++ b/src/slic3r/GUI/GUI_App.hpp @@ -1,13 +1,6 @@ #ifndef slic3r_GUI_App_hpp_ #define slic3r_GUI_App_hpp_ -#include -#include -#include -#include -#include -#include - #include #include #include "ImGuiWrapper.hpp" @@ -26,6 +19,13 @@ #include "slic3r/GUI/HttpServer.hpp" #include "../Utils/PrintHost.hpp" +#include +#include +#include +#include +#include +#include + #include #include @@ -275,7 +275,7 @@ private: std::unique_ptr m_other_instance_message_handler; std::unique_ptr m_single_instance_checker; std::string m_instance_hash_string; - size_t m_instance_hash_int; + size_t m_instance_hash_int; std::unique_ptr m_downloader; @@ -310,8 +310,8 @@ private: HttpServer m_http_server; bool m_show_gcode_window{true}; boost::thread m_check_network_thread; - public: - //try again when subscription fails +public: + //try again when subscription fails void on_start_subscribe_again(std::string dev_id); void check_filaments_in_blacklist(std::string tag_supplier, std::string tag_material, bool& in_blacklist, std::string& action, std::string& info); std::string get_local_models_path(); @@ -557,7 +557,7 @@ private: #endif /* __APPLE */ Sidebar& sidebar(); - GizmoObjectManipulation* obj_manipul(); + GizmoObjectManipulation *obj_manipul(); ObjectSettings* obj_settings(); ObjectList* obj_list(); ObjectLayers* obj_layers(); diff --git a/src/slic3r/GUI/MediaFilePanel.cpp b/src/slic3r/GUI/MediaFilePanel.cpp index 9ff4b7fd18..dcc31d27ee 100644 --- a/src/slic3r/GUI/MediaFilePanel.cpp +++ b/src/slic3r/GUI/MediaFilePanel.cpp @@ -255,7 +255,7 @@ void MediaFilePanel::SetMachineObject(MachineObject* obj) m_button_management->Enable(false); SetSelecting(false); if (m_machine.empty()) { - m_image_grid->SetStatus(m_bmp_failed, _L("No printers.")); + m_image_grid->SetStatus(m_bmp_failed, _L("Please confirm if the printer is connected.")); } else { boost::shared_ptr fs(new PrinterFileSystem); fs->Attached(); @@ -296,7 +296,7 @@ void MediaFilePanel::SetMachineObject(MachineObject* obj) switch (status) { case PrinterFileSystem::Initializing: icon = m_bmp_loading; msg = _L("Initializing..."); break; case PrinterFileSystem::Connecting: icon = m_bmp_loading; msg = _L("Connecting..."); break; - case PrinterFileSystem::Failed: icon = m_bmp_failed; if (extra != 1) msg = _L("Connect failed [%d]!"); break; + case PrinterFileSystem::Failed: icon = m_bmp_failed; if (extra != 1) msg = _L("Please check the network and try again, You can restart or update the printer if the issue persists."); break; case PrinterFileSystem::ListSyncing: icon = m_bmp_loading; msg = _L("Loading file list..."); break; case PrinterFileSystem::ListReady: icon = extra == 0 ? m_bmp_empty : m_bmp_failed; msg = extra == 0 ? _L("No files") : _L("Load failed"); break; } @@ -310,7 +310,6 @@ void MediaFilePanel::SetMachineObject(MachineObject* obj) if (e.GetInt() == PrinterFileSystem::Initializing) fetchUrl(boost::weak_ptr(fs)); - err = fs->GetLastError(); if ((status == PrinterFileSystem::Failed && m_last_errors.find(err) == m_last_errors.end()) || status == PrinterFileSystem::ListReady) { m_last_errors.insert(fs->GetLastError()); @@ -429,7 +428,7 @@ void MediaFilePanel::fetchUrl(boost::weak_ptr wfs) if (!fs || fs != m_image_grid->GetFileSystem()) return; if (!IsEnabled()) { m_waiting_enable = true; - m_image_grid->SetStatus(m_bmp_failed, _L("Initialize failed (Device connection not ready)!")); + m_image_grid->SetStatus(m_bmp_failed, _L("Please confirm if the printer is connected.")); fs->SetUrl("0"); return; } @@ -441,7 +440,7 @@ void MediaFilePanel::fetchUrl(boost::weak_ptr wfs) return; } if (!m_sdcard_exist) { - m_image_grid->SetStatus(m_bmp_failed, _L("Initialize failed (Storage unavailable, insert SD card.)!")); + m_image_grid->SetStatus(m_bmp_failed, _L("Please check if the SD card is inserted into the printer.\nIf it still cannot be read, you can try formatting the SD card.")); fs->SetUrl("0"); return; } @@ -495,9 +494,9 @@ void MediaFilePanel::fetchUrl(boost::weak_ptr wfs) boost::shared_ptr fs(wfs.lock()); if (!fs || fs != m_image_grid->GetFileSystem()) return; if (boost::algorithm::starts_with(url, "bambu:///")) { - fs->SetUrl(url + "&device=" + m + "&dev_ver=" + v); + fs->SetUrl(url); } else { - m_image_grid->SetStatus(m_bmp_failed, wxString::Format(_L("Initialize failed (%s)!"), url.empty() ? _L("Network unreachable") : from_u8(url))); + m_image_grid->SetStatus(m_bmp_failed, _L("Connection Failed. Please check the network and try again")); fs->SetUrl("3"); } }); diff --git a/src/slic3r/GUI/MediaFilePanel.h b/src/slic3r/GUI/MediaFilePanel.h index c22639304b..270542c5d9 100644 --- a/src/slic3r/GUI/MediaFilePanel.h +++ b/src/slic3r/GUI/MediaFilePanel.h @@ -8,9 +8,11 @@ #ifndef MediaFilePanel_h #define MediaFilePanel_h +#include + #include "GUI_Utils.hpp" #include "wxExtensions.hpp" -#include + #include class Button; diff --git a/src/slic3r/GUI/MsgDialog.cpp b/src/slic3r/GUI/MsgDialog.cpp index dfe4de512b..f6190d24ca 100644 --- a/src/slic3r/GUI/MsgDialog.cpp +++ b/src/slic3r/GUI/MsgDialog.cpp @@ -638,7 +638,7 @@ wxBoxSizer *Newer3mfVersionDialog::get_btn_sizer() } }); } - + if (!file_version_newer) { m_later_btn = new Button(this, _L("Not for now")); m_later_btn->SetBackgroundColor(btn_bg_white); @@ -671,7 +671,7 @@ NetworkErrorDialog::NetworkErrorDialog(wxWindow* parent) auto m_line_top = new wxPanel(this, wxID_ANY, wxDefaultPosition, wxSize(-1, 1), wxTAB_TRAVERSAL); m_line_top->SetBackgroundColour(wxColour(166, 169, 170)); - + wxBoxSizer* sizer_bacis_text = new wxBoxSizer(wxVERTICAL); m_text_basic = new Label(this, _L("The server is unable to respond. Please click the link below to check the server status.")); @@ -702,7 +702,7 @@ NetworkErrorDialog::NetworkErrorDialog(wxWindow* parent) m_text_proposal->Wrap(FromDIP(470)); m_text_proposal->SetFont(::Label::Body_14); m_text_proposal->SetForegroundColour(0x323A3C); - + m_text_wiki = new wxHyperlinkCtrl(this, wxID_ANY, _L("How to use LAN only mode"), ""); m_text_wiki->SetFont(::Label::Body_13); m_text_wiki->Bind(wxEVT_LEFT_DOWN, [this](auto& e) {wxGetApp().link_to_lan_only_wiki(); }); @@ -719,7 +719,7 @@ NetworkErrorDialog::NetworkErrorDialog(wxWindow* parent) checkbox->SetValue(false); - auto checkbox_title = new Label(this, _L("Dont't show this dialog again")); + auto checkbox_title = new Label(this, _L("Don't show this dialog again")); checkbox_title->SetForegroundColour(0x323A3C); checkbox_title->SetFont(::Label::Body_14); checkbox_title->Wrap(-1); diff --git a/src/slic3r/GUI/ReleaseNote.hpp b/src/slic3r/GUI/ReleaseNote.hpp index ba8901b26e..a290a9c291 100644 --- a/src/slic3r/GUI/ReleaseNote.hpp +++ b/src/slic3r/GUI/ReleaseNote.hpp @@ -313,7 +313,7 @@ public: bool m_show_access_code{ false }; int m_result; int current_input_index {0}; - std::shared_ptr m_status_bar; + std::shared_ptr m_status_bar; boost::bimaps::bimap m_models_map; void switch_input_panel(int index);