当前位置: 首页>>代码示例>>Python>>正文


Python BaseWidget.property_changed方法代码示例

本文整理汇总了Python中gui.BaseComponents.BaseWidget.property_changed方法的典型用法代码示例。如果您正苦于以下问题:Python BaseWidget.property_changed方法的具体用法?Python BaseWidget.property_changed怎么用?Python BaseWidget.property_changed使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在gui.BaseComponents.BaseWidget的用法示例。


在下文中一共展示了BaseWidget.property_changed方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: property_changed

# 需要导入模块: from gui.BaseComponents import BaseWidget [as 别名]
# 或者: from gui.BaseComponents.BaseWidget import property_changed [as 别名]
    def property_changed(self, property_name, old_value, new_value):
        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.get_hardware_object(new_value)

            if self.crl_hwobj:
                crl_modes = self.crl_hwobj.get_modes()
                for crl_mode in crl_modes:
                    self.mode_combo.addItem(crl_mode)
                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 == "lenseCount":
            self.crl_value_table.setColumnCount(new_value)
            for col_index in range(new_value):
                temp_item = QtImport.QTableWidgetItem("")
                temp_item.setFlags(QtImport.Qt.ItemIsEnabled)
                temp_item.setBackground(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)
        elif property_name == "caption":
            if new_value:
                self.main_gbox.setTitle(new_value)
        else:
            BaseWidget.property_changed(self, property_name, old_value, new_value)
开发者ID:IvarsKarpics,项目名称:mxcube,代码行数:34,代码来源:CRLBrick.py

示例2: property_changed

