def propertyChanged(self, property_name, old_value, new_value):
        """
        Descript. :
        Args.     :
        Return.   : 
        """
        if property_name == 'mnemonic':
            if self.actuator_hwo is not None:
                self.disconnect(self.actuator_hwo, QtCore.SIGNAL('stateChanged'), self.state_changed)

            self.actuator_hwo = self.getHardwareObject(new_value)
            if self.actuator_hwo is not None:
                self.setEnabled(True)
                self.connect(self.actuator_hwo, QtCore.SIGNAL('stateChanged'), self.state_changed)
                self.actuator_hwo.update_values()
                logging.getLogger("HWR").info("User Name is: %s" % self.actuator_hwo.getUserName())
                self.widget.actuatorBox.setTitle(self.actuator_hwo.getUserName())
            else:
                self.setEnabled(False)
        elif property_name == 'in_cmd_name':
            self.widget.cmdInButton.setText(new_value)
        elif property_name == 'out_cmd_name':
            self.widget.cmdOutButton.setText(new_value)
        else:
            BlissWidget.propertyChanged(self, property_name, old_value, new_value)
 def propertyChanged(self, property_name, old_value, new_value):
     if property_name == 'mnemonic':
         if self.beamline_test_hwobj is not None:
             self.disconnect(self.beamline_test_hwobj, 
                             'testProgress', 
                             self.update_test_progress)
             self.disconnect(self.beamline_test_hwobj, 
                             'focusingModeChanged', 
                             self.update_focus_status)
             self.disconnect(self.beamline_test_hwobj, 
                             'ppuStatusChanged', 
                             self.update_ppu_status)
             self.disconnect(self.beamline_test_hwobj, 
                             'testFinished', 
                             self.test_finished)
         self.beamline_test_hwobj = self.getHardwareObject(new_value)
         if self.beamline_test_hwobj is not None:
             self.init_com_table()                
             self.init_test_queue()
             self.connect(self.beamline_test_hwobj, 
                          'testProgress', 
                          self.update_test_progress)
             self.connect(self.beamline_test_hwobj, 
                          'focusingModeChanged', 
                          self.update_focus_status)
             self.connect(self.beamline_test_hwobj,
                          'ppuStatusChanged',
                          self.update_ppu_status)
             self.connect(self.beamline_test_hwobj,
                          'testFinished',
                          self.test_finished)
             self.update_focus_status(None, None)
     else:
         BlissWidget.propertyChanged(self, property_name, old_value, new_value)
 def propertyChanged(self, property_name, old_value, new_value):
     if property_name == "mnemonic":
         if self.detector_hwobj is not None:
             self.disconnect(self.detector_hwobj,
                             'temperatureChanged',
                             self.temperature_changed)
             self.disconnect(self.detector_hwobj,
                             'humidityChanged',
                             self.humidity_changed)
             self.disconnect(self.detector_hwobj,
                             'statusChanged',
                             self.status_changed)
             self.disconnect(self.detector_hwobj,
                             'frameRateChanged',
                             self.frame_rate_changed)
         self.detector_hwobj = self.getHardwareObject(new_value)
         if self.detector_hwobj is not None:
             self.connect(self.detector_hwobj,
                          'temperatureChanged',
                          self.temperature_changed)
             self.connect(self.detector_hwobj,
                          'humidityChanged',
                          self.humidity_changed)
             self.connect(self.detector_hwobj,
                          'statusChanged',
                          self.status_changed)
             self.connect(self.detector_hwobj,
                          'frameRateChanged',
                          self.frame_rate_changed)
             self.detector_hwobj.update_values()             
     else:
         BlissWidget.propertyChanged(self, property_name, old_value, new_value)
        def _pageChanged(self, index):
            """
            Descript. :
            """
            page = self.widget(index)
            self.countChanged[index]=False

            tab_label=str(self.tabText(index))
            label_list=tab_label.split()
            found=False
            try:
                count=label_list[-1]
                try:
                    found=count[0]=="("
                except:
                    pass
                else:
                    try:
                        found=count[-1]==")"
                    except:
                        pass
            except:
                pass
            if found:
                orig_label=" ".join(label_list[0:-1])
            else:
                orig_label=" ".join(label_list)
            self.emit(QtCore.SIGNAL("notebookPageChanged"), orig_label)
            QtGui.QApplication.emit(self, QtCore.SIGNAL('tab_changed'), index, page)

            tab_name = self.objectName()
            BlissWidget.updateTabWidget(tab_name,index)
