@@ -368,7 +368,7 @@ def load(file, **options):
368
368
369
369
ecu_start = ecu_end = 0
370
370
371
- column_heads = [sheet .cell (1 ,a ).value for a in range (1 , sheet .max_column )]
371
+ column_heads = [sheet .cell (1 ,a ).value for a in range (1 , sheet .max_column + 1 )]
372
372
373
373
if 'Byteorder' in column_heads :
374
374
ecu_start = column_heads .index ('Byteorder' ) + 1
@@ -407,6 +407,7 @@ def get_if_possible(my_row, my_value, default=None):
407
407
cycle_time = get_if_possible (row , 'Cycle Time [ms]' , '0' )
408
408
launch_type = get_if_possible (row , 'Launch Type' )
409
409
dlc = 8
410
+
410
411
# launch_param = get_if_possible(row, 'Launch Parameter', '0')
411
412
# launch_param = str(int(launch_param))
412
413
@@ -415,6 +416,12 @@ def get_if_possible(my_row, my_value, default=None):
415
416
else :
416
417
new_frame = canmatrix .Frame (frame_name , arbitration_id = int (frame_id [:- 1 ], 16 ), size = dlc )
417
418
419
+ for col_head in column_heads :
420
+ if col_head .startswith ("frame." ):
421
+ command_str = col_head .replace ("frame" , "new_frame" )
422
+ command_str += "=" + str (row [column_heads .index (col_head )].value )
423
+ exec (command_str )
424
+
418
425
db .add_frame (new_frame )
419
426
420
427
# eval launch_type
@@ -482,6 +489,7 @@ def get_if_possible(my_row, my_value, default=None):
482
489
bitNumbering = 1 ,
483
490
startLittle = True
484
491
)
492
+
485
493
if signal_name is not None :
486
494
new_frame .add_signal (new_signal )
487
495
new_signal .add_comment (signal_comment )
@@ -534,6 +542,14 @@ def get_if_possible(my_row, my_value, default=None):
534
542
new_signal .min = None
535
543
new_signal .max = None
536
544
545
+ for col_head in column_heads : # todo explain this possibly dangerous code with eval
546
+ if col_head .startswith ("signal." ):
547
+ command_str = col_head .replace ("signal" , "new_signal" )
548
+ command_str += "=" + str (row [column_heads .index (col_head )].value )
549
+ exec (command_str )
550
+
551
+
552
+
537
553
# dlc-estimation / dlc is not in xls, thus calculate a minimum-dlc:
538
554
for frame in db .frames :
539
555
frame .update_receiver ()
0 commit comments