@@ -761,7 +761,7 @@ def add_frame_by_id(frame): # type: (canmatrix.Frame) -> None
761
761
substring = decoded [7 :].strip ()
762
762
define_type = substring [:3 ]
763
763
substring = substring [3 :].strip ()
764
- pattern = r"^\"([A-Za-z0-9\-_\ ] +)\" +(.+);"
764
+ pattern = r"^\"(. +)\" +(.+);"
765
765
regexp = re .compile (pattern )
766
766
regexp_raw = re .compile (pattern .encode (dbcImportEncoding ))
767
767
temp = regexp .match (substring )
@@ -778,7 +778,7 @@ def add_frame_by_id(frame): # type: (canmatrix.Frame) -> None
778
778
db .add_env_defines (temp .group (1 ), temp_raw .group (2 ).decode (dbcImportEncoding ))
779
779
780
780
elif decoded .startswith ("BA_DEF_ " ):
781
- pattern = r"^BA_DEF_ +\"([A-Za-z0-9\-_] +)\" +(.+);"
781
+ pattern = r"^BA_DEF_ +\"(. +)\" +(.+);"
782
782
regexp = re .compile (pattern )
783
783
regexp_raw = re .compile (pattern .encode (dbcImportEncoding ))
784
784
temp = regexp .match (decoded )
@@ -792,7 +792,7 @@ def add_frame_by_id(frame): # type: (canmatrix.Frame) -> None
792
792
tempba = regexp .match (decoded )
793
793
794
794
if tempba .group (1 ).strip ().startswith ("BO_ " ):
795
- regexp = re .compile (r"^BA_ +\"(.*)\" +BO_ +(\w +) +(.+);" )
795
+ regexp = re .compile (r"^BA_ +\"(.*)\" +BO_ +(. +) +(.+);" )
796
796
temp = regexp .match (decoded )
797
797
get_frame_by_id (canmatrix .ArbitrationId .from_compound_integer (int (temp .group (2 )))).add_attribute (
798
798
temp .group (1 ), temp .group (3 ))
@@ -816,7 +816,7 @@ def add_frame_by_id(frame): # type: (canmatrix.Frame) -> None
816
816
temp .group (3 ))
817
817
else :
818
818
regexp = re .compile (
819
- r"^BA_ +\"([A-Za-z0-9\-_]+)\" +([\"A-Za-z0-9\-_ \.]+);" )
819
+ r"^BA_ +\"([A-Za-z0-9\-_]+)\" +([\"\w\- \.]+);" )
820
820
temp = regexp .match (decoded )
821
821
if temp :
822
822
db .add_attribute (temp .group (1 ), temp .group (2 ))
@@ -839,7 +839,7 @@ def add_frame_by_id(frame): # type: (canmatrix.Frame) -> None
839
839
# SIG_VALTYPE_ 0 float : 1;
840
840
841
841
elif decoded .startswith ("BA_DEF_DEF_ " ):
842
- pattern = r"^BA_DEF_DEF_ +\"([A-Za-z0-9\-_ \.]+)\" +(.+)\;"
842
+ pattern = r"^BA_DEF_DEF_ +\"([\w\- \.]+)\" +(.+)\;"
843
843
regexp = re .compile (pattern )
844
844
regexp_raw = re .compile (pattern .encode (dbcImportEncoding ))
845
845
temp = regexp .match (decoded )
@@ -848,7 +848,7 @@ def add_frame_by_id(frame): # type: (canmatrix.Frame) -> None
848
848
db .add_define_default (temp .group (1 ),
849
849
temp_raw .group (2 ).decode (dbcImportEncoding ))
850
850
elif decoded .startswith ("SG_MUL_VAL_ " ):
851
- pattern = r"^SG_MUL_VAL_ +([0-9]+) +([A-Za-z0-9\-_ ]+) +([A-Za-z0-9\-_ ]+) +([0-9]+)\-([0-9]+) *;"
851
+ pattern = r"^SG_MUL_VAL_ +([0-9]+) +([\w\- ]+) +([\w\- ]+) +([0-9]+)\-([0-9]+) *;"
852
852
regexp = re .compile (pattern )
853
853
regexp_raw = re .compile (pattern .encode (dbcImportEncoding ))
854
854
temp = regexp .match (decoded )
@@ -867,7 +867,7 @@ def add_frame_by_id(frame): # type: (canmatrix.Frame) -> None
867
867
signal .mux_val_min = muxValMin
868
868
signal .mux_val_max = muxValMax
869
869
elif decoded .startswith ("EV_ " ):
870
- pattern = r"^EV_ +([A-Za-z0-9\-_ ]+) *\: +([0-9]+) +\[([0-9.+\-eE]+)\|([0-9.+\-eE]+)\] +\"(\w*)\" +([0-9.+\-eE]+) +([0-9.+\-eE]+) +([A-Za-z0-9\-_ ]+) +(.*);"
870
+ pattern = r"^EV_ +([\w\- ]+) *\: +([0-9]+) +\[([0-9.+\-eE]+)\|([0-9.+\-eE]+)\] +\"(\w*)\" +([0-9.+\-eE]+) +([0-9.+\-eE]+) +([\w\- ]+) +(.*);"
871
871
regexp = re .compile (pattern )
872
872
temp = regexp .match (decoded )
873
873
0 commit comments