コード例 #1
0
    def __init__(self, *args):
        BaseWidget.__init__(self, *args)

        # Hardware objects ----------------------------------------------------

        # Internal values -----------------------------------------------------
        self.use_dialog = False

        # Properties ----------------------------------------------------------
        self.add_property("mnemonicList", "string", "")

        # Signals ------------------------------------------------------------

        # Slots ---------------------------------------------------------------

        # Graphic elements ----------------------------------------------------
        self.progress_type_label = QtImport.QLabel("", self)
        self.progress_bar = QtImport.QProgressBar(self)
        # $self.progress_bar.setCenterIndicator(True)
        self.progress_bar.setMinimum(0)

        main_layout = QtImport.QVBoxLayout(self)
        main_layout.addWidget(self.progress_type_label)
        main_layout.addWidget(self.progress_bar)
        main_layout.setContentsMargins(2, 2, 2, 2)
        main_layout.setSpacing(2)
        self.setEnabled(False)

        new_palette = QtImport.QPalette()
        new_palette.setColor(QtImport.QPalette.Highlight, Colors.DARK_GREEN)
        self.progress_bar.setPalette(new_palette)
コード例 #2
0
    def __init__(self, pixmap):
        """Builds a splash screen with a image and a progressbar"""

        QtImport.QSplashScreen.__init__(self, pixmap)

        self._message = ""
        self.gui_name = None

        self.top_x = 10
        self.top_y = 430
        self.right_x = 390
        self.pxsize = 11

        self.progress_bar = QtImport.QProgressBar(self)

        new_palette = QtImport.QPalette()
        new_palette.setColor(QtImport.QPalette.Highlight, Colors.DARK_GREEN)
        self.progress_bar.setPalette(new_palette)

        _vlayout = QtImport.QVBoxLayout(self)
        _vlayout.addWidget(self.progress_bar)

        self.repaint()
コード例 #3
0
ファイル: SCViewBrick.py プロジェクト: natxo14/mxcube
    def __init__(self, *args):

        BaseWidget.__init__(self, *args)

        # Hardware objects ----------------------------------------------------

        # Internal values -----------------------------------------------------
        self.axis_camera = None
        self.sc_camera = None

        # Properties ----------------------------------------------------------
        self.add_property("hwobj_axis_camera", "string", "")
        self.add_property("hwobj_sc_camera", "string", "")

        # Signals -------------------------------------------------------------

        # Slots ---------------------------------------------------------------

        # Graphic elements ----------------------------------------------------
        status_widget = QtImport.QWidget(self)
        status_label = QtImport.QLabel("Status: ", status_widget)
        self.status_ledit = QtImport.QLineEdit(status_widget)

        self.camera_live_cbx = QtImport.QCheckBox("Live view", self)
        self.camera_live_cbx.setChecked(False)

        self.progress_bar = QtImport.QProgressBar(self)
        self.progress_bar.setMinimum(0)

        camera_widget = QtImport.QWidget(self)

        self.axis_view = QtImport.QGraphicsView(camera_widget)
        axis_scene = QtImport.QGraphicsScene(self.axis_view)
        self.axis_view.setScene(axis_scene)
        self.axis_camera_pixmap_item = QtImport.QGraphicsPixmapItem()
        axis_scene.addItem(self.axis_camera_pixmap_item)

        self.sc_view = QtImport.QGraphicsView(camera_widget)
        sc_scene = QtImport.QGraphicsScene(self.sc_view)
        self.sc_view.setScene(sc_scene)
        self.sc_camera_pixmap_item = QtImport.QGraphicsPixmapItem()
        sc_scene.addItem(self.sc_camera_pixmap_item)

        # Layout --------------------------------------------------------------
        _status_widget_hlayout = QtImport.QHBoxLayout(status_widget)
        _status_widget_hlayout.addWidget(status_label)
        _status_widget_hlayout.addWidget(self.status_ledit)

        _camera_widget_hlayout = QtImport.QHBoxLayout(camera_widget)
        _camera_widget_hlayout.addWidget(self.axis_view)
        _camera_widget_hlayout.addWidget(self.sc_view)

        _main_vlayout = QtImport.QVBoxLayout(self)
        _main_vlayout.addWidget(status_widget)
        _main_vlayout.addWidget(self.camera_live_cbx)
        _main_vlayout.addWidget(camera_widget)
        _main_vlayout.addWidget(self.progress_bar)
        _main_vlayout.setSpacing(0)
        _main_vlayout.setContentsMargins(2, 2, 2, 2)

        # SizePolicies --------------------------------------------------------

        # Qt signal/slot connections ------------------------------------------
        self.camera_live_cbx.stateChanged.connect(
            self.camera_live_state_changed)

        if HWR.beamline.sample_changer is not None:
            self.connect(
                HWR.beamline.sample_changer,
                SampleChanger.STATUS_CHANGED_EVENT,
                self.sample_changer_status_changed,
            )
            self.connect(HWR.beamline.sample_changer, "progressInit",
                         self.init_progress)
            self.connect(HWR.beamline.sample_changer, "progressStep",
                         self.step_progress)
            self.connect(HWR.beamline.sample_changer, "progressStop",
                         self.stop_progress)