FIX: auto sync extruder list after connect printer
when enter in prepare page jira: none Change-Id: I3dd0ac4fbc283d5c4b8e85d01724251cc1a7131e
This commit is contained in:
parent
66a783d126
commit
34ed8441a1
|
@ -816,6 +816,12 @@ void MainFrame::update_layout()
|
|||
{
|
||||
// jump to 3deditor under preview_only mode
|
||||
if (evt.GetId() == tp3DEditor){
|
||||
Sidebar& sidebar = GUI::wxGetApp().sidebar();
|
||||
if (sidebar.need_auto_sync_after_connect_printer()) {
|
||||
sidebar.set_need_auto_sync_after_connect_printer(false);
|
||||
sidebar.sync_extruder_list();
|
||||
}
|
||||
|
||||
m_plater->update(true);
|
||||
|
||||
if (!preview_only_hint())
|
||||
|
|
|
@ -313,8 +313,9 @@ void MonitorPanel::select_machine(std::string machine_sn)
|
|||
obj_->last_cali_version = -1;
|
||||
obj_->reset_pa_cali_history_result();
|
||||
obj_->reset_pa_cali_result();
|
||||
GUI::wxGetApp().sidebar().load_ams_list(obj_->dev_id, obj_);
|
||||
GUI::wxGetApp().sidebar().auto_sync_extruder_list_on_connect_priner(obj_);
|
||||
Sidebar &sidebar = GUI::wxGetApp().sidebar();
|
||||
sidebar.load_ams_list(obj_->dev_id, obj_);
|
||||
sidebar.set_need_auto_sync_after_connect_printer(sidebar.need_auto_sync_extruder_list_after_connect_priner(obj_));
|
||||
}
|
||||
|
||||
Layout();
|
||||
|
|
|
@ -2764,7 +2764,7 @@ bool Sidebar::sync_extruder_list()
|
|||
return p->sync_extruder_list();
|
||||
}
|
||||
|
||||
bool Sidebar::auto_sync_extruder_list_on_connect_priner(const MachineObject *obj)
|
||||
bool Sidebar::need_auto_sync_extruder_list_after_connect_priner(const MachineObject *obj)
|
||||
{
|
||||
if(!obj)
|
||||
return false;
|
||||
|
@ -2776,10 +2776,10 @@ bool Sidebar::auto_sync_extruder_list_on_connect_priner(const MachineObject *obj
|
|||
return false;
|
||||
}
|
||||
|
||||
if (preset_bundle->get_printer_extruder_count() <= 1)
|
||||
if (preset_bundle->get_printer_extruder_count() <= 1 || !obj->is_multi_extruders())
|
||||
return false;
|
||||
|
||||
return p->sync_extruder_list();
|
||||
return true;
|
||||
}
|
||||
|
||||
void Sidebar::update_sync_status(const MachineObject *obj)
|
||||
|
|
|
@ -161,7 +161,7 @@ public:
|
|||
std::map<int, DynamicPrintConfig> build_filament_ams_list(MachineObject* obj);
|
||||
void sync_ams_list(bool is_from_big_sync_btn = false);
|
||||
bool sync_extruder_list();
|
||||
bool auto_sync_extruder_list_on_connect_priner(const MachineObject* obj);
|
||||
bool need_auto_sync_extruder_list_after_connect_priner(const MachineObject* obj);
|
||||
void update_sync_status(const MachineObject* obj);
|
||||
void get_big_btn_sync_pos_size(wxPoint &pt, wxSize &size);
|
||||
void get_small_btn_sync_pos_size(wxPoint &pt, wxSize &size);
|
||||
|
@ -210,6 +210,10 @@ public:
|
|||
void cancel_update_3d_state() { m_update_3d_state = false; }
|
||||
bool get_update_3d_state() { return m_update_3d_state; }
|
||||
void update_printer_thumbnail();
|
||||
|
||||
bool need_auto_sync_after_connect_printer() const { return m_need_auto_sync_after_connect_printer; }
|
||||
void set_need_auto_sync_after_connect_printer(bool need_auto_sync) { m_need_auto_sync_after_connect_printer = need_auto_sync; }
|
||||
|
||||
private:
|
||||
struct priv;
|
||||
std::unique_ptr<priv> p;
|
||||
|
@ -218,6 +222,7 @@ private:
|
|||
bool m_soft_first_start {true };
|
||||
bool m_is_gcode_file{ false };
|
||||
bool m_update_3d_state{false};
|
||||
bool m_need_auto_sync_after_connect_printer{false};
|
||||
};
|
||||
|
||||
class Plater: public wxPanel
|
||||
|
|
Loading…
Reference in New Issue