diff options
author | Suchinton Chakravarty <suchinton.2001@gmail.com> | 2024-10-10 18:16:07 +0530 |
---|---|---|
committer | Suchinton Chakravarty <suchinton.2001@gmail.com> | 2024-10-14 15:03:20 +0530 |
commit | 2e2dd79e41b27a1d50be3c118955cdbd76e65539 (patch) | |
tree | 1650d28a3dd3de761303a8c4013e4415bdcabf03 /extras | |
parent | 554ec4cd07d68f4bcb569277881e368c450d993a (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')
-rw-r--r-- | extras/KuksaClient.py | 33 | ||||
-rw-r--r-- | extras/config.ini | 7 | ||||
-rw-r--r-- | extras/config.py | 15 |
3 files changed, 50 insertions, 5 deletions
diff --git a/extras/KuksaClient.py b/extras/KuksaClient.py index 772fd50..dbffd93 100644 --- a/extras/KuksaClient.py +++ b/extras/KuksaClient.py @@ -119,7 +119,7 @@ class KuksaClient(QThread): """ if self.client is None: - #logging.error("Kuksa client is None, try reconnecting") + logging.error("Kuksa client is None, try reconnecting") return if not self.client.checkConnection(): @@ -133,3 +133,34 @@ class KuksaClient(QThread): except Exception as e: logging.error(f"Error sending values to kuksa {e}") threading.Thread(target=self.set_instance).start() + + def get(self, path=None): + """ + Gets VSS value. + + Parameters: + ----------- + path : str + The VSS signal path. + + Returns: + -------- + Any + The value of the VSS signal. + """ + + if self.client is None: + logging.error("Kuksa client is None, try reconnecting") + return + + if not self.client.checkConnection(): + logging.error("Client is not connected, try reconnecting") + threading.Thread(target=self.set_instance).start() + return + + try: + return self.client.getValue(path) + except Exception as e: + logging.error(f"Error getting value from kuksa {e}") + threading.Thread(target=self.set_instance).start() + return None diff --git a/extras/config.ini b/extras/config.ini index 9d443da..409de83 100644 --- a/extras/config.ini +++ b/extras/config.ini @@ -1,10 +1,11 @@ [default] -fullscreen-mode = false +fullscreen-mode = true hvac-enabled = true steering-wheel-enabled = true file-playback-enabled = true -file-playback-path = -can-interface = +file-playback-path = +dbc-file-path = +can-interface = [vss-server] ip = localhost 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)) |