def __init__(self, *args): BaseWidget.__init__(self, *args) # Internal variables -------------------------------------------------- # Properties ---------------------------------------------------------- #self.add_property("useImageTracking", "boolean", True) # Signals ------------------------------------------------------------ # Slots --------------------------------------------------------------- self.define_slot("populate_ssx_parameter_widget", ({})) # Graphic elements ---------------------------------------------------- self.tool_box = qt_import.QToolBox(self) self.parameters_widget = DCParametersWidget(self, "parameters_widget") #self.image_tracking_widget = ImageTrackingWidget(self.tool_box) self.advance_results_widget = AdvancedResultsWidget(self.tool_box) self.snapshot_widget = SnapshotWidget(self) self.tool_box.addItem(self.parameters_widget, "Parameters") #self.tool_box.addItem(self.results_static_view, "Results - Summary") #self.tool_box.addItem( # self.advance_results_widget, "Results - online processing" #) # Layout -------------------------------------------------------------- _main_vlayout = qt_import.QHBoxLayout(self) _main_vlayout.addWidget(self.tool_box) _main_vlayout.addWidget(self.snapshot_widget)
def __init__(self, parent=None, name=None, fl=0): qt_import.QWidget.__init__(self, parent, qt_import.Qt.WindowFlags(fl)) self.setObjectName("char_type_widget") # Hardware objects ---------------------------------------------------- # Internal variables -------------------------------------------------- # Graphic elements ---------------------------------------------------- self.charact_type_gbox = qt_import.QGroupBox(self) # Fix the widths of the widgets to make the layout look nicer, # and beacuse the qt layout engine is so tremendosly good. self.charact_type_gbox.setFixedWidth(800) self.charact_type_gbox.setFixedHeight(220) self.charact_type_tbox = qt_import.QToolBox(self.charact_type_gbox) self.routine_dc_page = RoutineDCWidgetLayout(self.charact_type_tbox) self.sad_page = SADWidgetLayout(self.charact_type_tbox) self.rad_damage_page = RadiationDamageWidgetLayout(self.charact_type_tbox) self.charact_type_tbox.addItem(self.routine_dc_page, "Routine-DC") self.charact_type_tbox.addItem(self.sad_page, "SAD") self.charact_type_tbox.addItem(self.rad_damage_page, "Radiation damage") # Layout -------------------------------------------------------------- _charact_type_gbox_vlayout = qt_import.QVBoxLayout(self.charact_type_gbox) _charact_type_gbox_vlayout.addWidget(self.charact_type_tbox) _charact_type_gbox_vlayout.addStretch(0) _charact_type_gbox_vlayout.setSpacing(0) _charact_type_gbox_vlayout.setContentsMargins(0, 0, 0, 0) _main_vlayout = qt_import.QVBoxLayout(self) _main_vlayout.addWidget(self.charact_type_gbox) _main_vlayout.addStretch(0) _main_vlayout.setSpacing(0) _main_vlayout.setContentsMargins(0, 0, 0, 0) # SizePolicies -------------------------------------------------------- # Qt signal/slot connections ------------------------------------------ self.routine_dc_page.dose_limit_cbx.toggled.connect(self.enable_dose_ledit) self.routine_dc_page.time_limit_cbx.toggled.connect(self.enable_time_ledit) self.routine_dc_page.dose_time_bgroup.buttonClicked.connect( self._toggle_time_dose ) # Other --------------------------------------------------------------- self._toggle_time_dose(self.routine_dc_page.dose_time_bgroup.checkedId())
def __init__(self, *args): BaseWidget.__init__(self, *args) # Hardware objects ---------------------------------------------------- # Internal values ----------------------------------------------------- self._data_collection = None # Properties ---------------------------------------------------------- # Signals ------------------------------------------------------------- # Slots --------------------------------------------------------------- self.define_slot("populate_advanced_widget", ({})) # Graphic elements ---------------------------------------------------- self.tool_box = qt_import.QToolBox(self) self.mesh_parameters_widget = AdvancedParametersWidget(self) self.line_parameters_widget = AdvancedParametersWidget(self) self.snapshot_widget = SnapshotWidget(self) self.tool_box.addItem(self.mesh_parameters_widget, "2D Heat map: Parameters") self.tool_box.addItem(self.line_parameters_widget, "Line scan: Parameters") # Layout -------------------------------------------------------------- _main_vlayout = qt_import.QHBoxLayout(self) _main_vlayout.addWidget(self.tool_box) _main_vlayout.addWidget(self.snapshot_widget) # SizePolicies -------------------------------------------------------- # Qt signal/slot connections ------------------------------------------ # Other --------------------------------------------------------------- self.connect(HWR.beamline.sample_view, "gridClicked", self.grid_clicked)
def __init__(self, parent=None, name=None, fl=0): qt_import.QWidget.__init__(self, parent, qt_import.Qt.WindowFlags(fl)) if not name: self.setObjectName("ReferenceImageWidget") # Hardware objects ---------------------------------------------------- # Internal variables -------------------------------------------------- # Graphic elements ---------------------------------------------------- self.group_box = qt_import.QGroupBox("Reference images", self) self.tool_box = qt_import.QToolBox(self.group_box) self.page_widget = qt_import.QWidget(self.tool_box) self.path_widget = DataPathWidget(self.page_widget) self.acq_widget = AcquisitionWidget(self.page_widget, "horizontal") self.acq_widget.acq_widget_layout.shutterless_cbx.hide() # self.acq_widget.acq_widget_layout.setFixedHeight(130) self.tool_box.addItem(self.page_widget, "Acquisition parameters") # Layout -------------------------------------------------------------- _page_widget_layout = qt_import.QVBoxLayout(self.page_widget) _page_widget_layout.addWidget(self.path_widget) _page_widget_layout.addWidget(self.acq_widget) _page_widget_layout.addStretch(0) _page_widget_layout.setSpacing(0) _page_widget_layout.setContentsMargins(0, 0, 0, 0) _group_box_vlayout = qt_import.QVBoxLayout(self.group_box) _group_box_vlayout.addWidget(self.tool_box) _group_box_vlayout.setSpacing(0) _group_box_vlayout.setContentsMargins(0, 0, 0, 0) _main_vlayout = qt_import.QVBoxLayout(self) _main_vlayout.addWidget(self.group_box) _main_vlayout.setSpacing(0) _main_vlayout.setContentsMargins(0, 0, 0, 0)
def __init__(self, parent=None, name="task_toolbox"): qt_import.QWidget.__init__(self, parent) self.setObjectName = name # Internal variables -------------------------------------------------- self.tree_brick = None self.previous_page_index = 0 self.is_running = None self.path_conflict = False self.acq_conflict = False self.enable_collect = False self.create_task_widgets = {} # Graphic elements ---------------------------------------------------- self.method_label = qt_import.QLabel("Collection method", self) self.method_label.setAlignment(qt_import.Qt.AlignCenter) self.tool_box = qt_import.QToolBox(self) self.tool_box.setObjectName("tool_box") # self.tool_box.setFixedWidth(600) self.discrete_page = CreateDiscreteWidget(self.tool_box, "Discrete") self.char_page = CreateCharWidget(self.tool_box, "Characterise") self.helical_page = CreateHelicalWidget(self.tool_box, "helical_page") self.energy_scan_page = CreateEnergyScanWidget(self.tool_box, "energy_scan") self.xrf_spectrum_page = CreateXRFSpectrumWidget( self.tool_box, "xrf_spectrum") if HWR.beamline.gphl_workflow is not None: self.gphl_workflow_page = CreateGphlWorkflowWidget( self.tool_box, "gphl_workflow") else: self.gphl_workflow_page = None self.advanced_page = CreateAdvancedWidget(self.tool_box, "advanced_scan") self.xray_imaging_page = CreateXrayImagingWidget( self.tool_box, "xray_imaging") self.ssx_page = CreateSsxWidget(self.tool_box, "ssx") self.tool_box.addItem(self.discrete_page, "Standard Collection") self.tool_box.addItem(self.char_page, "Characterisation") self.tool_box.addItem(self.helical_page, "Helical Collection") self.tool_box.addItem(self.energy_scan_page, "Energy Scan") self.tool_box.addItem(self.xrf_spectrum_page, "XRF Spectrum") if self.gphl_workflow_page is not None: self.tool_box.addItem(self.gphl_workflow_page, "GPhL Workflows") self.tool_box.addItem(self.advanced_page, "Advanced") self.tool_box.addItem(self.xray_imaging_page, "Xray Imaging") self.tool_box.addItem(self.ssx_page, "SSX") self.button_box = qt_import.QWidget(self) self.create_task_button = qt_import.QPushButton( " Add to queue", self.button_box) self.create_task_button.setIcon(icons.load_icon("add_row.png")) msg = "Add the collection method to the selected sample" self.create_task_button.setToolTip(msg) self.create_task_button.setEnabled(False) self.collect_now_button = qt_import.QPushButton( "Collect Now", self.button_box) self.collect_now_button.setIcon(icons.load_icon("VCRPlay2.png")) self.collect_now_button.setToolTip( "Add the collection method to the queue and execute it") self.comments_widget = CommentsWidget(self) self.comments_widget.setFixedHeight(100) # Layout -------------------------------------------------------------- _button_box_hlayout = qt_import.QHBoxLayout(self.button_box) _button_box_hlayout.addWidget(self.collect_now_button) _button_box_hlayout.addStretch(0) _button_box_hlayout.addWidget(self.create_task_button) _button_box_hlayout.setSpacing(0) _button_box_hlayout.setContentsMargins(0, 0, 0, 0) _main_vlayout = qt_import.QVBoxLayout(self) _main_vlayout.addWidget(self.method_label) _main_vlayout.addWidget(self.tool_box) _main_vlayout.addWidget(self.comments_widget) _main_vlayout.addWidget(self.button_box) _main_vlayout.setSpacing(0) _main_vlayout.setContentsMargins(0, 0, 0, 0) # SizePolicies -------------------------------------------------------- # self.setSizePolicy(QSizePolicy.Expanding, # QSizePolicy.Expanding) # Qt signal/slot connections ------------------------------------------ self.create_task_button.clicked.connect(self.create_task_button_click) self.collect_now_button.clicked.connect(self.collect_now_button_click) self.tool_box.currentChanged.connect(self.current_page_changed) for i in range(0, self.tool_box.count()): self.tool_box.widget(i).acqParametersConflictSignal.connect( self.acq_parameters_conflict_changed) self.tool_box.widget(i).pathTempleConflictSignal.connect( self.path_template_conflict_changed) # Other --------------------------------------------------------------- in_plate_mode = HWR.beamline.diffractometer.in_plate_mode() if (HWR.beamline.energy_scan is None or in_plate_mode or not HWR.beamline.tunable_wavelength): self.hide_task(self.energy_scan_page) logging.getLogger("HWR").info("Energy scan task not available") if HWR.beamline.xrf_spectrum is None or in_plate_mode: self.hide_task(self.xrf_spectrum_page) logging.getLogger("HWR").info("XRF spectrum task not available") if not HWR.beamline.imaging or in_plate_mode: self.hide_task(self.xray_imaging_page) logging.getLogger("HWR").info("Xray Imaging task not available") if HWR.beamline.gphl_connection and HWR.beamline.gphl_workflow: self.gphl_workflow_page.initialise_workflows() else: logging.getLogger("HWR").info("GPhL workflow task not available")