ENH: clean codes about device

JIRA: [STUDIO-13609]
Change-Id: I591de7033360b9570600006cfbce2148a8d031d5
(cherry picked from commit e9c774be8f4c89b8dafa14ef56913612fb68bd0c)
This commit is contained in:
xin.zhang
2025-08-01 17:34:35 +08:00
committed by Noisyfox
parent d022bac5e3
commit aae50ecd58
115 changed files with 7238 additions and 5492 deletions

View File

@@ -0,0 +1,25 @@
#include "DevBed.h"
#include "slic3r/GUI/DeviceManager.hpp"
namespace Slic3r {
void DevBed::ParseV1_0(const json &print_json, DevBed *system)
{
if (print_json.contains("bed_temper")) {
if (print_json["bed_temper"].is_number()) { system->bed_temp = print_json["bed_temper"].get<float>(); }
}
if (print_json.contains("bed_target_temper")) {
if (print_json["bed_target_temper"].is_number()) { system->bed_temp_target = print_json["bed_target_temper"].get<float>(); }
}
}
void DevBed::ParseV2_0(const json &print_json, DevBed *system)
{
if (print_json.contains("bed_temp") && print_json["bed_temp"].is_number()) {
int bed_temp_bits = print_json["bed_temp"].get<int>();
system->bed_temp = system->m_owner->get_flag_bits(bed_temp_bits, 0, 16);
system->bed_temp_target = system->m_owner->get_flag_bits(bed_temp_bits, 16, 16);
}
}
} // namespace Slic3r