diff options
author | Scott Murray <scott.murray@konsulko.com> | 2023-09-24 12:45:03 -0400 |
---|---|---|
committer | Scott Murray <scott.murray@konsulko.com> | 2023-09-24 12:55:47 -0400 |
commit | 80a4f8d75a66c22a23e825d4c0fb4065e2e58cb8 (patch) | |
tree | 07751588fbd9f0a5cecceabe593a716f01facbac | |
parent | 9bc83e64c508ad8c69a3950d5421774f9b53a31f (diff) |
Rework to use KUKSA.val databroker gRPC API
Rework to move from the WebSocket API with the older KUKSA.val
server to the gRPC "VAL" API of the databroker.
Changes include:
- All VISS WebSocket API code has been removed, and the signal
providers replumbed to be driven by a new VssClient class with
a dashboard-specific child class to hold all the gRPC API
handling.
- The generated code for the VAL API and its dependencies has
been checked in under lib/generated, as there still does not
seem to be a good way to generate it during the Flutter build.
- The "flutter-" prefix has been dropped from the configuration
file name (i.e. it's now just "cluster-dashboard.yaml") to match
the naming used for the other Flutter applications. The
authorization token field name has been renamed to "authorization",
and there are new "use-tls" and "ca-certificate" configuration
fields. TLS is disabled by default for now, and the default CA
certificate is /etc/kuksa.val/CA.pem.
- Bumped minimum SDK version to 2.18 in pubspec.yaml to enable
"super" keyword support. This matches what the version was set
to in the other applications.
- The unused navigation support has been removed to simplify
maintenance, as it is more likely that it will be replaced with
something else in the future than fixed to be usable.
- Removed .dart_tool generated output that had been checked in,
and added .gitignore file from flutter-homescreen so that things
will hopefully stay clean in the future. Since pubspec.lock is
not checked in here, it has also been added to .gitignore.
Bug-AGL: SPEC-4762
Signed-off-by: Scott Murray <scott.murray@konsulko.com>
Change-Id: Id35c569cdbb8476a527717ece7b4bb369c4874b7
36 files changed, 3958 insertions, 1224 deletions
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..93d6136 --- /dev/null +++ b/.gitignore @@ -0,0 +1,52 @@ +# Miscellaneous +*.class +*.log +*.pyc +*.swp +.DS_Store +.atom/ +.buildlog/ +.history +.svn/ + +# IntelliJ related +*.iml +*.ipr +*.iws +.idea/ + +# The .vscode folder contains launch configuration and tasks you configure in +# VS Code which you may wish to be included in version control, so this line +# is commented out by default. +#.vscode/ + +# Flutter/Dart/Pub related +**/doc/api/ +**/ios/Flutter/.last_build_id +.dart_tool/ +.flutter-plugins +.flutter-plugins-dependencies +.packages +.pub-cache/ +.pub/ +/build/ +/engine_sdk/ +libapp.so +pubspec.lock + +# Web related +lib/generated_plugin_registrant.dart + +# Symbolication related +app.*.symbols + +# Obfuscation related +app.*.map.json + +# Android Studio will place build artifacts here +/android/app/debug +/android/app/profile +/android/app/release + +# the linux folder should be present when building for AGL +linux/ diff --git a/lib/cluster_config.dart b/lib/cluster_config.dart deleted file mode 100644 index 7a81360..0000000 --- a/lib/cluster_config.dart +++ /dev/null @@ -1,163 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 - -import 'dart:io'; -import 'package:flutter/material.dart'; -import 'package:flutter_cluster_dashboard/vehicle_signal/initial_socket_connection.dart'; -import 'package:flutter_riverpod/flutter_riverpod.dart'; -import 'package:yaml/yaml.dart'; - -class GetConfig extends ConsumerStatefulWidget { - const GetConfig({Key? key, required this.client}) : super(key: key); - final HttpClient client; - - @override - ConsumerState<GetConfig> createState() => _GetConfigState(); -} - -class _GetConfigState extends ConsumerState<GetConfig> { - @override - void initState() { - super.initState(); - WidgetsBinding.instance.addPostFrameCallback((timeStamp) { - final configStateProvider = ref.read(clusterConfigStateprovider.notifier); - - String configFilePath = '/etc/xdg/AGL/flutter-cluster-dashboard.yaml'; - String orsKeyFilePath = '/etc/default/openroutekey'; - - String keyContent = ""; - - final configFile = File(configFilePath); - final orsKeyFile = File(orsKeyFilePath); - - configFile.readAsString().then((content) { - final dynamic yamlMap = loadYaml(content); - configStateProvider.update( - hostname: yamlMap['hostname'], - port: yamlMap['port'], - enableNavigation: yamlMap['enableNavigation'], - homeLat: yamlMap['homeLat'], - homeLng: yamlMap['homeLng'], - orsPathParam: yamlMap['orsPathParam'], - kuksaAuthToken: yamlMap['kuskaAuthToken'], - ); - }); - - orsKeyFile.readAsString().then((content) { - keyContent = content.split(':')[1].trim(); - if (keyContent.isNotEmpty && - keyContent != 'YOU_NEED_TO_SET_IT_IN_LOCAL_CONF') { - configStateProvider.update(orsApiKey: keyContent); - } else { - print("WARNING: openrouteservice API Key not found !"); - } - }); - }); - } - - @override - Widget build(BuildContext context) { - final config = ref.watch(clusterConfigStateprovider); - if (config.hostname == "" || - config.port == 0 || - config.kuksaAuthToken == "" || - config.homeLat == 0 || - config.homeLng == 0 || - config.orsPathParam == "") { - return Scaffold( - body: Center( - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.center, - children: const [ - Text("ERROR", - style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold)), - Text( - "Something Wrong with config file! Check config.yaml file and restart"), - ], - )), - ); - } - return InitialScreen(client: widget.client); - } -} - -class ClusterConfig { - ClusterConfig({ - required this.hostname, - required this.port, - required this.kuksaAuthToken, - required this.enableNavigation, - required this.orsApiKey, - required this.orsPathParam, - required this.homeLat, - required this.homeLng, - }); - final String hostname; - final int port; - final String kuksaAuthToken; - final bool enableNavigation; - final double homeLat; - final double homeLng; - final String orsApiKey; - final String orsPathParam; - - ClusterConfig copywith({ - String? hostname, - int? port, - String? kuksaAuthToken, - bool? enableNavigation, - double? homeLat, - double? homeLng, - String? orsApiKey, - String? orsPathParam, - }) => - ClusterConfig( - hostname: hostname ?? this.hostname, - port: port ?? this.port, - kuksaAuthToken: kuksaAuthToken ?? this.kuksaAuthToken, - enableNavigation: enableNavigation ?? this.enableNavigation, - orsApiKey: orsApiKey ?? this.orsApiKey, - orsPathParam: orsPathParam ?? this.orsPathParam, - homeLat: homeLat ?? this.homeLat, - homeLng: homeLng ?? this.homeLng, - ); -} - -class ClusterConfigStateNotifier extends StateNotifier<ClusterConfig> { - ClusterConfigStateNotifier() : super(_initialValue); - static final ClusterConfig _initialValue = ClusterConfig( - hostname: "", - port: 0, - kuksaAuthToken: "", - enableNavigation: false, - orsApiKey: "", - orsPathParam: "", - homeLat: 0, - homeLng: 0, - ); - void update({ - String? hostname, - int? port, - String? kuksaAuthToken, - bool? enableNavigation, - double? homeLat, - double? homeLng, - String? orsApiKey, - String? orsPathParam, - }) { - state = state.copywith( - hostname: hostname, - port: port, - kuksaAuthToken: kuksaAuthToken, - enableNavigation: enableNavigation, - homeLat: homeLat, - homeLng: homeLng, - orsApiKey: orsApiKey, - orsPathParam: orsPathParam, - ); - } -} - -final clusterConfigStateprovider = - StateNotifierProvider<ClusterConfigStateNotifier, ClusterConfig>( - (ref) => ClusterConfigStateNotifier()); diff --git a/lib/config.dart b/lib/config.dart new file mode 100644 index 0000000..1939b03 --- /dev/null +++ b/lib/config.dart @@ -0,0 +1,108 @@ +// SPDX-License-Identifier: Apache-2.0 +import 'dart:io'; +import 'package:flutter/foundation.dart'; +import 'package:flutter_riverpod/flutter_riverpod.dart'; +import 'package:yaml/yaml.dart'; + +class KuksaConfig { + final String hostname; + final int port; + final String authorization; + final bool use_tls; + final List<int> ca_certificate; + final String tls_server_name; + + static String configFilePath = '/etc/xdg/AGL/cluster-dashboard.yaml'; + static String defaultHostname = 'localhost'; + static int defaultPort = 55555; + static String defaultCaCertPath = '/etc/kuksa-val/CA.pem'; + + KuksaConfig({required this.hostname, required this.port, required this.authorization, + required this.use_tls, required this.ca_certificate, required this.tls_server_name}); +} + +// NOTE: This may need to be changed to a FutureProvider to avoid slowing +// down the top-level widget initState... + +final kuksaConfigProvider = Provider((ref) { + final configFile = File(KuksaConfig.configFilePath); + try { + print("Reading configuration ${KuksaConfig.configFilePath}"); + String content = configFile.readAsStringSync(); + final dynamic yamlMap = loadYaml(content); + + String hostname = KuksaConfig.defaultHostname; + if (yamlMap.containsKey('hostname')) { + hostname = yamlMap['hostname']; + } + + int port = KuksaConfig.defaultPort; + if (yamlMap.containsKey('port')) { + port = yamlMap['port']; + } + + String token = ""; + if (yamlMap.containsKey('authorization')) { + String s = yamlMap['authorization']; + if (s.isNotEmpty) { + if (s.startsWith("/")) { + debugPrint("Reading authorization token $s"); + try { + token = File(s).readAsStringSync(); + } on Exception catch(_) { + print("ERROR: Could not read authorization token file $token"); + token = ""; + } + } else { + token = s; + } + } + } + //debugPrint("authorization = $token"); + + bool use_tls = false; + if (yamlMap.containsKey('use-tls')) { + var value = yamlMap['use-tls']; + if (value is bool) + use_tls = value; + } + //debugPrint("Use TLS = $use_tls"); + + List<int> ca_cert = []; + String ca_path = KuksaConfig.defaultCaCertPath; + if (yamlMap.containsKey('ca-certificate')) { + ca_path = yamlMap['ca-certificate']; + } + try { + ca_cert = File(ca_path).readAsBytesSync(); + } on Exception catch(_) { + print("ERROR: Could not read CA certificate file $ca_path"); + ca_cert = []; + } + //debugPrint("CA cert = $ca_cert"); + + String tls_server_name = ""; + if (yamlMap.containsKey('tls-server-name')) { + tls_server_name = yamlMap['tls_server_name']; + } + + return KuksaConfig( + hostname: hostname, + port: port, + authorization: token, + use_tls: use_tls, + ca_certificate: ca_cert, + tls_server_name: tls_server_name + ); + } on Exception catch(_) { + return KuksaConfig( + hostname: KuksaConfig.defaultHostname, + port: KuksaConfig.defaultPort, + authorization: "", + use_tls: false, + ca_certificate: [], + tls_server_name: "" + ); + } +}); + diff --git a/lib/generated/google/protobuf/timestamp.pb.dart b/lib/generated/google/protobuf/timestamp.pb.dart new file mode 100644 index 0000000..ca4a49a --- /dev/null +++ b/lib/generated/google/protobuf/timestamp.pb.dart @@ -0,0 +1,83 @@ +/// +// Generated code. Do not modify. +// source: google/protobuf/timestamp.proto +// +// @dart = 2.12 +// ignore_for_file: annotate_overrides,camel_case_types,constant_identifier_names,directives_ordering,library_prefixes,non_constant_identifier_names,prefer_final_fields,return_of_invalid_type,unnecessary_const,unnecessary_import,unnecessary_this,unused_import,unused_shown_name + +import 'dart:core' as $core; + +import 'package:fixnum/fixnum.dart' as $fixnum; +import 'package:protobuf/protobuf.dart' as $pb; + +import 'package:protobuf/src/protobuf/mixins/well_known.dart' as $mixin; + +class Timestamp extends $pb.GeneratedMessage with $mixin.TimestampMixin { + static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'Timestamp', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'google.protobuf'), createEmptyInstance: create, toProto3Json: $mixin.TimestampMixin.toProto3JsonHelper, fromProto3Json: $mixin.TimestampMixin.fromProto3JsonHelper) + ..aInt64(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'seconds') + ..a<$core.int>(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'nanos', $pb.PbFieldType.O3) + ..hasRequiredFields = false + ; + + Timestamp._() : super(); + factory Timestamp({ + $fixnum.Int64? seconds, + $core.int? nanos, + }) { + final _result = create(); + if (seconds != null) { + _result.seconds = seconds; + } + if (nanos != null) { + _result.nanos = nanos; + } + return _result; + } + factory Timestamp.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory Timestamp.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') + Timestamp clone() => Timestamp()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + Timestamp copyWith(void Function(Timestamp) updates) => super.copyWith((message) => updates(message as Timestamp)) as Timestamp; // ignore: deprecated_member_use + $pb.BuilderInfo get info_ => _i; + @$core.pragma('dart2js:noInline') + static Timestamp create() => Timestamp._(); + Timestamp createEmptyInstance() => create(); + static $pb.PbList<Timestamp> createRepeated() => $pb.PbList<Timestamp>(); + @$core.pragma('dart2js:noInline') + static Timestamp getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<Timestamp>(create); + static Timestamp? _defaultInstance; + + @$pb.TagNumber(1) + $fixnum.Int64 get seconds => $_getI64(0); + @$pb.TagNumber(1) + set seconds($fixnum.Int64 v) { $_setInt64(0, v); } + @$pb.TagNumber(1) + $core.bool hasSeconds() => $_has(0); + @$pb.TagNumber(1) + void clearSeconds() => clearField(1); + + @$pb.TagNumber(2) + $core.int get nanos => $_getIZ(1); + @$pb.TagNumber(2) + set nanos($core.int v) { $_setSignedInt32(1, v); } + @$pb.TagNumber(2) + $core.bool hasNanos() => $_has(1); + @$pb.TagNumber(2) + void clearNanos() => clearField(2); + /// Creates a new instance from [dateTime]. + /// + /// Time zone information will not be preserved. + static Timestamp fromDateTime($core.DateTime dateTime) { + final result = create(); + $mixin.TimestampMixin.setFromDateTime(result, dateTime); + return result; + } +} + diff --git a/lib/generated/google/protobuf/timestamp.pbenum.dart b/lib/generated/google/protobuf/timestamp.pbenum.dart new file mode 100644 index 0000000..9d127fd --- /dev/null +++ b/lib/generated/google/protobuf/timestamp.pbenum.dart @@ -0,0 +1,7 @@ +/// +// Generated code. Do not modify. +// source: google/protobuf/timestamp.proto +// +// @dart = 2.12 +// ignore_for_file: annotate_overrides,camel_case_types,constant_identifier_names,directives_ordering,library_prefixes,non_constant_identifier_names,prefer_final_fields,return_of_invalid_type,unnecessary_const,unnecessary_import,unnecessary_this,unused_import,unused_shown_name + diff --git a/lib/generated/google/protobuf/timestamp.pbjson.dart b/lib/generated/google/protobuf/timestamp.pbjson.dart new file mode 100644 index 0000000..421f785 --- /dev/null +++ b/lib/generated/google/protobuf/timestamp.pbjson.dart @@ -0,0 +1,21 @@ +/// +// Generated code. Do not modify. +// source: google/protobuf/timestamp.proto +// +// @dart = 2.12 +// ignore_for_file: annotate_overrides,camel_case_types,constant_identifier_names,deprecated_member_use_from_same_package,directives_ordering,library_prefixes,non_constant_identifier_names,prefer_final_fields,return_of_invalid_type,unnecessary_const,unnecessary_import,unnecessary_this,unused_import,unused_shown_name + +import 'dart:core' as $core; +import 'dart:convert' as $convert; +import 'dart:typed_data' as $typed_data; +@$core.Deprecated('Use timestampDescriptor instead') +const Timestamp$json = const { + '1': 'Timestamp', + '2': const [ + const {'1': 'seconds', '3': 1, '4': 1, '5': 3, '10': 'seconds'}, + const {'1': 'nanos', '3': 2, '4': 1, '5': 5, '10': 'nanos'}, + ], +}; + +/// Descriptor for `Timestamp`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List timestampDescriptor = $convert.base64Decode('CglUaW1lc3RhbXASGAoHc2Vjb25kcxgBIAEoA1IHc2Vjb25kcxIUCgVuYW5vcxgCIAEoBVIFbmFub3M='); diff --git a/lib/generated/kuksa/val/v1/types.pb.dart b/lib/generated/kuksa/val/v1/types.pb.dart new file mode 100644 index 0000000..17bcbb3 --- /dev/null +++ b/lib/generated/kuksa/val/v1/types.pb.dart @@ -0,0 +1,1560 @@ +/// +// Generated code. Do not modify. +// source: kuksa/val/v1/types.proto +// +// @dart = 2.12 +// ignore_for_file: annotate_overrides,camel_case_types,constant_identifier_names,directives_ordering,library_prefixes,non_constant_identifier_names,prefer_final_fields,return_of_invalid_type,unnecessary_const,unnecessary_import,unnecessary_this,unused_import,unused_shown_name + +import 'dart:core' as $core; + +import 'package:fixnum/fixnum.dart' as $fixnum; +import 'package:protobuf/protobuf.dart' as $pb; + +import '../../../google/protobuf/timestamp.pb.dart' as $0; + +import 'types.pbenum.dart'; + +export 'types.pbenum.dart'; + +class DataEntry extends $pb.GeneratedMessage { + static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'DataEntry', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'kuksa.val.v1'), createEmptyInstance: create) + ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'path') + ..aOM<Datapoint>(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'value', subBuilder: Datapoint.create) + ..aOM<Datapoint>(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'actuatorTarget', subBuilder: Datapoint.create) + ..aOM<Metadata>(10, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'metadata', subBuilder: Metadata.create) + ..hasRequiredFields = false + ; + + DataEntry._() : super(); + factory DataEntry({ + $core.String? path, + Datapoint? value, + Datapoint? actuatorTarget, + Metadata? metadata, + }) { + final _result = create(); + if (path != null) { + _result.path = path; + } + if (value != null) { + _result.value = value; + } + if (actuatorTarget != null) { + _result.actuatorTarget = actuatorTarget; + } + if (metadata != null) { + _result.metadata = metadata; + } + return _result; + } + factory DataEntry.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory DataEntry.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') + DataEntry clone() => DataEntry()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + DataEntry copyWith(void Function(DataEntry) updates) => super.copyWith((message) => updates(message as DataEntry)) as DataEntry; // ignore: deprecated_member_use + $pb.BuilderInfo get info_ => _i; + @$core.pragma('dart2js:noInline') + static DataEntry create() => DataEntry._(); + DataEntry createEmptyInstance() => create(); + static $pb.PbList<DataEntry> createRepeated() => $pb.PbList<DataEntry>(); + @$core.pragma('dart2js:noInline') + static DataEntry getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<DataEntry>(create); + static DataEntry? _defaultInstance; + + @$pb.TagNumber(1) + $core.String get path => $_getSZ(0); + @$pb.TagNumber(1) + set path($core.String v) { $_setString(0, v); } + @$pb.TagNumber(1) + $core.bool hasPath() => $_has(0); + @$pb.TagNumber(1) + void clearPath() => clearField(1); + + @$pb.TagNumber(2) + Datapoint get value => $_getN(1); + @$pb.TagNumber(2) + set value(Datapoint v) { setField(2, v); } + @$pb.TagNumber(2) + $core.bool hasValue() => $_has(1); + @$pb.TagNumber(2) + void clearValue() => clearField(2); + @$pb.TagNumber(2) + Datapoint ensureValue() => $_ensure(1); + + @$pb.TagNumber(3) + Datapoint get actuatorTarget => $_getN(2); + @$pb.TagNumber(3) + set actuatorTarget(Datapoint v) { setField(3, v); } + @$pb.TagNumber(3) + $core.bool hasActuatorTarget() => $_has(2); + @$pb.TagNumber(3) + void clearActuatorTarget() => clearField(3); + @$pb.TagNumber(3) + Datapoint ensureActuatorTarget() => $_ensure(2); + + @$pb.TagNumber(10) + Metadata get metadata => $_getN(3); + @$pb.TagNumber(10) + set metadata(Metadata v) { setField(10, v); } + @$pb.TagNumber(10) + $core.bool hasMetadata() => $_has(3); + @$pb.TagNumber(10) + void clearMetadata() => clearField(10); + @$pb.TagNumber(10) + Metadata ensureMetadata() => $_ensure(3); +} + +enum Datapoint_Value { + string, + bool_12, + int32, + int64, + uint32, + uint64, + float, + double_18, + stringArray, + boolArray, + int32Array, + int64Array, + uint32Array, + uint64Array, + floatArray, + doubleArray, + notSet +} + +class Datapoint extends $pb.GeneratedMessage { + static const $core.Map<$core.int, Datapoint_Value> _Datapoint_ValueByTag = { + 11 : Datapoint_Value.string, + 12 : Datapoint_Value.bool_12, + 13 : Datapoint_Value.int32, + 14 : Datapoint_Value.int64, + 15 : Datapoint_Value.uint32, + 16 : Datapoint_Value.uint64, + 17 : Datapoint_Value.float, + 18 : Datapoint_Value.double_18, + 21 : Datapoint_Value.stringArray, + 22 : Datapoint_Value.boolArray, + 23 : Datapoint_Value.int32Array, + 24 : Datapoint_Value.int64Array, + 25 : Datapoint_Value.uint32Array, + 26 : Datapoint_Value.uint64Array, + 27 : Datapoint_Value.floatArray, + 28 : Datapoint_Value.doubleArray, + 0 : Datapoint_Value.notSet + }; + static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'Datapoint', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'kuksa.val.v1'), createEmptyInstance: create) + ..oo(0, [11, 12, 13, 14, 15, 16, 17, 18, 21, 22, 23, 24, 25, 26, 27, 28]) + ..aOM<$0.Timestamp>(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'timestamp', subBuilder: $0.Timestamp.create) + ..aOS(11, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'string') + ..aOB(12, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'bool') + ..a<$core.int>(13, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'int32', $pb.PbFieldType.OS3) + ..a<$fixnum.Int64>(14, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'int64', $pb.PbFieldType.OS6, defaultOrMaker: $fixnum.Int64.ZERO) + ..a<$core.int>(15, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'uint32', $pb.PbFieldType.OU3) + ..a<$fixnum.Int64>(16, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'uint64', $pb.PbFieldType.OU6, defaultOrMaker: $fixnum.Int64.ZERO) + ..a<$core.double>(17, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'float', $pb.PbFieldType.OF) + ..a<$core.double>(18, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'double', $pb.PbFieldType.OD) + ..aOM<StringArray>(21, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'stringArray', subBuilder: StringArray.create) + ..aOM<BoolArray>(22, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'boolArray', subBuilder: BoolArray.create) + ..aOM<Int32Array>(23, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'int32Array', subBuilder: Int32Array.create) + ..aOM<Int64Array>(24, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'int64Array', subBuilder: Int64Array.create) + ..aOM<Uint32Array>(25, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'uint32Array', subBuilder: Uint32Array.create) + ..aOM<Uint64Array>(26, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'uint64Array', subBuilder: Uint64Array.create) + ..aOM<FloatArray>(27, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'floatArray', subBuilder: FloatArray.create) + ..aOM<DoubleArray>(28, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'doubleArray', subBuilder: DoubleArray.create) + ..hasRequiredFields = false + ; + + Datapoint._() : super(); + factory Datapoint({ + $0.Timestamp? timestamp, + $core.String? string, + $core.bool? bool_12, + $core.int? int32, + $fixnum.Int64? int64, + $core.int? uint32, + $fixnum.Int64? uint64, + $core.double? float, + $core.double? double_18, + StringArray? stringArray, + BoolArray? boolArray, + Int32Array? int32Array, + Int64Array? int64Array, + Uint32Array? uint32Array, + Uint64Array? uint64Array, + FloatArray? floatArray, + DoubleArray? doubleArray, + }) { + final _result = create(); + if (timestamp != null) { + _result.timestamp = timestamp; + } + if (string != null) { + _result.string = string; + } + if (bool_12 != null) { + _result.bool_12 = bool_12; + } + if (int32 != null) { + _result.int32 = int32; + } + if (int64 != null) { + _result.int64 = int64; + } + if (uint32 != null) { + _result.uint32 = uint32; + } + if (uint64 != null) { + _result.uint64 = uint64; + } + if (float != null) { + _result.float = float; + } + if (double_18 != null) { + _result.double_18 = double_18; + } + if (stringArray != null) { + _result.stringArray = stringArray; + } + if (boolArray != null) { + _result.boolArray = boolArray; + } + if (int32Array != null) { + _result.int32Array = int32Array; + } + if (int64Array != null) { + _result.int64Array = int64Array; + } + if (uint32Array != null) { + _result.uint32Array = uint32Array; + } + if (uint64Array != null) { + _result.uint64Array = uint64Array; + } + if (floatArray != null) { + _result.floatArray = floatArray; + } + if (doubleArray != null) { + _result.doubleArray = doubleArray; + } + return _result; + } + factory Datapoint.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory Datapoint.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') + Datapoint clone() => Datapoint()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + Datapoint copyWith(void Function(Datapoint) updates) => super.copyWith((message) => updates(message as Datapoint)) as Datapoint; // ignore: deprecated_member_use + $pb.BuilderInfo get info_ => _i; + @$core.pragma('dart2js:noInline') + static Datapoint create() => Datapoint._(); + Datapoint createEmptyInstance() => create(); + static $pb.PbList<Datapoint> createRepeated() => $pb.PbList<Datapoint>(); + @$core.pragma('dart2js:noInline') + static Datapoint getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<Datapoint>(create); + static Datapoint? _defaultInstance; + + Datapoint_Value whichValue() => _Datapoint_ValueByTag[$_whichOneof(0)]!; + void clearValue() => clearField($_whichOneof(0)); + + @$pb.TagNumber(1) + $0.Timestamp get timestamp => $_getN(0); + @$pb.TagNumber(1) + set timestamp($0.Timestamp v) { setField(1, v); } + @$pb.TagNumber(1) + $core.bool hasTimestamp() => $_has(0); + @$pb.TagNumber(1) + void clearTimestamp() => clearField(1); + @$pb.TagNumber(1) + $0.Timestamp ensureTimestamp() => $_ensure(0); + + @$pb.TagNumber(11) + $core.String get string => $_getSZ(1); + @$pb.TagNumber(11) + set string($core.String v) { $_setString(1, v); } + @$pb.TagNumber(11) + $core.bool hasString() => $_has(1); + @$pb.TagNumber(11) + void clearString() => clearField(11); + + @$pb.TagNumber(12) + $core.bool get bool_12 => $_getBF(2); + @$pb.TagNumber(12) + set bool_12($core.bool v) { $_setBool(2, v); } + @$pb.TagNumber(12) + $core.bool hasBool_12() => $_has(2); + @$pb.TagNumber(12) + void clearBool_12() => clearField(12); + + @$pb.TagNumber(13) + $core.int get int32 => $_getIZ(3); + @$pb.TagNumber(13) + set int32($core.int v) { $_setSignedInt32(3, v); } + @$pb.TagNumber(13) + $core.bool hasInt32() => $_has(3); + @$pb.TagNumber(13) + void clearInt32() => clearField(13); + + @$pb.TagNumber(14) + $fixnum.Int64 get int64 => $_getI64(4); + @$pb.TagNumber(14) + set int64($fixnum.Int64 v) { $_setInt64(4, v); } + @$pb.TagNumber(14) + $core.bool hasInt64() => $_has(4); + @$pb.TagNumber(14) + void clearInt64() => clearField(14); + + @$pb.TagNumber(15) + $core.int get uint32 => $_getIZ(5); + @$pb.TagNumber(15) + set uint32($core.int v) { $_setUnsignedInt32(5, v); } + @$pb.TagNumber(15) + $core.bool hasUint32() => $_has(5); + @$pb.TagNumber(15) + void clearUint32() => clearField(15); + + @$pb.TagNumber(16) + $fixnum.Int64 get uint64 => $_getI64(6); + @$pb.TagNumber(16) + set uint64($fixnum.Int64 v) { $_setInt64(6, v); } + @$pb.TagNumber(16) + $core.bool hasUint64() => $_has(6); + @$pb.TagNumber(16) + void clearUint64() => clearField(16); + + @$pb.TagNumber(17) + $core.double get float => $_getN(7); + @$pb.TagNumber(17) + set float($core.double v) { $_setFloat(7, v); } + @$pb.TagNumber(17) + $core.bool hasFloat() => $_has(7); + @$pb.TagNumber(17) + void clearFloat() => clearField(17); + + @$pb.TagNumber(18) + $core.double get double_18 => $_getN(8); + @$pb.TagNumber(18) + set double_18($core.double v) { $_setDouble(8, v); } + @$pb.TagNumber(18) + $core.bool hasDouble_18() => $_has(8); + @$pb.TagNumber(18) + void clearDouble_18() => clearField(18); + + @$pb.TagNumber(21) + StringArray get stringArray => $_getN(9); + @$pb.TagNumber(21) + set stringArray(StringArray v) { setField(21, v); } + @$pb.TagNumber(21) + $core.bool hasStringArray() => $_has(9); + @$pb.TagNumber(21) + void clearStringArray() => clearField(21); + @$pb.TagNumber(21) + StringArray ensureStringArray() => $_ensure(9); + + @$pb.TagNumber(22) + BoolArray get boolArray => $_getN(10); + @$pb.TagNumber(22) + set boolArray(BoolArray v) { setField(22, v); } + @$pb.TagNumber(22) + $core.bool hasBoolArray() => $_has(10); + @$pb.TagNumber(22) + void clearBoolArray() => clearField(22); + @$pb.TagNumber(22) + BoolArray ensureBoolArray() => $_ensure(10); + + @$pb.TagNumber(23) + Int32Array get int32Array => $_getN(11); + @$pb.TagNumber(23) + set int32Array(Int32Array v) { setField(23, v); } + @$pb.TagNumber(23) + $core.bool hasInt32Array() => $_has(11); + @$pb.TagNumber(23) + void clearInt32Array() => clearField(23); + @$pb.TagNumber(23) + Int32Array ensureInt32Array() => $_ensure(11); + + @$pb.TagNumber(24) + Int64Array get int64Array => $_getN(12); + @$pb.TagNumber(24) + set int64Array(Int64Array v) { setField(24, v); } + @$pb.TagNumber(24) + $core.bool hasInt64Array() => $_has(12); + @$pb.TagNumber(24) + void clearInt64Array() => clearField(24); + @$pb.TagNumber(24) + Int64Array ensureInt64Array() => $_ensure(12); + + @$pb.TagNumber(25) + Uint32Array get uint32Array => $_getN(13); + @$pb.TagNumber(25) + set uint32Array(Uint32Array v) { setField(25, v); } + @$pb.TagNumber(25) + $core.bool hasUint32Array() => $_has(13); + @$pb.TagNumber(25) + void clearUint32Array() => clearField(25); + @$pb.TagNumber(25) + Uint32Array ensureUint32Array() => $_ensure(13); + + @$pb.TagNumber(26) + Uint64Array get uint64Array => $_getN(14); + @$pb.TagNumber(26) + set uint64Array(Uint64Array v) { setField(26, v); } + @$pb.TagNumber(26) + $core.bool hasUint64Array() => $_has(14); + @$pb.TagNumber(26) + void clearUint64Array() => clearField(26); + @$pb.TagNumber(26) + Uint64Array ensureUint64Array() => $_ensure(14); + + @$pb.TagNumber(27) + FloatArray get floatArray => $_getN(15); + @$pb.TagNumber(27) + set floatArray(FloatArray v) { setField(27, v); } + @$pb.TagNumber(27) + $core.bool hasFloatArray() => $_has(15); + @$pb.TagNumber(27) + void clearFloatArray() => clearField(27); + @$pb.TagNumber(27) + FloatArray ensureFloatArray() => $_ensure(15); + + @$pb.TagNumber(28) + DoubleArray get doubleArray => $_getN(16); + @$pb.TagNumber(28) + set doubleArray(DoubleArray v) { setField(28, v); } + @$pb.TagNumber(28) + $core.bool hasDoubleArray() => $_has(16); + @$pb.TagNumber(28) + void clearDoubleArray() => clearField(28); + @$pb.TagNumber(28) + DoubleArray ensureDoubleArray() => $_ensure(16); +} + +enum Metadata_EntrySpecific { + actuator, + sensor, + attribute, + notSet +} + +class Metadata extends $pb.GeneratedMessage { + static const $core.Map<$core.int, Metadata_EntrySpecific> _Metadata_EntrySpecificByTag = { + 20 : Metadata_EntrySpecific.actuator, + 30 : Metadata_EntrySpecific.sensor, + 40 : Metadata_EntrySpecific.attribute, + 0 : Metadata_EntrySpecific.notSet + }; + static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'Metadata', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'kuksa.val.v1'), createEmptyInstance: create) + ..oo(0, [20, 30, 40]) + ..e<DataType>(11, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'dataType', $pb.PbFieldType.OE, defaultOrMaker: DataType.DATA_TYPE_UNSPECIFIED, valueOf: DataType.valueOf, enumValues: DataType.values) + ..e<EntryType>(12, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'entryType', $pb.PbFieldType.OE, defaultOrMaker: EntryType.ENTRY_TYPE_UNSPECIFIED, valueOf: EntryType.valueOf, enumValues: EntryType.values) + ..aOS(13, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'description') + ..aOS(14, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'comment') + ..aOS(15, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'deprecation') + ..aOS(16, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'unit') + ..aOM<ValueRestriction>(17, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'valueRestriction', subBuilder: ValueRestriction.create) + ..aOM<Actuator>(20, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'actuator', subBuilder: Actuator.create) + ..aOM<Sensor>(30, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'sensor', subBuilder: Sensor.create) + ..aOM<Attribute>(40, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'attribute', subBuilder: Attribute.create) + ..hasRequiredFields = false + ; + + Metadata._() : super(); + factory Metadata({ + DataType? dataType, + EntryType? entryType, + $core.String? description, + $core.String? comment, + $core.String? deprecation, + $core.String? unit, + ValueRestriction? valueRestriction, + Actuator? actuator, + Sensor? sensor, + Attribute? attribute, + }) { + final _result = create(); + if (dataType != null) { + _result.dataType = dataType; + } + if (entryType != null) { + _result.entryType = entryType; + } + if (description != null) { + _result.description = description; + } + if (comment != null) { + _result.comment = comment; + } + if (deprecation != null) { + _result.deprecation = deprecation; + } + if (unit != null) { + _result.unit = unit; + } + if (valueRestriction != null) { + _result.valueRestriction = valueRestriction; + } + if (actuator != null) { + _result.actuator = actuator; + } + if (sensor != null) { + _result.sensor = sensor; + } + if (attribute != null) { + _result.attribute = attribute; + } + return _result; + } + factory Metadata.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory Metadata.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') + Metadata clone() => Metadata()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + Metadata copyWith(void Function(Metadata) updates) => super.copyWith((message) => updates(message as Metadata)) as Metadata; // ignore: deprecated_member_use + $pb.BuilderInfo get info_ => _i; + @$core.pragma('dart2js:noInline') + static Metadata create() => Metadata._(); + Metadata createEmptyInstance() => create(); + static $pb.PbList<Metadata> createRepeated() => $pb.PbList<Metadata>(); + @$core.pragma('dart2js:noInline') + static Metadata getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<Metadata>(create); + static Metadata? _defaultInstance; + + Metadata_EntrySpecific whichEntrySpecific() => _Metadata_EntrySpecificByTag[$_whichOneof(0)]!; + void clearEntrySpecific() => clearField($_whichOneof(0)); + + @$pb.TagNumber(11) + DataType get dataType => $_getN(0); + @$pb.TagNumber(11) + set dataType(DataType v) { setField(11, v); } + @$pb.TagNumber(11) + $core.bool hasDataType() => $_has(0); + @$pb.TagNumber(11) + void clearDataType() => clearField(11); + + @$pb.TagNumber(12) + EntryType get entryType => $_getN(1); + @$pb.TagNumber(12) + set entryType(EntryType v) { setField(12, v); } + @$pb.TagNumber(12) + $core.bool hasEntryType() => $_has(1); + @$pb.TagNumber(12) + void clearEntryType() => clearField(12); + + @$pb.TagNumber(13) + $core.String get description => $_getSZ(2); + @$pb.TagNumber(13) + set description($core.String v) { $_setString(2, v); } + @$pb.TagNumber(13) + $core.bool hasDescription() => $_has(2); + @$pb.TagNumber(13) + void clearDescription() => clearField(13); + + @$pb.TagNumber(14) + $core.String get comment => $_getSZ(3); + @$pb.TagNumber(14) + set comment($core.String v) { $_setString(3, v); } + @$pb.TagNumber(14) + $core.bool hasComment() => $_has(3); + @$pb.TagNumber(14) + void clearComment() => clearField(14); + + @$pb.TagNumber(15) + $core.String get deprecation => $_getSZ(4); + @$pb.TagNumber(15) + set deprecation($core.String v) { $_setString(4, v); } + @$pb.TagNumber(15) + $core.bool hasDeprecation() => $_has(4); + @$pb.TagNumber(15) + void clearDeprecation() => clearField(15); + + @$pb.TagNumber(16) + $core.String get unit => $_getSZ(5); + @$pb.TagNumber(16) + set unit($core.String v) { $_setString(5, v); } + @$pb.TagNumber(16) + $core.bool hasUnit() => $_has(5); + @$pb.TagNumber(16) + void clearUnit() => clearField(16); + + @$pb.TagNumber(17) + ValueRestriction get valueRestriction => $_getN(6); + @$pb.TagNumber(17) + set valueRestriction(ValueRestriction v) { setField(17, v); } + @$pb.TagNumber(17) + $core.bool hasValueRestriction() => $_has(6); + @$pb.TagNumber(17) + void clearValueRestriction() => clearField(17); + @$pb.TagNumber(17) + ValueRestriction ensureValueRestriction() => $_ensure(6); + + @$pb.TagNumber(20) + Actuator get actuator => $_getN(7); + @$pb.TagNumber(20) + set actuator(Actuator v) { setField(20, v); } + @$pb.TagNumber(20) + $core.bool hasActuator() => $_has(7); + @$pb.TagNumber(20) + void clearActuator() => clearField(20); + @$pb.TagNumber(20) + Actuator ensureActuator() => $_ensure(7); + + @$pb.TagNumber(30) + Sensor get sensor => $_getN(8); + @$pb.TagNumber(30) + set sensor(Sensor v) { setField(30, v); } + @$pb.TagNumber(30) + $core.bool hasSensor() => $_has(8); + @$pb.TagNumber(30) + void clearSensor() => clearField(30); + @$pb.TagNumber(30) + Sensor ensureSensor() => $_ensure(8); + + @$pb.TagNumber(40) + Attribute get attribute => $_getN(9); + @$pb.TagNumber(40) + set attribute(Attribute v) { setField(40, v); } + @$pb.TagNumber(40) + $core.bool hasAttribute() => $_has(9); + @$pb.TagNumber(40) + void clearAttribute() => clearField(40); + @$pb.TagNumber(40) + Attribute ensureAttribute() => $_ensure(9); +} + +class Actuator extends $pb.GeneratedMessage { + static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'Actuator', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'kuksa.val.v1'), createEmptyInstance: create) + ..hasRequiredFields = false + ; + + Actuator._() : super(); + factory Actuator() => create(); + factory Actuator.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory Actuator.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') + Actuator clone() => Actuator()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + Actuator copyWith(void Function(Actuator) updates) => super.copyWith((message) => updates(message as Actuator)) as Actuator; // ignore: deprecated_member_use + $pb.BuilderInfo get info_ => _i; + @$core.pragma('dart2js:noInline') + static Actuator create() => Actuator._(); + Actuator createEmptyInstance() => create(); + static $pb.PbList<Actuator> createRepeated() => $pb.PbList<Actuator>(); + @$core.pragma('dart2js:noInline') + static Actuator getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<Actuator>(create); + static Actuator? _defaultInstance; +} + +class Sensor extends $pb.GeneratedMessage { + static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'Sensor', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'kuksa.val.v1'), createEmptyInstance: create) + ..hasRequiredFields = false + ; + + Sensor._() : super(); + factory Sensor() => create(); + factory Sensor.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory Sensor.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') + Sensor clone() => Sensor()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + Sensor copyWith(void Function(Sensor) updates) => super.copyWith((message) => updates(message as Sensor)) as Sensor; // ignore: deprecated_member_use + $pb.BuilderInfo get info_ => _i; + @$core.pragma('dart2js:noInline') + static Sensor create() => Sensor._(); + Sensor createEmptyInstance() => create(); + static $pb.PbList<Sensor> createRepeated() => $pb.PbList<Sensor>(); + @$core.pragma('dart2js:noInline') + static Sensor getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<Sensor>(create); + static Sensor? _defaultInstance; +} + +class Attribute extends $pb.GeneratedMessage { + static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'Attribute', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'kuksa.val.v1'), createEmptyInstance: create) + ..hasRequiredFields = false + ; + + Attribute._() : super(); + factory Attribute() => create(); + factory Attribute.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory Attribute.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') + Attribute clone() => Attribute()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + Attribute copyWith(void Function(Attribute) updates) => super.copyWith((message) => updates(message as Attribute)) as Attribute; // ignore: deprecated_member_use + $pb.BuilderInfo get info_ => _i; + @$core.pragma('dart2js:noInline') + static Attribute create() => Attribute._(); + Attribute createEmptyInstance() => create(); + static $pb.PbList<Attribute> createRepeated() => $pb.PbList<Attribute>(); + @$core.pragma('dart2js:noInline') + static Attribute getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<Attribute>(create); + static Attribute? _defaultInstance; +} + +enum ValueRestriction_Type { + string, + signed, + unsigned, + floatingPoint, + notSet +} + +class ValueRestriction extends $pb.GeneratedMessage { + static const $core.Map<$core.int, ValueRestriction_Type> _ValueRestriction_TypeByTag = { + 21 : ValueRestriction_Type.string, + 22 : ValueRestriction_Type.signed, + 23 : ValueRestriction_Type.unsigned, + 24 : ValueRestriction_Type.floatingPoint, + 0 : ValueRestriction_Type.notSet + }; + static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'ValueRestriction', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'kuksa.val.v1'), createEmptyInstance: create) + ..oo(0, [21, 22, 23, 24]) + ..aOM<ValueRestrictionString>(21, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'string', subBuilder: ValueRestrictionString.create) + ..aOM<ValueRestrictionInt>(22, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'signed', subBuilder: ValueRestrictionInt.create) + ..aOM<ValueRestrictionUint>(23, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'unsigned', subBuilder: ValueRestrictionUint.create) + ..aOM<ValueRestrictionFloat>(24, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'floatingPoint', subBuilder: ValueRestrictionFloat.create) + ..hasRequiredFields = false + ; + + ValueRestriction._() : super(); + factory ValueRestriction({ + ValueRestrictionString? string, + ValueRestrictionInt? signed, + ValueRestrictionUint? unsigned, + ValueRestrictionFloat? floatingPoint, + }) { + final _result = create(); + if (string != null) { + _result.string = string; + } + if (signed != null) { + _result.signed = signed; + } + if (unsigned != null) { + _result.unsigned = unsigned; + } + if (floatingPoint != null) { + _result.floatingPoint = floatingPoint; + } + return _result; + } + factory ValueRestriction.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory ValueRestriction.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') + ValueRestriction clone() => ValueRestriction()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + ValueRestriction copyWith(void Function(ValueRestriction) updates) => super.copyWith((message) => updates(message as ValueRestriction)) as ValueRestriction; // ignore: deprecated_member_use + $pb.BuilderInfo get info_ => _i; + @$core.pragma('dart2js:noInline') + static ValueRestriction create() => ValueRestriction._(); + ValueRestriction createEmptyInstance() => create(); + static $pb.PbList<ValueRestriction> createRepeated() => $pb.PbList<ValueRestriction>(); + @$core.pragma('dart2js:noInline') + static ValueRestriction getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<ValueRestriction>(create); + static ValueRestriction? _defaultInstance; + + ValueRestriction_Type whichType() => _ValueRestriction_TypeByTag[$_whichOneof(0)]!; + void clearType() => clearField($_whichOneof(0)); + + @$pb.TagNumber(21) + ValueRestrictionString get string => $_getN(0); + @$pb.TagNumber(21) + set string(ValueRestrictionString v) { setField(21, v); } + @$pb.TagNumber(21) + $core.bool hasString() => $_has(0); + @$pb.TagNumber(21) + void clearString() => clearField(21); + @$pb.TagNumber(21) + ValueRestrictionString ensureString() => $_ensure(0); + + @$pb.TagNumber(22) + ValueRestrictionInt get signed => $_getN(1); + @$pb.TagNumber(22) + set signed(ValueRestrictionInt v) { setField(22, v); } + @$pb.TagNumber(22) + $core.bool hasSigned() => $_has(1); + @$pb.TagNumber(22) + void clearSigned() => clearField(22); + @$pb.TagNumber(22) + ValueRestrictionInt ensureSigned() => $_ensure(1); + + @$pb.TagNumber(23) + ValueRestrictionUint get unsigned => $_getN(2); + @$pb.TagNumber(23) + set unsigned(ValueRestrictionUint v) { setField(23, v); } + @$pb.TagNumber(23) + $core.bool hasUnsigned() => $_has(2); + @$pb.TagNumber(23) + void clearUnsigned() => clearField(23); + @$pb.TagNumber(23) + ValueRestrictionUint ensureUnsigned() => $_ensure(2); + + @$pb.TagNumber(24) + ValueRestrictionFloat get floatingPoint => $_getN(3); + @$pb.TagNumber(24) + set floatingPoint(ValueRestrictionFloat v) { setField(24, v); } + @$pb.TagNumber(24) + $core.bool hasFloatingPoint() => $_has(3); + @$pb.TagNumber(24) + void clearFloatingPoint() => clearField(24); + @$pb.TagNumber(24) + ValueRestrictionFloat ensureFloatingPoint() => $_ensure(3); +} + +class ValueRestrictionInt extends $pb.GeneratedMessage { + static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'ValueRestrictionInt', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'kuksa.val.v1'), createEmptyInstance: create) + ..a<$fixnum.Int64>(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'min', $pb.PbFieldType.OS6, defaultOrMaker: $fixnum.Int64.ZERO) + ..a<$fixnum.Int64>(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'max', $pb.PbFieldType.OS6, defaultOrMaker: $fixnum.Int64.ZERO) + ..p<$fixnum.Int64>(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'allowedValues', $pb.PbFieldType.KS6) + ..hasRequiredFields = false + ; + + ValueRestrictionInt._() : super(); + factory ValueRestrictionInt({ + $fixnum.Int64? min, + $fixnum.Int64? max, + $core.Iterable<$fixnum.Int64>? allowedValues, + }) { + final _result = create(); + if (min != null) { + _result.min = min; + } + if (max != null) { + _result.max = max; + } + if (allowedValues != null) { + _result.allowedValues.addAll(allowedValues); + } + return _result; + } + factory ValueRestrictionInt.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory ValueRestrictionInt.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') + ValueRestrictionInt clone() => ValueRestrictionInt()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + ValueRestrictionInt copyWith(void Function(ValueRestrictionInt) updates) => super.copyWith((message) => updates(message as ValueRestrictionInt)) as ValueRestrictionInt; // ignore: deprecated_member_use + $pb.BuilderInfo get info_ => _i; + @$core.pragma('dart2js:noInline') + static ValueRestrictionInt create() => ValueRestrictionInt._(); + ValueRestrictionInt createEmptyInstance() => create(); + static $pb.PbList<ValueRestrictionInt> createRepeated() => $pb.PbList<ValueRestrictionInt>(); + @$core.pragma('dart2js:noInline') + static ValueRestrictionInt getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<ValueRestrictionInt>(create); + static ValueRestrictionInt? _defaultInstance; + + @$pb.TagNumber(1) + $fixnum.Int64 get min => $_getI64(0); + @$pb.TagNumber(1) + set min($fixnum.Int64 v) { $_setInt64(0, v); } + @$pb.TagNumber(1) + $core.bool hasMin() => $_has(0); + @$pb.TagNumber(1) + void clearMin() => clearField(1); + + @$pb.TagNumber(2) + $fixnum.Int64 get max => $_getI64(1); + @$pb.TagNumber(2) + set max($fixnum.Int64 v) { $_setInt64(1, v); } + @$pb.TagNumber(2) + $core.bool hasMax() => $_has(1); + @$pb.TagNumber(2) + void clearMax() => clearField(2); + + @$pb.TagNumber(3) + $core.List<$fixnum.Int64> get allowedValues => $_getList(2); +} + +class ValueRestrictionUint extends $pb.GeneratedMessage { + static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'ValueRestrictionUint', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'kuksa.val.v1'), createEmptyInstance: create) + ..a<$fixnum.Int64>(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'min', $pb.PbFieldType.OU6, defaultOrMaker: $fixnum.Int64.ZERO) + ..a<$fixnum.Int64>(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'max', $pb.PbFieldType.OU6, defaultOrMaker: $fixnum.Int64.ZERO) + ..p<$fixnum.Int64>(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'allowedValues', $pb.PbFieldType.KU6) + ..hasRequiredFields = false + ; + + ValueRestrictionUint._() : super(); + factory ValueRestrictionUint({ + $fixnum.Int64? min, + $fixnum.Int64? max, + $core.Iterable<$fixnum.Int64>? allowedValues, + }) { + final _result = create(); + if (min != null) { + _result.min = min; + } + if (max != null) { + _result.max = max; + } + if (allowedValues != null) { + _result.allowedValues.addAll(allowedValues); + } + return _result; + } + factory ValueRestrictionUint.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory ValueRestrictionUint.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') + ValueRestrictionUint clone() => ValueRestrictionUint()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + ValueRestrictionUint copyWith(void Function(ValueRestrictionUint) updates) => super.copyWith((message) => updates(message as ValueRestrictionUint)) as ValueRestrictionUint; // ignore: deprecated_member_use + $pb.BuilderInfo get info_ => _i; + @$core.pragma('dart2js:noInline') + static ValueRestrictionUint create() => ValueRestrictionUint._(); + ValueRestrictionUint createEmptyInstance() => create(); + static $pb.PbList<ValueRestrictionUint> createRepeated() => $pb.PbList<ValueRestrictionUint>(); + @$core.pragma('dart2js:noInline') + static ValueRestrictionUint getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<ValueRestrictionUint>(create); + static ValueRestrictionUint? _defaultInstance; + + @$pb.TagNumber(1) + $fixnum.Int64 get min => $_getI64(0); + @$pb.TagNumber(1) + set min($fixnum.Int64 v) { $_setInt64(0, v); } + @$pb.TagNumber(1) + $core.bool hasMin() => $_has(0); + @$pb.TagNumber(1) + void clearMin() => clearField(1); + + @$pb.TagNumber(2) + $fixnum.Int64 get max => $_getI64(1); + @$pb.TagNumber(2) + set max($fixnum.Int64 v) { $_setInt64(1, v); } + @$pb.TagNumber(2) + $core.bool hasMax() => $_has(1); + @$pb.TagNumber(2) + void clearMax() => clearField(2); + + @$pb.TagNumber(3) + $core.List<$fixnum.Int64> get allowedValues => $_getList(2); +} + +class ValueRestrictionFloat extends $pb.GeneratedMessage { + static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'ValueRestrictionFloat', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'kuksa.val.v1'), createEmptyInstance: create) + ..a<$core.double>(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'min', $pb.PbFieldType.OD) + ..a<$core.double>(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'max', $pb.PbFieldType.OD) + ..p<$core.double>(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'allowedValues', $pb.PbFieldType.KD) + ..hasRequiredFields = false + ; + + ValueRestrictionFloat._() : super(); + factory ValueRestrictionFloat({ + $core.double? min, + $core.double? max, + $core.Iterable<$core.double>? allowedValues, + }) { + final _result = create(); + if (min != null) { + _result.min = min; + } + if (max != null) { + _result.max = max; + } + if (allowedValues != null) { + _result.allowedValues.addAll(allowedValues); + } + return _result; + } + factory ValueRestrictionFloat.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory ValueRestrictionFloat.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') + ValueRestrictionFloat clone() => ValueRestrictionFloat()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + ValueRestrictionFloat copyWith(void Function(ValueRestrictionFloat) updates) => super.copyWith((message) => updates(message as ValueRestrictionFloat)) as ValueRestrictionFloat; // ignore: deprecated_member_use + $pb.BuilderInfo get info_ => _i; + @$core.pragma('dart2js:noInline') + static ValueRestrictionFloat create() => ValueRestrictionFloat._(); + ValueRestrictionFloat createEmptyInstance() => create(); + static $pb.PbList<ValueRestrictionFloat> createRepeated() => $pb.PbList<ValueRestrictionFloat>(); + @$core.pragma('dart2js:noInline') + static ValueRestrictionFloat getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<ValueRestrictionFloat>(create); + static ValueRestrictionFloat? _defaultInstance; + + @$pb.TagNumber(1) + $core.double get min => $_getN(0); + @$pb.TagNumber(1) + set min($core.double v) { $_setDouble(0, v); } + @$pb.TagNumber(1) + $core.bool hasMin() => $_has(0); + @$pb.TagNumber(1) + void clearMin() => clearField(1); + + @$pb.TagNumber(2) + $core.double get max => $_getN(1); + @$pb.TagNumber(2) + set max($core.double v) { $_setDouble(1, v); } + @$pb.TagNumber(2) + $core.bool hasMax() => $_has(1); + @$pb.TagNumber(2) + void clearMax() => clearField(2); + + @$pb.TagNumber(3) + $core.List<$core.double> get allowedValues => $_getList(2); +} + +class ValueRestrictionString extends $pb.GeneratedMessage { + static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'ValueRestrictionString', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'kuksa.val.v1'), createEmptyInstance: create) + ..pPS(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'allowedValues') + ..hasRequiredFields = false + ; + + ValueRestrictionString._() : super(); + factory ValueRestrictionString({ + $core.Iterable<$core.String>? allowedValues, + }) { + final _result = create(); + if (allowedValues != null) { + _result.allowedValues.addAll(allowedValues); + } + return _result; + } + factory ValueRestrictionString.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory ValueRestrictionString.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') + ValueRestrictionString clone() => ValueRestrictionString()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + ValueRestrictionString copyWith(void Function(ValueRestrictionString) updates) => super.copyWith((message) => updates(message as ValueRestrictionString)) as ValueRestrictionString; // ignore: deprecated_member_use + $pb.BuilderInfo get info_ => _i; + @$core.pragma('dart2js:noInline') + static ValueRestrictionString create() => ValueRestrictionString._(); + ValueRestrictionString createEmptyInstance() => create(); + static $pb.PbList<ValueRestrictionString> createRepeated() => $pb.PbList<ValueRestrictionString>(); + @$core.pragma('dart2js:noInline') + static ValueRestrictionString getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<ValueRestrictionString>(create); + static ValueRestrictionString? _defaultInstance; + + @$pb.TagNumber(3) + $core.List<$core.String> get allowedValues => $_getList(0); +} + +class Error extends $pb.GeneratedMessage { + static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'Error', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'kuksa.val.v1'), createEmptyInstance: create) + ..a<$core.int>(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'code', $pb.PbFieldType.OU3) + ..aOS(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'reason') + ..aOS(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'message') + ..hasRequiredFields = false + ; + + Error._() : super(); + factory Error({ + $core.int? code, + $core.String? reason, + $core.String? message, + }) { + final _result = create(); + if (code != null) { + _result.code = code; + } + if (reason != null) { + _result.reason = reason; + } + if (message != null) { + _result.message = message; + } + return _result; + } + factory Error.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory Error.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') + Error clone() => Error()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + Error copyWith(void Function(Error) updates) => super.copyWith((message) => updates(message as Error)) as Error; // ignore: deprecated_member_use + $pb.BuilderInfo get info_ => _i; + @$core.pragma('dart2js:noInline') + static Error create() => Error._(); + Error createEmptyInstance() => create(); + static $pb.PbList<Error> createRepeated() => $pb.PbList<Error>(); + @$core.pragma('dart2js:noInline') + static Error getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<Error>(create); + static Error? _defaultInstance; + + @$pb.TagNumber(1) + $core.int get code => $_getIZ(0); + @$pb.TagNumber(1) + set code($core.int v) { $_setUnsignedInt32(0, v); } + @$pb.TagNumber(1) + $core.bool hasCode() => $_has(0); + @$pb.TagNumber(1) + void clearCode() => clearField(1); + + @$pb.TagNumber(2) + $core.String get reason => $_getSZ(1); + @$pb.TagNumber(2) + set reason($core.String v) { $_setString(1, v); } + @$pb.TagNumber(2) + $core.bool hasReason() => $_has(1); + @$pb.TagNumber(2) + void clearReason() => clearField(2); + + @$pb.TagNumber(3) + $core.String get message => $_getSZ(2); + @$pb.TagNumber(3) + set message($core.String v) { $_setString(2, v); } + @$pb.TagNumber(3) + $core.bool hasMessage() => $_has(2); + @$pb.TagNumber(3) + void clearMessage() => clearField(3); +} + +class DataEntryError extends $pb.GeneratedMessage { + static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'DataEntryError', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'kuksa.val.v1'), createEmptyInstance: create) + ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'path') + ..aOM<Error>(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'error', subBuilder: Error.create) + ..hasRequiredFields = false + ; + + DataEntryError._() : super(); + factory DataEntryError({ + $core.String? path, + Error? error, + }) { + final _result = create(); + if (path != null) { + _result.path = path; + } + if (error != null) { + _result.error = error; + } + return _result; + } + factory DataEntryError.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory DataEntryError.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') + DataEntryError clone() => DataEntryError()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + DataEntryError copyWith(void Function(DataEntryError) updates) => super.copyWith((message) => updates(message as DataEntryError)) as DataEntryError; // ignore: deprecated_member_use + $pb.BuilderInfo get info_ => _i; + @$core.pragma('dart2js:noInline') + static DataEntryError create() => DataEntryError._(); + DataEntryError createEmptyInstance() => create(); + static $pb.PbList<DataEntryError> createRepeated() => $pb.PbList<DataEntryError>(); + @$core.pragma('dart2js:noInline') + static DataEntryError getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<DataEntryError>(create); + static DataEntryError? _defaultInstance; + + @$pb.TagNumber(1) + $core.String get path => $_getSZ(0); + @$pb.TagNumber(1) + set path($core.String v) { $_setString(0, v); } + @$pb.TagNumber(1) + $core.bool hasPath() => $_has(0); + @$pb.TagNumber(1) + void clearPath() => clearField(1); + + @$pb.TagNumber(2) + Error get error => $_getN(1); + @$pb.TagNumber(2) + set error(Error v) { setField(2, v); } + @$pb.TagNumber(2) + $core.bool hasError() => $_has(1); + @$pb.TagNumber(2) + void clearError() => clearField(2); + @$pb.TagNumber(2) + Error ensureError() => $_ensure(1); +} + +class StringArray extends $pb.GeneratedMessage { + static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'StringArray', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'kuksa.val.v1'), createEmptyInstance: create) + ..pPS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'values') + ..hasRequiredFields = false + ; + + StringArray._() : super(); + factory StringArray({ + $core.Iterable<$core.String>? values, + }) { + final _result = create(); + if (values != null) { + _result.values.addAll(values); + } + return _result; + } + factory StringArray.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory StringArray.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') + StringArray clone() => StringArray()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + StringArray copyWith(void Function(StringArray) updates) => super.copyWith((message) => updates(message as StringArray)) as StringArray; // ignore: deprecated_member_use + $pb.BuilderInfo get info_ => _i; + @$core.pragma('dart2js:noInline') + static StringArray create() => StringArray._(); + StringArray createEmptyInstance() => create(); + static $pb.PbList<StringArray> createRepeated() => $pb.PbList<StringArray>(); + @$core.pragma('dart2js:noInline') + static StringArray getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<StringArray>(create); + static StringArray? _defaultInstance; + + @$pb.TagNumber(1) + $core.List<$core.String> get values => $_getList(0); +} + +class BoolArray extends $pb.GeneratedMessage { + static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'BoolArray', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'kuksa.val.v1'), createEmptyInstance: create) + ..p<$core.bool>(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'values', $pb.PbFieldType.KB) + ..hasRequiredFields = false + ; + + BoolArray._() : super(); + factory BoolArray({ + $core.Iterable<$core.bool>? values, + }) { + final _result = create(); + if (values != null) { + _result.values.addAll(values); + } + return _result; + } + factory BoolArray.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory BoolArray.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') + BoolArray clone() => BoolArray()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + BoolArray copyWith(void Function(BoolArray) updates) => super.copyWith((message) => updates(message as BoolArray)) as BoolArray; // ignore: deprecated_member_use + $pb.BuilderInfo get info_ => _i; + @$core.pragma('dart2js:noInline') + static BoolArray create() => BoolArray._(); + BoolArray createEmptyInstance() => create(); + static $pb.PbList<BoolArray> createRepeated() => $pb.PbList<BoolArray>(); + @$core.pragma('dart2js:noInline') + static BoolArray getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<BoolArray>(create); + static BoolArray? _defaultInstance; + + @$pb.TagNumber(1) + $core.List<$core.bool> get values => $_getList(0); +} + +class Int32Array extends $pb.GeneratedMessage { + static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'Int32Array', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'kuksa.val.v1'), createEmptyInstance: create) + ..p<$core.int>(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'values', $pb.PbFieldType.KS3) + ..hasRequiredFields = false + ; + + Int32Array._() : super(); + factory Int32Array({ + $core.Iterable<$core.int>? values, + }) { + final _result = create(); + if (values != null) { + _result.values.addAll(values); + } + return _result; + } + factory Int32Array.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory Int32Array.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') + Int32Array clone() => Int32Array()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + Int32Array copyWith(void Function(Int32Array) updates) => super.copyWith((message) => updates(message as Int32Array)) as Int32Array; // ignore: deprecated_member_use + $pb.BuilderInfo get info_ => _i; + @$core.pragma('dart2js:noInline') + static Int32Array create() => Int32Array._(); + Int32Array createEmptyInstance() => create(); + static $pb.PbList<Int32Array> createRepeated() => $pb.PbList<Int32Array>(); + @$core.pragma('dart2js:noInline') + static Int32Array getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<Int32Array>(create); + static Int32Array? _defaultInstance; + + @$pb.TagNumber(1) + $core.List<$core.int> get values => $_getList(0); +} + +class Int64Array extends $pb.GeneratedMessage { + static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'Int64Array', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'kuksa.val.v1'), createEmptyInstance: create) + ..p<$fixnum.Int64>(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'values', $pb.PbFieldType.KS6) + ..hasRequiredFields = false + ; + + Int64Array._() : super(); + factory Int64Array({ + $core.Iterable<$fixnum.Int64>? values, + }) { + final _result = create(); + if (values != null) { + _result.values.addAll(values); + } + return _result; + } + factory Int64Array.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory Int64Array.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') + Int64Array clone() => Int64Array()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + Int64Array copyWith(void Function(Int64Array) updates) => super.copyWith((message) => updates(message as Int64Array)) as Int64Array; // ignore: deprecated_member_use + $pb.BuilderInfo get info_ => _i; + @$core.pragma('dart2js:noInline') + static Int64Array create() => Int64Array._(); + Int64Array createEmptyInstance() => create(); + static $pb.PbList<Int64Array> createRepeated() => $pb.PbList<Int64Array>(); + @$core.pragma('dart2js:noInline') + static Int64Array getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<Int64Array>(create); + static Int64Array? _defaultInstance; + + @$pb.TagNumber(1) + $core.List<$fixnum.Int64> get values => $_getList(0); +} + +class Uint32Array extends $pb.GeneratedMessage { + static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'Uint32Array', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'kuksa.val.v1'), createEmptyInstance: create) + ..p<$core.int>(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'values', $pb.PbFieldType.KU3) + ..hasRequiredFields = false + ; + + Uint32Array._() : super(); + factory Uint32Array({ + $core.Iterable<$core.int>? values, + }) { + final _result = create(); + if (values != null) { + _result.values.addAll(values); + } + return _result; + } + factory Uint32Array.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory Uint32Array.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') + Uint32Array clone() => Uint32Array()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + Uint32Array copyWith(void Function(Uint32Array) updates) => super.copyWith((message) => updates(message as Uint32Array)) as Uint32Array; // ignore: deprecated_member_use + $pb.BuilderInfo get info_ => _i; + @$core.pragma('dart2js:noInline') + static Uint32Array create() => Uint32Array._(); + Uint32Array createEmptyInstance() => create(); + static $pb.PbList<Uint32Array> createRepeated() => $pb.PbList<Uint32Array>(); + @$core.pragma('dart2js:noInline') + static Uint32Array getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<Uint32Array>(create); + static Uint32Array? _defaultInstance; + + @$pb.TagNumber(1) + $core.List<$core.int> get values => $_getList(0); +} + +class Uint64Array extends $pb.GeneratedMessage { + static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'Uint64Array', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'kuksa.val.v1'), createEmptyInstance: create) + ..p<$fixnum.Int64>(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'values', $pb.PbFieldType.KU6) + ..hasRequiredFields = false + ; + + Uint64Array._() : super(); + factory Uint64Array({ + $core.Iterable<$fixnum.Int64>? values, + }) { + final _result = create(); + if (values != null) { + _result.values.addAll(values); + } + return _result; + } + factory Uint64Array.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory Uint64Array.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') + Uint64Array clone() => Uint64Array()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + Uint64Array copyWith(void Function(Uint64Array) updates) => super.copyWith((message) => updates(message as Uint64Array)) as Uint64Array; // ignore: deprecated_member_use + $pb.BuilderInfo get info_ => _i; + @$core.pragma('dart2js:noInline') + static Uint64Array create() => Uint64Array._(); + Uint64Array createEmptyInstance() => create(); + static $pb.PbList<Uint64Array> createRepeated() => $pb.PbList<Uint64Array>(); + @$core.pragma('dart2js:noInline') + static Uint64Array getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<Uint64Array>(create); + static Uint64Array? _defaultInstance; + + @$pb.TagNumber(1) + $core.List<$fixnum.Int64> get values => $_getList(0); +} + +class FloatArray extends $pb.GeneratedMessage { + static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'FloatArray', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'kuksa.val.v1'), createEmptyInstance: create) + ..p<$core.double>(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'values', $pb.PbFieldType.KF) + ..hasRequiredFields = false + ; + + FloatArray._() : super(); + factory FloatArray({ + $core.Iterable<$core.double>? values, + }) { + final _result = create(); + if (values != null) { + _result.values.addAll(values); + } + return _result; + } + factory FloatArray.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory FloatArray.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') + FloatArray clone() => FloatArray()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + FloatArray copyWith(void Function(FloatArray) updates) => super.copyWith((message) => updates(message as FloatArray)) as FloatArray; // ignore: deprecated_member_use + $pb.BuilderInfo get info_ => _i; + @$core.pragma('dart2js:noInline') + static FloatArray create() => FloatArray._(); + FloatArray createEmptyInstance() => create(); + static $pb.PbList<FloatArray> createRepeated() => $pb.PbList<FloatArray>(); + @$core.pragma('dart2js:noInline') + static FloatArray getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<FloatArray>(create); + static FloatArray? _defaultInstance; + + @$pb.TagNumber(1) + $core.List<$core.double> get values => $_getList(0); +} + +class DoubleArray extends $pb.GeneratedMessage { + static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'DoubleArray', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'kuksa.val.v1'), createEmptyInstance: create) + ..p<$core.double>(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'values', $pb.PbFieldType.KD) + ..hasRequiredFields = false + ; + + DoubleArray._() : super(); + factory DoubleArray({ + $core.Iterable<$core.double>? values, + }) { + final _result = create(); + if (values != null) { + _result.values.addAll(values); + } + return _result; + } + factory DoubleArray.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory DoubleArray.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') + DoubleArray clone() => DoubleArray()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + DoubleArray copyWith(void Function(DoubleArray) updates) => super.copyWith((message) => updates(message as DoubleArray)) as DoubleArray; // ignore: deprecated_member_use + $pb.BuilderInfo get info_ => _i; + @$core.pragma('dart2js:noInline') + static DoubleArray create() => DoubleArray._(); + DoubleArray createEmptyInstance() => create(); + static $pb.PbList<DoubleArray> createRepeated() => $pb.PbList<DoubleArray>(); + @$core.pragma('dart2js:noInline') + static DoubleArray getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<DoubleArray>(create); + static DoubleArray? _defaultInstance; + + @$pb.TagNumber(1) + $core.List<$core.double> get values => $_getList(0); +} + diff --git a/lib/generated/kuksa/val/v1/types.pbenum.dart b/lib/generated/kuksa/val/v1/types.pbenum.dart new file mode 100644 index 0000000..745d50a --- /dev/null +++ b/lib/generated/kuksa/val/v1/types.pbenum.dart @@ -0,0 +1,159 @@ +/// +// Generated code. Do not modify. +// source: kuksa/val/v1/types.proto +// +// @dart = 2.12 +// ignore_for_file: annotate_overrides,camel_case_types,constant_identifier_names,directives_ordering,library_prefixes,non_constant_identifier_names,prefer_final_fields,return_of_invalid_type,unnecessary_const,unnecessary_import,unnecessary_this,unused_import,unused_shown_name + +// ignore_for_file: UNDEFINED_SHOWN_NAME +import 'dart:core' as $core; +import 'package:protobuf/protobuf.dart' as $pb; + +class DataType extends $pb.ProtobufEnum { + static const DataType DATA_TYPE_UNSPECIFIED = DataType._(0, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'DATA_TYPE_UNSPECIFIED'); + static const DataType DATA_TYPE_STRING = DataType._(1, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'DATA_TYPE_STRING'); + static const DataType DATA_TYPE_BOOLEAN = DataType._(2, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'DATA_TYPE_BOOLEAN'); + static const DataType DATA_TYPE_INT8 = DataType._(3, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'DATA_TYPE_INT8'); + static const DataType DATA_TYPE_INT16 = DataType._(4, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'DATA_TYPE_INT16'); + static const DataType DATA_TYPE_INT32 = DataType._(5, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'DATA_TYPE_INT32'); + static const DataType DATA_TYPE_INT64 = DataType._(6, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'DATA_TYPE_INT64'); + static const DataType DATA_TYPE_UINT8 = DataType._(7, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'DATA_TYPE_UINT8'); + static const DataType DATA_TYPE_UINT16 = DataType._(8, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'DATA_TYPE_UINT16'); + static const DataType DATA_TYPE_UINT32 = DataType._(9, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'DATA_TYPE_UINT32'); + static const DataType DATA_TYPE_UINT64 = DataType._(10, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'DATA_TYPE_UINT64'); + static const DataType DATA_TYPE_FLOAT = DataType._(11, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'DATA_TYPE_FLOAT'); + static const DataType DATA_TYPE_DOUBLE = DataType._(12, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'DATA_TYPE_DOUBLE'); + static const DataType DATA_TYPE_TIMESTAMP = DataType._(13, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'DATA_TYPE_TIMESTAMP'); + static const DataType DATA_TYPE_STRING_ARRAY = DataType._(20, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'DATA_TYPE_STRING_ARRAY'); + static const DataType DATA_TYPE_BOOLEAN_ARRAY = DataType._(21, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'DATA_TYPE_BOOLEAN_ARRAY'); + static const DataType DATA_TYPE_INT8_ARRAY = DataType._(22, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'DATA_TYPE_INT8_ARRAY'); + static const DataType DATA_TYPE_INT16_ARRAY = DataType._(23, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'DATA_TYPE_INT16_ARRAY'); + static const DataType DATA_TYPE_INT32_ARRAY = DataType._(24, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'DATA_TYPE_INT32_ARRAY'); + static const DataType DATA_TYPE_INT64_ARRAY = DataType._(25, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'DATA_TYPE_INT64_ARRAY'); + static const DataType DATA_TYPE_UINT8_ARRAY = DataType._(26, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'DATA_TYPE_UINT8_ARRAY'); + static const DataType DATA_TYPE_UINT16_ARRAY = DataType._(27, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'DATA_TYPE_UINT16_ARRAY'); + static const DataType DATA_TYPE_UINT32_ARRAY = DataType._(28, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'DATA_TYPE_UINT32_ARRAY'); + static const DataType DATA_TYPE_UINT64_ARRAY = DataType._(29, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'DATA_TYPE_UINT64_ARRAY'); + static const DataType DATA_TYPE_FLOAT_ARRAY = DataType._(30, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'DATA_TYPE_FLOAT_ARRAY'); + static const DataType DATA_TYPE_DOUBLE_ARRAY = DataType._(31, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'DATA_TYPE_DOUBLE_ARRAY'); + static const DataType DATA_TYPE_TIMESTAMP_ARRAY = DataType._(32, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'DATA_TYPE_TIMESTAMP_ARRAY'); + + static const $core.List<DataType> values = <DataType> [ + DATA_TYPE_UNSPECIFIED, + DATA_TYPE_STRING, + DATA_TYPE_BOOLEAN, + DATA_TYPE_INT8, + DATA_TYPE_INT16, + DATA_TYPE_INT32, + DATA_TYPE_INT64, + DATA_TYPE_UINT8, + DATA_TYPE_UINT16, + DATA_TYPE_UINT32, + DATA_TYPE_UINT64, + DATA_TYPE_FLOAT, + DATA_TYPE_DOUBLE, + DATA_TYPE_TIMESTAMP, + DATA_TYPE_STRING_ARRAY, + DATA_TYPE_BOOLEAN_ARRAY, + DATA_TYPE_INT8_ARRAY, + DATA_TYPE_INT16_ARRAY, + DATA_TYPE_INT32_ARRAY, + DATA_TYPE_INT64_ARRAY, + DATA_TYPE_UINT8_ARRAY, + DATA_TYPE_UINT16_ARRAY, + DATA_TYPE_UINT32_ARRAY, + DATA_TYPE_UINT64_ARRAY, + DATA_TYPE_FLOAT_ARRAY, + DATA_TYPE_DOUBLE_ARRAY, + DATA_TYPE_TIMESTAMP_ARRAY, + ]; + + static final $core.Map<$core.int, DataType> _byValue = $pb.ProtobufEnum.initByValue(values); + static DataType? valueOf($core.int value) => _byValue[value]; + + const DataType._($core.int v, $core.String n) : super(v, n); +} + +class EntryType extends $pb.ProtobufEnum { + static const EntryType ENTRY_TYPE_UNSPECIFIED = EntryType._(0, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'ENTRY_TYPE_UNSPECIFIED'); + static const EntryType ENTRY_TYPE_ATTRIBUTE = EntryType._(1, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'ENTRY_TYPE_ATTRIBUTE'); + static const EntryType ENTRY_TYPE_SENSOR = EntryType._(2, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'ENTRY_TYPE_SENSOR'); + static const EntryType ENTRY_TYPE_ACTUATOR = EntryType._(3, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'ENTRY_TYPE_ACTUATOR'); + + static const $core.List<EntryType> values = <EntryType> [ + ENTRY_TYPE_UNSPECIFIED, + ENTRY_TYPE_ATTRIBUTE, + ENTRY_TYPE_SENSOR, + ENTRY_TYPE_ACTUATOR, + ]; + + static final $core.Map<$core.int, EntryType> _byValue = $pb.ProtobufEnum.initByValue(values); + static EntryType? valueOf($core.int value) => _byValue[value]; + + const EntryType._($core.int v, $core.String n) : super(v, n); +} + +class View extends $pb.ProtobufEnum { + static const View VIEW_UNSPECIFIED = View._(0, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'VIEW_UNSPECIFIED'); + static const View VIEW_CURRENT_VALUE = View._(1, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'VIEW_CURRENT_VALUE'); + static const View VIEW_TARGET_VALUE = View._(2, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'VIEW_TARGET_VALUE'); + static const View VIEW_METADATA = View._(3, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'VIEW_METADATA'); + static const View VIEW_FIELDS = View._(10, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'VIEW_FIELDS'); + static const View VIEW_ALL = View._(20, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'VIEW_ALL'); + + static const $core.List<View> values = <View> [ + VIEW_UNSPECIFIED, + VIEW_CURRENT_VALUE, + VIEW_TARGET_VALUE, + VIEW_METADATA, + VIEW_FIELDS, + VIEW_ALL, + ]; + + static final $core.Map<$core.int, View> _byValue = $pb.ProtobufEnum.initByValue(values); + static View? valueOf($core.int value) => _byValue[value]; + + const View._($core.int v, $core.String n) : super(v, n); +} + +class Field extends $pb.ProtobufEnum { + static const Field FIELD_UNSPECIFIED = Field._(0, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'FIELD_UNSPECIFIED'); + static const Field FIELD_PATH = Field._(1, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'FIELD_PATH'); + static const Field FIELD_VALUE = Field._(2, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'FIELD_VALUE'); + static const Field FIELD_ACTUATOR_TARGET = Field._(3, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'FIELD_ACTUATOR_TARGET'); + static const Field FIELD_METADATA = Field._(10, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'FIELD_METADATA'); + static const Field FIELD_METADATA_DATA_TYPE = Field._(11, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'FIELD_METADATA_DATA_TYPE'); + static const Field FIELD_METADATA_DESCRIPTION = Field._(12, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'FIELD_METADATA_DESCRIPTION'); + static const Field FIELD_METADATA_ENTRY_TYPE = Field._(13, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'FIELD_METADATA_ENTRY_TYPE'); + static const Field FIELD_METADATA_COMMENT = Field._(14, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'FIELD_METADATA_COMMENT'); + static const Field FIELD_METADATA_DEPRECATION = Field._(15, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'FIELD_METADATA_DEPRECATION'); + static const Field FIELD_METADATA_UNIT = Field._(16, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'FIELD_METADATA_UNIT'); + static const Field FIELD_METADATA_VALUE_RESTRICTION = Field._(17, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'FIELD_METADATA_VALUE_RESTRICTION'); + static const Field FIELD_METADATA_ACTUATOR = Field._(20, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'FIELD_METADATA_ACTUATOR'); + static const Field FIELD_METADATA_SENSOR = Field._(30, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'FIELD_METADATA_SENSOR'); + static const Field FIELD_METADATA_ATTRIBUTE = Field._(40, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'FIELD_METADATA_ATTRIBUTE'); + + static const $core.List<Field> values = <Field> [ + FIELD_UNSPECIFIED, + FIELD_PATH, + FIELD_VALUE, + FIELD_ACTUATOR_TARGET, + FIELD_METADATA, + FIELD_METADATA_DATA_TYPE, + FIELD_METADATA_DESCRIPTION, + FIELD_METADATA_ENTRY_TYPE, + FIELD_METADATA_COMMENT, + FIELD_METADATA_DEPRECATION, + FIELD_METADATA_UNIT, + FIELD_METADATA_VALUE_RESTRICTION, + FIELD_METADATA_ACTUATOR, + FIELD_METADATA_SENSOR, + FIELD_METADATA_ATTRIBUTE, + ]; + + static final $core.Map<$core.int, Field> _byValue = $pb.ProtobufEnum.initByValue(values); + static Field? valueOf($core.int value) => _byValue[value]; + + const Field._($core.int v, $core.String n) : super(v, n); +} + diff --git a/lib/generated/kuksa/val/v1/types.pbjson.dart b/lib/generated/kuksa/val/v1/types.pbjson.dart new file mode 100644 index 0000000..063631a --- /dev/null +++ b/lib/generated/kuksa/val/v1/types.pbjson.dart @@ -0,0 +1,364 @@ +/// +// Generated code. Do not modify. +// source: kuksa/val/v1/types.proto +// +// @dart = 2.12 +// ignore_for_file: annotate_overrides,camel_case_types,constant_identifier_names,deprecated_member_use_from_same_package,directives_ordering,library_prefixes,non_constant_identifier_names,prefer_final_fields,return_of_invalid_type,unnecessary_const,unnecessary_import,unnecessary_this,unused_import,unused_shown_name + +import 'dart:core' as $core; +import 'dart:convert' as $convert; +import 'dart:typed_data' as $typed_data; +@$core.Deprecated('Use dataTypeDescriptor instead') +const DataType$json = const { + '1': 'DataType', + '2': const [ + const {'1': 'DATA_TYPE_UNSPECIFIED', '2': 0}, + const {'1': 'DATA_TYPE_STRING', '2': 1}, + const {'1': 'DATA_TYPE_BOOLEAN', '2': 2}, + const {'1': 'DATA_TYPE_INT8', '2': 3}, + const {'1': 'DATA_TYPE_INT16', '2': 4}, + const {'1': 'DATA_TYPE_INT32', '2': 5}, + const {'1': 'DATA_TYPE_INT64', '2': 6}, + const {'1': 'DATA_TYPE_UINT8', '2': 7}, + const {'1': 'DATA_TYPE_UINT16', '2': 8}, + const {'1': 'DATA_TYPE_UINT32', '2': 9}, + const {'1': 'DATA_TYPE_UINT64', '2': 10}, + const {'1': 'DATA_TYPE_FLOAT', '2': 11}, + const {'1': 'DATA_TYPE_DOUBLE', '2': 12}, + const {'1': 'DATA_TYPE_TIMESTAMP', '2': 13}, + const {'1': 'DATA_TYPE_STRING_ARRAY', '2': 20}, + const {'1': 'DATA_TYPE_BOOLEAN_ARRAY', '2': 21}, + const {'1': 'DATA_TYPE_INT8_ARRAY', '2': 22}, + const {'1': 'DATA_TYPE_INT16_ARRAY', '2': 23}, + const {'1': 'DATA_TYPE_INT32_ARRAY', '2': 24}, + const {'1': 'DATA_TYPE_INT64_ARRAY', '2': 25}, + const {'1': 'DATA_TYPE_UINT8_ARRAY', '2': 26}, + const {'1': 'DATA_TYPE_UINT16_ARRAY', '2': 27}, + const {'1': 'DATA_TYPE_UINT32_ARRAY', '2': 28}, + const {'1': 'DATA_TYPE_UINT64_ARRAY', '2': 29}, + const {'1': 'DATA_TYPE_FLOAT_ARRAY', '2': 30}, + const {'1': 'DATA_TYPE_DOUBLE_ARRAY', '2': 31}, + const {'1': 'DATA_TYPE_TIMESTAMP_ARRAY', '2': 32}, + ], +}; + +/// Descriptor for `DataType`. Decode as a `google.protobuf.EnumDescriptorProto`. +final $typed_data.Uint8List dataTypeDescriptor = $convert.base64Decode('CghEYXRhVHlwZRIZChVEQVRBX1RZUEVfVU5TUEVDSUZJRUQQABIUChBEQVRBX1RZUEVfU1RSSU5HEAESFQoRREFUQV9UWVBFX0JPT0xFQU4QAhISCg5EQVRBX1RZUEVfSU5UOBADEhMKD0RBVEFfVFlQRV9JTlQxNhAEEhMKD0RBVEFfVFlQRV9JTlQzMhAFEhMKD0RBVEFfVFlQRV9JTlQ2NBAGEhMKD0RBVEFfVFlQRV9VSU5UOBAHEhQKEERBVEFfVFlQRV9VSU5UMTYQCBIUChBEQVRBX1RZUEVfVUlOVDMyEAkSFAoQREFUQV9UWVBFX1VJTlQ2NBAKEhMKD0RBVEFfVFlQRV9GTE9BVBALEhQKEERBVEFfVFlQRV9ET1VCTEUQDBIXChNEQVRBX1RZUEVfVElNRVNUQU1QEA0SGgoWREFUQV9UWVBFX1NUUklOR19BUlJBWRAUEhsKF0RBVEFfVFlQRV9CT09MRUFOX0FSUkFZEBUSGAoUREFUQV9UWVBFX0lOVDhfQVJSQVkQFhIZChVEQVRBX1RZUEVfSU5UMTZfQVJSQVkQFxIZChVEQVRBX1RZUEVfSU5UMzJfQVJSQVkQGBIZChVEQVRBX1RZUEVfSU5UNjRfQVJSQVkQGRIZChVEQVRBX1RZUEVfVUlOVDhfQVJSQVkQGhIaChZEQVRBX1RZUEVfVUlOVDE2X0FSUkFZEBsSGgoWREFUQV9UWVBFX1VJTlQzMl9BUlJBWRAcEhoKFkRBVEFfVFlQRV9VSU5UNjRfQVJSQVkQHRIZChVEQVRBX1RZUEVfRkxPQVRfQVJSQVkQHhIaChZEQVRBX1RZUEVfRE9VQkxFX0FSUkFZEB8SHQoZREFUQV9UWVBFX1RJTUVTVEFNUF9BUlJBWRAg'); +@$core.Deprecated('Use entryTypeDescriptor instead') +const EntryType$json = const { + '1': 'EntryType', + '2': const [ + const {'1': 'ENTRY_TYPE_UNSPECIFIED', '2': 0}, + const {'1': 'ENTRY_TYPE_ATTRIBUTE', '2': 1}, + const {'1': 'ENTRY_TYPE_SENSOR', '2': 2}, + const {'1': 'ENTRY_TYPE_ACTUATOR', '2': 3}, + ], +}; + +/// Descriptor for `EntryType`. Decode as a `google.protobuf.EnumDescriptorProto`. +final $typed_data.Uint8List entryTypeDescriptor = $convert.base64Decode('CglFbnRyeVR5cGUSGgoWRU5UUllfVFlQRV9VTlNQRUNJRklFRBAAEhgKFEVOVFJZX1RZUEVfQVRUUklCVVRFEAESFQoRRU5UUllfVFlQRV9TRU5TT1IQAhIXChNFTlRSWV9UWVBFX0FDVFVBVE9SEAM='); +@$core.Deprecated('Use viewDescriptor instead') +const View$json = const { + '1': 'View', + '2': const [ + const {'1': 'VIEW_UNSPECIFIED', '2': 0}, + const {'1': 'VIEW_CURRENT_VALUE', '2': 1}, + const {'1': 'VIEW_TARGET_VALUE', '2': 2}, + const {'1': 'VIEW_METADATA', '2': 3}, + const {'1': 'VIEW_FIELDS', '2': 10}, + const {'1': 'VIEW_ALL', '2': 20}, + ], +}; + +/// Descriptor for `View`. Decode as a `google.protobuf.EnumDescriptorProto`. +final $typed_data.Uint8List viewDescriptor = $convert.base64Decode('CgRWaWV3EhQKEFZJRVdfVU5TUEVDSUZJRUQQABIWChJWSUVXX0NVUlJFTlRfVkFMVUUQARIVChFWSUVXX1RBUkdFVF9WQUxVRRACEhEKDVZJRVdfTUVUQURBVEEQAxIPCgtWSUVXX0ZJRUxEUxAKEgwKCFZJRVdfQUxMEBQ='); +@$core.Deprecated('Use fieldDescriptor instead') +const Field$json = const { + '1': 'Field', + '2': const [ + const {'1': 'FIELD_UNSPECIFIED', '2': 0}, + const {'1': 'FIELD_PATH', '2': 1}, + const {'1': 'FIELD_VALUE', '2': 2}, + const {'1': 'FIELD_ACTUATOR_TARGET', '2': 3}, + const {'1': 'FIELD_METADATA', '2': 10}, + const {'1': 'FIELD_METADATA_DATA_TYPE', '2': 11}, + const {'1': 'FIELD_METADATA_DESCRIPTION', '2': 12}, + const {'1': 'FIELD_METADATA_ENTRY_TYPE', '2': 13}, + const {'1': 'FIELD_METADATA_COMMENT', '2': 14}, + const {'1': 'FIELD_METADATA_DEPRECATION', '2': 15}, + const {'1': 'FIELD_METADATA_UNIT', '2': 16}, + const {'1': 'FIELD_METADATA_VALUE_RESTRICTION', '2': 17}, + const {'1': 'FIELD_METADATA_ACTUATOR', '2': 20}, + const {'1': 'FIELD_METADATA_SENSOR', '2': 30}, + const {'1': 'FIELD_METADATA_ATTRIBUTE', '2': 40}, + ], +}; + +/// Descriptor for `Field`. Decode as a `google.protobuf.EnumDescriptorProto`. +final $typed_data.Uint8List fieldDescriptor = $convert.base64Decode('CgVGaWVsZBIVChFGSUVMRF9VTlNQRUNJRklFRBAAEg4KCkZJRUxEX1BBVEgQARIPCgtGSUVMRF9WQUxVRRACEhkKFUZJRUxEX0FDVFVBVE9SX1RBUkdFVBADEhIKDkZJRUxEX01FVEFEQVRBEAoSHAoYRklFTERfTUVUQURBVEFfREFUQV9UWVBFEAsSHgoaRklFTERfTUVUQURBVEFfREVTQ1JJUFRJT04QDBIdChlGSUVMRF9NRVRBREFUQV9FTlRSWV9UWVBFEA0SGgoWRklFTERfTUVUQURBVEFfQ09NTUVOVBAOEh4KGkZJRUxEX01FVEFEQVRBX0RFUFJFQ0FUSU9OEA8SFwoTRklFTERfTUVUQURBVEFfVU5JVBAQEiQKIEZJRUxEX01FVEFEQVRBX1ZBTFVFX1JFU1RSSUNUSU9OEBESGwoXRklFTERfTUVUQURBVEFfQUNUVUFUT1IQFBIZChVGSUVMRF9NRVRBREFUQV9TRU5TT1IQHhIcChhGSUVMRF9NRVRBREFUQV9BVFRSSUJVVEUQKA=='); +@$core.Deprecated('Use dataEntryDescriptor instead') +const DataEntry$json = const { + '1': 'DataEntry', + '2': const [ + const {'1': 'path', '3': 1, '4': 1, '5': 9, '10': 'path'}, + const {'1': 'value', '3': 2, '4': 1, '5': 11, '6': '.kuksa.val.v1.Datapoint', '10': 'value'}, + const {'1': 'actuator_target', '3': 3, '4': 1, '5': 11, '6': '.kuksa.val.v1.Datapoint', '10': 'actuatorTarget'}, + const {'1': 'metadata', '3': 10, '4': 1, '5': 11, '6': '.kuksa.val.v1.Metadata', '10': 'metadata'}, + ], +}; + +/// Descriptor for `DataEntry`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List dataEntryDescriptor = $convert.base64Decode('CglEYXRhRW50cnkSEgoEcGF0aBgBIAEoCVIEcGF0aBItCgV2YWx1ZRgCIAEoCzIXLmt1a3NhLnZhbC52MS5EYXRhcG9pbnRSBXZhbHVlEkAKD2FjdHVhdG9yX3RhcmdldBgDIAEoCzIXLmt1a3NhLnZhbC52MS5EYXRhcG9pbnRSDmFjdHVhdG9yVGFyZ2V0EjIKCG1ldGFkYXRhGAogASgLMhYua3Vrc2EudmFsLnYxLk1ldGFkYXRhUghtZXRhZGF0YQ=='); +@$core.Deprecated('Use datapointDescriptor instead') +const Datapoint$json = const { + '1': 'Datapoint', + '2': const [ + const {'1': 'timestamp', '3': 1, '4': 1, '5': 11, '6': '.google.protobuf.Timestamp', '10': 'timestamp'}, + const {'1': 'string', '3': 11, '4': 1, '5': 9, '9': 0, '10': 'string'}, + const {'1': 'bool', '3': 12, '4': 1, '5': 8, '9': 0, '10': 'bool'}, + const {'1': 'int32', '3': 13, '4': 1, '5': 17, '9': 0, '10': 'int32'}, + const {'1': 'int64', '3': 14, '4': 1, '5': 18, '9': 0, '10': 'int64'}, + const {'1': 'uint32', '3': 15, '4': 1, '5': 13, '9': 0, '10': 'uint32'}, + const {'1': 'uint64', '3': 16, '4': 1, '5': 4, '9': 0, '10': 'uint64'}, + const {'1': 'float', '3': 17, '4': 1, '5': 2, '9': 0, '10': 'float'}, + const {'1': 'double', '3': 18, '4': 1, '5': 1, '9': 0, '10': 'double'}, + const {'1': 'string_array', '3': 21, '4': 1, '5': 11, '6': '.kuksa.val.v1.StringArray', '9': 0, '10': 'stringArray'}, + const {'1': 'bool_array', '3': 22, '4': 1, '5': 11, '6': '.kuksa.val.v1.BoolArray', '9': 0, '10': 'boolArray'}, + const {'1': 'int32_array', '3': 23, '4': 1, '5': 11, '6': '.kuksa.val.v1.Int32Array', '9': 0, '10': 'int32Array'}, + const {'1': 'int64_array', '3': 24, '4': 1, '5': 11, '6': '.kuksa.val.v1.Int64Array', '9': 0, '10': 'int64Array'}, + const {'1': 'uint32_array', '3': 25, '4': 1, '5': 11, '6': '.kuksa.val.v1.Uint32Array', '9': 0, '10': 'uint32Array'}, + const {'1': 'uint64_array', '3': 26, '4': 1, '5': 11, '6': '.kuksa.val.v1.Uint64Array', '9': 0, '10': 'uint64Array'}, + const {'1': 'float_array', '3': 27, '4': 1, '5': 11, '6': '.kuksa.val.v1.FloatArray', '9': 0, '10': 'floatArray'}, + const {'1': 'double_array', '3': 28, '4': 1, '5': 11, '6': '.kuksa.val.v1.DoubleArray', '9': 0, '10': 'doubleArray'}, + ], + '8': const [ + const {'1': 'value'}, + ], +}; + +/// Descriptor for `Datapoint`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List datapointDescriptor = $convert.base64Decode('CglEYXRhcG9pbnQSOAoJdGltZXN0YW1wGAEgASgLMhouZ29vZ2xlLnByb3RvYnVmLlRpbWVzdGFtcFIJdGltZXN0YW1wEhgKBnN0cmluZxgLIAEoCUgAUgZzdHJpbmcSFAoEYm9vbBgMIAEoCEgAUgRib29sEhYKBWludDMyGA0gASgRSABSBWludDMyEhYKBWludDY0GA4gASgSSABSBWludDY0EhgKBnVpbnQzMhgPIAEoDUgAUgZ1aW50MzISGAoGdWludDY0GBAgASgESABSBnVpbnQ2NBIWCgVmbG9hdBgRIAEoAkgAUgVmbG9hdBIYCgZkb3VibGUYEiABKAFIAFIGZG91YmxlEj4KDHN0cmluZ19hcnJheRgVIAEoCzIZLmt1a3NhLnZhbC52MS5TdHJpbmdBcnJheUgAUgtzdHJpbmdBcnJheRI4Cgpib29sX2FycmF5GBYgASgLMhcua3Vrc2EudmFsLnYxLkJvb2xBcnJheUgAUglib29sQXJyYXkSOwoLaW50MzJfYXJyYXkYFyABKAsyGC5rdWtzYS52YWwudjEuSW50MzJBcnJheUgAUgppbnQzMkFycmF5EjsKC2ludDY0X2FycmF5GBggASgLMhgua3Vrc2EudmFsLnYxLkludDY0QXJyYXlIAFIKaW50NjRBcnJheRI+Cgx1aW50MzJfYXJyYXkYGSABKAsyGS5rdWtzYS52YWwudjEuVWludDMyQXJyYXlIAFILdWludDMyQXJyYXkSPgoMdWludDY0X2FycmF5GBogASgLMhkua3Vrc2EudmFsLnYxLlVpbnQ2NEFycmF5SABSC3VpbnQ2NEFycmF5EjsKC2Zsb2F0X2FycmF5GBsgASgLMhgua3Vrc2EudmFsLnYxLkZsb2F0QXJyYXlIAFIKZmxvYXRBcnJheRI+Cgxkb3VibGVfYXJyYXkYHCABKAsyGS5rdWtzYS52YWwudjEuRG91YmxlQXJyYXlIAFILZG91YmxlQXJyYXlCBwoFdmFsdWU='); +@$core.Deprecated('Use metadataDescriptor instead') +const Metadata$json = const { + '1': 'Metadata', + '2': const [ + const {'1': 'data_type', '3': 11, '4': 1, '5': 14, '6': '.kuksa.val.v1.DataType', '10': 'dataType'}, + const {'1': 'entry_type', '3': 12, '4': 1, '5': 14, '6': '.kuksa.val.v1.EntryType', '10': 'entryType'}, + const {'1': 'description', '3': 13, '4': 1, '5': 9, '9': 1, '10': 'description', '17': true}, + const {'1': 'comment', '3': 14, '4': 1, '5': 9, '9': 2, '10': 'comment', '17': true}, + const {'1': 'deprecation', '3': 15, '4': 1, '5': 9, '9': 3, '10': 'deprecation', '17': true}, + const {'1': 'unit', '3': 16, '4': 1, '5': 9, '9': 4, '10': 'unit', '17': true}, + const {'1': 'value_restriction', '3': 17, '4': 1, '5': 11, '6': '.kuksa.val.v1.ValueRestriction', '10': 'valueRestriction'}, + const {'1': 'actuator', '3': 20, '4': 1, '5': 11, '6': '.kuksa.val.v1.Actuator', '9': 0, '10': 'actuator'}, + const {'1': 'sensor', '3': 30, '4': 1, '5': 11, '6': '.kuksa.val.v1.Sensor', '9': 0, '10': 'sensor'}, + const {'1': 'attribute', '3': 40, '4': 1, '5': 11, '6': '.kuksa.val.v1.Attribute', '9': 0, '10': 'attribute'}, + ], + '8': const [ + const {'1': 'entry_specific'}, + const {'1': '_description'}, + const {'1': '_comment'}, + const {'1': '_deprecation'}, + const {'1': '_unit'}, + ], +}; + +/// Descriptor for `Metadata`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List metadataDescriptor = $convert.base64Decode('CghNZXRhZGF0YRIzCglkYXRhX3R5cGUYCyABKA4yFi5rdWtzYS52YWwudjEuRGF0YVR5cGVSCGRhdGFUeXBlEjYKCmVudHJ5X3R5cGUYDCABKA4yFy5rdWtzYS52YWwudjEuRW50cnlUeXBlUgllbnRyeVR5cGUSJQoLZGVzY3JpcHRpb24YDSABKAlIAVILZGVzY3JpcHRpb26IAQESHQoHY29tbWVudBgOIAEoCUgCUgdjb21tZW50iAEBEiUKC2RlcHJlY2F0aW9uGA8gASgJSANSC2RlcHJlY2F0aW9uiAEBEhcKBHVuaXQYECABKAlIBFIEdW5pdIgBARJLChF2YWx1ZV9yZXN0cmljdGlvbhgRIAEoCzIeLmt1a3NhLnZhbC52MS5WYWx1ZVJlc3RyaWN0aW9uUhB2YWx1ZVJlc3RyaWN0aW9uEjQKCGFjdHVhdG9yGBQgASgLMhYua3Vrc2EudmFsLnYxLkFjdHVhdG9ySABSCGFjdHVhdG9yEi4KBnNlbnNvchgeIAEoCzIULmt1a3NhLnZhbC52MS5TZW5zb3JIAFIGc2Vuc29yEjcKCWF0dHJpYnV0ZRgoIAEoCzIXLmt1a3NhLnZhbC52MS5BdHRyaWJ1dGVIAFIJYXR0cmlidXRlQhAKDmVudHJ5X3NwZWNpZmljQg4KDF9kZXNjcmlwdGlvbkIKCghfY29tbWVudEIOCgxfZGVwcmVjYXRpb25CBwoFX3VuaXQ='); +@$core.Deprecated('Use actuatorDescriptor instead') +const Actuator$json = const { + '1': 'Actuator', +}; + +/// Descriptor for `Actuator`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List actuatorDescriptor = $convert.base64Decode('CghBY3R1YXRvcg=='); +@$core.Deprecated('Use sensorDescriptor instead') +const Sensor$json = const { + '1': 'Sensor', +}; + +/// Descriptor for `Sensor`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List sensorDescriptor = $convert.base64Decode('CgZTZW5zb3I='); +@$core.Deprecated('Use attributeDescriptor instead') +const Attribute$json = const { + '1': 'Attribute', +}; + +/// Descriptor for `Attribute`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List attributeDescriptor = $convert.base64Decode('CglBdHRyaWJ1dGU='); +@$core.Deprecated('Use valueRestrictionDescriptor instead') +const ValueRestriction$json = const { + '1': 'ValueRestriction', + '2': const [ + const {'1': 'string', '3': 21, '4': 1, '5': 11, '6': '.kuksa.val.v1.ValueRestrictionString', '9': 0, '10': 'string'}, + const {'1': 'signed', '3': 22, '4': 1, '5': 11, '6': '.kuksa.val.v1.ValueRestrictionInt', '9': 0, '10': 'signed'}, + const {'1': 'unsigned', '3': 23, '4': 1, '5': 11, '6': '.kuksa.val.v1.ValueRestrictionUint', '9': 0, '10': 'unsigned'}, + const {'1': 'floating_point', '3': 24, '4': 1, '5': 11, '6': '.kuksa.val.v1.ValueRestrictionFloat', '9': 0, '10': 'floatingPoint'}, + ], + '8': const [ + const {'1': 'type'}, + ], +}; + +/// Descriptor for `ValueRestriction`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List valueRestrictionDescriptor = $convert.base64Decode('ChBWYWx1ZVJlc3RyaWN0aW9uEj4KBnN0cmluZxgVIAEoCzIkLmt1a3NhLnZhbC52MS5WYWx1ZVJlc3RyaWN0aW9uU3RyaW5nSABSBnN0cmluZxI7CgZzaWduZWQYFiABKAsyIS5rdWtzYS52YWwudjEuVmFsdWVSZXN0cmljdGlvbkludEgAUgZzaWduZWQSQAoIdW5zaWduZWQYFyABKAsyIi5rdWtzYS52YWwudjEuVmFsdWVSZXN0cmljdGlvblVpbnRIAFIIdW5zaWduZWQSTAoOZmxvYXRpbmdfcG9pbnQYGCABKAsyIy5rdWtzYS52YWwudjEuVmFsdWVSZXN0cmljdGlvbkZsb2F0SABSDWZsb2F0aW5nUG9pbnRCBgoEdHlwZQ=='); +@$core.Deprecated('Use valueRestrictionIntDescriptor instead') +const ValueRestrictionInt$json = const { + '1': 'ValueRestrictionInt', + '2': const [ + const {'1': 'min', '3': 1, '4': 1, '5': 18, '9': 0, '10': 'min', '17': true}, + const {'1': 'max', '3': 2, '4': 1, '5': 18, '9': 1, '10': 'max', '17': true}, + const {'1': 'allowed_values', '3': 3, '4': 3, '5': 18, '10': 'allowedValues'}, + ], + '8': const [ + const {'1': '_min'}, + const {'1': '_max'}, + ], +}; + +/// Descriptor for `ValueRestrictionInt`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List valueRestrictionIntDescriptor = $convert.base64Decode('ChNWYWx1ZVJlc3RyaWN0aW9uSW50EhUKA21pbhgBIAEoEkgAUgNtaW6IAQESFQoDbWF4GAIgASgSSAFSA21heIgBARIlCg5hbGxvd2VkX3ZhbHVlcxgDIAMoElINYWxsb3dlZFZhbHVlc0IGCgRfbWluQgYKBF9tYXg='); +@$core.Deprecated('Use valueRestrictionUintDescriptor instead') +const ValueRestrictionUint$json = const { + '1': 'ValueRestrictionUint', + '2': const [ + const {'1': 'min', '3': 1, '4': 1, '5': 4, '9': 0, '10': 'min', '17': true}, + const {'1': 'max', '3': 2, '4': 1, '5': 4, '9': 1, '10': 'max', '17': true}, + const {'1': 'allowed_values', '3': 3, '4': 3, '5': 4, '10': 'allowedValues'}, + ], + '8': const [ + const {'1': '_min'}, + const {'1': '_max'}, + ], +}; + +/// Descriptor for `ValueRestrictionUint`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List valueRestrictionUintDescriptor = $convert.base64Decode('ChRWYWx1ZVJlc3RyaWN0aW9uVWludBIVCgNtaW4YASABKARIAFIDbWluiAEBEhUKA21heBgCIAEoBEgBUgNtYXiIAQESJQoOYWxsb3dlZF92YWx1ZXMYAyADKARSDWFsbG93ZWRWYWx1ZXNCBgoEX21pbkIGCgRfbWF4'); +@$core.Deprecated('Use valueRestrictionFloatDescriptor instead') +const ValueRestrictionFloat$json = const { + '1': 'ValueRestrictionFloat', + '2': const [ + const {'1': 'min', '3': 1, '4': 1, '5': 1, '9': 0, '10': 'min', '17': true}, + const {'1': 'max', '3': 2, '4': 1, '5': 1, '9': 1, '10': 'max', '17': true}, + const {'1': 'allowed_values', '3': 3, '4': 3, '5': 1, '10': 'allowedValues'}, + ], + '8': const [ + const {'1': '_min'}, + const {'1': '_max'}, + ], +}; + +/// Descriptor for `ValueRestrictionFloat`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List valueRestrictionFloatDescriptor = $convert.base64Decode('ChVWYWx1ZVJlc3RyaWN0aW9uRmxvYXQSFQoDbWluGAEgASgBSABSA21pbogBARIVCgNtYXgYAiABKAFIAVIDbWF4iAEBEiUKDmFsbG93ZWRfdmFsdWVzGAMgAygBUg1hbGxvd2VkVmFsdWVzQgYKBF9taW5CBgoEX21heA=='); +@$core.Deprecated('Use valueRestrictionStringDescriptor instead') +const ValueRestrictionString$json = const { + '1': 'ValueRestrictionString', + '2': const [ + const {'1': 'allowed_values', '3': 3, '4': 3, '5': 9, '10': 'allowedValues'}, + ], +}; + +/// Descriptor for `ValueRestrictionString`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List valueRestrictionStringDescriptor = $convert.base64Decode('ChZWYWx1ZVJlc3RyaWN0aW9uU3RyaW5nEiUKDmFsbG93ZWRfdmFsdWVzGAMgAygJUg1hbGxvd2VkVmFsdWVz'); +@$core.Deprecated('Use errorDescriptor instead') +const Error$json = const { + '1': 'Error', + '2': const [ + const {'1': 'code', '3': 1, '4': 1, '5': 13, '10': 'code'}, + const {'1': 'reason', '3': 2, '4': 1, '5': 9, '10': 'reason'}, + const {'1': 'message', '3': 3, '4': 1, '5': 9, '10': 'message'}, + ], +}; + +/// Descriptor for `Error`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List errorDescriptor = $convert.base64Decode('CgVFcnJvchISCgRjb2RlGAEgASgNUgRjb2RlEhYKBnJlYXNvbhgCIAEoCVIGcmVhc29uEhgKB21lc3NhZ2UYAyABKAlSB21lc3NhZ2U='); +@$core.Deprecated('Use dataEntryErrorDescriptor instead') +const DataEntryError$json = const { + '1': 'DataEntryError', + '2': const [ + const {'1': 'path', '3': 1, '4': 1, '5': 9, '10': 'path'}, + const {'1': 'error', '3': 2, '4': 1, '5': 11, '6': '.kuksa.val.v1.Error', '10': 'error'}, + ], +}; + +/// Descriptor for `DataEntryError`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List dataEntryErrorDescriptor = $convert.base64Decode('Cg5EYXRhRW50cnlFcnJvchISCgRwYXRoGAEgASgJUgRwYXRoEikKBWVycm9yGAIgASgLMhMua3Vrc2EudmFsLnYxLkVycm9yUgVlcnJvcg=='); +@$core.Deprecated('Use stringArrayDescriptor instead') +const StringArray$json = const { + '1': 'StringArray', + '2': const [ + const {'1': 'values', '3': 1, '4': 3, '5': 9, '10': 'values'}, + ], +}; + +/// Descriptor for `StringArray`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List stringArrayDescriptor = $convert.base64Decode('CgtTdHJpbmdBcnJheRIWCgZ2YWx1ZXMYASADKAlSBnZhbHVlcw=='); +@$core.Deprecated('Use boolArrayDescriptor instead') +const BoolArray$json = const { + '1': 'BoolArray', + '2': const [ + const {'1': 'values', '3': 1, '4': 3, '5': 8, '10': 'values'}, + ], +}; + +/// Descriptor for `BoolArray`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List boolArrayDescriptor = $convert.base64Decode('CglCb29sQXJyYXkSFgoGdmFsdWVzGAEgAygIUgZ2YWx1ZXM='); +@$core.Deprecated('Use int32ArrayDescriptor instead') +const Int32Array$json = const { + '1': 'Int32Array', + '2': const [ + const {'1': 'values', '3': 1, '4': 3, '5': 17, '10': 'values'}, + ], +}; + +/// Descriptor for `Int32Array`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List int32ArrayDescriptor = $convert.base64Decode('CgpJbnQzMkFycmF5EhYKBnZhbHVlcxgBIAMoEVIGdmFsdWVz'); +@$core.Deprecated('Use int64ArrayDescriptor instead') +const Int64Array$json = const { + '1': 'Int64Array', + '2': const [ + const {'1': 'values', '3': 1, '4': 3, '5': 18, '10': 'values'}, + ], +}; + +/// Descriptor for `Int64Array`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List int64ArrayDescriptor = $convert.base64Decode('CgpJbnQ2NEFycmF5EhYKBnZhbHVlcxgBIAMoElIGdmFsdWVz'); +@$core.Deprecated('Use uint32ArrayDescriptor instead') +const Uint32Array$json = const { + '1': 'Uint32Array', + '2': const [ + const {'1': 'values', '3': 1, '4': 3, '5': 13, '10': 'values'}, + ], +}; + +/// Descriptor for `Uint32Array`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List uint32ArrayDescriptor = $convert.base64Decode('CgtVaW50MzJBcnJheRIWCgZ2YWx1ZXMYASADKA1SBnZhbHVlcw=='); +@$core.Deprecated('Use uint64ArrayDescriptor instead') +const Uint64Array$json = const { + '1': 'Uint64Array', + '2': const [ + const {'1': 'values', '3': 1, '4': 3, '5': 4, '10': 'values'}, + ], +}; + +/// Descriptor for `Uint64Array`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List uint64ArrayDescriptor = $convert.base64Decode('CgtVaW50NjRBcnJheRIWCgZ2YWx1ZXMYASADKARSBnZhbHVlcw=='); +@$core.Deprecated('Use floatArrayDescriptor instead') +const FloatArray$json = const { + '1': 'FloatArray', + '2': const [ + const {'1': 'values', '3': 1, '4': 3, '5': 2, '10': 'values'}, + ], +}; + +/// Descriptor for `FloatArray`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List floatArrayDescriptor = $convert.base64Decode('CgpGbG9hdEFycmF5EhYKBnZhbHVlcxgBIAMoAlIGdmFsdWVz'); +@$core.Deprecated('Use doubleArrayDescriptor instead') +const DoubleArray$json = const { + '1': 'DoubleArray', + '2': const [ + const {'1': 'values', '3': 1, '4': 3, '5': 1, '10': 'values'}, + ], +}; + +/// Descriptor for `DoubleArray`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List doubleArrayDescriptor = $convert.base64Decode('CgtEb3VibGVBcnJheRIWCgZ2YWx1ZXMYASADKAFSBnZhbHVlcw=='); diff --git a/lib/generated/kuksa/val/v1/val.pb.dart b/lib/generated/kuksa/val/v1/val.pb.dart new file mode 100644 index 0000000..761fba0 --- /dev/null +++ b/lib/generated/kuksa/val/v1/val.pb.dart @@ -0,0 +1,586 @@ +/// +// Generated code. Do not modify. +// source: kuksa/val/v1/val.proto +// +// @dart = 2.12 +// ignore_for_file: annotate_overrides,camel_case_types,constant_identifier_names,directives_ordering,library_prefixes,non_constant_identifier_names,prefer_final_fields,return_of_invalid_type,unnecessary_const,unnecessary_import,unnecessary_this,unused_import,unused_shown_name + +import 'dart:core' as $core; + +import 'package:protobuf/protobuf.dart' as $pb; + +import 'types.pb.dart' as $1; + +import 'types.pbenum.dart' as $1; + +class EntryRequest extends $pb.GeneratedMessage { + static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'EntryRequest', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'kuksa.val.v1'), createEmptyInstance: create) + ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'path') + ..e<$1.View>(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'view', $pb.PbFieldType.OE, defaultOrMaker: $1.View.VIEW_UNSPECIFIED, valueOf: $1.View.valueOf, enumValues: $1.View.values) + ..pc<$1.Field>(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'fields', $pb.PbFieldType.KE, valueOf: $1.Field.valueOf, enumValues: $1.Field.values, defaultEnumValue: $1.Field.FIELD_UNSPECIFIED) + ..hasRequiredFields = false + ; + + EntryRequest._() : super(); + factory EntryRequest({ + $core.String? path, + $1.View? view, + $core.Iterable<$1.Field>? fields, + }) { + final _result = create(); + if (path != null) { + _result.path = path; + } + if (view != null) { + _result.view = view; + } + if (fields != null) { + _result.fields.addAll(fields); + } + return _result; + } + factory EntryRequest.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory EntryRequest.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') + EntryRequest clone() => EntryRequest()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + EntryRequest copyWith(void Function(EntryRequest) updates) => super.copyWith((message) => updates(message as EntryRequest)) as EntryRequest; // ignore: deprecated_member_use + $pb.BuilderInfo get info_ => _i; + @$core.pragma('dart2js:noInline') + static EntryRequest create() => EntryRequest._(); + EntryRequest createEmptyInstance() => create(); + static $pb.PbList<EntryRequest> createRepeated() => $pb.PbList<EntryRequest>(); + @$core.pragma('dart2js:noInline') + static EntryRequest getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<EntryRequest>(create); + static EntryRequest? _defaultInstance; + + @$pb.TagNumber(1) + $core.String get path => $_getSZ(0); + @$pb.TagNumber(1) + set path($core.String v) { $_setString(0, v); } + @$pb.TagNumber(1) + $core.bool hasPath() => $_has(0); + @$pb.TagNumber(1) + void clearPath() => clearField(1); + + @$pb.TagNumber(2) + $1.View get view => $_getN(1); + @$pb.TagNumber(2) + set view($1.View v) { setField(2, v); } + @$pb.TagNumber(2) + $core.bool hasView() => $_has(1); + @$pb.TagNumber(2) + void clearView() => clearField(2); + + @$pb.TagNumber(3) + $core.List<$1.Field> get fields => $_getList(2); +} + +class GetRequest extends $pb.GeneratedMessage { + static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'GetRequest', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'kuksa.val.v1'), createEmptyInstance: create) + ..pc<EntryRequest>(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'entries', $pb.PbFieldType.PM, subBuilder: EntryRequest.create) + ..hasRequiredFields = false + ; + + GetRequest._() : super(); + factory GetRequest({ + $core.Iterable<EntryRequest>? entries, + }) { + final _result = create(); + if (entries != null) { + _result.entries.addAll(entries); + } + return _result; + } + factory GetRequest.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory GetRequest.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') + GetRequest clone() => GetRequest()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + GetRequest copyWith(void Function(GetRequest) updates) => super.copyWith((message) => updates(message as GetRequest)) as GetRequest; // ignore: deprecated_member_use + $pb.BuilderInfo get info_ => _i; + @$core.pragma('dart2js:noInline') + static GetRequest create() => GetRequest._(); + GetRequest createEmptyInstance() => create(); + static $pb.PbList<GetRequest> createRepeated() => $pb.PbList<GetRequest>(); + @$core.pragma('dart2js:noInline') + static GetRequest getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<GetRequest>(create); + static GetRequest? _defaultInstance; + + @$pb.TagNumber(1) + $core.List<EntryRequest> get entries => $_getList(0); +} + +class GetResponse extends $pb.GeneratedMessage { + static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'GetResponse', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'kuksa.val.v1'), createEmptyInstance: create) + ..pc<$1.DataEntry>(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'entries', $pb.PbFieldType.PM, subBuilder: $1.DataEntry.create) + ..pc<$1.DataEntryError>(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'errors', $pb.PbFieldType.PM, subBuilder: $1.DataEntryError.create) + ..aOM<$1.Error>(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'error', subBuilder: $1.Error.create) + ..hasRequiredFields = false + ; + + GetResponse._() : super(); + factory GetResponse({ + $core.Iterable<$1.DataEntry>? entries, + $core.Iterable<$1.DataEntryError>? errors, + $1.Error? error, + }) { + final _result = create(); + if (entries != null) { + _result.entries.addAll(entries); + } + if (errors != null) { + _result.errors.addAll(errors); + } + if (error != null) { + _result.error = error; + } + return _result; + } + factory GetResponse.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory GetResponse.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') + GetResponse clone() => GetResponse()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + GetResponse copyWith(void Function(GetResponse) updates) => super.copyWith((message) => updates(message as GetResponse)) as GetResponse; // ignore: deprecated_member_use + $pb.BuilderInfo get info_ => _i; + @$core.pragma('dart2js:noInline') + static GetResponse create() => GetResponse._(); + GetResponse createEmptyInstance() => create(); + static $pb.PbList<GetResponse> createRepeated() => $pb.PbList<GetResponse>(); + @$core.pragma('dart2js:noInline') + static GetResponse getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<GetResponse>(create); + static GetResponse? _defaultInstance; + + @$pb.TagNumber(1) + $core.List<$1.DataEntry> get entries => $_getList(0); + + @$pb.TagNumber(2) + $core.List<$1.DataEntryError> get errors => $_getList(1); + + @$pb.TagNumber(3) + $1.Error get error => $_getN(2); + @$pb.TagNumber(3) + set error($1.Error v) { setField(3, v); } + @$pb.TagNumber(3) + $core.bool hasError() => $_has(2); + @$pb.TagNumber(3) + void clearError() => clearField(3); + @$pb.TagNumber(3) + $1.Error ensureError() => $_ensure(2); +} + +class EntryUpdate extends $pb.GeneratedMessage { + static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'EntryUpdate', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'kuksa.val.v1'), createEmptyInstance: create) + ..aOM<$1.DataEntry>(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'entry', subBuilder: $1.DataEntry.create) + ..pc<$1.Field>(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'fields', $pb.PbFieldType.KE, valueOf: $1.Field.valueOf, enumValues: $1.Field.values, defaultEnumValue: $1.Field.FIELD_UNSPECIFIED) + ..hasRequiredFields = false + ; + + EntryUpdate._() : super(); + factory EntryUpdate({ + $1.DataEntry? entry, + $core.Iterable<$1.Field>? fields, + }) { + final _result = create(); + if (entry != null) { + _result.entry = entry; + } + if (fields != null) { + _result.fields.addAll(fields); + } + return _result; + } + factory EntryUpdate.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory EntryUpdate.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') + EntryUpdate clone() => EntryUpdate()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + EntryUpdate copyWith(void Function(EntryUpdate) updates) => super.copyWith((message) => updates(message as EntryUpdate)) as EntryUpdate; // ignore: deprecated_member_use + $pb.BuilderInfo get info_ => _i; + @$core.pragma('dart2js:noInline') + static EntryUpdate create() => EntryUpdate._(); + EntryUpdate createEmptyInstance() => create(); + static $pb.PbList<EntryUpdate> createRepeated() => $pb.PbList<EntryUpdate>(); + @$core.pragma('dart2js:noInline') + static EntryUpdate getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<EntryUpdate>(create); + static EntryUpdate? _defaultInstance; + + @$pb.TagNumber(1) + $1.DataEntry get entry => $_getN(0); + @$pb.TagNumber(1) + set entry($1.DataEntry v) { setField(1, v); } + @$pb.TagNumber(1) + $core.bool hasEntry() => $_has(0); + @$pb.TagNumber(1) + void clearEntry() => clearField(1); + @$pb.TagNumber(1) + $1.DataEntry ensureEntry() => $_ensure(0); + + @$pb.TagNumber(2) + $core.List<$1.Field> get fields => $_getList(1); +} + +class SetRequest extends $pb.GeneratedMessage { + static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'SetRequest', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'kuksa.val.v1'), createEmptyInstance: create) + ..pc<EntryUpdate>(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'updates', $pb.PbFieldType.PM, subBuilder: EntryUpdate.create) + ..hasRequiredFields = false + ; + + SetRequest._() : super(); + factory SetRequest({ + $core.Iterable<EntryUpdate>? updates, + }) { + final _result = create(); + if (updates != null) { + _result.updates.addAll(updates); + } + return _result; + } + factory SetRequest.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory SetRequest.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') + SetRequest clone() => SetRequest()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + SetRequest copyWith(void Function(SetRequest) updates) => super.copyWith((message) => updates(message as SetRequest)) as SetRequest; // ignore: deprecated_member_use + $pb.BuilderInfo get info_ => _i; + @$core.pragma('dart2js:noInline') + static SetRequest create() => SetRequest._(); + SetRequest createEmptyInstance() => create(); + static $pb.PbList<SetRequest> createRepeated() => $pb.PbList<SetRequest>(); + @$core.pragma('dart2js:noInline') + static SetRequest getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<SetRequest>(create); + static SetRequest? _defaultInstance; + + @$pb.TagNumber(1) + $core.List<EntryUpdate> get updates => $_getList(0); +} + +class SetResponse extends $pb.GeneratedMessage { + static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'SetResponse', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'kuksa.val.v1'), createEmptyInstance: create) + ..aOM<$1.Error>(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'error', subBuilder: $1.Error.create) + ..pc<$1.DataEntryError>(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'errors', $pb.PbFieldType.PM, subBuilder: $1.DataEntryError.create) + ..hasRequiredFields = false + ; + + SetResponse._() : super(); + factory SetResponse({ + $1.Error? error, + $core.Iterable<$1.DataEntryError>? errors, + }) { + final _result = create(); + if (error != null) { + _result.error = error; + } + if (errors != null) { + _result.errors.addAll(errors); + } + return _result; + } + factory SetResponse.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory SetResponse.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') + SetResponse clone() => SetResponse()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + SetResponse copyWith(void Function(SetResponse) updates) => super.copyWith((message) => updates(message as SetResponse)) as SetResponse; // ignore: deprecated_member_use + $pb.BuilderInfo get info_ => _i; + @$core.pragma('dart2js:noInline') + static SetResponse create() => SetResponse._(); + SetResponse createEmptyInstance() => create(); + static $pb.PbList<SetResponse> createRepeated() => $pb.PbList<SetResponse>(); + @$core.pragma('dart2js:noInline') + static SetResponse getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<SetResponse>(create); + static SetResponse? _defaultInstance; + + @$pb.TagNumber(1) + $1.Error get error => $_getN(0); + @$pb.TagNumber(1) + set error($1.Error v) { setField(1, v); } + @$pb.TagNumber(1) + $core.bool hasError() => $_has(0); + @$pb.TagNumber(1) + void clearError() => clearField(1); + @$pb.TagNumber(1) + $1.Error ensureError() => $_ensure(0); + + @$pb.TagNumber(2) + $core.List<$1.DataEntryError> get errors => $_getList(1); +} + +class SubscribeEntry extends $pb.GeneratedMessage { + static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'SubscribeEntry', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'kuksa.val.v1'), createEmptyInstance: create) + ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'path') + ..e<$1.View>(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'view', $pb.PbFieldType.OE, defaultOrMaker: $1.View.VIEW_UNSPECIFIED, valueOf: $1.View.valueOf, enumValues: $1.View.values) + ..pc<$1.Field>(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'fields', $pb.PbFieldType.KE, valueOf: $1.Field.valueOf, enumValues: $1.Field.values, defaultEnumValue: $1.Field.FIELD_UNSPECIFIED) + ..hasRequiredFields = false + ; + + SubscribeEntry._() : super(); + factory SubscribeEntry({ + $core.String? path, + $1.View? view, + $core.Iterable<$1.Field>? fields, + }) { + final _result = create(); + if (path != null) { + _result.path = path; + } + if (view != null) { + _result.view = view; + } + if (fields != null) { + _result.fields.addAll(fields); + } + return _result; + } + factory SubscribeEntry.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory SubscribeEntry.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') + SubscribeEntry clone() => SubscribeEntry()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + SubscribeEntry copyWith(void Function(SubscribeEntry) updates) => super.copyWith((message) => updates(message as SubscribeEntry)) as SubscribeEntry; // ignore: deprecated_member_use + $pb.BuilderInfo get info_ => _i; + @$core.pragma('dart2js:noInline') + static SubscribeEntry create() => SubscribeEntry._(); + SubscribeEntry createEmptyInstance() => create(); + static $pb.PbList<SubscribeEntry> createRepeated() => $pb.PbList<SubscribeEntry>(); + @$core.pragma('dart2js:noInline') + static SubscribeEntry getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<SubscribeEntry>(create); + static SubscribeEntry? _defaultInstance; + + @$pb.TagNumber(1) + $core.String get path => $_getSZ(0); + @$pb.TagNumber(1) + set path($core.String v) { $_setString(0, v); } + @$pb.TagNumber(1) + $core.bool hasPath() => $_has(0); + @$pb.TagNumber(1) + void clearPath() => clearField(1); + + @$pb.TagNumber(2) + $1.View get view => $_getN(1); + @$pb.TagNumber(2) + set view($1.View v) { setField(2, v); } + @$pb.TagNumber(2) + $core.bool hasView() => $_has(1); + @$pb.TagNumber(2) + void clearView() => clearField(2); + + @$pb.TagNumber(3) + $core.List<$1.Field> get fields => $_getList(2); +} + +class SubscribeRequest extends $pb.GeneratedMessage { + static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'SubscribeRequest', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'kuksa.val.v1'), createEmptyInstance: create) + ..pc<SubscribeEntry>(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'entries', $pb.PbFieldType.PM, subBuilder: SubscribeEntry.create) + ..hasRequiredFields = false + ; + + SubscribeRequest._() : super(); + factory SubscribeRequest({ + $core.Iterable<SubscribeEntry>? entries, + }) { + final _result = create(); + if (entries != null) { + _result.entries.addAll(entries); + } + return _result; + } + factory SubscribeRequest.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory SubscribeRequest.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') + SubscribeRequest clone() => SubscribeRequest()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + SubscribeRequest copyWith(void Function(SubscribeRequest) updates) => super.copyWith((message) => updates(message as SubscribeRequest)) as SubscribeRequest; // ignore: deprecated_member_use + $pb.BuilderInfo get info_ => _i; + @$core.pragma('dart2js:noInline') + static SubscribeRequest create() => SubscribeRequest._(); + SubscribeRequest createEmptyInstance() => create(); + static $pb.PbList<SubscribeRequest> createRepeated() => $pb.PbList<SubscribeRequest>(); + @$core.pragma('dart2js:noInline') + static SubscribeRequest getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<SubscribeRequest>(create); + static SubscribeRequest? _defaultInstance; + + @$pb.TagNumber(1) + $core.List<SubscribeEntry> get entries => $_getList(0); +} + +class SubscribeResponse extends $pb.GeneratedMessage { + static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'SubscribeResponse', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'kuksa.val.v1'), createEmptyInstance: create) + ..pc<EntryUpdate>(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'updates', $pb.PbFieldType.PM, subBuilder: EntryUpdate.create) + ..hasRequiredFields = false + ; + + SubscribeResponse._() : super(); + factory SubscribeResponse({ + $core.Iterable<EntryUpdate>? updates, + }) { + final _result = create(); + if (updates != null) { + _result.updates.addAll(updates); + } + return _result; + } + factory SubscribeResponse.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory SubscribeResponse.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') + SubscribeResponse clone() => SubscribeResponse()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + SubscribeResponse copyWith(void Function(SubscribeResponse) updates) => super.copyWith((message) => updates(message as SubscribeResponse)) as SubscribeResponse; // ignore: deprecated_member_use + $pb.BuilderInfo get info_ => _i; + @$core.pragma('dart2js:noInline') + static SubscribeResponse create() => SubscribeResponse._(); + SubscribeResponse createEmptyInstance() => create(); + static $pb.PbList<SubscribeResponse> createRepeated() => $pb.PbList<SubscribeResponse>(); + @$core.pragma('dart2js:noInline') + static SubscribeResponse getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<SubscribeResponse>(create); + static SubscribeResponse? _defaultInstance; + + @$pb.TagNumber(1) + $core.List<EntryUpdate> get updates => $_getList(0); +} + +class GetServerInfoRequest extends $pb.GeneratedMessage { + static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'GetServerInfoRequest', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'kuksa.val.v1'), createEmptyInstance: create) + ..hasRequiredFields = false + ; + + GetServerInfoRequest._() : super(); + factory GetServerInfoRequest() => create(); + factory GetServerInfoRequest.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory GetServerInfoRequest.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') + GetServerInfoRequest clone() => GetServerInfoRequest()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + GetServerInfoRequest copyWith(void Function(GetServerInfoRequest) updates) => super.copyWith((message) => updates(message as GetServerInfoRequest)) as GetServerInfoRequest; // ignore: deprecated_member_use + $pb.BuilderInfo get info_ => _i; + @$core.pragma('dart2js:noInline') + static GetServerInfoRequest create() => GetServerInfoRequest._(); + GetServerInfoRequest createEmptyInstance() => create(); + static $pb.PbList<GetServerInfoRequest> createRepeated() => $pb.PbList<GetServerInfoRequest>(); + @$core.pragma('dart2js:noInline') + static GetServerInfoRequest getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<GetServerInfoRequest>(create); + static GetServerInfoRequest? _defaultInstance; +} + +class GetServerInfoResponse extends $pb.GeneratedMessage { + static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'GetServerInfoResponse', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'kuksa.val.v1'), createEmptyInstance: create) + ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'name') + ..aOS(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'version') + ..hasRequiredFields = false + ; + + GetServerInfoResponse._() : super(); + factory GetServerInfoResponse({ + $core.String? name, + $core.String? version, + }) { + final _result = create(); + if (name != null) { + _result.name = name; + } + if (version != null) { + _result.version = version; + } + return _result; + } + factory GetServerInfoResponse.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory GetServerInfoResponse.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') + GetServerInfoResponse clone() => GetServerInfoResponse()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + GetServerInfoResponse copyWith(void Function(GetServerInfoResponse) updates) => super.copyWith((message) => updates(message as GetServerInfoResponse)) as GetServerInfoResponse; // ignore: deprecated_member_use + $pb.BuilderInfo get info_ => _i; + @$core.pragma('dart2js:noInline') + static GetServerInfoResponse create() => GetServerInfoResponse._(); + GetServerInfoResponse createEmptyInstance() => create(); + static $pb.PbList<GetServerInfoResponse> createRepeated() => $pb.PbList<GetServerInfoResponse>(); + @$core.pragma('dart2js:noInline') + static GetServerInfoResponse getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<GetServerInfoResponse>(create); + static GetServerInfoResponse? _defaultInstance; + + @$pb.TagNumber(1) + $core.String get name => $_getSZ(0); + @$pb.TagNumber(1) + set name($core.String v) { $_setString(0, v); } + @$pb.TagNumber(1) + $core.bool hasName() => $_has(0); + @$pb.TagNumber(1) + void clearName() => clearField(1); + + @$pb.TagNumber(2) + $core.String get version => $_getSZ(1); + @$pb.TagNumber(2) + set version($core.String v) { $_setString(1, v); } + @$pb.TagNumber(2) + $core.bool hasVersion() => $_has(1); + @$pb.TagNumber(2) + void clearVersion() => clearField(2); +} + diff --git a/lib/generated/kuksa/val/v1/val.pbenum.dart b/lib/generated/kuksa/val/v1/val.pbenum.dart new file mode 100644 index 0000000..0500def --- /dev/null +++ b/lib/generated/kuksa/val/v1/val.pbenum.dart @@ -0,0 +1,7 @@ +/// +// Generated code. Do not modify. +// source: kuksa/val/v1/val.proto +// +// @dart = 2.12 +// ignore_for_file: annotate_overrides,camel_case_types,constant_identifier_names,directives_ordering,library_prefixes,non_constant_identifier_names,prefer_final_fields,return_of_invalid_type,unnecessary_const,unnecessary_import,unnecessary_this,unused_import,unused_shown_name + diff --git a/lib/generated/kuksa/val/v1/val.pbgrpc.dart b/lib/generated/kuksa/val/v1/val.pbgrpc.dart new file mode 100644 index 0000000..3a9a3c8 --- /dev/null +++ b/lib/generated/kuksa/val/v1/val.pbgrpc.dart @@ -0,0 +1,133 @@ +/// +// Generated code. Do not modify. +// source: kuksa/val/v1/val.proto +// +// @dart = 2.12 +// ignore_for_file: annotate_overrides,camel_case_types,constant_identifier_names,directives_ordering,library_prefixes,non_constant_identifier_names,prefer_final_fields,return_of_invalid_type,unnecessary_const,unnecessary_import,unnecessary_this,unused_import,unused_shown_name + +import 'dart:async' as $async; + +import 'dart:core' as $core; + +import 'package:grpc/service_api.dart' as $grpc; +import 'val.pb.dart' as $0; +export 'val.pb.dart'; + +class VALClient extends $grpc.Client { + static final _$get = $grpc.ClientMethod<$0.GetRequest, $0.GetResponse>( + '/kuksa.val.v1.VAL/Get', + ($0.GetRequest value) => value.writeToBuffer(), + ($core.List<$core.int> value) => $0.GetResponse.fromBuffer(value)); + static final _$set = $grpc.ClientMethod<$0.SetRequest, $0.SetResponse>( + '/kuksa.val.v1.VAL/Set', + ($0.SetRequest value) => value.writeToBuffer(), + ($core.List<$core.int> value) => $0.SetResponse.fromBuffer(value)); + static final _$subscribe = + $grpc.ClientMethod<$0.SubscribeRequest, $0.SubscribeResponse>( + '/kuksa.val.v1.VAL/Subscribe', + ($0.SubscribeRequest value) => value.writeToBuffer(), + ($core.List<$core.int> value) => + $0.SubscribeResponse.fromBuffer(value)); + static final _$getServerInfo = + $grpc.ClientMethod<$0.GetServerInfoRequest, $0.GetServerInfoResponse>( + '/kuksa.val.v1.VAL/GetServerInfo', + ($0.GetServerInfoRequest value) => value.writeToBuffer(), + ($core.List<$core.int> value) => + $0.GetServerInfoResponse.fromBuffer(value)); + + VALClient($grpc.ClientChannel channel, + {$grpc.CallOptions? options, + $core.Iterable<$grpc.ClientInterceptor>? interceptors}) + : super(channel, options: options, interceptors: interceptors); + + $grpc.ResponseFuture<$0.GetResponse> get($0.GetRequest request, + {$grpc.CallOptions? options}) { + return $createUnaryCall(_$get, request, options: options); + } + + $grpc.ResponseFuture<$0.SetResponse> set($0.SetRequest request, + {$grpc.CallOptions? options}) { + return $createUnaryCall(_$set, request, options: options); + } + + $grpc.ResponseStream<$0.SubscribeResponse> subscribe( + $0.SubscribeRequest request, + {$grpc.CallOptions? options}) { + return $createStreamingCall( + _$subscribe, $async.Stream.fromIterable([request]), + options: options); + } + + $grpc.ResponseFuture<$0.GetServerInfoResponse> getServerInfo( + $0.GetServerInfoRequest request, + {$grpc.CallOptions? options}) { + return $createUnaryCall(_$getServerInfo, request, options: options); + } +} + +abstract class VALServiceBase extends $grpc.Service { + $core.String get $name => 'kuksa.val.v1.VAL'; + + VALServiceBase() { + $addMethod($grpc.ServiceMethod<$0.GetRequest, $0.GetResponse>( + 'Get', + get_Pre, + false, + false, + ($core.List<$core.int> value) => $0.GetRequest.fromBuffer(value), + ($0.GetResponse value) => value.writeToBuffer())); + $addMethod($grpc.ServiceMethod<$0.SetRequest, $0.SetResponse>( + 'Set', + set_Pre, + false, + false, + ($core.List<$core.int> value) => $0.SetRequest.fromBuffer(value), + ($0.SetResponse value) => value.writeToBuffer())); + $addMethod($grpc.ServiceMethod<$0.SubscribeRequest, $0.SubscribeResponse>( + 'Subscribe', + subscribe_Pre, + false, + true, + ($core.List<$core.int> value) => $0.SubscribeRequest.fromBuffer(value), + ($0.SubscribeResponse value) => value.writeToBuffer())); + $addMethod( + $grpc.ServiceMethod<$0.GetServerInfoRequest, $0.GetServerInfoResponse>( + 'GetServerInfo', + getServerInfo_Pre, + false, + false, + ($core.List<$core.int> value) => + $0.GetServerInfoRequest.fromBuffer(value), + ($0.GetServerInfoResponse value) => value.writeToBuffer())); + } + + $async.Future<$0.GetResponse> get_Pre( + $grpc.ServiceCall call, $async.Future<$0.GetRequest> request) async { + return get(call, await request); + } + + $async.Future<$0.SetResponse> set_Pre( + $grpc.ServiceCall call, $async.Future<$0.SetRequest> request) async { + return set(call, await request); + } + + $async.Stream<$0.SubscribeResponse> subscribe_Pre($grpc.ServiceCall call, + $async.Future<$0.SubscribeRequest> request) async* { + yield* subscribe(call, await request); + } + + $async.Future<$0.GetServerInfoResponse> getServerInfo_Pre( + $grpc.ServiceCall call, + $async.Future<$0.GetServerInfoRequest> request) async { + return getServerInfo(call, await request); + } + + $async.Future<$0.GetResponse> get( + $grpc.ServiceCall call, $0.GetRequest request); + $async.Future<$0.SetResponse> set( + $grpc.ServiceCall call, $0.SetRequest request); + $async.Stream<$0.SubscribeResponse> subscribe( + $grpc.ServiceCall call, $0.SubscribeRequest request); + $async.Future<$0.GetServerInfoResponse> getServerInfo( + $grpc.ServiceCall call, $0.GetServerInfoRequest request); +} diff --git a/lib/generated/kuksa/val/v1/val.pbjson.dart b/lib/generated/kuksa/val/v1/val.pbjson.dart new file mode 100644 index 0000000..e6c035c --- /dev/null +++ b/lib/generated/kuksa/val/v1/val.pbjson.dart @@ -0,0 +1,126 @@ +/// +// Generated code. Do not modify. +// source: kuksa/val/v1/val.proto +// +// @dart = 2.12 +// ignore_for_file: annotate_overrides,camel_case_types,constant_identifier_names,deprecated_member_use_from_same_package,directives_ordering,library_prefixes,non_constant_identifier_names,prefer_final_fields,return_of_invalid_type,unnecessary_const,unnecessary_import,unnecessary_this,unused_import,unused_shown_name + +import 'dart:core' as $core; +import 'dart:convert' as $convert; +import 'dart:typed_data' as $typed_data; +@$core.Deprecated('Use entryRequestDescriptor instead') +const EntryRequest$json = const { + '1': 'EntryRequest', + '2': const [ + const {'1': 'path', '3': 1, '4': 1, '5': 9, '10': 'path'}, + const {'1': 'view', '3': 2, '4': 1, '5': 14, '6': '.kuksa.val.v1.View', '10': 'view'}, + const {'1': 'fields', '3': 3, '4': 3, '5': 14, '6': '.kuksa.val.v1.Field', '10': 'fields'}, + ], +}; + +/// Descriptor for `EntryRequest`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List entryRequestDescriptor = $convert.base64Decode('CgxFbnRyeVJlcXVlc3QSEgoEcGF0aBgBIAEoCVIEcGF0aBImCgR2aWV3GAIgASgOMhIua3Vrc2EudmFsLnYxLlZpZXdSBHZpZXcSKwoGZmllbGRzGAMgAygOMhMua3Vrc2EudmFsLnYxLkZpZWxkUgZmaWVsZHM='); +@$core.Deprecated('Use getRequestDescriptor instead') +const GetRequest$json = const { + '1': 'GetRequest', + '2': const [ + const {'1': 'entries', '3': 1, '4': 3, '5': 11, '6': '.kuksa.val.v1.EntryRequest', '10': 'entries'}, + ], +}; + +/// Descriptor for `GetRequest`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List getRequestDescriptor = $convert.base64Decode('CgpHZXRSZXF1ZXN0EjQKB2VudHJpZXMYASADKAsyGi5rdWtzYS52YWwudjEuRW50cnlSZXF1ZXN0UgdlbnRyaWVz'); +@$core.Deprecated('Use getResponseDescriptor instead') +const GetResponse$json = const { + '1': 'GetResponse', + '2': const [ + const {'1': 'entries', '3': 1, '4': 3, '5': 11, '6': '.kuksa.val.v1.DataEntry', '10': 'entries'}, + const {'1': 'errors', '3': 2, '4': 3, '5': 11, '6': '.kuksa.val.v1.DataEntryError', '10': 'errors'}, + const {'1': 'error', '3': 3, '4': 1, '5': 11, '6': '.kuksa.val.v1.Error', '10': 'error'}, + ], +}; + +/// Descriptor for `GetResponse`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List getResponseDescriptor = $convert.base64Decode('CgtHZXRSZXNwb25zZRIxCgdlbnRyaWVzGAEgAygLMhcua3Vrc2EudmFsLnYxLkRhdGFFbnRyeVIHZW50cmllcxI0CgZlcnJvcnMYAiADKAsyHC5rdWtzYS52YWwudjEuRGF0YUVudHJ5RXJyb3JSBmVycm9ycxIpCgVlcnJvchgDIAEoCzITLmt1a3NhLnZhbC52MS5FcnJvclIFZXJyb3I='); +@$core.Deprecated('Use entryUpdateDescriptor instead') +const EntryUpdate$json = const { + '1': 'EntryUpdate', + '2': const [ + const {'1': 'entry', '3': 1, '4': 1, '5': 11, '6': '.kuksa.val.v1.DataEntry', '10': 'entry'}, + const {'1': 'fields', '3': 2, '4': 3, '5': 14, '6': '.kuksa.val.v1.Field', '10': 'fields'}, + ], +}; + +/// Descriptor for `EntryUpdate`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List entryUpdateDescriptor = $convert.base64Decode('CgtFbnRyeVVwZGF0ZRItCgVlbnRyeRgBIAEoCzIXLmt1a3NhLnZhbC52MS5EYXRhRW50cnlSBWVudHJ5EisKBmZpZWxkcxgCIAMoDjITLmt1a3NhLnZhbC52MS5GaWVsZFIGZmllbGRz'); +@$core.Deprecated('Use setRequestDescriptor instead') +const SetRequest$json = const { + '1': 'SetRequest', + '2': const [ + const {'1': 'updates', '3': 1, '4': 3, '5': 11, '6': '.kuksa.val.v1.EntryUpdate', '10': 'updates'}, + ], +}; + +/// Descriptor for `SetRequest`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List setRequestDescriptor = $convert.base64Decode('CgpTZXRSZXF1ZXN0EjMKB3VwZGF0ZXMYASADKAsyGS5rdWtzYS52YWwudjEuRW50cnlVcGRhdGVSB3VwZGF0ZXM='); +@$core.Deprecated('Use setResponseDescriptor instead') +const SetResponse$json = const { + '1': 'SetResponse', + '2': const [ + const {'1': 'error', '3': 1, '4': 1, '5': 11, '6': '.kuksa.val.v1.Error', '10': 'error'}, + const {'1': 'errors', '3': 2, '4': 3, '5': 11, '6': '.kuksa.val.v1.DataEntryError', '10': 'errors'}, + ], +}; + +/// Descriptor for `SetResponse`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List setResponseDescriptor = $convert.base64Decode('CgtTZXRSZXNwb25zZRIpCgVlcnJvchgBIAEoCzITLmt1a3NhLnZhbC52MS5FcnJvclIFZXJyb3ISNAoGZXJyb3JzGAIgAygLMhwua3Vrc2EudmFsLnYxLkRhdGFFbnRyeUVycm9yUgZlcnJvcnM='); +@$core.Deprecated('Use subscribeEntryDescriptor instead') +const SubscribeEntry$json = const { + '1': 'SubscribeEntry', + '2': const [ + const {'1': 'path', '3': 1, '4': 1, '5': 9, '10': 'path'}, + const {'1': 'view', '3': 2, '4': 1, '5': 14, '6': '.kuksa.val.v1.View', '10': 'view'}, + const {'1': 'fields', '3': 3, '4': 3, '5': 14, '6': '.kuksa.val.v1.Field', '10': 'fields'}, + ], +}; + +/// Descriptor for `SubscribeEntry`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List subscribeEntryDescriptor = $convert.base64Decode('Cg5TdWJzY3JpYmVFbnRyeRISCgRwYXRoGAEgASgJUgRwYXRoEiYKBHZpZXcYAiABKA4yEi5rdWtzYS52YWwudjEuVmlld1IEdmlldxIrCgZmaWVsZHMYAyADKA4yEy5rdWtzYS52YWwudjEuRmllbGRSBmZpZWxkcw=='); +@$core.Deprecated('Use subscribeRequestDescriptor instead') +const SubscribeRequest$json = const { + '1': 'SubscribeRequest', + '2': const [ + const {'1': 'entries', '3': 1, '4': 3, '5': 11, '6': '.kuksa.val.v1.SubscribeEntry', '10': 'entries'}, + ], +}; + +/// Descriptor for `SubscribeRequest`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List subscribeRequestDescriptor = $convert.base64Decode('ChBTdWJzY3JpYmVSZXF1ZXN0EjYKB2VudHJpZXMYASADKAsyHC5rdWtzYS52YWwudjEuU3Vic2NyaWJlRW50cnlSB2VudHJpZXM='); +@$core.Deprecated('Use subscribeResponseDescriptor instead') +const SubscribeResponse$json = const { + '1': 'SubscribeResponse', + '2': const [ + const {'1': 'updates', '3': 1, '4': 3, '5': 11, '6': '.kuksa.val.v1.EntryUpdate', '10': 'updates'}, + ], +}; + +/// Descriptor for `SubscribeResponse`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List subscribeResponseDescriptor = $convert.base64Decode('ChFTdWJzY3JpYmVSZXNwb25zZRIzCgd1cGRhdGVzGAEgAygLMhkua3Vrc2EudmFsLnYxLkVudHJ5VXBkYXRlUgd1cGRhdGVz'); +@$core.Deprecated('Use getServerInfoRequestDescriptor instead') +const GetServerInfoRequest$json = const { + '1': 'GetServerInfoRequest', +}; + +/// Descriptor for `GetServerInfoRequest`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List getServerInfoRequestDescriptor = $convert.base64Decode('ChRHZXRTZXJ2ZXJJbmZvUmVxdWVzdA=='); +@$core.Deprecated('Use getServerInfoResponseDescriptor instead') +const GetServerInfoResponse$json = const { + '1': 'GetServerInfoResponse', + '2': const [ + const {'1': 'name', '3': 1, '4': 1, '5': 9, '10': 'name'}, + const {'1': 'version', '3': 2, '4': 1, '5': 9, '10': 'version'}, + ], +}; + +/// Descriptor for `GetServerInfoResponse`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List getServerInfoResponseDescriptor = $convert.base64Decode('ChVHZXRTZXJ2ZXJJbmZvUmVzcG9uc2USEgoEbmFtZRgBIAEoCVIEbmFtZRIYCgd2ZXJzaW9uGAIgASgJUgd2ZXJzaW9u'); diff --git a/lib/main.dart b/lib/main.dart index c1198ce..9717055 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -2,17 +2,16 @@ import 'dart:io';
import 'package:flutter/material.dart';
-import 'package:flutter_cluster_dashboard/cluster_config.dart';
+import 'package:flutter_cluster_dashboard/screen/home.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
-import 'package:flutter_cluster_dashboard/vehicle_signal/vehicle_signal_config.dart';
Future<void> main() async {
WidgetsFlutterBinding.ensureInitialized();
- HttpClient client = await initializeClient();
+
runApp(
ProviderScope(
child: MaterialApp(
- home: GetConfig(client: client),
+ home: Home(),
),
),
);
diff --git a/lib/map/navigationHome.dart b/lib/map/navigationHome.dart deleted file mode 100644 index 5218de7..0000000 --- a/lib/map/navigationHome.dart +++ /dev/null @@ -1,136 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 - -import 'dart:async'; -import 'package:flutter/material.dart'; -import 'package:flutter_cluster_dashboard/cluster_config.dart'; -import 'package:flutter_map/flutter_map.dart'; -import 'package:flutter_riverpod/flutter_riverpod.dart'; -import 'package:flutter_cluster_dashboard/map/networkPolyline.dart'; -import 'package:flutter_cluster_dashboard/provider.dart'; -import 'package:flutter_cluster_dashboard/vehicle_signal/vehicle_signal_provider.dart'; -import 'package:latlong2/latlong.dart'; - -class NavigationHome extends ConsumerStatefulWidget { - const NavigationHome({Key? key}) : super(key: key); - - @override - ConsumerState<NavigationHome> createState() => _NavigationHomeState(); -} - -class _NavigationHomeState extends ConsumerState<NavigationHome> { - late Timer timerCurrLocation; - Timer timerPolyline = Timer.periodic(const Duration(hours: 10), ((timer) {})); - double pathStroke = 5; - late MapController mapController; - // randomly initialization of the variable - LatLng src = LatLng(31.71, 76.95); - LatLng markerLocation = LatLng(31.71, 76.95); - - @override - void initState() { - super.initState(); - mapController = MapController(); - - WidgetsBinding.instance.addPostFrameCallback((timeStamp) { - var vehicle = ref.read(vehicleSignalProvider); - var polylineDB = ref.read(polyLineStateProvider); - final polylineDBNotifier = ref.read(polyLineStateProvider.notifier); - final clusterConfig = ref.read(clusterConfigStateprovider); - // timer for updating map center and zoom - timerCurrLocation = Timer.periodic(const Duration(seconds: 2), (timer) { - polylineDB = ref.read(polyLineStateProvider); - - vehicle = ref.read(vehicleSignalProvider); - markerLocation = LatLng(vehicle.currLat, vehicle.currLng); - // move and center - mapController.move(LatLng(vehicle.currLat, vehicle.currLng), 15); - - // rotate - double rotationDegree = 0; - int n = polylineDB.currPolyLineList.length; - if (polylineDB.currPolyLineList.isNotEmpty && n > 1) { - rotationDegree = calcAngle( - polylineDB.currPolyLineList[0], polylineDB.currPolyLineList[1]); - - rotationDegree = (rotationDegree.isNaN) ? 0 : rotationDegree; - } - // print("Rotation:$rotationDegree"); - mapController.rotate(-1 * rotationDegree); - }); - - // update polyline in polyline db - if (polylineDB.currPolyLineList.isEmpty && clusterConfig.orsApiKey.isNotEmpty) { - timerPolyline.cancel(); - timerPolyline = - Timer.periodic(const Duration(seconds: 10), (timer) async { - List data = await getJsonData(ref, vehicle.currLat, vehicle.currLng, - vehicle.desLat, vehicle.desLng); - List<LatLng> currList = - data.map((element) => LatLng(element[1], element[0])).toList(); - polylineDBNotifier.update(currPolyLineList: currList); - }); - } - }); - } - - @override - void dispose() { - super.dispose(); - timerCurrLocation.cancel(); - timerPolyline.cancel(); - } - - double tempangle = 0; - @override - Widget build(BuildContext context) { - final currListProvider = ref.watch(polyLineStateProvider); - List<LatLng> currPolyLineList = currListProvider.currPolyLineList; - - return FlutterMap( - mapController: mapController, - options: MapOptions( - rotation: 0, - center: src, - minZoom: 12, - zoom: 12, - maxZoom: 22.0, - keepAlive: true, - ), - layers: [ - TileLayerOptions( - maxZoom: 22, - maxNativeZoom: 18, - subdomains: ["a", "b", "c"], - urlTemplate: "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", - userAgentPackageName: 'dev.fleaflet.flutter_map.example', - ), - if (currPolyLineList.isNotEmpty) - PolylineLayerOptions( - polylineCulling: false, - polylines: [ - if (currPolyLineList.isNotEmpty) - Polyline( - strokeWidth: pathStroke, - points: currPolyLineList, - color: Colors.blue, - ), - ], - ), - if (currPolyLineList.isNotEmpty) - MarkerLayerOptions( - rotate: true, - markers: [ - Marker( - point: markerLocation, - width: 70, - height: 70, - builder: (context) => Image.asset( - "images/car.png", - ), - ), - ], - ), - ], - ); - } -} diff --git a/lib/map/networkPolyline.dart b/lib/map/networkPolyline.dart deleted file mode 100644 index 0241bec..0000000 --- a/lib/map/networkPolyline.dart +++ /dev/null @@ -1,86 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 - -import 'dart:math'; -import 'package:flutter_cluster_dashboard/cluster_config.dart'; -import 'package:flutter_riverpod/flutter_riverpod.dart'; -import 'package:http/http.dart' as http; -import 'dart:convert'; -import 'package:latlong2/latlong.dart'; - -class NetworkHelper { - NetworkHelper( - {required this.startLng, - required this.startLat, - required this.endLng, - required this.endLat}); - - final String url = 'https://api.openrouteservice.org/v2/directions/'; - - final double startLng; - final double startLat; - final double endLng; - final double endLat; - - Future getData(WidgetRef ref) async { - final config = ref.read(clusterConfigStateprovider); - String uriStr = - '$url${config.orsPathParam}?api_key=${config.orsApiKey}&start=$startLng,$startLat&end=$endLng,$endLat'; - http.Response response = await http.get(Uri.parse(uriStr)); - - if (response.statusCode == 200) { - String data = response.body; - return jsonDecode(data); - } else { - print("Warning: API Response Code: ${response.statusCode}"); - } - } -} - -Future getJsonData( - WidgetRef ref, - double startLat, - double startLng, - double endLat, - double endLng, -) async { - if (startLat == endLat && startLng == endLng) { - return []; - } else { - NetworkHelper network = NetworkHelper( - startLat: startLat, - startLng: startLng, - endLat: endLat, - endLng: endLng, - ); - try { - final apikey = ref.read(clusterConfigStateprovider).orsApiKey; - if (apikey.isNotEmpty) { - var data = await network.getData(ref); - return data['features'][0]['geometry']['coordinates']; - } - else { - return []; - } - } catch (error) { - print('Warning: Something Wrong with openstreet API Key !'); - return []; - } - } -} - -double calcAngle(LatLng a, LatLng b) { - List<double> newA = convertCoord(a); - List<double> newB = convertCoord(b); - double slope = (newB[1] - newA[1]) / (newB[0] - newA[0]); - // -1 * deg + 180 - return ((atan(slope) * 180) / pi); -} - -List<double> convertCoord(LatLng coord) { - double oldLat = coord.latitude; - double oldLong = coord.longitude; - double newLong = (oldLong * 20037508.34 / 180); - double newlat = - (log(tan((90 + oldLat) * pi / 360)) / (pi / 180)) * (20037508.34 / 180); - return [newlat, newLong]; -} diff --git a/lib/screen/home.dart b/lib/screen/home.dart index 3bd47a8..f154550 100644 --- a/lib/screen/home.dart +++ b/lib/screen/home.dart @@ -2,29 +2,44 @@ import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
-import 'package:flutter_cluster_dashboard/map/navigationHome.dart';
import 'package:flutter_cluster_dashboard/provider.dart';
-import 'package:flutter_cluster_dashboard/screen/widgets/guages/guage_props.dart';
+import 'package:flutter_cluster_dashboard/screen/widgets/gauges/gauge_props.dart';
import 'package:flutter_cluster_dashboard/screen/paints/bottombar_paint.dart';
import 'package:flutter_cluster_dashboard/screen/paints/topbar_paint.dart';
-import 'package:flutter_cluster_dashboard/screen/widgets/guages/rpm_guage_animation_wrapper.dart';
+import 'package:flutter_cluster_dashboard/screen/widgets/gauges/rpm_gauge_animation_wrapper.dart';
import 'package:flutter_cluster_dashboard/screen/widgets/left_bar.dart';
import 'package:flutter_cluster_dashboard/screen/widgets/performance_mode.dart';
import 'package:flutter_cluster_dashboard/screen/widgets/right_bar.dart';
-import 'package:flutter_cluster_dashboard/screen/widgets/guages/speed_guage_animation_wrapper.dart';
+import 'package:flutter_cluster_dashboard/screen/widgets/gauges/speed_gauge_animation_wrapper.dart';
import 'package:flutter_cluster_dashboard/screen/widgets/signals.dart';
import 'package:flutter_cluster_dashboard/screen/widgets/turn_signal.dart';
-import 'package:flutter_cluster_dashboard/vehicle_signal/vehicle_signal_provider.dart';
-import 'package:flutter_cluster_dashboard/cluster_config.dart';
+import 'package:flutter_cluster_dashboard/vehicle-signals/vss_client.dart';
+import 'package:flutter_cluster_dashboard/vehicle-signals/vss_provider.dart';
+import 'package:flutter_cluster_dashboard/vehicle-signals/vehicle_status_provider.dart';
import 'package:intl/intl.dart';
-class Home extends ConsumerWidget {
+class Home extends ConsumerStatefulWidget {
const Home({Key? key}) : super(key: key);
- GuageColors? getGuageColor(String mode) {
+
+ @override
+ _HomeState createState() => _HomeState();
+}
+
+class _HomeState extends ConsumerState<Home> {
+ late VssClient vss;
+
+ initState() {
+ vss = ref.read(vssClientProvider);
+ vss.run();
+
+ super.initState();
+ }
+
+ GaugeColors? getGaugeColor(String mode) {
return (mode == "economy")
- ? GuageProps.ecoModeColor
+ ? GaugeProps.ecoModeColor
: (mode == "sport")
- ? GuageProps.sportModeColor
+ ? GaugeProps.sportModeColor
: null;
}
@@ -46,9 +61,12 @@ class Home extends ConsumerWidget { }
@override
- Widget build(BuildContext context, WidgetRef ref) {
- final clusterConfig = ref.read(clusterConfigStateprovider);
- final vehicle = ref.watch(vehicleSignalProvider);
+ Widget build(BuildContext context) {
+ final bool isLeftIndicator = ref.watch(vehicleStatusProvider.select((p) => p.isLeftIndicator));
+ final bool isRightIndicator = ref.watch(vehicleStatusProvider.select((p) => p.isRightIndicator));
+ final String performanceMode = ref.watch(vehicleStatusProvider.select((p) => p.performanceMode));
+ final String selectedGear = ref.watch(vehicleStatusProvider.select((p) => p.selectedGear));
+ final double ambientAirTemp = ref.watch(vehicleStatusProvider.select((p) => p.ambientAirTemp));
final clock = ref.watch(clockProvider);
final windowHeight = MediaQuery.of(context).size.height;
final windowWidth = MediaQuery.of(context).size.width;
@@ -68,7 +86,7 @@ class Home extends ConsumerWidget { }
return Scaffold(
- backgroundColor: GuageProps.bgColor,
+ backgroundColor: GaugeProps.bgColor,
body: SafeArea(
child: Center(
child: Center(
@@ -87,8 +105,8 @@ class Home extends ConsumerWidget { children: [
TurnSignal(
screenHeight: screenHeight,
- isLefton: vehicle.isLeftIndicator,
- isRighton: vehicle.isRightIndicator,
+ isLefton: isLeftIndicator,
+ isRighton: isRightIndicator,
),
Flex(
direction: Axis.horizontal,
@@ -128,7 +146,7 @@ class Home extends ConsumerWidget { SizedBox(
width: (30 * screenHeight) / 480),
Text(
- "${vehicle.ambientAirTemp} ${"\u00B0"}C",
+ "${ambientAirTemp} ${"\u00B0"}C",
style: TextStyle(
color: const Color.fromARGB(
255, 184, 183, 183),
@@ -216,7 +234,7 @@ class Home extends ConsumerWidget { child: PerformanceMode(
size: Size((90 * screenHeight) / 480,
(20 * screenHeight) / 480),
- mode: vehicle.performanceMode),
+ mode: performanceMode),
),
// logo
Flexible(
@@ -224,25 +242,18 @@ class Home extends ConsumerWidget { fit: FlexFit.tight,
child: SizedBox(
width: (330 * screenHeight) / 720,
- child: (clusterConfig
- .enableNavigation &&
- vehicle.isSteeringInfo)
- ? const NavigationHome()
- : Padding(
- padding: EdgeInsets.symmetric(
- vertical:
- (36.0 * screenHeight) /
- 720,
- horizontal:
- (48.0 * screenHeight) /
- 720),
- child: Image.asset(
- "images/logo_agl.png",
- width:
- (90 * screenHeight) / 480,
- color: Colors.grey.shade600,
- ),
- ),
+ child: Padding(
+ padding: EdgeInsets.symmetric(
+ vertical:
+ (36.0 * screenHeight) / 720,
+ horizontal:
+ (48.0 * screenHeight) / 720),
+ child: Image.asset(
+ "images/logo_agl.png",
+ width: (90 * screenHeight) / 480,
+ color: Colors.grey.shade600,
+ ),
+ ),
),
),
const Flexible(
@@ -265,14 +276,11 @@ class Home extends ConsumerWidget { child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
- Signals(
- screenHeight: screenHeight,
- vehicle: vehicle,
- ),
+ Signals(screenHeight: screenHeight),
],
),
),
- // guages
+ // gauges
Padding(
padding: EdgeInsets.fromLTRB(
calcPadding(70, screenHeight),
@@ -283,17 +291,17 @@ class Home extends ConsumerWidget { mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
- // Speed Guage
+ // Speed Gauge
SpeedGauge(
screenHeight: screenHeight,
- guageColor:
- getGuageColor(vehicle.performanceMode),
+ gaugeColor:
+ getGaugeColor(performanceMode),
),
- //RPM Guage
+ //RPM Gauge
RPMGauge(
screenHeight: screenHeight,
- guageColor:
- getGuageColor(vehicle.performanceMode),
+ gaugeColor:
+ getGaugeColor(performanceMode),
),
],
),
@@ -314,33 +322,33 @@ class Home extends ConsumerWidget { child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
- (vehicle.selectedGear == Gear.parking)
+ (selectedGear == Gear.parking)
? Text("P",
- style: GuageProps.activeGearIconStyle(
+ style: GaugeProps.activeGearIconStyle(
screenHeight))
: Text("P",
- style: GuageProps.gearIconStyle(
+ style: GaugeProps.gearIconStyle(
screenHeight)),
- (vehicle.selectedGear == Gear.reverse)
+ (selectedGear == Gear.reverse)
? Text("R",
- style: GuageProps.activeGearIconStyle(
+ style: GaugeProps.activeGearIconStyle(
screenHeight))
: Text("R",
- style: GuageProps.gearIconStyle(
+ style: GaugeProps.gearIconStyle(
screenHeight)),
- (vehicle.selectedGear == Gear.neutral)
+ (selectedGear == Gear.neutral)
? Text("N",
- style: GuageProps.activeGearIconStyle(
+ style: GaugeProps.activeGearIconStyle(
screenHeight))
: Text("N",
- style: GuageProps.gearIconStyle(
+ style: GaugeProps.gearIconStyle(
screenHeight)),
- (vehicle.selectedGear == Gear.drive)
+ (selectedGear == Gear.drive)
? Text("D",
- style: GuageProps.activeGearIconStyle(
+ style: GaugeProps.activeGearIconStyle(
screenHeight))
: Text("D",
- style: GuageProps.gearIconStyle(
+ style: GaugeProps.gearIconStyle(
screenHeight)),
]),
),
diff --git a/lib/screen/paints/guage_paint.dart b/lib/screen/paints/gauge_paint.dart index 22f7544..bae265c 100644 --- a/lib/screen/paints/guage_paint.dart +++ b/lib/screen/paints/gauge_paint.dart @@ -3,15 +3,15 @@ import 'package:flutter/material.dart';
import 'dart:math';
import 'dart:ui' as ui;
-import 'package:flutter_cluster_dashboard/screen/widgets/guages/guage_props.dart';
+import 'package:flutter_cluster_dashboard/screen/widgets/gauges/gauge_props.dart';
-class GuagePainter extends CustomPainter {
+class GaugePainter extends CustomPainter {
final double low, high;
double currentSpeed;
final Color? outPrimaryColor;
final Color? inPrimaryColor;
final Color? secondaryColor;
- GuagePainter({
+ GaugePainter({
required this.low,
required this.high,
required this.currentSpeed,
@@ -25,7 +25,7 @@ class GuagePainter extends CustomPainter { double radius = min(size.width / 2, size.height / 2);
double radius1 = radius - ((20 / 200) * (radius));
double speedAngle =
- GuageProps.degToRad((GuageProps.majorAngle / high) * currentSpeed);
+ GaugeProps.degToRad((GaugeProps.majorAngle / high) * currentSpeed);
final zeroTickPaint = Paint()
..strokeWidth = ((7 / 200) * (radius))
@@ -89,8 +89,8 @@ class GuagePainter extends CustomPainter { [Colors.black, const Color.fromARGB(255, 142, 35, 39)], [0.65, 0.9]);
for (double i = 0; i < 13; i++) {
- double startAngle = GuageProps.degToRad(i * 20);
- double gapAngle = GuageProps.degToRad(19);
+ double startAngle = GaugeProps.degToRad(i * 20);
+ double gapAngle = GaugeProps.degToRad(19);
var outerPath = Path();
outerPath.addArc(Rect.fromCircle(center: center, radius: radius),
@@ -132,8 +132,8 @@ class GuagePainter extends CustomPainter { zeroTickPaint);
canvas.drawLine(
center,
- Offset(center.dx + (radius) * cos(GuageProps.majorAngleRad),
- center.dy + (radius) * sin(GuageProps.majorAngleRad)),
+ Offset(center.dx + (radius) * cos(GaugeProps.majorAngleRad),
+ center.dy + (radius) * sin(GaugeProps.majorAngleRad)),
maxTickPaint);
}
diff --git a/lib/screen/widgets/guages/guage_props.dart b/lib/screen/widgets/gauges/gauge_props.dart index bb56a31..51dba51 100644 --- a/lib/screen/widgets/guages/guage_props.dart +++ b/lib/screen/widgets/gauges/gauge_props.dart @@ -3,17 +3,17 @@ import 'dart:math';
import 'package:flutter/material.dart';
-class GuageProps {
- static GuageColors normalModeColor = GuageColors(
+class GaugeProps {
+ static GaugeColors normalModeColor = GaugeColors(
inPrimary: const Color.fromARGB(255, 67, 67, 67),
outPrimary: const Color.fromARGB(255, 120, 120, 120),
secondary: const Color.fromARGB(156, 226, 226, 200),
);
- static GuageColors sportModeColor = GuageColors(
+ static GaugeColors sportModeColor = GaugeColors(
inPrimary: Colors.deepPurple,
outPrimary: Colors.blue,
secondary: const Color.fromARGB(214, 202, 202, 202));
- static GuageColors ecoModeColor = GuageColors(
+ static GaugeColors ecoModeColor = GaugeColors(
inPrimary: const Color.fromARGB(255, 85, 165, 87),
outPrimary: const Color.fromARGB(255, 40, 92, 42),
secondary: const Color.fromARGB(202, 194, 238, 195));
@@ -40,9 +40,9 @@ class GuageProps { }
}
-class GuageColors {
+class GaugeColors {
Color? inPrimary;
Color? outPrimary;
Color? secondary;
- GuageColors({this.inPrimary, this.outPrimary, this.secondary});
+ GaugeColors({this.inPrimary, this.outPrimary, this.secondary});
}
diff --git a/lib/screen/widgets/guages/guage_widget.dart b/lib/screen/widgets/gauges/gauge_widget.dart index fa43958..c302953 100644 --- a/lib/screen/widgets/guages/guage_widget.dart +++ b/lib/screen/widgets/gauges/gauge_widget.dart @@ -2,11 +2,11 @@ import 'dart:math';
import 'package:flutter/material.dart';
-import 'package:flutter_cluster_dashboard/screen/paints/guage_paint.dart';
-import 'package:flutter_cluster_dashboard/screen/widgets/guages/guage_props.dart';
+import 'package:flutter_cluster_dashboard/screen/paints/gauge_paint.dart';
+import 'package:flutter_cluster_dashboard/screen/widgets/gauges/gauge_props.dart';
-class CustomGuage extends StatelessWidget {
- const CustomGuage({
+class CustomGauge extends StatelessWidget {
+ const CustomGauge({
Key? key,
required this.mainValue,
required this.low,
@@ -59,14 +59,14 @@ class CustomGuage extends StatelessWidget { child: Stack(
alignment: Alignment.topCenter,
children: [
- // Guage painter
+ // Gauge painter
Positioned(
top: 0,
child: Transform.rotate(
- angle: (pi / 2) + (GuageProps.minorAngle * (pi / 360.0)),
+ angle: (pi / 2) + (GaugeProps.minorAngle * (pi / 360.0)),
child: CustomPaint(
size: Size(size ?? 400, size ?? 400),
- painter: GuagePainter(
+ painter: GaugePainter(
low: low,
high: high,
currentSpeed: mainValue,
@@ -77,17 +77,17 @@ class CustomGuage extends StatelessWidget { ),
),
),
- // Guage Label
+ // Gauge Label
Positioned(
top: distLabelTop ?? ((100 / 400) * (size ?? 400)),
child: Text(label, style: labelTextStyle),
),
- // Guage Main Value
+ // Gauge Main Value
Positioned(
top: distMainTop ?? ((150 / 400) * (size ?? 400)),
child: Text("${mainValue.toInt()}", style: mainValueTextStyle),
),
- // Guage Ticks value
+ // Gauge Ticks value
Positioned(
bottom: distTicksBottom ?? ((80 / 400) * (size ?? 400)),
child: Row(
diff --git a/lib/screen/widgets/guages/rpm_guage_animation_wrapper.dart b/lib/screen/widgets/gauges/rpm_gauge_animation_wrapper.dart index 95403dd..fa76bd8 100644 --- a/lib/screen/widgets/guages/rpm_guage_animation_wrapper.dart +++ b/lib/screen/widgets/gauges/rpm_gauge_animation_wrapper.dart @@ -4,20 +4,19 @@ import 'package:flutter/material.dart'; import 'package:flutter/widgets.dart';
import 'package:flutter_hooks/flutter_hooks.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
-import 'package:flutter_cluster_dashboard/screen/widgets/guages/guage_props.dart';
-import 'package:flutter_cluster_dashboard/screen/widgets/guages/guage_widget.dart';
-import 'package:flutter_cluster_dashboard/vehicle_signal/vehicle_signal_model.dart';
-import 'package:flutter_cluster_dashboard/vehicle_signal/vehicle_signal_provider.dart';
+import 'package:flutter_cluster_dashboard/screen/widgets/gauges/gauge_props.dart';
+import 'package:flutter_cluster_dashboard/screen/widgets/gauges/gauge_widget.dart';
+import 'package:flutter_cluster_dashboard/vehicle-signals/vehicle_status_provider.dart';
class RPMGauge extends HookConsumerWidget {
final double screenHeight;
- final GuageColors? guageColor;
- const RPMGauge({Key? key, required this.screenHeight, this.guageColor})
+ final GaugeColors? gaugeColor;
+ const RPMGauge({Key? key, required this.screenHeight, this.gaugeColor})
: super(key: key);
@override
Widget build(BuildContext context, WidgetRef ref) {
- final VehicleSignal vehicle = ref.watch(vehicleSignalProvider);
+ final double rpm = ref.watch(vehicleStatusProvider.select((p) => p.rpm));
const double minRPM = 0;
const double maxRPM = 8000;
@@ -26,14 +25,14 @@ class RPMGauge extends HookConsumerWidget { final animationController = useAnimationController(
lowerBound: minRPM,
upperBound: maxRPM,
- )..animateTo(vehicle.rpm,
+ )..animateTo(rpm,
duration: sweepDuration, curve: Curves.linearToEaseOut);
return AnimatedBuilder(
animation: animationController,
builder: (context, child) {
return Padding(
padding: const EdgeInsets.all(8.0),
- child: CustomGuage(
+ child: CustomGauge(
size: (248 * screenHeight) / 480,
low: minRPM,
high: maxRPM,
@@ -41,9 +40,9 @@ class RPMGauge extends HookConsumerWidget { label: "rpm",
zeroTickLabel: minRPM.toInt().toString(),
maxTickLabel: maxRPM.toInt().toString(),
- inPrimaryColor: guageColor?.inPrimary,
- outPrimaryColor: guageColor?.outPrimary,
- secondaryColor: guageColor?.secondary,
+ inPrimaryColor: gaugeColor?.inPrimary,
+ outPrimaryColor: gaugeColor?.outPrimary,
+ secondaryColor: gaugeColor?.secondary,
),
);
});
diff --git a/lib/screen/widgets/guages/speed_guage_animation_wrapper.dart b/lib/screen/widgets/gauges/speed_gauge_animation_wrapper.dart index 8704fcd..dfa4277 100644 --- a/lib/screen/widgets/guages/speed_guage_animation_wrapper.dart +++ b/lib/screen/widgets/gauges/speed_gauge_animation_wrapper.dart @@ -3,31 +3,30 @@ import 'package:flutter/material.dart';
import 'package:flutter_hooks/flutter_hooks.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
-import 'package:flutter_cluster_dashboard/screen/widgets/guages/guage_props.dart';
-import 'package:flutter_cluster_dashboard/screen/widgets/guages/guage_widget.dart';
-import 'package:flutter_cluster_dashboard/vehicle_signal/vehicle_signal_model.dart';
-import 'package:flutter_cluster_dashboard/vehicle_signal/vehicle_signal_provider.dart';
+import 'package:flutter_cluster_dashboard/screen/widgets/gauges/gauge_props.dart';
+import 'package:flutter_cluster_dashboard/screen/widgets/gauges/gauge_widget.dart';
+import 'package:flutter_cluster_dashboard/vehicle-signals/vehicle_status_provider.dart';
class SpeedGauge extends HookConsumerWidget {
final double screenHeight;
- final GuageColors? guageColor;
- const SpeedGauge({Key? key, required this.screenHeight, this.guageColor})
+ final GaugeColors? gaugeColor;
+ const SpeedGauge({Key? key, required this.screenHeight, this.gaugeColor})
: super(key: key);
@override
Widget build(BuildContext context, WidgetRef ref) {
- final VehicleSignal vehicle = ref.watch(vehicleSignalProvider);
+ final double speed = ref.watch(vehicleStatusProvider.select((p) => p.speed));
+ final String units = ref.watch(vehicleStatusProvider.select((p) => p.vehicleDistanceUnit));
const double minSpeed = 0;
const double maxSpeed = 240;
const Duration sweepDuration = Duration(milliseconds: 200);
- double speedScaling =
- (vehicle.vehicleDistanceUnit == "mi") ? 0.621504 : 1.0;
+ double speedScaling = (units == "mi") ? 0.621504 : 1.0;
final animationController = useAnimationController(
lowerBound: minSpeed,
upperBound: maxSpeed,
- )..animateTo(speedScaling * (vehicle.speed),
+ )..animateTo(speedScaling * speed,
duration: sweepDuration, curve: Curves.linearToEaseOut);
return AnimatedBuilder(
@@ -35,32 +34,32 @@ class SpeedGauge extends HookConsumerWidget { builder: (context, child) {
return Padding(
padding: const EdgeInsets.all(8.0),
- child: CustomGuage(
+ child: CustomGauge(
size: (248 * screenHeight) / 480,
low: minSpeed,
high: maxSpeed,
mainValue: animationController.value,
- label: (vehicle.vehicleDistanceUnit == "mi") ? "mph" : "Km/h",
+ label: (units == "mi") ? "mph" : "Km/h",
zeroTickLabel: minSpeed.toInt().toString(),
maxTickLabel: maxSpeed.toInt().toString(),
- inPrimaryColor: guageColor?.inPrimary,
- outPrimaryColor: guageColor?.outPrimary,
- secondaryColor: guageColor?.secondary,
+ inPrimaryColor: gaugeColor?.inPrimary,
+ outPrimaryColor: gaugeColor?.outPrimary,
+ secondaryColor: gaugeColor?.secondary,
),
);
});
}
}
-final guageColorProvider = Provider.family<GuageColors, String>((ref, mode) {
+final gaugeColorProvider = Provider.family<GaugeColors, String>((ref, mode) {
switch (mode) {
case "normal":
- return GuageColors(inPrimary: Colors.red);
+ return GaugeColors(inPrimary: Colors.red);
case "sports":
- return GuageColors(inPrimary: Colors.blue);
+ return GaugeColors(inPrimary: Colors.blue);
case "eco":
- return GuageColors(inPrimary: Colors.green);
+ return GaugeColors(inPrimary: Colors.green);
default:
- return GuageColors();
+ return GaugeColors();
}
});
diff --git a/lib/screen/widgets/left_bar.dart b/lib/screen/widgets/left_bar.dart index 3192c28..ea877a5 100644 --- a/lib/screen/widgets/left_bar.dart +++ b/lib/screen/widgets/left_bar.dart @@ -4,8 +4,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_hooks/flutter_hooks.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:flutter_cluster_dashboard/screen/paints/arc_painter.dart';
-import 'package:flutter_cluster_dashboard/vehicle_signal/vehicle_signal_model.dart';
-import 'package:flutter_cluster_dashboard/vehicle_signal/vehicle_signal_provider.dart';
+import 'package:flutter_cluster_dashboard/vehicle-signals/vehicle_status_provider.dart';
class LeftArc extends HookConsumerWidget {
final double screenHeight;
@@ -14,11 +13,11 @@ class LeftArc extends HookConsumerWidget { @override
Widget build(BuildContext context, WidgetRef ref) {
- final VehicleSignal vehicle = ref.watch(vehicleSignalProvider);
+ final double coolantTemp = ref.watch(vehicleStatusProvider.select((p) => p.coolantTemp));
final animationController = useAnimationController(
lowerBound: 0,
upperBound: 100,
- )..animateTo(vehicle.coolantTemp,
+ )..animateTo(coolantTemp,
duration: const Duration(milliseconds: 1000));
return AnimatedBuilder(
diff --git a/lib/screen/widgets/right_bar.dart b/lib/screen/widgets/right_bar.dart index e5ed44d..a3d9ef4 100644 --- a/lib/screen/widgets/right_bar.dart +++ b/lib/screen/widgets/right_bar.dart @@ -4,8 +4,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_hooks/flutter_hooks.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:flutter_cluster_dashboard/screen/paints/arc_painter.dart';
-import 'package:flutter_cluster_dashboard/vehicle_signal/vehicle_signal_model.dart';
-import 'package:flutter_cluster_dashboard/vehicle_signal/vehicle_signal_provider.dart';
+import 'package:flutter_cluster_dashboard/vehicle-signals/vehicle_status_provider.dart';
class RightArc extends HookConsumerWidget {
final double screenHeight;
@@ -13,11 +12,11 @@ class RightArc extends HookConsumerWidget { @override
Widget build(BuildContext context, WidgetRef ref) {
- final VehicleSignal vehicle = ref.watch(vehicleSignalProvider);
+ final double fuelLevel = ref.watch(vehicleStatusProvider.select((p) => p.fuelLevel));
final animationController = useAnimationController(
lowerBound: 0,
upperBound: 100,
- )..animateTo(vehicle.fuelLevel,
+ )..animateTo(fuelLevel,
duration: const Duration(milliseconds: 500));
return AnimatedBuilder(
diff --git a/lib/screen/widgets/signals.dart b/lib/screen/widgets/signals.dart index dbdffb5..befaf7b 100644 --- a/lib/screen/widgets/signals.dart +++ b/lib/screen/widgets/signals.dart @@ -1,61 +1,70 @@ // SPDX-License-Identifier: Apache-2.0
import 'package:flutter/material.dart';
-import 'package:flutter_cluster_dashboard/vehicle_signal/vehicle_signal_model.dart';
+import 'package:flutter_riverpod/flutter_riverpod.dart';
+import 'package:flutter_cluster_dashboard/vehicle-signals/vehicle_status_provider.dart';
-class Signals extends StatelessWidget {
- final VehicleSignal vehicle;
+class Signals extends ConsumerWidget {
final double screenHeight;
static Color idleColor = Colors.grey.shade600;
const Signals({
Key? key,
- required this.screenHeight,
- required this.vehicle,
+ required this.screenHeight
}) : super(key: key);
@override
- Widget build(BuildContext context) {
+ Widget build(BuildContext context, WidgetRef ref) {
+ final bool isLowBeam = ref.watch(vehicleStatusProvider.select((p) => p.isLowBeam));
+ final bool isHighBeam = ref.watch(vehicleStatusProvider.select((p) => p.isHighBeam));
+ final bool isHazardLightOn = ref.watch(vehicleStatusProvider.select((p) => p.isHazardLightOn));
+ final bool isParkingOn = ref.watch(vehicleStatusProvider.select((p) => p.isParkingOn));
+ final bool isBatteryCharging = ref.watch(vehicleStatusProvider.select((p) => p.isBatteryCharging));
+ final bool isMILon = ref.watch(vehicleStatusProvider.select((p) => p.isMILon));
+ final bool isSteeringLaneWarning = ref.watch(vehicleStatusProvider.select((p) => p.isSteeringLaneWarning));
+ final bool isSteeringCruiseEnable = ref.watch(vehicleStatusProvider.select((p) => p.isSteeringCruiseEnable));
+ final bool isSteeringCruiseSet = ref.watch(vehicleStatusProvider.select((p) => p.isSteeringCruiseSet));
+
return Wrap(
spacing: 14,
runAlignment: WrapAlignment.spaceBetween,
alignment: WrapAlignment.spaceEvenly,
children: [
- (vehicle.isLowBeam)
+ isLowBeam
? Image.asset("images/low-beam.png",
color: Colors.green, width: (20 * screenHeight) / 480)
- : (vehicle.isHighBeam)
+ : isHighBeam
? Image.asset("images/high-beam.png",
color: Colors.green, width: (20 * screenHeight) / 480)
: Image.asset("images/high-beam.png",
color: idleColor, width: (20 * screenHeight) / 480),
Image.asset("images/hazard.png",
- color: (vehicle.isHazardLightOn) ? Colors.red : idleColor,
+ color: isHazardLightOn ? Colors.red : idleColor,
width: (20 * screenHeight) / 480),
Image.asset("images/parking.png",
- color: (vehicle.isParkingOn) ? Colors.green : idleColor,
+ color: isParkingOn ? Colors.green : idleColor,
width: (20 * screenHeight) / 480),
Image.asset("images/battery.png",
- color: (vehicle.isBatteryCharging) ? Colors.green : Colors.red,
+ color: isBatteryCharging ? Colors.green : Colors.red,
width: (20 * screenHeight) / 480),
Image.asset("images/malfunction.png",
- color: (vehicle.isMILon) ? Colors.red : idleColor,
+ color: isMILon ? Colors.red : idleColor,
width: (20 * screenHeight) / 480),
//
Image.asset("images/openDoor.png",
- color: (vehicle.isMILon) ? Colors.white : idleColor,
+ color: isMILon ? Colors.white : idleColor,
width: (20 * screenHeight) / 480),
Image.asset("images/seatBelt.png",
- color: (vehicle.isMILon) ? Colors.white : idleColor,
+ color: isMILon ? Colors.white : idleColor,
width: (20 * screenHeight) / 480),
//
Image.asset("images/lane.png",
- color: (vehicle.isSteeringLaneWarning) ? Colors.white : idleColor,
+ color: (isSteeringLaneWarning) ? Colors.white : idleColor,
width: (25 * screenHeight) / 480),
Image.asset("images/cruise.png",
- color: (vehicle.isSteeringCruiseEnable)
- ? (vehicle.isSteeringCruiseSet)
+ color: (isSteeringCruiseEnable)
+ ? (isSteeringCruiseSet)
? Colors.green
: Colors.orange
: idleColor,
diff --git a/lib/vehicle_signal/vehicle_signal_model.dart b/lib/vehicle-signals/vehicle_status_provider.dart index 90f76e7..9518f59 100644 --- a/lib/vehicle_signal/vehicle_signal_model.dart +++ b/lib/vehicle-signals/vehicle_status_provider.dart @@ -1,7 +1,9 @@ // SPDX-License-Identifier: Apache-2.0
-class VehicleSignal {
- VehicleSignal({
+import 'package:flutter_riverpod/flutter_riverpod.dart';
+
+class VehicleStatus {
+ VehicleStatus({
required this.speed,
required this.rpm,
required this.fuelLevel,
@@ -23,7 +25,8 @@ class VehicleSignal { required this.isTrunkLocked,
required this.isTrunkOpen,
required this.isBatteryCharging,
- //steering switches
+
+ // steering switches
required this.vehicleDistanceUnit,
required this.isSteeringCruiseEnable,
required this.isSteeringCruiseSet,
@@ -31,12 +34,8 @@ class VehicleSignal { required this.isSteeringCruiseCancel,
required this.isSteeringLaneWarning,
required this.isSteeringInfo,
- // map coordinates
- required this.currLat,
- required this.currLng,
- required this.desLat,
- required this.desLng,
});
+
final double speed;
final double rpm;
final double fuelLevel;
@@ -46,7 +45,7 @@ class VehicleSignal { final bool isRightIndicator;
final String selectedGear;
final String performanceMode;
- final String ambientAirTemp;
+ final double ambientAirTemp;
final bool isLowBeam;
final bool isHighBeam;
final bool isParkingOn;
@@ -67,12 +66,7 @@ class VehicleSignal { final bool isSteeringLaneWarning;
final bool isSteeringInfo;
- final double currLat;
- final double currLng;
- final double desLat;
- final double desLng;
-
- VehicleSignal copyWith({
+ VehicleStatus copyWith({
double? speed,
double? rpm,
double? fuelLevel,
@@ -81,7 +75,7 @@ class VehicleSignal { bool? isRightIndicator,
String? selectedGear,
String? performanceMode,
- String? ambientAirTemp,
+ double? ambientAirTemp,
bool? isLowBeam,
bool? isHighBeam,
bool? isHazardLightOn,
@@ -102,13 +96,8 @@ class VehicleSignal { bool? isSteeringCruiseCancel,
bool? isSteeringLaneWarning,
bool? isSteeringInfo,
- // map coordinates
- double? currLat,
- double? currLng,
- double? desLat,
- double? desLng,
}) {
- return VehicleSignal(
+ return VehicleStatus(
speed: speed ?? (this.speed),
rpm: rpm ?? this.rpm,
fuelLevel: fuelLevel ?? this.fuelLevel,
@@ -142,11 +131,108 @@ class VehicleSignal { isSteeringLaneWarning:
isSteeringLaneWarning ?? this.isSteeringLaneWarning,
vehicleDistanceUnit: vehicleDistanceUnit ?? this.vehicleDistanceUnit,
+ );
+ }
+}
+
+final vehicleStatusProvider =
+ StateNotifierProvider<VehicleStatusNotifier, VehicleStatus>(
+ (ref) => VehicleStatusNotifier(),
+);
+
+class VehicleStatusNotifier extends StateNotifier<VehicleStatus> {
+ VehicleStatusNotifier() : super(_initialValue);
+ static final VehicleStatus _initialValue = VehicleStatus(
+ speed: 140,
+ rpm: 7000,
+ fuelLevel: 90,
+ coolantTemp: 90,
+ isLeftIndicator: false,
+ isRightIndicator: false,
+ selectedGear: "P",
+ performanceMode: "normal",
+ isHazardLightOn: false,
+ isHighBeam: true,
+ isLowBeam: false,
+ isParkingOn: true,
+ travelledDistance: 888,
+ ambientAirTemp: 25,
+ cruiseControlSpeed: 60,
+ isCruiseControlActive: false,
+ isCruiseControlError: false,
+ isMILon: false,
+ isTrunkLocked: true,
+ isTrunkOpen: false,
+ isBatteryCharging: true,
+ isSteeringCruiseEnable: false,
+ isSteeringCruiseSet: false,
+ isSteeringCruiseResume: false,
+ isSteeringCruiseCancel: false,
+ isSteeringInfo: false,
+ isSteeringLaneWarning: false,
+ vehicleDistanceUnit: 'km',
+ );
+ void update({
+ double? speed,
+ double? rpm,
+ double? fuelLevel,
+ double? coolantTemp,
+ bool? isLeftIndicator,
+ bool? isRightIndicator,
+ String? selectedGear,
+ String? performanceMode,
+ double? ambientAirTemp,
+ bool? isLowBeam,
+ bool? isHighBeam,
+ bool? isHazardLightOn,
+ bool? isMILon,
+ bool? isParkingOn,
+ bool? isTrunkOpen,
+ bool? isTrunkLocked,
+ bool? isCruiseControlActive,
+ bool? isCruiseControlError,
+ bool? isBatteryCharging,
+ double? travelledDistance,
+ double? cruiseControlSpeed,
+ //
+ String? vehicleDistanceUnit,
+ bool? isSteeringCruiseEnable,
+ bool? isSteeringCruiseSet,
+ bool? isSteeringCruiseResume,
+ bool? isSteeringCruiseCancel,
+ bool? isSteeringLaneWarning,
+ bool? isSteeringInfo,
+ }) {
+ state = state.copyWith(
+ speed: speed,
+ rpm: rpm,
+ fuelLevel: fuelLevel,
+ coolantTemp: coolantTemp,
+ isLeftIndicator: isLeftIndicator,
+ isRightIndicator: isRightIndicator,
+ selectedGear: selectedGear,
+ isLowBeam: isLowBeam,
+ isHighBeam: isHighBeam,
+ isHazardLightOn: isHazardLightOn,
+ travelledDistance: travelledDistance,
+ performanceMode: performanceMode,
+ isParkingOn: isParkingOn,
+ isTrunkOpen: isTrunkOpen,
+ isTrunkLocked: isTrunkLocked,
+ isMILon: isMILon,
+ ambientAirTemp: ambientAirTemp,
+ isCruiseControlActive: isCruiseControlActive,
+ isCruiseControlError: isCruiseControlError,
+ cruiseControlSpeed: cruiseControlSpeed,
+ isBatteryCharging: isBatteryCharging,
//
- currLat: currLat ?? this.currLat,
- currLng: currLng ?? this.currLng,
- desLat: desLat ?? this.desLat,
- desLng: desLng ?? this.desLng,
+ isSteeringCruiseEnable: isSteeringCruiseEnable,
+ isSteeringCruiseSet: isSteeringCruiseSet,
+ isSteeringCruiseResume: isSteeringCruiseResume,
+ isSteeringCruiseCancel: isSteeringCruiseCancel,
+ isSteeringInfo: isSteeringInfo,
+ isSteeringLaneWarning: isSteeringLaneWarning,
+ vehicleDistanceUnit: vehicleDistanceUnit,
);
}
}
diff --git a/lib/vehicle-signals/vss_client.dart b/lib/vehicle-signals/vss_client.dart new file mode 100644 index 0000000..e416d87 --- /dev/null +++ b/lib/vehicle-signals/vss_client.dart @@ -0,0 +1,113 @@ +// SPDX-License-Identifier: Apache-2.0 +import 'dart:io'; +import 'package:meta/meta.dart'; +import 'package:flutter/foundation.dart'; +import 'package:flutter_riverpod/flutter_riverpod.dart'; +import 'package:grpc/grpc.dart'; +import 'package:flutter_cluster_dashboard/generated/kuksa/val/v1/val.pbgrpc.dart'; +import 'package:flutter_cluster_dashboard/generated/kuksa/val/v1/types.pb.dart'; +import 'package:flutter_cluster_dashboard/config.dart'; + +abstract class VssClient { + final KuksaConfig config; + final ClientChannel channel; + final VALClient stub; + final Ref ref; + + // Extenders will likely override this + final List<String> signals = []; + + VssClient({required this.config, required this.channel, required this.stub, required this.ref}); + + // Abstract method extenders must implement + void handleSignalUpdates(EntryUpdate update); + + void run() async { + if (signals.isEmpty) + return; + + var request = SubscribeRequest(); + for (var i = 0; i < signals.length; i++) { + var entry = SubscribeEntry(); + entry.path = signals[i]; + entry.fields.add(Field.FIELD_PATH); + entry.fields.add(Field.FIELD_VALUE); + request.entries.add(entry); + } + + try { + Map<String, String> metadata = {}; + if (config.authorization.isNotEmpty) { + metadata = {'authorization': "Bearer ${config.authorization}" }; + } + var responseStream = stub.subscribe(request, options: CallOptions(metadata: metadata)); + await for (var response in responseStream) { + for (var update in response.updates) { + if (!(update.hasEntry() && update.entry.hasPath())) + continue; + handleSignalUpdates(update); + } + } + } catch (e) { + print(e); + } + } + + void setUint32(String path, int value, [bool actuator = true]) async { + var dp = Datapoint() + ..uint32 = value; + set(path, dp, actuator); + } + + void setInt32(String path, int value, [bool actuator = true]) async { + var dp = Datapoint() + ..int32 = value; + set(path, dp, actuator); + } + + void setBool(String path, bool value, [bool actuator = true]) async { + var dp = Datapoint() + ..bool_12 = value; + set(path, dp, actuator); + } + + void setString(String path, String value, [bool actuator = true]) async { + var dp = Datapoint() + ..string = value; + set(path, dp, actuator); + } + + void setFloat(String path, double value, [bool actuator = true]) async { + var dp = Datapoint() + ..float = value; + set(path, dp, actuator); + } + + void setDouble(String path, double value, [bool actuator = true]) async { + var dp = Datapoint() + ..double_18 = value; + set(path, dp, actuator); + } + + void set(String path, Datapoint dp, bool actuator) async { + var entry = DataEntry() + ..path = path; + var update = EntryUpdate(); + if (actuator) { + entry.actuatorTarget = dp; + update.fields.add(Field.FIELD_ACTUATOR_TARGET); + } else { + entry.value = dp; + update.fields.add(Field.FIELD_VALUE); + } + update.entry = entry; + var request = SetRequest(); + request.updates.add(update); + Map<String, String> metadata = {}; + if (config.authorization.isNotEmpty) { + metadata = {'authorization': "Bearer ${config.authorization}" }; + } + await stub.set(request, options: CallOptions(metadata: metadata)); + } + +} diff --git a/lib/vehicle_signal/vehicle_signal_path.dart b/lib/vehicle-signals/vss_path.dart index 6a4d5f3..78538b9 100644 --- a/lib/vehicle_signal/vehicle_signal_path.dart +++ b/lib/vehicle-signals/vss_path.dart @@ -1,60 +1,89 @@ // SPDX-License-Identifier: Apache-2.0
-class VSPath {
+class VSSPath {
static const String vehicleSpeed = "Vehicle.Speed";
+
static const String vehicleEngineRPM =
"Vehicle.Powertrain.CombustionEngine.Speed";
+
static const String vehicleFuelLevel = "Vehicle.Powertrain.FuelSystem.Level";
+
static const String vehicleCoolantTemp =
"Vehicle.Powertrain.CombustionEngine.ECT";
+
+ static const String vehicleAmbientAirTemperature =
+ "Vehicle.Exterior.AirTemperature";
+
static const String vehicleLeftIndicator =
"Vehicle.Body.Lights.DirectionIndicator.Left.IsSignaling";
+
static const String vehicleRightIndicator =
"Vehicle.Body.Lights.DirectionIndicator.Right.IsSignaling";
+
//Selected Gear output=> 0=Neutral, 1/2/..=Forward, -1/..=Reverse, 126=Park, 127=Drive
static const String vehicleSelectedGear =
"Vehicle.Powertrain.Transmission.SelectedGear";
+
static const String vehicleLowBeamOn = "Vehicle.Body.Lights.Beam.Low.IsOn";
+
static const String vehicleHighBeamOn = "Vehicle.Body.Lights.Beam.High.IsOn";
+
static const String vehicleParkingLightOn = "Vehicle.Body.Lights.Parking.IsOn";
+
static const String vehicleHazardLightOn = "Vehicle.Body.Lights.Hazard.IsSignaling";
+
static const String vehicleTravelledDistance = "Vehicle.TravelledDistance";
+
static const String vehicleTrunkLocked = "Vehicle.Body.Trunk.Rear.IsLocked";
+
static const String vehicleTrunkOpen = "Vehicle.Body.Trunk.Rear.IsOpen";
+
// \"normal\",\"sport\",\"economy\",\"snow\",\"rain\"]
static const String vehiclePerformanceMode =
"Vehicle.Powertrain.Transmission.PerformanceMode";
- static const String vehicleAmbientAirTemperature =
- "Vehicle.Exterior.AirTemperature";
+
static const String vehicleMIL = "Vehicle.OBD.Status.IsMILOn";
+
static const String vehicleCruiseControlError =
"Vehicle.ADAS.CruiseControl.IsError";
+
static const String vehicleCruiseControlSpeedSet =
"Vehicle.ADAS.CruiseControl.SpeedSet";
- static const String vehicleCruiseControlSpeedisActive =
+
+ static const String vehicleCruiseControlActive =
"Vehicle.ADAS.CruiseControl.IsActive";
+
static const String vehicleBatteryChargingStatus =
"Vehicle.Powertrain.TractionBattery.Charging.IsCharging";
static const String steeringCruiseEnable =
"Vehicle.Cabin.SteeringWheel.Switches.CruiseEnable";
+
static const String steeringCruiseSet =
"Vehicle.Cabin.SteeringWheel.Switches.CruiseSet";
+
static const String steeringCruiseResume =
"Vehicle.Cabin.SteeringWheel.Switches.CruiseResume";
+
static const String steeringCruiseCancel =
"Vehicle.Cabin.SteeringWheel.Switches.CruiseCancel";
+
static const String steeringLaneDepWarn =
"Vehicle.Cabin.SteeringWheel.Switches.LaneDepartureWarning";
+
static const String steeringInfo =
"Vehicle.Cabin.SteeringWheel.Switches.Info";
+
static const String vehicleDistanceUnit =
"Vehicle.Cabin.Infotainment.HMI.DistanceUnit";
static const String vehicleCurrLat = "Vehicle.CurrentLocation.Latitude";
- static const String vehicleCurrLng = "Vehicle.CurrentLocation.Longitude";
- static const String vehicleDesLat =
+
+ static const String vehicleCurrLon = "Vehicle.CurrentLocation.Longitude";
+
+ static const String vehicleDestLat =
"Vehicle.Cabin.Infotainment.Navigation.DestinationSet.Latitude";
- static const String vehicleDesLng =
+
+ static const String vehicleDestLon =
"Vehicle.Cabin.Infotainment.Navigation.DestinationSet.Longitude";
}
diff --git a/lib/vehicle-signals/vss_path.dart.hvac b/lib/vehicle-signals/vss_path.dart.hvac new file mode 100644 index 0000000..df90a48 --- /dev/null +++ b/lib/vehicle-signals/vss_path.dart.hvac @@ -0,0 +1,60 @@ +// SPDX-License-Identifier: Apache-2.0 + + +class VSSPath { + + static const String vehicleOutsideTemperature = + "Vehicle.AmbientAirTemperature"; + + static const String vehicleInsideTemperature = + "Vehicle.Cabin.HVAC.AmbientAirTemperature"; + + static const String vehicleIsAirConditioningActive = + "Vehicle.Cabin.HVAC.IsAirConditioningActive"; + + static const String vehicleIsFrontDefrosterActive = + "Vehicle.Cabin.HVAC.IsFrontDefrosterActive"; + + static const String vehicleIsRearDefrosterActive = + "Vehicle.Cabin.HVAC.IsRearDefrosterActive"; + + static const String vehicleIsRecirculationActive = + "Vehicle.Cabin.HVAC.IsRecirculationActive"; + + static const String vehicleFrontLeftAirDistribution = + "Vehicle.Cabin.HVAC.Station.Row1.Left.AirDistribution"; + + static const String vehicleFrontLeftFanSpeed = + "Vehicle.Cabin.HVAC.Station.Row1.Left.FanSpeed"; + + static const String vehicleFrontLeftTemp = + "Vehicle.Cabin.HVAC.Station.Row1.Left.Temperature"; + + static const String vehicleFrontRightAirDistribution = + "Vehicle.Cabin.HVAC.Station.Row1.Right.AirDistribution"; + + static const String vehicleFrontRightFanSpeed = + "Vehicle.Cabin.HVAC.Station.Row1.Right.FanSpeed"; + + static const String vehicleFrontRightTemp = + "Vehicle.Cabin.HVAC.Station.Row1.Right.Temperature"; + + static const String vehicleRearLeftAirDistribution = + "Vehicle.Cabin.HVAC.Station.Row2.Left.AirDistribution"; + + static const String vehicleRearLeftFanSpeed = + "Vehicle.Cabin.HVAC.Station.Row2.Left.FanSpeed"; + + static const String vehicleRearLeftTemp = + "Vehicle.Cabin.HVAC.Station.Row2.Left.Temperature"; + + static const String vehicleRearRightAirDistribution = + "Vehicle.Cabin.HVAC.Station.Row2.Right.AirDistribution"; + + static const String vehicleRearRightFanSpeed = + "Vehicle.Cabin.HVAC.Station.Row2.Right.FanSpeed"; + + static const String vehicleRearRightTemp = + "Vehicle.Cabin.HVAC.Station.Row2.Right.Temperature"; + +} diff --git a/lib/vehicle-signals/vss_provider.dart b/lib/vehicle-signals/vss_provider.dart new file mode 100644 index 0000000..7820a52 --- /dev/null +++ b/lib/vehicle-signals/vss_provider.dart @@ -0,0 +1,270 @@ +// SPDX-License-Identifier: Apache-2.0 +import 'dart:io'; +import 'package:meta/meta.dart'; +import 'package:flutter/foundation.dart'; +import 'package:flutter_riverpod/flutter_riverpod.dart'; +import 'package:grpc/grpc.dart'; +import 'package:flutter_cluster_dashboard/generated/kuksa/val/v1/val.pbgrpc.dart'; +import 'package:flutter_cluster_dashboard/generated/kuksa/val/v1/types.pb.dart'; +import 'package:flutter_cluster_dashboard/config.dart'; +import 'package:flutter_cluster_dashboard/vehicle-signals/vss_client.dart'; +import 'package:flutter_cluster_dashboard/vehicle-signals/vss_path.dart'; +import 'package:flutter_cluster_dashboard/vehicle-signals/vehicle_status_provider.dart'; + +class DashboardVssClient extends VssClient { + @override + final List<String> signals = [ + VSSPath.vehicleSpeed, + VSSPath.vehicleEngineRPM, + VSSPath.vehicleFuelLevel, + VSSPath.vehicleCoolantTemp, + VSSPath.vehicleAmbientAirTemperature, + VSSPath.vehicleLeftIndicator, + VSSPath.vehicleRightIndicator, + VSSPath.vehicleHazardLightOn, + VSSPath.vehicleHighBeamOn, + VSSPath.vehicleLowBeamOn, + VSSPath.vehicleSelectedGear, + VSSPath.vehiclePerformanceMode, + VSSPath.vehicleParkingLightOn, + VSSPath.vehicleTrunkLocked, + VSSPath.vehicleTrunkOpen, + VSSPath.vehicleMIL, + VSSPath.vehicleCruiseControlError, + VSSPath.vehicleCruiseControlSpeedSet, + VSSPath.vehicleCruiseControlActive, + VSSPath.vehicleBatteryChargingStatus, + VSSPath.vehicleDistanceUnit, + VSSPath.steeringCruiseEnable, + VSSPath.steeringCruiseSet, + VSSPath.steeringCruiseResume, + VSSPath.steeringCruiseCancel, + VSSPath.steeringInfo, + VSSPath.steeringLaneDepWarn + ]; + + DashboardVssClient({required super.config, required super.channel, required super.stub, required super.ref}); + + static String? numToGear(int? number) { + switch (number) { + case -1: + return 'R'; + case 0: + return 'N'; + case 126: + return 'P'; + case 127: + return 'D'; + default: + return null; + } + } + + @override + void handleSignalUpdates(EntryUpdate update) { + var vehicleStatus = ref.read(vehicleStatusProvider.notifier); + switch (update.entry.path) { + case VSSPath.vehicleSpeed: + if (update.entry.value.hasFloat()) { + vehicleStatus.update(speed: update.entry.value.float); + } + break; + case VSSPath.vehicleEngineRPM: + if (update.entry.value.hasFloat()) { + vehicleStatus.update(rpm: update.entry.value.float); + } + break; + case VSSPath.vehicleFuelLevel: + if (update.entry.value.hasUint32()) { + vehicleStatus.update(fuelLevel: update.entry.value.uint32.toDouble()); + } + break; + case VSSPath.vehicleCoolantTemp: + if (update.entry.value.hasFloat()) { + vehicleStatus.update(coolantTemp: update.entry.value.float); + } + break; + case VSSPath.vehicleAmbientAirTemperature: + if (update.entry.value.hasFloat()) { + vehicleStatus.update(ambientAirTemp: update.entry.value.float); + } + break; + case VSSPath.vehicleLeftIndicator: + if (update.entry.value.hasBool_12()) { + vehicleStatus.update(isLeftIndicator: update.entry.value.bool_12); + } + break; + case VSSPath.vehicleRightIndicator: + if (update.entry.value.hasBool_12()) { + vehicleStatus.update(isRightIndicator: update.entry.value.bool_12); + } + break; + case VSSPath.vehicleHighBeamOn: + if (update.entry.value.hasBool_12()) { + if (update.entry.value.bool_12) { + vehicleStatus.update(isHighBeam: true); + vehicleStatus.update(isLowBeam: false); + } else { + vehicleStatus.update(isHighBeam: false); + } + } + break; + case VSSPath.vehicleParkingLightOn: + if (update.entry.value.hasBool_12()) { + vehicleStatus.update(isParkingOn: update.entry.value.bool_12); + } + break; + case VSSPath.vehicleLowBeamOn: + if (update.entry.value.hasBool_12()) { + if (update.entry.value.bool_12) { + vehicleStatus.update(isHighBeam: false); + vehicleStatus.update(isLowBeam: true); + } else { + vehicleStatus.update(isLowBeam: false); + } + } + break; + case VSSPath.vehicleHazardLightOn: + if (update.entry.value.hasBool_12()) { + vehicleStatus.update(isHazardLightOn: update.entry.value.bool_12); + } + break; + case VSSPath.vehicleSelectedGear: + if (update.entry.value.hasInt32()) { + vehicleStatus.update( + selectedGear: numToGear(update.entry.value.int32)); + } + break; + case VSSPath.vehiclePerformanceMode: + if (update.entry.value.hasString()) { + vehicleStatus.update(performanceMode: update.entry.value.string); + } + break; + case VSSPath.vehicleTravelledDistance: + if (update.entry.value.hasFloat()) { + vehicleStatus.update(travelledDistance: update.entry.value.float); + } + break; + case VSSPath.vehicleTrunkLocked: + if (update.entry.value.hasBool_12()) { + vehicleStatus.update(isTrunkLocked: update.entry.value.bool_12); + } + break; + case VSSPath.vehicleTrunkOpen: + if (update.entry.value.hasBool_12()) { + vehicleStatus.update(isTrunkOpen: update.entry.value.bool_12); + } + break; + case VSSPath.vehicleMIL: + if (update.entry.value.hasBool_12()) { + vehicleStatus.update(isMILon: update.entry.value.bool_12); + } + break; + case VSSPath.vehicleCruiseControlError: + if (update.entry.value.hasBool_12()) { + vehicleStatus.update(isCruiseControlError: update.entry.value.bool_12); + } + break; + case VSSPath.vehicleCruiseControlSpeedSet: + if (update.entry.value.hasFloat()) { + vehicleStatus.update(cruiseControlSpeed: update.entry.value.float); + } + break; + case VSSPath.vehicleCruiseControlActive: + if (update.entry.value.hasBool_12()) { + vehicleStatus.update(isCruiseControlActive: update.entry.value.bool_12); + } + break; + case VSSPath.vehicleBatteryChargingStatus: + if (update.entry.value.hasBool_12()) { + vehicleStatus.update(isBatteryCharging: update.entry.value.bool_12); + } + break; + case VSSPath.vehicleDistanceUnit: + if (update.entry.value.hasString()) { + vehicleStatus.update(vehicleDistanceUnit: update.entry.value.string); + } + break; + + // Steering wheel switches + case VSSPath.steeringCruiseEnable: + if (update.entry.value.hasBool_12()) { + if (update.entry.value.bool_12) { + if (vehicleStatus.state.isSteeringCruiseEnable) { + vehicleStatus.update(isSteeringCruiseEnable: false); + vehicleStatus.update(isSteeringCruiseSet: false); + } else { + vehicleStatus.update(isSteeringCruiseEnable: true); + } + } + } + break; + case VSSPath.steeringCruiseSet: + if (update.entry.value.hasBool_12()) { + if (update.entry.value.bool_12 && + vehicleStatus.state.isSteeringCruiseEnable) { + vehicleStatus.update(isSteeringCruiseSet: true); + } + } + break; + case VSSPath.steeringCruiseResume: + if (update.entry.value.hasBool_12()) { + if (update.entry.value.bool_12 && + vehicleStatus.state.isSteeringCruiseEnable) { + vehicleStatus.update(isSteeringCruiseSet: true); + } + } + break; + case VSSPath.steeringCruiseCancel: + if (update.entry.value.hasBool_12()) { + if (update.entry.value.bool_12) { + vehicleStatus.update(isSteeringCruiseSet: false); + } + } + break; + case VSSPath.steeringInfo: + if (update.entry.value.hasBool_12()) { + if (update.entry.value.bool_12) { + vehicleStatus.update( + isSteeringInfo: !vehicleStatus.state.isSteeringInfo); + } + } + break; + case VSSPath.steeringLaneDepWarn: + if (update.entry.value.hasBool_12()) { + if (update.entry.value.bool_12) { + vehicleStatus.update( + isSteeringLaneWarning: + !(vehicleStatus.state.isSteeringLaneWarning)); + } + } + break; + + default: + print("ERROR: Unexpected path ${update.entry.path}"); + break; + } + } +} + +final vssClientProvider = Provider((ref) { + var config = ref.read(kuksaConfigProvider); + debugPrint("Using ${config.hostname}:${config.port}"); + ChannelCredentials creds; + if (config.use_tls && config.ca_certificate.isNotEmpty) { + print("Using TLS"); + if (config.tls_server_name.isNotEmpty) + creds = ChannelCredentials.secure(certificates: config.ca_certificate, authority: config.tls_server_name); + else + creds = ChannelCredentials.secure(certificates: config.ca_certificate); + } else { + creds = ChannelCredentials.insecure(); + } + final channel = ClientChannel(config.hostname, + port: config.port, + options: ChannelOptions(credentials: creds)); + + final stub = VALClient(channel); + + return DashboardVssClient(config: config, channel: channel, stub: stub, ref: ref); +}); diff --git a/lib/vehicle_signal/initial_socket_connection.dart b/lib/vehicle_signal/initial_socket_connection.dart deleted file mode 100644 index aa13016..0000000 --- a/lib/vehicle_signal/initial_socket_connection.dart +++ /dev/null @@ -1,126 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0
-
-import 'dart:io';
-import 'package:flutter/material.dart';
-import 'package:flutter_riverpod/flutter_riverpod.dart';
-import 'package:flutter_cluster_dashboard/vehicle_signal/listen_stream.dart';
-import 'package:flutter_cluster_dashboard/vehicle_signal/vehicle_signal_config.dart';
-
-class InitialScreen extends ConsumerWidget {
- InitialScreen({Key? key, required this.client}) : super(key: key);
- final HttpClient client;
- late WebSocket socket;
-
- @override
- Widget build(BuildContext context, ref) {
- final sockConnect = ref.watch(sockConnectprovider(client));
-
- return sockConnect.when(
- data: (socket) {
- this.socket = socket;
- this.socket.pingInterval = const Duration(seconds: 2);
- return OnBoardingPage(client: client, socket: this.socket);
- },
- error: (e, stk) {
- print(e);
- Future.delayed(const Duration(milliseconds: 700), (() {
- ref.refresh(sockConnectprovider(client));
- }));
- return const Scaffold(
- backgroundColor: Colors.black,
- body: NoticeWidget(
- assetImageName: "images/server_error.png",
- text1: "Server unavailable",
- text2: "Retrying...",
- ),
- );
- },
- loading: () => const Scaffold(
- backgroundColor: Colors.black,
- body: NoticeWidget(
- assetImageName: "images/server.png",
- text1: "Looking for server",
- text2: "Connecting...",
- ),
- ),
- );
- }
-}
-
-class NoticeWidget extends StatelessWidget {
- const NoticeWidget({
- Key? key,
- required this.assetImageName,
- required this.text1,
- required this.text2,
- this.loadingColor,
- }) : super(key: key);
-
- final String assetImageName;
- final String text1;
- final String text2;
- final Color? loadingColor;
-
- @override
- Widget build(BuildContext context) {
- return LoadingContainer(
- child: Flex(
- mainAxisSize: MainAxisSize.min,
- mainAxisAlignment: MainAxisAlignment.spaceAround,
- crossAxisAlignment: CrossAxisAlignment.center,
- direction: Axis.vertical,
- children: [
- Container(),
- Flexible(
- child: SizedBox(
- height: 100,
- child:
- Image(image: AssetImage(assetImageName), fit: BoxFit.fitWidth),
- ),
- ),
- Column(children: [
- Text(text1,
- style:
- const TextStyle(fontSize: 20, fontWeight: FontWeight.bold)),
- SizedBox(height: 6),
- Text(text2,
- style: const TextStyle(fontSize: 20, fontWeight: FontWeight.bold))
- ]),
- Flexible(
- child: Padding(
- padding: const EdgeInsets.fromLTRB(35, 6, 35, 20),
- child: LinearProgressIndicator(color: loadingColor ?? Colors.red),
- ),
- )
- ],
- ));
- }
-}
-
-class LoadingContainer extends StatelessWidget {
- const LoadingContainer({Key? key, required this.child}) : super(key: key);
- final Widget child;
-
- @override
- Widget build(BuildContext context) {
- return Row(children: [
- Spacer(),
- Column(children: [
- Spacer(),
- Center(
- child: Padding(
- padding: const EdgeInsets.all(8.0),
- child: Container(
- width: MediaQuery.of(context).size.width / 4,
- height: MediaQuery.of(context).size.height / 5,
- decoration: BoxDecoration(
- color: Colors.white, borderRadius: BorderRadius.circular(20)),
- child: child,
- ),
- )),
- SizedBox(height: 32)
- ]),
- Spacer(),
- ]);
- }
-}
diff --git a/lib/vehicle_signal/listen_stream.dart b/lib/vehicle_signal/listen_stream.dart deleted file mode 100644 index 0e2772d..0000000 --- a/lib/vehicle_signal/listen_stream.dart +++ /dev/null @@ -1,56 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0
-
-import 'dart:async';
-import 'dart:io';
-import 'package:flutter/material.dart';
-import 'package:flutter_riverpod/flutter_riverpod.dart';
-import 'package:flutter_cluster_dashboard/screen/home.dart';
-import 'package:flutter_cluster_dashboard/vehicle_signal/vehicle_signal_config.dart';
-import 'package:flutter_cluster_dashboard/vehicle_signal/vehicle_signal_methods.dart';
-
-class OnBoardingPage extends ConsumerStatefulWidget {
- const OnBoardingPage({Key? key, required this.client, required this.socket})
- : super(key: key);
- final WebSocket socket;
- final HttpClient client;
-
- @override
- ConsumerState<OnBoardingPage> createState() => _OnBoardingPageState();
-}
-
-class _OnBoardingPageState extends ConsumerState<OnBoardingPage> {
- late Timer _timer;
-
- @override
- void initState() {
- super.initState();
- VISS.init(widget.socket, ref);
- _timer = Timer.periodic(const Duration(seconds: 2), (timer) {
- if (widget.socket.readyState == 3) {
- ref.refresh(sockConnectprovider(widget.client));
- }
- });
- WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
- widget.socket.listen(
- (data) {
- // print(data);
- VISS.parseData(ref, data);
- },
- onError: (e, stk) {
- print(e.toString());
- ref.refresh(sockConnectprovider(widget.client));
- },
- );
- });
- }
-
- @override
- void dispose() {
- super.dispose();
- _timer.cancel();
- widget.socket.close(786887, "Connection lost with server!");
- }
-
- @override
- Widget build(BuildContext context) => const Home();
-}
diff --git a/lib/vehicle_signal/vehicle_signal_config.dart b/lib/vehicle_signal/vehicle_signal_config.dart deleted file mode 100644 index 1eca347..0000000 --- a/lib/vehicle_signal/vehicle_signal_config.dart +++ /dev/null @@ -1,33 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0
-
-import 'dart:io';
-import 'package:flutter/services.dart';
-import 'package:flutter_cluster_dashboard/cluster_config.dart';
-import 'package:flutter_riverpod/flutter_riverpod.dart';
-
-final sockConnectprovider = FutureProvider.family<WebSocket, HttpClient>(
- (ref, client) => connect(client, ref));
-
-// load certificates and set context and returns http client
-Future<HttpClient> initializeClient() async {
- ByteData dataCert = await rootBundle.load('assets/cert/Client.pem');
- ByteData dataKey = await rootBundle.load('assets/cert/Client.key');
-
- SecurityContext ctx = SecurityContext.defaultContext;
- ctx.useCertificateChainBytes(dataCert.buffer.asUint8List());
- ctx.usePrivateKeyBytes(dataKey.buffer.asUint8List());
- HttpClient client = HttpClient(context: ctx)
- ..findProxy = null
- ..badCertificateCallback = (cert, host, port) {
- return true;
- };
- return client;
-}
-
-Future<WebSocket> connect(HttpClient client, ref) async {
- final config = ref.read(clusterConfigStateprovider);
- WebSocket socket = await WebSocket.connect(
- "wss://${config.hostname}:${config.port}",
- customClient: client);
- return socket;
-}
diff --git a/lib/vehicle_signal/vehicle_signal_methods.dart b/lib/vehicle_signal/vehicle_signal_methods.dart deleted file mode 100644 index 7f3d8e0..0000000 --- a/lib/vehicle_signal/vehicle_signal_methods.dart +++ /dev/null @@ -1,325 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0
-
-import 'dart:convert';
-import 'dart:io';
-import 'package:flutter/rendering.dart';
-import 'package:flutter_cluster_dashboard/cluster_config.dart';
-import 'package:flutter_riverpod/flutter_riverpod.dart';
-import 'package:flutter_cluster_dashboard/map/networkPolyline.dart';
-import 'package:flutter_cluster_dashboard/provider.dart';
-import 'package:flutter_cluster_dashboard/vehicle_signal/vehicle_signal_path.dart';
-import 'package:flutter_cluster_dashboard/vehicle_signal/vehicle_signal_provider.dart';
-import 'package:latlong2/latlong.dart';
-
-class VISS {
- static const requestId = "flutter-cluster-app";
- static void init(WebSocket socket, WidgetRef ref) {
- authorize(socket, ref);
- subscribe(socket, ref, VSPath.vehicleSpeed);
- subscribe(socket, ref, VSPath.vehicleEngineRPM);
- subscribe(socket, ref, VSPath.vehicleLeftIndicator);
- subscribe(socket, ref, VSPath.vehicleRightIndicator);
- subscribe(socket, ref, VSPath.vehicleFuelLevel);
- subscribe(socket, ref, VSPath.vehicleCoolantTemp);
- subscribe(socket, ref, VSPath.vehicleHazardLightOn);
- subscribe(socket, ref, VSPath.vehicleHighBeamOn);
- subscribe(socket, ref, VSPath.vehicleLowBeamOn);
- subscribe(socket, ref, VSPath.vehicleSelectedGear);
- subscribe(socket, ref, VSPath.vehiclePerformanceMode);
- subscribe(socket, ref, VSPath.vehicleAmbientAirTemperature);
- subscribe(socket, ref, VSPath.vehicleParkingLightOn);
- subscribe(socket, ref, VSPath.vehicleTrunkLocked);
- subscribe(socket, ref, VSPath.vehicleTrunkOpen);
- subscribe(socket, ref, VSPath.vehicleAmbientAirTemperature);
- subscribe(socket, ref, VSPath.vehicleMIL);
- subscribe(socket, ref, VSPath.vehicleCruiseControlError);
- subscribe(socket, ref, VSPath.vehicleCruiseControlSpeedSet);
- subscribe(socket, ref, VSPath.vehicleCruiseControlSpeedisActive);
- subscribe(socket, ref, VSPath.vehicleBatteryChargingStatus);
-
- //
- subscribe(socket, ref, VSPath.steeringCruiseEnable);
- subscribe(socket, ref, VSPath.steeringCruiseSet);
- subscribe(socket, ref, VSPath.steeringCruiseResume);
- subscribe(socket, ref, VSPath.steeringCruiseCancel);
- subscribe(socket, ref, VSPath.steeringInfo);
- subscribe(socket, ref, VSPath.steeringLaneDepWarn);
- subscribe(socket, ref, VSPath.vehicleDistanceUnit);
- //
- subscribe(socket, ref, VSPath.vehicleCurrLat);
- subscribe(socket, ref, VSPath.vehicleCurrLng);
- subscribe(socket, ref, VSPath.vehicleDesLat);
- subscribe(socket, ref, VSPath.vehicleDesLng);
-
- update(socket, ref);
- }
-
- static void update(WebSocket socket, WidgetRef ref) {
- get(socket, ref, VSPath.vehicleSpeed);
- get(socket, ref, VSPath.vehicleEngineRPM);
- get(socket, ref, VSPath.vehicleLeftIndicator);
- get(socket, ref, VSPath.vehicleRightIndicator);
- get(socket, ref, VSPath.vehicleFuelLevel);
- get(socket, ref, VSPath.vehicleCoolantTemp);
- get(socket, ref, VSPath.vehicleHazardLightOn);
- get(socket, ref, VSPath.vehicleHighBeamOn);
- get(socket, ref, VSPath.vehicleLowBeamOn);
- get(socket, ref, VSPath.vehicleSelectedGear);
- get(socket, ref, VSPath.vehiclePerformanceMode);
- get(socket, ref, VSPath.vehicleAmbientAirTemperature);
- get(socket, ref, VSPath.vehicleParkingLightOn);
- get(socket, ref, VSPath.vehicleTrunkLocked);
- get(socket, ref, VSPath.vehicleTrunkOpen);
- get(socket, ref, VSPath.vehicleAmbientAirTemperature);
- get(socket, ref, VSPath.vehicleMIL);
- get(socket, ref, VSPath.vehicleCruiseControlError);
- get(socket, ref, VSPath.vehicleCruiseControlSpeedSet);
- get(socket, ref, VSPath.vehicleCruiseControlSpeedisActive);
- get(socket, ref, VSPath.vehicleBatteryChargingStatus);
- get(socket, ref, VSPath.vehicleDistanceUnit);
- //
- get(socket, ref, VSPath.vehicleCurrLat);
- get(socket, ref, VSPath.vehicleCurrLng);
- get(socket, ref, VSPath.vehicleDesLat);
- get(socket, ref, VSPath.vehicleDesLng);
- }
-
- static void authorize(WebSocket socket, WidgetRef ref) {
- final config = ref.read(clusterConfigStateprovider);
- Map<String, dynamic> map = {
- "action": "authorize",
- "tokens": config.kuksaAuthToken,
- "requestId": requestId
- };
- socket.add(jsonEncode(map));
- }
-
- static void get(WebSocket socket, WidgetRef ref, String path) {
- final config = ref.read(clusterConfigStateprovider);
- Map<String, dynamic> map = {
- "action": "get",
- "tokens": config.kuksaAuthToken,
- "path": path,
- "requestId": requestId
- };
- socket.add(jsonEncode(map));
- }
-
- static void set(WebSocket socket, WidgetRef ref, String path, String value) {
- final config = ref.read(clusterConfigStateprovider);
- Map<String, dynamic> map = {
- "action": "set",
- "tokens": config.kuksaAuthToken,
- "path": path,
- "requestId": requestId,
- "value": value
- };
- socket.add(jsonEncode(map));
- }
-
- static void subscribe(WebSocket socket, WidgetRef ref, String path) {
- final config = ref.read(clusterConfigStateprovider);
- Map<String, dynamic> map = {
- "action": "subscribe",
- "tokens": config.kuksaAuthToken,
- "path": path,
- "requestId": requestId
- };
- socket.add(jsonEncode(map));
- }
-
- static String? numToGear(int? number) {
- switch (number) {
- case -1:
- return 'R';
- case 0:
- return 'N';
- case 126:
- return 'P';
- case 127:
- return 'D';
- default:
- return null;
- }
- }
-
- static void parseData(WidgetRef ref, String data) {
- final vehicleSignal = ref.read(vehicleSignalProvider.notifier);
- final polylineDBNotifier = ref.read(polyLineStateProvider.notifier);
- Map<String, dynamic> dataMap = jsonDecode(data);
- if (dataMap["action"] == "subscription" || dataMap["action"] == "get") {
- if (dataMap.containsKey("data")) {
- if ((dataMap["data"] as Map<String, dynamic>).containsKey("dp") &&
- (dataMap["data"] as Map<String, dynamic>).containsKey("path")) {
- String path = dataMap["data"]["path"];
- Map<String, dynamic> dp = dataMap["data"]["dp"];
- if (dp.containsKey("value")) {
- if (dp["value"] != "---") {
- switch (path) {
- case VSPath.vehicleSpeed:
- vehicleSignal.update(speed: dp["value"]);
- break;
- case VSPath.vehicleEngineRPM:
- vehicleSignal.update(rpm: dp["value"].toDouble());
- break;
- case VSPath.vehicleFuelLevel:
- vehicleSignal.update(fuelLevel: dp["value"]);
- break;
- case VSPath.vehicleCoolantTemp:
- vehicleSignal.update(coolantTemp: dp["value"]);
- break;
- case VSPath.vehicleLeftIndicator:
- vehicleSignal.update(isLeftIndicator: dp["value"]);
- break;
- case VSPath.vehicleRightIndicator:
- vehicleSignal.update(isRightIndicator: dp["value"]);
- break;
- case VSPath.vehicleHighBeamOn:
- if (dp["value"]) {
- vehicleSignal.update(isHighBeam: true);
- vehicleSignal.update(isLowBeam: false);
- } else {
- vehicleSignal.update(isHighBeam: dp["value"]);
- }
- break;
- case VSPath.vehicleParkingLightOn:
- vehicleSignal.update(isParkingOn: dp["value"]);
- break;
- case VSPath.vehicleLowBeamOn:
- if (dp["value"]) {
- vehicleSignal.update(isHighBeam: false);
- vehicleSignal.update(isLowBeam: true);
- } else {
- vehicleSignal.update(isLowBeam: dp["value"]);
- }
- break;
- case VSPath.vehicleHazardLightOn:
- vehicleSignal.update(isHazardLightOn: dp["value"]);
- break;
- case VSPath.vehicleSelectedGear:
- vehicleSignal.update(
- selectedGear: numToGear(int.parse(dp["value"])));
- break;
- case VSPath.vehiclePerformanceMode:
- vehicleSignal.update(performanceMode: dp['value']);
- break;
- case VSPath.vehicleTravelledDistance:
- vehicleSignal.update(travelledDistance: dp['value']);
- break;
- case VSPath.vehicleTrunkLocked:
- vehicleSignal.update(isTrunkLocked: dp['value']);
- break;
- case VSPath.vehicleTrunkOpen:
- vehicleSignal.update(isTrunkOpen: dp['value']);
- break;
- case VSPath.vehicleAmbientAirTemperature:
- vehicleSignal.update(ambientAirTemp: dp['value']);
- break;
- case VSPath.vehicleMIL:
- vehicleSignal.update(isMILon: dp['value']);
- break;
- case VSPath.vehicleCruiseControlError:
- vehicleSignal.update(isCruiseControlError: dp['value']);
- break;
- case VSPath.vehicleCruiseControlSpeedSet:
- vehicleSignal.update(cruiseControlSpeed: dp['value']);
- break;
- case VSPath.vehicleCruiseControlSpeedisActive:
- vehicleSignal.update(isCruiseControlActive: dp['value']);
- break;
- case VSPath.vehicleBatteryChargingStatus:
- vehicleSignal.update(isBatteryCharging: dp['value']);
- break;
- //
- case VSPath.steeringCruiseEnable:
- if (dp['value']) {
- if (vehicleSignal.state.isSteeringCruiseEnable) {
- vehicleSignal.update(isSteeringCruiseEnable: false);
- vehicleSignal.update(isSteeringCruiseSet: false);
- } else {
- vehicleSignal.update(isSteeringCruiseEnable: dp['value']);
- }
- }
- break;
- case VSPath.steeringCruiseSet:
- if (dp['value'] &&
- vehicleSignal.state.isSteeringCruiseEnable) {
- vehicleSignal.update(isSteeringCruiseSet: dp['value']);
- }
- break;
- case VSPath.steeringCruiseResume:
- if (dp['value'] &&
- vehicleSignal.state.isSteeringCruiseEnable) {
- vehicleSignal.update(isSteeringCruiseSet: dp['value']);
- }
- break;
- case VSPath.steeringCruiseCancel:
- if (dp['value']) {
- vehicleSignal.update(isSteeringCruiseSet: false);
- }
- break;
- case VSPath.steeringInfo:
- if (dp['value']) {
- vehicleSignal.update(
- isSteeringInfo: !vehicleSignal.state.isSteeringInfo);
- }
- break;
- case VSPath.steeringLaneDepWarn:
- if (dp['value']) {
- vehicleSignal.update(
- isSteeringLaneWarning:
- !(vehicleSignal.state.isSteeringLaneWarning));
- }
- break;
- case VSPath.vehicleDistanceUnit:
- vehicleSignal.update(vehicleDistanceUnit: dp['value']);
- break;
- //
- case VSPath.vehicleCurrLat:
- vehicleSignal.update(currLat: dp['value']);
- break;
- case VSPath.vehicleCurrLng:
- vehicleSignal.update(currLng: dp['value']);
- break;
- case VSPath.vehicleDesLat:
- vehicleSignal.update(desLat: dp['value']);
- polylineDBNotifier.update(currPolyLineList: []);
-
- break;
- case VSPath.vehicleDesLng:
- vehicleSignal.update(desLng: dp['value']);
- polylineDBNotifier.update(currPolyLineList: []);
- break;
- default:
- print("$path Not Available yet!");
- }
- } else {
- print("ERROR:Value not available yet! Set Value of $path");
- }
- } else {
- print("ERROR:'value': Key not found!");
- }
- } else if ((!dataMap["data"] as Map<String, dynamic>)
- .containsKey("path")) {
- print("ERROR:'path':key not found !");
- } else if ((dataMap["data"] as Map<String, dynamic>)
- .containsKey("dp")) {
- print("ERROR:'dp':key not found !");
- }
- } else if (dataMap.containsKey("error")) {
- print("ERROR: ${dataMap['error']['message']}");
- }
- }
- }
-}
-
-void updatePolyline(WidgetRef ref, vehicleSignal, polyLineState) {
- getJsonData(ref, vehicleSignal.state.currLat, vehicleSignal.state.currLng,
- vehicleSignal.state.desLat, vehicleSignal.state.desLng)
- .then((polylineList) {
- polyLineState.update(
- currPolyLineList: polylineList
- .map((element) => LatLng(element[1], element[0]))
- .toList());
- });
-}
diff --git a/lib/vehicle_signal/vehicle_signal_provider.dart b/lib/vehicle_signal/vehicle_signal_provider.dart deleted file mode 100644 index e75afff..0000000 --- a/lib/vehicle_signal/vehicle_signal_provider.dart +++ /dev/null @@ -1,120 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0
-
-import 'package:flutter_riverpod/flutter_riverpod.dart';
-import 'package:flutter_cluster_dashboard/vehicle_signal/vehicle_signal_model.dart';
-
-final vehicleSignalProvider =
- StateNotifierProvider<VehicleSignalNotifier, VehicleSignal>(
- (ref) => VehicleSignalNotifier(),
-);
-
-class VehicleSignalNotifier extends StateNotifier<VehicleSignal> {
- VehicleSignalNotifier() : super(_initialValue);
- static final VehicleSignal _initialValue = VehicleSignal(
- speed: 140,
- rpm: 7000,
- fuelLevel: 90,
- coolantTemp: 90,
- isLeftIndicator: false,
- isRightIndicator: false,
- selectedGear: "P",
- performanceMode: "normal",
- isHazardLightOn: false,
- isHighBeam: true,
- isLowBeam: false,
- isParkingOn: true,
- travelledDistance: 888,
- ambientAirTemp: '25',
- cruiseControlSpeed: 60,
- isCruiseControlActive: false,
- isCruiseControlError: false,
- isMILon: false,
- isTrunkLocked: true,
- isTrunkOpen: false,
- isBatteryCharging: true,
- isSteeringCruiseEnable: false,
- isSteeringCruiseSet: false,
- isSteeringCruiseResume: false,
- isSteeringCruiseCancel: false,
- isSteeringInfo: false,
- isSteeringLaneWarning: false,
- vehicleDistanceUnit: 'km',
- currLat: 31.71,
- currLng: 76.95,
- desLat: 31.71,
- desLng: 76.95,
- );
- void update({
- double? speed,
- double? rpm,
- double? fuelLevel,
- double? coolantTemp,
- bool? isLeftIndicator,
- bool? isRightIndicator,
- String? selectedGear,
- String? performanceMode,
- String? ambientAirTemp,
- bool? isLowBeam,
- bool? isHighBeam,
- bool? isHazardLightOn,
- bool? isMILon,
- bool? isParkingOn,
- bool? isTrunkOpen,
- bool? isTrunkLocked,
- bool? isCruiseControlActive,
- bool? isCruiseControlError,
- bool? isBatteryCharging,
- double? travelledDistance,
- double? cruiseControlSpeed,
- //
- String? vehicleDistanceUnit,
- bool? isSteeringCruiseEnable,
- bool? isSteeringCruiseSet,
- bool? isSteeringCruiseResume,
- bool? isSteeringCruiseCancel,
- bool? isSteeringLaneWarning,
- bool? isSteeringInfo,
- //
- double? currLat,
- double? currLng,
- double? desLat,
- double? desLng,
- }) {
- state = state.copyWith(
- speed: speed,
- rpm: rpm,
- fuelLevel: fuelLevel,
- coolantTemp: coolantTemp,
- isLeftIndicator: isLeftIndicator,
- isRightIndicator: isRightIndicator,
- selectedGear: selectedGear,
- isLowBeam: isLowBeam,
- isHighBeam: isHighBeam,
- isHazardLightOn: isHazardLightOn,
- travelledDistance: travelledDistance,
- performanceMode: performanceMode,
- isParkingOn: isParkingOn,
- isTrunkOpen: isTrunkOpen,
- isTrunkLocked: isTrunkLocked,
- isMILon: isMILon,
- ambientAirTemp: ambientAirTemp,
- isCruiseControlActive: isCruiseControlActive,
- isCruiseControlError: isCruiseControlError,
- cruiseControlSpeed: cruiseControlSpeed,
- isBatteryCharging: isBatteryCharging,
- //
- isSteeringCruiseEnable: isSteeringCruiseEnable,
- isSteeringCruiseSet: isSteeringCruiseSet,
- isSteeringCruiseResume: isSteeringCruiseResume,
- isSteeringCruiseCancel: isSteeringCruiseCancel,
- isSteeringInfo: isSteeringInfo,
- isSteeringLaneWarning: isSteeringLaneWarning,
- vehicleDistanceUnit: vehicleDistanceUnit,
- //
- currLat: currLat,
- currLng: currLng,
- desLat: desLat,
- desLng: desLng,
- );
- }
-}
diff --git a/pubspec.yaml b/pubspec.yaml index 16ce184..60c514b 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -6,7 +6,7 @@ version: 1.0.0+1 # Dart SDK version
environment:
- sdk: ">=2.17.0 <3.0.0"
+ sdk: ">=2.18.0 <3.0.0"
dependencies:
flutter:
@@ -22,6 +22,9 @@ dependencies: http: ^0.13.5
yaml: ^3.1.1
+ grpc: ^3.0.0
+ protobuf: ^2.1.0
+
dev_dependencies:
flutter_test:
sdk: flutter
|