FlowManager Documentation Beta

Structure Flow​Parameters

public struct FlowParameters: Codable, Equatable

Configuration parameters for the FlowManager object

%3 FlowParameters FlowParameters Equatable Equatable FlowParameters->Equatable Codable Codable FlowParameters->Codable

Conforms To

Codable
Equatable

Initializers

init(expected​Time​Interval:​accepted​Delay:​ignore​First​Samples:​device:​enable​Logging:​immediate​Alarm:​normal​Range:​light​Sleep​Range:​deep​Sleep​Range:​anomaly​Max​Lenght​Seconds:​bpm​Speed​Alarm:​hrv​Buffer​Size:​average​Speed​Buffer​Size:​)

public init(expectedTimeInterval: TimeInterval = 0.0, acceptedDelay: TimeInterval = 0.0, ignoreFirstSamples: Int = 0, device: Device = .appleWatch, enableLogging: Bool = false, immediateAlarm: ParamsRange = ParamsRange(), normalRange: ParamsRange = ParamsRange(), lightSleepRange: ParamsRange = ParamsRange(), deepSleepRange: ParamsRange = ParamsRange(), anomalyMaxLenghtSeconds: Int = 0, bpmSpeedAlarm: Double = 0.0, hrvBufferSize: Int = 50, averageSpeedBufferSize: Int = 5)

Initialize the FlowParameters

Properties

expected​Time​Interval

var expectedTimeInterval: TimeInterval

Expected frequency of the sample stream expressed in terms of seconds between each samples.

accepted​Delay

var acceptedDelay: TimeInterval

Maximum delay accepted between two samples in a stream expressed in seconds. If the new sample has a time difference from the previous sample greater then this value a noData event is fired.

ignore​First​Samples

var ignoreFirstSamples: Int

Number of initial samples to be ignored at the beginning of a stream.

device

var device: Device

The type of source device used to collect input sample data.

enable​Logging

var enableLogging: Bool

Enable logging on console output the processing of each sample in the stream.

immediate​Alarm

var immediateAlarm: ParamsRange

The min max range values for immediate alarm condition. The FlowManager immediatly fire an alarm event if the input sample BPM value is lower then the min or greater then the max. If a flow of contiguous sample data generating alarm condition is interrupted with other events such as a normal BMP value or missing values then the alarm condition is reset and the FlowManager fire a backToNormal event.

normal​Range

var normalRange: ParamsRange

The min max range values for warning condition. The FlowManager immediatly fire a warning event if the input sample BPM value is lower then the min or greater then the max and at the same time the BPM value is not outside the immediateAlarm range parameter. It the stream of sample data continue to feed samples with a BML value generating a warning event for a period of time greater then the anomalyMaxLenghtSeconds parameter then the FlowManager will fire a alarm event. If a flow of contiguous sample data generating warning condition is interrupted with other events such as a normal BMP value or missing values then the warning condition is reset.

light​Sleep​Range

var lightSleepRange: ParamsRange

The min max range values for a light sleep condition withing the normalRange of values.

deep​Sleep​Range

var deepSleepRange: ParamsRange

The min max range values for a deep sleep condition withing the normalRange of values.

anomaly​Max​Lenght​Seconds

var anomalyMaxLenghtSeconds: Int

The number of seconds after a continuous and persistant warning condition fire an alarm event.

bpm​Speed​Alarm

var bpmSpeedAlarm: Double

The anomaly accelleration detection value. If the input sample BPM value is greater then this value then a alarm notification is fired. 0.0 to disable this check.

hrv​Buffer​Size

var hrvBufferSize: Int

Size of the circular buffer used for calcolating the HRV value.
Expressed as number of historic sample to consider for calculating the average.

average​Speed​Buffer​Size

var averageSpeedBufferSize: Int

Size of the circular buffer used for calcolating the average speed value.
Expressed as number of historic sample to consider for calculating the average.

Methods

==(lhs:​rhs:​)

public static func ==(lhs: FlowParameters, rhs: FlowParameters) -> Bool

Implement Equatable protocol to confront two FlowParameters object