FBDVariableDialog.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:beremiz 作者: nucleron 项目源码 文件源码
def SetValues(self, values):
        """
        Set default variable parameters
        @param values: Variable parameters values
        """

        # Get class parameter value
        var_class = values.get("class", None)
        if var_class is not None:
            # Set class selected in class combo box
            self.Class.SetStringSelection(VARIABLE_CLASSES_DICT[var_class])
            # Refresh names in name list box according to var class
            self.RefreshNameList()

        # For each parameters defined, set corresponding control value
        for name, value in values.items():

            # Parameter is variable expression
            if name == "expression":
                # Set expression text control value
                self.Expression.ChangeValue(value)
                # Select corresponding text in name list box if it exists
                if self.VariableName.FindString(value) != wx.NOT_FOUND:
                    self.VariableName.SetStringSelection(value)
                else:
                    self.VariableName.SetSelection(wx.NOT_FOUND)

            # Parameter is variable execution order
            elif name == "executionOrder":
                self.ExecutionOrder.SetValue(value)

        # Refresh preview panel
        self.RefreshPreview()
        self.Fit()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号