Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
# valuetable available?
if len(sig.values) > 0 and not values_in_seperate_lines:
value_style = signal_style
# iterate over values in valuetable
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.set_row(row, None, None, {'level': 1})
col = head_start
col = write_ecu_matrix(ecu_list, sig, frame, worksheet, row, col, frame_style)
# write Value
(frontRow, back_row) = canmatrix.formats.xls_common.get_signal(db, sig, motorola_bit_format)
write_excel_line(worksheet, row, front_col, frontRow, signal_style)
back_row += additional_frame_info
for item in additional_signal_columns:
temp = getattr(sig, item, "")
back_row.append(temp)
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
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:
temp = getattr(sig, item, "")
signal_row += [temp]
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
for item in additional_signal_columns:
temp = getattr(sig, item, "")
back_row.append(temp)
write_excel_line(worksheet, row, col, back_row, signal_style)
if len(sig.values) > 0:
write_excel_line(worksheet, row, col, ["\n".join(["{}: {}".format(a,b) for (a,b) in sig.values.items()])], signal_style)
# set style to normal - without border
sig_style = sty_white
frame_style = sty_white
val_style = sty_norm
# loop over values ends here
# no value table 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.row(row).level = 1
col = head_start
col = write_ecu_matrix(
ecu_list, sig, frame, worksheet, row, col, frame_style)
(frontRow, backRow) = canmatrix.formats.xls_common.get_signal(db, sig, motorola_bit_format)
write_excel_line(worksheet, row, front_col, frontRow, sig_style)
if float(sig.min) != 0 or float(sig.max) != 1.0:
backRow.insert(0, str("%g..%g" % (sig.min, sig.max))) # type: ignore
else:
backRow.insert(0, "")
backRow.insert(0, "")
backRow += additional_frame_info
for item in additional_signal_columns:
temp = getattr(sig, item, "")
backRow.append(temp)
write_excel_line(worksheet, row, col, backRow, sig_style)
# next row