Beispiel #5
0
    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 propertyChanged(self, property_name, old_value, new_value):
     """
     """
     if property_name == "mnemonic":
         self.tools_hwobj = self.getHardwareObject(new_value)
     else:
         BlissWidget.propertyChanged(self, property_name, old_value, new_value)
    def propertyChanged(self, property_name, old_value, new_value):
        """
        Descript. :
        Args.     :
        Return.   : 
        """
        if property_name == 'mnemonic':
            if self.mach_info_hwobj is not None:
                self.disconnect(self.mach_info_hwobj, QtCore.SIGNAL('valuesChanged'), self.set_value)
                self.disconnect(self.mach_info_hwobj, QtCore.SIGNAL('inRangeChanged'), self.set_color)
                self.disconnect(self.mach_info_hwobj, QtCore.SIGNAL('tempHumChanged'), self.temp_hum_changed)

            self.mach_info_hwobj = self.getHardwareObject(new_value)
            if self.mach_info_hwobj is not None:
                self.setEnabled(True)
                self.connect(self.mach_info_hwobj, QtCore.SIGNAL('valuesChanged'), self.set_value)
                self.connect(self.mach_info_hwobj, QtCore.SIGNAL('inRangeChanged'), self.set_color)
                self.connect(self.mach_info_hwobj, QtCore.SIGNAL('tempHumChanged'), self.temp_hum_changed)
                if self.mach_info_hwobj.has_cryo() is False:
                    self.cryo_label.hide()
                    self.cryo_value_label.hide()
                self.mach_info_hwobj.update_values() 
            else:
                self.setEnabled(False)
        else:
            BlissWidget.propertyChanged(self, property_name, old_value, new_value)
    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 = 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)
Beispiel #10
0
 def init_progress(self, progress_type, number_of_steps):
     self.setEnabled(True)
     self.progress_bar.reset()
     self.progress_type_label.setText(progress_type)
     self.number_of_steps = number_of_steps
     self.progress_bar.setMaximum(self.number_of_steps)
     BlissWidget.set_status_info("status", progress_type)
Beispiel #11
0
 def propertyChanged(self, property_name, old_value, new_value):
     """
     Descript. :
     """
     if property_name == 'ldapServer':
         self.ldap_connection_hwobj = self.getHardwareObject(new_value)
     elif property_name == 'codes':
         self.setCodes(new_value)
     elif property_name == 'localLogin':
         self.local_login_hwobj = self.getHardwareObject(new_value)
     elif property_name == 'dbConnection':
         self.lims_hwobj = self.getHardwareObject(new_value)
     elif property_name == 'instanceServer':
         if self.instanceServer is not None:
             self.disconnect(self.instanceServer, QtCore.SIGNAL('passControl'), self.passControl)
             self.disconnect(self.instanceServer, QtCore.SIGNAL('haveControl'), self.haveControl)
         self.instanceServer = self.getHardwareObject(new_value)
         if self.instanceServer is not None:
             self.connect(self.instanceServer, QtCore.SIGNAL('passControl'), self.passControl)
             self.connect(self.instanceServer, QtCore.SIGNAL('haveControl'), self.haveControl)
     elif property_name == 'icons':
         icons_list = new_value.split()
         try:
             self.login_button.setIcon(QtGui.QIcon(Qt4_Icons.load(icons_list[0])))
         except IndexError:
             pass
         try:
             self.logout_button.setIcon(QtGui.QIcon(Qt4_Icons.load(icons_list[1])))
         except IndexError:
             pass
     elif property_name == 'session':
         self.session_hwobj = self.getHardwareObject(new_value)
     else:
         BlissWidget.propertyChanged(self, property_name, old_value, new_value)
