ENH: Add automatic slicing behavior for some steps

jira: none
Change-Id: If94726eee45724985b3b49b36695086da24f7848
(cherry picked from commit 0476a83264660841c5601168ab6f11a9c70411ff)
This commit is contained in:
zhimin.zeng
2024-11-19 14:40:43 +08:00
committed by Noisyfox
parent 0b014edecd
commit ac19851e52
3 changed files with 20 additions and 7 deletions

View File

@@ -4408,7 +4408,7 @@ void GCodeViewer::render_legend_color_arr_recommen(float window_padding)
Plater *plater = wxGetApp().plater();
wxCommandEvent evt(EVT_OPEN_FILAMENT_MAP_SETTINGS_DIALOG);
evt.SetEventObject(plater);
evt.SetInt(0);
evt.SetInt(0b0010); //0010 means from gcode view, manual mode
wxPostEvent(plater, evt);
}
}

View File

@@ -8496,6 +8496,8 @@ bool Plater::priv::check_ams_status_impl()
dlg.Fit();
if (dlg.ShowModal() == wxID_YES) {
GUI::wxGetApp().sidebar().sync_extruder_list();
wxPostEvent(q, SimpleEvent(EVT_GLTOOLBAR_SLICE_PLATE));
wxGetApp().mainframe->m_tabpanel->SetSelection(MainFrame::TabPosition::tpPreview);
return false;
}
}
@@ -14753,12 +14755,14 @@ void Plater::open_platesettings_dialog(wxCommandEvent& evt) {
void Plater::open_filament_map_setting_dialog(wxCommandEvent &evt)
{
PartPlate* curr_plate = p->partplate_list.get_curr_plate();
int is_auto = evt.GetInt();
int value = evt.GetInt();
bool is_auto = value & 1; //0000 means manual, 0001 means auto
bool need_slice = value & (1 << 1); //0010 means from gcode view, 0000 means not from gcode view
FilamentMapDialog filament_dlg(this,
config(),
curr_plate->get_filament_maps(),
curr_plate->get_extruders(true),
is_auto==1,
is_auto,
curr_plate->has_auto_filament_map_reslut()
);
if (filament_dlg.ShowModal() == wxID_OK) {
@@ -14782,9 +14786,14 @@ void Plater::open_filament_map_setting_dialog(wxCommandEvent &evt)
need_invalidate = true;
}
if (need_invalidate) {
curr_plate->update_slice_result_valid_state(false);
set_plater_dirty(true);
update();
if (need_slice) {
wxPostEvent(this, SimpleEvent(EVT_GLTOOLBAR_SLICE_PLATE));
}
else {
curr_plate->update_slice_result_valid_state(false);
set_plater_dirty(true);
update();
}
}
}
return;
@@ -14952,7 +14961,7 @@ int Plater::select_plate_by_hover_id(int hover_id, bool right_click, bool isModi
if (!ret) {
PartPlate * curr_plate = p->partplate_list.get_curr_plate();
wxCommandEvent evt(EVT_OPEN_FILAMENT_MAP_SETTINGS_DIALOG);
evt.SetInt(curr_plate->get_filament_map_mode()==FilamentMapMode::fmmAuto);
evt.SetInt(curr_plate->get_filament_map_mode()==FilamentMapMode::fmmAuto ? 1 : 0);
evt.SetEventObject(this);
wxPostEvent(this, evt);
} else {

View File

@@ -91,6 +91,10 @@ enum class ActionButtonType : int;
wxDECLARE_EVENT(EVT_SLICING_UPDATE, Slic3r::SlicingStatusEvent);
wxDECLARE_EVENT(EVT_PUBLISH, wxCommandEvent);
wxDECLARE_EVENT(EVT_OPEN_PLATESETTINGSDIALOG, wxCommandEvent);
// Explanation of int param
// Bit 0: 1 = automatic mode, 0 = manual mode.
// Bit 1: 1 = need auto slicing(from preview page), 0 = not need auto slicing.
wxDECLARE_EVENT(EVT_OPEN_FILAMENT_MAP_SETTINGS_DIALOG, wxCommandEvent);
wxDECLARE_EVENT(EVT_REPAIR_MODEL, wxCommandEvent);
wxDECLARE_EVENT(EVT_FILAMENT_COLOR_CHANGED, wxCommandEvent);