Exemplo n.º 1
0
    def setupUi(self):
        self.setGeometry(QtCore.QRect(100, 100, 500, 500))

        self.w = QtWidgets.QWidget(self)
        self.setCentralWidget(self.w)

        # here's the demo ..
        class FileMenu(QuickMenu):
            title = "File"
            elements = [QuickMenuElement(title="Exit")]

        class GridMenu(QuickMenu):
            title = "Video Grid"
            elements = [
                QuickMenuElement(title="Grid 1x1"),
                QuickMenuElement(title="Grid 2x2"),
                QuickMenuElement(title="Grid 3x3"),
                QuickMenuElement(title="Grid 4x4")
            ]

        class ViewMenu(QuickMenu):
            title = "View"
            elements = [QuickMenuElement(title="Camera List"), GridMenu]

        self.filemenu = FileMenu(parent=self)
        self.viewmenu = ViewMenu(parent=self)

        # the attributes were autogenerated:
        self.filemenu.exit.triggered.connect(self.exit_slot)
        self.viewmenu.video_grid.grid_1x1.triggered.connect(self.grid1x1_slot)
Exemplo n.º 2
0
 def setupUi(self):
   self.setGeometry(QtCore.QRect(100,100,500,500))
   
   self.w=QtWidgets.QWidget(self)
   self.setCentralWidget(self.w)
   
   QtWidgets.QMessageBox.about(self.w, "About it", constant.valkka_core_not_found)
Exemplo n.º 3
0
    def setupUi(self):
        self.setGeometry(QtCore.QRect(100, 100, 800, 800))
        self.w = QtWidgets.QWidget(self)
        self.setCentralWidget(self.w)
        self.lay = QtWidgets.QVBoxLayout(self.w)

        self.timelinewidget = TimeLineWidget(datetime.date.today(),
                                             parent=self.w)
        self.timelinewidget.setLogLevel(logging.DEBUG)
        self.lay.addWidget(self.timelinewidget)

        t = int(time.mktime(datetime.date.today().timetuple()) * 1000)
        self.timelinewidget.setFSTimeLimits(
            (t + int(1000 * 2 * 3600), t + int(1000 * 20 * 3600)))

        t = int(time.mktime(datetime.date.today().timetuple()) * 1000)
        self.timelinewidget.setBlockTimeLimits(
            (t + int(1000 * 6 * 3600), t + int(1000 * 14 * 3600)))

        self.calendarwidget = CalendarWidget(datetime.date.today(),
                                             parent=self.w)
        self.lay.addWidget(self.calendarwidget)

        d = datetime.date.today()
        d0 = datetime.date(year=d.year, month=d.month, day=d.day - 2)
        d1 = datetime.date(year=d.year, month=d.month, day=d.day + 3)

        t0 = int(time.mktime(d0.timetuple()) * 1000)
        t1 = int(time.mktime(d1.timetuple()) * 1000)

        self.calendarwidget.set_fs_time_limits_slot((t0, t1))
Exemplo n.º 4
0
    def setupUi(self):
        self.setGeometry(QtCore.QRect(100, 100, 500, 500))

        self.w = QtWidgets.QWidget(self)
        self.setCentralWidget(self.w)
        self.lay = QtWidgets.QVBoxLayout(self.w)

        # self.video = SimpleVideoWidget(parent=self.w)
        self.video = LineCrossingVideoWidget(parent=self.w)
        self.lay.addWidget(self.video)
Exemplo n.º 5
0
    def setupUi(self):
        self.setGeometry(QtCore.QRect(100, 100, 500, 500))

        self.w = QtWidgets.QWidget(self)
        self.lay = QtWidgets.QVBoxLayout(self.w)

        self.setCentralWidget(self.w)

        # self.device_list_form = self.dm.getDeviceListAndForm(self.w)
        # self.lay.addWidget(self.device_list_form.widget)

        self.device_list_form = self.dm.getDeviceListAndForm(None)
        self.device_list_form.widget.show()
Exemplo n.º 6
0
    def setupUi(self):
        self.setGeometry(QtCore.QRect(100, 100, 500, 500))

        self.w = QtWidgets.QWidget(self)
        self.setCentralWidget(self.w)

        self.filemenu = FileMenu(parent=self)
        self.viewmenu = ViewMenu(parent=self)
        self.configmenu = ConfigMenu(parent=self)
        self.aboutmenu = AboutMenu(parent=self)

        self.filemenu.exit.triggered.connect(self.exit_slot)

        self.viewmenu.video_grid.grid_1x1.triggered.connect(self.grid1x1_slot)
