ENH: try to fix a printer search bug

JIRA: STUDIO-4697

Change-Id: If14fdcf7a27d02af9c33029837a067305582208b
Signed-off-by: Stone Li <stone.li@bambulab.com>
This commit is contained in:
Stone Li 2023-10-16 16:30:52 +08:00 committed by Lane.Wei
parent 6058b18e43
commit b0d65b2cab
2 changed files with 12 additions and 6 deletions

View File

@ -4054,7 +4054,7 @@ int MachineObject::parse_json(std::string payload)
tray_id = jj["tray_id"].get<int>();
}
if (ams_id == 255 && tray_id == VIRTUAL_TRAY_ID) {
BOOST_LOG_TRIVIAL(trace) << "ams_filament_setting, parse tray info";
BOOST_LOG_TRIVIAL(info) << "ams_filament_setting, parse tray info";
vt_tray.nozzle_temp_max = std::to_string(jj["nozzle_temp_max"].get<int>());
vt_tray.nozzle_temp_min = std::to_string(jj["nozzle_temp_min"].get<int>());
vt_tray.color = jj["tray_color"].get<std::string>();

View File

@ -552,11 +552,14 @@ void SelectMachinePopup::update_other_devices()
MachineObjectPanel* op = nullptr;
if (i < m_other_list_machine_panel.size()) {
op = m_other_list_machine_panel[i]->mPanel;
op->Show();
#if !BBL_RELEASE_TO_PUBLIC && defined(__WINDOWS__)
if (!search_for_printer(mobj)) {
op->Hide();
}
} else {
op->Show();
}
#else
op->Show();
#endif
} else {
op = new MachineObjectPanel(m_scrolledWindow, wxID_ANY);
@ -682,11 +685,14 @@ void SelectMachinePopup::update_user_devices()
MachineObjectPanel* op = nullptr;
if (i < m_user_list_machine_panel.size()) {
op = m_user_list_machine_panel[i]->mPanel;
op->Show();
#if !BBL_RELEASE_TO_PUBLIC && defined(__WINDOWS__)
if (!search_for_printer(mobj)) {
op->Hide();
}
} else {
op->Show();
}
#else
op->Show();
#endif
} else {
op = new MachineObjectPanel(m_scrolledWindow, wxID_ANY);
@ -803,7 +809,7 @@ bool SelectMachinePopup::search_for_printer(MachineObject* obj)
auto ip_it = ip.find(search_text);
if ((name_it != std::string::npos)||(ip_it != std::string::npos)) {
return true;
}
}
return false;
}