Prusa Slicer 2.6.0
Loading...
Searching...
No Matches
Slic3r::BackgroundSlicingProcess Class Reference

#include <src/slic3r/GUI/BackgroundSlicingProcess.hpp>

+ Collaboration diagram for Slic3r::BackgroundSlicingProcess:

Classes

struct  UITask
 

Public Types

enum  State {
  STATE_INITIAL = 0 , STATE_IDLE , STATE_STARTED , STATE_RUNNING ,
  STATE_FINISHED , STATE_CANCELED , STATE_EXIT , STATE_EXITED
}
 

Public Member Functions

 BackgroundSlicingProcess ()
 
 ~BackgroundSlicingProcess ()
 
void set_fff_print (Print *print)
 
void set_sla_print (SLAPrint *print)
 
void set_thumbnail_cb (ThumbnailsGeneratorCallback cb)
 
void set_gcode_result (GCodeProcessorResult *result)
 
void set_slicing_completed_event (int event_id)
 
void set_finished_event (int event_id)
 
void set_export_began_event (int event_id)
 
bool select_technology (PrinterTechnology tech)
 
PrinterTechnology current_printer_technology () const
 
const PrintBasecurrent_print () const
 
const Printfff_print () const
 
const SLAPrintsla_print () const
 
std::string output_filepath_for_project (const boost::filesystem::path &project_path)
 
bool start ()
 
bool stop ()
 
bool reset ()
 
PrintBase::ApplyStatus apply (const Model &model, const DynamicPrintConfig &config)
 
void set_task (const PrintBase::TaskParams &params)
 
bool empty () const
 
std::string validate (std::vector< std::string > *warnings=nullptr)
 
void schedule_export (const std::string &path, bool export_path_on_removable_media)
 
void schedule_upload (Slic3r::PrintHostJob upload_job)
 
void reset_export ()
 
bool is_export_scheduled () const
 
bool is_upload_scheduled () const
 
State state () const
 
bool idle () const
 
bool running () const
 
bool finished () const
 

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 prepare_upload ()
 
ThumbnailsList render_thumbnails (const ThumbnailsParams &params)
 
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

PrintBasem_print = nullptr
 
Printm_fff_print = nullptr
 
SLAPrintm_sla_print = nullptr
 
GCodeProcessorResultm_gcode_result = nullptr
 
ThumbnailsGeneratorCallback m_thumbnail_cb = nullptr
 
std::string m_temp_output_path
 
std::string m_export_path
 
bool m_export_path_on_removable_media = 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< UITaskm_ui_task
 
PrintState< BackgroundSlicingProcessStep, bspsCountm_step_state
 
int m_event_slicing_completed_id = 0
 
int m_event_finished_id = 0
 
int m_event_export_began_id = 0
 

Detailed Description

Member Enumeration Documentation

◆ State

Enumerator
STATE_INITIAL 
STATE_IDLE 
STATE_STARTED 
STATE_RUNNING 
STATE_FINISHED 
STATE_CANCELED 
STATE_EXIT 
STATE_EXITED 
149 {
150 // m_thread is not running yet, or it did not reach the STATE_IDLE yet (it does not wait on the condition yet).
151 STATE_INITIAL = 0,
152 // m_thread is waiting for the task to execute.
155 // m_thread is executing a task.
157 // m_thread finished executing a task, and it is waiting until the UI thread picks up the results.
159 // m_thread finished executing a task, the task has been canceled by the UI thread, therefore the UI thread will not be notified.
161 // m_thread exited the loop and it is going to finish. The UI thread should join on m_thread.
164 };
@ STATE_EXITED
Definition BackgroundSlicingProcess.hpp:163
@ STATE_INITIAL
Definition BackgroundSlicingProcess.hpp:151
@ STATE_RUNNING
Definition BackgroundSlicingProcess.hpp:156
@ STATE_CANCELED
Definition BackgroundSlicingProcess.hpp:160
@ STATE_FINISHED
Definition BackgroundSlicingProcess.hpp:158
@ STATE_EXIT
Definition BackgroundSlicingProcess.hpp:162
@ STATE_IDLE
Definition BackgroundSlicingProcess.hpp:153
@ STATE_STARTED
Definition BackgroundSlicingProcess.hpp:154

Constructor & Destructor Documentation

◆ BackgroundSlicingProcess()

Slic3r::BackgroundSlicingProcess::BackgroundSlicingProcess ( )
99{
100 boost::filesystem::path temp_path(wxStandardPaths::Get().GetTempDir().utf8_str().data());
101 temp_path /= (boost::format(".%1%.gcode") % get_current_pid()).str();
102 m_temp_output_path = temp_path.string();
103}
std::string m_temp_output_path
Definition BackgroundSlicingProcess.hpp:223
unsigned get_current_pid()
Definition utils.cpp:924
constexpr auto data(C &c) -> decltype(c.data())
Definition span.hpp:195

References Slic3r::get_current_pid(), and m_temp_output_path.

+ Here is the call graph for this function:

◆ ~BackgroundSlicingProcess()

Slic3r::BackgroundSlicingProcess::~BackgroundSlicingProcess ( )
106{
107 this->stop();
109 boost::nowide::remove(m_temp_output_path.c_str());
110}
void join_background_thread()
Definition BackgroundSlicingProcess.cpp:374
bool stop()
Definition BackgroundSlicingProcess.cpp:426

References join_background_thread(), m_temp_output_path, and stop().

+ Here is the call graph for this function:

Member Function Documentation

◆ apply()

Print::ApplyStatus Slic3r::BackgroundSlicingProcess::apply ( const Model model,
const DynamicPrintConfig config 
)
561{
562 assert(m_print != nullptr);
563 assert(config.opt_enum<PrinterTechnology>("printer_technology") == m_print->technology());
564 Print::ApplyStatus invalidated = m_print->apply(model, config);
565 if ((invalidated & PrintBase::APPLY_STATUS_INVALIDATED) != 0 && m_print->technology() == ptFFF &&
567 // Some FFF status was invalidated, and the G-code was not exported yet.
568 // Let the G-code preview UI know that the final G-code preview is not valid.
569 // In addition, this early memory deallocation reduces memory footprint.
570 if (m_gcode_result != nullptr)
572 }
573 return invalidated;
574}
PrintBase * m_print
Definition BackgroundSlicingProcess.hpp:213
GCodeProcessorResult * m_gcode_result
Definition BackgroundSlicingProcess.hpp:218
Print * m_fff_print
Definition BackgroundSlicingProcess.hpp:215
ApplyStatus
Definition PrintBase.hpp:423
@ APPLY_STATUS_INVALIDATED
Definition PrintBase.hpp:430
virtual ApplyStatus apply(const Model &model, DynamicPrintConfig config)=0
virtual PrinterTechnology technology() const noexcept=0
bool is_step_done(PrintStep step) const
Definition Print.hpp:573
PrinterTechnology
Definition Config.hpp:205
@ ptFFF
Definition Config.hpp:207
@ psGCodeExport
Definition Print.hpp:64
void reset()
Definition GCodeProcessor.cpp:457

