mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2026-02-17 18:02:20 -07: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:
parent
8267224756
commit
98f305f32c
4 changed files with 18 additions and 6 deletions
|
|
@ -830,6 +830,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())
|
||||
|
|
|
|||
|
|
@ -300,8 +300,9 @@ void MonitorPanel::on_update_all(wxMouseEvent &event)
|
|||
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();
|
||||
|
|
|
|||
|
|
@ -2637,7 +2637,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;
|
||||
|
|
@ -2649,10 +2649,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)
|
||||
|
|
|
|||
|
|
@ -171,7 +171,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);
|
||||
|
|
@ -219,11 +219,16 @@ public:
|
|||
Search::OptionsSearcher& get_searcher();
|
||||
std::string& get_search_line();
|
||||
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;
|
||||
|
||||
wxBoxSizer* m_scrolled_sizer = nullptr;
|
||||
bool m_need_auto_sync_after_connect_printer{false};
|
||||
};
|
||||
|
||||
class Plater: public wxPanel
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue