ENH: move on_device_connected to CalibrationPanel

Change-Id: I856103e9e2cd623919e35a595a436cd67435ec86
Signed-off-by: Stone Li <stone.li@bambulab.com>
This commit is contained in:
Stone Li 2023-07-04 16:18:47 +08:00 committed by Lane.Wei
parent d3b9d5dcdc
commit 270acd4685
4 changed files with 21 additions and 9 deletions

View file

@ -531,6 +531,15 @@ void CalibrationPanel::update_all() {
m_cali_panels[curr_selected]->update(obj);
}
if (obj) {
if (last_obj != obj && obj->is_info_ready()) {
for (int i = 0; i < CALI_MODE_COUNT; i++) {
m_cali_panels[i]->on_device_connected(obj);
}
last_obj = obj;
}
}
// check valid machine
if (obj && dev->get_my_machine(obj->dev_id) == nullptr) {
dev->set_selected_machine("");