References Slic3r::PrintBase::apply(), Slic3r::PrintBase::APPLY_STATUS_INVALIDATED, Slic3r::Print::is_step_done(), m_fff_print, m_gcode_result, m_print, Slic3r::ConfigBase::opt_enum(), Slic3r::psGCodeExport, Slic3r::ptFFF, Slic3r::GCodeProcessorResult::reset(), and Slic3r::PrintBase::technology().

+ Here is the call graph for this function:

◆ call_process()

void Slic3r::BackgroundSlicingProcess::call_process ( std::exception_ptr &  ex)
throw (
)
private
323{
324 try {
325 assert(m_print != nullptr);
326 switch (m_print->technology()) {
327 case ptFFF: this->process_fff(); break;
328 case ptSLA: this->process_sla(); break;
329 default: m_print->process(); break;
330 }
331 } catch (CanceledException& /* ex */) {
332 // Canceled, this is all right.
333 assert(m_print->canceled());
334 ex = std::current_exception();
335 } catch (...) {
336 ex = std::current_exception();
337 }
338}
void process_fff()
Definition BackgroundSlicingProcess.cpp:144
void process_sla()
Definition BackgroundSlicingProcess.cpp:168
virtual void process()=0
bool canceled() const
Definition PrintBase.hpp:513
@ ptSLA
Definition Config.hpp:209

References Slic3r::ptFFF, and Slic3r::ptSLA.

Referenced by thread_proc().

+ Here is the caller graph for this function:

◆ cancel_ui_task()

void Slic3r::BackgroundSlicingProcess::cancel_ui_task ( std::shared_ptr< BackgroundSlicingProcess::UITask task)
staticprivate
537{
538 if (task) {
539 std::unique_lock<std::mutex> lck(task->mutex);
540 task->state = UITask::Canceled;
541 lck.unlock();
542 task->condition.notify_all();
543 }
544}
@ Canceled
Definition BackgroundSlicingProcess.hpp:246

References Slic3r::BackgroundSlicingProcess::UITask::Canceled.

Referenced by stop(), and stop_internal().

+ Here is the caller graph for this function:

◆ current_print()

const PrintBase * Slic3r::BackgroundSlicingProcess::current_print ( ) const
inline
109{ return m_print; }

References m_print.

Referenced by prepare_upload(), and process_sla().

+ Here is the caller graph for this function:

◆ current_printer_technology()

PrinterTechnology Slic3r::BackgroundSlicingProcess::current_printer_technology ( ) const
130{
131 return m_print->technology();
132}

References m_print, and Slic3r::PrintBase::technology().

Referenced by Slic3r::GUI::GLCanvas3D::current_printer_technology(), Slic3r::GUI::Preview::load_print(), Slic3r::GUI::Preview::load_print_as_fff(), Slic3r::GUI::Preview::load_print_as_sla(), and Slic3r::GUI::Preview::on_layers_slider_scroll_changed().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ empty()

bool Slic3r::BackgroundSlicingProcess::empty ( ) const
547{
548 assert(m_print != nullptr);
549 return m_print->empty();
550}
virtual bool empty() const =0

References Slic3r::PrintBase::empty(), and m_print.

+ Here is the call graph for this function:

◆ execute_ui_task()

bool Slic3r::BackgroundSlicingProcess::execute_ui_task ( std::function< void()>  task)
private
494{
495 bool running = false;
496 if (m_mutex.try_lock()) {
497 // Cancellation is either not in process, or already canceled and waiting for us to finish.
498 // There must be no UI task planned.
499 assert(! m_ui_task);
500 if (! m_print->canceled()) {
501 running = true;
502 m_ui_task = std::make_shared<UITask>();
503 }
504 m_mutex.unlock();
505 } else {
506 // Cancellation is in process.
507 }
508
509 bool result = false;
510 if (running) {
511 std::shared_ptr<UITask> ctx = m_ui_task;
512 GUI::wxGetApp().mainframe->m_plater->CallAfter([task, ctx]() {
513 // Running on the UI thread, thus ctx->state does not need to be guarded with mutex against ::cancel_ui_task().
514 assert(ctx->state == UITask::Planned || ctx->state == UITask::Canceled);
515 if (ctx->state == UITask::Planned) {
516 task();
517 std::unique_lock<std::mutex> lck(ctx->mutex);
518 ctx->state = UITask::Finished;
519 }
520 // Wake up the worker thread from the UI thread.
521 ctx->condition.notify_all();
522 });
523
524 {
525 std::unique_lock<std::mutex> lock(ctx->mutex);
526 ctx->condition.wait(lock, [&ctx]{ return ctx->state == UITask::Finished || ctx->state == UITask::Canceled; });
527 }
528 result = ctx->state == UITask::Finished;
529 m_ui_task.reset();
530 }
531
532 return result;
533}
std::shared_ptr< UITask > m_ui_task
Definition BackgroundSlicingProcess.hpp:254
std::mutex m_mutex
Definition BackgroundSlicingProcess.hpp:235
bool running() const
Definition BackgroundSlicingProcess.hpp:167
@ Finished
Definition BackgroundSlicingProcess.hpp:245
@ Planned
Definition BackgroundSlicingProcess.hpp:244

References Slic3r::PrintBase::canceled(), 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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fff_print()

const Print * Slic3r::BackgroundSlicingProcess::fff_print ( ) const
inline
110{ return m_fff_print; }

References m_fff_print.

Referenced by Slic3r::GUI::Preview::load_print_as_fff(), and Slic3r::GUI::GLCanvas3D::reload_scene().

+ Here is the caller graph for this function:

◆ finalize_gcode()