# 需要导入模块: from gui.BaseComponents import BaseWidget [as 别名]
# 或者: from gui.BaseComponents.BaseWidget import property_changed [as 别名]
    def property_changed(self, property_name, old_value, new_value):
        if property_name == "mnemonic":
            if self.actuator_hwo is not None:
                self.disconnect(
                    self.actuator_hwo, QtImport.SIGNAL("stateChanged"), self.state_changed
                )

            self.actuator_hwo = self.get_hardware_object(new_value)
            if self.actuator_hwo is not None:
                self.setEnabled(True)
                self.connect(
                    self.actuator_hwo, QtImport.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:
            BaseWidget.property_changed(self, property_name, old_value, new_value)
开发者ID:IvarsKarpics,项目名称:mxcube,代码行数:28,代码来源:ALBA_ActuatorBrick.py

示例3: property_changed

# 需要导入模块: from gui.BaseComponents import BaseWidget [as 别名]
# 或者: from gui.BaseComponents.BaseWidget import property_changed [as 别名]
    def property_changed(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.get_hardware_object(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:
            BaseWidget.property_changed(self, property_name, old_value, new_value)
开发者ID:IvarsKarpics,项目名称:mxcube,代码行数:37,代码来源:ImageTrackingStatusBrick.py

示例4: property_changed

# 需要导入模块: from gui.BaseComponents import BaseWidget [as 别名]
# 或者: from gui.BaseComponents.BaseWidget import property_changed [as 别名]
    def property_changed(self, property_name, old_value, new_value):
        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.get_hardware_object(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:
            BaseWidget.property_changed(self, property_name, old_value, new_value)
开发者ID:IvarsKarpics,项目名称:mxcube,代码行数:34,代码来源:BeamstopDistanceBrick.py

示例5: property_changed

# 需要导入模块: from gui.BaseComponents import BaseWidget [as 别名]
# 或者: from gui.BaseComponents.BaseWidget import property_changed [as 别名]
    def property_changed(self, property_name, old_value, new_value):
        if property_name == "mnemonic":
            if self.light_ho is not None:
                self.disconnect(
                    self.light_ho, QtImport.SIGNAL("levelChanged"), self.level_changed
                )
                self.disconnect(
                    self.light_ho, QtImport.SIGNAL("stateChanged"), self.state_changed
                )

            self.light_ho = self.get_hardware_object(new_value)

            if self.light_ho is not None:
                self.setEnabled(True)
                self.connect(
                    self.light_ho, QtImport.SIGNAL("levelChanged"), self.level_changed
                )
                self.connect(
                    self.light_ho, QtImport.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:
            BaseWidget.property_changed(self, property_name, old_value, new_value)
开发者ID:IvarsKarpics,项目名称:mxcube,代码行数:35,代码来源:ALBA_LightControlBrick.py

示例6: property_changed

# 需要导入模块: from gui.BaseComponents import BaseWidget [as 别名]
# 或者: from gui.BaseComponents.BaseWidget import property_changed [as 别名]
    def property_changed(self, property_name, old_value, new_value):
        if property_name == "level":
            self.filter_level = logging.NOTSET

            if new_value == "INFO":
                self.filter_level = logging.INFO
            elif new_value == "WARNING":
                self.filter_level = logging.WARNING
            elif new_value == "ERROR":
                self.filter_level = logging.ERROR

        elif property_name == "showDebug":
            if self["appearance"] == "tabs":
                if not new_value:
                    self.tab_widget.removeTab(self.tab_widget.indexOf(self.debug_log))

        elif property_name == "emailAddresses":
            self.feedback_log.email_addresses = new_value
        elif property_name == "fromEmailAddress":
            self.feedback_log.from_email_address = new_value

        elif property_name == "enableFeedback":
            if self["appearance"] == "tabs":
                if not new_value:
                    self.tab_widget.removeTab(
                        self.tab_widget.indexOf(self.feedback_log)
                    )

        elif property_name == "appearance":
            if new_value == "list":
                self.tab_levels = {
                    logging.NOTSET: self.info_log,
                    logging.DEBUG: self.info_log,
                    logging.INFO: self.info_log,
                    logging.WARNING: self.info_log,
                    logging.ERROR: self.info_log,
                    logging.CRITICAL: self.info_log,
                }

                self.tab_widget.removeTab(self.tab_widget.indexOf(self.details_log))
                self.tab_widget.removeTab(self.tab_widget.indexOf(self.debug_log))

            elif new_value == "tabs":
                self.tab_levels = {
                    logging.NOTSET: self.details_log,
                    logging.DEBUG: self.debug_log,
                    logging.INFO: self.info_log,
                    logging.WARNING: self.details_log,
                    logging.ERROR: self.details_log,
                    logging.CRITICAL: self.details_log,
                }

        elif property_name == "maxLogLines":
            self.details_log.set_max_log_lines(new_value)
            self.info_log.set_max_log_lines(new_value)
            self.debug_log.set_max_log_lines(new_value)
        else:
            BaseWidget.property_changed(self, property_name, old_value, new_value)
开发者ID:mxcube,项目名称:mxcube,代码行数:60,代码来源:LogViewBrick.py

示例7: property_changed

# 需要导入模块: from gui.BaseComponents import BaseWidget [as 别名]
# 或者: from gui.BaseComponents.BaseWidget import property_changed [as 别名]
 def property_changed(self, property_name, old_value, new_value):
     if property_name == "targetMenu":
         self.target_menu = new_value
     # elif property_name == 'cameraControls':
     #    self.camera_control_action.setEnabled(new_value)
     # elif property_name == 'beamDefiner':
     #     self.define_beam_action.setEnabled(new_value)
     else:
         BaseWidget.property_changed(self, property_name, old_value, new_value)
开发者ID:mxcube,项目名称:mxcube,代码行数:11,代码来源:GraphicsToolsBrick.py

示例8: property_changed

# 需要导入模块: from gui.BaseComponents import BaseWidget [as 别名]
# 或者: from gui.BaseComponents.BaseWidget import property_changed [as 别名]
    def property_changed(self, property_name, old_value, new_value):
        if property_name == "mnemonic":
            if self.graphics_manager_hwobj is not None:
                self.disconnect(
                    self.graphics_manager_hwobj, "mouseMoved", self.mouse_moved
                )
                self.disconnect(
                    self.graphics_manager_hwobj, "imageScaleChanged", self.image_scaled
                )
                self.disconnect(
                    self.graphics_manager_hwobj, "infoMsg", self.set_info_msg
                )

            self.graphics_manager_hwobj = self.get_hardware_object(new_value)

            if self.graphics_manager_hwobj is not None:
                self.connect(
                    self.graphics_manager_hwobj, "mouseMoved", self.mouse_moved
                )
                self.connect(
                    self.graphics_manager_hwobj, "imageScaleChanged", self.image_scaled
                )
                self.connect(self.graphics_manager_hwobj, "infoMsg", self.set_info_msg)
                self.graphics_view = self.graphics_manager_hwobj.get_graphics_view()
                # self.graphics_camera_frame = self.graphics_manager_hwobj.get_camera_frame()
                self.main_layout.addWidget(self.graphics_view)
                self.main_layout.addWidget(self.info_widget)
                self.set_fixed_size()
                self.init_image_scale_list()
                if hasattr(self.graphics_manager_hwobj, "camera_hwobj"):
                    self.camera_control_dialog.set_camera_hwobj(
                        self.graphics_manager_hwobj.camera_hwobj
                    )
        elif property_name == "fixedSize":
            try:
                fixed_size = list(map(int, new_value.split()))
                if len(fixed_size) == 2:
                    self.fixed_size = fixed_size
                    self.set_fixed_size()
            except BaseException:
                pass
        elif property_name == "displayBeam":
            self.display_beam = new_value
        elif property_name == "displayScale":
            self.display_scale = new_value
            if self.graphics_manager_hwobj is not None:
                self.graphics_manager_hwobj.set_scale_visible(new_value)
        elif property_name == "beamDefiner":
            self.define_beam_action.setEnabled(new_value)
        elif property_name == "cameraControls":
            self.camera_control_action.setEnabled(new_value)
        else:
            BaseWidget.property_changed(self, property_name, old_value, new_value)
开发者ID:IvarsKarpics,项目名称:mxcube,代码行数:55,代码来源:CameraBrick.py

示例9: property_changed

# 需要导入模块: from gui.BaseComponents import BaseWidget [as 别名]
# 或者: from gui.BaseComponents.BaseWidget import property_changed [as 别名]
    def property_changed(self, property_name, old_value, new_value):
        if property_name == "hwobj_flux":
            if self.flux_hwobj is not None:
                self.disconnect(self.flux_hwobj, "fluxChanged", self.flux_changed)

            self.flux_hwobj = self.get_hardware_object(new_value)

            if self.flux_hwobj is not None:
                self.connect(self.flux_hwobj, "fluxChanged", self.flux_changed)
                self.flux_changed(self.flux_hwobj.get_flux_info())
        else:
            BaseWidget.property_changed(self, property_name, old_value, new_value)
开发者ID:IvarsKarpics,项目名称:mxcube,代码行数:14,代码来源:FluxBrick.py

示例10: property_changed

# 需要导入模块: from gui.BaseComponents import BaseWidget [as 别名]
# 或者: from gui.BaseComponents.BaseWidget import property_changed [as 别名]
 def property_changed(self, property_name, old_value, new_value):
     if 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)
     elif property_name == "enableRealignBeam":
         self.realign_button.setVisible(new_value)
     else:
         BaseWidget.property_changed(self, property_name, old_value, new_value)
开发者ID:IvarsKarpics,项目名称:mxcube,代码行数:15,代码来源:HutchMenuBrick.py

示例11: property_changed

# 需要导入模块: from gui.BaseComponents import BaseWidget [as 别名]
# 或者: from gui.BaseComponents.BaseWidget import property_changed [as 别名]
 def property_changed(self, property_name, old_value, new_value):
     """Initates the shutter hwobj"""
     if property_name == "hwobj_shutter":
         if self.shutter_hwobj is not None:
             self.disconnect(
                 self.shutter_hwobj, "shutterStateChanged", self.state_changed
             )
         else:
             self.shutter_hwobj = self.get_hardware_object(new_value)
             self.connect(
                 self.shutter_hwobj, "shutterStateChanged", self.state_changed
             )
             self.shutter_hwobj.update_values()
     else:
         BaseWidget.property_changed(self, property_name, old_value, new_value)
开发者ID:IvarsKarpics,项目名称:mxcube,代码行数:17,代码来源:ShutterBrick.py

示例12: property_changed

# 需要导入模块: from gui.BaseComponents import BaseWidget [as 别名]
# 或者: from gui.BaseComponents.BaseWidget import property_changed [as 别名]
    def property_changed(self, property_name, old_value, new_value):
        if property_name == "defaultMode":
            if new_value == "keV":
                self.units_combobox.setCurrentIndex(0)
            else:
                self.units_combobox.setCurrentIndex(1)

        elif property_name == "displayStatus":
            self.status_label.setVisible(new_value)
            self.status_ledit.setVisible(new_value)
        elif property_name == "doBeamAlignment":
            self.beam_align_cbox.setEnabled(new_value)
            self.beam_align_cbox.setChecked(new_value)
        else:
            BaseWidget.property_changed(self, property_name, old_value, new_value)
开发者ID:IvarsKarpics,项目名称:mxcube,代码行数:17,代码来源:EnergyBrick.py

示例13: property_changed

# 需要导入模块: from gui.BaseComponents import BaseWidget [as 别名]
# 或者: from gui.BaseComponents.BaseWidget import property_changed [as 别名]
    def property_changed(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(
                    "processingStarted", self.processing_started
                )
                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.beamline_setup_hwobj = self.get_hardware_object(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(
                    "processingStarted", self.processing_started
                )
                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
                )
                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.grid_properties = (
                    self.parallel_processing_hwobj.get_current_grid_properties()
                )
                self.init_gui()
                self.grid_graphics_base.init_item(self.grid_properties)
                self.grid_graphics_overlay.init_item(self.grid_properties)
        else:
            BaseWidget.property_changed(self, property_name, old_value, new_value)
开发者ID:IvarsKarpics,项目名称:mxcube,代码行数:50,代码来源:StillCollectionPreviewBrick.py

示例14: property_changed

# 需要导入模块: from gui.BaseComponents import BaseWidget [as 别名]
# 或者: from gui.BaseComponents.BaseWidget import property_changed [as 别名]
 def property_changed(self, property_name, old_value, new_value):
     if property_name == "mnemonic":
         if self.diffractometer_hwobj is not None:
             self.disconnect(
                 self.diffractometer_hwobj, "kappaMotorMoved", self.kappa_motor_moved
             )
             self.disconnect(
                 self.diffractometer_hwobj,
                 "kappaPhiMotorMoved",
                 self.kappaphi_motor_moved,
             )
             self.disconnect(
                 self.diffractometer_hwobj,
                 "minidiffStatusChanged",
                 self.diffractometer_state_changed,
             )
         self.diffractometer_hwobj = self.get_hardware_object(new_value)
         if self.diffractometer_hwobj is not None:
             self.connect(
                 self.diffractometer_hwobj, "kappaMotorMoved", self.kappa_motor_moved
             )
             self.connect(
                 self.diffractometer_hwobj,
                 "kappaPhiMotorMoved",
                 self.kappaphi_motor_moved,
             )
             self.connect(
                 self.diffractometer_hwobj,
                 "minidiffStatusChanged",
                 self.diffractometer_state_changed,
             )
             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:
         BaseWidget.property_changed(self, property_name, old_value, new_value)
开发者ID:IvarsKarpics,项目名称:mxcube,代码行数:47,代码来源:KappaPhiMotorsBrick.py

示例15: property_changed

# 需要导入模块: from gui.BaseComponents import BaseWidget [as 别名]
# 或者: from gui.BaseComponents.BaseWidget import property_changed [as 别名]
 def property_changed(self, property_name, old_value, new_value):
     if property_name == "hwobj_state_machine":
         if self.state_machine_hwobj is not None:
             self.state_machine_hwobj.disconnect("stateChanged", self.state_changed)
             self.state_machine_hwobj.disconnect(
                 "conditionChanged", self.condition_changed
             )
         self.state_machine_hwobj = self.get_hardware_object(new_value)
         if self.state_machine_hwobj is not None:
             self.state_machine_hwobj.connect("stateChanged", self.state_changed)
             self.state_machine_hwobj.connect(
                 "conditionChanged", self.condition_changed
             )
             self.init_state_machine()
             self.init_state_graph()
             self.state_machine_hwobj.update_values()
     else:
         BaseWidget.property_changed(self, property_name, old_value, new_value)
开发者ID:mxcube,项目名称:mxcube,代码行数:20,代码来源:StateMachineBrick.py


注:本文中的gui.BaseComponents.BaseWidget.property_changed方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。