def __init__(self, parent=None, name="task_toolbox"): QtGui.QWidget.__init__(self, parent) self.setObjectName = name # Hardware objects ---------------------------------------------------- self.graphics_manager_hwobj = None # Internal variables -------------------------------------------------- self.tree_brick = None self.previous_page_index = 0 self.is_running = None # Graphic elements ---------------------------------------------------- self.method_label = QtGui.QLabel("Collection method", self) self.method_label.setAlignment(QtCore.Qt.AlignCenter) #Qt4_widget_colors.set_widget_color(self.method_label, # Qt4_widget_colors.SKY_BLUE) #font = self.method_group_box.font() #font.setPointSize(10) #self.method_group_box.setFont(font) self.tool_box = QtGui.QToolBox(self) self.tool_box.setObjectName("tool_box") self.tool_box.setFixedWidth(475) #self.tool_box.setFont(font) 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") self.advanced_page = CreateAdvancedWidget(self.tool_box, "advanced_scan") 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") self.tool_box.addItem(self.advanced_page, "Advanced") self.button_box = QtGui.QWidget(self) self.create_task_button = QtGui.QPushButton(" Add to queue", self.button_box) self.create_task_button.setIcon(Qt4_Icons.load_icon("add_row.png")) msg = "Add the collection method to the selected sample" self.create_task_button.setToolTip(msg) self.collect_now_button = QtGui.QPushButton("Collect Now", self.button_box) self.collect_now_button.setIcon(Qt4_Icons.load_icon("VCRPlay2.png")) self.collect_now_button.hide() # Layout -------------------------------------------------------------- #_method_group_box_vlayout = QtGui.QVBoxLayout(self.method_group_box) #_method_group_box_vlayout.addWidget(self.tool_box) #_method_group_box_vlayout.setSpacing(2) #_method_group_box_vlayout.setContentsMargins(2, 2, 2, 2) _button_box_hlayout = QtGui.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 = QtGui.QVBoxLayout(self) _main_vlayout.addWidget(self.method_label) _main_vlayout.addWidget(self.tool_box) #_main_vlayout.addStretch(0) _main_vlayout.addWidget(self.button_box) _main_vlayout.setSpacing(0) _main_vlayout.setContentsMargins(0, 0, 0, 0) # SizePolicies -------------------------------------------------------- self.setSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.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)
def __init__(self, parent = None, name="task_toolbox"): QWidget.__init__(self, parent) self.setObjectName = name # Hardware objects ---------------------------------------------------- self.graphics_manager_hwobj = None # 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 # Graphic elements ---------------------------------------------------- self.method_label = QLabel("Collection method", self) self.method_label.setAlignment(Qt.AlignCenter) self.tool_box = 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 hasattr(parent.getHardwareObject('beamline-setup'), 'gphl_workflow_hwobj'): 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.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.button_box = QWidget(self) self.create_task_button = QPushButton(" Add to queue", self.button_box) self.create_task_button.setIcon(Qt4_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 = QPushButton("Collect Now", self.button_box) self.collect_now_button.setIcon(Qt4_Icons.load_icon("VCRPlay2.png")) self.collect_now_button.setToolTip( "Add the collection method to the queue and execute it") # Layout -------------------------------------------------------------- _button_box_hlayout = 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 = QVBoxLayout(self) _main_vlayout.addWidget(self.method_label) _main_vlayout.addWidget(self.tool_box) _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)
def __init__(self, parent = None, name = "task_toolbox"): QtGui.QWidget.__init__(self, parent) self.setObjectName = name # LNLS self.parent = parent # Hardware objects ---------------------------------------------------- self.graphics_manager_hwobj = None # Internal variables -------------------------------------------------- self.tree_brick = None self.previous_page_index = 0 # Graphic elements ---------------------------------------------------- self.method_group_box = QtGui.QGroupBox(" Collection method", self) font = self.method_group_box.font() font.setPointSize(10) self.method_group_box.setFont(font) # ------------------------------------------------------- # LNLS style_string = """QToolBox { background-color: rgb(0,128,255); }""" self.setStyleSheet(style_string) # ------------------------------------------------------- self.tool_box = QtGui.QToolBox(self.method_group_box) self.tool_box.setObjectName("tool_box") self.tool_box.setFixedWidth(475) # LNLS self.tool_box.setFixedHeight(705) self.tool_box.setFont(font) self.discrete_page = CreateDiscreteWidget(self.tool_box, "Discrete", parent_class=self) # LNLS #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", parent_class=self) #self.xrf_spectrum_page = CreateXRFSpectrumWidget(self.tool_box, "xrf_spectrum") #self.advanced_page = CreateAdvancedWidget(self.tool_box, "advanced_scan") self.tool_box.addItem(self.discrete_page, QtGui.QIcon(Qt4_Icons.load("down_small.png")), "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, QtGui.QIcon(Qt4_Icons.load("down_small.png")), "Energy Scan") #self.tool_box.addItem(self.xrf_spectrum_page, "XRF Spectrum") #self.tool_box.addItem(self.advanced_page, "Advanced") self.button_box = QtGui.QWidget(self) self.create_task_button = QtGui.QPushButton(" Add to queue", self.button_box) self.create_task_button.setIcon(QtGui.QIcon(Qt4_Icons.load("add_row.png"))) msg = "Add the collection method to the selected sample" self.create_task_button.setToolTip(msg) # Layout -------------------------------------------------------------- _method_group_box_vlayout = QtGui.QVBoxLayout(self.method_group_box) _method_group_box_vlayout.addWidget(self.tool_box) _method_group_box_vlayout.setSpacing(0) _method_group_box_vlayout.setContentsMargins(0, 0, 0, 0) _button_box_hlayout = QtGui.QHBoxLayout(self.button_box) _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 = QtGui.QVBoxLayout(self) _main_vlayout.addWidget(self.method_group_box) #_main_vlayout.addStretch(0) _main_vlayout.addWidget(self.button_box) _main_vlayout.setSpacing(0) _main_vlayout.setContentsMargins(0, 0, 0, 0) # SizePolicies -------------------------------------------------------- self.setSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding) # Qt signal/slot connections ------------------------------------------ self.create_task_button.clicked.connect(self.create_task_button_click) self.tool_box.currentChanged.connect(self.current_page_changed)
def __init__(self, parent=None, name="task_toolbox"): QtGui.QWidget.__init__(self, parent) self.setObjectName = name # Hardware objects ---------------------------------------------------- self.graphics_manager_hwobj = None # Internal variables -------------------------------------------------- self.tree_brick = None self.previous_page_index = 0 # Graphic elements ---------------------------------------------------- self.method_group_box = QtGui.QGroupBox(" Collection method", self) font = self.method_group_box.font() font.setPointSize(10) self.method_group_box.setFont(font) self.tool_box = QtGui.QToolBox(self.method_group_box) self.tool_box.setObjectName("tool_box") self.tool_box.setFixedWidth(475) self.tool_box.setFont(font) 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_scan_page = CreateXRFScanWidget(self.tool_box, "xrf_scan") self.advanced_scan_page = CreateAdvancedScanWidget( self.tool_box, "advanced_scan") 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_scan_page, "XRF Scan") self.tool_box.addItem(self.advanced_scan_page, "Advanced") self.button_box = QtGui.QWidget(self) self.create_task_button = QtGui.QPushButton(" Add to queue", self.button_box) self.create_task_button.setIcon( QtGui.QIcon(Qt4_Icons.load("add_row.png"))) msg = "Add the collection method to the selected sample" self.create_task_button.setToolTip(msg) # Layout -------------------------------------------------------------- self.method_group_box_layout = QtGui.QVBoxLayout(self) self.method_group_box_layout.addWidget(self.tool_box) self.method_group_box_layout.setSpacing(0) self.method_group_box_layout.setContentsMargins(0, 0, 0, 0) self.method_group_box.setLayout(self.method_group_box_layout) self.button_box_layout = QtGui.QHBoxLayout(self) self.button_box_layout.addStretch(0) self.button_box_layout.addWidget(self.create_task_button) self.button_box_layout.setSpacing(0) self.button_box_layout.setContentsMargins(0, 0, 0, 0) self.button_box.setLayout(self.button_box_layout) self.main_layout = QtGui.QVBoxLayout(self) self.main_layout.addWidget(self.method_group_box) #self.main_layout.addStretch(0) self.main_layout.addWidget(self.button_box) self.main_layout.setSpacing(0) self.main_layout.setContentsMargins(0, 0, 0, 0) self.setLayout(self.main_layout) # SizePolicies -------------------------------------------------------- self.setSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding) # Qt signal/slot connections ------------------------------------------ self.create_task_button.clicked.connect(self.create_task_button_click) self.connect(self.tool_box, QtCore.SIGNAL("currentChanged( int )"), self.current_page_changed)