Beispiel #12
0
    def propertyChanged(self, property, oldValue, newValue):
        if property == 'mnemonic':
	    if self.slitbox_hwobj is not None:
		self.disconnect(self.slitbox_hwobj, QtCore.SIGNAL('gapSizeChanged'), self.gap_value_changed)
		self.disconnect(self.slitbox_hwobj, QtCore.SIGNAL('statusChanged'), self.gap_status_changed)
	        self.disconnect(self.slitbox_hwobj, QtCore.SIGNAL('focModeChanged'), self.focModeChanged)
	        self.disconnect(self.slitbox_hwobj, QtCore.SIGNAL('gapLimitsChanged'), self.gapLimitsChanged)
	    self.slitbox_hwobj = self.getHardwareObject(newValue)
	    if self.slitbox_hwobj is not None:
		self.connect(self.slitbox_hwobj, QtCore.SIGNAL('gapSizeChanged'), self.gap_value_changed)
		self.connect(self.slitbox_hwobj, QtCore.SIGNAL('statusChanged'), self.gap_status_changed)
                self.connect(self.slitbox_hwobj, QtCore.SIGNAL('focModeChanged'), self.focModeChanged)
	        self.connect(self.slitbox_hwobj, QtCore.SIGNAL('gapLimitsChanged'), self.gapLimitsChanged)

                self.slitbox_hwobj.update_values()
            	self.slitBoxReady()
	    else:
                self.slitBoxNotReady()
	elif property == 'icons':
            icons_list=newValue.split()
            try:
		self.set_hor_gap_button.setIcon(Qt4_Icons.load_icon(icons_list[0])) 
		self.set_ver_gap_button.setIcon(Qt4_Icons.load_icon(icons_list[0]))                  
		self.stop_hor_button.setIcon(Qt4_Icons.load_icon(icons_list[1]))
        	self.stop_ver_button.setIcon(Qt4_Icons.load_icon(icons_list[1]))
            except IndexError:
                self.set_hor_gap_button.setText("Set")
                self.set_ver_gap_button.setText("Set")
                self.stop_hor_button.setText("Stop")
                self.stop_ver_button.setText("Stop")
        else:
            BlissWidget.propertyChanged(self,property,oldValue,newValue)
 def propertyChanged(self, property_value, old_value, new_value):
     """
     Descript. :
     Args.     :
     Return.   : 
     """
     if property_value == 'mnemonic':
         if self.attenuators_hwobj is not None:
             self.disconnect(self.attenuators_hwobj, QtCore.SIGNAL('deviceReady'), self.connected)
             self.disconnect(self.attenuators_hwobj, QtCore.SIGNAL('deviceNotReady'), self.disconnected)
             self.disconnect(self.attenuators_hwobj, QtCore.SIGNAL('attStateChanged'), self.transmission_state_changed)
             self.disconnect(self.attenuators_hwobj, QtCore.SIGNAL('attFactorChanged'), self.transmission_value_changed)
         self.attenuators_hwobj = self.getHardwareObject(new_value)
         if self.attenuators_hwobj is not None:
             self.connect(self.attenuators_hwobj, QtCore.SIGNAL('deviceReady'), self.connected)
             self.connect(self.attenuators_hwobj, QtCore.SIGNAL('deviceNotReady'), self.disconnected)
             self.connect(self.attenuators_hwobj, QtCore.SIGNAL('attStateChanged'), self.transmission_state_changed)
             self.connect(self.attenuators_hwobj, QtCore.SIGNAL('attFactorChanged'), self.transmission_value_changed)
             if self.attenuators_hwobj.isReady():
                 self.connected()
                 self.attenuators_hwobj.update_values() 
             else:
                 self.disconnected()
         else:
             self.disconnected()
     else:
         BlissWidget.propertyChanged(self, property_value, old_value, new_value)
    def propertyChanged(self, property_name, old_value, new_value):
        if property_name == 'mnemonic':
            hwobj_names_list = new_value.split()
            for hwobj_name in hwobj_names_list:
                temp_motor_hwobj = self.getHardwareObject(hwobj_name)
                temp_motor_widget = Qt4_MotorSpinBoxBrick(self)
                temp_motor_widget.set_motor(temp_motor_hwobj, hwobj_name)
                temp_motor_widget.move_left_button.hide()
                temp_motor_widget.move_right_button.hide()
                temp_motor_widget.step_button.hide()
                temp_motor_widget.set_line_step(10.0)
                temp_motor_widget.step_changed(None)
                self.main_groupbox_hlayout.addWidget(temp_motor_widget)

                self.motor_hwobj_list.append(temp_motor_hwobj)
                self.motor_widget_list.append(temp_motor_widget) 
            if len(self.motor_widget_labels):      
                for index, label in enumerate(self.motor_widget_labels):
                    self.motor_widget_list[index].setLabel(label)
        elif property_name == 'icons':
            icons_list = new_value.split()
        elif property_name == 'labels':
            self.motor_widget_labels = new_value.split()
            if len(self.motor_widget_list):
                for index, label in enumerate(self.motor_widget_labels):
                    self.motor_widget_list[index].setLabel(label)            
        elif property_name == 'predefinedPositions':
            self.predefined_positions_list = new_value.split()
            for predefined_position in self.predefined_positions_list:
                temp_position_button = QtGui.QPushButton(predefined_position, self.main_group_box)
                self.main_groupbox_hlayout.addWidget(temp_position_button)
                temp_position_button.clicked.connect(lambda: \
                     self.predefined_position_clicked(predefined_position))
        else:
            BlissWidget.propertyChanged(self,property_name, old_value, new_value)
    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)