Exemplo n.º 7
0
    def setupUi(self):
        self.setGeometry(QtCore.QRect(100, 100, 500, 500))

        # create widget inside this window
        self.w = QtWidgets.QFrame(self)
        self.w.setAutoFillBackground(True)
        self.w.setStyleSheet("QFrame {background-color: blue;}")
        self.setCentralWidget(self.w)

        # lets create another window with a widget inside
        self.another_window = QtWidgets.QMainWindow()
        self.w2 = QtWidgets.QFrame(self.another_window)
        self.w2.setAutoFillBackground(True)
        self.w2.setStyleSheet("QFrame {background-color: green;}")
        self.another_window.setCentralWidget(self.w2)
        self.another_window.show()
Exemplo n.º 8
0
    def setupUi(self):
        self.setGeometry(QtCore.QRect(100, 100, 500, 500))
        # self.w = self.VideoWidget(self)
        self.w = QtWidgets.QWidget(self)
        self.setCentralWidget(self.w)

        self.root = HeaderListItem()

        self.server1 = ServerListItem(
            name="First Server",
            ip="192.168.1.20",
            parent=self.root)
        self.server2 = ServerListItem(
            name="First Server",
            ip="192.168.1.21",
            parent=self.root)
        self.server3 = ServerListItem(
            name="First Server",
            ip="192.168.1.22",
            parent=self.root)
        self.server4 = ServerListItem(
            name="First Server",
            ip="192.168.1.23",
            parent=self.root)

        self.camera1 = RTSPCameraListItem(
            
            camera = RTSPCameraDevice(
                _id     =1,
                slot    =1,
                address ="192.168.1.4",
                username="******",
                password="******"),
            
            parent=self.server1)
            
        self.camera7 = USBCameraListItem(
            
            camera = USBCameraDevice(
                _id    =1,
                slot   =2,
                address ="/dev/video2"),
            
            parent=self.server4)

        self.treelist = BasicView(parent=None, root=self.root)
        self.treelist.show()
Exemplo n.º 9
0
    def setupUi(self):
        self.setGeometry(QtCore.QRect(100, 100, 500, 500))

        # create widget inside this window
        self.w = QtWidgets.QFrame(self)
        self.w.setAutoFillBackground(True)
        self.w.setStyleSheet("QFrame {background-color: blue;}")
        self.setCentralWidget(self.w)

        self.lay = QtWidgets.QVBoxLayout(self.w)

        self.thread = QOnvifThread(user="******",
                                   password="******",
                                   ip="192.168.0.134")

        self.b = QtWidgets.QPushButton(self, "Push Me")
        self.b.clicked.connect(self.b_slot)
        self.lay.addWidget(self.b)

        self.thread.start()
Exemplo n.º 10
0
    def setupUi(self):
        self.setGeometry(QtCore.QRect(100, 100, 800, 800))

        self.valkkafs = ValkkaSingleFS.loadFromDirectory(
            dirname="/home/sampsa/tmp/testvalkkafs")
        self.manager = ValkkaFSManager(self.valkkafs)
        self.manager.setOutput_(925412, 1)  # id => slot

        gpu_handler = GPUHandler()

        pvc = PlayVideoContainerNxM(n_dim=3,
                                    m_dim=3,
                                    valkkafsmanager=self.manager,
                                    gpu_handler=gpu_handler,
                                    filterchain_group=None)

        # dummy window
        self.w = QtWidgets.QWidget(self)
        self.setCentralWidget(self.w)
        self.lay = QtWidgets.QVBoxLayout(self.w)
Exemplo n.º 11
0
    def setupUi(self):
        self.setGeometry(QtCore.QRect(100, 100, 500, 500))

        # create widget inside this window
        self.w = QtWidgets.QFrame(self)
        self.w.setAutoFillBackground(True)
        self.w.setStyleSheet("QFrame {background-color: blue;}")
        self.setCentralWidget(self.w)

        self.lay = QtWidgets.QVBoxLayout(self.w)

        self.thread = IPCQThread(
            "/tmp/test-socket.ipc"
        )

        self.b = QtWidgets.QPushButton(self, "Push Me")
        self.b.clicked.connect(self.b_slot)
        self.lay.addWidget(self.b)

        self.thread.start()
