From 315bcb2e6b43327f2575608ad8c3a4bf2628d50d Mon Sep 17 00:00:00 2001 From: Mitch <37594798+mitchdetailed@users.noreply.github.com> Date: Tue, 25 Apr 2023 20:28:45 -0500 Subject: [PATCH 1/3] Update Plotter.py --- Pipeline/Plotter.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Pipeline/Plotter.py b/Pipeline/Plotter.py index 8dfa8df..1f297bc 100644 --- a/Pipeline/Plotter.py +++ b/Pipeline/Plotter.py @@ -83,7 +83,7 @@ def plot_signals_by_arb_id(a_timer: PipelineTimer, arb_id_dict: dict, signal_dic # If you want transparent backgrounds, a different file format, etc. then change these settings accordingly. savefig(hex(arb_id.id) + "." + figure_format, - bbox_iches='tight', + bbox_inches='tight', pad_inches=0.0, dpi=figure_dpi, format=figure_format, From 6a3fc24b9472971df1894c4715a86589775d3785 Mon Sep 17 00:00:00 2001 From: Mitch <37594798+mitchdetailed@users.noreply.github.com> Date: Wed, 26 Apr 2023 19:49:51 -0500 Subject: [PATCH 2/3] Update FromCanUtilsLog.py added Try/Except conditional handling for messages with no data payload ( or erroneous lines ). --- Pipeline/FromCanUtilsLog.py | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/Pipeline/FromCanUtilsLog.py b/Pipeline/FromCanUtilsLog.py index 7141c51..ec55274 100644 --- a/Pipeline/FromCanUtilsLog.py +++ b/Pipeline/FromCanUtilsLog.py @@ -10,20 +10,23 @@ def canUtilsToTSV(filename): line = file.readline() if not line: return outFileName - tokens = linePattern.search(line).groups() + try: + tokens = linePattern.search(line).groups() - # write delta time - writeLine = tokens[0] + # write delta time + writeLine = tokens[0] - # write arb id - writeLine += '\t' + tokens[1] + # write arb id + writeLine += '\t' + tokens[1] - # write dlc - bytes = int(len(tokens[2]) / 2) - writeLine += '\t' + str(bytes) + # write dlc + bytes = int(len(tokens[2]) / 2) + writeLine += '\t' + str(bytes) - # write bytes - for b in range(bytes): - writeLine += '\t' + tokens[2][b*2:b*2+2] + # write bytes + for b in range(bytes): + writeLine += '\t' + tokens[2][b*2:b*2+2] - outFile.write(writeLine + '\n') + outFile.write(writeLine + '\n') + except: + pass From 6fefee71474aebd0bf87de02adab84a8b7391510 Mon Sep 17 00:00:00 2001 From: Mitch <37594798+mitchdetailed@users.noreply.github.com> Date: Sat, 27 Apr 2024 17:40:23 -0500 Subject: [PATCH 3/3] Update FromCanUtilsLog.py try : except handling of can utils message --- Pipeline/FromCanUtilsLog.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Pipeline/FromCanUtilsLog.py b/Pipeline/FromCanUtilsLog.py index ec55274..5d3a245 100644 --- a/Pipeline/FromCanUtilsLog.py +++ b/Pipeline/FromCanUtilsLog.py @@ -4,8 +4,10 @@ def canUtilsToTSV(filename): outFileName = filename + ".tsv" with open(outFileName, "w") as outFile: with open(filename, "r") as file: - linePattern = re.compile(r"\((\d+.\d+)\)\s+[^\s]+\s+([0-9A-F#]{3}|[0-9A-F#]{8})#([0-9A-F]+)") - + try: + linePattern = re.compile(r"\((\d+.\d+)\)\s+[^\s]+\s+([0-9A-F#]{3}|[0-9A-F#]{8})#([0-9A-F]+)") + except: + pass while True: line = file.readline() if not line: