def __init__(self, parent=None):
        super(ProgramUI, self).__init__(parent)

        # loads an exteranl styesheet as python
        newstyle = styles()
        self.setStyleSheet(newstyle.dark_orange)

        self.setWindowTitle("Motion Detector Editor")
        self.setFixedSize(375, 250)
        # create the main layout
        self.main_layout = QVBoxLayout()
       
        # create the top layout and add it
        self.createtoplayout()
        self.main_layout.addWidget(self.topGroupBox)
        # create the save botton and add it
        self.save_location_button = QtWidgets.QPushButton("Save Location")
        self.save_location_button.setAutoDefault(False)
        self.main_layout.addWidget(self.save_location_button)
        # create the bottom layout and add it
        self.createbottomlayout()
        self.main_layout.addLayout(self.proggresslayout)
       
       # resize window to match the width of what has been added
        self.setLayout(self.main_layout)
        layout_size = self.main_layout.sizeHint()
        self.setFixedSize(self.width(),layout_size.height())
Пример #2
0
    def __init__(self,
                 rows=1,
                 columns=1,
                 width=None,
                 height=None,
                 parent=None,
                 name=""):
        """ A grid of rows and columns of cells, which are grids themselves.
        """

        self._id = _unique_id()
        self.parent = parent
        self.name = name

        # By default, a grid has the width and height of its parent,
        # or the canvas width and height if there is no parent.
        if width == None:
            if self.parent == None:
                width = _ctx.WIDTH
            else:
                width = 1.0
        if height == None:
            if self.parent == None:
                height = _ctx.HEIGHT
            else:
                height = 1.0
        self._width = width
        self._height = height
        self.fixed = False

        # Styling and content.
        if parent == None:
            self._styles = style.styles(_ctx, self)
            self._style = "default"
        else:
            self._styles = None
            self._style = None
        self._content = None

        # The proportion between the cells in the grid.
        self._proportion = proportion()
        self.clear()
        self.split(rows, columns)

        # The order in which cells are drawn.
        self.flow = []
        self._done = False
Пример #3
0
    def __init__(self, iterations=1000, distance=1.0, layout=LAYOUT_SPRING):

        self.nodes = []
        self.edges = []
        self.root = None

        # Calculates positions for nodes.
        self.layout = layout_.__dict__[layout + "_layout"](self, iterations)
        self.d = node(None).r * 2.5 * distance

        # Hover, click and drag event handler.
        self.events = event.events(self, _ctx)

        # Enhanced dictionary of all styles.
        self.styles = style.styles(self)
        self.styles.append(style.style(style.DEFAULT, _ctx))
        self.alpha = 0

        # Try to specialize intensive math operations.
        try:
            import psyco
            psyco.bind(self.layout._bounds)
            psyco.bind(self.layout.iterate)
            psyco.bind(self.__or__)
            psyco.bind(cluster.flatten)
            psyco.bind(cluster.subgraph)
            psyco.bind(cluster.clique)
            psyco.bind(cluster.partition)
            psyco.bind(proximity.dijkstra_shortest_path)
            psyco.bind(proximity.brandes_betweenness_centrality)
            psyco.bind(proximity.eigenvector_centrality)
            psyco.bind(style.edge_arrow)
            psyco.bind(style.edge_label)
            #print "using psyco"
        except:
            pass

        self.times = {}
        self.times['other'] = 0.
        self.times['edges'] = 0.
        self.times['nodes'] = 0.
        self.times['events'] = 0.
        self.times['path'] = 0.
        self.times['node_ids'] = 0.
        self.times['iter'] = 0
Пример #4
0
    def __init__(self, iterations=1000, distance=1.0, layout=LAYOUT_SPRING):
        
        self.nodes = []
        self.edges = []
        self.root  = None
        
        # Calculates positions for nodes.
        self.layout = layout_.__dict__[layout+"_layout"](self, iterations)
        self.d = node(None).r * 2.5 * distance
        
        # Hover, click and drag event handler.
        self.events = event.events(self, _ctx)
        
        # Enhanced dictionary of all styles.
        self.styles = style.styles(self)
        self.styles.append(style.style(style.DEFAULT, _ctx))
        self.alpha = 0

        # Try to specialize intensive math operations.
        try:
            import psyco
            psyco.bind(self.layout._bounds)
            psyco.bind(self.layout.iterate)
            psyco.bind(self.__or__)
            psyco.bind(cluster.flatten)
            psyco.bind(cluster.subgraph)
            psyco.bind(cluster.clique)
            psyco.bind(cluster.partition)
            psyco.bind(proximity.dijkstra_shortest_path)
            psyco.bind(proximity.brandes_betweenness_centrality)
            psyco.bind(proximity.eigenvector_centrality)
            psyco.bind(style.edge_arrow)
            psyco.bind(style.edge_label)
            #print "using psyco"
        except:
            pass

        self.times = {}
        self.times['other'] = 0.
        self.times['edges'] = 0.
        self.times['nodes'] = 0.
        self.times['events'] = 0.
        self.times['path'] = 0.
        self.times['node_ids'] = 0.
        self.times['iter'] = 0
Пример #5
0
    def __init__(self, rows=1, columns=1,
                       width=None, height=None,
                       parent=None, name=""):

        """ A grid of rows and columns of cells, which are grids themselves.
        """

        self._id = _unique_id()
        self.parent = parent
        self.name = name

        # By default, a grid has the width and height of its parent,
        # or the canvas width and height if there is no parent.
        if width == None:
            if self.parent == None:
                width = _ctx.WIDTH
            else:
                width = 1.0
        if height == None:
            if self.parent == None:
                height = _ctx.HEIGHT
            else:
                height = 1.0
        self._width = width
        self._height = height
        self.fixed = False

        # Styling and content.
        if parent == None:
            self._styles = style.styles(_ctx, self)
            self._style = "default"
        else:
            self._styles = None
            self._style = None
        self._content = None

        # The proportion between the cells in the grid.
        self._proportion = proportion()
        self.clear()
        self.split(rows, columns)

        # The order in which cells are drawn.
        self.flow = []
        self._done = False