void Slic3r::BackgroundSlicingProcess::finalize_gcode ( )
private
651{
652 m_print->set_status(95, _u8L("Running post-processing scripts"));
653
654 // Perform the final post-processing of the export path by applying the print statistics over the file name.
656 std::string output_path = m_temp_output_path;
657 // Both output_path and export_path ar in-out parameters.
658 // If post processed, output_path will differ from m_temp_output_path as run_post_process_scripts() will make a copy of the G-code to not
659 // collide with the G-code viewer memory mapping of the unprocessed G-code. G-code viewer maps unprocessed G-code, because m_gcode_result
660 // is calculated for the unprocessed G-code and it references lines in the memory mapped G-code file by line numbers.
661 // export_path may be changed by the post-processing script as well if the post processing script decides so, see GH #6042.
662 bool post_processed = run_post_process_scripts(output_path, true, "File", export_path, m_fff_print->full_print_config());
663 auto remove_post_processed_temp_file = [post_processed, &output_path]() {
664 if (post_processed)
665 try {
666 boost::filesystem::remove(output_path);
667 } catch (const std::exception &ex) {
668 BOOST_LOG_TRIVIAL(error) << "Failed to remove temp file " << output_path << ": " << ex.what();
669 }
670 };
671
672 //FIXME localize the messages
673 std::string error_message;
674 int copy_ret_val = CopyFileResult::SUCCESS;
675 try
676 {
677 copy_ret_val = copy_file(output_path, export_path, error_message, m_export_path_on_removable_media);
678 remove_post_processed_temp_file();
679 }
680 catch (...)
681 {
682 remove_post_processed_temp_file();
683 throw Slic3r::ExportError(_u8L("Unknown error occured during exporting G-code."));
684 }
685 switch (copy_ret_val) {
686 case CopyFileResult::SUCCESS: break; // no error
688 throw Slic3r::ExportError(GUI::format(_L("Copying of the temporary G-code to the output G-code failed. Maybe the SD card is write locked?\nError message: %1%"), error_message));
689 break;
691 throw Slic3r::ExportError(GUI::format(_L("Copying of the temporary G-code to the output G-code failed. There might be problem with target device, please try exporting again or using different device. The corrupted output G-code is at %1%.tmp."), export_path));
692 break;
694 throw Slic3r::ExportError(GUI::format(_L("Renaming of the G-code after copying to the selected destination folder has failed. Current path is %1%.tmp. Please try exporting again."), export_path));
695 break;
697 throw Slic3r::ExportError(GUI::format(_L("Copying of the temporary G-code has finished but the original code at %1% couldn't be opened during copy check. The output G-code is at %2%.tmp."), output_path, export_path));
698 break;
700 throw Slic3r::ExportError(GUI::format(_L("Copying of the temporary G-code has finished but the exported code couldn't be opened during copy check. The output G-code is at %1%.tmp."), export_path));
701 break;
702 default:
703 throw Slic3r::ExportError(_u8L("Unknown error occured during exporting G-code."));
704 BOOST_LOG_TRIVIAL(error) << "Unexpected fail code(" << (int)copy_ret_val << ") durring copy_file() to " << export_path << ".";
705 break;
706 }
707
708 m_print->set_status(100, GUI::format(_L("G-code file exported to %1%"), export_path));
709}
#define _u8L(s)
macro used to mark string used at localization, return same string
Definition SLAPrint.cpp:29
std::string m_export_path
Definition BackgroundSlicingProcess.hpp:226
bool m_export_path_on_removable_media
Definition BackgroundSlicingProcess.hpp:227
void set_status(int percent, const std::string &message, unsigned int flags=SlicingStatus::DEFAULT)
Definition PrintBase.hpp:492
const DynamicPrintConfig & full_print_config() const
Definition PrintBase.hpp:523
const PrintStatistics & print_statistics() const
Definition Print.hpp:632
std::string format(const char *fmt, TArgs &&... args)
Definition format.hpp:56
CopyFileResult copy_file(const std::string &from, const std::string &to, std::string &error_message, const bool with_check)
Definition utils.cpp:707
@ FAIL_RENAMING
Definition Utils.hpp:84
@ FAIL_COPY_FILE
Definition Utils.hpp:82
@ FAIL_CHECK_ORIGIN_NOT_OPENED
Definition Utils.hpp:85
@ FAIL_FILES_DIFFERENT
Definition Utils.hpp:83
@ SUCCESS
Definition Utils.hpp:81
@ FAIL_CHECK_TARGET_NOT_OPENED
Definition Utils.hpp:86
bool run_post_process_scripts(std::string &src_path, bool make_copy, const std::string &host, std::string &output_name, const DynamicPrintConfig &config)
Definition PostProcessor.cpp:198
#define _L(s)
Definition I18N.hpp:3
std::string finalize_output_path(const std::string &path_in) const
Definition Print.cpp:1585
static char error[256]
Definition tga.cpp:50

References _L, _u8L, Slic3r::copy_file(), error, Slic3r::FAIL_CHECK_ORIGIN_NOT_OPENED, Slic3r::FAIL_CHECK_TARGET_NOT_OPENED, Slic3r::FAIL_COPY_FILE, Slic3r::FAIL_FILES_DIFFERENT, Slic3r::FAIL_RENAMING, Slic3r::PrintStatistics::finalize_output_path(), Slic3r::GUI::format(), Slic3r::PrintBase::full_print_config(), m_export_path, m_export_path_on_removable_media, m_fff_print, m_print, m_temp_output_path, Slic3r::Print::print_statistics(), Slic3r::run_post_process_scripts(), Slic3r::PrintBase::set_status(), and Slic3r::SUCCESS.

Referenced by process_fff().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ finished()

bool Slic3r::BackgroundSlicingProcess::finished ( ) const
inline
172{ return m_print->finished(); }
virtual bool finished() const =0

References Slic3r::PrintBase::finished(), and m_print.

+ Here is the call graph for this function:

◆ idle()

bool Slic3r::BackgroundSlicingProcess::idle ( ) const
inline
166{ return m_state == STATE_IDLE; }
State m_state
Definition BackgroundSlicingProcess.hpp:237

References m_state, and STATE_IDLE.

Referenced by start().

+ Here is the caller graph for this function:

◆ invalidate_all_steps()

bool Slic3r::BackgroundSlicingProcess::invalidate_all_steps ( )
private
643{
644 return m_step_state.invalidate_all([this](){ this->stop_internal(); });
645}
PrintState< BackgroundSlicingProcessStep, bspsCount > m_step_state
Definition BackgroundSlicingProcess.hpp:256
void stop_internal()
Definition BackgroundSlicingProcess.cpp:465
bool invalidate_all(CancelationCallback cancel)
Definition PrintBase.hpp:279

