Browse Source

add base function definition

hanojiang 2 years ago
parent
commit
4d2e886cf1
1 changed files with 23 additions and 5 deletions
  1. 23 5
      Base/SignalInitTableCheck.py

+ 23 - 5
Base/SignalInitTableCheck.py

@@ -23,17 +23,35 @@ class TableColumnHeaderType(Enum):
 
 
 
-class SignalInitTableCheck:
+class SignalInitValueTableCheck:
 
     Column_Need_Check = [TableColumnHeaderType.Signal.value,
                          TableColumnHeaderType.Type.value,
                          TableColumnHeaderType.Bit.value,
                          TableColumnHeaderType.RawValue.value]
 
-    def __init__(self):
+    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):
+    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
@@ -43,7 +61,7 @@ class SignalInitTableCheck:
                     is_header_readed = True
                     continue
 
-                table_data.append([row[column] for column in SignalInitTableCheck.Column_Need_Check])
+                table_data.append([row[column] for column in SignalInitValueTableCheck.Column_Need_Check])
 
         return table_data
 
@@ -51,5 +69,5 @@ class SignalInitTableCheck:
 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 = SignalInitTableCheck()
+    sc = SignalInitValueTableCheck()
     sc.get_csv_data(matrix_path)