From c88c92a415bac3c0db7b367cf83909321b2f5d8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eduard=20Br=C3=B6cker?= Date: Thu, 27 Jun 2024 14:54:51 +0200 Subject: [PATCH] possible quick fix for issue #781 --- src/canmatrix/formats/dbc.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/canmatrix/formats/dbc.py b/src/canmatrix/formats/dbc.py index ffe3ffa9..6c4e3c5e 100644 --- a/src/canmatrix/formats/dbc.py +++ b/src/canmatrix/formats/dbc.py @@ -237,6 +237,9 @@ def dump(in_db, f, **options): for signal in frame.signals: if signal.cycle_time != 0: signal.add_attribute("GenSigCycleTime", signal.cycle_time) + if signal.initial_value != 0 and "GenSigStartValue" not in db.signal_defines: + db.add_signal_defines("GenSigStartValue", 'FLOAT 0 100000000000') + if "GenSigStartValue" in db.signal_defines: signal.add_attribute("GenSigStartValue", signal.phys2raw(None))