References Slic3r::PrintState< StepType, COUNT >::invalidate_all(), m_step_state, and stop_internal().

Referenced by reset().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ invalidate_step()

bool Slic3r::BackgroundSlicingProcess::invalidate_step ( BackgroundSlicingProcessStep  step)
private
637{
638 bool invalidated = m_step_state.invalidate(step, [this](){ this->stop_internal(); });
639 return invalidated;
640}
bool invalidate(StepType step, CancelationCallback cancel)
Definition PrintBase.hpp:227

References Slic3r::PrintState< StepType, COUNT >::invalidate(), m_step_state, and stop_internal().

Referenced by reset_export(), schedule_export(), and schedule_upload().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ is_export_scheduled()

bool Slic3r::BackgroundSlicingProcess::is_export_scheduled ( ) const
inline
146{ return ! m_export_path.empty(); }

References m_export_path.

◆ is_step_done()

bool Slic3r::BackgroundSlicingProcess::is_step_done ( BackgroundSlicingProcessStep  step) const
private
632{
633 return m_step_state.is_done(step, m_print->state_mutex());
634}
std::mutex & state_mutex() const
Definition PrintBase.hpp:534
bool is_done(StepType step, std::mutex &mtx) const
Definition PrintBase.hpp:134

References Slic3r::PrintState< StepType, COUNT >::is_done(), m_print, m_step_state, and Slic3r::PrintBase::state_mutex().

+ Here is the call graph for this function:

◆ is_upload_scheduled()

bool Slic3r::BackgroundSlicingProcess::is_upload_scheduled ( ) const
inline
147{ return ! m_upload_job.empty(); }
PrintHostJob m_upload_job
Definition BackgroundSlicingProcess.hpp:230
bool empty() const
Definition PrintHost.hpp:105

References Slic3r::PrintHostJob::empty(), and m_upload_job.

+ Here is the call graph for this function:

◆ join_background_thread()

void Slic3r::BackgroundSlicingProcess::join_background_thread ( )
private
375{
376 std::unique_lock<std::mutex> lck(m_mutex);
377 if (m_state == STATE_INITIAL) {
378 // Worker thread has not been started yet.
379 assert(! m_thread.joinable());
380 } else {
381 assert(m_state == STATE_IDLE);
382 assert(m_thread.joinable());
383 // Notify the worker thread to exit.
385 lck.unlock();
386 m_condition.notify_one();
387 // Wait until the worker thread exits.
388 m_thread.join();
389 }
390}
std::condition_variable m_condition
Definition BackgroundSlicingProcess.hpp:236
boost::thread m_thread
Definition BackgroundSlicingProcess.hpp:233

References m_condition, m_mutex, m_state, m_thread, STATE_EXIT, STATE_IDLE, and STATE_INITIAL.

Referenced by ~BackgroundSlicingProcess().

+ Here is the caller graph for this function:

◆ output_filepath_for_project()

std::string Slic3r::BackgroundSlicingProcess::output_filepath_for_project ( const boost::filesystem::path &  project_path)
135{
136 assert(m_print != nullptr);
137 if (project_path.empty())
138 return m_print->output_filepath("");
139 return m_print->output_filepath(project_path.parent_path().string(), project_path.stem().string());
140}
std::string output_filepath(const std::string &path, const std::string &filename_base=std::string()) const
Definition PrintBase.cpp:84

References m_print, and Slic3r::PrintBase::output_filepath().

+ Here is the call graph for this function:

◆ prepare_upload()

void Slic3r::BackgroundSlicingProcess::prepare_upload ( )
private
713{
714 // Generate a unique temp path to which the gcode/zip file is copied/exported
715 boost::filesystem::path source_path = boost::filesystem::temp_directory_path()
716 / boost::filesystem::unique_path("." SLIC3R_APP_KEY ".upload.%%%%-%%%%-%%%%-%%%%");
717
718 if (m_print == m_fff_print) {
719 m_print->set_status(95, _u8L("Running post-processing scripts"));
720 std::string error_message;
721 if (copy_file(m_temp_output_path, source_path.string(), error_message) != SUCCESS)
722 throw Slic3r::RuntimeError("Copying of the temporary G-code to the output G-code failed");
724 // Make a copy of the source path, as run_post_process_scripts() is allowed to change it when making a copy of the source file
725 // (not here, but when the final target is a file).
726 std::string source_path_str = source_path.string();
727 std::string output_name_str = m_upload_job.upload_data.upload_path.string();
728 if (run_post_process_scripts(source_path_str, false, m_upload_job.printhost->get_name(), output_name_str, m_fff_print->full_print_config()))
729 m_upload_job.upload_data.upload_path = output_name_str;
730 } else {
732
733 ThumbnailsList thumbnails = this->render_thumbnails(
734 ThumbnailsParams{current_print()->full_print_config().option<ConfigOptionPoints>("thumbnails")->values, true, true, true, true});
735 m_sla_print->export_print(source_path.string(),thumbnails, m_upload_job.upload_data.upload_path.filename().string());
736 }
737
738 m_print->set_status(100, GUI::format(_L("Scheduling upload to `%1%`. See Window -> Print Host Upload Queue"), m_upload_job.printhost->get_host()));
739
740 m_upload_job.upload_data.source_path = std::move(source_path);
741
742 GUI::wxGetApp().printhost_job_queue().enqueue(std::move(m_upload_job));
743}
const PrintBase * current_print() const
Definition BackgroundSlicingProcess.hpp:109
ThumbnailsList render_thumbnails(const ThumbnailsParams &params)
Definition BackgroundSlicingProcess.cpp:746
SLAPrint * m_sla_print
Definition BackgroundSlicingProcess.hpp:216
ConfigOption * option(const t_config_option_key &opt_key, bool create=false)
Definition Config.hpp:2169
const SLAPrintStatistics & print_statistics() const
Definition SLAPrint.hpp:495
void export_print(const std::string &fname, const std::string &projectname="")
Definition SLAPrint.hpp:541
boost::filesystem::path upload_path
Definition PrintHost.hpp:33
boost::filesystem::path source_path
Definition PrintHost.hpp:32
std::vector< ThumbnailData > ThumbnailsList
Definition ThumbnailData.hpp:22
PrintHostUpload upload_data
Definition PrintHost.hpp:80
std::unique_ptr< PrintHost > printhost
Definition PrintHost.hpp:81
std::string finalize_output_path(const std::string &path_in) const
Definition SLAPrint.cpp:1147

