STAR
Cal STAR — firmware, DAQ server, and engine design
Loading...
Searching...
No Matches
t7_integration.FakeElodin Class Reference

Public Member Functions

None __init__ (self)
None send_all (self, bytes data)
None command (self, int cmd, int uid, float ref)
list[tuple[int, float, int, int]] latest (self, int ain, int n=20)
bool wait_clients (self, int n, float timeout=10.0)
None close (self)

Public Attributes

 srv = socket.socket()
 port = self.srv.getsockname()[1]
list clients = []
 lock = threading.Lock()
list calibrated = []
set[int] raw_seen = set()
int raw_count = 0

Protected Member Functions

None _accept (self)
None _read (self, socket.socket c)

Detailed Description

Accepts any number of clients. A T7 raw packet from one is relayed to all the others
(elodin-db fanning a table out to its subscribers); every T7 calibrated packet is recorded.

Definition at line 109 of file t7_integration.py.

Constructor & Destructor Documentation

◆ __init__()

None t7_integration.FakeElodin.__init__ ( self)

Definition at line 113 of file t7_integration.py.

Member Function Documentation

◆ _accept()

None t7_integration.FakeElodin._accept ( self)
protected

Definition at line 126 of file t7_integration.py.

References _read(), clients, emmc_port_t.lock, lock, srv, and start().

◆ _read()

None t7_integration.FakeElodin._read ( self,
socket.socket c )
protected

◆ close()

None t7_integration.FakeElodin.close ( self)

Definition at line 199 of file t7_integration.py.

References clients, close(), emmc_port_t.lock, lock, and srv.

Referenced by engine.layerx.pool.WorkerPool.__exit__(), and close().

◆ command()

None t7_integration.FakeElodin.command ( self,
int cmd,
int uid,
float ref )
A CalibrationCommand [0x46,0x00]: ts | cmd @8 | pad | uid (u16 LE) @10 | ref f32 @12.

Definition at line 181 of file t7_integration.py.

References t7_integration.frame(), and send_all().

◆ latest()

list[tuple[int, float, int, int]] t7_integration.FakeElodin.latest ( self,
int ain,
int n = 20 )

Definition at line 185 of file t7_integration.py.

References calibrated, emmc_port_t.lock, and lock.

◆ send_all()

None t7_integration.FakeElodin.send_all ( self,
bytes data )

Definition at line 172 of file t7_integration.py.

References clients, emmc_port_t.lock, and lock.

Referenced by command().

◆ wait_clients()

bool t7_integration.FakeElodin.wait_clients ( self,
int n,
float timeout = 10.0 )

Definition at line 190 of file t7_integration.py.

References clients, emmc_port_t.lock, lock, and time.time().

Member Data Documentation

◆ calibrated

list t7_integration.FakeElodin.calibrated = []

Definition at line 121 of file t7_integration.py.

Referenced by _read(), and latest().

◆ clients

t7_integration.FakeElodin.clients = []

Definition at line 119 of file t7_integration.py.

Referenced by _accept(), _read(), close(), send_all(), and wait_clients().

◆ lock

t7_integration.FakeElodin.lock = threading.Lock()

Definition at line 120 of file t7_integration.py.

Referenced by _accept(), _read(), close(), latest(), send_all(), and wait_clients().

◆ port

◆ raw_count

int t7_integration.FakeElodin.raw_count = 0

Definition at line 123 of file t7_integration.py.

Referenced by _read().

◆ raw_seen

set[int] t7_integration.FakeElodin.raw_seen = set()

Definition at line 122 of file t7_integration.py.

Referenced by _read().

◆ srv

t7_integration.FakeElodin.srv = socket.socket()

Definition at line 114 of file t7_integration.py.

Referenced by _accept(), and close().


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