MayaFlux 0.4.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ tasks()

InspectResult MayaFlux::Portal::Forma::Inspector::tasks ( Vruta::ProcessingToken  token,
Surface surface,
LayoutCursor cursor,
float  x_min = -0.95F,
float  x_max = 0.95F,
float  row_h = 0.05F 
)

Inspect tasks for a specific processing token.

Same per-task layout as scheduler() but filtered to one token.

Definition at line 105 of file SchedulerQuery.cpp.

110{
111 const std::string header_label = "TaskScheduler ["
112 + std::string(Reflect::enum_to_string(token)) + "]";
113
114 const auto dims = row_pixel_dims(surface.window(), x_min, x_max, row_h);
115 auto hbuf = make_row_buffer(surface.window(), header_label, dims);
116 auto root_group = make_value_group({}, std::move(hbuf), {},
117 surface, cursor, x_min, x_max, row_h, true);
118
119 InspectResult result;
120 result.group = std::move(root_group);
121
122 const auto all = m_sched.get_all_tasks();
123 for (const auto& entry : all) {
124 if (!entry.routine)
125 continue;
126 if (entry.routine->get_processing_token() != token)
127 continue;
128
129 auto task_result = inspect_task(
130 entry, surface, cursor,
131 x_min, x_max, row_h);
132
133 result.group.header.attach(surface.layer(), task_result.group.header.header_id);
134 result.children.push_back(std::move(task_result));
135 }
136
137 return result;
138}
RowBuffer make_row_buffer(const std::shared_ptr< Core::Window > &window, std::string_view text, glm::uvec2 pixel_dims) const
Definition Inspector.cpp:13
InspectResult inspect_task(const Vruta::TaskEntry &entry, Surface &surface, LayoutCursor &cursor, float x_min, float x_max, float row_h)
Vruta::TaskScheduler & m_sched
const std::vector< TaskEntry > & get_all_tasks()
Get all tasks for inspection/debugging.
ValueGroup make_value_group(std::span< const ValueSpec > values, RowBuffer header_buf, std::span< const RowBuffer > row_bufs, Surface &surface, LayoutCursor &cursor, float x_min, float x_max, float row_h, bool initially_open)
Construct a collapsible header followed by N value rows under it.
glm::uvec2 row_pixel_dims(const std::shared_ptr< Core::Window > &window, float x_min, float x_max, float row_h)
Convert an NDC row rect into integer pixel dimensions.
constexpr std::string_view enum_to_string(EnumType value) noexcept
Universal enum to string converter using magic_enum (original case)

References MayaFlux::Reflect::enum_to_string(), MayaFlux::Vruta::TaskScheduler::get_all_tasks(), MayaFlux::Portal::Forma::InspectResult::group, inspect_task(), MayaFlux::Portal::Forma::Surface::layer(), m_sched, make_row_buffer(), MayaFlux::Portal::Forma::make_value_group(), MayaFlux::Portal::Forma::row_pixel_dims(), and MayaFlux::Portal::Forma::Surface::window().

Referenced by scheduler().

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