Exemplo n.º 12
0
    def setupUi(self):
        self.setGeometry(QtCore.QRect(100, 100, 500, 500))
        self.w = QtWidgets.QWidget(self)
        self.setCentralWidget(self.w)

        self.lay = QtWidgets.QGridLayout(self.w)

        self.button1 = QtWidgets.QPushButton("Button 1", self.w)
        self.button2 = QtWidgets.QPushButton("Button 2", self.w)

        self.check1 = QtWidgets.QRadioButton(self.w)
        self.check2 = QtWidgets.QRadioButton(self.w)

        self.lay.addWidget(self.button1, 0, 0)
        self.lay.addWidget(self.check1, 0, 1)
        self.lay.addWidget(self.button2, 1, 0)
        self.lay.addWidget(self.check2, 1, 1)

        self.button1.clicked.connect(self.button1_slot)
        self.button2.clicked.connect(self.button2_slot)

        self.process1.signals.pong.connect(self.pong1_slot)
        self.process2.signals.pong.connect(self.pong2_slot)
Exemplo n.º 13
0
    def setupUi(self):
        self.setGeometry(QtCore.QRect(100, 100, 500, 500))

        # create widget inside this window
        self.w = QtWidgets.QFrame(self)
        self.w.setAutoFillBackground(True)
        self.w.setStyleSheet("QFrame {background-color: blue;}")
        self.setCentralWidget(self.w)

        self.lay = QtWidgets.QVBoxLayout(self.w)

        self.thread = WWWQThread(singleton.ipc_dir.getFile("pyramid.ipc"),
                                 inspect.currentframe())
        self.ws_thread = WebSocketThread(singleton.ipc_dir.getFile("ws.ipc"))

        self.b = QtWidgets.QPushButton(self, "Push Me")
        self.b.clicked.connect(self.b_slot)
        self.lay.addWidget(self.b)

        self.ws_thread.signals.base.connect(self.ws_message)

        self.thread.start()
        time.sleep(1)
        self.ws_thread.start()
Exemplo n.º 14
0
 def setupUi(self):
   self.setGeometry(QtCore.QRect(100,100,500,500))
   
   self.w=QtWidgets.QWidget(self)
   self.setCentralWidget(self.w)
Exemplo n.º 15
0
    def setupUi(self):

        rec = QtWidgets.QApplication.desktop().screenGeometry()
        height = rec.height()
        width = rec.width()

        self.setGeometry(QtCore.QRect(0, 0, width, height // 2))
        self.w = QtWidgets.QWidget(self)
        self.setCentralWidget(self.w)
        self.lay = QtWidgets.QVBoxLayout(self.w)

        # return

        # divide window into three parts
        self.upper = QtWidgets.QWidget(self.w)
        self.middle = QtWidgets.QWidget(self.w)
        self.lower = QtWidgets.QWidget(self.w)
        self.lowest = QtWidgets.QWidget(self.w)
        self.lay.addWidget(self.upper)
        self.lay.addWidget(self.middle)
        self.lay.addWidget(self.lower)
        self.lay.addWidget(self.lowest)

        # upper part: detectors widget and the video itself
        self.upperlay = QtWidgets.QHBoxLayout(self.upper)

        # self.widget  =QtWidgets.QTextEdit(self.upper)
        self.widget = QtWidgets.QWidget(self.upper)
        self.widget_lay = QtWidgets.QVBoxLayout(self.widget)

        # self.widget = self.mvision_process.getWidget()
        # self.widget.setParent(self.upper)

        self.video_area = QtWidgets.QWidget(self.upper)
        self.video_lay = QtWidgets.QGridLayout(self.video_area)

        self.upperlay.addWidget(self.widget)
        self.upperlay.addWidget(self.video_area)
        self.widget.setSizePolicy(QtWidgets.QSizePolicy.Minimum,
                                  QtWidgets.QSizePolicy.Minimum)
        self.video_area.setSizePolicy(QtWidgets.QSizePolicy.Expanding,
                                      QtWidgets.QSizePolicy.Expanding)
        """
        [------|--------------------------------------]
        [Open File] [Close Live] [Play] [Stop] [Rewind]
        """

        self.middlelay = QtWidgets.QHBoxLayout(self.middle)
        self.slider = QtWidgets.QSlider(QtCore.Qt.Orientation.Horizontal,
                                        self.middle)
        self.middlelay.addWidget(self.slider)
        self.slider.setTracking(False)

        self.lowerlay = QtWidgets.QHBoxLayout(self.lower)
        self.open_file_button = QtWidgets.QPushButton("Open File", self.lower)
        self.close_file_button = QtWidgets.QPushButton("Close File",
                                                       self.lower)
        self.play_button = QtWidgets.QPushButton("Play", self.lower)
        self.stop_button = QtWidgets.QPushButton("Stop", self.lower)
        self.rewind_button = QtWidgets.QPushButton("<<", self.lower)
        self.seek_label = QtWidgets.QLabel("<<", self.lower)

        self.lowerlay.addWidget(self.open_file_button)
        self.lowerlay.addWidget(self.close_file_button)
        self.lowerlay.addWidget(self.play_button)
        self.lowerlay.addWidget(self.stop_button)
        self.lowerlay.addWidget(self.rewind_button)
        self.lowerlay.addWidget(self.seek_label)

        self.open_file_button.clicked.connect(self.open_file_button_slot)
        self.close_file_button.clicked.connect(self.close_file_button_slot)
        self.play_button.clicked.connect(self.play_button_slot)
        self.stop_button.clicked.connect(self.stop_button_slot)
        self.rewind_button.clicked.connect(self.rewind_button_slot)
        self.slider.valueChanged.connect(self.slider_slot)

        # lowest part: some text
        self.lowestlay = QtWidgets.QVBoxLayout(self.lowest)
        self.infotext = QtWidgets.QLabel("info text", self.lowest)
        self.lowestlay.addWidget(self.infotext)
Exemplo n.º 16
0
    def setupUi(self):
        self.setStyleSheet(style.main_gui)
        self.setWindowTitle(singleton.program_name)

        self.setGeometry(QtCore.QRect(100, 100, 500, 500))

        self.w = QtWidgets.QWidget(self)
        self.setCentralWidget(self.w)

        self.filemenu = FileMenu(parent=self)
        self.viewmenu = ViewMenu(parent=self)  # grids up to 4x4
        self.configmenu = ConfigMenu(parent=self)

        if self.mvision:
            mvision_elements = []

            for cl in self.mvision_classes + self.mvision_client_classes:
                if cl.auto_menu:
                    # # instead: all visible in menus
                    # # but if auto_menu is False, then must be connected
                    # # manually .. actually, we'd need auto_connect switch.
                    el = QuickMenuElement(title=cl.name, method_name=cl.name)
                    mvision_elements.append(el)

            class MVisionMenu(QuickMenu):
                title = "Machine Vision"
                elements = mvision_elements

            self.mvisionmenu = MVisionMenu(parent=self)

        self.aboutmenu = AboutMenu(parent=self)

        # create container and their windows
        self.manage_cameras_container = singleton.data_model.getDeviceListAndForm(
            None)
        self.manage_memory_container = singleton.data_model.getConfigForm()

        self.manage_memory_container.signals.save.connect(
            self.config_modified_slot)
        self.manage_cameras_container.getForm().signals.save_record.connect(
            self.config_modified_slot)

        tabs = [
            (self.manage_cameras_container.widget, "Camera Configuration"),
            (self.manage_memory_container.widget, "Memory Configuration"),
        ]

        if singleton.use_playback:
            self.manage_valkkafs_container = singleton.data_model.getValkkaFSForm(
            )
            self.manage_valkkafs_container.signals.save.connect(
                self.valkkafs_modified_slot)
            tabs.append((self.manage_valkkafs_container.widget,
                         "Recording Configuration"))

        self.config_win = QTabCapsulate("Configuration", tabs)

        self.config_win.signals.close.connect(self.config_dialog_close_slot)
        self.config_win.signals.close.connect(
            self.manage_cameras_container.close_slot)
        # == inform ListAndForm that it has been closed => it knows to close any extra wins / dialogs present
        # when the configuration dialog is reopened, inform the camera configuration form .. this way it can re-check if usb cams are available
        self.config_win.signals.show.connect(
            self.manage_cameras_container.getForm().show_slot)
        self.config_win.signals.show.connect(
            self.manage_cameras_container.choose_first_slot
        )  # so that we have at least one device chosen

        self.makeCameraTree()
        self.camera_list_win = QCapsulate(self.treelist, "Camera List")

        self.wait_label = QtWidgets.QLabel("Restarting Valkka, please wait ..")
        self.wait_window = QCapsulate(self.wait_label, "Wait", nude=True)