Exemplo n.º 1
0
 def __update_spectrogram(self):
     spectrogram = Spectrogram(self.device.data)
     spectrogram.data_min = -80
     spectrogram.data_max = 10
     scene = self.ui.graphicsViewSpectrogram.scene()
     pixmap = QPixmap.fromImage(spectrogram.create_spectrogram_image(transpose=True))
     scene.addPixmap(pixmap).moveBy(0, self.spectrogram_y_pos)
     self.spectrogram_y_pos += pixmap.height()
     if self.spectrogram_y_pos >= scene.sceneRect().height():
         scene.setSceneRect(0, 0, Spectrogram.DEFAULT_FFT_WINDOW_SIZE, self.spectrogram_y_pos)
         self.ui.graphicsViewSpectrogram.verticalScrollBar().setValue(
             self.ui.graphicsViewSpectrogram.verticalScrollBar().maximum())
Exemplo n.º 2
0
 def __update_spectrogram(self):
     spectrogram = Spectrogram(self.device.data)
     spectrogram.data_min = -80
     spectrogram.data_max = 10
     scene = self.ui.graphicsViewSpectrogram.scene()
     pixmap = QPixmap.fromImage(spectrogram.create_spectrogram_image(transpose=True))
     pixmap_item = scene.addPixmap(pixmap)
     pixmap_item.moveBy(0, self.spectrogram_y_pos)
     self.spectrogram_y_pos += pixmap.height()
     if self.spectrogram_y_pos >= scene.sceneRect().height():
         scene.setSceneRect(0, 0, Spectrogram.DEFAULT_FFT_WINDOW_SIZE, self.spectrogram_y_pos)
         self.ui.graphicsViewSpectrogram.ensureVisible(pixmap_item)
Exemplo n.º 3
0
    def __update_spectrogram(self):
        spectrogram = Spectrogram(self.device.data,
                                  overlap_factor=self.my_overlap_factor)
        spectrogram.data_min = -80
        spectrogram.data_max = 10
        scene = self.ui.graphicsViewSpectrogram.scene()
        pixmap = QPixmap.fromImage(
            spectrogram.create_spectrogram_image(transpose=True))
        pixmap_item = scene.addPixmap(pixmap)
        self.my_mass_vodopad.append(pixmap)
        pixmap_item.moveBy(0, self.spectrogram_y_pos)
        self.spectrogram_y_pos += pixmap.height()

        if self.spectrogram_y_pos >= scene.sceneRect().height():

            while sum(map(lambda x: x.height(),
                          self.my_mass_vodopad)) >= 20480:
                scene.setSceneRect(0, 0, Spectrogram.DEFAULT_FFT_WINDOW_SIZE,
                                   self.spectrogram_y_pos)
                self.ui.graphicsViewSpectrogram.ensureVisible(pixmap_item)

                scene.removeItem(scene.items().pop(-1))
                self.my_mass_vodopad.pop(-1)