#include </home/runner/work/OrcaSlicer/OrcaSlicer/src/slic3r/GUI/PrebuildQueue.hpp>
|
| void | add (LazyBase &task) |
| void | clear () |
| bool | pending () const |
| std::string | names () const |
| Slice | run_slice (int budget_ms, const std::function< long long()> &now_ms, const std::function< bool()> &interrupt, const std::function< void(const std::string &, long long)> &on_unit={}) |
◆ Slic3r::GUI::PrebuildQueue::Slice
| struct Slic3r::GUI::PrebuildQueue::Slice |
| Class Members |
|
bool |
completed { false } |
|
|
long long |
ms { 0 } |
|
|
string |
name |
|
|
bool |
remaining { false } |
|
|
int |
units { 0 } |
|
◆ add()
| void Slic3r::GUI::PrebuildQueue::add |
( |
LazyBase & | task | ) |
|
|
inline |
28 {
29 auto after = std::find_if(
m_tasks.begin(),
m_tasks.end(), [&](
const LazyBase* t) { return t->prebuild_order() > task.prebuild_order(); });
31 }
std::vector< LazyBase * > m_tasks
Definition PrebuildQueue.hpp:86
References m_tasks.
◆ clear()
| void Slic3r::GUI::PrebuildQueue::clear |
( |
| ) |
|
|
inline |
◆ names()
| std::string Slic3r::GUI::PrebuildQueue::names |
( |
| ) |
const |
|
inline |
42 {
43 std::string out;
44 for (
const LazyBase* t :
m_tasks)
45 out += (out.empty() ? "" : ", ") + t->name();
46 return out;
47 }
References m_tasks.
◆ pending()
| bool Slic3r::GUI::PrebuildQueue::pending |
( |
| ) |
const |
|
inline |
36 {
37 return std::any_of(
m_tasks.begin(),
m_tasks.end(), [](
const LazyBase* t) { return t->pending(); });
38 }
References m_tasks.
◆ run_slice()
| Slice Slic3r::GUI::PrebuildQueue::run_slice |
( |
int | budget_ms, |
|
|
const std::function< long long()> & | now_ms, |
|
|
const std::function< bool()> & | interrupt, |
|
|
const std::function< void(const std::string &, long long)> & | on_unit = {} ) |
|
inline |
56 {})
57 {
59 auto next = std::find_if(
m_tasks.begin(),
m_tasks.end(), [](
const LazyBase* t) { return t->pending(); });
61 return slice;
62
63 LazyBase* const task = *next;
64 slice.name = task->name();
65 const long long started = now_ms();
66 for (;;) {
67 const long long unit_started = now_ms();
68 const bool more = task->build_step();
69 const long long now = now_ms();
70 ++slice.units;
71 if (on_unit)
72 on_unit(slice.name, now - unit_started);
73 slice.ms = now - started;
74 if (!more) {
75 slice.completed = true;
76 break;
77 }
78 if (slice.ms >= budget_ms || interrupt())
79 break;
80 }
82 return slice;
83 }
bool pending() const
Definition PrebuildQueue.hpp:35
Definition PrebuildQueue.hpp:18
◆ m_tasks
| std::vector<LazyBase*> Slic3r::GUI::PrebuildQueue::m_tasks |
|
private |
The documentation for this class was generated from the following file: