mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-16 18:12:10 +00:00
ENH: support parts skipping function
Jira: STUDIO-12687 Change-Id: I244cb611954590bd5e741f0d2701f359426a33a2 (cherry picked from commit e7e90e0f8ca0106a51d18d83efa0de56b332ddc0)
This commit is contained in:
@@ -1860,6 +1860,17 @@ int MachineObject::command_control_fan_val(FanType fan_type, int val)
|
||||
}
|
||||
|
||||
|
||||
int MachineObject::command_task_partskip(std::vector<int> part_ids)
|
||||
{
|
||||
BOOST_LOG_TRIVIAL(trace) << "command_task_partskip: ";
|
||||
json j;
|
||||
j["print"]["command"] = "skip_objects";
|
||||
j["print"]["obj_list"] = part_ids;
|
||||
j["print"]["sequence_id"] = std::to_string(MachineObject::m_sequence_id++);
|
||||
|
||||
return this->publish_json(j.dump(), 1);
|
||||
}
|
||||
|
||||
int MachineObject::command_task_abort()
|
||||
{
|
||||
BOOST_LOG_TRIVIAL(trace) << "command_task_abort: ";
|
||||
@@ -2730,7 +2741,7 @@ void MachineObject::reset()
|
||||
vt_tray.reset();
|
||||
|
||||
subtask_ = nullptr;
|
||||
|
||||
m_partskip_ids.clear();
|
||||
}
|
||||
|
||||
void MachineObject::set_print_state(std::string status)
|
||||
@@ -2966,8 +2977,20 @@ int MachineObject::parse_json(std::string payload, bool key_field_only)
|
||||
print_json.load_compatible_settings(printer_type, "");
|
||||
print_json.diff2all_base_reset(j_pre);
|
||||
}
|
||||
|
||||
if (j_pre["print"].contains("s_obj")){
|
||||
if(j_pre["print"]["s_obj"].is_array()){
|
||||
m_partskip_ids.clear();
|
||||
for(auto it=j_pre["print"]["s_obj"].begin(); it!=j_pre["print"]["s_obj"].end(); it++){
|
||||
m_partskip_ids.push_back(it.value().get<int>());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (j_pre["print"].contains("plate_idx") && m_plate_index == -1){
|
||||
m_plate_index = j_pre["print"]["plate_idx"].get<int>();
|
||||
}
|
||||
}
|
||||
if (j_pre.contains("system")) {
|
||||
if (j_pre["system"].contains("command")) {
|
||||
|
||||
Reference in New Issue
Block a user