andes.core.service.ExtendedEvent#
- class andes.core.service.ExtendedEvent(u, t_ext: int | float | BaseParam | BaseService = 0.0, trig: str = 'rise', enable=True, v_disabled=0, extend_only=False, vtype: type | None = None, name: str | None = None, tex_name=None, info=None)[source]#
Service for indicating an event for an extended, predefined period of time following the event disappearance.
The triggering of an event, whether the rise or fall edge, is specified through trig. For example, if trig = rise, the change of the input from 0 to 1 will be considered as an input, whereas the subsequent change back to 0 will be considered as the event end.
ExtendedEvent.v stores the flags whether the extended time has completed. Outputs will become 1 once the event starts and return to 0 when the extended time ends.
- Parameters:
- uv-provider
Triggering signal where the values are 0 or 1.
- trigstr in ("rise", "fall")
Triggering edge for the beginning of an event. rise by default.
- enablebool or v-provider
If disabled, the output will be v_disabled
- extend_onlybool
Only output during the extended period, not the event period.
Warning
The performance of this class needs to be optimized.
- __init__(u, t_ext: int | float | BaseParam | BaseService = 0.0, trig: str = 'rise', enable=True, v_disabled=0, extend_only=False, vtype: type | None = None, name: str | None = None, tex_name=None, info=None)[source]#
Methods
assign_memory(n)Assign memory for internal data.
check(**kwargs)Check if an extended event is in place.
get_names()Return name in a list
restore_init()No-op: VarService is recomputed each step.
snapshot_init()No-op: VarService is recomputed each step.
Attributes
class_nameReturn the class name
nReturn the count of values in
self.v.