Beispiel #16
0
    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 propertyChanged(self,property_name, old_value, new_value):
     if property_name == 'mnemonic':
         if self.diffractometer_hwobj is not None:
             self.disconnect(self.diffractometer_hwobj, QtCore.SIGNAL("kappaMotorMoved"), self.kappa_motor_moved) 
             self.disconnect(self.diffractometer_hwobj, QtCore.SIGNAL("kappaPhiMotorMoved"), self.kappaphi_motor_moved)
             self.disconnect(self.diffractometer_hwobj, Qtcore.SIGNAL('minidiffStatusChanged'),self.diffractometer_state_changed)
         self.diffractometer_hwobj = self.getHardwareObject(new_value)
         if self.diffractometer_hwobj is not None:
             self.connect(self.diffractometer_hwobj, QtCore.SIGNAL("kappaMotorMoved"), self.kappa_motor_moved)            
             self.connect(self.diffractometer_hwobj, QtCore.SIGNAL("kappaPhiMotorMoved"), self.kappaphi_motor_moved)
             self.connect(self.diffractometer_hwobj, QtCore.SIGNAL('minidiffStatusChanged'),self.diffractometer_state_changed)
             self.setDisabled(self.diffractometer_hwobj.in_plate_mode())
             self.diffractometer_state_changed("Ready")
         else:
             self.setEnabled(False)
     elif property_name == 'showStop':
         if new_value:
             self.stop_button.show()
         else:
             self.stop_button.hide()
     elif property_name == 'defaultStep':
         if new_value != "":
             self.set_line_step(float(new_value))
             self.step_changed(None)
     else:
         BlissWidget.propertyChanged(self, property_name, old_value, new_value)
    def propertyChanged(self, property_name, old_value, new_value):
        if property_name == 'mnemonic':
            if self.image_tracking_hwobj is not None:
                self.disconnect(self.image_tracking_hwobj,
                                'imageTrackingStateChanged',
                                self.image_tracking_state_changed)
                self.disconnect(self.image_tracking_hwobj, 
                                'stateChanged', 
                                self.state_changed)
            self.image_tracking_hwobj = self.getHardwareObject(new_value)
            if self.image_tracking_hwobj is not None:
                self.image_tracking_cbox.blockSignals(True)
                self.image_tracking_cbox.setChecked(\
                     self.image_tracking_hwobj.is_tracking_enabled() == True)
                self.image_tracking_cbox.blockSignals(False)
                self.connect(self.image_tracking_hwobj,
                             'imageTrackingStateChanged',
                             self.image_tracking_state_changed)
                self.connect(self.image_tracking_hwobj, 
                             'stateChanged', 
                             self.state_changed)
                self.image_tracking_hwobj.update_values()
                self.setEnabled(True)
            else:
                self.setEnabled(False)

        else:
            BlissWidget.propertyChanged(self,property_name, old_value, new_value)
