observable_interface
Defines the contract for observable components within the safety system.
ObservableInterface
Bases: ABC
Abstract interface for objects that need to be monitored by a SafetyObserver.
It defines the mechanism for attaching observers and broadcasting calculation results.
Source code in src/ecc_analyzer/interfaces/observable_interface.py
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | |
attach(observer)
abstractmethod
Registers a listener (observer) to receive notifications upon computation events.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
observer
|
SafetyObserver
|
The SafetyObserver instance to be registered. |
required |
Source code in src/ecc_analyzer/interfaces/observable_interface.py
17 18 19 20 21 22 23 24 | |
notify(input_ports, spfm_in, lfm_in, spfm_out, lfm_out)
abstractmethod
Broadcasts the computation results and visual context to all registered observers.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
input_ports
|
dict
|
Mapping of fault types to incoming node IDs for visualization. |
required |
spfm_in
|
dict[FaultType, float]
|
Incoming residual/SPFM fault rates. |
required |
lfm_in
|
dict[FaultType, float]
|
Incoming latent/LFM fault rates. |
required |
spfm_out
|
dict[FaultType, float]
|
Transformed outgoing SPFM fault rates. |
required |
lfm_out
|
dict[FaultType, float]
|
Transformed outgoing LFM fault rates. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
dict |
dict
|
The visual output ports generated by the observers. |
Source code in src/ecc_analyzer/interfaces/observable_interface.py
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | |