SimCore
Shared transport-layer plumbing for the ADR-029 Train/IL/CTC RBC simulators
Loading...
Searching...
No Matches
simcore.status_report.StatusReporter Class Reference

Public Member Functions

 __init__ (self, log, link, unit, log_source, kind=SIM_STATUS_KIND, period_s=PERIOD_S, clock=time.monotonic, frame_size=rbc_wire.ENVELOPE_SIZE)
 emit (self, extra=None)
 tick (self, extra=None)

Protected Member Functions

 _payload (self, extra)

Protected Attributes

 _log = log
 _link = link
 _unit = unit
 _source = log_source
 _kind = kind
 _period = period_s
 _clock = clock
 _frame_size = frame_size
float _next = 0.0

Detailed Description

Cadence + encode + log + send for one sim's status heartbeat.

Definition at line 28 of file status_report.py.

Constructor & Destructor Documentation

◆ __init__()

simcore.status_report.StatusReporter.__init__ ( self,
log,
link,
unit,
log_source,
kind = SIM_STATUS_KIND,
period_s = PERIOD_S,
clock = time.monotonic,
frame_size = rbc_wire.ENVELOPE_SIZE )
@param frame_size: passed straight through to rbc_wire.encode_opaque() -
override if @link's own channel uses a wider fixed slot than the
default ENVELOPE_SIZE (see that function's own doc).

Definition at line 31 of file status_report.py.

Member Function Documentation

◆ _payload()

simcore.status_report.StatusReporter._payload ( self,
extra )
protected

Definition at line 46 of file status_report.py.

◆ emit()

simcore.status_report.StatusReporter.emit ( self,
extra = None )
Report now, unconditionally - use once at startup.

Definition at line 70 of file status_report.py.

◆ tick()

simcore.status_report.StatusReporter.tick ( self,
extra = None )
Report iff PERIOD_S has elapsed since the last report.

Definition at line 77 of file status_report.py.

Member Data Documentation

◆ _clock

simcore.status_report.StatusReporter._clock = clock
protected

Definition at line 42 of file status_report.py.

◆ _frame_size

simcore.status_report.StatusReporter._frame_size = frame_size
protected

Definition at line 43 of file status_report.py.

◆ _kind

simcore.status_report.StatusReporter._kind = kind
protected

Definition at line 40 of file status_report.py.

◆ _link

simcore.status_report.StatusReporter._link = link
protected

Definition at line 37 of file status_report.py.

◆ _log

simcore.status_report.StatusReporter._log = log
protected

Definition at line 36 of file status_report.py.

◆ _next

float simcore.status_report.StatusReporter._next = 0.0
protected

Definition at line 44 of file status_report.py.

◆ _period

simcore.status_report.StatusReporter._period = period_s
protected

Definition at line 41 of file status_report.py.

◆ _source

simcore.status_report.StatusReporter._source = log_source
protected

Definition at line 39 of file status_report.py.

◆ _unit

simcore.status_report.StatusReporter._unit = unit
protected

Definition at line 38 of file status_report.py.


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