Beispiel #19
0
    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 propertyChanged(self, property_name, old_value, new_value):
        if property_name == 'hwobj_beamline_setup':
            if self.parallel_processing_hwobj is not None:
                self.parallel_processing_hwobj.disconnect("processingFinished",
                                                          self.processing_finished)
                self.parallel_processing_hwobj.disconnect("processingFailed",
                                                          self.processing_failed)
                self.parallel_processing_hwobj.disconnect("processingFrame",
                                                          self.processing_frame_changed)
                self.parallel_processing_hwobj.disconnect("paralleProcessingResults",
                                                          self.set_results)

            self.beamline_setup_hwobj = self.getHardwareObject(new_value)
            self.parallel_processing_hwobj = self.beamline_setup_hwobj.parallel_processing_hwobj

            if self.parallel_processing_hwobj is not None:
                self.parallel_processing_hwobj.connect("processingFinished",
                                                       self.processing_finished)
                self.parallel_processing_hwobj.connect("processingFailed",
                                                       self.processing_failed)
                self.parallel_processing_hwobj.connect("processingFrame",
                                                       self.processing_frame_changed)
                self.parallel_processing_hwobj.connect("paralleProcessingResults",
                                                       self.set_results)

                for grid_property in self.parallel_processing_hwobj.get_available_grid_properties():
                    self.grid_properties_combo.addItem(str(grid_property))
                self.grid_properties_combo.blockSignals(True)
                self.grid_properties_combo.setCurrentIndex(0)
                self.grid_properties_combo.blockSignals(False)
                self.init_gui()
        else:
            BlissWidget.propertyChanged(self, property_name, old_value, new_value)
    def propertyChanged(self, property_name, old_value, new_value):
        """
        Descript. : Event triggered when user property changed in the property
                    editor. 
        Args.     : property_name (string), old_value, new_value
        Return.   : None
        """
        if property_name == 'mnemonic':
            if self.light_hwobj is not None:
                self.disconnect(self.light_hwobj, QtCore.SIGNAL('intensityChanged'), self.intensity_changed)
            self.light_hwobj = self.getHardwareObject(new_value)
            if self.light_hwobj is not None:
                self.connect(self.light_hwobj, QtCore.SIGNAL('intensityChanged'), self.intensity_changed)

                if self.light_hwobj.isReady():
                    self.connected()
                else:
                    self.disconnected()
            else:
                self.disconnected()
        elif property_name == 'label':
            self.group_box.setTitle(new_value)
        elif property_name == 'minimum':
            self.intensity_spinbox.setMinimum(new_value)
        elif property_name == 'maximum':
            self.intensity_spinbox.setMaximum(new_value)
        else:
            BlissWidget.propertyChanged(self, property_name, old_value, new_value)
    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)
