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

Public Member Functions

None __init__ (self, Optional[Path] user_dir)
List[Drawing] list (self)
Optional[Drawing] get (self, str drawing_id_)
Drawing add (self, Mapping[str, Any] payload, *, str name, str source)

Public Attributes

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

Protected Member Functions

List[Drawing] _shipped (self)
List[Drawing] _feedtwin_library (self)
List[Drawing] _sample (self)
List[Drawing] _own_one (self, Path path)
List[Drawing] _own (self)

Detailed Description

The shipped set plus one user's own drawings.

Uploads and pulls live in ``<user dir>/layerx/drawings`` as ``<id>.json`` with
a ``<id>.meta.json`` beside them. Shipped drawings are read in place and
never copied.

Definition at line 292 of file sources.py.

Constructor & Destructor Documentation

◆ __init__()

None engine.layerx.sources.DrawingStore.__init__ ( self,
Optional[Path] user_dir )

Definition at line 300 of file sources.py.

Member Function Documentation

◆ _feedtwin_library()

List[Drawing] engine.layerx.sources.DrawingStore._feedtwin_library ( self)
protected
The drawings in the feed twin's library, read in place: Layer X burns the feed system
the twin holds (2026-10-03, "pull from it and trust it"), including what the twin pulled
from pid-designer, not only the files feed-twin ships.

Definition at line 330 of file sources.py.

References engine.layerx.sources._read(), engine.layerx.sources.drawing_id(), engine.layerx.sources.feedtwin_library_dir(), get(), list(), engine.layerx.sources.sha256(), and engine.layerx.sources.summarize().

Referenced by get(), and list().

◆ _own()

List[Drawing] engine.layerx.sources.DrawingStore._own ( self)
protected

Definition at line 425 of file sources.py.

References _own_one(), engine.layerx.measurements.MeasurementStore.dir, dir, and fs::directory_iterator.dir.

Referenced by get(), and list().

◆ _own_one()

List[Drawing] engine.layerx.sources.DrawingStore._own_one ( self,
Path path )
protected

◆ _sample()

List[Drawing] engine.layerx.sources.DrawingStore._sample ( self)
protected
The drawings in feed-twin's sample set, read in place: featured. A library that already
holds the same bytes lists it under the library's name (``list`` keeps the first met).

Definition at line 370 of file sources.py.

References engine.layerx.sources._read(), engine.layerx.sources.drawing_id(), get(), engine.layerx.sources.sample_dir(), engine.layerx.sources.sha256(), and engine.layerx.sources.summarize().

Referenced by get(), and list().

◆ _shipped()

List[Drawing] engine.layerx.sources.DrawingStore._shipped ( self)
protected

◆ add()

Drawing engine.layerx.sources.DrawingStore.add ( self,
Mapping[str, Any] payload,
* ,
str name,
str source )

◆ get()

Optional[Drawing] engine.layerx.sources.DrawingStore.get ( self,
str drawing_id_ )

◆ list()

List[Drawing] engine.layerx.sources.DrawingStore.list ( self)

Definition at line 435 of file sources.py.

References _feedtwin_library(), _own(), _sample(), and _shipped().

Referenced by _feedtwin_library().

Member Data Documentation

◆ dir

tuple engine.layerx.sources.DrawingStore.dir = (user_dir / "layerx" / "drawings") if user_dir is not None else None

Definition at line 301 of file sources.py.

Referenced by _own(), add(), and get().


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