-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuf_view.h
More file actions
31 lines (25 loc) · 1.01 KB
/
Copy pathuf_view.h
File metadata and controls
31 lines (25 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// uf_view.h - the dashboard renderer, itself a uniflow module.
//
// FEATURE FOCUS: a renderer is just another flow on the same pump. It reads
// every runner's row with plain member access (no lock) because they share the
// thread. Its frame cadence uses a REAL-time UFTimer (default ctor), NOT the
// virtual clock - so when the user pauses the sim (clock frozen), the runners
// stop but the dashboard keeps redrawing and shows [PAUSED].
#pragma once
#include "uniflow.hpp"
class Flow_View : public uniflow::Uniflow<Flow_View>
{
public:
explicit Flow_View(uniflow::Runtime& rt);
struct Task_Draw : uniflow::Task<Flow_View>
{
void OnEnter() override { fps_.Restart(); }
StepResult Entry() override { return Step1_Draw(); }
private:
uniflow::UFTimer fps_; // real-clock throttle (keeps drawing while paused)
StepResult Step1_Draw();
void Render();
} task_draw_;
private:
uniflow::VirtualClock& clock_; // read scale/frozen state for the header
};