FIX:fixed the issue of AMS not updating location

jira:[STUDIO-9182 STUDIO-9216]

Change-Id: I42e57b47abf357cdc99f71e1739ab9fc3a122d85
This commit is contained in:
tao wang 2024-12-20 16:44:11 +08:00 committed by lane.wei
parent b8b341e523
commit 43083f1e48
2 changed files with 12 additions and 0 deletions

View File

@ -4223,6 +4223,11 @@ int MachineObject::parse_json(std::string payload, bool key_field_only)
// new ams added event // new ams added event
curr_ams = new_ams; curr_ams = new_ams;
} else { } else {
if (nozzle_id != ams_it->second->nozzle) {
ams_it->second->nozzle = nozzle_id;
}
curr_ams = ams_it->second; curr_ams = ams_it->second;
} }
if (!curr_ams) continue; if (!curr_ams) continue;

View File

@ -3404,16 +3404,23 @@ void AMSControl::UpdateAms(std::vector<AMSinfo> ams_info, std::vector<AMSinfo>ex
if (!test){ if (!test){
// update item // update item
bool fresh = false; bool fresh = false;
// basic check
if (m_ams_info.size() == ams_info.size() && m_extder_data.total_extder_count == data.total_extder_count && m_dev_id == dev_id){ if (m_ams_info.size() == ams_info.size() && m_extder_data.total_extder_count == data.total_extder_count && m_dev_id == dev_id){
for (int i = 0; i < m_ams_info.size(); i++){ for (int i = 0; i < m_ams_info.size(); i++){
if (m_ams_info[i].ams_id != ams_info[i].ams_id){ if (m_ams_info[i].ams_id != ams_info[i].ams_id){
fresh = true; fresh = true;
} }
if (m_ams_info[i].nozzle_id != ams_info[i].nozzle_id) {
fresh = true;
}
} }
} }
else{ else{
fresh = true; fresh = true;
} }
m_ams_info.clear(); m_ams_info.clear();
m_ams_info = ams_info; m_ams_info = ams_info;
m_ext_info.clear(); m_ext_info.clear();