mirror of
https://git.mirrors.martin98.com/https://github.com/bambulab/BambuStudio.git
synced 2025-08-06 00:56:04 +08:00
ENH:prohibit resume2D tasks
jira:[none] Change-Id: I038928bbe06b9f8f711513dca9021a9a08c92e6f
This commit is contained in:
parent
60dd53b26d
commit
573db9bf60
@ -2112,6 +2112,8 @@ int MachineObject::command_task_pause()
|
||||
|
||||
int MachineObject::command_task_resume()
|
||||
{
|
||||
if (jobState_ > 1) return 0;
|
||||
|
||||
json j;
|
||||
j["print"]["command"] = "resume";
|
||||
j["print"]["param"] = "";
|
||||
@ -2122,6 +2124,8 @@ int MachineObject::command_task_resume()
|
||||
|
||||
int MachineObject::command_hms_idle_ignore(const std::string &error_str, int type)
|
||||
{
|
||||
if (jobState_ > 1) return 0;
|
||||
|
||||
json j;
|
||||
j["print"]["command"] = "idle_ignore";
|
||||
j["print"]["err"] = error_str;
|
||||
@ -2132,6 +2136,8 @@ 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;
|
||||
|
||||
json j;
|
||||
j["print"]["command"] = "resume";
|
||||
j["print"]["err"] = error_str;
|
||||
@ -2144,6 +2150,8 @@ 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;
|
||||
|
||||
json j;
|
||||
j["print"]["command"] = "ignore";
|
||||
j["print"]["err"] = error_str;
|
||||
@ -2382,6 +2390,8 @@ 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;
|
||||
|
||||
//valid actions
|
||||
if (action == "resume" || action == "reset" || action == "pause" || action == "done" || action == "abort") {
|
||||
json j;
|
||||
@ -3098,6 +3108,7 @@ void MachineObject::reset()
|
||||
network_wired = false;
|
||||
dev_connection_name = "";
|
||||
job_id_ = "";
|
||||
jobState_ = 0;
|
||||
m_plate_index = -1;
|
||||
|
||||
nt_reset_data();
|
||||
@ -3984,6 +3995,11 @@ int MachineObject::parse_json(std::string tunnel, std::string payload, bool key_
|
||||
this->task_id_ = jj["task_id"].get<std::string>();
|
||||
}
|
||||
|
||||
if (jj.contains("job_attr")) {
|
||||
int jobAttr = jj["job_attr"].get<int>();
|
||||
jobState_ = get_flag_bits(jobAttr, 4, 4);
|
||||
}
|
||||
|
||||
if (jj.contains("gcode_file"))
|
||||
this->m_gcode_file = jj["gcode_file"].get<std::string>();
|
||||
if (jj.contains("gcode_file_prepare_percent")) {
|
||||
|
@ -1125,6 +1125,9 @@ public:
|
||||
boost::thread* get_slice_info_thread { nullptr };
|
||||
boost::thread* get_model_task_thread { nullptr };
|
||||
|
||||
/* job attr */
|
||||
int jobState_ = 0;
|
||||
|
||||
/* key: sequence id, value: callback */
|
||||
std::map<std::string, CommandCallBack> m_callback_list;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user