Skip to content

Commit 618a8da

Browse files
authored
Iss522 (#530)
* arxml: add reciever information from signals to frames (issue #522)
1 parent ce34efa commit 618a8da

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

src/canmatrix/formats/arxml.py

+11-7
Original file line numberDiff line numberDiff line change
@@ -1732,6 +1732,7 @@ def decode_ethernet_helper(ea, float_factory):
17321732
pdu_sig_mapping = ea.findall("I-SIGNAL-TO-I-PDU-MAPPING", ipdu)
17331733

17341734
get_signals(pdu_sig_mapping, target_frame, ea, None, float_factory)
1735+
target_frame.update_receiver()
17351736
db.add_frame(target_frame)
17361737
return found_matrixes
17371738

@@ -1750,14 +1751,14 @@ def decode_flexray_helper(ea, float_factory):
17501751
found_matrixes[channel_name] = db
17511752

17521753
frames = ea.findall("FLEXRAY-FRAME-TRIGGERING", pc)
1753-
for frame in frames:
1754+
for frame_element in frames:
17541755
frame_counter += 1
1755-
slot_id = int(ea.get_child(frame, "SLOT-ID").text)
1756-
base_cycle = ea.get_child(frame, "BASE-CYCLE").text
1757-
ipdu_triggerings = ea.get_children(frame, "I-PDU-TRIGGERING")
1758-
frame_repetition_cycle = ea.find_children_by_path(frame, "CYCLE-REPETITION/CYCLE-REPETITION")[0].text
1759-
network_endpoints = pc.findall('.//' + ns + "NETWORK-ENDPOINT")
1760-
frame_size = int(ea.find_children_by_path(frame, "FRAME/FRAME-LENGTH")[0].text)
1756+
slot_id = int(ea.get_child(frame_element, "SLOT-ID").text)
1757+
base_cycle = ea.get_child(frame_element, "BASE-CYCLE").text
1758+
ipdu_triggerings = ea.get_children(frame_element, "I-PDU-TRIGGERING")
1759+
frame_repetition_cycle = ea.find_children_by_path(frame_element, "CYCLE-REPETITION/CYCLE-REPETITION")[0].text
1760+
network_endpoints = pc.findall('.//' + ea.ns + "NETWORK-ENDPOINT")
1761+
frame_size = int(ea.find_children_by_path(frame_element, "FRAME/FRAME-LENGTH")[0].text)
17611762
frame = canmatrix.Frame(size = frame_size, arbitration_id = frame_counter)
17621763
frame.slot_id = slot_id
17631764
frame.base_cycle = base_cycle
@@ -1888,7 +1889,10 @@ def decode_can_helper(ea, float_factory, ignore_cluster_info):
18881889
sig_value_hash[sig.name] = 0
18891890
frame_data = frame.encode(sig_value_hash)
18901891
frame.add_attribute("GenMsgStartValue", "".join(["%02x" % x for x in frame_data]))
1892+
frame.update_receiver()
18911893
found_matrixes[bus_name] = db
1894+
1895+
18921896
return found_matrixes
18931897

18941898
def load(file, **options):

0 commit comments

Comments
 (0)