References _L, _u8L, Slic3r::copy_file(), current_print(), Slic3r::SLAPrint::export_print(), Slic3r::PrintStatistics::finalize_output_path(), Slic3r::SLAPrintStatistics::finalize_output_path(), Slic3r::GUI::format(), Slic3r::PrintBase::full_print_config(), m_fff_print, m_print, m_sla_print, m_temp_output_path, m_upload_job, Slic3r::ConfigBase::option(), Slic3r::Print::print_statistics(), Slic3r::SLAPrint::print_statistics(), Slic3r::PrintHostJob::printhost, render_thumbnails(), Slic3r::run_post_process_scripts(), Slic3r::PrintBase::set_status(), Slic3r::PrintHostUpload::source_path, Slic3r::SUCCESS, Slic3r::PrintHostJob::upload_data, and Slic3r::PrintHostUpload::upload_path.

Referenced by process_fff(), and process_sla().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ process_fff()

void Slic3r::BackgroundSlicingProcess::process_fff ( )
private
145{
146 assert(m_print == m_fff_print);
147 m_print->process();
148 wxCommandEvent evt(m_event_slicing_completed_id);
149 // Post the Slicing Finished message for the G-code viewer to update.
150 // Passing the timestamp
152 wxQueueEvent(GUI::wxGetApp().mainframe->m_plater, evt.Clone());
153 m_fff_print->export_gcode(m_temp_output_path, m_gcode_result, [this](const ThumbnailsParams& params) { return this->render_thumbnails(params); });
155 if (! m_export_path.empty()) {
156 wxQueueEvent(GUI::wxGetApp().mainframe->m_plater, new wxCommandEvent(m_event_export_began_id));
158 } else if (! m_upload_job.empty()) {
159 wxQueueEvent(GUI::wxGetApp().mainframe->m_plater, new wxCommandEvent(m_event_export_began_id));
161 } else {
162 m_print->set_status(100, _u8L("Slicing complete"));
163 }
165 }
166}
void finalize_gcode()
Definition BackgroundSlicingProcess.cpp:650
void prepare_upload()
Definition BackgroundSlicingProcess.cpp:712
void set_step_done(BackgroundSlicingProcessStep step)
Definition BackgroundSlicingProcess.cpp:626
int m_event_slicing_completed_id
Definition BackgroundSlicingProcess.hpp:274
int m_event_export_began_id
Definition BackgroundSlicingProcess.hpp:278
bool set_step_started(BackgroundSlicingProcessStep step)
Definition BackgroundSlicingProcess.cpp:621
PrintStateBase::StateWithTimeStamp step_state_with_timestamp(PrintStepEnum step) const
Definition PrintBase.hpp:584
std::string export_gcode(const std::string &path_template, GCodeProcessorResult *result, ThumbnailsGeneratorCallback thumbnail_cb=nullptr)
Definition Print.cpp:984
@ psSlicingFinished
Definition Print.hpp:63
@ bspsGCodeFinalize
Definition BackgroundSlicingProcess.hpp:73
TimeStamp timestamp
Definition PrintBase.hpp:62

References _u8L, Slic3r::bspsGCodeFinalize, Slic3r::PrintHostJob::empty(), Slic3r::Print::export_gcode(), finalize_gcode(), 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::PrintBase::process(), Slic3r::psSlicingFinished, render_thumbnails(), Slic3r::PrintBase::set_status(), set_step_done(), set_step_started(), Slic3r::PrintBaseWithState< PrintStepEnumType, COUNT >::step_state_with_timestamp(), and Slic3r::PrintStateBase::StateWithTimeStamp::timestamp.

+ Here is the call graph for this function:

◆ process_sla()

void Slic3r::BackgroundSlicingProcess::process_sla ( )
private
169{
170 assert(m_print == m_sla_print);
171 m_print->process();
173 if (! m_export_path.empty()) {
174 wxQueueEvent(GUI::wxGetApp().mainframe->m_plater, new wxCommandEvent(m_event_export_began_id));
175
176 const std::string export_path = m_sla_print->print_statistics().finalize_output_path(m_export_path);
177
178 ThumbnailsList thumbnails = this->render_thumbnails(
179 ThumbnailsParams{current_print()->full_print_config().option<ConfigOptionPoints>("thumbnails")->values, true, true, true, true});
180
181 m_sla_print->export_print(export_path, thumbnails);
182
183 m_print->set_status(100, GUI::format(_L("Masked SLA file exported to %1%"), export_path));
184 } else if (! m_upload_job.empty()) {
185 wxQueueEvent(GUI::wxGetApp().mainframe->m_plater, new wxCommandEvent(m_event_export_began_id));
187 } else {
188 m_print->set_status(100, _u8L("Slicing complete"));
189 }
191 }
192}

References _L, _u8L, Slic3r::bspsGCodeFinalize, current_print(), Slic3r::PrintHostJob::empty(), Slic3r::SLAPrint::export_print(), Slic3r::SLAPrintStatistics::finalize_output_path(), Slic3r::GUI::format(), Slic3r::PrintBase::full_print_config(), m_event_export_began_id, m_export_path, m_print, m_sla_print, m_upload_job, Slic3r::ConfigBase::option(), prepare_upload(), Slic3r::SLAPrint::print_statistics(), Slic3r::PrintBase::process(), render_thumbnails(), Slic3r::PrintBase::set_status(), set_step_done(), and set_step_started().

+ Here is the call graph for this function:

◆ render_thumbnails()

ThumbnailsList Slic3r::BackgroundSlicingProcess::render_thumbnails ( const ThumbnailsParams params)
private
747{
748 ThumbnailsList thumbnails;
749 if (m_thumbnail_cb)
750 this->execute_ui_task([this, &params, &thumbnails](){ thumbnails = m_thumbnail_cb(params); });
751 return thumbnails;
752}
bool execute_ui_task(std::function< void()> task)
Definition BackgroundSlicingProcess.cpp:493
ThumbnailsGeneratorCallback m_thumbnail_cb
Definition BackgroundSlicingProcess.hpp:220

References execute_ui_task(), and m_thumbnail_cb.

Referenced by prepare_upload(), process_fff(), and process_sla().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ reset()

