Beispiel #1
0
    def clearConsoleGrid(self):
        if len(self.thumbPanels) > 1:  # don't remove the 0th element
            maxcount = len(self.thumbPanels) - 1
            for mon_count in range(
                    maxcount, 0, -1
            ):  # destroy old previewPanel objects or they will keep playing
                # reverse order avoids issues with list renumbering
                #                self.thumbPanels[mon_count].trackedMonitor.keepPlaying = False        # no video
                #                self.thumbPanels[mon_count].thumbPanels.console.playTimer.Stop()       # timers aren't needed for consoles
                self.trackedConsoles[mon_count].Hide()
                self.trackedConsoles[mon_count].Destroy(
                )  # prevents doubled up panels and flickering
                self.thumbPanels[mon_count]._Thread__stop()
                del self.thumbPanels[
                    mon_count]  # delete the objects from the list.
                del self.trackedConsoles[
                    mon_count]  # delete the objects from the list.
                del self.trackedMonitors[
                    mon_count]  # delete the objects from the list.

            gbl.del_started_item(gbl.threadsStarted,
                                 gbl.mon_ID)  ###### for debugging
            gbl.del_started_item(gbl.timersStarted,
                                 gbl.mon_ID)  ###### for debugging

        self.thumbGridSizer.Clear()  # clear out gridsizer
Beispiel #2
0
    def onNextFrame(
        self_MP, evt
    ):  # -------------------------------------------------- captures next frame
        self_MP.frame = self_MP.captureVideo.getImage()

        if self_MP.frame is None:
            gbl.statbar.SetStatusText('Reached end of file. Monitor %d' %
                                      gbl.mon_ID)
            self_MP.keepPlaying = False
            self_MP.playTimer.Stop()
            winsound.Beep(600, 200)
            gbl.del_started_item(gbl.timersStarted,
                                 self_MP.mon_ID)  ###### debug
            return

        frame2 = np.multiply(
            self_MP.frame.copy(),
            self_MP.ROIframe)  # apply mask (like PlayMonitor function)
        frame3 = np.add(frame2.copy(), self_MP.redmask)
        self_MP.newframe = cv2.resize(
            frame3.copy(),
            dsize=self_MP.size)  # resize the frame before copy from buffer
        # too large a frame will be corrupted

        try:  # ------ copy from buffer may fail
            self_MP.bmp.CopyFromBuffer(self_MP.newframe.tostring()
                                       )  # copies data from buffer to bitmap
            self_MP.Refresh()  # triggers EVT_PAINT

        except:
            gbl.statbar.SetStatusText('Could not paint image.')
            self_MP.keepPlaying = False
    def clearVideo(self):
        # don't save nicknames, you don't know whose been using them
        # -------------------------------------------------------------------------------------- stop old monitor panel  TODO: Update mask & settings
        try:  # ------ object may have been deleted earlier
            self.previewPanel.keepPlaying = False
            self.previewPanel.playTimer.Stop()
            self.previewPanel.Hide()  # don't destroy the panel
        except:
            print('preview panel can' 't be cleared.')
            pass

        self.videoSizer.Clear()

        gbl.del_started_item(gbl.timersStarted,
                             self.mon_ID)  ###### for debugging
Beispiel #4
0
    def clearThumbGrid(self):
        if len(self.thumbPanels) > 1:        # don't remove the 0th element
            for gbl.mon_ID in range(len(self.thumbPanels) -1, 0, -1):     # destroy old previewPanel objects or they will keep playing
                                                            # reverse order avoids issues with list renumbering
                self.thumbPanels[gbl.mon_ID]._Thread__stop()
                self.thumbPanels[gbl.mon_ID].monitorPanel.keepPlaying = False        # stop playing video                       ###### checks out 1,2,3
                self.thumbPanels[gbl.mon_ID].monitorPanel.playTimer.Stop()
                self.thumbPanels[gbl.mon_ID].monitorPanel.Hide()
                self.thumbPanels[gbl.mon_ID].monitorPanel.Destroy()         # prevents doubled up images & flickering
                del self.thumbPanels[gbl.mon_ID]                    # delete the objects from the list.

                gbl.del_started_item(gbl.threadsStarted, gbl.mon_ID)                                                        ###### for debugging
                gbl.del_started_item(gbl.timersStarted, gbl.mon_ID)                                                        ###### for debugging

        self.thumbGridSizer.Clear()                          # clear out gridsizer