Skip to main content

TimelapseManager

Struct TimelapseManager 

Source
pub struct TimelapseManager { /* private fields */ }
Expand description

Owns up to two concurrent captures of the same print — a smooth one (per-layer, synced to the printer’s park) and a plain one (sampled on a wall-time interval, head in shot). Each is started/stopped independently. Lives in AppState.

Implementations§

Source§

impl TimelapseManager

Source

pub fn start_smooth( &self, cameras: Vec<(String, FrameGrab)>, every: u64, burst_offsets: Vec<u64>, rx: Receiver<PrinterStatus>, out_dir: PathBuf, ) -> Result<(), String>

Start the smooth (per-layer) capture: one frame per every-th layer from each camera, written to out_dir/<camera-id>/.

Source

pub fn start_smooth_with_select( &self, cameras: Vec<(String, FrameGrab)>, every: u64, burst_offsets: Vec<u64>, rx: Receiver<PrinterStatus>, out_dir: PathBuf, selects: Vec<Option<SelectTuning>>, ) -> Result<(), String>

Like start_smooth, plus per-camera burst-SELECTION tuning (index-aligned with cameras; None/missing = no live selection). When a camera has select tuning, after each layer’s burst settles the run picks the parked frame and publishes it as park_*.jpg/parks.jsonl in that camera’s dir — so the live park preview shows the clean timelapse DURING a smooth capture, and the finished run reads back as a clean park recording.

Source

pub fn start_plain( &self, cameras: Vec<PlainCapture>, interval_ms: u64, rx: Receiver<PrinterStatus>, out_dir: PathBuf, ) -> Result<(), String>

Start the plain (time-sampled) capture: one frame from each camera every interval_ms, while the print is active.

Source

pub fn start_park( &self, cameras: Vec<ParkCapture>, rx: Receiver<PrinterStatus>, out_dir: PathBuf, spawn_worker: ParkSpawn, ) -> Result<(), String>

Start the live park-preview capture: for each tuned stream camera, lazily spawn one ffmpeg supervisor (via spawn_worker) once the print is active; each emits latest_park.jpg per layer under out_dir/<camera-id>/. spawn_worker is injected so the lifecycle is testable without ffmpeg (real_park_spawn runs the real one). Rejected if a park run is already active or cameras is empty.

Source

pub fn start_segment( &self, cameras: Vec<SegmentCapture>, rx: Receiver<PrinterStatus>, out_dir: PathBuf, spawn_worker: SegmentSpawn, ) -> Result<(), String>

Start the dense-stream segmented capture: for each capable stream camera, lazily spawn one ffmpeg supervisor (via spawn_worker) once the print is active. The lifecycle maintains the live print layer (from MQTT layer_num) and feeds it to the workers, which segment the stream per layer and publish the picked frame as latest_park.jpg/park_NNNNNN.jpg (read by /api/camera/{id}/park, exactly like park). spawn_worker is injected for testing; real_segment_spawn runs ffmpeg. Rejected if a segment run is already active or cameras is empty.

Source

pub fn stop_smooth(&self) -> bool

Stop the smooth capture (idempotent). Returns whether one was running.

Source

pub fn stop_plain(&self) -> bool

Stop the plain capture (idempotent). Returns whether one was running.

Source

pub fn stop_park(&self) -> bool

Stop the live park-preview capture (idempotent). Returns whether one was running.

Source

pub fn stop_segment(&self) -> bool

Stop the dense-stream segmented capture (idempotent). Returns whether one was running.

Source

pub fn status_smooth(&self) -> TimelapseStatus

Source

pub fn status_plain(&self) -> TimelapseStatus

Source

pub fn status_park(&self) -> TimelapseStatus

Source

pub fn status_segment(&self) -> TimelapseStatus

Trait Implementations§

Source§

impl Default for TimelapseManager

Source§

fn default() -> TimelapseManager

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<A, B, T> HttpServerConnExec<A, B> for T
where B: Body,

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more