aboutsummaryrefslogtreecommitdiffstats
path: root/Scripts
diff options
context:
space:
mode:
authorSuchinton Chakravarty <suchinton.2001@gmail.com>2024-10-30 16:13:15 +0530
committerSuchinton Chakravarty <suchinton.2001@gmail.com>2024-10-30 19:39:08 +0530
commitbaee04c181eb9043606797da2f223a1fafed1ae1 (patch)
treeffabbfd86e8212a878f9ae77baa0696419da88e3 /Scripts
parent18fdc7e1bcf160f8e9bbad406f1556c3d1911734 (diff)
- Fixed Stutter while setting values using slider (when databroker is connected), Caused due to the values being sent at every step on main thread. - Improved error handeling if playback file is empty/ not found - Fixed Tire pressure values not being sent when connected to databroker - Selected tire pressure value and unit is updated on LCD display as selected Bug-AGL: SPEC-5161 Change-Id: I66ed5f2e36bd0b0a84743e2c2a8af0de955cf4ba Signed-off-by: Suchinton Chakravarty <suchinton.2001@gmail.com>
Diffstat (limited to 'Scripts')
-rw-r--r--Scripts/record_playback.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/Scripts/record_playback.py b/Scripts/record_playback.py
index 4d067f1..0eb8e70 100644
--- a/Scripts/record_playback.py
+++ b/Scripts/record_playback.py
@@ -10,6 +10,7 @@ import argparse
from PyQt6.QtCore import QThread, pyqtSignal
import cantools
import sys
+import logging
current_dir = os.path.dirname(os.path.abspath(__file__))
sys.path.append(os.path.dirname(current_dir))
@@ -28,7 +29,7 @@ class CAN_playback(QThread):
try:
playbackFile = config.get_playback_file()
except Exception as e:
- print(e)
+ logging.error("Error loading playback file:", e)
# playbackFile = os.path.join(current_dir, "can_messages.txt")
def __init__(self, interface='vcan0'):
@@ -104,7 +105,11 @@ class CAN_playback(QThread):
def replay_messages(self, messages):
"""Replay CAN messages."""
# self._running = True
- start_time = messages[0].timestamp
+ try:
+ start_time = messages[0].timestamp
+ except IndexError:
+ logging.error("No messages to replay from file:", self.output_file)
+ self.reset()
for msg in messages:
if not self._running: # Check if playback should stop
@@ -161,7 +166,6 @@ class CAN_playback(QThread):
if decoded_data['PT_LeftTurnOn'] == 1:
self.indicatorUpdate.emit('LeftBlinkerOn')
- print("Left Blinker On")
if decoded_data['PT_LeftTurnOn'] == 0:
self.indicatorUpdate.emit('LeftBlinkerOff')