Пример #1
0
 def init_grids(self):
     w_ratio = 1 / MAX_GRID_WIDTH
     h_ratio = 1 / MAX_GRID_HEIGHT
     for i in range(MAX_GRID_WIDTH):
         column = []
         for j in range(MAX_GRID_HEIGHT):
             grid = Grid(self)
             column.append(grid)
             self.grid_cluster.append(grid)
             grid.place(relx=i * w_ratio,
                        rely=j * h_ratio,
                        relwidth=w_ratio,
                        relheight=h_ratio)
         self.grids.append(column)
Пример #2
0
    def create_widgets(self):
        ls = List("STAT_VAR_LIST", "ID", "TITLE", "select ID, CONCAT(COMM, ' [', NAME, ']') TITLE from core_variables order by COMM")
        self.add_widget(ls)

        gr = Grid("STAT_VAR_DATA", "ID", "select ID, CHANGE_DATE, VALUE from core_variable_changes", detail=True)
        gr.add_column("ID", "ID", 60, False)
        gr.add_column("CHANGE_DATE", "CHANGE_DATE", 130, sort="asc")
        gr.add_column("VALUE", "VALUE", 100)
        self.add_widget(gr)
Пример #3
0
 def load_favourites(self):
     row, column, max_h = 0, 0, 6
     for grid_config in self.get_favourites():
         grid = Grid(self, font=(grid_config[1], 12))
         grid.set(grid_config[0])
         self.grids.append(grid)
         grid.place(x=column * 40, y=row * 40, width=40, height=40)
         if row == max_h - 1:
             column += 1
             row = 0
         else:
             row += 1
     self.body.config(width=(column + 1) * 40, height=max_h * 40)
Пример #4
0
    def create_widgets(self):
        variableSql = ("select s.* "
                       "  from core_scheduler s ")

        grid = Grid("SCHEDULER_LIST", "ID", variableSql)

        grid.add_column("ID", "ID", 50, visible=False)
        grid.add_column("Описание", "COMM", 250, sort="asc")
        grid.add_column("Следующее действие", "ACTION_DATETIME", 90, sort="on")
        grid.add_column("Действие", "ACTION", 300, sort="on")
        grid.add_column("Переодичность", "INTERVAL_TYPE", 500, sort="on", func=self.column_interval_func)
        self.add_widget(grid)
        self.SCHEDULER_LIST = grid;
Пример #5
0
    def create_widgets(self):
        ls = Tree(
            "VARIABLE_GROUPS",
            "ID",
            "PARENT_ID",
            "NAME",
            "select ID, PARENT_ID, NAME from plan_parts order by ORDER_NUM",
            self.varGroupAddAttr,
        )
        self.add_widget(ls)

        variableSql = (
            "select v.ID, c.NAME C_NAME, v.ROM, v.DIRECTION, v.NAME, v.COMM, v.APP_CONTROL, v.VALUE, v.CHANNEL "
            "  from core_variables v, core_controllers c "
            " where c.ID = v.CONTROLLER_ID "
        )

        grid = Grid("VARIABLE_LIST", "ID", variableSql)

        grid.add_column("ID", "ID", 50, visible=False)
        grid.add_column("Контроллер", "C_NAME", 150, sort="asc")
        grid.add_column("Тип", "ROM", 70, sort="on")
        grid.add_column("Только чтение", "DIRECTION", 60, sort="on", func=self.column_ro_func)
        grid.add_column("Идентификатор", "NAME", 200, sort="asc")
        grid.add_column("Описание", "COMM", 200, sort="on")
        grid.add_column("Устройство", "APP_CONTROL", 100, sort="on", func=self.column_control_func)
        grid.add_column("Значение", "VALUE", 100, sort="on", func=self.column_val_func)
        grid.add_column("Канал", "CHANNEL", 100, sort="on")
        self.add_widget(grid)

        self.controls = [(0, b"--//--")] + self.db.select("select ID, NAME from core_variable_controls order by ID")
Пример #6
0
    def create_widgets(self):
        #variableSql = ("select w.ID, c.NAME, HEX(w.ROM_1, w.ROM_2, w.ROM_3, w.ROM_4, w.ROM_5, w.ROM_6, w.ROM_7, w.ROM_8, t.CHANNELS, w.VALUE, '' F1, '' F2 "
        variableSql = ("select w.ID, c.NAME, CONCAT(HEX(w.ROM_1), ' ', HEX(w.ROM_2), ' ', HEX(w.ROM_3), ' ', HEX(w.ROM_4), ' ', HEX(w.ROM_5), ' ', HEX(w.ROM_6), ' ', HEX(w.ROM_7), ' ', HEX(w.ROM_8)) ROM, t.CHANNELS, w.VALUE, '' F1 "
                       "  from core_controllers c, "
                       "       core_ow_devs w LEFT JOIN core_ow_types t ON t.CODE = w.ROM_1 "
                       " where c.ID = w.CONTROLLER_ID")

        grid = Grid("OW_MANAGER_GRID", "ID", variableSql)
        grid.add_column("ID", "ID", 50, visible=False)
        grid.add_column("Контроллер", "NAME", 150, sort="asc")
        grid.add_column("ROM", "ROM", 290, sort="asc", func=self._rom_to_hex)
        grid.add_column("Каналы", "CHANNELS", 100, sort="on")
        grid.add_column("Связанные переменные", "F1", 190, func=self._vars)        
        self.add_widget(grid)