T2T (Trigger-To-Trigger)

Searches the table for particular conditions ('triggers') to be met, making time-frames out of the spaces between them.

This layer deletes the table.

Parameters

NameDefaultMeaning
aThe condition for the start trigger
bThe condition for the end trigger. If not provided, 'a' is used.
insideinsideThe name used for all times inside the range (ie. 'Loading')
outsideThe optional name used for all times outside the range (ie. 'Not Loading')

Description

This layer searches a table of values to look for when the 'a' (and optionally 'b') conditions are met.

It then creates time-frames for each of these time-windows between.

For example, Trigger A might be {Speed} > 0 while Trigger B might be {Speed} == 0.

This will then create timeframes for all times when your speed is greater than 0.

Single Trigger

If you only specify a Trigger A, the system will capture the time it takes for the condition to happen again. So a trigger like {Speed} == 0 would create timeframes for every window where the machine ran.

Naming Outside Times

If you provide an outside name, time-frames will also be created for the opposite conditions - the times between Trigger B and Trigger A.

For example, lets say we have a machine that moves between 0 and 100%, along with the following layer…

{
   "type": "t2t",
   "a": "{Machine.Position} < 2",
   "b": "{Machine.Position} > 98",
   "inside": "Leaving",
   "outside": "Returning"
}

In this case, you'll get leaving timeframes when the machine is heading from 0% to 100%, and returning timeframes when the machine is heading back towards 0%.

Example

If the frame contains the following table of data…

AttributeValue
StartTime09:00AM
EndTime10:00AM
TimeMachine.Position
09:00AM0
09:10AM20
09:20AM80
09:30AM100
09:40AM50
09:50AM12
10:00AM0
{
   "type": "t2t",
   "a": "{Machine.Position} < 2",
   "b": "{Machine.Position} > 98",
   "inside": "Leaving",
   "outside": "Returning"
}

The final result will be two time-frames.

StartTimeEndTimeName
09:00AM9:30AMLeaving
09:30AM10:00AMReturning