bool Slic3r::BackgroundSlicingProcess::reset ( )
454{
455 bool stopped = this->stop();
456 this->reset_export();
457 m_print->clear();
458 this->invalidate_all_steps();
459 return stopped;
460}
bool invalidate_all_steps()
Definition BackgroundSlicingProcess.cpp:642
void reset_export()
Definition BackgroundSlicingProcess.cpp:609
virtual void clear()=0

References Slic3r::PrintBase::clear(), invalidate_all_steps(), m_print, reset_export(), and stop().

Referenced by select_technology().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ reset_export()

void Slic3r::BackgroundSlicingProcess::reset_export ( )
610{
611 assert(! this->running());
612 if (! this->running()) {
613 m_export_path.clear();
615 // invalidate_step expects the mutex to be locked.
616 std::scoped_lock<std::mutex> lock(m_print->state_mutex());
618 }
619}
bool invalidate_step(BackgroundSlicingProcessStep step)
Definition BackgroundSlicingProcess.cpp:636

References Slic3r::bspsGCodeFinalize, invalidate_step(), m_export_path, m_export_path_on_removable_media, m_print, running(), and Slic3r::PrintBase::state_mutex().

Referenced by reset().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ running()

bool Slic3r::BackgroundSlicingProcess::running ( ) const
inline

References m_state, STATE_CANCELED, STATE_FINISHED, STATE_RUNNING, and STATE_STARTED.

Referenced by execute_ui_task(), reset_export(), and start().

+ Here is the caller graph for this function:

◆ schedule_export()

void Slic3r::BackgroundSlicingProcess::schedule_export ( const std::string &  path,
bool  export_path_on_removable_media 
)
584{
585 assert(m_export_path.empty());
586 if (! m_export_path.empty())
587 return;
588
589 // Guard against entering the export step before changing the export path.
590 std::scoped_lock<std::mutex> lock(m_print->state_mutex());
592 m_export_path = path;
593 m_export_path_on_removable_media = export_path_on_removable_media;
594}

References Slic3r::bspsGCodeFinalize, invalidate_step(), m_export_path, m_export_path_on_removable_media, m_print, and Slic3r::PrintBase::state_mutex().

+ Here is the call graph for this function:

◆ schedule_upload()

void Slic3r::BackgroundSlicingProcess::schedule_upload ( Slic3r::PrintHostJob  upload_job)
597{
598 assert(m_export_path.empty());
599 if (! m_export_path.empty())
600 return;
601
602 // Guard against entering the export step before changing the export path.
603 std::scoped_lock<std::mutex> lock(m_print->state_mutex());
605 m_export_path.clear();
606 m_upload_job = std::move(upload_job);
607}

References Slic3r::bspsGCodeFinalize, invalidate_step(), m_export_path, m_print, m_upload_job, and Slic3r::PrintBase::state_mutex().

+ Here is the call graph for this function:

◆ select_technology()

bool Slic3r::BackgroundSlicingProcess::select_technology ( PrinterTechnology  tech)
113{
114 bool changed = false;
115 if (m_print == nullptr || m_print->technology() != tech) {
116 if (m_print != nullptr)
117 this->reset();
118 switch (tech) {
119 case ptFFF: m_print = m_fff_print; break;
120 case ptSLA: m_print = m_sla_print; break;
121 default: assert(false); break;
122 }
123 changed = true;
124 }
125 assert(m_print != nullptr);
126 return changed;
127}
bool reset()
Definition BackgroundSlicingProcess.cpp:453

References m_fff_print, m_print, m_sla_print, Slic3r::ptFFF, Slic3r::ptSLA, reset(), and Slic3r::PrintBase::technology().

+ Here is the call graph for this function:

◆ set_export_began_event()

void Slic3r::BackgroundSlicingProcess::set_export_began_event ( int  event_id)
inline
100{ m_event_export_began_id = event_id; }

References m_event_export_began_id.

◆ set_fff_print()

void Slic3r::BackgroundSlicingProcess::set_fff_print ( Print print)
inline
85{ m_fff_print = print; }

References m_fff_print.

◆ set_finished_event()

void Slic3r::BackgroundSlicingProcess::set_finished_event ( int  event_id)
inline
96{ m_event_finished_id = event_id; }
int m_event_finished_id
Definition BackgroundSlicingProcess.hpp:276

References m_event_finished_id.

◆ set_gcode_result()

void Slic3r::BackgroundSlicingProcess::set_gcode_result ( GCodeProcessorResult result)
inline
88{ m_gcode_result = result; }

References m_gcode_result.

◆ set_sla_print()

void Slic3r::BackgroundSlicingProcess::set_sla_print ( SLAPrint print)
inline
86{ m_sla_print = print; }

References m_sla_print.

◆ set_slicing_completed_event()

void Slic3r::BackgroundSlicingProcess::set_slicing_completed_event ( int  event_id)
inline

◆ set_step_done()

void Slic3r::BackgroundSlicingProcess::set_step_done ( BackgroundSlicingProcessStep  step)
private
627{
628 m_step_state.set_done(step, m_print->state_mutex(), [this](){ this->throw_if_canceled(); });
629}
std::pair< TimeStamp, bool > set_done(StepType step, std::mutex &mtx, ThrowIfCanceled throw_if_canceled)
Definition PrintBase.hpp:202

References m_print, m_step_state, Slic3r::PrintState< StepType, COUNT >::set_done(), and Slic3r::PrintBase::state_mutex().

Referenced by process_fff(), and process_sla().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ set_step_started()

bool Slic3r::BackgroundSlicingProcess::set_step_started ( BackgroundSlicingProcessStep  step)
private
622{
623 return m_step_state.set_started(step, m_print->state_mutex(), [this](){ this->throw_if_canceled(); });
624}
bool set_started(StepType step, std::mutex &mtx, ThrowIfCanceled throw_if_canceled)
Definition PrintBase.hpp:169

References m_print, m_step_state, Slic3r::PrintState< StepType, COUNT >::set_started(), and Slic3r::PrintBase::state_mutex().

Referenced by process_fff(), and process_sla().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ set_task()

void Slic3r::BackgroundSlicingProcess::set_task ( const PrintBase::TaskParams params)
577{
578 assert(m_print != nullptr);
579 m_print->set_task(params);
580}
virtual void set_task(const TaskParams &params)=0

References m_print, and Slic3r::PrintBase::set_task().

