Skip to content

Commit 5e99480

Browse files
committed
fix for #484
buggy ARXMLs with no System-Signals referenced
1 parent f7e75ca commit 5e99480

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/canmatrix/formats/arxml.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -1041,7 +1041,7 @@ def get_signals(signal_array, frame, ea, multiplex_id, float_factory, bit_offset
10411041
if system_signal is None:
10421042
logger.debug('Frame %s, signal %s has no system-signal', frame.name, isignal.tag)
10431043

1044-
if "SYSTEM-SIGNAL-GROUP" in system_signal.tag:
1044+
if system_signal is not None and "SYSTEM-SIGNAL-GROUP" in system_signal.tag:
10451045
system_signals = ea.find_children_by_path(system_signal, "SYSTEM-SIGNAL-REFS/SYSTEM-SIGNAL")
10461046
get_sys_signals(system_signal, system_signals, frame, group_id, ns)
10471047
group_id = group_id + 1
@@ -1168,6 +1168,7 @@ def get_signals(signal_array, frame, ea, multiplex_id, float_factory, bit_offset
11681168

11691169
if name is None:
11701170
logger.debug('no name for signal given')
1171+
name = ea.get_child(isignal, "SHORT-NAME")
11711172
if start_bit is None:
11721173
logger.debug('no startBit for signal given')
11731174
if length is None:
@@ -1255,8 +1256,7 @@ def get_frame_from_multiplexed_ipdu(pdu, target_frame, multiplex_translation, ea
12551256
ipdu = ea.get_child(alternative, "I-PDU")
12561257
multiplex_translation[ea.get_element_name(ipdu)] = ea.get_element_name(pdu)
12571258
if ipdu is not None:
1258-
pdu_sig_mappings = ea.get_child(ipdu, "SIGNAL-TO-PDU-MAPPINGS")
1259-
pdu_sig_mapping = ea.get_children(pdu_sig_mappings, "I-SIGNAL-TO-I-PDU-MAPPING")
1259+
pdu_sig_mapping = ea.get_children(ipdu, "I-SIGNAL-TO-I-PDU-MAPPING")
12601260
get_signals(pdu_sig_mapping, target_frame, ea, selector_id.text, float_factory)
12611261

12621262

0 commit comments

Comments
 (0)