rillrate_protocol/live_data/pulse/
tracer.rs1use super::state::*;
2use crate::base::frame_flow::FrameFlowTracer;
3use crate::live_data::auto_path::AutoPath;
4use crate::manifest::Binded;
5
6pub struct PulseFrameTracer {
7 tracer: Binded<FrameFlowTracer<PulseFrameSpec>>,
8}
9
10impl PulseFrameTracer {
11 pub fn new(auto_path: AutoPath, spec: Option<PulseFrameSpec>) -> Self {
12 let spec = spec.unwrap_or_default();
13 let path = auto_path.into();
14 let tracer = Binded::new(FrameFlowTracer::new(path, spec).0);
15 Self { tracer }
16 }
17
18 pub fn add(&self, value: f32) {
19 self.tracer.add_frame(value);
20 }
21}