mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2026-02-15 08:59:39 -07:00
ENH:add protection for ams_id&slot_id formatting
jira:[STUDIO-10335] Change-Id: Icc9ab0ce07860920378c286d725c32d451d17555 (cherry picked from commit 3e66c96d125590e1b8a35d0ee41732584af24253)
This commit is contained in:
parent
6a7b6f2094
commit
91176fb7fb
1 changed files with 8 additions and 6 deletions
|
|
@ -1378,13 +1378,15 @@ bool SelectMachineDialog::get_ams_mapping_result(std::string &mapping_array_str,
|
|||
mapping_item_v1["ams_id"] = 0xff;
|
||||
mapping_item_v1["slot_id"] = 0xff;
|
||||
|
||||
for (int k = 0; k < m_ams_mapping_result.size(); k++) {
|
||||
if (m_ams_mapping_result[k].id == i) {
|
||||
mapping_result = m_ams_mapping_result[k].tray_id;
|
||||
mapping_item_v1["ams_id"] = std::stoi(m_ams_mapping_result[k].ams_id);
|
||||
mapping_item_v1["slot_id"] = std::stoi(m_ams_mapping_result[k].slot_id);
|
||||
try {
|
||||
for (int k = 0; k < m_ams_mapping_result.size(); k++) {
|
||||
if (m_ams_mapping_result[k].id == i) {
|
||||
mapping_result = m_ams_mapping_result[k].tray_id;
|
||||
mapping_item_v1["ams_id"] = std::stoi(m_ams_mapping_result[k].ams_id);
|
||||
mapping_item_v1["slot_id"] = std::stoi(m_ams_mapping_result[k].slot_id);
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (...) {}
|
||||
|
||||
mapping_v0_json.push_back(mapping_result);
|
||||
mapping_v1_json.push_back(mapping_item_v1);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue