def __init__(self, parent):
        QWidget.__init__(self)
        self.playing = True

        self.title = QLabel()
        font = QFont('Helvetica', 18)
        self.title.setFont(font)
        self.title.setAlignment(Qt.AlignCenter)

        self.surface = QLabel()
        self.placeholder = data_handler.getLabelledPixmap(
            1280,
            720,
            "Click on something in the ready list\nto view it here.",
            path='../data/placeholder.png')
        self.surface.setSizePolicy(
            QSizePolicy(QSizePolicy.Maximum, QSizePolicy.Maximum))
        self.setSizePolicy(
            QSizePolicy(QSizePolicy.Minimum, QSizePolicy.Minimum))

        self.surface.setPixmap(self.placeholder)

        self.timeDisplay = QLabel("0:00:00 / 0:00:00")
        font = QFont('Helvetica', 12)
        self.timeDisplay.setFont(font)

        self.controls = QHBoxLayout()
        self.controls.setAlignment(Qt.AlignCenter)
        self.togglePlay = QPushButton('Play/Pause')
        self.togglePlay.clicked.connect(self.toggle)

        self.togglePlay.setSizePolicy(
            QSizePolicy(QSizePolicy.Maximum, QSizePolicy.Maximum))

        self.resultDisplay = QLabel()
        self.resultDisplay.setFont(font)
        self.resultDisplay.setAlignment(Qt.AlignRight)
        self.resultDisplay.setMinimumWidth(50)
        self.resultDisplay.setMaximumWidth(50)

        self.controls.addWidget(self.timeDisplay)
        self.controls.addWidget(self.togglePlay)
        self.controls.addWidget(self.resultDisplay)

        self.analyser = self.Analyser(self)
        self.analyser.setDaemon(True)
        self.analyser.start()

        self.pause = GenericConnector(self.analyser.pausefeed)
        self.play = GenericConnector(self.analyser.playfeed)

        self.chart = self.Chart(self)

        outerLayout = QVBoxLayout()
        outerLayout.addWidget(self.title)
        outerLayout.addWidget(self.surface)
        outerLayout.addLayout(self.controls)
        outerLayout.addWidget(self.chart)

        self.setLayout(outerLayout)
Beispiel #2
0
	def __init__(self, parent):
		Thread.__init__(self)
		self.parent = parent
		self.updateLayout = GenericConnector(self.parent.updateLayout)
		self.alertDialog = GenericConnector(self.parent.showAlertDialog)

		self.index = {}
		self.playlist = []

		soundsPath = '../data/Sounds'
		files = os.listdir(soundsPath)

		fullPaths = []

		for file in files:
			path = soundsPath + '/' + file
			fullPaths.append(path)

		count = 0
		for file in fullPaths:
			media = QUrl.fromLocalFile(file)
			self.playlist.append(media)
			self.index[file] = count
			count += 1

		self.player = QMediaPlayer()
		self.player.stateChanged.connect(self.mediaStateChange)
		self.finished = True

		self.soundsPath = '../data/Sounds'
		self.detectedPath = soundsPath + '/weapondetected.mp3'
		self.andPath = soundsPath + '/and.mp3'
		self.notify = Notify()
 def __init__(self, parent):
     Thread.__init__(self)
     self.parent = parent
     self.terminator = Terminator.getInstance()
     self.moveTopConnector = GenericConnector(self.parent.moveTop)
     self.progressBarSetup = GenericConnector(self.parent.setupProgressBar)
     self.progressBarUpdate = GenericConnector(
         self.parent.updateProgressBar)
 def __init__(self, display):
     Thread.__init__(self)
     self.basePath = '../data/processed/'
     self.path = None
     self.resultPath = None
     self.frameCount = 0
     self.displayConn = DisplayConnector(display)
     self.chartConn = GenericConnector(display.resetChart)
     self.pointConn = GenericConnector(display.updateChart)
     self.timeConn = GenericConnector(display.updateTimeDisplay)
     self.titleConn = GenericConnector(display.setTitle)
     self.reset = False
     self.ready = True
     self.pause = False
 def __init__(self, parent):
     QLabel.__init__(self)
     self.data = None
     self.padding = 10
     self.leftPadding = 30
     self.maxX = None
     self.currentPoints = None
     self.closestPoint = None
     self.currentPoint = 0
     self.seek = GenericConnector(parent.analyser.seek)
     self.setMouseTracking(True)
     self.setSizePolicy(
         QSizePolicy(QSizePolicy.Ignored, QSizePolicy.Ignored))
    def __init__(self, parent):
        QWidget.__init__(self)
        self.parent = parent
        self.setSizePolicy(
            QSizePolicy(QSizePolicy.Minimum, QSizePolicy.Minimum))

        files = os.listdir('../data/processed/')

        fullPaths = []
        for file in files:
            fullPath = '../data/processed/' + file
            fullPaths.append(fullPath)

        files = self.parent.sortFiles(fullPaths)
        files = self.parent.addPreviews(files, ready=True)

        self.stopFeedConn = GenericConnector(
            self.parent.viewer.analyser.resetFeed)

        self.update()
Beispiel #7
0
    def __init__(self,
                 camera=None,
                 display=None,
                 mainDisplay=None,
                 deferredMode=False,
                 filePath=None,
                 layoutHandler=None,
                 imageMode=False):
        Thread.__init__(self)

        self.layoutHandler = layoutHandler

        if self.layoutHandler is not None:
            self.updateConnector = GenericConnector(layoutHandler.updateLayout)

        self.end = False
        self.frames = deque()
        self.nextFrame = None

        self.camera = camera
        self.display = display
        self.deferredMode = deferredMode
        self.imageMode = imageMode
        self.filePath = filePath

        if display is not None:
            self.displayConn = DisplayConnector(display)
            self.mainDisplayConn = DisplayConnector(mainDisplay)
            self.mainDisplay = mainDisplay

        self.serverAddr = 'tcp://35.204.135.105'
        self.localAddr = 'tcp://127.0.0.1'
        self.mainAddr = self.serverAddr
        self.initPort = ':5000'

        self.total = 0