prop_helpers.py 文件源码

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

项目:core-framework 作者: RedhawkSDR 项目源码 文件源码
def __init__(self, id, valueType, enum, compRef, kinds,defValue=None, parent=None, mode='readwrite', action='external',
                 structRef=None, structSeqRef=None, structSeqIdx=None):
        """ 
        Create a new simple property.

        Arguments:
          id        - The property ID
          valueType - Type of the property, must be in VALUE_TYPES
          compRef   - Reference to the PropertySet that owns this property
          defValue  - Default Python value for this property (default: None)
          parent    - Parent property that contains this property (default: None)
          mode      - Mode for the property, must be in MODES (default: 'readwrite')
          action    - Allocation action type (default: 'external')

        Deprecated arguments:
          structRef, structSeqRef, structSeqIdx
        """
        if valueType not in SCA_TYPES:
            raise(Exception('"' + str(valueType) + '"' + ' is not a valid valueType, choose from\n ' + str(SCA_TYPES)))

        # Initialize the parent
        Property.__init__(self, id, type=valueType, kinds=kinds,compRef=compRef, mode=mode, action=action, parent=parent,
                          defValue=defValue)

        self.valueType = valueType
        self.typecode = getTypeCode(self.valueType)
        if enum != None:
            self._enums = self._parseEnumerations(enum)
        else:
            self._enums = None
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号