def draw_signal(self, full_signal=False): gv_legend = self.ui.gvLegend gv_legend.y_sep = -self.signal.qad_center self.scene_manager.scene_type = self.ui.cbSignalView.currentIndex() self.scene_manager.init_scene() if full_signal: self.ui.gvSignal.show_full_scene() else: self.ui.gvSignal.redraw_view() legend = LegendScene() legend.setBackgroundBrush(constants.BGCOLOR) legend.setSceneRect(0, self.scene_manager.scene.sceneRect().y(), gv_legend.width(), self.scene_manager.scene.sceneRect().height()) legend.draw_one_zero_arrows(-self.signal.qad_center) gv_legend.setScene(legend) num_samples = self.signal.num_samples self.ui.spinBoxSelectionStart.setMaximum(num_samples) self.ui.spinBoxSelectionEnd.setMaximum(num_samples) self.ui.gvSignal.nsamples = num_samples self.ui.gvSignal.sel_area_active = True self.ui.gvSignal.y_sep = -self.signal.qad_center
def draw_signal(self, full_signal=False): gv_legend = self.ui.gvLegend gv_legend.ysep = -self.signal.qad_center self.scene_manager.scene_type = self.ui.cbSignalView.currentIndex() self.scene_manager.init_scene() if full_signal: self.ui.gvSignal.show_full_scene() else: self.ui.gvSignal.redraw_view() legend = LegendScene() legend.setBackgroundBrush(constants.BGCOLOR) legend.setSceneRect(0, self.scene_manager.scene.sceneRect().y(), gv_legend.width(), self.scene_manager.scene.sceneRect().height()) legend.draw_one_zero_arrows(-self.signal.qad_center) gv_legend.setScene(legend) num_samples = self.signal.num_samples self.ui.spinBoxSelectionStart.setMaximum(num_samples) self.ui.spinBoxSelectionEnd.setMaximum(num_samples) self.ui.gvSignal.nsamples = num_samples self.ui.gvSignal.sel_area_active = True self.ui.gvSignal.y_sep = -self.signal.qad_center
def draw_signal(self, full_signal=False): gv_legend = self.ui.gvLegend gv_legend.ysep = -self.signal.qad_center # Save current visible region for restoring it after drawing y, h = self.ui.gvSignal.sceneRect().y(), self.ui.gvSignal.sceneRect( ).height() vr = self.ui.gvSignal.view_rect() x, w = vr.x(), vr.width() self.scene_manager.scene_type = self.ui.cbSignalView.currentIndex() self.scene_manager.init_scene() if full_signal: self.ui.gvSignal.show_full_scene() else: self.ui.gvSignal.redraw_view() legend = LegendScene() legend.setBackgroundBrush(constants.BGCOLOR) legend.setSceneRect(0, self.scene_manager.scene.sceneRect().y(), gv_legend.width(), self.scene_manager.scene.sceneRect().height()) legend.draw_one_zero_arrows(-self.signal.qad_center) gv_legend.setScene(legend) num_samples = self.signal.num_samples self.ui.spinBoxSelectionStart.setMaximum(num_samples) self.ui.spinBoxSelectionEnd.setMaximum(num_samples) self.ui.gvSignal.nsamples = num_samples self.ui.gvSignal.sel_area_active = True self.ui.gvSignal.y_sep = -self.signal.qad_center if not full_signal: # Restore Zoom w = w if w < self.signal.num_samples else self.signal.num_samples self.ui.gvSignal.fitInView(QRectF(x, y, w, h)) self.ui.gvSignal.centerOn(x + w / 2, self.ui.gvSignal.y_center)