====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===
^Name^Default^Meaning^
|a||The condition for the start trigger|
|b||The condition for the end trigger. If not provided, 'a' is used.|
|inside|inside|The name used for all times inside the range (ie. 'Loading')|
|outside||The //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...
^Attribute^Value^
|StartTime|09:00AM|
|EndTime|10:00AM|
^Time^Machine.Position^
|09:00AM|0|
|09:10AM|20|
|09:20AM|80|
|09:30AM|100|
|09:40AM|50|
|09:50AM|12|
|10:00AM|0|
{
"type": "t2t",
"a": "{Machine.Position} < 2",
"b": "{Machine.Position} > 98",
"inside": "Leaving",
"outside": "Returning"
}
The final result will be two time-frames.
^StartTime^EndTime^Name^
|09:00AM|9:30AM|Leaving|
|09:30AM|10:00AM|Returning|