From be4da312ad1f33cea62ba7c8768bb4060ee6a178 Mon Sep 17 00:00:00 2001 From: Scott Murray Date: Mon, 2 Jan 2023 15:35:50 -0500 Subject: VSS signal fixes Changes: - Update some signals for VSS 3.0 changes that were missed on the initial pass. - Improve error handling in VSS parsing to display error message from the VIS server. - Add explicit knob to disable navigation display with a default value of disabled, so that mode switches triggered by the steering wheel "Info" signal do not unexpectedly activate it. Bug-AGL: SPEC-4664 Signed-off-by: Scott Murray Change-Id: Ib5fba613053f2860a0a5ff7331c78d6ab9590848 (cherry picked from commit c605ab037edcb35a7aa365fa6abe7fd6289d8a19) --- lib/cluster_config.dart | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'lib/cluster_config.dart') diff --git a/lib/cluster_config.dart b/lib/cluster_config.dart index 10e152d..7a81360 100644 --- a/lib/cluster_config.dart +++ b/lib/cluster_config.dart @@ -23,7 +23,7 @@ class _GetConfigState extends ConsumerState { String configFilePath = '/etc/xdg/AGL/flutter-cluster-dashboard.yaml'; String orsKeyFilePath = '/etc/default/openroutekey'; - + String keyContent = ""; final configFile = File(configFilePath); @@ -34,6 +34,7 @@ class _GetConfigState extends ConsumerState { configStateProvider.update( hostname: yamlMap['hostname'], port: yamlMap['port'], + enableNavigation: yamlMap['enableNavigation'], homeLat: yamlMap['homeLat'], homeLng: yamlMap['homeLng'], orsPathParam: yamlMap['orsPathParam'], @@ -43,7 +44,8 @@ class _GetConfigState extends ConsumerState { orsKeyFile.readAsString().then((content) { keyContent = content.split(':')[1].trim(); - if (keyContent.isNotEmpty && keyContent != 'YOU_NEED_TO_SET_IT_IN_LOCAL_CONF') { + if (keyContent.isNotEmpty && + keyContent != 'YOU_NEED_TO_SET_IT_IN_LOCAL_CONF') { configStateProvider.update(orsApiKey: keyContent); } else { print("WARNING: openrouteservice API Key not found !"); @@ -84,6 +86,7 @@ class ClusterConfig { required this.hostname, required this.port, required this.kuksaAuthToken, + required this.enableNavigation, required this.orsApiKey, required this.orsPathParam, required this.homeLat, @@ -92,6 +95,7 @@ class ClusterConfig { final String hostname; final int port; final String kuksaAuthToken; + final bool enableNavigation; final double homeLat; final double homeLng; final String orsApiKey; @@ -101,6 +105,7 @@ class ClusterConfig { String? hostname, int? port, String? kuksaAuthToken, + bool? enableNavigation, double? homeLat, double? homeLng, String? orsApiKey, @@ -110,6 +115,7 @@ class 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, @@ -123,6 +129,7 @@ class ClusterConfigStateNotifier extends StateNotifier { hostname: "", port: 0, kuksaAuthToken: "", + enableNavigation: false, orsApiKey: "", orsPathParam: "", homeLat: 0, @@ -132,6 +139,7 @@ class ClusterConfigStateNotifier extends StateNotifier { String? hostname, int? port, String? kuksaAuthToken, + bool? enableNavigation, double? homeLat, double? homeLng, String? orsApiKey, @@ -141,6 +149,7 @@ class ClusterConfigStateNotifier extends StateNotifier { hostname: hostname, port: port, kuksaAuthToken: kuksaAuthToken, + enableNavigation: enableNavigation, homeLat: homeLat, homeLng: homeLng, orsApiKey: orsApiKey, -- cgit