FIX:add idel heating protection

jira:[STUDIO-14359][STUDIO-14431]

Change-Id: I2ecb6c78c4b28d6f14c45dbb1f905b95a9d8c4ab
(cherry picked from commit f6eee61915b47321c1cb44e3ff2306875c32466b)
This commit is contained in:
milk
2025-09-15 21:41:05 +08:00
committed by Noisyfox
parent 434d2142e4
commit 7608195e17
7 changed files with 197 additions and 49 deletions

View File

@@ -107,7 +107,6 @@ void DevPrintOptionsParser::ParseDetectionV1_2(DevPrintOptions *opts, MachineObj
}
}
if (time(nullptr) - opts->xcam_auto_recovery_hold_start > HOLD_TIME_3SEC) {
if (print_json.contains("auto_recovery")) { opts->xcam_auto_recovery_step_loss = print_json["auto_recovery"].get<bool>(); }
}
@@ -145,7 +144,11 @@ void DevPrintOptionsParser::ParseDetectionV2_0(DevPrintOptions *opts, std::strin
if (time(nullptr) - opts->xcam_filament_tangle_detect_hold_start > HOLD_TIME_3SEC) {
opts->xcam_filament_tangle_detect = DevUtil::get_flag_bits(print_json, 23);
}
}
void DevPrintOptionsParser::ParseDetectionV2_1(DevPrintOptions *opts, std::string cfg) {
if (time(nullptr) - opts->idel_heating_protect_hold_strat > HOLD_TIME_3SEC)
opts->idel_heating_protect_enabled = DevUtil::get_flag_bits(cfg, 32, 2);
}
void DevPrintOptions::SetPrintingSpeedLevel(DevPrintingSpeedLevel speed_level)
@@ -168,8 +171,15 @@ int DevPrintOptions::command_xcam_control_ai_monitoring(bool on_off, std::string
xcam_ai_monitoring_hold_start = time(nullptr);
xcam_ai_monitoring_sensitivity = lvl;
return command_xcam_control("printing_monitor", on_off, m_obj, lvl);
}
int DevPrintOptions::command_xcam_control_idelheatingprotect_detector(bool on_off)
{
idel_heating_protect_enabled = on_off;
idel_heating_protect_hold_strat = time(nullptr);
return command_set_against_continued_heating_mode(on_off);
}
int DevPrintOptions::command_xcam_control_buildplate_marker_detector(bool on_off)
{
xcam_buildplate_marker_detector = on_off;
@@ -239,6 +249,15 @@ int DevPrintOptions::command_xcam_control(std::string module_name, bool on_off ,
return obj->publish_json(j);
}
int DevPrintOptions::command_set_against_continued_heating_mode(bool on_off)
{
json j;
j["print"]["sequence_id"] = std::to_string(MachineObject::m_sequence_id++);
j["print"]["command"] = "set_against_continued_heating_mode";
j["print"]["enable"] = on_off;
return m_obj->publish_json(j);
}
int DevPrintOptions::command_set_printing_option(bool auto_recovery, MachineObject *obj)
{
json j;