#include </home/runner/work/OrcaSlicer/OrcaSlicer/src/slic3r/GUI/BackgroundSlicingProcess.hpp>
Classes | |
| struct | UITask |
Public Types | |
| enum | State { STATE_INITIAL = 0 , STATE_IDLE , STATE_STARTED , STATE_RUNNING , STATE_FINISHED , STATE_CANCELED , STATE_EXIT , STATE_EXITED } |
Private Member Functions | |
| void | thread_proc () |
| void | thread_proc_safe () throw () |
| void | join_background_thread () |
| void | stop_internal () |
| void | process_fff () |
| void | process_sla () |
| void | call_process (std::exception_ptr &ex) throw () |
| bool | set_step_started (BackgroundSlicingProcessStep step) |
| void | set_step_done (BackgroundSlicingProcessStep step) |
| bool | is_step_done (BackgroundSlicingProcessStep step) const |
| bool | invalidate_step (BackgroundSlicingProcessStep step) |
| bool | invalidate_all_steps () |
| void | throw_if_canceled () const |
| void | finalize_gcode () |
| void | export_gcode () |
| void | prepare_upload () |
| ThumbnailsList | render_thumbnails (const ThumbnailsParams ¶ms) |
| bool | execute_ui_task (std::function< void()> task) |
Static Private Member Functions | |
| static void | cancel_ui_task (std::shared_ptr< BackgroundSlicingProcess::UITask > task) |
Private Attributes | |
| PrintBase * | m_print = nullptr |
| Print * | m_fff_print = nullptr |
| SLAPrint * | m_sla_print = nullptr |
| GCodeProcessorResult * | m_gcode_result = nullptr |
| ThumbnailsGeneratorCallback | m_thumbnail_cb = nullptr |
| SL1Archive | m_sla_archive |
| std::string | m_temp_output_path |
| std::string | m_export_path |
| bool | m_export_path_on_removable_media = false |
| bool | m_export_statistics = false |
| PrintHostJob | m_upload_job |
| boost::thread | m_thread |
| std::mutex | m_mutex |
| std::condition_variable | m_condition |
| State | m_state = STATE_INITIAL |
| std::shared_ptr< UITask > | m_ui_task |
| GUI::PartPlate * | m_current_plate |
| PrinterTechnology | m_printer_tech = ptUnknown |
| bool | m_internal_cancelled = false |
| PrintState< BackgroundSlicingProcessStep, bspsCount > | m_step_state |
| int | m_event_slicing_completed_id = 0 |
| int | m_event_finished_id = 0 |
| int | m_event_export_began_id = 0 |
| int | m_event_export_finished_id = 0 |
Friends | |
| class | GUI::Plater |
| Enumerator | |
|---|---|
| STATE_INITIAL | |
| STATE_IDLE | |
| STATE_STARTED | |
| STATE_RUNNING | |
| STATE_FINISHED | |
| STATE_CANCELED | |
| STATE_EXIT | |
| STATE_EXITED | |
| Slic3r::BackgroundSlicingProcess::BackgroundSlicingProcess | ( | ) |
References Slic3r::get_current_pid(), and m_temp_output_path.
| Slic3r::BackgroundSlicingProcess::~BackgroundSlicingProcess | ( | ) |
References join_background_thread(), and stop().
| Print::ApplyStatus Slic3r::BackgroundSlicingProcess::apply | ( | const Model & | model, |
| const DynamicPrintConfig & | config ) |
References Slic3r::ConfigBase::apply(), Slic3r::PrintBase::APPLY_STATUS_INVALIDATED, Slic3r::PrintBase::APPLY_STATUS_UNCHANGED, m_current_plate, m_fff_print, m_gcode_result, m_print, Slic3r::DynamicConfig::opt_enum(), Slic3r::psGCodeExport, and Slic3r::ptFFF.
|
private | |||||||||||||
References m_print, process_fff(), process_sla(), Slic3r::ptFFF, and Slic3r::ptSLA.
Referenced by thread_proc().
| bool Slic3r::BackgroundSlicingProcess::can_switch_print | ( | ) |
References m_current_plate, m_state, and STATE_RUNNING.
|
staticprivate |
References Slic3r::BackgroundSlicingProcess::UITask::Canceled.
Referenced by stop(), and stop_internal().
|
inline |
References m_print.
Referenced by Slic3r::GUI::Plater::priv::on_process_completed(), prepare_upload(), process_sla(), and Slic3r::GUI::Plater::priv::update_background_process().
| PrinterTechnology Slic3r::BackgroundSlicingProcess::current_printer_technology | ( | ) | const |
References m_printer_tech.
| bool Slic3r::BackgroundSlicingProcess::empty | ( | ) | const |
References m_print.
Referenced by Slic3r::GUI::Plater::priv::on_process_completed(), and Slic3r::GUI::Plater::priv::restart_background_process().
|
private |
References Slic3r::BackgroundSlicingProcess::UITask::Canceled, Slic3r::BackgroundSlicingProcess::UITask::Finished, m_mutex, m_print, m_ui_task, Slic3r::BackgroundSlicingProcess::UITask::Planned, and running().
Referenced by render_thumbnails().
|
private |
References _utf8, Slic3r::copy_file(), Slic3r::export_gcode_statistics(), Slic3r::FAIL_CHECK_ORIGIN_NOT_OPENED, Slic3r::FAIL_CHECK_TARGET_NOT_OPENED, Slic3r::FAIL_COPY_FILE, Slic3r::FAIL_FILES_DIFFERENT, Slic3r::FAIL_RENAMING, Slic3r::gcode_add_line_number(), Slic3r::gcode_statistics_path(), L, m_event_export_finished_id, m_export_path, m_export_path_on_removable_media, m_export_statistics, m_fff_print, m_gcode_result, m_temp_output_path, and Slic3r::SUCCESS.
Referenced by process_fff().
|
inline |
References m_fff_print.
|
inline |
References m_fff_print.
Referenced by Slic3r::GUI::Plater::priv::update_fff_scene_only_shells().
|
private |
References _L, _u8L, _utf8, Slic3r::copy_file(), Slic3r::export_gcode_statistics(), Slic3r::FAIL_CHECK_ORIGIN_NOT_OPENED, Slic3r::FAIL_CHECK_TARGET_NOT_OPENED, Slic3r::FAIL_COPY_FILE, Slic3r::FAIL_FILES_DIFFERENT, Slic3r::FAIL_RENAMING, Slic3r::GUI::format(), Slic3r::gcode_statistics_path(), L, m_export_path, m_export_path_on_removable_media, m_export_statistics, m_fff_print, m_gcode_result, m_print, m_temp_output_path, Slic3r::run_post_process_scripts(), and Slic3r::SUCCESS.
Referenced by process_fff().
|
inline |
References m_gcode_result, and m_print.
|
inline |
References m_gcode_result.
Referenced by Slic3r::DevNozzleMappingCtrl::CtrlGetAutoNozzleMappingV0(), and Slic3r::DevUtilBackend::GetNozzleGroupResult().
|
inline |
References m_current_plate.
Referenced by Slic3r::GUI::Plater::priv::on_process_completed(), process_fff(), Slic3r::GUI::Plater::priv::set_current_panel(), and Slic3r::GUI::Plater::priv::update_background_process().
|
inline |
References m_state, and STATE_IDLE.
Referenced by Slic3r::GUI::Plater::priv::init_notification_manager(), and start().
|
private |
References m_step_state, and stop_internal().
Referenced by reset().
|
private |
References m_step_state, and stop_internal().
Referenced by reset_export(), schedule_export(), and schedule_upload().
|
inline |
References m_export_path.
Referenced by Slic3r::GUI::Plater::priv::object_list_changed(), and Slic3r::GUI::Plater::priv::set_current_panel().
|
inline |
References m_internal_cancelled.
Referenced by Slic3r::GUI::Plater::priv::update_background_process().
|
private |
References m_print, and m_step_state.
|
inline |
References m_upload_job.
|
private |
References m_condition, m_mutex, m_state, m_thread, STATE_EXIT, STATE_IDLE, and STATE_INITIAL.
Referenced by ~BackgroundSlicingProcess().
| std::string Slic3r::BackgroundSlicingProcess::output_filepath_for_project | ( | const boost::filesystem::path & | project_path | ) |
|
private |
References _utf8, Slic3r::copy_file(), current_print(), Slic3r::PrintBase::full_print_config(), L, m_fff_print, m_print, m_sla_archive, m_sla_print, m_temp_output_path, m_upload_job, Slic3r::ConfigBase::option(), Slic3r::post_process(), render_thumbnails(), Slic3r::run_post_process_scripts(), Slic3r::SUCCESS, and Slic3r::write_thumbnail().
Referenced by process_fff().
|
private |
References _utf8, Slic3r::bspsGCodeFinalize, export_gcode(), finalize_gcode(), Slic3r::fmmManual, Slic3r::fmmNozzleManual, get_current_plate(), Slic3r::GUI::PartPlate::get_tmp_gcode_path(), Slic3r::PresetBundle::is_bbl_vendor(), L, m_current_plate, m_event_export_began_id, m_event_slicing_completed_id, m_export_path, m_fff_print, m_gcode_result, m_print, m_temp_output_path, m_upload_job, prepare_upload(), Slic3r::PresetBundle::project_config, Slic3r::psSlicingFinished, render_thumbnails(), Slic3r::run_post_process_scripts(), set_step_done(), and set_step_started().
Referenced by call_process().
|
private |
References _utf8, Slic3r::bspsGCodeFinalize, current_print(), Slic3r::PrintBase::full_print_config(), m_event_export_began_id, m_export_path, m_print, m_sla_archive, m_sla_print, Slic3r::ConfigBase::option(), render_thumbnails(), set_step_done(), set_step_started(), and Slic3r::write_thumbnail().
Referenced by call_process().
|
private |
References execute_ui_task(), and m_thumbnail_cb.
Referenced by prepare_upload(), process_fff(), and process_sla().
| bool Slic3r::BackgroundSlicingProcess::reset | ( | ) |
References invalidate_all_steps(), reset_export(), and stop().
Referenced by Slic3r::GUI::Plater::priv::reset(), and select_technology().
| void Slic3r::BackgroundSlicingProcess::reset_export | ( | ) |
References Slic3r::bspsGCodeFinalize, invalidate_step(), m_export_path, m_export_path_on_removable_media, m_print, and running().
Referenced by Slic3r::GUI::Plater::priv::on_process_completed(), and reset().
|
inline |
References m_state, STATE_CANCELED, STATE_FINISHED, STATE_RUNNING, and STATE_STARTED.
Referenced by execute_ui_task(), reset_export(), Slic3r::GUI::Plater::priv::set_current_panel(), start(), Slic3r::GUI::Plater::priv::trigger_auto_reslice_now(), and Slic3r::GUI::Plater::priv::update_background_process().
| void Slic3r::BackgroundSlicingProcess::schedule_export | ( | const std::string & | path, |
| bool | export_path_on_removable_media ) |
References Slic3r::bspsGCodeFinalize, invalidate_step(), m_export_path, m_export_path_on_removable_media, m_export_statistics, and m_print.
| void Slic3r::BackgroundSlicingProcess::schedule_upload | ( | Slic3r::PrintHostJob | upload_job | ) |
References Slic3r::bspsGCodeFinalize, invalidate_step(), m_export_path, m_print, and m_upload_job.
| bool Slic3r::BackgroundSlicingProcess::select_technology | ( | PrinterTechnology | tech | ) |
References m_fff_print, m_print, m_printer_tech, m_sla_print, Slic3r::ptFFF, Slic3r::ptSLA, and reset().
|
inline |
References m_current_plate.
|
inline |
References m_event_export_began_id.
|
inline |
References m_event_export_finished_id.
|
inline |
References m_fff_print.
|
inline |
References m_event_finished_id.
|
inline |
References m_gcode_result.
|
inline |
References m_sla_archive, and m_sla_print.
|
inline |
References m_event_slicing_completed_id.
|
private |
References m_print, and m_step_state.
Referenced by process_fff(), and process_sla().
|
private |
References m_print, and m_step_state.
Referenced by process_fff(), and process_sla().
| void Slic3r::BackgroundSlicingProcess::set_task | ( | const PrintBase::TaskParams & | params | ) |
References m_print.
Referenced by Slic3r::GUI::Plater::priv::export_gcode(), and Slic3r::GUI::Plater::priv::export_gcode().
|
inline |
References m_thumbnail_cb.
|
inline |
References m_sla_print.
| bool Slic3r::BackgroundSlicingProcess::start | ( | ) |
References Slic3r::create_thread(), idle(), m_condition, m_current_plate, m_mutex, m_print, m_state, m_thread, running(), STATE_IDLE, STATE_INITIAL, STATE_STARTED, stop_internal(), and thread_proc_safe().
Referenced by Slic3r::GUI::Plater::priv::restart_background_process().
|
inline |
| bool Slic3r::BackgroundSlicingProcess::stop | ( | ) |
References cancel_ui_task(), m_condition, m_mutex, m_print, m_state, m_ui_task, STATE_CANCELED, STATE_FINISHED, STATE_IDLE, STATE_INITIAL, STATE_RUNNING, and STATE_STARTED.
Referenced by ~BackgroundSlicingProcess(), Slic3r::GUI::Plater::priv::init_notification_manager(), Slic3r::GUI::Plater::priv::on_process_completed(), reset(), and Slic3r::GUI::Plater::priv::reset().
|
private |
References cancel_ui_task(), m_condition, m_mutex, m_print, m_state, m_ui_task, STATE_CANCELED, STATE_FINISHED, STATE_IDLE, STATE_RUNNING, and STATE_STARTED.
Referenced by invalidate_all_steps(), invalidate_step(), and start().
| bool Slic3r::BackgroundSlicingProcess::switch_print_preprocess | ( | ) |
|
private |
References call_process(), Slic3r::PrintBase::CANCELED_INTERNAL, Slic3r::SlicingProcessCompletedEvent::Cancelled, Slic3r::SlicingProcessCompletedEvent::Clone(), Slic3r::SlicingProcessCompletedEvent::Error, Slic3r::SlicingProcessCompletedEvent::Finished, m_condition, m_event_finished_id, m_fff_print, m_internal_cancelled, m_mutex, m_print, m_sla_print, m_state, Slic3r::name_tbb_thread_pool_threads_set_locale(), Slic3r::set_current_thread_name(), STATE_CANCELED, STATE_EXIT, STATE_EXITED, STATE_FINISHED, STATE_IDLE, STATE_RUNNING, STATE_STARTED, and Slic3r::SlicingProcessCompletedEvent::status().
Referenced by thread_proc_safe().
|
private | ||||||||||||
References thread_proc().
Referenced by start().
|
inlineprivate |
| StringObjectException Slic3r::BackgroundSlicingProcess::validate | ( | std::vector< StringObjectException > * | warnings = nullptr, |
| Polygons * | collison_polygons = nullptr, | ||
| std::vector< std::pair< Polygon, float > > * | height_polygons = nullptr ) |
References m_fff_print, and m_print.
|
friend |
|
private |
Referenced by join_background_thread(), start(), stop(), stop_internal(), and thread_proc().
|
private |
Referenced by apply(), can_switch_print(), get_current_plate(), process_fff(), set_current_plate(), and start().
|
private |
Referenced by process_fff(), process_sla(), and set_export_began_event().
|
private |
Referenced by export_gcode(), and set_export_finished_event().
|
private |
Referenced by set_finished_event(), and thread_proc().
|
private |
Referenced by process_fff(), and set_slicing_completed_event().
|
private |
Referenced by export_gcode(), finalize_gcode(), is_export_scheduled(), process_fff(), process_sla(), reset_export(), schedule_export(), and schedule_upload().
|
private |
Referenced by export_gcode(), finalize_gcode(), reset_export(), and schedule_export().
|
private |
Referenced by export_gcode(), finalize_gcode(), and schedule_export().
Referenced by apply(), export_gcode(), fff_print(), fff_print(), finalize_gcode(), Slic3r::GUI::Plater::priv::generate_first_layer_bbox(), Slic3r::GUI::Plater::priv::on_process_completed(), Slic3r::GUI::Plater::priv::on_slicing_update(), prepare_upload(), process_fff(), select_technology(), set_fff_print(), thread_proc(), and validate().
|
private |
Referenced by apply(), export_gcode(), finalize_gcode(), finished(), get_current_gcode_result(), process_fff(), and set_gcode_result().
|
private |
Referenced by is_internal_cancelled(), and thread_proc().
|
private |
Referenced by execute_ui_task(), join_background_thread(), start(), stop(), stop_internal(), and thread_proc().
Referenced by apply(), call_process(), current_print(), empty(), execute_ui_task(), finalize_gcode(), finished(), is_step_done(), output_filepath_for_project(), prepare_upload(), process_fff(), process_sla(), reset_export(), schedule_export(), schedule_upload(), select_technology(), set_step_done(), set_step_started(), set_task(), start(), stop(), stop_internal(), thread_proc(), throw_if_canceled(), and validate().
|
private |
Referenced by current_printer_technology(), and select_technology().
|
private |
Referenced by prepare_upload(), process_sla(), and set_sla_print().
|
private |
Referenced by can_switch_print(), idle(), join_background_thread(), running(), start(), state(), stop(), stop_internal(), and thread_proc().
|
private |
Referenced by invalidate_all_steps(), invalidate_step(), is_step_done(), set_step_done(), and set_step_started().
|
private |
Referenced by BackgroundSlicingProcess(), export_gcode(), finalize_gcode(), prepare_upload(), and process_fff().
|
private |
Referenced by join_background_thread(), and start().
|
private |
Referenced by render_thumbnails(), and set_thumbnail_cb().
|
private |
Referenced by execute_ui_task(), stop(), and stop_internal().
|
private |
Referenced by is_upload_scheduled(), prepare_upload(), process_fff(), and schedule_upload().