diff --git a/CMakeLists.txt b/CMakeLists.txt index 680a9515d..88db091a8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -507,7 +507,7 @@ add_custom_target(gettext_make_pot COMMAND xgettext --keyword=L --keyword=_L --keyword=_u8L --keyword=L_CONTEXT:1,2c --keyword=_L_PLURAL:1,2 --add-comments=TRN --from-code=UTF-8 --no-location --debug --boost -f "${BBL_L18N_DIR}/list.txt" -o "${BBL_L18N_DIR}/BambuStudio.pot" - COMMAND hintsToPot ${SLIC3R_RESOURCES_DIR} ${BBL_L18N_DIR} + COMMAND hintsToPot ${SLIC3R_RESOURCES_DIR} ${BBL_L18N_DIR} WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} COMMENT "Generate pot file from strings in the source tree" ) diff --git a/localazy.json b/localazy.json index 5e83bab32..42403bb53 100644 --- a/localazy.json +++ b/localazy.json @@ -43,6 +43,7 @@ }, "download": { "folder": "bbl/i18n", + "includeSourceLang" : "true", "files": { "output": "${lang}/BambuStudio_${lang}.po" } diff --git a/src/libslic3r/Fill/Fill.cpp b/src/libslic3r/Fill/Fill.cpp index 20fd3b760..2f7b63a2e 100644 --- a/src/libslic3r/Fill/Fill.cpp +++ b/src/libslic3r/Fill/Fill.cpp @@ -356,8 +356,8 @@ std::vector group_fills(const Layer &layer) surface_fills.back().region_id = surface_fills[i].region_id; surface_fills.back().surface.surface_type = stInternalSolid; surface_fills.back().surface.thickness = surface_fills[i].surface.thickness; - surface_fills.back().region_id_group = surface_fills[i].region_id_group; - surface_fills.back().no_overlap_expolygons = surface_fills[i].no_overlap_expolygons; + surface_fills.back().region_id_group = surface_fills[i].region_id_group; + surface_fills.back().no_overlap_expolygons = surface_fills[i].no_overlap_expolygons; for (size_t j = 0; j < narrow_expolygons_index.size(); j++) { // BBS: move the narrow expolygons to new surface_fills.back(); surface_fills.back().expolygons.emplace_back(std::move(surface_fills[i].expolygons[narrow_expolygons_index[j]])); diff --git a/src/libslic3r/Preset.hpp b/src/libslic3r/Preset.hpp index 2f315b3fa..e319f60cb 100644 --- a/src/libslic3r/Preset.hpp +++ b/src/libslic3r/Preset.hpp @@ -300,10 +300,11 @@ public: std::string get_filament_type(std::string &display_filament_type); std::string get_printer_type(PresetBundle *preset_bundle); // get edited preset type std::string get_current_printer_type(PresetBundle *preset_bundle); // get current preset type + bool is_custom_defined(); bool is_bbl_vendor_preset(PresetBundle *preset_bundle); - bool is_custom_defined(); + static const std::vector& print_options(); static const std::vector& filament_options(); diff --git a/src/slic3r/GUI/BBLTopbar.cpp b/src/slic3r/GUI/BBLTopbar.cpp index 665dd047f..9505e1d95 100644 --- a/src/slic3r/GUI/BBLTopbar.cpp +++ b/src/slic3r/GUI/BBLTopbar.cpp @@ -386,7 +386,9 @@ void BBLTopbar::OnPublishClicked(wxAuiToolBarEvent& event) //no more check //if (GUI::wxGetApp().plater()->model().objects.empty()) return; - if (!wxGetApp().is_user_login()) return; + + if (!wxGetApp().check_login()) + return; #ifdef ENABLE_PUBLISHING wxGetApp().plater()->show_publish_dialog(); diff --git a/src/slic3r/GUI/ConfigManipulation.cpp b/src/slic3r/GUI/ConfigManipulation.cpp index 6085b986b..1c3805f2f 100644 --- a/src/slic3r/GUI/ConfigManipulation.cpp +++ b/src/slic3r/GUI/ConfigManipulation.cpp @@ -131,7 +131,8 @@ void ConfigManipulation::check_bed_temperature_difference(int bed_type, DynamicP } if (first_layer_bed_temp > vitrification || bed_temp > vitrification) { - const wxString msg_text = wxString::Format(_L("Bed temperature is higher than vitrification temperature of this filament.\nThis may cause nozzle blocked and printing failure\nPlease keep the printer open during the printing process to ensure air circulation or reduce the temperature of the hot bed")); + const wxString msg_text = wxString::Format( + _L("Bed temperature is higher than vitrification temperature of this filament.\nThis may cause nozzle blocked and printing failure\nPlease keep the printer open during the printing process to ensure air circulation or reduce the temperature of the hot bed")); MessageDialog dialog(m_msg_dlg_parent, msg_text, "", wxICON_WARNING | wxOK); is_msg_dlg_already_exist = true; dialog.ShowModal(); diff --git a/src/slic3r/GUI/DeviceManager.cpp b/src/slic3r/GUI/DeviceManager.cpp index 946c75663..55a168305 100644 --- a/src/slic3r/GUI/DeviceManager.cpp +++ b/src/slic3r/GUI/DeviceManager.cpp @@ -1319,6 +1319,19 @@ int MachineObject::command_upgrade_firmware(FirmwareInfo info) return this->publish_json(j.dump()); } +int MachineObject::command_upgrade_module(std::string url, std::string module_type, std::string version) +{ + json j; + j["upgrade"]["command"] = "start"; + j["upgrade"]["sequence_id"] = std::to_string(MachineObject::m_sequence_id++); + j["upgrade"]["url"] = url; + j["upgrade"]["module"] = module_type; + j["upgrade"]["version"] = version; + j["upgrade"]["src_id"] = 1; + + return this->publish_json(j.dump()); +} + int MachineObject::command_xyz_abs() { return this->publish_gcode("G90 \n"); @@ -2040,11 +2053,6 @@ int MachineObject::parse_json(std::string payload) std::chrono::system_clock::time_point clock_start = std::chrono::system_clock::now(); this->set_online_state(true); - std::chrono::system_clock::time_point curr_time = std::chrono::system_clock::now(); - auto diff1 = std::chrono::duration_cast(curr_time - last_update_time); - - BOOST_LOG_TRIVIAL(info) << "interval = " << diff1.count(); - /* update last received time */ last_update_time = std::chrono::system_clock::now(); diff --git a/src/slic3r/GUI/DeviceManager.hpp b/src/slic3r/GUI/DeviceManager.hpp index 3e768c389..ad54d2219 100644 --- a/src/slic3r/GUI/DeviceManager.hpp +++ b/src/slic3r/GUI/DeviceManager.hpp @@ -621,6 +621,7 @@ public: int command_upgrade_confirm(); int command_consistency_upgrade_confirm(); int command_upgrade_firmware(FirmwareInfo info); + int command_upgrade_module(std::string url, std::string module_type, std::string version); /* control apis */ int command_xyz_abs(); diff --git a/src/slic3r/GUI/GUI_App.cpp b/src/slic3r/GUI/GUI_App.cpp index 5f10fea72..0fdb59b28 100644 --- a/src/slic3r/GUI/GUI_App.cpp +++ b/src/slic3r/GUI/GUI_App.cpp @@ -2722,8 +2722,9 @@ void GUI_App::UpdateDarkUI(wxWindow* window, bool highlited/* = false*/, bool ju return; } - if (m_is_dark_mode != dark_mode()) + if (m_is_dark_mode != dark_mode() ) m_is_dark_mode = dark_mode(); + if (m_is_dark_mode) { auto original_col = window->GetBackgroundColour(); @@ -4372,7 +4373,7 @@ bool GUI_App::load_language(wxString language, bool initial) else if (initial) { // bbs supported languages //TODO: use a global one with Preference - wxLanguage supported_languages[] { + wxLanguage supported_languages[]{ wxLANGUAGE_ENGLISH, wxLANGUAGE_CHINESE_SIMPLIFIED, wxLANGUAGE_GERMAN, @@ -4380,7 +4381,7 @@ bool GUI_App::load_language(wxString language, bool initial) wxLANGUAGE_SPANISH, wxLANGUAGE_SWEDISH, wxLANGUAGE_DUTCH, - wxLANGUAGE_HUNGARIAN }; + wxLANGUAGE_HUNGARIAN}; std::string cur_language = app_config->get("language"); if (cur_language != "") { //cleanup the language wrongly set before diff --git a/src/slic3r/GUI/MainFrame.hpp b/src/slic3r/GUI/MainFrame.hpp index c30aff094..9eafa803e 100644 --- a/src/slic3r/GUI/MainFrame.hpp +++ b/src/slic3r/GUI/MainFrame.hpp @@ -187,19 +187,6 @@ protected: #endif public: - MainFrame(); - ~MainFrame() = default; - - //BBS GUI refactor - enum TabPosition - { - tpHome = 0, - tp3DEditor = 1, - //tpSettings = 1, - tpPreview = 2, - tpMonitor = 3, - tpProject = 4, - }; //BBS GUI refactor enum PrintSelectType @@ -215,6 +202,21 @@ public: eExportAllSlicedFile = 8 }; + MainFrame(); + ~MainFrame() = default; + + //BBS GUI refactor + enum TabPosition + { + tpHome = 0, + tp3DEditor = 1, + //tpSettings = 1, + tpPreview = 2, + tpMonitor = 3, + tpProject = 4, + toDebugTool = 5, + }; + //BBS: add slice&&print status update logic enum SlicePrintEventType { @@ -240,7 +242,7 @@ public: void update_title_colour_after_set_title(); void show_option(bool show); - void init_tabpanel(); + void init_tabpanel(); void create_preset_tabs(); //BBS: GUI refactor void add_created_tab(Tab* panel, const std::string& bmp_name = ""); diff --git a/src/slic3r/GUI/MediaPlayCtrl.cpp b/src/slic3r/GUI/MediaPlayCtrl.cpp index a1e643cf0..772c51664 100644 --- a/src/slic3r/GUI/MediaPlayCtrl.cpp +++ b/src/slic3r/GUI/MediaPlayCtrl.cpp @@ -101,6 +101,7 @@ void MediaPlayCtrl::SetMachineObject(MachineObject* obj) return; } m_machine = machine; + BOOST_LOG_TRIVIAL(info) << "MediaPlayCtrl switch machine: " << m_machine; m_failed_retry = 0; std::string stream_url; if (get_stream_url(&stream_url)) { diff --git a/src/slic3r/GUI/ParamsPanel.cpp b/src/slic3r/GUI/ParamsPanel.cpp index ae4802e58..caf4d01dc 100644 --- a/src/slic3r/GUI/ParamsPanel.cpp +++ b/src/slic3r/GUI/ParamsPanel.cpp @@ -249,14 +249,7 @@ ParamsPanel::ParamsPanel( wxWindow* parent, wxWindowID id, const wxPoint& pos, c }); } - //m_staticline_filament = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); - ////m_staticline_print = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); - //m_staticline_print_object = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); - //m_staticline_print_part = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); - //m_staticline_printer = new wxStaticLine(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL); - // BBS: new layout - //m_staticline_buttons = new wxStaticLine(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL); - //m_staticline_middle = new wxStaticLine(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL); + //m_export_to_file = new Button( this, wxT("Export To File"), ""); //m_import_from_file = new Button( this, wxT("Import From File") ); diff --git a/src/slic3r/Utils/bambu_networking.hpp b/src/slic3r/Utils/bambu_networking.hpp index d2911dcd1..41c5049f4 100644 --- a/src/slic3r/Utils/bambu_networking.hpp +++ b/src/slic3r/Utils/bambu_networking.hpp @@ -34,11 +34,11 @@ namespace BBL { #define BAMBU_NETWORK_ERR_FTP_LOGIN_DENIED -25 #define BAMBU_NETWORK_ERR_GET_MODEL_PUBLISH_PAGE -26 #define BAMBU_NETWORK_ERR_GET_MODEL_MALL_HOME_PAGE -27 +#define BAMBU_NETWORK_ERR_GET_USER_INFO -28 #define BAMBU_NETWORK_LIBRARY "bambu_networking" #define BAMBU_NETWORK_AGENT_NAME "bambu_network_agent" - #define BAMBU_NETWORK_AGENT_VERSION "01.04.00.12"