mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-14 09:02:06 +00:00
ENH:use new command based on AMS type
jira:[none] Change-Id: I9411aa5b673b4270fe468a07c38d9966bd31a29a (cherry picked from commit 83de229aa1306e80646b69ea7ba02f6b2e58f818)
This commit is contained in:
@@ -4422,8 +4422,9 @@ int MachineObject::parse_json(std::string payload, bool key_field_only)
|
||||
int type_id = 1; // 0:dummy 1:ams 2:ams-lite 3:n3f 4:n3s
|
||||
|
||||
/*ams info*/
|
||||
std::string info;
|
||||
if (it->contains("info")) {
|
||||
std::string info = (*it)["info"].get<std::string>();
|
||||
info = (*it)["info"].get<std::string>();
|
||||
type_id = get_flag_bits(info, 0, 4);
|
||||
nozzle_id = get_flag_bits(info, 8, 4);
|
||||
}
|
||||
@@ -4440,6 +4441,7 @@ int MachineObject::parse_json(std::string payload, bool key_field_only)
|
||||
auto ams_it = amsList.find(ams_id);
|
||||
if (ams_it == amsList.end()) {
|
||||
Ams* new_ams = new Ams(ams_id, nozzle_id, type_id);
|
||||
new_ams->info = info;
|
||||
amsList.insert(std::make_pair(ams_id, new_ams));
|
||||
// new ams added event
|
||||
curr_ams = new_ams;
|
||||
|
||||
@@ -374,6 +374,7 @@ public:
|
||||
type = type_id;
|
||||
}
|
||||
std::string id;
|
||||
std::string info;
|
||||
int left_dry_time = 0;
|
||||
int humidity = 5;
|
||||
int humidity_raw = -1; // the percentage, -1 means invalid. eg. 100 means 100%
|
||||
|
||||
@@ -4567,6 +4567,12 @@ void StatusPanel::on_ams_refresh_rfid(wxCommandEvent &event)
|
||||
|
||||
if (obj->m_extder_data.total_extder_count <= 1 && !obj->is_enable_np) {
|
||||
has_filament_at_extruder = obj->is_filament_at_extruder();
|
||||
|
||||
/*for xp support n3s/n3f*/
|
||||
if (!ams_it->second->info.empty()) {
|
||||
use_new_command = true;
|
||||
}
|
||||
|
||||
} else {
|
||||
use_new_command = true;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user