pub struct MeasurementStore { /* private fields */ }Implementations§
Source§impl MeasurementStore
impl MeasurementStore
pub fn open(path: impl Into<PathBuf>) -> Result<Self, ProjectError>
pub fn new(path: impl Into<PathBuf>, project: Project) -> Self
pub fn project(&self) -> &Project
pub fn project_mut(&mut self) -> &mut Project
pub fn records(&self) -> Vec<MeasurementRecord>
pub fn entry_for(&self, pos: i64) -> Option<MeasurementRecord>
pub fn done_positions(&self, roles: Option<&[String]>) -> Vec<i64>
pub fn pending_positions(&self, positions: &[i64], roles: &[String]) -> Vec<i64>
pub fn label_for(&self, pos: i64) -> String
pub fn start_position(&mut self, pos: i64) -> MeasurementRecord
Sourcepub fn record(
&mut self,
result: MeasurementResult,
plan_roles: Option<&[String]>,
) -> Result<MeasurementRecord, ProjectError>
pub fn record( &mut self, result: MeasurementResult, plan_roles: Option<&[String]>, ) -> Result<MeasurementRecord, ProjectError>
Writes the IR and its source sidecar, enters the result into its
position (upstream session.record), and saves the project once.
A result with a source also sets source[role] on the entry, where
upstream’s importer (step5.load_mdat) sets it after recording: the
key goes last when the entry has none, and a value that is not an
object is replaced by one.
Sourcepub fn clear_position(&mut self, pos: i64) -> bool
pub fn clear_position(&mut self, pos: i64) -> bool
Removes a position’s entries and SNR values; false if it had none.
Sourcepub fn remove_position(&mut self, pos: i64) -> Option<RemovedPosition>
pub fn remove_position(&mut self, pos: i64) -> Option<RemovedPosition>
Takes a position’s entries and SNR values out of the store, keeping
them for Self::restore_position. None if the position has no
entry. The project file is not written.
Sourcepub fn restore_position(
&mut self,
removed: RemovedPosition,
) -> Result<(), ProjectError>
pub fn restore_position( &mut self, removed: RemovedPosition, ) -> Result<(), ProjectError>
Puts a removed position back; fails if that position was recorded again meanwhile. Each entry returns to its old list index (or the end, if the list is shorter now). The project file is not written.
pub fn ir_path_of( &mut self, role: &str, pos: i64, ) -> Result<PathBuf, ProjectError>
pub fn ir_of( &mut self, role: &str, pos: i64, ) -> Result<(Vec<f32>, u32), ProjectError>
Sourcepub fn source_of(&mut self, role: &str, pos: i64) -> Option<SourceInfo>
pub fn source_of(&mut self, role: &str, pos: i64) -> Option<SourceInfo>
Returns a recorded IR’s source sidecar when both files are readable and
confined to the project’s .irs directory.
Sourcepub fn replace_source(
&mut self,
role: &str,
pos: i64,
info: Option<&SourceInfo>,
) -> Result<(), ProjectError>
pub fn replace_source( &mut self, role: &str, pos: i64, info: Option<&SourceInfo>, ) -> Result<(), ProjectError>
Rewrites a recorded IR’s source sidecar and updates its in-memory calibration fingerprint. The IR and measurement entry are unchanged.
pub fn t0_of(&self, role: &str, pos: i64) -> f64
pub fn t0_by_role(&self, pos: i64) -> BTreeMap<String, f64>
pub fn irs_by_role( &mut self, pos: i64, ) -> Result<BTreeMap<String, (Vec<f32>, u32)>, ProjectError>
pub fn warnings(&self) -> &[MigrationWarning]
pub fn save(&mut self) -> Result<(), ProjectError>
Sourcepub fn save_count(&self) -> u64
pub fn save_count(&self) -> u64
How many times this store has written its project file. A test hook: tests count saves with it.