OrcaSlicer latest
OrcaSlicer
Loading...
Searching...
No Matches
Slic3r::PrintHostJobQueue Class Reference

#include </home/runner/work/OrcaSlicer/OrcaSlicer/src/slic3r/Utils/PrintHost.hpp>

Collaboration diagram for Slic3r::PrintHostJobQueue:

Classes

struct  priv

Public Member Functions

 PrintHostJobQueue (GUI::PrintHostQueueDialog *queue_dialog)
 PrintHostJobQueue (const PrintHostJobQueue &)=delete
 PrintHostJobQueue (PrintHostJobQueue &&other)=delete
 ~PrintHostJobQueue ()
PrintHostJobQueue & operator= (const PrintHostJobQueue &)=delete
PrintHostJobQueue & operator= (PrintHostJobQueue &&other)=delete
void enqueue (PrintHostJob job)
void cancel (size_t id)

Static Public Member Functions

static bool upload_job (PrintHostJob &job, PrintHost::ProgressFn progress_fn, PrintHost::ErrorFn error_fn, PrintHost::InfoFn info_fn)

Private Attributes

std::shared_ptr< priv > p

Detailed Description

Constructor & Destructor Documentation

◆ PrintHostJobQueue() [1/3]

Slic3r::PrintHostJobQueue::PrintHostJobQueue ( GUI::PrintHostQueueDialog * queue_dialog)
263 : p(new priv(this))
264{
265 p->queue_dialog = queue_dialog;
266}
std::shared_ptr< priv > p
Definition PrintHost.hpp:164
Definition PrintHost.cpp:229

References p.

Referenced by PrintHostJobQueue(), PrintHostJobQueue(), Slic3r::PrintHostJobQueue::priv::priv(), operator=(), and operator=().

Here is the caller graph for this function:

◆ PrintHostJobQueue() [2/3]

Slic3r::PrintHostJobQueue::PrintHostJobQueue ( const PrintHostJobQueue & )
delete

References PrintHostJobQueue().

Here is the call graph for this function:

◆ PrintHostJobQueue() [3/3]

Slic3r::PrintHostJobQueue::PrintHostJobQueue ( PrintHostJobQueue && other)
delete

References PrintHostJobQueue().

Here is the call graph for this function:

◆ ~PrintHostJobQueue()

Slic3r::PrintHostJobQueue::~PrintHostJobQueue ( )
269{
270 if (p) { p->stop_bg_thread(); }
271}

References p.

Member Function Documentation

◆ cancel()

void Slic3r::PrintHostJobQueue::cancel ( size_t id)
510{
511 p->channel_cancels.push(id);
512}

References p.

Referenced by Slic3r::PrintHostJobQueue::priv::perform_job(), and Slic3r::PrintHostJobQueue::priv::progress_fn().

Here is the caller graph for this function:

◆ enqueue()

void Slic3r::PrintHostJobQueue::enqueue ( PrintHostJob job)
503{
504 p->start_bg_thread();
505 p->queue_dialog->append_job(job);
506 p->channel_jobs.push(std::move(job));
507}

References p.

◆ operator=() [1/2]

PrintHostJobQueue & Slic3r::PrintHostJobQueue::operator= ( const PrintHostJobQueue & )
delete

References PrintHostJobQueue().

Here is the call graph for this function:

◆ operator=() [2/2]

PrintHostJobQueue & Slic3r::PrintHostJobQueue::operator= ( PrintHostJobQueue && other)
delete

References PrintHostJobQueue().

Here is the call graph for this function:

◆ upload_job()

bool Slic3r::PrintHostJobQueue::upload_job ( PrintHostJob & job,
PrintHost::ProgressFn progress_fn,
PrintHost::ErrorFn error_fn,
PrintHost::InfoFn info_fn )
static
451{
452 // Captured before upload_data is moved into upload() below.
453 const std::string upload_filename = job.upload_data.source_path.filename().string();
454
455 {
456 LifecycleEventContext ctx;
457 ctx.name = upload_filename;
458 ctx.code = LifecycleEvtCode::Ok;
460 }
461
462 bool success = false;
463 std::string error;
464 // A throwing upload must not stop the worker, or later jobs would stay queued forever.
465 try {
466 success = job.printhost->upload(std::move(job.upload_data), std::move(progress_fn), error_fn, std::move(info_fn));
467 } catch (const std::exception &e) {
468 error = e.what();
469 error_fn(error);
470 }
471
472 {
473 LifecycleEventContext ctx;
474 ctx.name = upload_filename;
475 ctx.code = success ? LifecycleEvtCode::Ok : LifecycleEvtCode::Error;
476 ctx.msg = error;
478 }
479
480 return success;
481}
@ UploadStarted
Definition LifecycleEvents.hpp:56
@ UploadFinished
Definition LifecycleEvents.hpp:57
@ Error
Definition LifecycleEvents.hpp:68
@ Ok
Definition LifecycleEvents.hpp:68
void fire_lifecycle_event(LifecycleEvent event, const LifecycleEventContext &ctx)
Definition LifecycleEvents.hpp:234

References Slic3r::LifecycleEventContext::code, Slic3r::Error, Slic3r::fire_lifecycle_event(), Slic3r::LifecycleEventContext::msg, Slic3r::LifecycleEventContext::name, Slic3r::Ok, Slic3r::PrintHostJob::printhost, Slic3r::PrintHostUpload::source_path, Slic3r::PrintHostJob::upload_data, Slic3r::UploadFinished, and Slic3r::UploadStarted.

Referenced by Slic3r::PrintHostJobQueue::priv::perform_job().

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

Member Data Documentation

◆ p

std::shared_ptr<priv> Slic3r::PrintHostJobQueue::p
private

The documentation for this class was generated from the following files:
  • /home/runner/work/OrcaSlicer/OrcaSlicer/src/slic3r/Utils/PrintHost.hpp
  • /home/runner/work/OrcaSlicer/OrcaSlicer/src/slic3r/Utils/PrintHost.cpp