summaryrefslogtreecommitdiffstats
path: root/lib/cluster_config.dart
diff options
context:
space:
mode:
authorScott Murray <scott.murray@konsulko.com>2023-01-02 15:35:50 -0500
committerScott Murray <scott.murray@konsulko.com>2023-01-02 15:41:53 -0500
commitc605ab037edcb35a7aa365fa6abe7fd6289d8a19 (patch)
treefd9ec01408646706827e3b369695e53bbd105279 /lib/cluster_config.dart
parentaa3ebcabd92b63be6b9cfe0bc3f877b9f124c1d2 (diff)
VSS signal fixesneedlefish
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 <scott.murray@konsulko.com> Change-Id: Ib5fba613053f2860a0a5ff7331c78d6ab9590848
Diffstat (limited to 'lib/cluster_config.dart')
-rw-r--r--lib/cluster_config.dart13
1 files changed, 11 insertions, 2 deletions
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<GetConfig> {
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<GetConfig> {
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<GetConfig> {
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<ClusterConfig> {
hostname: "",
port: 0,
kuksaAuthToken: "",
+ enableNavigation: false,
orsApiKey: "",
orsPathParam: "",
homeLat: 0,
@@ -132,6 +139,7 @@ class ClusterConfigStateNotifier extends StateNotifier<ClusterConfig> {
String? hostname,
int? port,
String? kuksaAuthToken,
+ bool? enableNavigation,
double? homeLat,
double? homeLng,
String? orsApiKey,
@@ -141,6 +149,7 @@ class ClusterConfigStateNotifier extends StateNotifier<ClusterConfig> {
hostname: hostname,
port: port,
kuksaAuthToken: kuksaAuthToken,
+ enableNavigation: enableNavigation,
homeLat: homeLat,
homeLng: homeLng,
orsApiKey: orsApiKey,