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}) -
constfactory
-
Sensor.fromJson(Map<
String, dynamic> json) -
factory
Properties
-
access
→ List<
Access> ? -
Is the list of granted access
no setterinherited
-
assignedAssets
→ List<
Asset> ? -
assignedAssetsis the list of assets assigned to this sensor.no setterinherited -
assignedAssetsIds
→ List<
String> ? -
assignedAssetsIdsis the list of assets ids assigned to this sensor.no setterinherited - contentType → String?
-
contentTypeis 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> ? -
csvHeadersis a list of strings to indicate the names of the columns of the CSV. Only whenhasHeadersis true.no setterinherited - csvSeparator → String?
-
csvSeparatoris a string to indicate the separator of the CSV.no setterinherited -
externalIdentifiers
→ List<
String> ? -
no setterinherited
- formula → String?
-
formulais the LCL formula to execute.no setterinherited - functionId → String?
-
functionIdis 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,csvHeadersandcsvSeparatormeans the configuration to unpack a CSV data comming from message.hasHeadersis a boolean to indicate if the CSV has headers inside of the message.no setterinherited - hasValidator → bool?
-
hasValidatoris a boolean to indicate if the sensor has a double validator. When true,minValurandmaxValuewill define the range, both values can benullif the minimum or maximum range is double.infinity.no setterinherited - icon → LayrzIcon?
-
iconof 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
-
idof the sensor. Must be unique along of all sensors of the asset.no setterinherited - isGlobal → bool
-
isGlobaldefines if the sensor is global or not.no setterinherited - isInstant → bool?
-
isInstantis a boolean to indicate if the sensor is an instant sensor. Means what the sensor execution returnsnull, if it'strue, the sensor is will "disappear" from the calculated sensors, otherwise it will be take the previous value of the sensor.no setterinherited - isTemplate → bool?
-
isTemplateis 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?
-
iterationCycleof the sensor. Only will accept positive valuesno setterinherited - lastExit → AtsExit?
-
lastExitis the last AtsExit registered by this sensor.no setterinherited -
mask
→ List<
MaskPoint> ? -
maskof the sensor. Is basically a list of MaskPoint objects.no setterinherited - maxHistorySearch → Duration?
-
maxHistorySearchdefines the maximum search interval for the history of the sensor.no setterinherited - maxValue → double?
-
maxValueis a double to indicate the maximum value of the sensor. Only whenhasValidatoris true.maxValuemust be greater thanminValue. IfmaxValueisnull, the minimum range is double.infinity.no setterinherited - measuringUnit → String?
-
measuringUnitof the sensor. Can be an estandard unit or a custom one.no setterinherited - minValue → double?
-
minValueis a double to indicate the minimum value of the sensor. Only whenhasValidatoris true. Can returnnullif the minimum range is double.infinity.no setterinherited - name → String
-
nameof the sensor. Must be unique along of all sensors of the asset.no setterinherited - parameter → String?
-
parameterof the sensor.no setterinherited - parent → Sensor?
-
parentis a Sensor to indicate the parent sensor.no setterinherited - parentId → String?
-
parentIdis a string to indicate the id of the parent sensor.no setterinherited - qrCode → String?
-
qrCodeis a string to indicate the QR code URI of the sensor.no setterinherited -
ranges
→ List<
SensorRange> ? -
rangesof the sensor, only forSensorType.intervallinear conversion. It's a list ofSensorPairobjects.no setterinherited - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- script → String?
-
scriptis the script to execute.no setterinherited - slug → String
-
slugof the sensor. Must be unique along of all sensors of the asset.no setterinherited - subtype → SensorSubType?
-
subTypeof the sensor.no setterinherited - type → SensorType?
-
typeof the sensor.no setterinherited
Methods
-
map<
TResult extends Object?> (TResult $default(_Sensor value)) → TResult -
Available on Sensor, provided by the SensorPatterns extension
Aswitch-like method, using callbacks. -
mapOrNull<
TResult extends Object?> (TResult? $default(_Sensor value)?) → TResult? -
Available on Sensor, provided by the SensorPatterns extension
A variant ofmapthat fallback to returningnull. -
maybeMap<
TResult extends Object?> (TResult $default(_Sensor value)?, {required TResult orElse()}) → TResult -
Available on Sensor, provided by the SensorPatterns extension
A variant ofmapthat fallback to returningorElse. -
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 ofwhenthat fallback to anorElsecallback. -
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
Aswitch-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 ofwhenthat fallback to returningnull
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited