當前位置: 首頁>>代碼示例>>Python>>正文


Python LocalDeviceObject._dict_contents方法代碼示例

本文整理匯總了Python中bacpypes.app.LocalDeviceObject._dict_contents方法的典型用法代碼示例。如果您正苦於以下問題:Python LocalDeviceObject._dict_contents方法的具體用法?Python LocalDeviceObject._dict_contents怎麽用?Python LocalDeviceObject._dict_contents使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在bacpypes.app.LocalDeviceObject的用法示例。


在下文中一共展示了LocalDeviceObject._dict_contents方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: RandomAnalogValueObject

# 需要導入模塊: from bacpypes.app import LocalDeviceObject [as 別名]
# 或者: from bacpypes.app.LocalDeviceObject import _dict_contents [as 別名]
    this_device.protocolServicesSupported = services_supported.value

    # make a random input object
    ravo1 = RandomAnalogValueObject(
        objectIdentifier=('analogValue', 1), objectName='Random1'
        )
    _log.debug("    - ravo1: %r", ravo1)

    ravo1d = ravo1._dict_contents()
    print ravo1d

    ravo2 = RandomAnalogValueObject(
        objectIdentifier=('analogValue', 2), objectName='Random2'
        )
    _log.debug("    - ravo2: %r", ravo2)

    # add it to the device
    this_application.add_object(ravo1)
    this_application.add_object(ravo2)
    _log.debug("    - object list: %r", this_device.objectList)

    print this_device._dict_contents()

    run()

except Exception, e:
    _log.exception("an error has occurred: %s", e)
finally:
    _log.debug("finally")

開發者ID:matthewhelt,項目名稱:bacpypes,代碼行數:31,代碼來源:RandomAnalogValueObject.py

示例2: RandomAnalogValueObject

# 需要導入模塊: from bacpypes.app import LocalDeviceObject [as 別名]
# 或者: from bacpypes.app.LocalDeviceObject import _dict_contents [as 別名]
    this_device.protocolServicesSupported = services_supported.value

    # make a random input object
    ravo1 = RandomAnalogValueObject(
        objectIdentifier=('analogValue', 1), objectName='Random1'
        )
    _log.debug("    - ravo1: %r", ravo1)

    ravo1d = ravo1._dict_contents()
    print(ravo1d)

    ravo2 = RandomAnalogValueObject(
        objectIdentifier=('analogValue', 2), objectName='Random2'
        )
    _log.debug("    - ravo2: %r", ravo2)

    # add it to the device
    this_application.add_object(ravo1)
    this_application.add_object(ravo2)
    _log.debug("    - object list: %r", this_device.objectList)

    print(this_device._dict_contents())

    run()

except Exception as error:
    _log.exception("an error has occurred: %s", error)
finally:
    _log.debug("finally")

開發者ID:KunalSaini,項目名稱:bacpypes,代碼行數:31,代碼來源:RandomAnalogValueObject.py


注:本文中的bacpypes.app.LocalDeviceObject._dict_contents方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。