Beispiel #23
0
 def propertyChanged(self, property_name, old_value, new_value):
     """
     Descript. : Event triggered when user property changed in the property
                 editor. 
     Args.     : property_name (string), old_value, new_value
     Return    : None
     """
     if property_name == "graphicsManager":
         if self.graphics_manager_hwobj:  
             self.disconnect(self.graphics_manager_hwobj, QtCore.SIGNAL('centringStarted'), self.centring_started)
             self.disconnect(self.graphics_manager_hwobj, QtCore.SIGNAL('centringFailed'), self.centring_failed)
             self.disconnect(self.graphics_manager_hwobj, QtCore.SIGNAL('centringSuccessful'), self.centring_successful)
             self.disconnect(self.graphics_manager_hwobj, QtCore.SIGNAL('minidiffReady'), self.diffractometer_ready_changed)
         self.graphics_manager_hwobj = self.getHardwareObject(new_value) 
         if self.graphics_manager_hwobj:
             self.connect(self.graphics_manager_hwobj, QtCore.SIGNAL('centringStarted'), self.centring_started)
             self.connect(self.graphics_manager_hwobj, QtCore.SIGNAL('centringFailed'), self.centring_failed)
             self.connect(self.graphics_manager_hwobj, QtCore.SIGNAL('centringSuccessful'), self.centring_successful)
             self.connect(self.graphics_manager_hwobj, QtCore.SIGNAL('minidiffReady'), self.diffractometer_ready_changed)
     elif property_name == "collection":
         self.collect_hwobj = self.getHardwareObject(new_value)
     elif property_name == "enableAutoFocus":
         self.auto_focus_button.setVisible(new_value) 
     elif property_name == "enableRefreshCamera":
         self.refresh_camera_button.setVisible(new_value)
     elif property_name == "enableVisualAlign":
         self.visual_align_button.setVisible(new_value)
     elif property_name == "enableAutoCenter":
         self.auto_center_button.setVisible(new_value)
     else:
         BlissWidget.propertyChanged(self, property_name, old_value, new_value)
 def propertyChanged(self, property_name, old_value, new_value):
     if property_name == 'mnemonic':
         if self.beamline_test_hwobj is not None:
             self.disconnect(self.beamline_test_hwobj, 
                             QtCore.SIGNAL('testProgress'), 
                             self.update_test_progress)
             #self.disconnect(self.beamline_test_hwobj, 
             #                QtCore.SIGNAL('focModeChanged'), 
             #                self.update_focus_status)
             self.disconnect(self.beamline_test_hwobj, 
                             QtCore.SIGNAL('ppuStatusChanged'), 
                             self.update_ppu_status)
             self.disconnect(self.beamline_test_hwobj, 
                             QtCore.SIGNAL('testFinished'), 
                             self.test_finished)
         self.beamline_test_hwobj = self.getHardwareObject(new_value)
         if self.beamline_test_hwobj is not None:
             self.init_com_table()                
             self.init_test_queue()
             self.connect(self.beamline_test_hwobj, 
                          QtCore.SIGNAL('testProgress'), 
                          self.update_test_progress)
             #self.connect(self.beamline_test_hwobj, 
             #             QtCore.SIGNAL('focModeChanged'), 
             #             self.update_focus_status)
             self.connect(self.beamline_test_hwobj,
                          QtCore.SIGNAL('ppuStatusChanged'),
                          self.update_ppu_status)
             self.connect(self.beamline_test_hwobj,
                          QtCore.SIGNAL('testFinished'),
                          self.test_finished)
             #self.load_result_page()
     else:
         BlissWidget.propertyChanged(self, property_name, old_value, new_value)
 def propertyChanged(self, property_name, old_value, new_value):
     """
     Descript. :
     """
     if property_name == 'mnemonic':
         if self.beamstop_hwobj is not None:
             self.disconnect(self.beamstop_hwobj,
                             'deviceReady',
                             self.connected)
             self.disconnect(self.beamstop_hwobj,
                             'deviceNotReady',
                             self.disconnected)
             self.disconnect(self.beamstop_hwobj,
                             'beamstopDistanceChanged',
                             self.beamstop_distance_changed)
         self.beamstop_hwobj = self.getHardwareObject(new_value)
         if self.beamstop_hwobj is not None:
             self.connect(self.beamstop_hwobj,
                          'deviceReady',
                          self.connected)
             self.connect(self.beamstop_hwobj,
                          'deviceNotReady',
                          self.disconnected)
             self.connect(self.beamstop_hwobj,
                          'beamstopDistanceChanged',
                          self.beamstop_distance_changed)
             if self.beamstop_hwobj.isReady():
                 self.connected()
                 self.beamstop_hwobj.update_values()
             else:
                 self.disconnected()
         else:
             self.disconnected()
     else:
         BlissWidget.propertyChanged(self, property_name, old_value, new_value)
    def propertyChanged(self, property_name, old_value, new_value):
        """
        Descript. : Event triggered when user property changed in the property
                    editor. 
        Args.     : property_name (string), old_value, new_value
        Return.   : None
        """
        if property_name == 'mnemonic':
            if self.energy_hwobj is not None:
                self.disconnect(self.energy_hwobj, QtCore.SIGNAL('deviceReady'), self.connected)
                self.disconnect(self.energy_hwobj, QtCore.SIGNAL('deviceNotReady'), self.disconnected)
                self.disconnect(self.energy_hwobj, QtCore.SIGNAL('energyChanged'), self.energy_changed)
            self.energy_hwobj = self.getHardwareObject(new_value)
            if self.energy_hwobj is not None:
                self.set_new_value_limits()
                self.connect(self.energy_hwobj, QtCore.SIGNAL('deviceReady'), self.connected)
                self.connect(self.energy_hwobj, QtCore.SIGNAL('deviceNotReady'), self.disconnected)
                self.connect(self.energy_hwobj, QtCore.SIGNAL('energyChanged'), self.energy_changed)
                self.energy_hwobj.update_values() 
                if self.energy_hwobj.isReady():
                    self.connected()
                else:
                    self.disconnected()
            else:
                self.disconnected()
        elif property_name == 'defaultMode':
            if new_value == "keV":
                self.units_combobox.setCurrentIndex(0)
            else:
                self.units_combobox.setCurrentIndex(1)

        elif property_name == 'alwaysReadonly':
            pass
        else:
            BlissWidget.propertyChanged(self, property_name, old_value, new_value)
