FIX: can not send print since the param fault

jira: [STUDIO-9724]
Change-Id: I1e8870e6e0b182ed6c026784b169cfcf56c56e4c
This commit is contained in:
xin.zhang 2025-01-11 11:32:41 +08:00 committed by lane.wei
parent 7b9c9345ac
commit 1813163743

View File

@ -2105,6 +2105,7 @@ void SelectMachineDialog::on_ok_btn(wxCommandEvent &event)
//check blacklist
for (auto i = 0; i < m_ams_mapping_result.size(); i++) {
const auto& ams_id = m_ams_mapping_result[i].ams_id;
auto tid = m_ams_mapping_result[i].tray_id;
std::string filament_type = boost::to_upper_copy(m_ams_mapping_result[i].type);
@ -2119,7 +2120,8 @@ void SelectMachineDialog::on_ok_btn(wxCommandEvent &event)
bool in_blacklist = false;
std::string action;
std::string info;
DeviceManager::check_filaments_in_blacklist(filament_brand, filament_type, tid, in_blacklist, action, info);
DeviceManager::check_filaments_in_blacklist(filament_brand, filament_type, stoi(ams_id), in_blacklist, action, info);
if (in_blacklist && action == "warning") {
wxString prohibited_error = wxString::FromUTF8(info);
@ -2170,6 +2172,7 @@ void SelectMachineDialog::on_ok_btn(wxCommandEvent &event)
for (auto i = 0; i < m_ams_mapping_result.size(); i++) {
const auto& ams_id = m_ams_mapping_result[i].ams_id;
auto tid = m_ams_mapping_result[i].tray_id;
std::string filament_type = boost::to_upper_copy(m_ams_mapping_result[i].type);
@ -2184,7 +2187,7 @@ void SelectMachineDialog::on_ok_btn(wxCommandEvent &event)
bool in_blacklist = false;
std::string action;
std::string info;
DeviceManager::check_filaments_in_blacklist(filament_brand, filament_type, tid, in_blacklist, action, info);
DeviceManager::check_filaments_in_blacklist(filament_brand, filament_type, stoi(ams_id), in_blacklist, action, info);
if (in_blacklist && action == "prohibition") {
has_prohibited_filament = true;