mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-10-19 23:01:22 -06:00
ENH:optimize filament auto refill
Change-Id: I098ea5872061ba8c27e9240faa301db8fd3a1b82
This commit is contained in:
parent
85b44fbe1f
commit
c26961218a
6 changed files with 48 additions and 65 deletions
|
@ -1886,13 +1886,11 @@ AMSControl::AMSControl(wxWindow *parent, wxWindowID id, const wxPoint &pos, cons
|
|||
|
||||
|
||||
//backup tips
|
||||
|
||||
#ifdef FILAMENT_BACKUP
|
||||
auto m_ams_backup_tip = new Label(m_amswin, _L("Ams filament backup"));
|
||||
m_ams_backup_tip = new Label(m_amswin, _L("Auto Refill"));
|
||||
m_ams_backup_tip->SetFont(::Label::Head_12);
|
||||
m_ams_backup_tip->SetForegroundColour(wxColour(0x00AE42));
|
||||
m_ams_backup_tip->SetBackgroundColour(*wxWHITE);
|
||||
auto m_img_ams_backup = new wxStaticBitmap(m_amswin, wxID_ANY, create_scaled_bitmap("automatic_material_renewal", this, 16), wxDefaultPosition, wxSize(FromDIP(16), FromDIP(16)), 0);
|
||||
m_img_ams_backup = new wxStaticBitmap(m_amswin, wxID_ANY, create_scaled_bitmap("automatic_material_renewal", this, 16), wxDefaultPosition, wxSize(FromDIP(16), FromDIP(16)), 0);
|
||||
m_img_ams_backup->SetBackgroundColour(*wxWHITE);
|
||||
|
||||
m_sizer_ams_tips->Add(0, 0, 1, wxEXPAND, 0);
|
||||
|
@ -1907,11 +1905,8 @@ AMSControl::AMSControl(wxWindow *parent, wxWindowID id, const wxPoint &pos, cons
|
|||
|
||||
m_ams_backup_tip->Bind(wxEVT_LEFT_DOWN, [this](auto& e) {post_event(SimpleEvent(EVT_AMS_FILAMENT_BACKUP)); });
|
||||
m_img_ams_backup->Bind(wxEVT_LEFT_DOWN, [this](auto& e) {post_event(SimpleEvent(EVT_AMS_FILAMENT_BACKUP)); });
|
||||
#endif // FILAMENT_BACKUP
|
||||
|
||||
|
||||
|
||||
|
||||
//ams cans
|
||||
m_panel_can = new StaticBox(m_amswin, wxID_ANY, wxDefaultPosition, AMS_CANS_SIZE, wxBORDER_NONE);
|
||||
m_panel_can->SetMinSize(AMS_CANS_SIZE);
|
||||
|
@ -2656,8 +2651,15 @@ void AMSControl::show_noams_mode(bool show, bool support_virtual_tray, bool supp
|
|||
}
|
||||
|
||||
show?ExitNoneAMSMode() : EnterNoneAMSMode(support_vt_load);
|
||||
if (simple_mode)
|
||||
EnterSimpleMode();
|
||||
if (simple_mode)EnterSimpleMode();
|
||||
}
|
||||
|
||||
void AMSControl::show_auto_refill(bool show)
|
||||
{
|
||||
m_ams_backup_tip->Show(show);
|
||||
m_img_ams_backup->Show(show);
|
||||
m_amswin->Layout();
|
||||
m_amswin->Fit();
|
||||
}
|
||||
|
||||
void AMSControl::show_vams(bool show)
|
||||
|
@ -2697,10 +2699,6 @@ void AMSControl::update_vams_kn_value(AmsTray tray, MachineObject* obj)
|
|||
m_vams_lib->Refresh();
|
||||
}
|
||||
|
||||
void AMSControl::show_filament_backup(bool show)
|
||||
{
|
||||
}
|
||||
|
||||
void AMSControl::reset_vams()
|
||||
{
|
||||
m_vams_lib->m_info.k = 0;
|
||||
|
@ -2761,22 +2759,6 @@ void AMSControl::UpdateAms(std::vector<AMSinfo> info, bool keep_selection, bool
|
|||
}
|
||||
}
|
||||
|
||||
/*if (m_current_senect.empty() && info.size() > 0) {
|
||||
if (curr_ams_id.empty()) {
|
||||
SwitchAms(info[0].ams_id);
|
||||
return;
|
||||
}
|
||||
|
||||
if (keep_selection) {
|
||||
SwitchAms(curr_ams_id);
|
||||
for (auto i = 0; i < m_ams_cans_list.GetCount(); i++) {
|
||||
AmsCansWindow *cans = m_ams_cans_list[i];
|
||||
if (i < info.size()) { cans->amsCans->SelectCan(curr_can_id); }
|
||||
}
|
||||
return;
|
||||
}
|
||||
}*/
|
||||
|
||||
if ( m_current_show_ams.empty() && !is_reset ) {
|
||||
if (info.size() > 0) {
|
||||
SwitchAms(info[0].ams_id);
|
||||
|
|
|
@ -13,7 +13,6 @@
|
|||
#include <wx/animate.h>
|
||||
#include <wx/dynarray.h>
|
||||
|
||||
#define FILAMENT_BACKUP 1
|
||||
#define AMS_CONTROL_BRAND_COLOUR wxColour(0, 174, 66)
|
||||
#define AMS_CONTROL_GRAY700 wxColour(107, 107, 107)
|
||||
#define AMS_CONTROL_GRAY800 wxColour(50, 58, 61)
|
||||
|
@ -564,6 +563,7 @@ protected:
|
|||
wxBoxSizer* m_vams_sizer = {nullptr};
|
||||
wxBoxSizer* m_sizer_vams_tips = {nullptr};
|
||||
|
||||
Label* m_ams_backup_tip = {nullptr};
|
||||
Caninfo m_vams_info;
|
||||
StaticBox* m_panel_virtual = {nullptr};
|
||||
AMSLib* m_vams_lib = {nullptr};
|
||||
|
@ -583,6 +583,7 @@ protected:
|
|||
Button *m_button_extruder_feed = {nullptr};
|
||||
Button *m_button_extruder_back = {nullptr};
|
||||
wxStaticBitmap* m_button_ams_setting = {nullptr};
|
||||
wxStaticBitmap* m_img_ams_backup = {nullptr};
|
||||
ScalableBitmap m_button_ams_setting_normal;
|
||||
ScalableBitmap m_button_ams_setting_hover;
|
||||
ScalableBitmap m_button_ams_setting_press;
|
||||
|
@ -640,10 +641,10 @@ public:
|
|||
void Reset();
|
||||
|
||||
void show_noams_mode(bool show, bool support_virtual_tray, bool support_extrustion_cali, bool support_vt_load = false, bool simple_mode = false);
|
||||
void show_auto_refill(bool show);
|
||||
void show_vams(bool show);
|
||||
void show_vams_kn_value(bool show);
|
||||
void update_vams_kn_value(AmsTray tray, MachineObject* obj);
|
||||
void show_filament_backup(bool show);
|
||||
|
||||
void reset_vams();
|
||||
void post_event(wxEvent&& event);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue