def __init__(self, rastr_win, dir_name_file_excel, name_list_excel, switch_command_line=False): self.rastr_win = rastr_win load_file(rastr_win=rastr_win, shabl=Shabl.shablon_file_scenario) excel_wb = load_workbook(filename=dir_name_file_excel, data_only=True) self.ws = excel_wb[name_list_excel] Variable.__init__(self, rastr_win=self.rastr_win, switch_command_line=switch_command_line)
def create_log(self, start=4, finish=8, switch_command_line=False): Variable.__init__(self, rastr_win=self.rastr_win, switch_command_line=switch_command_line) table_ = self.rastr_win.Tables(DFWAutoLogicScn.table) for index in range(start, finish): table_.AddRow() Variable.make_changes_row(self, table=DFWAutoLogicScn.table, column=DFWAutoLogicScn.Id, row_id=index - start, value=self.ws[f'A{index}'].value) # Id Variable.make_changes_row( self, table=DFWAutoLogicScn.table, column=DFWAutoLogicScn.Name, row_id=index - start, value=self.ws[f'B{index}'].value) # Название Variable.make_changes_row( self, table=DFWAutoLogicScn.table, column=DFWAutoLogicScn.ParentId, row_id=index - start, value=self.ws[f'C{index}'].value) # Номер модуля Variable.make_changes_row( self, table=DFWAutoLogicScn.table, column=DFWAutoLogicScn.Type, row_id=index - start, value=self.ws[f'D{index}'].value) # Тип логики Variable.make_changes_row( self, table=DFWAutoLogicScn.table, column=DFWAutoLogicScn.Formula, row_id=index - start, value=self.ws[f'E{index}'].value) # Формула Variable.make_changes_row( self, table=DFWAutoLogicScn.table, column=DFWAutoLogicScn.Actions, row_id=index - start, value=self.ws[f'F{index}'].value) # Действия Variable.make_changes_row( self, table=DFWAutoLogicScn.table, column=DFWAutoLogicScn.Delay, row_id=index - start, value=self.ws[f'G{index}'].value) # Выдержка времени Variable.make_changes_row( self, table=DFWAutoLogicScn.table, column=DFWAutoLogicScn.UnitStarters, row_id=index - start, value=self.ws[f'H{index}'].value) # ПО мод Variable.make_changes_row( self, table=DFWAutoLogicScn.table, column=DFWAutoLogicScn.UnitConstants, row_id=index - start, value=self.ws[f'I{index}'].value) # Const мод Variable.make_changes_row( self, table=DFWAutoLogicScn.table, column=DFWAutoLogicScn.UnitActions, row_id=index - start, value=self.ws[f'J{index}'].value) # Дейст мод Variable.make_changes_row( self, table=DFWAutoLogicScn.table, column=DFWAutoLogicScn.OutputMode, row_id=index - start, value=self.ws[f'H{index}'].value) # Режим выхода