aboutsummaryrefslogtreecommitdiffstats
path: root/extras/config.py
diff options
context:
space:
mode:
authorSuchinton Chakravarty <suchinton.2001@gmail.com>2024-10-10 18:16:07 +0530
committerSuchinton Chakravarty <suchinton.2001@gmail.com>2024-10-14 15:03:20 +0530
commit2e2dd79e41b27a1d50be3c118955cdbd76e65539 (patch)
tree1650d28a3dd3de761303a8c4013e4415bdcabf03 /extras/config.py
parent554ec4cd07d68f4bcb569277881e368c450d993a (diff)
Add Tire Pressure, Keypad elements and misc. UI Changes
- Increased slider grab handle size - Add floating menu for Tire Pressure UI - Show errow in Playback toggle when CAN interface is not available - Update Half gauges to show Unit and logo correctly - Update App resources - Add new tumbler input for HVAC temp - Add new get function to KuksaClient to get Tire Pressure unit and Current value to increment Fixes: - Check for vcar dbc file at '/etc/kuksa-dbc-feeder/' - Increase font size in Settings page - Allow for tumbler/ spin wheel values to wrap around Bug-AGL: SPEC-5161 Change-Id: I2386bf7dc762b09b83cef1be104a35d6afc0a704 Signed-off-by: Suchinton Chakravarty <suchinton.2001@gmail.com>
Diffstat (limited to 'extras/config.py')
-rw-r--r--extras/config.py15
1 files changed, 14 insertions, 1 deletions
diff --git a/extras/config.py b/extras/config.py
index 7540e61..8df3497 100644
--- a/extras/config.py
+++ b/extras/config.py
@@ -67,6 +67,12 @@ PLAYBACK_FILE_PATHS = check_paths(
os.path.abspath(os.path.join(os.path.dirname(__file__), "../assets/can_messages.txt"))
)
+DBC_FILE_PATHS = check_paths(
+ config.get('default', 'dbc-file-path', fallback=None),
+ "/etc/kuksa-dbc-feeder/agl-vcar.dbc",
+ os.path.abspath(os.path.join(os.path.dirname(__file__), "../Scripts/agl-vcar.dbc"))
+)
+
CA_PATH = next((path for path, exists in CA_PATHS.items() if exists), None)
WS_TOKEN = next((path for path, exists in WS_TOKEN_PATHS.items() if exists), None)
GRPC_TOKEN = next((path for path, exists in GRPC_TOKEN_PATHS.items() if exists), None)
@@ -177,7 +183,14 @@ def get_playback_file():
config.write(configfile)
return os.path.join(os.path.dirname(__file__), "can_messages.txt")
-
+
+# Function to get the dbc file path from config.ini
+def get_dbc_file():
+ if DBC_FILE_PATHS:
+ return DBC_FILE_PATHS
+ else:
+ raise ValueError("DBC file path not found")
+
# Function to get the can interface name from config.ini
def get_can_interface():
print(config.get('default', 'can-interface', fallback=None))