mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-19 19:33:47 +00:00
FIX: auto sync extruder list after connect printer
when enter in prepare page jira: none Change-Id: I3dd0ac4fbc283d5c4b8e85d01724251cc1a7131e (cherry picked from commit 34ed8441a16499f922e82b6c83f140eda58055a5)
This commit is contained in:
@@ -830,6 +830,12 @@ void MainFrame::update_layout()
|
|||||||
{
|
{
|
||||||
// jump to 3deditor under preview_only mode
|
// jump to 3deditor under preview_only mode
|
||||||
if (evt.GetId() == tp3DEditor){
|
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);
|
m_plater->update(true);
|
||||||
|
|
||||||
if (!preview_only_hint())
|
if (!preview_only_hint())
|
||||||
|
|||||||
@@ -300,8 +300,9 @@ void MonitorPanel::on_update_all(wxMouseEvent &event)
|
|||||||
obj_->last_cali_version = -1;
|
obj_->last_cali_version = -1;
|
||||||
obj_->reset_pa_cali_history_result();
|
obj_->reset_pa_cali_history_result();
|
||||||
obj_->reset_pa_cali_result();
|
obj_->reset_pa_cali_result();
|
||||||
GUI::wxGetApp().sidebar().load_ams_list(obj_->dev_id, obj_);
|
Sidebar &sidebar = GUI::wxGetApp().sidebar();
|
||||||
GUI::wxGetApp().sidebar().auto_sync_extruder_list_on_connect_priner(obj_);
|
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();
|
Layout();
|
||||||
|
|||||||
@@ -2637,7 +2637,7 @@ bool Sidebar::sync_extruder_list()
|
|||||||
return p->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)
|
if(!obj)
|
||||||
return false;
|
return false;
|
||||||
@@ -2649,10 +2649,10 @@ bool Sidebar::auto_sync_extruder_list_on_connect_priner(const MachineObject *obj
|
|||||||
return false;
|
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 false;
|
||||||
|
|
||||||
return p->sync_extruder_list();
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Sidebar::update_sync_status(const MachineObject *obj)
|
void Sidebar::update_sync_status(const MachineObject *obj)
|
||||||
|
|||||||
@@ -171,7 +171,7 @@ public:
|
|||||||
std::map<int, DynamicPrintConfig> build_filament_ams_list(MachineObject* obj);
|
std::map<int, DynamicPrintConfig> build_filament_ams_list(MachineObject* obj);
|
||||||
void sync_ams_list(bool is_from_big_sync_btn = false);
|
void sync_ams_list(bool is_from_big_sync_btn = false);
|
||||||
bool sync_extruder_list();
|
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 update_sync_status(const MachineObject* obj);
|
||||||
void get_big_btn_sync_pos_size(wxPoint &pt, wxSize &size);
|
void get_big_btn_sync_pos_size(wxPoint &pt, wxSize &size);
|
||||||
void get_small_btn_sync_pos_size(wxPoint &pt, wxSize &size);
|
void get_small_btn_sync_pos_size(wxPoint &pt, wxSize &size);
|
||||||
@@ -219,11 +219,16 @@ public:
|
|||||||
Search::OptionsSearcher& get_searcher();
|
Search::OptionsSearcher& get_searcher();
|
||||||
std::string& get_search_line();
|
std::string& get_search_line();
|
||||||
void update_printer_thumbnail();
|
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:
|
private:
|
||||||
struct priv;
|
struct priv;
|
||||||
std::unique_ptr<priv> p;
|
std::unique_ptr<priv> p;
|
||||||
|
|
||||||
wxBoxSizer* m_scrolled_sizer = nullptr;
|
wxBoxSizer* m_scrolled_sizer = nullptr;
|
||||||
|
bool m_need_auto_sync_after_connect_printer{false};
|
||||||
};
|
};
|
||||||
|
|
||||||
class Plater: public wxPanel
|
class Plater: public wxPanel
|
||||||
|
|||||||
Reference in New Issue
Block a user