FBD_Objects.py 文件源码

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

项目:beremiz 作者: nucleron 项目源码 文件源码
def SetType(self, type, value_type):
        if type != self.Type:
            self.Type = type
            # Create an input or output connector according to variable type
            if self.Type != INPUT:
                if self.Input is None:
                    self.Input = Connector(self, "", value_type, wx.Point(0, 0), WEST, onlyone=True)
            elif self.Input:
                self.Input.UnConnect(delete=True)
                self.Input = None
            if self.Type != OUTPUT:
                if self.Output is None:
                    self.Output = Connector(self, "", value_type, wx.Point(0, 0), EAST)
            elif self.Output:
                self.Output.UnConnect(delete=True)
                self.Output = None
            self.RefreshConnectors()
            self.RefreshBoundingBox()
        elif value_type != self.ValueType:
            if self.Input:
                self.Input.SetType(value_type)
            if self.Output:
                self.Output.SetType(value_type)

    # Returns the variable type
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号