def __init__(self, *args): BaseWidget.__init__(self, *args) # Hardware objects ---------------------------------------------------- # Internal values ----------------------------------------------------- self.num_cols = None self.num_rows = None self.num_drops = None self.current_location = None self.plate_content = None self.xtal_map = None # Properties ---------------------------------------------------------- self.add_property("icons", "string", "") # Signals ------------------------------------------------------------- # Slots --------------------------------------------------------------- # Graphic elements ---------------------------------------------------- self.plate_navigator_widget = PlateNavigatorWidget(self) self.crims_widget = QtImport.load_ui_file( "plate_crims_widget_layout.ui") # Layout -------------------------------------------------------------- _main_vlayout = QtImport.QVBoxLayout(self) _main_vlayout.addWidget(self.plate_navigator_widget) _main_vlayout.addWidget(self.crims_widget) _main_vlayout.setSpacing(0) _main_vlayout.setContentsMargins(0, 0, 0, 0) # Qt signal/slot connections ------------------------------------------ self.crims_widget.search_button.clicked.connect( self.search_button_clicked) self.crims_widget.move_button.clicked.connect( self.move_to_xtal_clicked) self.crims_widget.abort_button.clicked.connect(self.abort_clicked) self.crims_widget.xtal_treewidget.currentItemChanged.connect( self.xtal_treewidget_current_item_changed) # Other --------------------------------------------------------------- self.xtal_image_graphicsscene = QtImport.QGraphicsScene(self) self.crims_widget.xtal_image_graphicsview.setScene( self.xtal_image_graphicsscene) self.xtal_image_pixmap = QtImport.QPixmap() self.xtal_image_graphics_pixmap = QtImport.QGraphicsPixmapItem() self.xtal_image_graphicsscene.addItem(self.xtal_image_graphics_pixmap) if HWR.beamline.plate_manipulator is not None: self.connect( HWR.beamline.plate_manipulator, SampleChanger.INFO_CHANGED_EVENT, self.plate_navigator_widget.refresh_plate_location, )
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)