diff --git a/resources/printers/BL-P001.json b/resources/printers/BL-P001.json index 9e57866d4..e2c36e878 100644 --- a/resources/printers/BL-P001.json +++ b/resources/printers/BL-P001.json @@ -37,6 +37,7 @@ "support_lidar_calibration": true, "support_ai_monitoring": false, "support_first_layer_inspect": true, + "support_save_remote_print_file_to_storage": true, "support_chamber_temp_edit": false, "support_extrusion_cali": false, "support_user_preset": false diff --git a/resources/printers/BL-P002.json b/resources/printers/BL-P002.json index d795d50ff..ab2ea157d 100644 --- a/resources/printers/BL-P002.json +++ b/resources/printers/BL-P002.json @@ -37,6 +37,7 @@ "support_lidar_calibration": true, "support_ai_monitoring": false, "support_first_layer_inspect": true, + "support_save_remote_print_file_to_storage": true, "support_chamber_temp_edit": false, "support_extrusion_cali": false, "support_user_preset": false diff --git a/resources/printers/O1D.json b/resources/printers/O1D.json index 2322e81ea..3b925d8bf 100644 --- a/resources/printers/O1D.json +++ b/resources/printers/O1D.json @@ -47,6 +47,7 @@ "support_high_tempbed_calibration": true, "support_ai_monitoring": true, "support_first_layer_inspect": false, + "support_save_remote_print_file_to_storage": true, "support_chamber_temp_edit": true, "support_chamber_temp_edit_range": [ 20, 65 ], "support_chamber_temp_switch_heating": 40, diff --git a/resources/printers/version.txt b/resources/printers/version.txt index b255660da..c9d25e727 100644 --- a/resources/printers/version.txt +++ b/resources/printers/version.txt @@ -1 +1 @@ -02.00.00.03 \ No newline at end of file +02.00.00.04 \ No newline at end of file diff --git a/src/slic3r/GUI/DeviceManager.cpp b/src/slic3r/GUI/DeviceManager.cpp index 2bf80f69d..bd8242a3f 100644 --- a/src/slic3r/GUI/DeviceManager.cpp +++ b/src/slic3r/GUI/DeviceManager.cpp @@ -3412,6 +3412,12 @@ int MachineObject::parse_json(std::string payload, bool key_field_only) } } + if (jj.contains("support_save_remote_print_file_to_storage")) { + if (jj["support_save_remote_print_file_to_storage"].is_boolean()) { + is_support_save_remote_print_file_to_storage = jj["support_save_remote_print_file_to_storage"].get(); + } + } + if (jj.contains("support_ai_monitoring")) { if (jj["support_ai_monitoring"].is_boolean()) { is_support_ai_monitoring = jj["support_ai_monitoring"].get(); @@ -5944,6 +5950,11 @@ void MachineObject::parse_new_info(json print) ams_auto_switch_filament_flag = get_flag_bits(cfg, 18); } + if (time(nullptr) - xcam__save_remote_print_file_to_storage_start_time > HOLD_TIME_MAX) + { + xcam__save_remote_print_file_to_storage = get_flag_bits(cfg, 19); + } + if (time(nullptr) - xcam_door_open_check_start_time > HOLD_TIME_MAX) { xcam_door_open_check = (DoorOpenCheckState) get_flag_bits(cfg, 20, 2); @@ -6542,6 +6553,24 @@ void MachineObject::command_set_door_open_check(DoorOpenCheckState state) } } + +void MachineObject::command_set_save_remote_print_file_to_storage(bool save) +{ + if (get_save_remote_print_file_to_storage() != save) + { + json j; + j["system"]["command"] = "print_cache_set"; + j["system"]["sequence_id"] = std::to_string(MachineObject::m_sequence_id++); + j["system"]["config"] = save ? true : false; + + if (publish_json(j.dump()) == 0) + { + xcam__save_remote_print_file_to_storage = save; + xcam__save_remote_print_file_to_storage_start_time = time(nullptr); + } + } +} + bool DeviceManager::EnableMultiMachine = false; bool DeviceManager::key_field_only = false; diff --git a/src/slic3r/GUI/DeviceManager.hpp b/src/slic3r/GUI/DeviceManager.hpp index e53947bfd..af75f1a5b 100644 --- a/src/slic3r/GUI/DeviceManager.hpp +++ b/src/slic3r/GUI/DeviceManager.hpp @@ -1272,12 +1272,22 @@ public: DoorOpenCheckState get_door_open_check_state() const { return xcam_door_open_check;}; void command_set_door_open_check(DoorOpenCheckState state); + /* xcam save remove print file to local*/ + bool support_save_remote_print_file_to_storage() const { return is_support_save_remote_print_file_to_storage; }; + bool get_save_remote_print_file_to_storage() const { return xcam__save_remote_print_file_to_storage; }; + void command_set_save_remote_print_file_to_storage(bool save); + private: /* xcam door open check*/ bool is_support_door_open_check = false; DoorOpenCheckState xcam_door_open_check = DoorOpenCheckState::DOOR_OPEN_CHECK_DISABLE; time_t xcam_door_open_check_start_time = 0; + + /* xcam save remove print file to local*/ + bool is_support_save_remote_print_file_to_storage = false; + bool xcam__save_remote_print_file_to_storage = false; + time_t xcam__save_remote_print_file_to_storage_start_time = 0; }; class DeviceManager diff --git a/src/slic3r/GUI/PrintOptionsDialog.cpp b/src/slic3r/GUI/PrintOptionsDialog.cpp index 582727968..e68a9a7ed 100644 --- a/src/slic3r/GUI/PrintOptionsDialog.cpp +++ b/src/slic3r/GUI/PrintOptionsDialog.cpp @@ -78,6 +78,12 @@ PrintOptionsDialog::PrintOptionsDialog(wxWindow* parent) evt.Skip(); }); + m_cb_save_remote_print_file_to_storage->Bind(wxEVT_TOGGLEBUTTON, [this](wxCommandEvent& evt) + { + if (obj) { obj->command_set_save_remote_print_file_to_storage(m_cb_save_remote_print_file_to_storage->GetValue());} + evt.Skip(); + }); + m_cb_plate_mark->Bind(wxEVT_TOGGLEBUTTON, [this](wxCommandEvent& evt) { if (obj) { obj->command_xcam_control_buildplate_marker_detector(m_cb_plate_mark->GetValue()); @@ -213,6 +219,7 @@ void PrintOptionsDialog::update_options(MachineObject* obj_) } UpdateOptionOpenDoorCheck(obj_); + UpdateOptionSavePrintFileToStorage(obj_); this->Freeze(); @@ -240,7 +247,6 @@ void PrintOptionsDialog::UpdateOptionOpenDoorCheck(MachineObject *obj) { if (!obj || !obj->support_door_open_check()) { m_cb_open_door->Hide(); text_open_door->Hide(); - open_door_line->Hide(); open_door_switch_board->Hide(); return; } @@ -263,6 +269,20 @@ void PrintOptionsDialog::UpdateOptionOpenDoorCheck(MachineObject *obj) { } } +void PrintOptionsDialog::UpdateOptionSavePrintFileToStorage(MachineObject *obj) +{ + if (obj && obj->support_save_remote_print_file_to_storage()) + { + m_cb_save_remote_print_file_to_storage->SetValue(obj->get_save_remote_print_file_to_storage()); + } + else + { + m_cb_save_remote_print_file_to_storage->Hide(); + text_save_remote_print_file_to_storage->Hide(); + text_save_remote_print_file_to_storage_explain->Hide(); + } +} + wxBoxSizer* PrintOptionsDialog::create_settings_group(wxWindow* parent) { wxBoxSizer* sizer = new wxBoxSizer(wxVERTICAL); @@ -384,9 +404,21 @@ wxBoxSizer* PrintOptionsDialog::create_settings_group(wxWindow* parent) sizer->Add(open_door_switch_board, 0, wxLEFT, FromDIP(58)); line_sizer->Add(FromDIP(5), 0, 0, 0); - open_door_line = new StaticLine(parent, false); - open_door_line->SetLineColour(wxColour(255, 255, 255)); - sizer->Add(open_door_line, 0, wxEXPAND | wxLEFT | wxRIGHT, FromDIP(20)); + //Save remote file to local storage + line_sizer = new wxBoxSizer(wxHORIZONTAL); + m_cb_save_remote_print_file_to_storage = new CheckBox(parent); + text_save_remote_print_file_to_storage = new Label(parent, _L("Store Sent Files on External Storage")); + text_save_remote_print_file_to_storage->SetFont(Label::Body_14); + line_sizer->Add(FromDIP(5), 0, 0, 0); + line_sizer->Add(m_cb_save_remote_print_file_to_storage, 0, wxALL | wxALIGN_CENTER_VERTICAL, FromDIP(5)); + line_sizer->Add(text_save_remote_print_file_to_storage, 1, wxALL | wxALIGN_CENTER_VERTICAL, FromDIP(5)); + text_save_remote_print_file_to_storage_explain = new Label(parent, _L("Save the printing files initiated from Bambu Studio, Bambu Handy and MakerWorld on External Storage")); + text_save_remote_print_file_to_storage_explain->SetFont(Label::Body_14); + text_save_remote_print_file_to_storage_explain->Wrap(300); + sizer->Add(0, 0, 0, wxTOP, FromDIP(15)); + sizer->Add(line_sizer, 0, wxEXPAND | wxLEFT | wxRIGHT, FromDIP(18)); + sizer->Add(text_save_remote_print_file_to_storage_explain, 0, wxLEFT, FromDIP(58)); + line_sizer->Add(FromDIP(5), 0, 0, 0); //Allow prompt sound line_sizer = new wxBoxSizer(wxHORIZONTAL); diff --git a/src/slic3r/GUI/PrintOptionsDialog.hpp b/src/slic3r/GUI/PrintOptionsDialog.hpp index d6b01915c..860daa2f6 100644 --- a/src/slic3r/GUI/PrintOptionsDialog.hpp +++ b/src/slic3r/GUI/PrintOptionsDialog.hpp @@ -79,6 +79,7 @@ protected: CheckBox* m_cb_plate_mark; CheckBox* m_cb_auto_recovery; CheckBox* m_cb_open_door; + CheckBox* m_cb_save_remote_print_file_to_storage; CheckBox* m_cb_sup_sound; CheckBox* m_cb_filament_tangle; CheckBox* m_cb_nozzle_blob; @@ -90,6 +91,8 @@ protected: Label* text_plate_mark_caption; Label* text_auto_recovery; Label* text_open_door; + Label* text_save_remote_print_file_to_storage; + Label* text_save_remote_print_file_to_storage_explain; Label* text_sup_sound; Label* text_filament_tangle; Label* text_nozzle_blob; @@ -101,7 +104,6 @@ protected: StaticLine* line5; StaticLine* line6; StaticLine* line7; - StaticLine* open_door_line; SwitchBoard* open_door_switch_board; wxBoxSizer* create_settings_group(wxWindow* parent); @@ -133,6 +135,7 @@ public: private: void UpdateOptionOpenDoorCheck(MachineObject *obj); + void UpdateOptionSavePrintFileToStorage(MachineObject *obj); }; }} // namespace Slic3r::GUI