mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-15 13:56:01 +08:00
Toolpath outside check during background processing at 3d view
This commit is contained in:
parent
012e987389
commit
9ea3b1356e
@ -661,13 +661,13 @@ void GCodeViewer::init()
|
||||
}
|
||||
#endif // ENABLE_SEAMS_USING_MODELS
|
||||
|
||||
void GCodeViewer::load(const GCodeProcessor::Result& gcode_result, const Print& print, bool initialized)
|
||||
void GCodeViewer::load(const GCodeProcessor::Result& gcode_result, const Print& print, bool initialized, bool save_result_id/* = true*/)
|
||||
{
|
||||
// avoid processing if called with the same gcode_result
|
||||
if (m_last_result_id == gcode_result.id)
|
||||
return;
|
||||
|
||||
m_last_result_id = gcode_result.id;
|
||||
if (save_result_id)
|
||||
m_last_result_id = gcode_result.id;
|
||||
|
||||
// release gpu memory, if used
|
||||
reset();
|
||||
|
@ -820,7 +820,7 @@ public:
|
||||
#endif // ENABLE_SEAMS_USING_MODELS
|
||||
|
||||
// extract rendering data from the given parameters
|
||||
void load(const GCodeProcessor::Result& gcode_result, const Print& print, bool initialized);
|
||||
void load(const GCodeProcessor::Result& gcode_result, const Print& print, bool initialized, bool save_result_id = true);
|
||||
// recalculate ranges in dependence of what is visible and sets tool/print colors
|
||||
void refresh(const GCodeProcessor::Result& gcode_result, const std::vector<std::string>& str_tool_colors);
|
||||
void refresh_render_paths();
|
||||
|
@ -2116,6 +2116,17 @@ void GLCanvas3D::load_gcode_preview(const GCodeProcessor::Result& gcode_result,
|
||||
request_extra_frame();
|
||||
}
|
||||
|
||||
void GLCanvas3D::check_toolpath(const GCodeProcessor::Result& gcode_result, const std::vector<std::string>& str_tool_colors)
|
||||
{
|
||||
m_gcode_viewer.load(gcode_result, *this->fff_print(), m_initialized, false);
|
||||
|
||||
if (wxGetApp().is_editor()) {
|
||||
//m_gcode_viewer.update_shells_color_by_extruder(m_config);
|
||||
_set_warning_notification_if_needed(EWarning::ToolpathOutside);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void GLCanvas3D::refresh_gcode_preview_render_paths()
|
||||
{
|
||||
m_gcode_viewer.refresh_render_paths();
|
||||
|
@ -738,6 +738,7 @@ public:
|
||||
void reload_scene(bool refresh_immediately, bool force_full_scene_refresh = false);
|
||||
|
||||
void load_gcode_preview(const GCodeProcessor::Result& gcode_result, const std::vector<std::string>& str_tool_colors);
|
||||
void check_toolpath(const GCodeProcessor::Result& gcode_result, const std::vector<std::string>& str_tool_colors);
|
||||
void refresh_gcode_preview_render_paths();
|
||||
void set_gcode_view_preview_type(GCodeViewer::EViewType type) { return m_gcode_viewer.set_view_type(type); }
|
||||
GCodeViewer::EViewType get_gcode_view_preview_type() const { return m_gcode_viewer.get_view_type(); }
|
||||
|
@ -974,6 +974,9 @@ void Preview::load_print_as_fff(bool keep_z_range)
|
||||
m_canvas_widget->Refresh();
|
||||
} else
|
||||
update_layers_slider(zs, keep_z_range);
|
||||
// if background processing is enabled, load gcode preview to check toolpath outside
|
||||
} else if (wxGetApp().app_config->get("background_processing") == "1" && gcode_preview_data_valid && wxGetApp().is_editor()) {
|
||||
m_canvas->check_toolpath(*m_gcode_result, colors);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user