Beispiel #27
0
 def propertyChanged(self, property_name, old_value, new_value):
     """
     Descript. :
     """
     if property_name == 'mnemonic':
         if self.crl_hwobj:
             self.disconnect(self.crl_hwobj, 'crlModeChanged', self.crl_mode_changed)
             self.disconnect(self.crl_hwobj, 'crlValueChanged', self.crl_value_changed)
         self.crl_hwobj = self.getHardwareObject(new_value)
         if self.crl_hwobj:
             self.connect(self.crl_hwobj, 'crlModeChanged', self.crl_mode_changed)
             self.connect(self.crl_hwobj, 'crlValueChanged', self.crl_value_changed)
             self.crl_hwobj.update_values()
     elif property_name == 'beamAlign':
         self.beam_align_hwobj = self.getHardwareObject(new_value)
     elif property_name == 'lenseCount':
         self.crl_value_table.setColumnCount(new_value)
         for col_index in range(new_value):
             temp_item = QtGui.QTableWidgetItem("")
             temp_item.setFlags(QtCore.Qt.ItemIsEnabled)
             temp_item.setBackground(Qt4_widget_colors.LIGHT_GRAY)
             self.crl_value_table.setItem(0, col_index, temp_item)
             self.crl_value_table.setColumnWidth(col_index, 20)
             self.crl_value.append(0)
         self.crl_value_table.setFixedWidth(20 * new_value + 6)
     else:
         BlissWidget.propertyChanged(self, property_name, old_value, new_value)
 def propertyChanged(self, property_name, old_value, new_value):
     if property_name == 'mnemonic':
         self.exporter_client_hwobj = self.getHardwareObject(new_value)
         if self.exporter_client_hwobj is not None:
             self.init_tables()
     else:
         BlissWidget.propertyChanged(self, property_name, old_value, new_value)
