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

◆ inspect_task()

InspectResult MayaFlux::Portal::Forma::Inspector::inspect_task ( const Vruta::TaskEntry entry,
Surface surface,
LayoutCursor cursor,
float  x_min,
float  x_max,
float  row_h 
)
private

Definition at line 12 of file SchedulerQuery.cpp.

17{
18 auto routine = entry.routine;
19 const std::string name = entry.name;
20
21 std::vector<ValueSpec> values {
22 ValueSpec {
23 .label = "name",
24 .reader = [name] { return name.empty() ? "(unnamed)" : name; },
25 },
26 ValueSpec {
27 .label = "token",
28 .reader = [routine] {
29 return std::string(Reflect::enum_to_string(routine->get_processing_token()));
30 },
31 },
32 ValueSpec {
33 .label = "active",
34 .reader = [routine] { return routine->is_active() ? "true" : "false"; },
35 },
36 ValueSpec {
37 .label = "delay",
38 .reader = [routine] {
39 return std::string(Reflect::enum_to_string(routine->get_delay_context()));
40 },
41 },
42 };
43
44 const auto dims = row_pixel_dims(surface.window(), x_min, x_max, row_h);
45 auto hbuf = make_row_buffer(surface.window(), Reflect::short_dynamic_type_name(*entry.routine), dims);
46 std::vector<RowBuffer> rbufs;
47 rbufs.reserve(values.size());
48 for (const auto& spec : values)
49 rbufs.push_back(make_row_buffer(surface.window(), spec.label, dims));
50
51 auto group = make_value_group(values, std::move(hbuf), rbufs,
52 surface, cursor, x_min, x_max, row_h, false);
53
54 InspectResult result;
55 result.group = std::move(group);
56 return result;
57}
RowBuffer make_row_buffer(const std::shared_ptr< Core::Window > &window, std::string_view text, glm::uvec2 pixel_dims) const
Definition Inspector.cpp:13
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)
std::string short_dynamic_type_name(const T &obj) noexcept
Returns the unqualified dynamic type name of obj.
Definition TypeInfo.hpp:95

References MayaFlux::Reflect::enum_to_string(), MayaFlux::Portal::Forma::InspectResult::group, MayaFlux::Portal::Forma::ValueSpec::label, make_row_buffer(), MayaFlux::Portal::Forma::make_value_group(), MayaFlux::Vruta::TaskEntry::name, MayaFlux::Vruta::TaskEntry::routine, MayaFlux::Portal::Forma::row_pixel_dims(), MayaFlux::Reflect::short_dynamic_type_name(), and MayaFlux::Portal::Forma::Surface::window().

Referenced by scheduler(), and tasks().

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