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
impl Alignments
Sourcepub fn new(
state_dir: &Path,
calibration: Option<Arc<CameraCalibration>>,
prints: Arc<dyn PrintStore>,
) -> Result<Self>
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.
Sourcepub fn calibration(&self) -> Option<&CameraCalibration>
pub fn calibration(&self) -> Option<&CameraCalibration>
The camera calibration in force, when one is configured.
Sourcepub fn previous_check(&self, print_id: PrintId) -> Option<PreviousCheck>
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.
Sourcepub fn record_check(&self, print_id: PrintId, check: &PreviousCheck)
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.
Sourcepub fn checked_frames(&self, print_id: PrintId) -> Vec<CheckedFrame>
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.
Sourcepub fn restart_growth(&self, print_id: PrintId)
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.
Sourcepub fn growth_reference(
&self,
print_id: PrintId,
print_z_mm: f64,
rise_mm: f64,
) -> Option<CheckedFrame>
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.
Sourcepub fn record_checked_frame(
&self,
print_id: PrintId,
checked: CheckedFrame,
rise_mm: f64,
)
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.
Sourcepub fn print_alignment(&self, print_id: PrintId) -> PrintAlignment
pub fn print_alignment(&self, print_id: PrintId) -> PrintAlignment
One print’s verdict as it stands.
Sourcepub async fn check(
&self,
supervisor: &Supervisor,
active: ActiveJob,
) -> Option<PrintAlignment>
pub async fn check( &self, supervisor: &Supervisor, active: ActiveJob, ) -> Option<PrintAlignment>
Rule on the running print’s alignment once its first object layer is down, when it has no verdict yet. Answers the verdict it wrote, and nothing when it wrote none — not yet due, or no good frame came.
Sourcepub async fn sweep(&self)
pub async fn sweep(&self)
Delete the verdict, the last check’s record and the checked frames 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§
Auto Trait Implementations§
impl !RefUnwindSafe for Alignments
impl !UnwindSafe for Alignments
impl Forget for Alignments
impl Freeze for Alignments
impl Move for Alignments
impl Send for Alignments
impl Sync for Alignments
impl Unpin for Alignments
impl UnsafeUnpin for Alignments
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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 moreSource§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.