@@ -1316,33 +1316,38 @@ def get_frame(frame_triggering, root_or_cache, multiplex_translation, ns, float_
1316
1316
new_frame .add_attribute ("GenMsgCycleTime" , str (int (float_factory (value .text ) * 1000 )))
1317
1317
1318
1318
1319
- # pdu_sig_mappings = get_child(pdu, "SIGNAL-TO-PDU-MAPPINGS", arDict, ns)
1320
- # if not pdu_sig_mappings:
1321
- # logger.debug("Frame %s no SIGNAL-TO-PDU-MAPPINGS found", new_frame.name)
1322
- pdu_sig_mapping = get_children (pdu , "I-SIGNAL-TO-I-PDU-MAPPING" , root_or_cache , ns )
1323
- if pdu_sig_mapping :
1324
- get_signals (pdu_sig_mapping , new_frame , root_or_cache , ns , None , float_factory )
1325
-
1326
- # Seen some pdu_sig_mapping being [] and not None with some arxml 4.2
1327
- else : # AR 4.2
1328
- pdu_trigs = get_children (frame_triggering , "PDU-TRIGGERINGS" , root_or_cache , ns )
1329
- if pdu_trigs is not None :
1330
- for pdu_trig in pdu_trigs :
1331
- trig_ref_cond = get_child (pdu_trig , "PDU-TRIGGERING-REF-CONDITIONAL" , root_or_cache , ns )
1332
- trigs = get_child (trig_ref_cond , "PDU-TRIGGERING" , root_or_cache , ns )
1333
- ipdus = get_child (trigs , "I-PDU" , root_or_cache , ns )
1334
-
1335
- signal_to_pdu_maps = get_child (ipdus , "I-SIGNAL-TO-PDU-MAPPINGS" , root_or_cache , ns )
1336
- if signal_to_pdu_maps is None :
1337
- signal_to_pdu_maps = get_child (ipdus , "I-SIGNAL-TO-I-PDU-MAPPINGS" , root_or_cache , ns )
1338
-
1339
- if signal_to_pdu_maps is None :
1340
- logger .debug ("AR4.x PDU %s no SIGNAL-TO-PDU-MAPPINGS found - no signal extraction!" ,
1341
- get_element_name (ipdus , ns ))
1342
- # signal_to_pdu_map = get_children(signal_to_pdu_maps, "I-SIGNAL-TO-I-PDU-MAPPING", arDict, ns)
1343
- get_signals (signal_to_pdu_maps , new_frame , root_or_cache , ns , None , float_factory ) # todo BUG expects list, not item
1344
- else :
1345
- logger .debug ("Frame %s (assuming AR4.2) no PDU-TRIGGERINGS found" , new_frame .name )
1319
+ if pdu .tag == "CONTAINER-I-PDU" :
1320
+ pdus = get_children (pdu , "CONTAINED-PDU-TRIGGERING" , root_or_cache , ns )
1321
+ for pdu in pdus :
1322
+ ipdu = get_child (pdu , "I-PDU" , root_or_cache , ns )
1323
+ pdu_sig_mapping = get_children (ipdu , "I-SIGNAL-IN-I-PDU" , root_or_cache , ns )
1324
+ # TODO
1325
+ if pdu_sig_mapping :
1326
+ get_signals (pdu_sig_mapping , new_frame , root_or_cache , ns , None , float_factory )
1327
+ else :
1328
+ pdu_sig_mapping = get_children (pdu , "I-SIGNAL-TO-I-PDU-MAPPING" , root_or_cache , ns )
1329
+ if pdu_sig_mapping :
1330
+ get_signals (pdu_sig_mapping , new_frame , root_or_cache , ns , None , float_factory )
1331
+ # Seen some pdu_sig_mapping being [] and not None with some arxml 4.2
1332
+ else : # AR 4.2
1333
+ pdu_trigs = get_children (frame_triggering , "PDU-TRIGGERINGS" , root_or_cache , ns )
1334
+ if pdu_trigs is not None :
1335
+ for pdu_trig in pdu_trigs :
1336
+ trig_ref_cond = get_child (pdu_trig , "PDU-TRIGGERING-REF-CONDITIONAL" , root_or_cache , ns )
1337
+ trigs = get_child (trig_ref_cond , "PDU-TRIGGERING" , root_or_cache , ns )
1338
+ ipdus = get_child (trigs , "I-PDU" , root_or_cache , ns )
1339
+
1340
+ signal_to_pdu_maps = get_child (ipdus , "I-SIGNAL-TO-PDU-MAPPINGS" , root_or_cache , ns )
1341
+ if signal_to_pdu_maps is None :
1342
+ signal_to_pdu_maps = get_child (ipdus , "I-SIGNAL-TO-I-PDU-MAPPINGS" , root_or_cache , ns )
1343
+
1344
+ if signal_to_pdu_maps is None :
1345
+ logger .debug ("AR4.x PDU %s no SIGNAL-TO-PDU-MAPPINGS found - no signal extraction!" ,
1346
+ get_element_name (ipdus , ns ))
1347
+ # signal_to_pdu_map = get_children(signal_to_pdu_maps, "I-SIGNAL-TO-I-PDU-MAPPING", arDict, ns)
1348
+ get_signals (signal_to_pdu_maps , new_frame , root_or_cache , ns , None , float_factory ) # todo BUG expects list, not item
1349
+ else :
1350
+ logger .debug ("Frame %s (assuming AR4.2) no PDU-TRIGGERINGS found" , new_frame .name )
1346
1351
return new_frame
1347
1352
1348
1353
0 commit comments