Skip to content

Transformations

Luis Llamas edited this page Apr 25, 2019 · 1 revision

Transformation Select

Emit received items transformed by a function

Select(ReactiveFunction<T> function)

Transformation Cast

Cast received item to another type

Cast()

Transformation Map

Emit received items transformed by a function to another type

Map(ReactiveMap<Torig, Tdest> map)

Transformation Reduce

Apply a function to each item emitted by an Observable, sequentially

Reduce(ReactiveCompound<T> function)

Transformation Limit

Emits received item cropped by a lower and upper limit

Limit(T lowerLimit, T upperLimit)

Transformation LimitUpper

Emits received item cropped by an upper limit

LimitUpper(T upperLimit)

Transformation LimitLower

Emits received item cropped by a lower limit

LimitLower(T lowerLimit)

Transformation Scale

Emits received items scaled (interpolated) to a different range

Scale(T input_min, T input_max, T output_min, T output_max)

Transformation Timestamp

Emits timestamp when a item is received

Millis version

Millis()

Micros version

Micros()

Transformation Elapsed

Emits time elapsed since last item is received

Millis version

ElapsedMillis()

Micros version

ElapsedMicros()

Transformation Toggle

Emits an state that toggles each time an item is received

Toggle(bool state = false)

Transformation Threshold

Emits an state which varies when the value received goes above or below a certain Threshold

Threshold(T threshold)
Threshold(T threshold, bool initialState)
Threshold(T lowThreshold, T highThreshold)
Threshold(T lowThreshold, T highThreshold, bool initialState)

Transformation AdcToVoltage

Emits an state that toggles each time an item is received

TransformationAdcToVoltage<T>& AdcToVoltage(T input_max = 1023, T output_max = 5.0)

Transformation Split

Split an string using a separator

Split(char separator = ',')

Transformation Buffer

Emits and String that contatenates all received items

Buffer()

Transformation Join

Join received items using a separator

Join(char separator = ',')

Transformation ToBool

Emits true if received item is not equal zero

ParseInt()

Transformation ParseInt

Emits received items parsed to Int

ParseInt()

Transformation ParseFloat

Emits received items parsed to Float

ParseFloat()