Sensor class abstract

Available extensions
Annotations
  • @freezed

Constructors

Sensor({required String id, required String name, int? iterationCycle, required String slug, bool? isInstant, @IconOrNullConverter() LayrzIcon? icon, String? measuringUnit, @JsonKey.new(unknownEnumValue: SensorType.constant) SensorType? type, @JsonKey.new(unknownEnumValue: SensorSubType.raw) SensorSubType? subtype, String? parameter, List<String>? externalIdentifiers, String? formula, String? script, bool? hasHeaders, List<String>? csvHeaders, String? csvSeparator, List<SensorRange>? ranges, List<MaskPoint>? mask, bool? hasValidator, double? minValue, double? maxValue, String? contentType, String? parentId, Sensor? parent, String? functionId, AtsExit? lastExit, String? qrCode, List<String>? assignedAssetsIds, List<Asset>? assignedAssets, bool? isTemplate, @Default.new(false) bool isGlobal, List<Access>? access, @DurationOrNullConverter() Duration? maxHistorySearch})
const
factory
Sensor.fromJson(Map<String, dynamic> json)
factory

Properties

access List<Access>?
Is the list of granted access
no setterinherited
assignedAssets List<Asset>?
assignedAssets is the list of assets assigned to this sensor.
no setterinherited
assignedAssetsIds List<String>?
assignedAssetsIds is the list of assets ids assigned to this sensor.
no setterinherited
contentType String?
contentType is a string to indicate the content type of the sensor, only used for SensorType.image, SensorType.video and SensorType.audio, but only when the SensorSubType is SensorSubType.base64.
no setterinherited
copyWith → $SensorCopyWith<Sensor>
Create a copy of Sensor with the given fields replaced by the non-null parameter values.
no setterinherited
csvHeaders List<String>?
csvHeaders is a list of strings to indicate the names of the columns of the CSV. Only when hasHeaders is true.
no setterinherited
csvSeparator String?
csvSeparator is a string to indicate the separator of the CSV.
no setterinherited
externalIdentifiers List<String>?
no setterinherited
formula String?
formula is the LCL formula to execute.
no setterinherited
functionId String?
functionId is a string to indicate the id of the Function of the sensor.
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
hasHeaders bool?
Only for SensorType.unpack and SensorSubType.csv, hasHeaders, csvHeaders and csvSeparator means the configuration to unpack a CSV data comming from message. hasHeaders is a boolean to indicate if the CSV has headers inside of the message.
no setterinherited
hasValidator bool?
hasValidator is a boolean to indicate if the sensor has a double validator. When true, minValur and maxValue will define the range, both values can be null if the minimum or maximum range is double.infinity.
no setterinherited
icon → LayrzIcon?
icon of the sensor. To send it to API, will convert to javascript codename, but from Flutter execution will convert to LayrzIcon entity.
no setterinherited
id String
id of the sensor. Must be unique along of all sensors of the asset.
no setterinherited
isGlobal bool
isGlobal defines if the sensor is global or not.
no setterinherited
isInstant bool?
isInstant is a boolean to indicate if the sensor is an instant sensor. Means what the sensor execution returns null, if it's true, the sensor is will "disappear" from the calculated sensors, otherwise it will be take the previous value of the sensor.
no setterinherited
isTemplate bool?
isTemplate is a boolean to indicate if the sensor is a template. So, this sensor was created from the Golden M, and their authorized you to use it.
no setterinherited
iterationCycle int?
iterationCycle of the sensor. Only will accept positive values
no setterinherited
lastExit AtsExit?
lastExit is the last AtsExit registered by this sensor.
no setterinherited
mask List<MaskPoint>?
mask of the sensor. Is basically a list of MaskPoint objects.
no setterinherited
maxHistorySearch Duration?
maxHistorySearch defines the maximum search interval for the history of the sensor.
no setterinherited
maxValue double?
maxValue is a double to indicate the maximum value of the sensor. Only when hasValidator is true. maxValue must be greater than minValue. If maxValue is null, the minimum range is double.infinity.
no setterinherited
measuringUnit String?
measuringUnit of the sensor. Can be an estandard unit or a custom one.
no setterinherited
minValue double?
minValue is a double to indicate the minimum value of the sensor. Only when hasValidator is true. Can return null if the minimum range is double.infinity.
no setterinherited
name String
name of the sensor. Must be unique along of all sensors of the asset.
no setterinherited
parameter String?
parameter of the sensor.
no setterinherited
parent Sensor?
parent is a Sensor to indicate the parent sensor.
no setterinherited
parentId String?
parentId is a string to indicate the id of the parent sensor.
no setterinherited
qrCode String?
qrCode is a string to indicate the QR code URI of the sensor.
no setterinherited
ranges List<SensorRange>?
ranges of the sensor, only for SensorType.interval linear conversion. It's a list of SensorPair objects.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
script String?
script is the script to execute.
no setterinherited
slug String
slug of the sensor. Must be unique along of all sensors of the asset.
no setterinherited
subtype SensorSubType?
subType of the sensor.
no setterinherited
type SensorType?
type of the sensor.
no setterinherited

