mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2026-01-05 22:37:41 -07:00
Fix issue that filament is rolled back and forth when click ams slots
This commit is contained in:
parent
65936b34c1
commit
6e47c0c175
2 changed files with 22 additions and 1 deletions
|
|
@ -585,7 +585,7 @@ AMSControl::AMSControl(wxWindow *parent, wxWindowID id, const wxPoint &pos, cons
|
|||
|
||||
delete info;
|
||||
});
|
||||
|
||||
Bind(EVT_AMS_ON_SELECTED, &AMSControl::AmsSelectedSwitch, this);
|
||||
|
||||
m_button_guide->Bind(wxEVT_BUTTON, [this](wxCommandEvent& e) {
|
||||
post_event(wxCommandEvent(EVT_AMS_GUIDE_WIKI));
|
||||
|
|
@ -633,6 +633,26 @@ std::string AMSControl::GetCurrentCan(std::string amsid)
|
|||
return current_can;
|
||||
}
|
||||
|
||||
void AMSControl::AmsSelectedSwitch(wxCommandEvent& event) {
|
||||
std::string ams_id_selected = std::to_string(event.GetInt());
|
||||
if (m_current_ams != ams_id_selected){
|
||||
m_current_ams = ams_id_selected;
|
||||
}
|
||||
if (m_current_show_ams != ams_id_selected && m_current_show_ams != "") {
|
||||
auto item = m_ams_item_list[m_current_show_ams];
|
||||
if (!item) return;
|
||||
try{
|
||||
const auto& can_lib_list = item->get_can_lib_list();
|
||||
for (auto can : can_lib_list) {
|
||||
can.second->UnSelected();
|
||||
}
|
||||
}
|
||||
catch (...){
|
||||
;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
wxColour AMSControl::GetCanColour(std::string amsid, std::string canid)
|
||||
{
|
||||
wxColour col = *wxWHITE;
|
||||
|
|
|
|||
|
|
@ -112,6 +112,7 @@ public:
|
|||
AMSModel m_is_none_ams_mode{AMSModel::EXT_AMS};
|
||||
|
||||
void SetAmsModel(AMSModel mode, AMSModel ext_mode) {m_ams_model = mode; m_ext_model = ext_mode;};
|
||||
void AmsSelectedSwitch(wxCommandEvent& event);
|
||||
|
||||
void SetActionState(bool button_status[]);
|
||||
void EnterNoneAMSMode();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue