mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-23 13:15:13 +00:00
ENH: Add automatic slicing behavior for some steps
jira: none Change-Id: If94726eee45724985b3b49b36695086da24f7848 (cherry picked from commit 0476a83264660841c5601168ab6f11a9c70411ff)
This commit is contained in:
@@ -4408,7 +4408,7 @@ void GCodeViewer::render_legend_color_arr_recommen(float window_padding)
|
|||||||
Plater *plater = wxGetApp().plater();
|
Plater *plater = wxGetApp().plater();
|
||||||
wxCommandEvent evt(EVT_OPEN_FILAMENT_MAP_SETTINGS_DIALOG);
|
wxCommandEvent evt(EVT_OPEN_FILAMENT_MAP_SETTINGS_DIALOG);
|
||||||
evt.SetEventObject(plater);
|
evt.SetEventObject(plater);
|
||||||
evt.SetInt(0);
|
evt.SetInt(0b0010); //0010 means from gcode view, manual mode
|
||||||
wxPostEvent(plater, evt);
|
wxPostEvent(plater, evt);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8496,6 +8496,8 @@ bool Plater::priv::check_ams_status_impl()
|
|||||||
dlg.Fit();
|
dlg.Fit();
|
||||||
if (dlg.ShowModal() == wxID_YES) {
|
if (dlg.ShowModal() == wxID_YES) {
|
||||||
GUI::wxGetApp().sidebar().sync_extruder_list();
|
GUI::wxGetApp().sidebar().sync_extruder_list();
|
||||||
|
wxPostEvent(q, SimpleEvent(EVT_GLTOOLBAR_SLICE_PLATE));
|
||||||
|
wxGetApp().mainframe->m_tabpanel->SetSelection(MainFrame::TabPosition::tpPreview);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -14753,12 +14755,14 @@ void Plater::open_platesettings_dialog(wxCommandEvent& evt) {
|
|||||||
void Plater::open_filament_map_setting_dialog(wxCommandEvent &evt)
|
void Plater::open_filament_map_setting_dialog(wxCommandEvent &evt)
|
||||||
{
|
{
|
||||||
PartPlate* curr_plate = p->partplate_list.get_curr_plate();
|
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,
|
FilamentMapDialog filament_dlg(this,
|
||||||
config(),
|
config(),
|
||||||
curr_plate->get_filament_maps(),
|
curr_plate->get_filament_maps(),
|
||||||
curr_plate->get_extruders(true),
|
curr_plate->get_extruders(true),
|
||||||
is_auto==1,
|
is_auto,
|
||||||
curr_plate->has_auto_filament_map_reslut()
|
curr_plate->has_auto_filament_map_reslut()
|
||||||
);
|
);
|
||||||
if (filament_dlg.ShowModal() == wxID_OK) {
|
if (filament_dlg.ShowModal() == wxID_OK) {
|
||||||
@@ -14782,11 +14786,16 @@ void Plater::open_filament_map_setting_dialog(wxCommandEvent &evt)
|
|||||||
need_invalidate = true;
|
need_invalidate = true;
|
||||||
}
|
}
|
||||||
if (need_invalidate) {
|
if (need_invalidate) {
|
||||||
|
if (need_slice) {
|
||||||
|
wxPostEvent(this, SimpleEvent(EVT_GLTOOLBAR_SLICE_PLATE));
|
||||||
|
}
|
||||||
|
else {
|
||||||
curr_plate->update_slice_result_valid_state(false);
|
curr_plate->update_slice_result_valid_state(false);
|
||||||
set_plater_dirty(true);
|
set_plater_dirty(true);
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -14952,7 +14961,7 @@ int Plater::select_plate_by_hover_id(int hover_id, bool right_click, bool isModi
|
|||||||
if (!ret) {
|
if (!ret) {
|
||||||
PartPlate * curr_plate = p->partplate_list.get_curr_plate();
|
PartPlate * curr_plate = p->partplate_list.get_curr_plate();
|
||||||
wxCommandEvent evt(EVT_OPEN_FILAMENT_MAP_SETTINGS_DIALOG);
|
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);
|
evt.SetEventObject(this);
|
||||||
wxPostEvent(this, evt);
|
wxPostEvent(this, evt);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -91,6 +91,10 @@ enum class ActionButtonType : int;
|
|||||||
wxDECLARE_EVENT(EVT_SLICING_UPDATE, Slic3r::SlicingStatusEvent);
|
wxDECLARE_EVENT(EVT_SLICING_UPDATE, Slic3r::SlicingStatusEvent);
|
||||||
wxDECLARE_EVENT(EVT_PUBLISH, wxCommandEvent);
|
wxDECLARE_EVENT(EVT_PUBLISH, wxCommandEvent);
|
||||||
wxDECLARE_EVENT(EVT_OPEN_PLATESETTINGSDIALOG, 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_OPEN_FILAMENT_MAP_SETTINGS_DIALOG, wxCommandEvent);
|
||||||
wxDECLARE_EVENT(EVT_REPAIR_MODEL, wxCommandEvent);
|
wxDECLARE_EVENT(EVT_REPAIR_MODEL, wxCommandEvent);
|
||||||
wxDECLARE_EVENT(EVT_FILAMENT_COLOR_CHANGED, wxCommandEvent);
|
wxDECLARE_EVENT(EVT_FILAMENT_COLOR_CHANGED, wxCommandEvent);
|
||||||
|
|||||||
Reference in New Issue
Block a user