コード例 #1
0
    def __init__(self,
                 object_id,
                 instance_id,
                 default_value=0,
                 type=DatastoreType.STATIC):
        #
        # 各識別子の定義
        #
        self.key = None
        self.type = type
        self.object_id = object_id
        self.instance_id = instance_id
        self.property_id = 85
        self.identifier = 'presentValue'

        #
        # スーパクラスのコンストラクタ呼び出し
        #
        Property.__init__(self,
                          self.identifier,
                          Real,
                          default=0.0,
                          optional=True,
                          mutable=False)

        #
        # 初期値のセットアップ
        #
        self.setType(type, default_value)
コード例 #2
0
ファイル: property.py プロジェクト: eternalharvest/eye
    def __init__(self, object_id, instance_id, default_value=0.0):
        #
        # 各識別子の定義
        #
        self.object_id = object_id
        self.instance_id = instance_id
        self.property_id = 85
        self.identifier = 'presentValue'

        #
        # スーパクラスのコンストラクタ呼び出し
        #
        Property.__init__(self,
                          self.identifier,
                          Real,
                          default=0.0,
                          optional=True,
                          mutable=False)

        #
        # 初期値のセットアップ
        #
        datastore = SingleBACnetd().getDatastore()
        datastore.set(self.object_id, self.instance_id, self.property_id,
                      default_value)
コード例 #3
0
 def __init__(self, identifier):
     Property.__init__(self,
                       identifier,
                       Boolean,
                       default=0.0,
                       optional=False,
                       mutable=False)
コード例 #4
0
 def __init__(self):
     if _debug: ChannelValueProperty._debug("__init__")
     Property.__init__(self,
                       'presentValue',
                       ChannelValue,
                       default=None,
                       optional=False,
                       mutable=True)
コード例 #5
0
 def __init__(self, identifier):
     if _debug: RandomValueProperty._debug("__init__ %r", identifier)
     Property.__init__(self,
                       identifier,
                       Real,
                       default=None,
                       optional=True,
                       mutable=False)
コード例 #6
0
ファイル: binaryio.py プロジェクト: zoopp/bacpypes
 def __init__(self, identifier):
     if _debug:
         BIPresentValue._debug("__init__ %r", identifier)
     Property.__init__(self,
                       identifier,
                       BinaryPV,
                       default=False,
                       optional=False,
                       mutable=False)
コード例 #7
0
ファイル: Test5.py プロジェクト: mteter-upenn/PiGateway
 def __init__(self, identifier):
     if _debug: ModbusValueProperty._debug("__init__ %r", identifier)
     self.register_reader = None
     Property.__init__(self,
                       identifier,
                       Real,
                       default=None,
                       optional=True,
                       mutable=False)
コード例 #8
0
ファイル: VendorAVObject.py プロジェクト: yaztown/bacpypes
    def __init__(self, identifier):
        if _debug: RandomValueProperty._debug("__init__ %r", identifier)
        Property.__init__(self,
                          identifier,
                          Real,
                          default=None,
                          optional=True,
                          mutable=False)

        # writing to this property changes the multiplier
        self.multiplier = 100.0
コード例 #9
0
ファイル: decorator.py プロジェクト: gnmerritt/BAC0
        def wrapper(*args, **kwargs):
            if callable(func):
                obj = func(*args, **kwargs)
            else:
                obj = func
            allowed_prop = _allowed_prop(obj)

            for property_name, value in properties.items():
                if property_name == "units":
                    new_prop = EngineeringUnits.enumerations[value]
                    obj.units = new_prop
                else:
                    try:
                        mutable = _mutable(property_name)
                        new_prop = Property(
                            property_name,
                            allowed_prop[property_name],
                            default=value,
                            mutable=mutable,
                        )
                    except KeyError:
                        raise ValueError(
                            "Invalid property ({}) for object".format(
                                property_name))
                    obj.add_property(new_prop)
            return obj
コード例 #10
0
class RandomAnalogValueObject(AnalogValueObject):

    properties = [
        RandomValueProperty('presentValue'),
        Property('eventMessageTexts', ArrayOf(CharacterString), mutable=True),
    ]

    def __init__(self, **kwargs):
        if _debug: RandomAnalogValueObject._debug("__init__ %r", kwargs)
        AnalogValueObject.__init__(self, **kwargs)
コード例 #11
0
class TECSupOnline(BinaryValueObject):
    """
    This class will provide to a BAC0 device referring to a Johnson Controls TEC3000
    thermostats the Supervisor Online variable. This will allow testing of remote
    occupancy schedules.
    """

    objectType = "device"
    vendor_id = 5

    properties = [Property(3653, Boolean, mutable=True)]

    def __init__(self, **kwargs):
        BinaryValueObject.__init__(self, **kwargs)
コード例 #12
0
ファイル: object.py プロジェクト: zbernhardtme/BAC0
def create_proprietary_object(params):
    try:
        _validate_params(params)
    except:
        raise
    props = [
        Property(v["obj_id"], v["primitive"], mutable=v["mutable"])
        for k, v in params["properties"].items()
    ]

    new_class = type(
        params["name"],
        (params["bacpypes_type"],),
        {"objectType": params["objectType"], "properties": props},
    )
    register_object_type(new_class, vendor_id=params["vendor_id"])
コード例 #13
0
ファイル: COVMixin.py プロジェクト: KunalSaini/bacpypes
 def __init__(self, identifier):
     Property.__init__(
         self, identifier, SequenceOf(COVSubscription),
         default=None, optional=True, mutable=False,
         )
コード例 #14
0
 def __init__(
     self, identifier, datatype, default=None, optional=True, mutable=False
 ):
     Property.__init__(self, identifier, datatype, default, optional, mutable)
コード例 #15
0
ファイル: vBACdevice.py プロジェクト: jack-hi/vBACnet
 def __init__(self, identifier):
     if _debug:
         DOPresentValue._debug("__init__ %r", identifier)
     Property.__init__(
         self, identifier, BinaryPV, default=BinaryPV("inactive"), optional=False, mutable=True
     )
コード例 #16
0
 def __init__(self, identifier):
     if _debug: RandomValueProperty._debug("__init__ %r", identifier)
     Property.__init__(self, identifier, Real, default=None, optional=True, mutable=False)
コード例 #17
0
 def __init__(self, identifier):
     if _debug: CurrentDateTimeProperty._debug("__init__ %r", identifier)
     Property.__init__(self, identifier, DateTime, default=None, optional=True, mutable=False)
コード例 #18
0
    def __init__(self, identifier):
        if _debug: RandomValueProperty._debug("__init__ %r", identifier)
        Property.__init__(self, identifier, Real, default=None, optional=True, mutable=False)

        # writing to this property changes the multiplier
        self.multiplier = 100.0
コード例 #19
0
 def __init__(self, identifier):
     if _debug: CurrentDateTimeProperty._debug("__init__ %r", identifier)
     Property.__init__(self, identifier, DateTime, default=None, optional=True, mutable=False)