NEW:add ams guide wiki

Change-Id: I825f9dbbf3aa0a32eb5272b941179025ef2d35e2
This commit is contained in:
liz.li 2022-09-28 20:22:16 +08:00 committed by Lane.Wei
parent 12d0e0b7ea
commit 066a4d70c9
7 changed files with 82 additions and 13 deletions

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 40 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 6.5 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 40 KiB

View file

@ -1104,6 +1104,8 @@ StatusPanel::StatusPanel(wxWindow *parent, wxWindowID id, const wxPoint &pos, co
Bind(EVT_AMS_REFRESH_RFID, &StatusPanel::on_ams_refresh_rfid, this); Bind(EVT_AMS_REFRESH_RFID, &StatusPanel::on_ams_refresh_rfid, this);
Bind(EVT_AMS_ON_SELECTED, &StatusPanel::on_ams_selected, this); Bind(EVT_AMS_ON_SELECTED, &StatusPanel::on_ams_selected, this);
Bind(EVT_AMS_ON_FILAMENT_EDIT, &StatusPanel::on_filament_edit, this); Bind(EVT_AMS_ON_FILAMENT_EDIT, &StatusPanel::on_filament_edit, this);
Bind(EVT_AMS_GUIDE_WIKI, &StatusPanel::on_ams_guide, this);
Bind(EVT_AMS_RETRY, &StatusPanel::on_ams_retry, this);
m_switch_speed->Connect(wxEVT_LEFT_DOWN, wxCommandEventHandler(StatusPanel::on_switch_speed), NULL, this); m_switch_speed->Connect(wxEVT_LEFT_DOWN, wxCommandEventHandler(StatusPanel::on_switch_speed), NULL, this);
m_calibration_btn->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(StatusPanel::on_start_calibration), NULL, this); m_calibration_btn->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(StatusPanel::on_start_calibration), NULL, this);
@ -2266,6 +2268,16 @@ void StatusPanel::on_ams_selected(wxCommandEvent &event)
} }
} }
void StatusPanel::on_ams_guide(wxCommandEvent& event)
{
;// todo
}
void StatusPanel::on_ams_retry(wxCommandEvent& event)
{
;// todo
}
void StatusPanel::on_bed_temp_kill_focus(wxFocusEvent &event) void StatusPanel::on_bed_temp_kill_focus(wxFocusEvent &event)
{ {
event.Skip(); event.Skip();

View file

@ -306,6 +306,8 @@ protected:
void on_filament_edit(wxCommandEvent &event); void on_filament_edit(wxCommandEvent &event);
void on_ams_refresh_rfid(wxCommandEvent &event); void on_ams_refresh_rfid(wxCommandEvent &event);
void on_ams_selected(wxCommandEvent &event); void on_ams_selected(wxCommandEvent &event);
void on_ams_guide(wxCommandEvent &event);
void on_ams_retry(wxCommandEvent &event);
void on_switch_speed(wxCommandEvent &event); void on_switch_speed(wxCommandEvent &event);
void on_lamp_switch(wxCommandEvent &event); void on_lamp_switch(wxCommandEvent &event);

View file

@ -31,6 +31,8 @@ wxDEFINE_EVENT(EVT_AMS_ON_SELECTED, wxCommandEvent);
wxDEFINE_EVENT(EVT_AMS_ON_FILAMENT_EDIT, wxCommandEvent); wxDEFINE_EVENT(EVT_AMS_ON_FILAMENT_EDIT, wxCommandEvent);
wxDEFINE_EVENT(EVT_AMS_CLIBRATION_AGAIN, wxCommandEvent); wxDEFINE_EVENT(EVT_AMS_CLIBRATION_AGAIN, wxCommandEvent);
wxDEFINE_EVENT(EVT_AMS_CLIBRATION_CANCEL, wxCommandEvent); wxDEFINE_EVENT(EVT_AMS_CLIBRATION_CANCEL, wxCommandEvent);
wxDEFINE_EVENT(EVT_AMS_GUIDE_WIKI, wxCommandEvent);
wxDEFINE_EVENT(EVT_AMS_RETRY, wxCommandEvent);
inline int hex_digit_to_int(const char c) inline int hex_digit_to_int(const char c)
{ {
@ -1467,14 +1469,26 @@ AMSControl::AMSControl(wxWindow *parent, wxWindowID id, const wxPoint &pos, cons
m_simplebook_right->AddPage(m_filament_unload_step, wxEmptyString, false); m_simplebook_right->AddPage(m_filament_unload_step, wxEmptyString, false);
wxBoxSizer *m_sizer_right_bottom = new wxBoxSizer(wxHORIZONTAL); wxBoxSizer *m_sizer_right_bottom = new wxBoxSizer(wxHORIZONTAL);
m_sizer_right_bottom->Add(0, 0, 1, wxEXPAND, FromDIP(5)); m_button_ams_setting = new Button(m_amswin, "", "ams_setting_normal", wxBORDER_NONE, FromDIP(24));
m_button_ams_setting = new Button(m_amswin, _L("AMS Settings")); m_button_ams_setting->SetPaddingSize(wxSize(0, 0));
m_button_ams_setting->SetBackgroundColor(btn_bg_white); m_button_ams_setting->SetBackgroundColor(m_amswin->GetBackgroundColour());
m_button_ams_setting->SetBorderColor(btn_bd_white);
m_button_ams_setting->SetFont(Label::Body_13); m_button_guide = new Button(m_amswin, _L("Guide"));
//m_button_ams_setting->Hide(); m_button_guide->SetFont(Label::Body_13);
m_sizer_right_bottom->Add(m_button_ams_setting, 0, wxTOP, FromDIP(20)); m_button_guide->SetCornerRadius(FromDIP(12));
m_sizer_right->Add(m_sizer_right_bottom, 0, wxEXPAND, FromDIP(5)); m_button_guide->SetMinSize(wxSize(-1, FromDIP(24)));
m_button_guide->SetBackgroundColor(btn_bg_white);
m_button_retry = new Button(m_amswin, _L("Retry"));
m_button_retry->SetFont(Label::Body_13);
m_button_retry->SetCornerRadius(FromDIP(12));
m_button_retry->SetMinSize(wxSize(-1, FromDIP(24)));
m_button_retry->SetBackgroundColor(btn_bg_white);
m_sizer_right_bottom->Add(m_button_ams_setting, 0);
m_sizer_right_bottom->Add(m_button_guide, 0, wxLEFT, FromDIP(10));
m_sizer_right_bottom->Add(m_button_retry, 0, wxLEFT, FromDIP(10));
m_sizer_right->Add(m_sizer_right_bottom, 0, wxEXPAND | wxTOP, FromDIP(20));
m_sizer_bottom->Add(m_sizer_right, 0, wxEXPAND, FromDIP(5)); m_sizer_bottom->Add(m_sizer_right, 0, wxEXPAND, FromDIP(5));
m_sizer_body->Add(m_simplebook_amsitems, 0, wxEXPAND, 0); m_sizer_body->Add(m_simplebook_amsitems, 0, wxEXPAND, 0);
@ -1485,7 +1499,6 @@ AMSControl::AMSControl(wxWindow *parent, wxWindowID id, const wxPoint &pos, cons
m_amswin->SetSizer(m_sizer_body); m_amswin->SetSizer(m_sizer_body);
m_amswin->Layout(); m_amswin->Layout();
m_amswin->Fit(); m_amswin->Fit();
//Thaw(); //Thaw();
SetSize(m_amswin->GetSize()); SetSize(m_amswin->GetSize());
@ -1566,6 +1579,25 @@ AMSControl::AMSControl(wxWindow *parent, wxWindowID id, const wxPoint &pos, cons
m_button_extruder_feed->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(AMSControl::on_filament_load), NULL, this); m_button_extruder_feed->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(AMSControl::on_filament_load), NULL, this);
m_button_extruder_back->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(AMSControl::on_filament_unload), NULL, this); m_button_extruder_back->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(AMSControl::on_filament_unload), NULL, this);
m_button_ams_setting->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(AMSControl::on_ams_setting_click), NULL, this); m_button_ams_setting->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(AMSControl::on_ams_setting_click), NULL, this);
m_button_ams_setting->Bind(wxEVT_ENTER_WINDOW, [this](wxMouseEvent& e) {
m_button_ams_setting->SetIcon("ams_setting_hover");
e.Skip();
});
m_button_ams_setting->Bind(wxEVT_LEFT_DOWN, [this](wxMouseEvent& e) {
m_button_ams_setting->SetIcon("ams_setting_press");
e.Skip();
});
m_button_ams_setting->Bind(wxEVT_LEAVE_WINDOW, [this](wxMouseEvent&e) {
m_button_ams_setting->SetIcon("ams_setting_normal");
e.Skip();
});
m_button_guide->Bind(wxEVT_BUTTON, [this](wxCommandEvent& e) {
post_event(wxCommandEvent(EVT_AMS_GUIDE_WIKI));
});
m_button_retry->Bind(wxEVT_BUTTON, [this](wxCommandEvent& e) {
post_event(wxCommandEvent(EVT_AMS_RETRY));
});
CreateAms(); CreateAms();
SetSelection(0); SetSelection(0);
@ -1578,8 +1610,6 @@ void AMSControl::init_scaled_buttons()
m_button_extruder_feed->SetCornerRadius(FromDIP(12)); m_button_extruder_feed->SetCornerRadius(FromDIP(12));
m_button_extruder_back->SetMinSize(wxSize(-1, FromDIP(24))); m_button_extruder_back->SetMinSize(wxSize(-1, FromDIP(24)));
m_button_extruder_back->SetCornerRadius(FromDIP(12)); m_button_extruder_back->SetCornerRadius(FromDIP(12));
m_button_ams_setting->SetMinSize(wxSize(-1, FromDIP(33)));
m_button_ams_setting->SetCornerRadius(FromDIP(12));
} }
std::string AMSControl::GetCurentAms() { return m_current_ams; } std::string AMSControl::GetCurentAms() { return m_current_ams; }
@ -1709,7 +1739,9 @@ void AMSControl::msw_rescale()
m_extruder->msw_rescale(); m_extruder->msw_rescale();
m_button_extruder_back->SetMinSize(wxSize(-1, FromDIP(24))); m_button_extruder_back->SetMinSize(wxSize(-1, FromDIP(24)));
m_button_extruder_feed->SetMinSize(wxSize(-1, FromDIP(24))); m_button_extruder_feed->SetMinSize(wxSize(-1, FromDIP(24)));
m_button_ams_setting->SetMinSize(wxSize(-1, FromDIP(33))); m_button_ams_setting->SetMinSize(wxSize(FromDIP(25), FromDIP(24)));
m_button_guide->SetMinSize(wxSize(-1, FromDIP(24)));
m_button_retry->SetMinSize(wxSize(-1, FromDIP(24)));
for (auto i = 0; i < m_ams_cans_list.GetCount(); i++) { for (auto i = 0; i < m_ams_cans_list.GetCount(); i++) {
AmsCansWindow *cans = m_ams_cans_list[i]; AmsCansWindow *cans = m_ams_cans_list[i];

View file

@ -461,7 +461,9 @@ protected:
Button *m_button_extruder_feed = {nullptr}; Button *m_button_extruder_feed = {nullptr};
Button *m_button_extruder_back = {nullptr}; Button *m_button_extruder_back = {nullptr};
Button *m_button_ams_setting = {nullptr}; Button* m_button_ams_setting = {nullptr};
Button *m_button_guide = {nullptr};
Button *m_button_retry = {nullptr};
wxHyperlinkCtrl *m_hyperlink = {nullptr}; wxHyperlinkCtrl *m_hyperlink = {nullptr};
@ -518,6 +520,8 @@ wxDECLARE_EVENT(EVT_AMS_ON_SELECTED, wxCommandEvent);
wxDECLARE_EVENT(EVT_AMS_ON_FILAMENT_EDIT, wxCommandEvent); wxDECLARE_EVENT(EVT_AMS_ON_FILAMENT_EDIT, wxCommandEvent);
wxDECLARE_EVENT(EVT_AMS_CLIBRATION_AGAIN, wxCommandEvent); wxDECLARE_EVENT(EVT_AMS_CLIBRATION_AGAIN, wxCommandEvent);
wxDECLARE_EVENT(EVT_AMS_CLIBRATION_CANCEL, wxCommandEvent); wxDECLARE_EVENT(EVT_AMS_CLIBRATION_CANCEL, wxCommandEvent);
wxDECLARE_EVENT(EVT_AMS_GUIDE_WIKI, wxCommandEvent);
wxDECLARE_EVENT(EVT_AMS_RETRY, wxCommandEvent);
}} // namespace Slic3r::GUI }} // namespace Slic3r::GUI