Beispiel #29
0
    def propertyChanged(self, property_name, old_value, new_value):
        """
        Descript. :
        Args.     :
        Return.   : 
        """
        if property_name == "mnemonic":
            if self.light_ho is not None:
                self.disconnect(self.light_ho, QtCore.SIGNAL("levelChanged"), self.level_changed)
                self.disconnect(self.light_ho, QtCore.SIGNAL("stateChanged"), self.state_changed)

            self.light_ho = self.getHardwareObject(new_value)

            if self.light_ho is not None:
                self.setEnabled(True)
                self.connect(self.light_ho, QtCore.SIGNAL("levelChanged"), self.level_changed)
                self.connect(self.light_ho, QtCore.SIGNAL("stateChanged"), self.state_changed)
                self.light_ho.update_values()
                self.setToolTip("Control of %s (light level and on/off switch." % self.light_ho.getUserName())
                self.set_level_limits(self.light_ho.getLimits())
                self.set_label(self.light_ho.getUserName())
            else:
                self.setEnabled(False)
        elif property_name == "icons":
            self.set_icons(new_value)
        else:
            BlissWidget.propertyChanged(self, property_name, old_value, new_value)
    def propertyChanged(self,propertyName,oldValue,newValue):
        if propertyName=='label':
            if newValue=="" and self.motor_hwobj is not None:
                self.label.setText("<i>"+self.motor_hwobj.username+":</i>")
                tip=self.motor_hwobj.username
            else:
                self.label.setText(newValue)
                tip=newValue
        elif propertyName=='mnemonic':
            if self.motor_hwobj is not None:
                self.disconnect(self.motor_hwobj, QtCore.SIGNAL('stateChanged'), self.motorStateChanged)
                self.disconnect(self.motor_hwobj, QtCore.SIGNAL('newPredefinedPositions'), self.fillPositions)
                self.disconnect(self.motor_hwobj, QtCore.SIGNAL('predefinedPositionChanged'), self.predefinedPositionChanged)
            self.motor_hwobj = self.getHardwareObject(newValue)
            if self.motor_hwobj is not None:
                self.connect(self.motor_hwobj, QtCore.SIGNAL('newPredefinedPositions'), self.fillPositions)
                self.connect(self.motor_hwobj, QtCore.SIGNAL('stateChanged'), self.motorStateChanged)
                self.connect(self.motor_hwobj, QtCore.SIGNAL('predefinedPositionChanged'), self.predefinedPositionChanged)

                self.fillPositions()

                if self.motor_hwobj.isReady():
                    self.predefinedPositionChanged(self.motor_hwobj.getCurrentPositionName(), 0)

                if self['label']=="":
                    lbl=self.motor_hwobj.username
                    self.label.setText("<i>"+lbl+":</i>")
                Qt4_widget_colors.set_widget_color(self.positions_combo,
                                                   Qt4_MotorPredefPosBrick.STATE_COLORS[0],
                                                   QtGui.QPalette.Button)
                self.motorStateChanged(self.motor_hwobj.getState())
        elif propertyName=='listIndex':
            self.fillPositions()
        else:
            BlissWidget.propertyChanged(self,propertyName,oldValue,newValue)
Beispiel #31
0
    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 = QtGui.QGroupBox("Detector status", self)
        self.status_label = QtGui.QLabel("<b>unknown status</b>",
                                         _main_groupbox)
        self.temperature_label = QtGui.QLabel("Temperature:", _main_groupbox)
        self.humidity_label = QtGui.QLabel("Humidity:     ", _main_groupbox)

        # Layout --------------------------------------------------------------
        _main_groupbox_vlayout = QtGui.QVBoxLayout(_main_groupbox)
        _main_groupbox_vlayout.addWidget(self.status_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 = QtGui.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'])

        self.status_label.setMinimumHeight(20)
        self.status_label.setAlignment(QtCore.Qt.AlignCenter)
        self.temperature_label.setMinimumHeight(20)
        self.humidity_label.setMinimumHeight(20)
Beispiel #32
0
    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)
Beispiel #33
0
    def __init__(self, *args):
        """
        Descript. :
        """
        BlissWidget.__init__(self, *args)

        # Hardware objects ----------------------------------------------------
        self.tools_hwobj = None

        # Internal values -----------------------------------------------------

        # Properties ----------------------------------------------------------
        self.addProperty('mnemonic', 'string', '')