Skip to main content

Alignments

Struct Alignments 

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

The alignment verdicts of every print, what decides them, the frame each print’s last check was given, and its recent checks’ frames and heights.

Implementations§

Source§

impl Alignments

Source

pub fn new( state_dir: &Path, calibration: Option<Arc<CameraCalibration>>, prints: Arc<dyn PrintStore>, ) -> Result<Self>

The verdicts kept under one state directory.

§Errors

The filesystem’s own error when the directory cannot be made.

Source

pub fn calibration(&self) -> Option<&CameraCalibration>

The camera calibration in force, when one is configured.

Source

pub fn previous_check(&self, print_id: PrintId) -> Option<PreviousCheck>

The frame one print’s last check was given; nothing before its first check, or when the record cannot be read back.

Source

pub fn record_check(&self, print_id: PrintId, check: &PreviousCheck)

Name the frame one print’s check was given, which its next check shows as the previous. A record the filesystem refuses for a moment is replaced once the refusal passes ([replace_file]); one it goes on refusing is said on the log and leaves the record before it standing, so the next check shows an older frame as the previous rather than none. No test makes the refusal last: that needs the state directory made to refuse writes beneath a running server, which refuses the store’s own writes first. What a check makes of a record it cannot use — an empty panel 3 — is proved by a_lost_previous_frame_empties_panel_3_and_the_record_goes_with_the_print.

Source

pub fn checked_frames(&self, print_id: PrintId) -> Vec<CheckedFrame>

One print’s recent checks’ frames and heights, oldest first; none before its first check with a height, or when the record cannot be read back.

Source

pub fn restart_growth(&self, print_id: PrintId)

Forget one print’s checked frames, so its growth is measured only from checks made after now: the print waited at a planned change, and a frame from before the wait would count the wait as no growth. A record the filesystem will not remove is said on the log and left, so a later check measures from a frame before the wait, which says no more than that a check could not tell.

Source

pub fn growth_reference( &self, print_id: PrintId, print_z_mm: f64, rise_mm: f64, ) -> Option<CheckedFrame>

The frame a check at print_z_mm measures growth from: the newest checked frame of the print at least rise_mm below it in the plan.

Source

pub fn record_checked_frame( &self, print_id: PrintId, checked: CheckedFrame, rise_mm: f64, )

Keep one check’s frame and height among the print’s, keeping only what a later check at rise_mm above some kept height can still measure from: the newest frame at least that far below this one and every frame after it. A height below the last kept one is a plan that went back down, as a print of one object after another does, and starts the record again. A record the filesystem refuses is said on the log and leaves the one before standing, as record_check does.

Source

pub fn print_alignment(&self, print_id: PrintId) -> PrintAlignment

One print’s verdict as it stands.

Source

pub fn correction_in_force(&self, print_id: PrintId) -> Option<ViewCorrection>

The correction in force for one print: the one its last pass took, or, for a pass an earlier release recorded with no reference, its correction held against the calibration’s own landmarks where it placed them. Nothing unless the print’s alignment passed.

Source

pub fn inconclusive(&self, print_id: PrintId) -> Option<InconclusiveReason>

Why the print’s alignment was last left pending, when the frame judged last was inconclusive.

Source

pub fn last_check_image(&self, print_id: PrintId) -> Option<LastCheckImage>

The image the print’s last check was shown, and when its frame was captured; nothing before its first check.

Source

pub fn note_check_image( &self, print_id: PrintId, shown: LastCheckImage, frame_sha256: &str, ) -> Option<EventBody>

Keep the image one check of a print was shown, and answer the change notice owed for it: on the print’s first check image, and whenever its kind or its fallback’s code differs from the last one kept.

Source

pub fn judge(&self, print_id: PrintId, judging: &Judging<'_>) -> Judged

Judge one frame of a print — its view always, and its first-layer alignment when judging asks and the alignment is due — keeping what the judgement decided and answering it with the records to append.

The alignment is due on a frame of the configured camera once the plan has passed the print’s first object layer: while it is pending, for AlignmentJudging::WhilePending, and whatever it stands at for AlignmentJudging::Afresh, a latched failure included. A frame whose view shows the camera moved again since the correction in force was taken sets the alignment back to pending, and is not judged for it: a later check’s frame takes the fresh correction.

Nothing is judged without a calibration, and a frame that is no JPEG is answered as such, with nothing recorded.

Source

pub async fn sweep(&self)

Delete the verdict, the last check’s record, the checked frames and the camera view of every print that is not open.

An open print’s record still being written — the .json.part beside it that [replace_file] renames over it — is its own, and kept: the watch sweeps after every read, so a sweep removing it between the write and the rename lost that record, and the print’s next check showed no previous frame.

A store that cannot list the open prints, a directory that cannot be listed and a file that cannot be removed each leave a verdict behind, which the next read’s sweep tries again. No test makes either refuse, since that needs a store or filesystem made to fail beneath a running server; the aligning journeys prove the sweep removes a closed print’s verdict and keeps an open one’s, after a close and at start.

Trait Implementations§

Source§

impl Debug for Alignments

Source§

fn fmt(&self, formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. 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> ErasedDestructor for T
where T: 'static,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

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

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
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<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
Source§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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<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