Runner's High
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Properties | List of all members
Accel.StateDetector Class Reference

A basic binary on/off statemachine that updates independently, taking one or multiple instances of DataOuput as its input. More...

Inheritance diagram for Accel.StateDetector:
Accel.DataOutput< float > Accel.StateOutput Accel.DataInput< float > Accel.ProgressDetector Accel.StepDetector

Public Member Functions

void AddInputVal (DataOutput< float > input, float onThreshold=1, float offThreshold=0)
 Add an input to the StateDetector. More...
 

Public Attributes

List< float > OnThresholds = new List<float>()
 
List< float > OffThresholds = new List<float>()
 
float minTriggerTime = 0
 The minimum time between subsequent triggers. Can be handy to prevent false triggers. More...
 
int onCount = 0
 How many times the detector switched to on since Scene start. More...
 

Protected Member Functions

unsafe void Update ()
 

Protected Attributes

List< DataOutput< float > > inputs = new List<DataOutput<float>>()
 
bool on
 
float floatState = 0
 

Properties

DataOutput< float > InputVal [get, set]
 The object this instance gets its data from. Must be of type DataOuput. Deletes all other inputs that are currently assigned.
 
float OnThreshold [get, set]
 The OnThreshold (if only 1 input is assigned), or the OnThreshold of the first input (if multiple inputs are assigned) More...
 
float OffThreshold [get, set]
 The OffThreshold (if only 1 input is assigned), or the OffThreshold of the first input (if multiple inputs are assigned) More...
 
bool off [get, set]
 
bool On [get]
 The current state of the detector.
 
float Val [get]
 The current state of the detector, converted to float.
 
- Properties inherited from Accel.DataOutput< float >
Val [get]
 The current output calue.
 
- Properties inherited from Accel.StateOutput
bool On [get]
 
- Properties inherited from Accel.DataInput< float >
DataOutput< T > InputVal [get, set]
 

Detailed Description

A basic binary on/off statemachine that updates independently, taking one or multiple instances of DataOuput as its input.

Member Function Documentation

◆ AddInputVal()

void Accel.StateDetector.AddInputVal ( DataOutput< float >  input,
float  onThreshold = 1,
float  offThreshold = 0 
)

Add an input to the StateDetector.

Parameters
inputThe input to add.
onThresholdThe OnThreshold for the new input.
offThresholdThe OfThreshold for the new input.

Member Data Documentation

◆ minTriggerTime

float Accel.StateDetector.minTriggerTime = 0

The minimum time between subsequent triggers. Can be handy to prevent false triggers.

◆ onCount

int Accel.StateDetector.onCount = 0

How many times the detector switched to on since Scene start.

Property Documentation

◆ OffThreshold

float Accel.StateDetector.OffThreshold
getset

The OffThreshold (if only 1 input is assigned), or the OffThreshold of the first input (if multiple inputs are assigned)

◆ OnThreshold

float Accel.StateDetector.OnThreshold
getset

The OnThreshold (if only 1 input is assigned), or the OnThreshold of the first input (if multiple inputs are assigned)


The documentation for this class was generated from the following file: