def __init__(self, *args): """ Descript. : """ BlissWidget.__init__(self, *args) # Hardware objects ---------------------------------------------------- self.beamline_setup_hwobj = None self.session_hwobj = None self.beam_center_hwobj = None # Internal variables -------------------------------------------------- # Properties ---------------------------------------------------------- self.addProperty("session", "string", "/session") self.addProperty("beamline_setup", "string", "/lnls/lnls-beamline_setup") self.addProperty("mnemonic", "string", "/lnls/lnls-beam_center") # Signals ------------------------------------------------------------ # Slots --------------------------------------------------------------- # Graphic elements ---------------------------------------------------- self.beam_center_widget = BeamCenteringWidget(self, "beam_center_widget") self.stacked_widget = QtGui.QStackedWidget(self) self.stacked_widget.addWidget(self.beam_center_widget) # Layout -------------------------------------------------------------- _main_vlayout = QtGui.QVBoxLayout(self) _main_vlayout.addWidget(self.stacked_widget)
def __init__(self, *args): BlissWidget.__init__(self, *args) # Hardware objects ---------------------------------------------------- self.session_hwobj = None # Internal values ----------------------------------------------------- # Properties ---------------------------------------------------------- self.addProperty("beamline_setup", "string", "/beamline-setup") # Signals ------------------------------------------------------------- # Slots --------------------------------------------------------------- self.defineSlot("populate_advanced_widget", ({})) # Graphic elements ---------------------------------------------------- self.tool_box = QToolBox(self) self.parameters_widget = AdvancedParametersWidget(self) self.results_widget = AdvancedResultsWidget(self) self.line_parameters_widget = AdvancedParametersWidget(self) self.line_results_widget = AdvancedResultsWidget(self) self.snapshot_widget = SnapshotWidget(self) self.tool_box.addItem(self.parameters_widget, "2D Heat map: Parameters") self.tool_box.addItem(self.results_widget, "2D Heat map: Results") self.tool_box.addItem(self.line_parameters_widget, "Line scan: Parameters") self.tool_box.addItem(self.line_results_widget, "Line scan: Results") # Layout -------------------------------------------------------------- _main_vlayout = QHBoxLayout(self) _main_vlayout.addWidget(self.tool_box) _main_vlayout.addWidget(self.snapshot_widget)
def __init__(self, *args): BlissWidget.__init__(self, *args) self.statusBar = None self.specStateLabel=None self.addProperty('statusSearchDepth','integer',3) self.defineSlot('setMessage',()) self.setSizePolicy(QSizePolicy.Fixed,QSizePolicy.Fixed) # Information messages self.MAX_BUFFER_SIZE = 5 self.messages = [] self.read_idx = 0 self.insert_idx = 0 self.button = QPushButton("Add", self, "add_button") self.v_scroll = SpinBoxButtons(self, 'v_scroll') QObject.connect(self.v_scroll, "scroll_up", self.next_message) QObject.connect(self.v_scroll, "scroll_down", self.prev_message)
def __init__(self, *args): """ Descript. : """ BlissWidget.__init__(self, *args) # Hardware objects ---------------------------------------------------- self.beamline_setup_hwobj = None self.session_hwobj = None self.beam_center_hwobj = None # Internal variables -------------------------------------------------- # Properties ---------------------------------------------------------- self.addProperty("session", "string", "/session") self.addProperty("beamline_setup", "string", "/lnls/lnls-beamline_setup") self.addProperty("mnemonic", "string", "/lnls/lnls-beam_center") # Signals ------------------------------------------------------------ # Slots --------------------------------------------------------------- # Graphic elements ---------------------------------------------------- self.beam_center_widget = BeamCenteringWidget(self, "beam_center_widget") self.stacked_widget = QtGui.QStackedWidget(self) self.stacked_widget.addWidget(self.beam_center_widget) # Layout -------------------------------------------------------------- _main_vlayout = QtGui.QVBoxLayout(self) _main_vlayout.addWidget(self.stacked_widget)
def __init__(self, *args): """ Descript. : """ BlissWidget.__init__(self, *args) # Hardware objects ---------------------------------------------------- self.graphics_manager_hwobj = None # Internal values ----------------------------------------------------- self.target_menu = None # Properties ---------------------------------------------------------- self.addProperty('mnemonic', 'string', '/Qt4_graphics-manager') self.addProperty('targetMenu', 'combo', ("menuBar", "toolBar", "both"), "menuBar") self.addProperty('beamDefiner', 'boolean', False) # Signals ------------------------------------------------------------ # Slots --------------------------------------------------------------- # Graphic elements ---------------------------------------------------- self.tools_menu = None self.measure_distance_action = None self.measure_angle_action = None self.measure_area_action = None self.define_beam_action = None self.move_beam_mark_manual_action = None self.move_beam_mark_auto_action = None self.display_beam_size_action = None self.display_grid_action = None self.magnification_action = None
def __init__(self, *args): BlissWidget.__init__(self, *args) # Hardware objects ---------------------------------------------------- # Internal values ----------------------------------------------------- self.motor_hwobj_list = [] self.motor_widget_list = [] self.motor_widget_labels = [] self.predefined_positions_list = [] self.positions = None # Properties ---------------------------------------------------------- self.addProperty('mnemonic', 'string', '') self.addProperty('labels', 'string', '') self.addProperty('predefinedPositions', 'string', '') # Signals ------------------------------------------------------------- # Slots --------------------------------------------------------------- # Graphic elements ---------------------------------------------------- self.main_group_box = QtGui.QGroupBox(self) # Layout -------------------------------------------------------------- self.main_groupbox_hlayout = QtGui.QHBoxLayout(self.main_group_box) self.main_groupbox_hlayout.setSpacing(2) self.main_groupbox_hlayout.setContentsMargins(0, 0, 0, 0) self.main_hlayout = QtGui.QHBoxLayout(self) self.main_hlayout.addWidget(self.main_group_box) self.main_hlayout.setSpacing(2) self.main_hlayout.setContentsMargins(2, 2, 2, 2)
def __init__(self, *args): BlissWidget.__init__(self, *args) # Hardware objects ---------------------------------------------------- self.session_hwobj = None # Internal values ----------------------------------------------------- # Properties ---------------------------------------------------------- self.addProperty("beamline_setup", "string", "/beamline-setup") # Signals ------------------------------------------------------------- # Slots --------------------------------------------------------------- self.defineSlot("populate_advanced_widget", ({})) # Graphic elements ---------------------------------------------------- self.tool_box = QToolBox(self) self.parameters_widget = AdvancedParametersWidget(self) self.results_widget = AdvancedResultsWidget(self) self.snapshot_widget = SnapshotWidget(self) self.tool_box.addItem(self.parameters_widget, "Parameters") self.tool_box.addItem(self.results_widget, "Results - Heat map") # Layout -------------------------------------------------------------- _main_vlayout = QHBoxLayout(self) _main_vlayout.addWidget(self.tool_box) _main_vlayout.addWidget(self.snapshot_widget)
def __init__(self, *args): BlissWidget.__init__(self, *args) self.statusBar = None self.specStateLabel=None self.addProperty('statusSearchDepth','integer',3) self.defineSlot('setMessage',()) self.setSizePolicy(QSizePolicy.Fixed,QSizePolicy.Fixed) # Information messages self.MAX_BUFFER_SIZE = 5 self.messages = [] self.read_idx = 0 self.insert_idx = 0 self.button = QPushButton("Add", self, "add_button") self.v_scroll = SpinBoxButtons(self, 'v_scroll') QObject.connect(self.v_scroll, "scroll_up", self.next_message) QObject.connect(self.v_scroll, "scroll_down", self.prev_message)
def __init__(self, *args): """ Descript. : """ BlissWidget.__init__(self, *args) # Hardware objects ---------------------------------------------------- self.collect_hwobj = None # Internal values ----------------------------------------------------- self.number_of_steps = 0 # Properties ---------------------------------------------------------- self.addProperty('mnemonicList', 'string', '') # Signals ------------------------------------------------------------ # Slots --------------------------------------------------------------- # Graphic elements ---------------------------------------------------- self.progress_type_label = QLabel('', self) self.progress_bar = QProgressBar(self) #$self.progress_bar.setCenterIndicator(True) self.progress_bar.setMinimum(0) main_layout = 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)
def __init__(self, *args): BlissWidget.__init__(self, *args) # Hardware objects ---------------------------------------------------- self.motor_hwobj = None # Internal values ----------------------------------------------------- self.positions = None # Properties ---------------------------------------------------------- self.addProperty('label', 'string', '') self.addProperty('mnemonic', 'string', '') self.addProperty('icons', 'string', '') self.addProperty('showMoveButtons', 'boolean', True) # Signals ------------------------------------------------------------- # Slots --------------------------------------------------------------- self.defineSlot('setEnabled', ()) # Graphic elements ---------------------------------------------------- _group_box = QGroupBox(self) self.label = QLabel("motor:", _group_box) self.positions_combo = QComboBox(_group_box) self.previous_position_button = QPushButton(_group_box) self.next_position_button = QPushButton(_group_box) # Layout -------------------------------------------------------------- _group_box_hlayout = QHBoxLayout(_group_box) _group_box_hlayout.addWidget(self.label) _group_box_hlayout.addWidget(self.positions_combo) _group_box_hlayout.addWidget(self.previous_position_button) _group_box_hlayout.addWidget(self.next_position_button) _group_box_hlayout.setSpacing(2) _group_box_hlayout.setContentsMargins(2, 2, 2, 2) main_layout = QHBoxLayout(self) main_layout.addWidget(_group_box) main_layout.setSpacing(0) main_layout.setContentsMargins(0, 0, 0, 0) # Size Policy --------------------------------------------------------- #box1.setSizePolicy(QtGui.QSizePolicy.Fixed, # QtGui.QSizePolicy.Fixed) self.label.setSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed) #self.setSizePolicy(QtGui.QSizePolicy.Minimum, # QtGui.QSizePolicy.Fixed) # Qt signal/slot connections ------------------------------------------ self.positions_combo.activated.connect(self.position_selected) self.previous_position_button.clicked.connect( self.select_previous_position) self.next_position_button.clicked.connect(self.select_next_position) # Other --------------------------------------------------------------- self.positions_combo.setToolTip( "Moves the motor to a predefined position") self.previous_position_button.setIcon(Qt4_Icons.load_icon('Minus2')) self.previous_position_button.setFixedWidth(27) self.next_position_button.setIcon(Qt4_Icons.load_icon('Plus2')) self.next_position_button.setFixedWidth(27)
def __init__(self, *args): """ Descript. : """ BlissWidget.__init__(self, *args) # Hardware objects ---------------------------------------------------- self.collect_hwobj = None # Internal values ----------------------------------------------------- self.number_of_steps = 0 # Properties ---------------------------------------------------------- self.addProperty('mnemonicList', 'string', '') # Signals ------------------------------------------------------------ # Slots --------------------------------------------------------------- # Graphic elements ---------------------------------------------------- self.progress_type_label = QtGui.QLabel('', self) self.progress_bar = QtGui.QProgressBar(self) #$self.progress_bar.setCenterIndicator(True) self.progress_bar.setMinimum(0) main_layout = QtGui.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)
def __init__(self, *args): BlissWidget.__init__(self, *args) # Hardware objects ---------------------------------------------------- # Internal values ----------------------------------------------------- self.motor_hwobj_list = [] self.motor_widget_list = [] self.motor_widget_labels = [] self.predefined_positions_list = [] self.positions = None # Properties ---------------------------------------------------------- self.addProperty('mnemonic', 'string', '') self.addProperty('labels','string','') self.addProperty('predefinedPositions', 'string', '') # Signals ------------------------------------------------------------- # Slots --------------------------------------------------------------- # Graphic elements ---------------------------------------------------- self.main_group_box = QtGui.QGroupBox(self) # Layout -------------------------------------------------------------- self.main_groupbox_hlayout = QtGui.QHBoxLayout(self.main_group_box) self.main_groupbox_hlayout.setSpacing(2) self.main_groupbox_hlayout.setContentsMargins(0, 0, 0, 0) self.main_hlayout = QtGui.QHBoxLayout(self) self.main_hlayout.addWidget(self.main_group_box) self.main_hlayout.setSpacing(2) self.main_hlayout.setContentsMargins(2, 2, 2, 2)
def __init__(self, *args): """ Descript. : """ BlissWidget.__init__(self, *args) # Hardware objects ---------------------------------------------------- # Internal values ----------------------------------------------------- self.max_log_lines = -1 # Properties ---------------------------------------------------------- self.addProperty('maxLogLines', 'integer', -1) # Signals ------------------------------------------------------------- # Slots --------------------------------------------------------------- # Graphic elements ---------------------------------------------------- self._status_bar_widget = LogBarWidget(self) # Layout -------------------------------------------------------------- _main_hlayout = QHBoxLayout(self) _main_hlayout.addWidget(self._status_bar_widget) _main_hlayout.setSpacing(0) _main_hlayout.setContentsMargins(2, 2, 2, 2) # SizePolicies -------------------------------------------------------- self.setSizePolicy(QSizePolicy.MinimumExpanding, QSizePolicy.Fixed) # Qt signal/slot connections ------------------------------------------ # Other --------------------------------------------------------------- Qt4_GUILogHandler.GUILogHandler().register(self)
def __init__(self, *args): """ Descript. : """ BlissWidget.__init__(self, *args) # Hardware objects ---------------------------------------------------- # Internal values ----------------------------------------------------- self.max_log_lines = -1 # Properties ---------------------------------------------------------- self.addProperty('maxLogLines', 'integer', -1) # Signals ------------------------------------------------------------- # Slots --------------------------------------------------------------- # Graphic elements ---------------------------------------------------- self._status_bar_widget = LogBarWidget(self) # Layout -------------------------------------------------------------- _main_hlayout = QHBoxLayout(self) _main_hlayout.addWidget(self._status_bar_widget) _main_hlayout.setSpacing(0) _main_hlayout.setContentsMargins(2, 2, 2, 2) # SizePolicies -------------------------------------------------------- # Qt signal/slot connections ------------------------------------------ # Other --------------------------------------------------------------- Qt4_GUILogHandler.GUILogHandler().register(self)
def __init__(self, *args): """ Descript. : """ BlissWidget.__init__(self, *args) # Hardware objects ---------------------------------------------------- self.graphics_manager_hwobj = None # Internal values ----------------------------------------------------- self.target_menu = None # Properties ---------------------------------------------------------- self.addProperty('mnemonic', 'string', '/Qt4_graphics-manager') self.addProperty('targetMenu', 'combo', ("menuBar", "toolBar", "both"), "menuBar") self.addProperty('beamDefiner', 'boolean', False) # Signals ------------------------------------------------------------ # Slots --------------------------------------------------------------- # Graphic elements ---------------------------------------------------- self.define_beam_action = None self.move_beam_mark_manual_action = None self.move_beam_mark_auto_action = None
def __init__(self, *args): """ Descript. : """ BlissWidget.__init__(self, *args) # Hardware objects ---------------------------------------------------- self.detector_hwobj = None # Internal variables -------------------------------------------------- # Properties ---------------------------------------------------------- self.addProperty('mnemonic', 'string', '') #self.defineSlot('collectStarted',()) # Signals ------------------------------------------------------------ # Slots --------------------------------------------------------------- # Graphic elements ---------------------------------------------------- _main_groupbox = QGroupBox("Detector status", self) self.status_label = QLabel("<b>unknown status</b>", _main_groupbox) self.frame_rate_label = QLabel(" Frame rate : ", _main_groupbox) self.temperature_label = QLabel(" Temperature:", _main_groupbox) self.humidity_label = QLabel(" Humidity: ", _main_groupbox) # Layout -------------------------------------------------------------- _main_groupbox_vlayout = QVBoxLayout(_main_groupbox) _main_groupbox_vlayout.addWidget(self.status_label) _main_groupbox_vlayout.addWidget(self.frame_rate_label) _main_groupbox_vlayout.addWidget(self.temperature_label) _main_groupbox_vlayout.addWidget(self.humidity_label) _main_groupbox_vlayout.setSpacing(2) _main_groupbox_vlayout.setContentsMargins(4, 4, 4, 4) main_layout = QVBoxLayout(self) main_layout.addWidget(_main_groupbox) main_layout.setSpacing(0) main_layout.setContentsMargins(0, 0, 0, 0) # SizePolicies ------------------------------------------------------- # Qt signal/slot connections ------------------------------------------ # Other --------------------------------------------------------------- Qt4_widget_colors.set_widget_color( self.status_label, Qt4_DetectorStatusBrick.DETECTOR_STATES['uninitialized']) Qt4_widget_colors.set_widget_color( self.temperature_label, Qt4_DetectorStatusBrick.STATES['unknown']) Qt4_widget_colors.set_widget_color( self.humidity_label, Qt4_DetectorStatusBrick.STATES['unknown']) Qt4_widget_colors.set_widget_color( self.frame_rate_label, Qt4_DetectorStatusBrick.STATES['OK']) self.status_label.setMinimumHeight(20) self.status_label.setAlignment(Qt.AlignCenter) self.temperature_label.setMinimumHeight(20) self.humidity_label.setMinimumHeight(20) self.frame_rate_label.setMinimumHeight(20)
def __init__(self, *args): BlissWidget.__init__(self, *args) # Hardware objects ---------------------------------------------------- self.motor_hwobj = None # Internal values ----------------------------------------------------- self.positions = None # Properties ---------------------------------------------------------- self.addProperty('label','string','') self.addProperty('mnemonic', 'string', '') self.addProperty('icons', 'string', '') self.addProperty('showMoveButtons', 'boolean', True) # Signals ------------------------------------------------------------- # Slots --------------------------------------------------------------- self.defineSlot('setEnabled',()) # Graphic elements ---------------------------------------------------- _group_box = QtGui.QGroupBox(self) self.label = QtGui.QLabel("motor:", _group_box) self.positions_combo = QtGui.QComboBox(_group_box) self.previous_position_button = QtGui.QPushButton(_group_box) self.next_position_button = QtGui.QPushButton(_group_box) # Layout -------------------------------------------------------------- _group_box_hlayout = QtGui.QHBoxLayout(_group_box) _group_box_hlayout.addWidget(self.label) _group_box_hlayout.addWidget(self.positions_combo) _group_box_hlayout.addWidget(self.previous_position_button) _group_box_hlayout.addWidget(self.next_position_button) _group_box_hlayout.setSpacing(2) _group_box_hlayout.setContentsMargins(2, 2, 2, 2) main_layout = QtGui.QHBoxLayout(self) main_layout.addWidget(_group_box) main_layout.setSpacing(0) main_layout.setContentsMargins(0, 0, 0, 0) # Size Policy --------------------------------------------------------- #box1.setSizePolicy(QtGui.QSizePolicy.Fixed, # QtGui.QSizePolicy.Fixed) self.label.setSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed) #self.setSizePolicy(QtGui.QSizePolicy.Minimum, # QtGui.QSizePolicy.Fixed) # Qt signal/slot connections ------------------------------------------ self.positions_combo.activated.connect(self.position_selected) self.previous_position_button.clicked.connect(self.select_previous_position) self.next_position_button.clicked.connect(self.select_next_position) # Other --------------------------------------------------------------- self.positions_combo.setToolTip("Moves the motor to a predefined position") self.previous_position_button.setIcon(Qt4_Icons.load_icon('Minus2')) self.previous_position_button.setFixedWidth(27) self.next_position_button.setIcon(Qt4_Icons.load_icon('Plus2')) self.next_position_button.setFixedWidth(27)
def __init__(self, *args): """ Descript. : """ BlissWidget.__init__(self, *args) # Hardware objects ---------------------------------------------------- self.detector_hwobj = None # Internal variables -------------------------------------------------- # Properties ---------------------------------------------------------- self.addProperty('mnemonic', 'string', '') #self.defineSlot('collectStarted',()) # Signals ------------------------------------------------------------ # Slots --------------------------------------------------------------- # Graphic elements ---------------------------------------------------- _main_groupbox = QGroupBox("Detector status", self) self.status_label = QLabel("<b>unknown status</b>", _main_groupbox) self.frame_rate_label = QLabel(" Frame rate : ", _main_groupbox) self.temperature_label = QLabel(" Temperature:", _main_groupbox) self.humidity_label = QLabel(" Humidity: ", _main_groupbox) # Layout -------------------------------------------------------------- _main_groupbox_vlayout = QVBoxLayout(_main_groupbox) _main_groupbox_vlayout.addWidget(self.status_label) _main_groupbox_vlayout.addWidget(self.frame_rate_label) _main_groupbox_vlayout.addWidget(self.temperature_label) _main_groupbox_vlayout.addWidget(self.humidity_label) _main_groupbox_vlayout.setSpacing(2) _main_groupbox_vlayout.setContentsMargins(4, 4, 4, 4) main_layout = QVBoxLayout(self) main_layout.addWidget(_main_groupbox) main_layout.setSpacing(0) main_layout.setContentsMargins(0, 0, 0, 0) # SizePolicies ------------------------------------------------------- # Qt signal/slot connections ------------------------------------------ # Other --------------------------------------------------------------- Qt4_widget_colors.set_widget_color(self.status_label, Qt4_DetectorStatusBrick.DETECTOR_STATES['uninitialized']) Qt4_widget_colors.set_widget_color(self.temperature_label, Qt4_DetectorStatusBrick.STATES['unknown']) Qt4_widget_colors.set_widget_color(self.humidity_label, Qt4_DetectorStatusBrick.STATES['unknown']) Qt4_widget_colors.set_widget_color(self.frame_rate_label, Qt4_DetectorStatusBrick.STATES['OK']) self.status_label.setMinimumHeight(20) self.status_label.setAlignment(Qt.AlignCenter) self.temperature_label.setMinimumHeight(20) self.humidity_label.setMinimumHeight(20) self.frame_rate_label.setMinimumHeight(20)
def __init__(self, *args): """ Descript. : Initiates BlissWidget Brick """ BlissWidget.__init__(self, *args) # Hardware objects ---------------------------------------------------- self.attenuators_hwobj = None # Internal variables -------------------------------------------------- # Properties ---------------------------------------------------------- self.addProperty('mnemonic', 'string', '') self.addProperty('mockup_mnemonic', 'string', '') self.addProperty('formatString', 'formatString', '###.##') # Signals ------------------------------------------------------------ # Slots --------------------------------------------------------------- # Graphic elements ---------------------------------------------------- self.group_box = QGroupBox("Transmission", self) current_label = QLabel("Current:", self.group_box) current_label.setFixedWidth(75) self.transmission_ledit = QLineEdit(self.group_box) self.transmission_ledit.setReadOnly(True) set_to_label = QLabel("Set to:", self.group_box) self.new_value_ledit = QLineEdit(self.group_box) # Layout -------------------------------------------------------------- _group_box_gridlayout = QGridLayout(self.group_box) _group_box_gridlayout.addWidget(current_label, 0, 0) _group_box_gridlayout.addWidget(self.transmission_ledit, 0, 1) _group_box_gridlayout.addWidget(set_to_label, 1, 0) _group_box_gridlayout.addWidget(self.new_value_ledit, 1, 1) _group_box_gridlayout.setSpacing(0) _group_box_gridlayout.setContentsMargins(1, 1, 1, 1) _main_vlayout = QVBoxLayout(self) _main_vlayout.setSpacing(0) _main_vlayout.setContentsMargins(0, 0, 2, 2) _main_vlayout.addWidget(self.group_box) # SizePolicies -------------------------------------------------------- # Qt signal/slot connections ------------------------------------------ self.new_value_ledit.returnPressed.connect(self.current_value_changed) self.new_value_ledit.textChanged.connect(self.input_field_changed) # Other --------------------------------------------------------------- Qt4_widget_colors.set_widget_color(self.new_value_ledit, Qt4_widget_colors.LINE_EDIT_ACTIVE, QPalette.Base) self.new_value_validator = QDoubleValidator(\ 0, 100, 2, self.new_value_ledit) self.new_value_ledit.setToolTip("Transmission limits 0 : 100 %") self.instance_synchronize("transmission_ledit", "new_value_ledit")
def __init__(self, *args): """ Descript. : Initiates BlissWidget Brick """ BlissWidget.__init__(self, *args) # Hardware objects ---------------------------------------------------- self.attenuators_hwobj = None # Internal variables -------------------------------------------------- # Properties ---------------------------------------------------------- self.addProperty('mnemonic', 'string', '') self.addProperty('mockup_mnemonic', 'string', '') self.addProperty('formatString', 'formatString', '###.##') # Signals ------------------------------------------------------------ # Slots --------------------------------------------------------------- # Graphic elements ---------------------------------------------------- self.group_box = QGroupBox("Transmission", self) current_label = QLabel("Current:", self.group_box) current_label.setFixedWidth(75) self.transmission_ledit = QLineEdit(self.group_box) self.transmission_ledit.setReadOnly(True) set_to_label = QLabel("Set to:", self.group_box) self.new_value_ledit = QLineEdit(self.group_box) # Layout -------------------------------------------------------------- _group_box_gridlayout = QGridLayout(self.group_box) _group_box_gridlayout.addWidget(current_label, 0, 0) _group_box_gridlayout.addWidget(self.transmission_ledit, 0, 1) _group_box_gridlayout.addWidget(set_to_label, 1, 0) _group_box_gridlayout.addWidget(self.new_value_ledit, 1, 1) _group_box_gridlayout.setSpacing(0) _group_box_gridlayout.setContentsMargins(1, 1, 1, 1) _main_vlayout = QVBoxLayout(self) _main_vlayout.setSpacing(0) _main_vlayout.setContentsMargins(0, 0, 2, 2) _main_vlayout.addWidget(self.group_box) # SizePolicies -------------------------------------------------------- # Qt signal/slot connections ------------------------------------------ self.new_value_ledit.returnPressed.connect(self.current_value_changed) self.new_value_ledit.textChanged.connect(self.input_field_changed) # Other --------------------------------------------------------------- Qt4_widget_colors.set_widget_color(self.new_value_ledit, Qt4_widget_colors.LINE_EDIT_ACTIVE, QPalette.Base) self.new_value_validator = QDoubleValidator(\ 0, 100, 2, self.new_value_ledit) self.new_value_ledit.setToolTip("Transmission limits 0 : 100 %") self.instance_synchronize("transmission_ledit", "new_value_ledit")
def __init__(self, *args): """ Descript. : """ BlissWidget.__init__(self, *args) # Hardware objects ---------------------------------------------------- self.aperture_hwobj = None # Internal values ----------------------------------------------------- # Properties ---------------------------------------------------------- self.addProperty('mnemonic', 'string', '') # Signals ------------------------------------------------------------ # Slots --------------------------------------------------------------- # Graphic elements ---------------------------------------------------- self.main_gbox = QGroupBox("Aperture", self) self.aperture_diameter_combo = QComboBox(self.main_gbox) self.aperture_diameter_combo.setMinimumWidth(100) self.aperture_position_combo = QComboBox(self.main_gbox) self.aperture_position_combo.setMinimumWidth(100) # Layout -------------------------------------------------------------- _main_gbox_vlayout = QVBoxLayout(self.main_gbox) _main_gbox_vlayout.addWidget(self.aperture_diameter_combo) _main_gbox_vlayout.addWidget(self.aperture_position_combo) _main_gbox_vlayout.addStretch() _main_gbox_vlayout.setSpacing(2) _main_gbox_vlayout.setContentsMargins(0, 0, 0, 0) _main_vlayout = QVBoxLayout(self) _main_vlayout.addWidget(self.main_gbox) _main_vlayout.setSpacing(0) #_main_vlayout.addSpacing(0) _main_vlayout.setContentsMargins(2, 2, 2, 2) # Qt signal/slot connections ------------------------------------------ self.aperture_diameter_combo.activated.\ connect(self.change_diameter) self.aperture_position_combo.activated.\ connect(self.change_position) # SizePolicies -------------------------------------------------------- # Other --------------------------------------------------------------- Qt4_widget_colors.set_widget_color(self.aperture_diameter_combo, Qt4_widget_colors.LIGHT_GREEN, QPalette.Button) Qt4_widget_colors.set_widget_color(self.aperture_position_combo, Qt4_widget_colors.LIGHT_GREEN, QPalette.Button) self.aperture_diameter_combo.setMinimumWidth(100) self.aperture_position_combo.setMinimumWidth(100)
def __init__(self, *args): BlissWidget.__init__(self, *args) # Hardware objects ---------------------------------------------------- # Internal values ----------------------------------------------------- self.motor_hwobj_list = [] self.motor_widget_list = [] self.motor_widget_labels = [] self.predefined_positions_list = [] self.positions = None # Properties ---------------------------------------------------------- self.addProperty('mnemonic', 'string', '') self.addProperty('labels', 'string', '') self.addProperty('moveButtonIcons', 'string', '') self.addProperty('alignment', 'combo', ('vertical', 'horizontal'), 'vertical') self.addProperty('defaultSteps', 'string', '') self.addProperty('defaultDeltas', 'string', '') self.addProperty('defaultDecimals', 'string', '') self.addProperty('predefinedPositions', 'string', '') self.addProperty('showMoveButtons', 'boolean', True) self.addProperty('showSlider', 'boolean', False) self.addProperty('showStop', 'boolean', True) self.addProperty('showStep', 'boolean', True) self.addProperty('showEnableButtons', 'boolean', False) self.addProperty('inExpertMode', 'boolean', False) # Signals ------------------------------------------------------------- # Slots --------------------------------------------------------------- # Graphic elements ---------------------------------------------------- self.main_group_box = QGroupBox(self) self.enable_motors_buttons = QPushButton('Enable', self.main_group_box) self.disable_motors_buttons = QPushButton('Disable', self.main_group_box) # Layout -------------------------------------------------------------- if self['alignment'] == 'horizontal': self.main_groupbox_hlayout = QHBoxLayout(self.main_group_box) else: self.main_groupbox_hlayout = QVBoxLayout(self.main_group_box) self.main_groupbox_hlayout.setSpacing(2) self.main_groupbox_hlayout.setContentsMargins(0, 0, 0, 0) self.main_hlayout = QHBoxLayout(self) self.main_hlayout.addWidget(self.main_group_box) self.main_hlayout.setSpacing(2) self.main_hlayout.setContentsMargins(2, 2, 2, 2) # Size Policy --------------------------------------------------------- # Qt signal/slot connections ------------------------------------------ self.enable_motors_buttons.clicked.connect(self.enable_motors) self.disable_motors_buttons.clicked.connect(self.disable_motors)
def __init__(self, *args): """ Descript. : Args. : Return : """ BlissWidget.__init__(self, *args) # Properties ---------------------------------------------------------- self.addProperty('mnemonic', 'string', '') self.addProperty('icons', 'string', '') self.addProperty('myTabLabel', 'string', '') # Signals ------------------------------------------------------------ self.defineSignal('incoming_unread_messages',()) self.defineSignal('reset_unread_message',()) # Slots --------------------------------------------------------------- self.defineSlot('tabSelected',()) self.defineSlot('sessionSelected',()) # Hardware objects ---------------------------------------------------- self.instance_server_hwobj = None # Internal values ----------------------------------------------------- self.session_id = None self.nickname = "" self.role = BlissWidget.INSTANCE_ROLE_UNKNOWN # Graphic elements ---------------------------------------------------- self.conversation_textedit = QTextEdit(self) self.conversation_textedit.setReadOnly(True) _controls_widget = QWidget(self) _say_label = QLabel("Say:", _controls_widget) self.message_ledit = QLineEdit(_controls_widget) self.send_button = QPushButton("Send", _controls_widget) self.send_button.setEnabled(False) # Layout -------------------------------------------------------------- _controls_widget_hlayout = QHBoxLayout(_controls_widget) _controls_widget_hlayout.addWidget(_say_label) _controls_widget_hlayout.addWidget(self.message_ledit) _controls_widget_hlayout.addWidget(self.send_button) _controls_widget_hlayout.setSpacing(2) _controls_widget_hlayout.setContentsMargins(0, 0, 0, 0) _main_vlayout = QVBoxLayout(self) _main_vlayout.addWidget(self.conversation_textedit) _main_vlayout.addWidget(_controls_widget) _main_vlayout.setSpacing(2) _main_vlayout.setContentsMargins(2, 2, 2, 2) # Qt signal/slot connections ------------------------------------------ self.send_button.clicked.connect(self.send_current_message) self.message_ledit.returnPressed.connect(self.send_current_message) self.message_ledit.textChanged.connect(self.message_changed)
def __init__(self, *args): """ Descript. : """ BlissWidget.__init__(self, *args) # Hardware objects ---------------------------------------------------- self.aperture_hwobj = None # Internal values ----------------------------------------------------- # Properties ---------------------------------------------------------- self.addProperty('mnemonic', 'string', '') # Signals ------------------------------------------------------------ # Slots --------------------------------------------------------------- # Graphic elements ---------------------------------------------------- self.main_gbox = QtGui.QGroupBox("Aperture", self) self.aperture_diameter_combo = QtGui.QComboBox(self.main_gbox) self.aperture_diameter_combo.setMinimumWidth(100) self.aperture_position_combo = QtGui.QComboBox(self.main_gbox) self.aperture_position_combo.setMinimumWidth(100) # Layout -------------------------------------------------------------- _main_gbox_vlayout = QtGui.QVBoxLayout(self.main_gbox) _main_gbox_vlayout.addWidget(self.aperture_diameter_combo) _main_gbox_vlayout.addWidget(self.aperture_position_combo) _main_gbox_vlayout.addStretch() _main_gbox_vlayout.setSpacing(2) _main_gbox_vlayout.setContentsMargins(2, 2, 2, 2) _main_vlayout = QtGui.QVBoxLayout(self) _main_vlayout.addWidget(self.main_gbox) _main_vlayout.setSpacing(0) _main_vlayout.addSpacing(0) _main_vlayout.setContentsMargins(2, 2, 2, 2) # Qt signal/slot connections ------------------------------------------ self.aperture_diameter_combo.activated.\ connect(self.change_diameter) self.aperture_position_combo.activated.\ connect(self.change_position) # SizePolicies -------------------------------------------------------- # Other --------------------------------------------------------------- Qt4_widget_colors.set_widget_color(self.aperture_diameter_combo, Qt4_widget_colors.LIGHT_GREEN, QtGui.QPalette.Button) Qt4_widget_colors.set_widget_color(self.aperture_position_combo, Qt4_widget_colors.LIGHT_GREEN, QtGui.QPalette.Button) self.aperture_diameter_combo.setMinimumWidth(100) self.aperture_position_combo.setMinimumWidth(100)
def __init__(self, *args): """ Descript. : """ BlissWidget.__init__(self, *args) # Hardware objects ---------------------------------------------------- self.plate_manipulator_hwobj = None # 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.addProperty("mnemonic", "string", "") self.addProperty("icons", "string", "") # Signals ------------------------------------------------------------- # Slots --------------------------------------------------------------- # Graphic elements ---------------------------------------------------- self.plate_navigator_widget = PlateNavigatorWidget(self) self.crims_widget = uic.loadUi( os.path.join(os.path.dirname(__file__), 'widgets/ui_files/Qt4_plate_crims_widget_layout.ui')) # Layout -------------------------------------------------------------- _main_vlayout = QtGui.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 = QtGui.QGraphicsScene(self) self.crims_widget.xtal_image_graphicsview.setScene(\ self.xtal_image_graphicsscene) self.xtal_image_pixmap = QtGui.QPixmap() self.xtal_image_graphics_pixmap = QtGui.QGraphicsPixmapItem() self.xtal_image_graphicsscene.addItem(\ self.xtal_image_graphics_pixmap)
def __init__(self, *args): BlissWidget.__init__(self, *args) self.dc_group_widget = DCGroupWidget(self) _main_vlayout = QtGui.QVBoxLayout(self) _main_vlayout.addWidget(self.dc_group_widget) # Qt-Slots self.defineSlot("populate_dc_group_widget", ({}))
def __init__(self, *args): BlissWidget.__init__(self, *args) self.dc_group_widget = DCGroupWidget(self) _main_vlayout = QVBoxLayout(self) _main_vlayout.addWidget(self.dc_group_widget) # Qt-Slots self.defineSlot("populate_dc_group_widget", ({}))
def __init__(self, *args): """ Descript. : """ BlissWidget.__init__(self, *args) self.logger = logging.getLogger("GUI Alba Actuator") self.logger.info("__init__()") self.on_color = Qt4_widget_colors.color_to_hexa( Qt4_widget_colors.LIGHT_GREEN) self.off_color = Qt4_widget_colors.color_to_hexa( Qt4_widget_colors.LIGHT_GRAY) self.fault_color = Qt4_widget_colors.color_to_hexa( Qt4_widget_colors.LIGHT_RED) self.unknown_color = Qt4_widget_colors.color_to_hexa( Qt4_widget_colors.DARK_GRAY) # Hardware objects ---------------------------------------------------- self.light_ho = None self.state = None self.level = None self.icons = None self.level_limits = [None, None] # Properties ---------------------------------------------------------- self.addProperty('mnemonic', 'string', '') self.addProperty('icons', 'string', '') # Graphic elements ---------------------------------------------------- self.widget = uic.loadUi( os.path.join(os.path.dirname(__file__), 'widgets/ui_files/alba_lightcontrol.ui')) QtGui.QHBoxLayout(self) self.layout().addWidget(self.widget) self.layout().setContentsMargins(0, 0, 0, 0) self.widget.layout().setContentsMargins(0, 0, 0, 0) self.widget.horizontalLayout.setContentsMargins(0, 0, 0, 0) self.widget.button.clicked.connect(self.do_switch) self.widget.slider.valueChanged.connect(self.do_set_level) # SizePolicies -------------------------------------------------------- self.setSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.MinimumExpanding) # Defaults self.set_icons('BulbCheck,BulbDelete') # Other --------------------------------------------------------------- self.setToolTip("Control of light (set level and on/off switch.") self.update()
def __init__(self, *args): BlissWidget.__init__(self, *args) # Hardware objects ---------------------------------------------------- self.beamline_test_hwobj = None # Internal variables -------------------------------------------------- self.available_test = None # Properties ---------------------------------------------------------- self.addProperty("mnemonic", "string", "") # Signals ------------------------------------------------------------ # Slots --------------------------------------------------------------- # Graphic elements ---------------------------------------------------- self.beamline_test_widget = uic.loadUi( os.path.join(os.path.dirname(__file__), "widgets/ui_files/Qt4_beamline_test_widget_layout.ui") ) self.test_toolbox = self.beamline_test_widget.test_toolbox self.test_queue_page = self.beamline_test_widget.queue_toolbox_page self.test_com_page = self.beamline_test_widget.com_toolbox_page self.test_focus_page = self.beamline_test_widget.focus_toolbox_page self.test_ppu_page = self.beamline_test_widget.ppu_toolbox_page self.test_profile_page = self.beamline_test_widget.profile_toolbox_page self.com_device_table = self.beamline_test_widget.comm_device_table self.current_test_listbox = self.beamline_test_widget.current_test_listbox self.available_test_listbox = self.beamline_test_widget.available_test_listbox self.test_result_browser = QtGui.QTextBrowser(self) # Layout -------------------------------------------------------------- _main_vlayout = QtGui.QHBoxLayout(self) _main_vlayout.addWidget(self.beamline_test_widget) _main_vlayout.addWidget(self.test_result_browser) _main_vlayout.setSpacing(0) _main_vlayout.setContentsMargins(0, 0, 0, 0) # Qt signal/slot connections ------------------------------------------ self.beamline_test_widget.add_button.clicked.connect(self.add_test_button_clicked) self.beamline_test_widget.remove_button.clicked.connect(self.remove_test_button_clicked) self.beamline_test_widget.run_test_button.clicked.connect(self.run_test_clicked) self.beamline_test_widget.test_focus_button.clicked.connect(self.test_focus_button_pressed) self.beamline_test_widget.focus_modes_combo.activated.connect(self.set_focus_mode_pressed) # Other --------------------------------------------------------------- # self.beamline_test_widget.setFixedWidth(600) self.test_result_browser.setSizePolicy(QtGui.QSizePolicy.MinimumExpanding, QtGui.QSizePolicy.MinimumExpanding)
def __init__(self, *args): BlissWidget.__init__(self, *args) # Hardware objects ---------------------------------------------------- # Internal values ----------------------------------------------------- self.motor_hwobj_list = [] self.motor_widget_list = [] self.motor_widget_labels = [] self.predefined_positions_list = [] self.positions = None # Properties ---------------------------------------------------------- self.addProperty('mnemonic', 'string', '') self.addProperty('labels', 'string','') self.addProperty('moveButtonIcons', 'string','') self.addProperty('alignment', 'combo', ('vertical', 'horizontal'), 'vertical') self.addProperty('defaultSteps', 'string', '') self.addProperty('defaultDeltas', 'string', '') self.addProperty('defaultDecimals', 'string', '') self.addProperty('predefinedPositions', 'string', '') self.addProperty('showMoveButtons', 'boolean', True) self.addProperty('showSlider', 'boolean', False) self.addProperty('showStop', 'boolean', True) self.addProperty('showStep', 'boolean', True) self.addProperty('showEnableButtons', 'boolean', False) self.addProperty('inExpertMode', 'boolean', False) # Signals ------------------------------------------------------------- # Slots --------------------------------------------------------------- # Graphic elements ---------------------------------------------------- self.main_group_box = QGroupBox(self) self.enable_motors_buttons = QPushButton('Enable', self.main_group_box) self.disable_motors_buttons = QPushButton('Disable', self.main_group_box) # Layout -------------------------------------------------------------- if self['alignment'] == 'horizontal': self.main_groupbox_hlayout = QHBoxLayout(self.main_group_box) else: self.main_groupbox_hlayout = QVBoxLayout(self.main_group_box) self.main_groupbox_hlayout.setSpacing(2) self.main_groupbox_hlayout.setContentsMargins(0, 0, 0, 0) self.main_hlayout = QHBoxLayout(self) self.main_hlayout.addWidget(self.main_group_box) self.main_hlayout.setSpacing(2) self.main_hlayout.setContentsMargins(2, 2, 2, 2) # Size Policy --------------------------------------------------------- # Qt signal/slot connections ------------------------------------------ self.enable_motors_buttons.clicked.connect(self.enable_motors) self.disable_motors_buttons.clicked.connect(self.disable_motors)
def __init__(self, *args): """ Descript. : """ BlissWidget.__init__(self, *args) # Hardware objects ---------------------------------------------------- self.plate_manipulator_hwobj = None # 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.addProperty("mnemonic", "string", "") self.addProperty("icons", "string", "") # Signals ------------------------------------------------------------- # Slots --------------------------------------------------------------- # Graphic elements ---------------------------------------------------- self.plate_navigator_widget = PlateNavigatorWidget(self) self.crims_widget = loadUi(os.path.join(os.path.dirname(__file__), 'widgets/ui_files/Qt4_plate_crims_widget_layout.ui')) # Layout -------------------------------------------------------------- _main_vlayout = 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 = QGraphicsScene(self) self.crims_widget.xtal_image_graphicsview.setScene(\ self.xtal_image_graphicsscene) self.xtal_image_pixmap = QPixmap() self.xtal_image_graphics_pixmap = QGraphicsPixmapItem() self.xtal_image_graphicsscene.addItem(\ self.xtal_image_graphics_pixmap)
def __init__(self, *args): BlissWidget.__init__(self, *args) self.defineSlot('setData',()) self.mcafit_widget = McaAdvancedFit.McaAdvancedFit(self) self.mcafit_widget.dismissButton.hide() main_vlayout = QtGui.QVBoxLayout(self) main_vlayout.addWidget(self.mcafit_widget) self.setLayout(main_vlayout)
def __init__(self, *args): BlissWidget.__init__(self, *args) self.defineSlot("setData", ()) self.mcafit_widget = McaAdvancedFit.McaAdvancedFit(self) self.mcafit_widget.dismissButton.hide() main_vlayout = QtGui.QVBoxLayout(self) main_vlayout.addWidget(self.mcafit_widget) self.setLayout(main_vlayout)
def __init__(self, *args): """ Descript. : """ BlissWidget.__init__(self, *args) # Hardware objects ---------------------------------------------------- self.beam_info_hwobj = None # Internal values ----------------------------------------------------- # Properties ---------------------------------------------------------- self.addProperty('mnemonic', 'string', '') self.addProperty('formatString', 'formatString', '#.##') # Signals ------------------------------------------------------------ # Slots --------------------------------------------------------------- # Graphic elements ---------------------------------------------------- self.main_gbox = QtGui.QGroupBox('Beam size', self) hor_label = QtGui.QLabel("Horizontal:", self.main_gbox) self.hor_size_ledit = QtGui.QLineEdit(self.main_gbox) self.hor_size_ledit.setMaximumWidth(70) self.hor_size_ledit.setEnabled(False) self.hor_size_ledit.setAlignment(QtCore.Qt.AlignRight) ver_label = QtGui.QLabel("Vertical:", self.main_gbox) self.ver_size_ledit = QtGui.QLineEdit(self.main_gbox) self.ver_size_ledit.setMaximumWidth(70) self.ver_size_ledit.setEnabled(False) self.ver_size_ledit.setAlignment(QtCore.Qt.AlignRight) bold_font = self.hor_size_ledit.font() bold_font.setBold(True) self.hor_size_ledit.setFont(bold_font) self.ver_size_ledit.setFont(bold_font) # Layout -------------------------------------------------------------- _main_gbox_gridlayout = QtGui.QGridLayout(self.main_gbox) _main_gbox_gridlayout.addWidget(hor_label, 0, 0) _main_gbox_gridlayout.addWidget(self.hor_size_ledit, 0, 1) _main_gbox_gridlayout.addWidget(ver_label, 1, 0) _main_gbox_gridlayout.addWidget(self.ver_size_ledit, 1, 1) _main_gbox_gridlayout.setSpacing(0) _main_gbox_gridlayout.setContentsMargins(0, 0, 0, 0) self.main_gbox.setLayout(_main_gbox_gridlayout) _main_vlayout = QtGui.QVBoxLayout() _main_vlayout.addWidget(self.main_gbox) _main_vlayout.setSpacing(0) _main_vlayout.setContentsMargins(0, 0, 0, 0) self.setLayout(_main_vlayout)
def __init__(self, *args): """ Descript. : Initiates BlissWidget Brick """ BlissWidget.__init__(self, *args) # Properties ---------------------------------------------------------- self.addProperty('mnemonic', 'string', '') self.addProperty('label', 'string', '') self.addProperty('minimum', 'integer', '0') self.addProperty('maximum', 'integer', '100') # Signals ------------------------------------------------------------ # Slots --------------------------------------------------------------- # Hardware objects ---------------------------------------------------- self.light_hwobj = None # Internal values ----------------------------------------------------- # Graphic elements ---------------------------------------------------- self.group_box = QtGui.QGroupBox("", self) self.intensity_spinbox = QtGui.QDoubleSpinBox(self.group_box) self.intensity_spinbox.setMinimum(0) self.intensity_spinbox.setMaximum(100) self.intensity_spinbox.setDecimals(0) self.intensity_spinbox.setMinimumSize(QtCore.QSize(35, 25)) self.intensity_spinbox.setMaximumSize(QtCore.QSize(55, 25)) self.intensity_spinbox.setToolTip("Set the light intensity from 0% until 100%") # Layout -------------------------------------------------------------- _light_widget_hlayout = QtGui.QHBoxLayout(self.intensity_spinbox) _light_widget_hlayout.setSpacing(0) _light_widget_hlayout.setContentsMargins(0, 0, 0, 0) _group_box_gridlayout = QtGui.QGridLayout(self.group_box) _group_box_gridlayout.addWidget(self.intensity_spinbox, 0, 0) _group_box_gridlayout.setSpacing(0) _group_box_gridlayout.setContentsMargins(1, 1, 1, 1) _main_vlayout = QtGui.QVBoxLayout(self) _main_vlayout.setSpacing(0) _main_vlayout.setContentsMargins(0, 0, 2, 2) _main_vlayout.addWidget(self.group_box) # SizePolicies -------------------------------------------------------- # Qt signal/slot connections ------------------------------------------ spinbox_event = SpinBoxEvent(self.intensity_spinbox) self.intensity_spinbox.installEventFilter(spinbox_event) spinbox_event.returnPressedSignal.connect(self.current_value_changed) self.intensity_spinbox.lineEdit().textEdited.connect(self.intensity_value_edited)
def __init__(self, *args): BlissWidget.__init__(self, *args) self.defineSlot('setData',()) self.mcafit_widget = McaAdvancedFit.McaAdvancedFit(self) self.mcafit_widget.dismissButton.hide() _main_vlayout = QtGui.QVBoxLayout(self) _main_vlayout.addWidget(self.mcafit_widget) _main_vlayout.setSpacing(0) _main_vlayout.setContentsMargins(0, 0, 0, 0)
def __init__(self, *args): """ Descript. : """ BlissWidget.__init__(self, *args) # Hardware objects ---------------------------------------------------- self.beam_info_hwobj = None # Internal values ----------------------------------------------------- # Properties ---------------------------------------------------------- self.addProperty('mnemonic', 'string', '') self.addProperty('formatString', 'formatString', '#.#') # Signals ------------------------------------------------------------ # Slots --------------------------------------------------------------- # Graphic elements ---------------------------------------------------- self.main_gbox = QtGui.QGroupBox('Beam size', self) hor_label = QtGui.QLabel("Horizontal:", self.main_gbox) self.hor_size_ledit = QtGui.QLineEdit(self.main_gbox) self.hor_size_ledit.setMaximumWidth(70) self.hor_size_ledit.setEnabled(False) self.hor_size_ledit.setAlignment(QtCore.Qt.AlignRight) ver_label = QtGui.QLabel("Vertical:", self.main_gbox) self.ver_size_ledit = QtGui.QLineEdit(self.main_gbox) self.ver_size_ledit.setMaximumWidth(70) self.ver_size_ledit.setEnabled(False) self.ver_size_ledit.setAlignment(QtCore.Qt.AlignRight) bold_font = self.hor_size_ledit.font() bold_font.setBold(True) self.hor_size_ledit.setFont(bold_font) self.ver_size_ledit.setFont(bold_font) # Layout -------------------------------------------------------------- _main_gbox_gridlayout = QtGui.QGridLayout(self.main_gbox) _main_gbox_gridlayout.addWidget(hor_label, 0, 0) _main_gbox_gridlayout.addWidget(self.hor_size_ledit, 0, 1) _main_gbox_gridlayout.addWidget(ver_label, 1, 0) _main_gbox_gridlayout.addWidget(self.ver_size_ledit, 1, 1) _main_gbox_gridlayout.setSpacing(0) _main_gbox_gridlayout.setContentsMargins(0, 0, 0, 0) self.main_gbox.setLayout(_main_gbox_gridlayout) _main_vlayout = QtGui.QVBoxLayout() _main_vlayout.addWidget(self.main_gbox) _main_vlayout.setSpacing(0) _main_vlayout.setContentsMargins(0, 0, 0, 0) self.setLayout(_main_vlayout)
def __init__(self, *args): """ Descript. : """ BlissWidget.__init__(self, *args) # Hardware objects ---------------------------------------------------- self.tools_hwobj = None # Internal values ----------------------------------------------------- # Properties ---------------------------------------------------------- self.addProperty('mnemonic', 'string', '')
def __init__(self, *args): """ Descript. : """ BlissWidget.__init__(self, *args) # Hardware objects ---------------------------------------------------- self.tools_hwobj = None # Internal values ----------------------------------------------------- # Properties ---------------------------------------------------------- self.addProperty('mnemonic', 'string', '')
def __init__(self, *args): """ Descript. : """ BlissWidget.__init__(self, *args) # Hardware objects ---------------------------------------------------- self.beamline_setup_hwobj = None self.queue_model_hwobj = None self.session_hwobj = None # Internal variables -------------------------------------------------- # Properties ---------------------------------------------------------- self.addProperty("session", "string", "/session") self.addProperty("queue-model", "string", "/Qt4_queue-model") self.addProperty("beamline_setup", "string", "/Qt4_beamline-setup") self.addProperty("useImageTracking", "boolean", True) # Signals ------------------------------------------------------------ # Slots --------------------------------------------------------------- self.defineSlot("populate_dc_parameter_widget",({})) # Graphic elements ---------------------------------------------------- self.parameters_widget = DCParametersWidget(self, "parameters_widget") self.toggle_page_button = QtGui.QPushButton('View Results', self) self.toggle_page_button.setFixedWidth(120) self.results_static_view = QtGui.QTextBrowser(self) self.results_dynamic_view = ImageTrackingWidget(self) self.stacked_widget = QtGui.QStackedWidget(self) self.stacked_widget.addWidget(self.parameters_widget) self.stacked_widget.addWidget(self.results_static_view) self.stacked_widget.addWidget(self.results_dynamic_view) # Layout -------------------------------------------------------------- _main_vlayout = QtGui.QVBoxLayout(self) _main_vlayout.addWidget(self.stacked_widget) _main_vlayout.addStretch(0) _main_vlayout.addWidget(self.toggle_page_button) # SizePolicies ------------------------------------------------------- # Qt signal/slot connections ------------------------------------------ self.toggle_page_button.clicked.connect(self.toggle_page) # Other --------------------------------------------------------------- self.parameters_widget.collection_type = None #self.toggle_page_button.setDisabled(True) self.stacked_widget.setCurrentWidget(self.parameters_widget)
def __init__(self, *args): """ Descript. : Initiates BlissWidget Brick """ BlissWidget.__init__(self, *args) # Hardware objects ---------------------------------------------------- self.graphics_manager_hwobj = None self.diffractometer_hwobj = None self.beamline_setup_hwobj = None self.queue_model_hwobj = None self.session_hwobj = None # Internal values ----------------------------------------------------- self.ispyb_logged_in = False self.tree_brick = None # Properties ---------------------------------------------------------- self.addProperty("beamline_setup", "string", "/Qt4_beamline-setup") self.addProperty("queue_model", "string", "/Qt4_queue-model") # Signals ------------------------------------------------------------ self.defineSignal("getView", ()) self.defineSignal("getTreeBrick",()) # Slots --------------------------------------------------------------- self.defineSlot("logged_in", ()) self.defineSlot("set_session", ()) self.defineSlot("selection_changed",()) self.defineSlot("new_centred_position", ()) self.defineSlot("user_group_saved", ()) # Graphic elements ---------------------------------------------------- self.task_tool_box_widget = TaskToolBoxWidget(self) # Layout -------------------------------------------------------------- self.main_layout = QtGui.QVBoxLayout(self) self.main_layout.addWidget(self.task_tool_box_widget) self.main_layout.setSpacing(0) self.main_layout.setContentsMargins(0, 0, 0, 0) self.setLayout(self.main_layout) # SizePolicies -------------------------------------------------------- self.setSizePolicy(QtGui.QSizePolicy.MinimumExpanding, QtGui.QSizePolicy.MinimumExpanding) # Other --------------------------------------------------------------- self.setEnabled(self.ispyb_logged_in)
def __init__(self, *args): """ Descript. : Initiates BlissWidget Brick """ BlissWidget.__init__(self, *args) # Hardware objects ---------------------------------------------------- #self.graphics_manager_hwobj = None self.diffractometer_hwobj = None self.beamline_setup_hwobj = None self.queue_model_hwobj = None self.session_hwobj = None # Internal values ----------------------------------------------------- self.ispyb_logged_in = False self.tree_brick = None # Properties ---------------------------------------------------------- self.addProperty("beamline_setup", "string", "/beamline-setup") self.addProperty("queue_model", "string", "/queue-model") self.addProperty("useOscStartCbox", "boolean", False) self.addProperty("useCompression", "boolean", False) # Signals ------------------------------------------------------------- self.defineSignal("request_tree_brick", ()) # Slots --------------------------------------------------------------- self.defineSlot("logged_in", ()) self.defineSlot("set_session", ()) self.defineSlot("selection_changed", ()) self.defineSlot("user_group_saved", ()) self.defineSlot("set_tree_brick", ()) # Graphic elements ---------------------------------------------------- self.task_tool_box_widget = TaskToolBoxWidget(self) # Layout -------------------------------------------------------------- self.main_layout = QVBoxLayout(self) self.main_layout.addWidget(self.task_tool_box_widget) self.main_layout.setSpacing(0) self.main_layout.setContentsMargins(0, 0, 0, 0) self.setLayout(self.main_layout) # SizePolicies -------------------------------------------------------- self.setSizePolicy(QSizePolicy.MinimumExpanding, QSizePolicy.MinimumExpanding) # Other --------------------------------------------------------------- self.setEnabled(self.ispyb_logged_in)
def __init__(self, *args): """ Descript. : """ BlissWidget.__init__(self, *args) # Hardware objects ---------------------------------------------------- self.mach_info_hwobj = None # Internal values ----------------------------------------------------- self.graphics_initialized = None self.disc_label = None self.disc_value_label = None self.value_label_list = [] # Properties (name, type, default value, comment)---------------------- self.addProperty('diskThreshold', 'float', 200, comment='Disk threshold') self.addProperty('maxPlotPoints', 'integer', 100, comment="Maximal number of plot points") self.addProperty('showDiskSize', 'boolean', True, comment="Display information about disk size") # Properties for hwobj initialization --------------------------------- self.addProperty('hwobj_mach_info', 'string', '') # Signals ------------------------------------------------------------- # Slots --------------------------------------------------------------- self.defineSlot('setColDir', ()) # Graphic elements ---------------------------------------------------- self.disc_value_label = None # Layout -------------------------------------------------------------- self.main_vlayout = QtGui.QVBoxLayout(self) self.main_vlayout.setSpacing(1) self.main_vlayout.setContentsMargins(2, 2, 2, 2) # SizePolicies -------------------------------------------------------- # Other --------------------------------------------------------------- self.setToolTip("Main information about the beamline")
def __init__(self, *args): """ Descript. : """ BlissWidget.__init__(self, *args) # Hardware objects ---------------------------------------------------- self.mach_info_hwobj = None # Internal values ----------------------------------------------------- self.graphics_initialized = None self.disc_label = None self.disc_value_label = None self.value_label_list = [] # Properties (name, type, default value, comment)---------------------- self.addProperty('diskThreshold', 'float', 200, comment='Disk threshold') self.addProperty('maxPlotPoints', 'integer', 100, comment="Maximal number of plot points") self.addProperty('showDiskSize', 'boolean', True, comment="Display information about disk size") # Properties for hwobj initialization --------------------------------- self.addProperty('hwobj_mach_info', 'string', '') # Signals ------------------------------------------------------------- # Slots --------------------------------------------------------------- self.defineSlot('setColDir', ()) # Graphic elements ---------------------------------------------------- self.disc_value_label = None # Layout -------------------------------------------------------------- self.main_vlayout = QtGui.QVBoxLayout(self) self.main_vlayout.setSpacing(1) self.main_vlayout.setContentsMargins(2, 2, 2, 2) # SizePolicies -------------------------------------------------------- # Other --------------------------------------------------------------- self.setToolTip("Main information about the beamline")
def __init__(self, *args): BlissWidget.__init__(self, *args) self.addProperty('xrf-spectrum', 'string', '') self.addProperty("session", "string", "/session") self.session_hwobj = None self.xrf_spectrum_widget = XRFSpectrumParametersWidget(self) _main_vlayout = QVBoxLayout(self) _main_vlayout.addWidget(self.xrf_spectrum_widget) _main_vlayout.setSpacing(0) _main_vlayout.setContentsMargins(0, 0, 0, 0) self.defineSlot("populate_xrf_widget", ({}))
def __init__(self, *args): BlissWidget.__init__(self, *args) self.addProperty('xrf-scan', 'string', '') self.addProperty("session", "string", "/session") self.session_hwobj = None self.xrf_scan_hwobj = None self.xrf_scan_widget = XRFScanParametersWidget(self) _main_vlayout = QtGui.QVBoxLayout(self) _main_vlayout.addWidget(self.xrf_scan_widget) self.setLayout(_main_vlayout) self.defineSlot("populate_xrf_widget", ({}))
def __init__(self, *args): BlissWidget.__init__(self, *args) self.defineSlot('set_data', ()) if pymca_imported: self.mcafit_widget = McaAdvancedFit.McaAdvancedFit(self) self.mcafit_widget.dismissButton.hide() else: self.mcafit_widget = TwoAxisPlotWidget(self) _main_vlayout = QVBoxLayout(self) _main_vlayout.addWidget(self.mcafit_widget) _main_vlayout.setSpacing(0) _main_vlayout.setContentsMargins(0, 0, 0, 0)
def __init__(self, *args): BlissWidget.__init__(self, *args) self.defineSlot('set_data',()) if pymca_imported: self.mcafit_widget = McaAdvancedFit.McaAdvancedFit(self) self.mcafit_widget.dismissButton.hide() else: self.mcafit_widget = TwoAxisPlotWidget(self) _main_vlayout = QVBoxLayout(self) _main_vlayout.addWidget(self.mcafit_widget) _main_vlayout.setSpacing(0) _main_vlayout.setContentsMargins(0, 0, 0, 0)
def __init__(self, *args): BlissWidget.__init__(self, *args) self.addProperty('xrf-scan', 'string', '') self.addProperty("session", "string", "/session") self.session_hwobj = None self.xrf_scan_hwobj = None self.xrf_scan_widget = XRFScanParametersWidget(self) _main_vlayout = QtGui.QVBoxLayout(self) _main_vlayout.addWidget(self.xrf_scan_widget) self.setLayout(_main_vlayout) self.defineSlot("populate_xrf_widget", ({}))
def __init__(self, *args): BlissWidget.__init__(self, *args) self.addProperty('energy-scan', 'string', '') self.addProperty("session", "string", "/session") self.session_hwobj = None # Layout self.energy_scan_widget = EnergyScanParametersWidget(self) _main_vlayout = QVBoxLayout(self) _main_vlayout.addWidget(self.energy_scan_widget) # Qt-Slots self.defineSlot("populate_parameter_widget", ({}))
def __init__(self, *args): """ Descript. : """ BlissWidget.__init__(self, *args) # Hardware objects ---------------------------------------------------- self.graphics_manager_hwobj = None # Internal values ----------------------------------------------------- self.target_menu = None # Properties ---------------------------------------------------------- self.addProperty('mnemonic', 'string', '/Qt4_graphics-manager') self.addProperty('targetMenu', 'combo', ("menuBar", "toolBar", "both"), "menuBar")
def __init__(self, *args): BlissWidget.__init__(self, *args) self.addProperty('xrf-spectrum', 'string', '') self.addProperty("session", "string", "/session") self.session_hwobj = None self.xrf_spectrum_widget = XRFSpectrumParametersWidget(self) _main_vlayout = QVBoxLayout(self) _main_vlayout.addWidget(self.xrf_spectrum_widget) _main_vlayout.setSpacing(0) _main_vlayout.setContentsMargins(0, 0, 0, 0) self.defineSlot("populate_xrf_widget", ({}))
def __init__(self, *args): BlissWidget.__init__(self, *args) self.addProperty('energy-scan', 'string', '') self.addProperty("session", "string", "/session") self.session_hwobj = None # Layout self.energy_scan_widget = EnergyScanParametersWidget(self) _main_vlayout = QVBoxLayout(self) _main_vlayout.addWidget(self.energy_scan_widget) # Qt-Slots self.defineSlot("populate_parameter_widget", ({}))
def __init__(self, *args): """ Descript. : """ BlissWidget.__init__(self, *args) # Hardware objects ---------------------------------------------------- self.session_hwobj = None # Internal variables -------------------------------------------------- # Properties ---------------------------------------------------------- self.addProperty("tunable-energy", "boolean", "True") self.addProperty("session", "string", "/session") self.addProperty("beamline_setup", "string", "/beamline-setup") # Signals ------------------------------------------------------------- # Slots --------------------------------------------------------------- self.defineSlot("populate_char_parameter_widget", {}) # Graphic elements ---------------------------------------------------- self.stacked_widget = QStackedWidget(self) self.parameters_widget = CharParametersWidget(self) self.toggle_page_button = QPushButton('View Results', self) self.toggle_page_button.setFixedWidth(100) self.results_view = WebViewWidget(self) self.stacked_widget.addWidget(self.parameters_widget) self.stacked_widget.addWidget(self.results_view) # Layout -------------------------------------------------------------- _main_vlayout = QVBoxLayout(self) _main_vlayout.addWidget(self.stacked_widget) #_main_vlayout.addStretch(0) _main_vlayout.addWidget(self.toggle_page_button) # SizePolicies ------------------------------------------------------- self.results_view.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding) # Qt signal/slot connections ------------------------------------------ self.toggle_page_button.clicked.connect(self.toggle_page) # Other --------------------------------------------------------------- self.stacked_widget.setCurrentWidget(self.parameters_widget) self.parameters_widget.collection_type = None self.toggle_page_button.setDisabled(True)
def __init__(self, *args): """ Descript. : """ BlissWidget.__init__(self, *args) self.logger = logging.getLogger("GUI Alba Actuator") self.logger.info("__init__()") self.on_color = Qt4_widget_colors.color_to_hexa(Qt4_widget_colors.LIGHT_GREEN) self.off_color = Qt4_widget_colors.color_to_hexa(Qt4_widget_colors.LIGHT_GRAY) self.fault_color = Qt4_widget_colors.color_to_hexa(Qt4_widget_colors.LIGHT_RED) self.unknown_color = Qt4_widget_colors.color_to_hexa(Qt4_widget_colors.DARK_GRAY) # Hardware objects ---------------------------------------------------- self.light_ho = None self.state = None self.level = None self.icons = None self.level_limits = [None, None] # Properties ---------------------------------------------------------- self.addProperty("mnemonic", "string", "") self.addProperty("icons", "string", "") # Graphic elements ---------------------------------------------------- self.widget = uic.loadUi(os.path.join(os.path.dirname(__file__), "widgets/ui_files/alba_lightcontrol.ui")) QtGui.QHBoxLayout(self) self.layout().addWidget(self.widget) self.layout().setContentsMargins(0, 0, 0, 0) self.widget.layout().setContentsMargins(0, 0, 0, 0) self.widget.horizontalLayout.setContentsMargins(0, 0, 0, 0) self.widget.button.clicked.connect(self.do_switch) self.widget.slider.valueChanged.connect(self.do_set_level) # SizePolicies -------------------------------------------------------- self.setSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.MinimumExpanding) # Defaults self.set_icons("BulbCheck,BulbDelete") # Other --------------------------------------------------------------- self.setToolTip("Control of light (set level and on/off switch.") self.update()
def __init__(self, *args): BlissWidget.__init__(self,*args) # Properties ---------------------------------------------------------- self.addProperty('mnemonic','string','') # Signals ------------------------------------------------------------ # Slots --------------------------------------------------------------- # Hardware objects ---------------------------------------------------- self.door_interlock_hwobj=None # Internal values ----------------------------------------------------- self.__expertMode = False # Graphic elements ---------------------------------------------------- self.main_groupbox = QtGui.QGroupBox("Door interlock", self) self.main_groupbox.setAlignment(QtCore.Qt.AlignCenter) self.state_label = QtGui.QLabel('<b>unknown</b>', self.main_groupbox) Qt4_widget_colors.set_widget_color(self.state_label, self.STATES['unknown']) self.state_label.setAlignment(QtCore.Qt.AlignCenter) self.unlock_door_button = QtGui.QPushButton(\ Qt4_Icons.load_icon("EnterHutch"), "Unlock", self.main_groupbox) # Layout -------------------------------------------------------------- _main_gbox_vlayout = QtGui.QVBoxLayout(self.main_groupbox) _main_gbox_vlayout.addWidget(self.state_label) _main_gbox_vlayout.addWidget(self.unlock_door_button) _main_gbox_vlayout.setSpacing(2) _main_gbox_vlayout.setContentsMargins(4, 4, 4, 4) _main_vlayout = QtGui.QVBoxLayout(self) _main_vlayout.addWidget(self.main_groupbox) _main_vlayout.setSpacing(0) _main_vlayout.setContentsMargins(0, 0, 0, 0) # SizePolicies -------------------------------------------------------- # Qt signal/slot connections ------------------------------------------ self.unlock_door_button.clicked.connect(self.unlock_doors) # Other --------------------------------------------------------------- self.state_label.setToolTip("Shows the current door state") self.unlock_door_button.setToolTip("Unlocks the doors") self.setEnabled(False)