diff --git a/src/slic3r/GUI/DeviceManager.cpp b/src/slic3r/GUI/DeviceManager.cpp index ef1308a919..694e1dd628 100644 --- a/src/slic3r/GUI/DeviceManager.cpp +++ b/src/slic3r/GUI/DeviceManager.cpp @@ -2067,7 +2067,7 @@ int MachineObject::command_task_pause() int MachineObject::command_task_resume() { - if (jobState_ > 1) return 0; + if(check_resume_condition()) return 0; json j; j["print"]["command"] = "resume"; @@ -2079,7 +2079,7 @@ int MachineObject::command_task_resume() int MachineObject::command_hms_idle_ignore(const std::string &error_str, int type) { - if (jobState_ > 1) return 0; + if(check_resume_condition()) return 0; json j; j["print"]["command"] = "idle_ignore"; @@ -2091,7 +2091,7 @@ int MachineObject::command_hms_idle_ignore(const std::string &error_str, int typ int MachineObject::command_hms_resume(const std::string& error_str, const std::string& job_id) { - if (jobState_ > 1) return 0; + if(check_resume_condition()) return 0; json j; j["print"]["command"] = "resume"; @@ -2105,7 +2105,7 @@ int MachineObject::command_hms_resume(const std::string& error_str, const std::s int MachineObject::command_hms_ignore(const std::string& error_str, const std::string& job_id) { - if (jobState_ > 1) return 0; + if(check_resume_condition()) return 0; json j; j["print"]["command"] = "ignore"; @@ -2173,6 +2173,14 @@ int MachineObject::command_set_chamber(int temp) return this->publish_json(j.dump(), 1); } +int MachineObject::check_resume_condition() +{ + if (jobState_ > 1) { + GUI::wxGetApp().show_dialog(_L("To ensure your safety, certain processing tasks (such as laser) can only be resumed on printer.")); + return 1; + } + return 0; +} int MachineObject::command_ams_change_filament(bool load, std::string ams_id, std::string slot_id, int old_temp, int new_temp) { json j; @@ -2295,7 +2303,7 @@ int MachineObject::command_ams_select_tray(std::string tray_id) int MachineObject::command_ams_control(std::string action) { - if (action == "resume" && jobState_ > 1 ) return 0; + if (action == "resume" && check_resume_condition()) return 0; //valid actions if (action == "resume" || action == "reset" || action == "pause" || action == "done" || action == "abort") { diff --git a/src/slic3r/GUI/DeviceManager.hpp b/src/slic3r/GUI/DeviceManager.hpp index 74ac751d56..655969626e 100644 --- a/src/slic3r/GUI/DeviceManager.hpp +++ b/src/slic3r/GUI/DeviceManager.hpp @@ -1209,6 +1209,7 @@ public: int command_set_nozzle(int temp); int command_set_nozzle_new(int nozzle_id, int temp); int command_set_chamber(int temp); + int check_resume_condition(); // ams controls //int command_ams_switch(int tray_index, int old_temp = 210, int new_temp = 210); int command_ams_change_filament(bool load, std::string ams_id, std::string slot_id, int old_temp = 210, int new_temp = 210);