Example #1
0
class SwitchNode:
    def __init__(self,
                 rastr_win=RASTR,
                 table=Node.table,
                 switch_command_line=False):
        f"""
        Класс включает и отключает заданный узел.
        :param rastr_win: {Tools.RastrDoc};
        :param table: название таблицы;
        :param switch_command_line: {Tools.switch_command_line_doc};
        """
        self.rastr_win = rastr_win
        self.table = table
        self.variable_ = Variable()
        self.get_ = GettingParameter()
        self.switch_command_line = switch_command_line

    def on_node(self, node_ny):
        """
        :param node_ny: номер узла.
        :return:
        """
        row_ = self.get_.get_row_node(node_ny=node_ny)
        sta_ny = self.get_.get_cell(table=self.table,
                                    column=node.sta,
                                    row_id=row_)
        self.variable_.make_changes_row(table=self.table,
                                        column=node.sta,
                                        row_id=row_)
        if self.switch_command_line is not False:
            print(sta_ny)

    def off_node(self, node_ny):
        """
        :param node_ny: номер узла.
        :return:
        """
        row_ = self.get_.get_row_node(node_ny=node_ny)
        sta_ny = self.get_.get_cell(table=self.table,
                                    column=node.sta,
                                    row_id=row_)
        self.variable_.make_changes_row(table=self.table,
                                        column=node.sta,
                                        row_id=row_)
        if self.switch_command_line is not False:
            print(sta_ny)
Example #2
0
    # # ********** Узлы ****************
    node_table_file_one = one_rastr.Tables(Node.table)
    max_col_node_file_one = node_table_file_one.Count - 1
    print(f'Max Node file_one: {max_col_node_file_one}')

    for y in range(0, max_col_node_file_one):
        # файл 1
        ny_node_file_one = get_one.get_cell_row(table=Node.table, column=Node.ny, row_id=y)
        p_node_file_one = get_one.get_cell_row(table=Node.table, column=Node.name, row_id=y)
        q_node_file_one = get_one.get_cell_row(table=Node.table, column=Node.sta, row_id=y)
        name_node_file_one = get_one.get_cell_row(table=Node.table, column=Node.vzd, row_id=y)
        sta_node_file_one = get_one.get_cell_row(table=Node.table, column=Node.pg, row_id=y)
        vzd_node_file_one = get_one.get_cell_row(table=Node.table, column=Node.qg, row_id=y)

        # файл 2
        row_node_file_two = get_two.get_row_node(node_ny=ny_node_file_one)

        if row_node_file_two != (-1):
            ny_node_file_two = get_two.get_cell_row(table=Node.table,
                                                    column=Node.ny,
                                                    row_id=row_node_file_two)

            name_node_file_two = get_two.get_cell_row(table=Node.table,
                                                      column=Node.name,
                                                      row_id=row_node_file_two)

            sta_node_file_two_do = get_two.get_cell_row(table=Node.table,
                                                        column=Node.sta,
                                                        row_id=row_node_file_two)

            val_file_two.make_changes_row(table=Node.table,
Example #3
0
from RastrWinLib.operation.Variable import Variable

load_file(
    file_path=
    r'C:\Users\Ohrimenko_AG\Desktop\Test_equiPy\02-БРМ Зима максимум [уст].rg2',
    shabl=Shabl.shablon_file_regime,
    switch_command_line=True)

get_ = GettingParameter()
variable_ = Variable()
for i in range(0, 26558):
    ip = get_.get_cell(table=vetv_table, column='ip', row_id=i)

    iq = get_.get_cell(table=vetv_table, column='iq', row_id=i)

    row_ny_ip = get_.get_row_node(node_ny=ip)
    row_ny_iq = get_.get_row_node(node_ny=iq)

    na_ip = get_.get_cell(table=node_table, column='na', row_id=row_ny_ip)

    na_iq = get_.get_cell(table=node_table, column='na', row_id=row_ny_iq)

    if na_ip == na_iq:
        print(f'na_ip={na_ip} == na_iq={na_iq}')
        variable_.make_changes_row(table=vetv_table,
                                   column='na',
                                   row_id=i,
                                   value=na_ip)
    else:
        print(f'ERROR: na_ip={na_ip} != na_iq={na_iq}')