File tree 2 files changed +11
-2
lines changed
2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -545,7 +545,7 @@ def add_frame_by_id(new_frame): # type: (canmatrix.Frame) -> None
545
545
db .frames .append (frame )
546
546
add_frame_by_id (frame )
547
547
elif decoded .startswith ("SG_ " ):
548
- pattern = r"^SG_ +(\w+) *: *(\d+)\|(\d+)@(\d+)([\+|\-]) + \(([0-9.+\-eE]+), *([0-9.+\-eE]+)\) + \[([0-9.+\-eE]+)\|([0-9.+\-eE]+)\] +\"(.*)\" +(.*)"
548
+ pattern = r"^SG_ +(\w+) *: *(\d+)\|(\d+)@(\d+)([\+|\-]) * \(([0-9.+\-eE]+), *([0-9.+\-eE]+)\) * \[([0-9.+\-eE]+)\|([0-9.+\-eE]+)\] +\"(.*)\" +(.*)"
549
549
regexp = re .compile (pattern )
550
550
temp = regexp .match (decoded )
551
551
regexp_raw = re .compile (pattern .encode (dbc_import_encoding ))
@@ -577,7 +577,7 @@ def add_frame_by_id(new_frame): # type: (canmatrix.Frame) -> None
577
577
frame .add_signal (temp_signal )
578
578
# db.frames.addSignalToLastFrame(tempSig)
579
579
else :
580
- pattern = r"^SG_ +(.+?) +(.+?) *: *(\d+)\|(\d+)@(\d+)([\+|\-]) + \(([0-9.+\-eE]+),([0-9.+\-eE]+)\) + \[([0-9.+\-eE]+)\|([0-9.+\-eE]+)\] +\"(.*)\" +(.*)"
580
+ pattern = r"^SG_ +(.+?) +(.+?) *: *(\d+)\|(\d+)@(\d+)([\+|\-]) * \(([0-9.+\-eE]+),([0-9.+\-eE]+)\) * \[([0-9.+\-eE]+)\|([0-9.+\-eE]+)\] +\"(.*)\" +(.*)"
581
581
regexp = re .compile (pattern )
582
582
regexp_raw = re .compile (pattern .encode (dbc_import_encoding ))
583
583
temp = regexp .match (decoded )
Original file line number Diff line number Diff line change @@ -429,3 +429,12 @@ def test_signal_inital_value():
429
429
outdbc = io .BytesIO ()
430
430
canmatrix .formats .dump (matrix , outdbc , "dbc" )
431
431
assert 'BA_ "GenSigStartValue" SG_ 17 sig1 2.7;' in outdbc .getvalue ().decode ('utf8' )
432
+
433
+ def test_missing_space ():
434
+ dbc = io .BytesIO (textwrap .dedent (u'''\
435
+ BO_ 17 Frame_1: 8 Vector__XXX
436
+ SG_ sig1 : 0|8@1-(1,0)[0|0] "" Vector__XXX
437
+ ''' ).encode ('utf-8' ))
438
+ matrix = canmatrix .formats .dbc .load (dbc , dbcImportEncoding = "utf8" )
439
+ assert matrix .frames [0 ].signals [0 ].name == "sig1"
440
+
You can’t perform that action at this time.
0 commit comments