# -*- coding: UTF-8 -*- """ @Project :Matrix_Check @File :SignalInitTableCheck.py @Author :haojiang @Date :2022/9/28 18:15 """ import csv from enum import Enum class TableColumnHeaderType(Enum): Signal = 0 Type = 1 Bit = 2 App = 3 AppValue = 4 Raw = 5 RawValue = 6 Controller = 7 Frame = 8 PDU = 9 class SignalInitValueTableCheck: Column_Need_Check = [TableColumnHeaderType.Signal.value, TableColumnHeaderType.Type.value, TableColumnHeaderType.Bit.value, TableColumnHeaderType.RawValue.value] Type_Mapping = { 'Boolean': bool, 'UInt': , 'SInt': , 'Composite':, 'Bytes': } def __init__(self, project_path: str): pass def check_row(self, row: list): pass def get_signal_init_value_table(self) -> list: pass def get_rx_tx_csv_file_name(self) -> tuple: pass def get_csv_data(self, file_name: str) -> list: with open(file_name, 'r') as csvfile: spamreader = csv.reader(csvfile, delimiter=',') is_header_readed = False table_data = list() for row in spamreader: if not is_header_readed: is_header_readed = True continue table_data.append([row[column] for column in SignalInitValueTableCheck.Column_Need_Check]) return table_data if __name__ == '__main__': matrix_path = r'D:\01_Work\02_WP\EP39_EREV\branch\src\MatrixAssistant_V2.0\EP39_EREV_SIMU+_GW\20220729-qy1-EP39EREV_SIMU+_GW_Rx_初值表.csv' sc = SignalInitValueTableCheck() sc.get_csv_data(matrix_path)