Ejemplo n.º 1
0
def equivalent_gen(viborka_gen):
    ekv_obj = Equivalent(rastr_win=RASTR,
                         switch_command_line=False)
    sel_remove = RemoveSelObjects(rastr_win=RASTR)
    sel_remove.remove_sel_vetv()
    sel_remove.remove_sel_node()

    list_na = [102, 103, 104, 105, 106, 107, 108, 109]
    get_ = GettingParameter()
    variable_ = Variable()

    for i in range(0, 26558):
        na_vetv = get_.get_cell(table=vetv_table,
                                column=vetv.na,
                                row_id=i)

        v_ip = get_.get_cell(table=vetv_table,
                             column=vetv.v_ip,
                             row_id=i)
        v_iq = get_.get_cell(table=vetv_table,
                             column=vetv.v_iq,
                             row_id=i)

        for na in list_na:
            if na == na_vetv:
                if 160 > v_iq and 160 > v_ip:
                    variable_.make_changes_row(table=vetv_table,
                                               column=vetv.sel,
                                               row_id=i,
                                               value=1)
Ejemplo n.º 2
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)
Ejemplo n.º 3
0
    for x in range(0, max_col_area_file_one):
        na_area_node_file_one = get_.get_cell(table=Area.table, column=Area.na, row_id=x)

        name_area_node_file_one = get_.get_cell(table=Area.table, column=Area.name, row_id=x)

        pg_area_node_file_one = get_.get_cell(table=Area.table, column=Area.pg, row_id=x)

        pn_area_file_one = get_.get_cell(table=Area.table, column=Area.pn, row_id=x)

        if na_area_node_file_one > 0:
            row_obj_area_file_two = FindNextSel(rastr_win=two_rastr, table=Area.table)
            row_area_file_two = row_obj_area_file_two.row(key=f"na={pn_area_file_one}")

            if row_area_file_two != (-1):
                na_file_two = get_two.get_cell(table=Area.table, column=Area.na, row_id=row_area_file_two)

                pg_area_file_two = get_two.get_cell(table=Area.table, column=Area.pg, row_id=row_area_file_two)

                if pg_area_file_two > 0:
                    k_pg = pg_area_node_file_one / pg_area_file_two
                else:
                    k_pg = 1

                grupCorr_pg_file_two = GroupCorr(rastr_win=two_rastr, table=Node.table, column=Node.pg,
                                                 switch_command_line=True)
                grupCorr_pg_file_two.calc(key=f'na={na_file_two}', formula=f'pg*{k_pg}')

                na_area_node_file_two = get_two.get_cell(table=Area.table, column=Area.na, row_id=row_area_file_two)

                name_area_file_two = get_two.get_cell(table=Area.table, column=Area.name, row_id=row_area_file_two)
Ejemplo n.º 4
0
from RastrWinLib.Load import load_file
from RastrWinLib.Load.save import save_file
from RastrWinLib.Load.shablon import Shabl
from RastrWinLib.Tables.tables_attributes import vetv_table, node_table
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,