trigger
signal TPT.trigger(timed_boolean start, timed_boolean stop, timed_boolean abort)
This function searches for all time intervals between start
and stop
as follows: If the start
condition is true
and the abort
condition is false
, a time interval starts. The time interval terminates as soon
as the stop
condition is true
, or at the end of the current context
interval. However, if the abort
condition is true
before the
stop
condition the interval is dropped and ignored. The search starts again at the
next sample.
This functionality is similar to the "Trigger rule" assesslet.
Note that if the stop
condition is undefined it will not terminate
the interval. In order to force the interval to terminate even if the stop condition is
undefined you can call signal.isDefined(t)
explicitly in the stop condition (e.g.
instead of "(x(t)==17)" use "(x.isUndef(t) or x(t)==17)".
Parameters:
start Condition that starts the interval.
stop Condition that stops the interval.
abort
Condition that rejects the interval from evaluation. If abort
condition is defined as "false
", this feature is turned off.
Returns:
A signal indicating the trigger intervals detected
Examples:
Check_1 = TPT.BooleanX("If the light_switch is turned to AUTO_MODE, and the light_intensity is \ lower-equal to 70, the headlight should turn on immediately.") during TPT.trigger(light_switch(t-@)!=AUTO_MODE and light_switch(t)==AUTO_MODE and light_intensity<=70,light_switch(t-@)==AUTO_MODE,false): Check_1 := TPT.checkAlways(headlight == true,"light_switch is turned to AUTO_MODE,\ light_intensity is lower-equal 70 and headlight is ON", "light_switch is turned to AUTO_MODE,\ light_intensity is lower-equal 70, but headlight is OFF") #Report as failed if there is no matching interval if not TPT.exists(Check_1): Check_1:=false