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


Python BaseWidget.set_status_info方法代码示例

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


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

示例1: current_value_changed

# 需要导入模块: from gui.BaseComponents import BaseWidget [as 别名]
# 或者: from gui.BaseComponents.BaseWidget import set_status_info [as 别名]
    def current_value_changed(self):
        input_field_text = self.new_value_ledit.text()

        if (
            self.new_value_validator.validate(input_field_text, 0)[0]
            == QtImport.QValidator.Acceptable
        ):
            if self.units_combobox.currentIndex() == 0:
                BaseWidget.set_status_info("status", "Setting energy...", "running")
                api.energy.move_energy(float(input_field_text))
            else:
                api.energy.move_wavelength(float(input_field_text))
            self.new_value_ledit.setText("")
            Colors.set_widget_color(
                self.new_value_ledit, Colors.LINE_EDIT_ACTIVE, QtImport.QPalette.Base
            )
开发者ID:IvarsKarpics,项目名称:mxcube,代码行数:18,代码来源:EnergyBrick.py

示例2: _do_login_as_proposal

# 需要导入模块: from gui.BaseComponents import BaseWidget [as 别名]
# 或者: from gui.BaseComponents.BaseWidget import set_status_info [as 别名]
    def _do_login_as_proposal(
        self,
        proposal_code,
        proposal_number,
        proposal_password,
        beamline_name,
        impersonate=False,
    ):
        # Get proposal and sessions
        logging.getLogger().debug("ProposalBrick: querying ISPyB database...")
        prop = api.lims.getProposal(proposal_code, proposal_number)

        # Check if everything went ok
        prop_ok = True
        try:
            prop_ok = prop["status"]["code"] == "ok"
        except KeyError:
            prop_ok = False
        if not prop_ok:
            self.set_ispyb_down()
            BaseWidget.set_status_info("ispyb", "error")
        else:
            self.select_proposal(prop)
            BaseWidget.set_status_info(
                "user", "%s%[email protected]%s" % (proposal_code, str(proposal_number), beamline_name)
            )
            BaseWidget.set_status_info("ispyb", "ready")
开发者ID:IvarsKarpics,项目名称:mxcube,代码行数:29,代码来源:ProposalBrick.py

示例3: _do_login_as_user

# 需要导入模块: from gui.BaseComponents import BaseWidget [as 别名]
# 或者: from gui.BaseComponents.BaseWidget import set_status_info [as 别名]
    def _do_login_as_user(self, user_name):
        logging.getLogger().debug("ProposalBrick: querying ISPyB database...")

        self.proposals = api.lims.get_proposals_by_user(user_name)

        if len(self.proposals) == 0:
            logging.getLogger("GUI").error(
                "No proposals for user %s found in ISPyB" % user_name
            )
            self.set_ispyb_down()
            BaseWidget.set_status_info("ispyb", "error")
        else:
            self.proposal_combo.clear()
            proposal_tooltip = "Available proposals:"
            for proposal in self.proposals:
                proposal_info = "%s%s - %s" % (
                    proposal["Proposal"]["code"],
                    proposal["Proposal"]["number"],
                    proposal["Proposal"]["title"],
                )
                self.proposal_combo.addItem(proposal_info)
                proposal_tooltip += "\n   %s" % proposal_info

            if len(self.proposals) > 1:
                proposal_index = self.select_todays_proposal(self.proposals)
                self.proposal_combo.setEnabled(True)
            else:
                proposal_tooltip = ""
                proposal_index = 0
                self.proposal_combo.setEnabled(False)

            self.select_proposal(self.proposals[proposal_index])
            self.proposal_combo.setCurrentIndex(proposal_index)
            proposal_info = "%s%s - %s" % (
                self.proposals[proposal_index]["Proposal"]["code"],
                self.proposals[proposal_index]["Proposal"]["number"],
                self.proposals[proposal_index]["Proposal"]["title"],
            )
            proposal_tooltip += "\nSelected proposal:\n   %s" % proposal_info
            self.proposal_combo.setToolTip(proposal_tooltip)
            logging.getLogger("GUI").info("ISPyB proposal: %s" % proposal_info)

            BaseWidget.set_status_info(
                "user", "%[email protected]%s" % (user_name, api.lims.beamline_name)
            )
            BaseWidget.set_status_info("ispyb", "ready")
开发者ID:IvarsKarpics,项目名称:mxcube,代码行数:48,代码来源:ProposalBrick.py

示例4: state_changed

# 需要导入模块: from gui.BaseComponents import BaseWidget [as 别名]
# 或者: from gui.BaseComponents.BaseWidget import set_status_info [as 别名]
 def state_changed(self, state):
     self.setEnabled(state == "ready")
     BaseWidget.set_status_info("status", "", "")
开发者ID:IvarsKarpics,项目名称:mxcube,代码行数:5,代码来源:EnergyBrick.py


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