Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
# write Value
signal_row += [val, sig.values[val]]
signal_row += additional_frame_info
for item in additional_signal_columns:
temp = getattr(sig, item, "")
signal_row += [temp]
# next row
row += 1
csv_table.append(signal_row)
# loop over values ends here
# no value table available
else:
signal_row = CsvRow()
signal_row += canmatrix.formats.xls_common.get_frame_info(db, frame)
(front, back) = canmatrix.formats.xls_common.get_signal(db, sig, motorola_bit_format)
signal_row += front
signal_row += ("s" if sig.is_signed else "u")
col = head_top.__len__()
write_ecu_matrix(ecu_name_list, sig, frame, signal_row, col)
signal_row += back
if sig.min is not None or sig.max is not None:
signal_row += [str("{}..{}".format(sig.min, sig.max))]
else:
signal_row += [""]
signal_row += additional_frame_info
for item in additional_signal_columns:
write_excel_line(worksheet, row, col + 2, back_row, signal_style)
write_excel_line(worksheet, row, col, [val, sig.values[val]], value_style)
# no min/max here, because min/max has same col as values...
# next row
row += 1
# set style to normal - without border
signal_style = sty_white
frame_style = sty_white
value_style = sty_norm
# loop over values ends here
# no valuetable available
else:
row_array = canmatrix.formats.xls_common.get_frame_info(db, frame)
front_col = write_excel_line(worksheet, row, 0, row_array, frame_style)
if frame_style != sty_first_frame:
worksheet.set_row(row, None, None, {'level': 1})
col = head_start
col = write_ecu_matrix(ecu_list, sig, frame, worksheet, row, col, frame_style)
(frontRow, back_row) = canmatrix.formats.xls_common.get_signal(db, sig, motorola_bit_format)
write_excel_line(worksheet, row, front_col, frontRow, signal_style)
if float(sig.min) != 0 or float(sig.max) != 1.0:
back_row.insert(0, str("%g..%g" % (sig.min, sig.max))) # type: ignore
else:
back_row.insert(0, "")
back_row.insert(0, "")
back_row += additional_frame_info
row += 1
continue
# iterate over signals
for sig_idx in sorted(sig_hash.keys()):
sig = sig_hash[sig_idx]
# if not first Signal in Frame, set style
if sig_style != sty_first_frame:
sig_style = sty_norm
if sig.values.__len__() > 0: # signals with value table
val_style = sig_style
# iterate over values in value table
for val in sorted(sig.values.keys()):
row_array = canmatrix.formats.xls_common.get_frame_info(db, frame)
front_col = write_excel_line(worksheet, row, 0, row_array, frame_style)
if frame_style != sty_first_frame:
worksheet.row(row).level = 1
col = head_start
col = write_ecu_matrix(ecu_list, sig, frame, worksheet, row, col, frame_style)
# write Value
(frontRow, backRow) = canmatrix.formats.xls_common.get_signal(db, sig, motorola_bit_format)
write_excel_line(worksheet, row, front_col, frontRow, sig_style)
backRow += additional_frame_info
for item in additional_signal_columns:
temp = getattr(sig, item, "")
backRow.append(temp)
write_excel_line(worksheet, row, col + 2, backRow, sig_style)