STAR
Cal STAR — firmware, DAQ server, and engine design
Loading...
Searching...
No Matches
engine.layerx.measurements.MeasurementStore Class Reference

Public Member Functions

None __init__ (self, Optional[Path] user_dir)
List[Override] get (self, Any drawing)
Tuple[List[Override], List[str], Optional[str]] load (self, Any drawing)
None put (self, Any drawing, List[Override] overrides)

Public Attributes

tuple dir = (user_dir / "layerx" / "measurements") if user_dir is not None else None

Protected Member Functions

Optional[Path] _path (self, str key)
Tuple[Optional[Dict[str, Any]], List[str]] _read (self, Any drawing)

Static Protected Member Functions

str _key (Any drawing)

Detailed Description

One person's overrides, per drawing, in ``<user dir>/layerx/measurements/<key>.json``.

Keyed by the drawing's lineage (:func:`lineage`), so restatements carry over when the drawing
is edited; each file records the revision they were entered against, and an element the new
revision no longer has is reported by :func:`apply_overrides`, not dropped. A bare content id
(the old key) is still read.

Definition at line 212 of file measurements.py.

Constructor & Destructor Documentation

◆ __init__()

None engine.layerx.measurements.MeasurementStore.__init__ ( self,
Optional[Path] user_dir )

Definition at line 220 of file measurements.py.

Member Function Documentation

◆ _key()

str engine.layerx.measurements.MeasurementStore._key ( Any drawing)
staticprotected

Definition at line 224 of file measurements.py.

References engine.layerx.measurements.lineage().

Referenced by _read(), and put().

◆ _path()

Optional[Path] engine.layerx.measurements.MeasurementStore._path ( self,
str key )
protected

Definition at line 229 of file measurements.py.

References dir, and fs::directory_iterator.dir.

Referenced by _read(), and put().

◆ _read()

Tuple[Optional[Dict[str, Any]], List[str]] engine.layerx.measurements.MeasurementStore._read ( self,
Any drawing )
protected

Definition at line 234 of file measurements.py.

References _key(), and _path().

Referenced by load().

◆ get()

◆ load()

Tuple[List[Override], List[str], Optional[str]] engine.layerx.measurements.MeasurementStore.load ( self,
Any drawing )
``(overrides, problems, revision)``: what is restated, what could not be read, and the
sha256 of the drawing they were entered against.

Definition at line 252 of file measurements.py.

References _read(), and t7_integration.FakeElodin._read().

Referenced by get().

◆ put()

None engine.layerx.measurements.MeasurementStore.put ( self,
Any drawing,
List[Override] overrides )

Definition at line 266 of file measurements.py.

References _key(), _path(), engine.layerx.measurements.lineage(), and time.time().

Member Data Documentation

◆ dir

tuple engine.layerx.measurements.MeasurementStore.dir = (user_dir / "layerx" / "measurements") if user_dir is not None else None

The documentation for this class was generated from the following file: