|
RBC_Test_Sim_Core 0.1.0 build 51fd23e
Shared transport-layer plumbing for the ADR-029 Train/IL/CTC RBC simulators
|
Public Member Functions | |
| __init__ (self, saf_session, ec_period_ms, *, seq_window=1, ec_alarm_state=3) | |
| start (self) | |
| send (self, pdu) | |
| recv (self) | |
| tick (self) | |
Public Attributes | |
| saf = saf_session | |
| ec_period_ms = ec_period_ms | |
| int | seq_window = seq_window or 1 |
| int | ec_alarm_state = ec_alarm_state or 3 |
| int | seq_tx = 0 |
| int | seq_rx = 0 |
| bool | seq_rx_valid = False |
| int | ec_tx = 0 |
| int | peer_ec_period_ms = None |
| int | ratio = None |
| int | expected_ec = None |
| int | last_rx_ec = 0 |
| bool | ec_initialized = False |
| int | ec_state = 0 |
Protected Member Functions | |
| _header (self, msg_type, seq, ec) | |
One SAI connection, layered over an already-connected :class:`simcore.saf.SafSession`. ``ec_period_ms`` is this side's own EC (execution cycle) period. ``seq_window`` is N of SS5.4.7 (up to ``seq_window - 1`` missing messages tolerated; default 1, no gaps allowed). ``ec_alarm_state`` is the Delta at/above which freshness fails (default 3, matching the spec's own worked example).
| simcore.sai.SaiSession.__init__ | ( | self, | |
| saf_session, | |||
| ec_period_ms, | |||
| * | , | ||
| seq_window = 1, | |||
| ec_alarm_state = 3 ) |
|
protected |
| simcore.sai.SaiSession.recv | ( | self | ) |
| simcore.sai.SaiSession.start | ( | self | ) |
| simcore.sai.SaiSession.tick | ( | self | ) |
Advance our own EC by one: call this once per ``ec_period_ms`` elapsed on the caller's clock. Updates the expected-EC estimate and the freshness state (SS5.4.9.4.4-7), reporting the state computed BEFORE advancing Ex for the next cycle (so the first tick after a fresh receive is 0).
| int simcore.sai.SaiSession.ec_alarm_state = ec_alarm_state or 3 |