ENH:actively select a printer on the calibration page

fixed:https://github.com/bambulab/BambuStudio/issues/2054

Change-Id: I087eebcda934c4f2447f2dc6e473a8389e9d4a25
This commit is contained in:
tao wang 2023-07-18 15:53:46 +08:00 committed by Lane.Wei
parent 5f8e285624
commit 386607a6a7

View file

@ -653,6 +653,22 @@ bool CalibrationPanel::Show(bool show) {
m_refresh_timer->SetOwner(this);
m_refresh_timer->Start(REFRESH_INTERVAL);
wxPostEvent(this, wxTimerEvent());
DeviceManager* dev = Slic3r::GUI::wxGetApp().getDeviceManager();
if (dev) {
//set a default machine when obj is null
obj = dev->get_selected_machine();
if (obj == nullptr) {
dev->load_last_machine();
obj = dev->get_selected_machine();
if (obj)
GUI::wxGetApp().sidebar().load_ams_list(obj->dev_id, obj);
}
else {
obj->reset_update_time();
}
}
}
else {
m_refresh_timer->Stop();