Methods

map<TResult extends Object?>(TResult $default(_Sensor value)) → TResult

Available on Sensor, provided by the SensorPatterns extension

A switch-like method, using callbacks.
mapOrNull<TResult extends Object?>(TResult? $default(_Sensor value)?) → TResult?

Available on Sensor, provided by the SensorPatterns extension

A variant of map that fallback to returning null.
maybeMap<TResult extends Object?>(TResult $default(_Sensor value)?, {required TResult orElse()}) → TResult

Available on Sensor, provided by the SensorPatterns extension

A variant of map that fallback to returning orElse.
maybeWhen<TResult extends Object?>(TResult $default(String id, String name, int? iterationCycle, String slug, bool? isInstant, LayrzIcon? icon, String? measuringUnit, SensorType? type, SensorSubType? subtype, String? parameter, List<String>? externalIdentifiers, String? formula, String? script, bool? hasHeaders, List<String>? csvHeaders, String? csvSeparator, List<SensorRange>? ranges, List<MaskPoint>? mask, bool? hasValidator, double? minValue, double? maxValue, String? contentType, String? parentId, Sensor? parent, String? functionId, AtsExit? lastExit, String? qrCode, List<String>? assignedAssetsIds, List<Asset>? assignedAssets, bool? isTemplate, bool isGlobal, List<Access>? access, Duration? maxHistorySearch)?, {required TResult orElse()}) → TResult

Available on Sensor, provided by the SensorPatterns extension

A variant of when that fallback to an orElse callback.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
Serializes this Sensor to a JSON map.
inherited
toString() String
A string representation of this object.
inherited
when<TResult extends Object?>(TResult $default(String id, String name, int? iterationCycle, String slug, bool? isInstant, LayrzIcon? icon, String? measuringUnit, SensorType? type, SensorSubType? subtype, String? parameter, List<String>? externalIdentifiers, String? formula, String? script, bool? hasHeaders, List<String>? csvHeaders, String? csvSeparator, List<SensorRange>? ranges, List<MaskPoint>? mask, bool? hasValidator, double? minValue, double? maxValue, String? contentType, String? parentId, Sensor? parent, String? functionId, AtsExit? lastExit, String? qrCode, List<String>? assignedAssetsIds, List<Asset>? assignedAssets, bool? isTemplate, bool isGlobal, List<Access>? access, Duration? maxHistorySearch)) → TResult

Available on Sensor, provided by the SensorPatterns extension

A switch-like method, using callbacks.
whenOrNull<TResult extends Object?>(TResult? $default(String id, String name, int? iterationCycle, String slug, bool? isInstant, LayrzIcon? icon, String? measuringUnit, SensorType? type, SensorSubType? subtype, String? parameter, List<String>? externalIdentifiers, String? formula, String? script, bool? hasHeaders, List<String>? csvHeaders, String? csvSeparator, List<SensorRange>? ranges, List<MaskPoint>? mask, bool? hasValidator, double? minValue, double? maxValue, String? contentType, String? parentId, Sensor? parent, String? functionId, AtsExit? lastExit, String? qrCode, List<String>? assignedAssetsIds, List<Asset>? assignedAssets, bool? isTemplate, bool isGlobal, List<Access>? access, Duration? maxHistorySearch)?) → TResult?

Available on Sensor, provided by the SensorPatterns extension

A variant of when that fallback to returning null

Operators

operator ==(Object other) bool
The equality operator.
inherited