Avena Webapp API - v0.0.1
    Preparing search index...

    Function findTriggerCrossing

    • Finds the first threshold crossing at or after fromIndex.

      Rising fires when the previous present value is at or below the threshold and the current one is above it; falling is the mirror. A crossing counts only if it is after notBefore and the buffer already holds the full pre-trigger window before it.

      Parameters

      • buffer: DataPoint[]

        Live buffer, sorted by time.

      • fromIndex: number

        First index that may fire.

      • settings: TriggerSettings

        Trigger settings.

      • notBefore: number = Number.NEGATIVE_INFINITY

        Crossings at or before this time (Unix ms) are ignored.

      Returns number

      Index of the crossing sample, or -1.