Skip to content

Commit

Permalink
ENH: try to fix a printer search bug
Browse files Browse the repository at this point in the history
JIRA: STUDIO-4697

Change-Id: If14fdcf7a27d02af9c33029837a067305582208b
Signed-off-by: Stone Li <[email protected]>
  • Loading branch information
StoneLiBambulab authored and lanewei120 committed Nov 9, 2023
1 parent 6058b18 commit b0d65b2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/slic3r/GUI/DeviceManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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>();
Expand Down
16 changes: 11 additions & 5 deletions src/slic3r/GUI/SelectMachine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit b0d65b2

Please sign in to comment.