+ Here is the call graph for this function:

◆ set_thumbnail_cb()

void Slic3r::BackgroundSlicingProcess::set_thumbnail_cb ( ThumbnailsGeneratorCallback  cb)
inline
87{ m_thumbnail_cb = cb; }

References m_thumbnail_cb.

◆ sla_print()

const SLAPrint * Slic3r::BackgroundSlicingProcess::sla_print ( ) const
inline
111{ return m_sla_print; }

References m_sla_print.

Referenced by Slic3r::GUI::Preview::load_print_as_sla().

+ Here is the caller graph for this function:

◆ start()

bool Slic3r::BackgroundSlicingProcess::start ( )
393{
394 if (m_print->empty())
395 // The print is empty (no object in Model, or all objects are out of the print bed).
396 return false;
397
398 std::unique_lock<std::mutex> lck(m_mutex);
399 if (m_state == STATE_INITIAL) {
400 // The worker thread is not running yet. Start it.
401 assert(! m_thread.joinable());
402 m_thread = create_thread([this]{
403#ifdef _WIN32
404 this->thread_proc_safe_seh_throw();
405#else // _WIN32
406 this->thread_proc_safe();
407#endif // _WIN32
408 });
409 // Wait until the worker thread is ready to execute the background processing task.
410 m_condition.wait(lck, [this](){ return m_state == STATE_IDLE; });
411 }
412 assert(m_state == STATE_IDLE || this->running());
413 if (this->running())
414 // The background processing thread is already running.
415 return false;
416 if (! this->idle())
417 throw Slic3r::RuntimeError("Cannot start a background task, the worker thread is not idle.");
419 m_print->set_cancel_callback([this](){ this->stop_internal(); });
420 lck.unlock();
421 m_condition.notify_one();
422 return true;
423}
bool idle() const
Definition BackgroundSlicingProcess.hpp:166
void thread_proc_safe()
Definition BackgroundSlicingProcess.cpp:365
void set_cancel_callback(cancel_callback_type cancel_callback)
Definition PrintBase.hpp:501
boost::thread create_thread(boost::thread::attributes &attrs, Fn &&fn)
Definition Thread.hpp:55

References Slic3r::create_thread(), Slic3r::PrintBase::empty(), idle(), m_condition, m_mutex, m_print, m_state, m_thread, running(), Slic3r::PrintBase::set_cancel_callback(), STATE_IDLE, STATE_INITIAL, STATE_STARTED, stop_internal(), and thread_proc_safe().

+ Here is the call graph for this function:

◆ state()

State Slic3r::BackgroundSlicingProcess::state ( ) const
inline
165{ return m_state; }

References m_state.

◆ stop()

bool Slic3r::BackgroundSlicingProcess::stop ( )
427{
428 // m_print->state_mutex() shall NOT be held. Unfortunately there is no interface to test for it.
429 std::unique_lock<std::mutex> lck(m_mutex);
430 if (m_state == STATE_INITIAL) {
431// m_export_path.clear();
432 return false;
433 }
434// assert(this->running());
436 // Cancel any task planned by the background thread on UI thread.
438 m_print->cancel();
439 // Wait until the background processing stops by being canceled.
440 m_condition.wait(lck, [this](){ return m_state == STATE_CANCELED; });
441 // In the "Canceled" state. Reset the state to "Idle".
444 } else if (m_state == STATE_FINISHED || m_state == STATE_CANCELED) {
445 // In the "Finished" or "Canceled" state. Reset the state to "Idle".
448 }
449// m_export_path.clear();
450 return true;
451}
static void cancel_ui_task(std::shared_ptr< BackgroundSlicingProcess::UITask > task)
Definition BackgroundSlicingProcess.cpp:536
void cancel()
Definition PrintBase.hpp:515

References Slic3r::PrintBase::cancel(), cancel_ui_task(), m_condition, m_mutex, m_print, m_state, m_ui_task, Slic3r::PrintBase::set_cancel_callback(), STATE_CANCELED, STATE_FINISHED, STATE_IDLE, STATE_INITIAL, STATE_RUNNING, and STATE_STARTED.

Referenced by ~BackgroundSlicingProcess(), and reset().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ stop_internal()

void Slic3r::BackgroundSlicingProcess::stop_internal ( )
private
466{
467 // m_print->state_mutex() shall be held. Unfortunately there is no interface to test for it.
468 if (m_state == STATE_IDLE)
469 // The worker thread is waiting on m_mutex/m_condition for wake up. The following lock of the mutex would block.
470 return;
471 std::unique_lock<std::mutex> lck(m_mutex);
474 // Cancel any task planned by the background thread on UI thread.
476 // At this point of time the worker thread may be blocking on m_print->state_mutex().
477 // Set the print state to canceled before unlocking the state_mutex(), so when the worker thread wakes up,
478 // it throws the CanceledException().
480 // Allow the worker thread to wake up if blocking on a milestone.
481 m_print->state_mutex().unlock();
482 // Wait until the background processing stops by being canceled.
483 m_condition.wait(lck, [this](){ return m_state == STATE_CANCELED; });
484 // Lock it back to be in a consistent state.
485 m_print->state_mutex().lock();
486 }
487 // In the "Canceled" state. Reset the state to "Idle".
490}
void cancel_internal()
Definition PrintBase.hpp:516

References Slic3r::PrintBase::cancel_internal(), cancel_ui_task(), m_condition, m_mutex, m_print, m_state, m_ui_task, Slic3r::PrintBase::set_cancel_callback(), STATE_CANCELED, STATE_FINISHED, STATE_IDLE, Slic3r::PrintBase::state_mutex(), STATE_RUNNING, and STATE_STARTED.

Referenced by invalidate_all_steps(), invalidate_step(), and start().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ thread_proc()

