@@ -895,7 +895,7 @@ def get_element_name(parent, ns):
895
895
def get_sys_signals (sys_signal , sys_signal_array , frame , group_id , ns ):
896
896
# type: (_Element, typing.Sequence[_Element], canmatrix.Frame, int, str) -> None
897
897
members = [get_element_name (signal , ns ) for signal in sys_signal_array ]
898
- frame .add_signal_group (get_element_name (sys_signal , ns ), 1 , members ) # todo use group_id instead of 1?
898
+ frame .add_signal_group (get_element_name (sys_signal , ns ), group_id , members ) # todo use group_id instead of 1?
899
899
900
900
901
901
def decode_compu_method (compu_method , root_or_cache , ns , float_factory ):
@@ -1625,6 +1625,8 @@ def decode_ethernet_helper(root, root_or_cache, ns, float_factory):
1625
1625
def decode_flexray_helper (root , root_or_cache , ns , float_factory ):
1626
1626
found_matrixes = {}
1627
1627
fcs = root .findall ('.//' + ns + 'FLEXRAY-CLUSTER' )
1628
+ frame_counter = 0
1629
+
1628
1630
for fc in fcs :
1629
1631
physical_channels = fc .findall ('.//' + ns + "FLEXRAY-PHYSICAL-CHANNEL" )
1630
1632
for pc in physical_channels :
@@ -1635,22 +1637,26 @@ def decode_flexray_helper(root, root_or_cache, ns, float_factory):
1635
1637
1636
1638
frames = pc .findall ('.//' + ns + "FLEXRAY-FRAME-TRIGGERING" )
1637
1639
for frame in frames :
1638
- slotId = int (get_child (frame , "SLOT-ID" , root_or_cache , ns ).text )
1639
-
1640
+ slot_id = int (get_child (frame , "SLOT-ID" , root_or_cache , ns ).text )
1641
+ base_cycle = get_child ( frame , "BASE-CYCLE" , root_or_cache , ns )
1640
1642
ipdu_triggerings = get_children (frame , "I-PDU-TRIGGERING" , root_or_cache , ns )
1641
- #pc.findall('.//' + ns + "I-PDU-TRIGGERING")
1642
-
1643
- #network_endpoints = pc.findall('.//' + ns + "NETWORK-ENDPOINT" )
1643
+ frame_repetition_cycle = find_children_by_path ( frame , "CYCLE-REPETITION/CYCLE-REPETITION" , root_or_cache , ns )[ 0 ]
1644
+ network_endpoints = pc . findall ( './/' + ns + "NETWORK-ENDPOINT" )
1645
+ frame_size = int ( find_children_by_path ( frame , "FRAME/FRAME-LENGTH" , root_or_cache , ns )[ 0 ]. text )
1644
1646
for ipdu_triggering in ipdu_triggerings :
1647
+ ipdu_triggering_name = get_element_name (ipdu_triggering , ns )
1645
1648
ipdu = get_child (ipdu_triggering , "I-PDU" , root_or_cache , ns )
1649
+ pdu_type = get_child (ipdu_triggering , "I-PDU-REF" , root_or_cache , ns ).attrib ["DEST" ]
1650
+ ipdu_length = int (get_child (ipdu , "LENGTH" , root_or_cache , ns ).text )
1651
+ pdu_port_type = get_child (ipdu_triggering , "I-PDU-PORT-REF" , root_or_cache , ns ).attrib ["DEST" ]
1646
1652
ipdu_name = get_element_name (ipdu , ns )
1647
- target_frame = canmatrix .Frame (name = ipdu_name , arbitration_id = slotId )
1653
+ frame_counter += 1 ;
1654
+ target_frame = canmatrix .Frame (name = ipdu_name , arbitration_id = frame_counter , size = ipdu_length )
1648
1655
pdu_sig_mapping = get_children (ipdu , "I-SIGNAL-TO-I-PDU-MAPPING" , root_or_cache , ns )
1649
1656
get_signals (pdu_sig_mapping , target_frame , root_or_cache , ns , None , float_factory )
1650
1657
db .add_frame (target_frame )
1651
1658
return found_matrixes
1652
1659
1653
-
1654
1660
def decode_can_helper (root , root_or_cache , ns , float_factory , ignore_cluster_info ):
1655
1661
found_matrixes = {}
1656
1662
if ignore_cluster_info is True :
0 commit comments