void Slic3r::BackgroundSlicingProcess::thread_proc ( )
private
195{
196 set_current_thread_name("slic3r_BgSlcPcs");
198
199 // Set "C" locales and enforce OSX QoS level on all threads entering an arena.
200 // The cost of the callback is quite low: The callback is called once per thread
201 // entering a parallel loop and the callback is guarded with a thread local
202 // variable to be executed just once.
203 TBBLocalesSetter setter;
204
205 assert(m_print != nullptr);
206 assert(m_print == m_fff_print || m_print == m_sla_print);
207 std::unique_lock<std::mutex> lck(m_mutex);
208 // Let the caller know we are ready to run the background processing task.
210 lck.unlock();
211 m_condition.notify_one();
212 for (;;) {
214 // Wait until a new task is ready to be executed, or this thread should be finished.
215 lck.lock();
216 m_condition.wait(lck, [this](){ return m_state == STATE_STARTED || m_state == STATE_EXIT; });
217 if (m_state == STATE_EXIT)
218 // Exiting this thread.
219 break;
220 // Process the background slicing task.
222 lck.unlock();
223 std::exception_ptr exception;
224#ifdef _WIN32
225 this->call_process_seh_throw(exception);
226#else
227 this->call_process(exception);
228#endif
229 m_print->finalize();
230 lck.lock();
233 // Only post the canceled event, if canceled by user.
234 // Don't post the canceled event, if canceled from Print::apply().
235 SlicingProcessCompletedEvent evt(m_event_finished_id, 0,
237 exception ? SlicingProcessCompletedEvent::Error : SlicingProcessCompletedEvent::Finished, exception);
238 wxQueueEvent(GUI::wxGetApp().mainframe->m_plater, evt.Clone());
239 // Cancelled by the user, not internally, thus cleanup() was not called yet.
240 // Otherwise cleanup() is called from Print::apply()
241 m_print->cleanup();
242 }
243 m_print->restart();
244 lck.unlock();
245 // Let the UI thread wake up if it is waiting for the background task to finish.
246 m_condition.notify_one();
247 // Let the UI thread see the result.
248 }
250 lck.unlock();
251 // End of the background processing thread. The UI thread should join m_thread now.
252}
void call_process(std::exception_ptr &ex)
Definition BackgroundSlicingProcess.cpp:322
virtual void finalize()=0
virtual void cleanup()=0
CancelStatus cancel_status() const
Definition PrintBase.hpp:511
void restart()
Definition PrintBase.hpp:518
@ CANCELED_INTERNAL
Definition PrintBase.hpp:509
@ Cancelled
Definition BackgroundSlicingProcess.hpp:41
bool set_current_thread_name(const char *thread_name)
Definition Thread.cpp:178
void name_tbb_thread_pool_threads_set_locale()
Definition Thread.cpp:222

References call_process(), Slic3r::PrintBase::cancel_status(), Slic3r::PrintBase::canceled(), Slic3r::PrintBase::CANCELED_INTERNAL, Slic3r::SlicingProcessCompletedEvent::Cancelled, Slic3r::PrintBase::cleanup(), Slic3r::SlicingProcessCompletedEvent::Clone(), Slic3r::SlicingProcessCompletedEvent::Error, Slic3r::PrintBase::finalize(), Slic3r::SlicingProcessCompletedEvent::Finished, m_condition, m_event_finished_id, m_fff_print, m_mutex, m_print, m_sla_print, m_state, Slic3r::name_tbb_thread_pool_threads_set_locale(), Slic3r::PrintBase::restart(), Slic3r::set_current_thread_name(), STATE_CANCELED, STATE_EXIT, STATE_EXITED, STATE_FINISHED, STATE_IDLE, STATE_RUNNING, and STATE_STARTED.

Referenced by thread_proc_safe().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ thread_proc_safe()

void Slic3r::BackgroundSlicingProcess::thread_proc_safe ( )
throw (
)
private
366{
367 try {
368 this->thread_proc();
369 } catch (...) {
370 wxTheApp->OnUnhandledException();
371 }
372}
void thread_proc()
Definition BackgroundSlicingProcess.cpp:194

References thread_proc().

Referenced by start().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ throw_if_canceled()

void Slic3r::BackgroundSlicingProcess::throw_if_canceled ( ) const
inlineprivate
263{ if (m_print->canceled()) throw CanceledException(); }

References Slic3r::PrintBase::canceled(), and m_print.

+ Here is the call graph for this function:

◆ validate()

std::string Slic3r::BackgroundSlicingProcess::validate ( std::vector< std::string > *  warnings = nullptr)
553{
554 assert(m_print != nullptr);
555 return m_print->validate(warnings);
556}
virtual std::string validate(std::vector< std::string > *warnings=nullptr) const
Definition PrintBase.hpp:421

References m_print, and Slic3r::PrintBase::validate().

+ Here is the call graph for this function:

Member Data Documentation

◆ m_condition

std::condition_variable Slic3r::BackgroundSlicingProcess::m_condition
private

◆ m_event_export_began_id

int Slic3r::BackgroundSlicingProcess::m_event_export_began_id = 0
private

◆ m_event_finished_id

int Slic3r::BackgroundSlicingProcess::m_event_finished_id = 0
private

Referenced by set_finished_event(), and thread_proc().

◆ m_event_slicing_completed_id

int Slic3r::BackgroundSlicingProcess::m_event_slicing_completed_id = 0
private

◆ m_export_path

std::string Slic3r::BackgroundSlicingProcess::m_export_path
private

◆ m_export_path_on_removable_media

bool Slic3r::BackgroundSlicingProcess::m_export_path_on_removable_media = false
private

◆ m_fff_print

Print* Slic3r::BackgroundSlicingProcess::m_fff_print = nullptr
private

◆ m_gcode_result

GCodeProcessorResult* Slic3r::BackgroundSlicingProcess::m_gcode_result = nullptr
private

◆ m_mutex

std::mutex Slic3r::BackgroundSlicingProcess::m_mutex
private

◆ m_print

◆ m_sla_print

SLAPrint* Slic3r::BackgroundSlicingProcess::m_sla_print = nullptr
private

◆ m_state

State Slic3r::BackgroundSlicingProcess::m_state = STATE_INITIAL
private

◆ m_step_state

PrintState<BackgroundSlicingProcessStep, bspsCount> Slic3r::BackgroundSlicingProcess::m_step_state
private

◆ m_temp_output_path

std::string Slic3r::BackgroundSlicingProcess::m_temp_output_path
private

◆ m_thread

boost::thread Slic3r::BackgroundSlicingProcess::m_thread
private

Referenced by join_background_thread(), and start().

◆ m_thumbnail_cb

ThumbnailsGeneratorCallback Slic3r::BackgroundSlicingProcess::m_thumbnail_cb = nullptr
private

◆ m_ui_task

std::shared_ptr<UITask> Slic3r::BackgroundSlicingProcess::m_ui_task
private

◆ m_upload_job

PrintHostJob Slic3r::BackgroundSlicingProcess::m_upload_job
private

The documentation for this class was generated from the following files: