●方法定义
modify_alarm_tags_attributes(self, props)
●方法参数说明
参数名称 |
参数说明 |
参数类型 |
默认值 |
props |
多个点属性列表,列表元素为每个点的属性字典。 |
字典类型的list |
|
●异常
如果调用失败,抛出hyperdb.HDError异常
●返回值
hyperdb.hd_sucess
●注意事项
属性字典必须遵循特定的格式,例如:
[
{'tagname': 'amtag0', 'descriptor': 'hahaha'},
{'tagname': 'amtag1', 'descriptor': 'aaaaaa'}
]
tagname被用来定位被修改的tag点。有些属性无法修改,例如 'tagname',具体参考iHyperDB中的Tag属性页面。
●方法调用
def ModifyAlarmTagsAttributes(self):
props = [{'tagname': 'amtag0', 'descriptor': 'hahaha'},
{'tagname': 'amtag1', 'descriptor': 'aaaaaa'}]
tagnames = ['amtag0', 'amtag1']
try:
tag1 = self.myTagMgr.get_tag(tagname=tagnames[0])
except Exception as e:
print("get_tag error: ", e.errcode)
try:
tag2 = self.myTagMgr.get_tag(tagname=tagnames[1])
except Exception as e:
print("get_tag error: ", e.errcode)
print("tagname: ", tag1.tagname, "descriptor: ", tag1.descriptor,"tagname: ", tag2.tagname, "descriptor: ", tag2.descriptor)
try:
self.myTagMgr.modify_alarm_tags_attributes(props=props)
except Exception as e:
print("modify_alarm_tags_attributes error: ", e.errcode)
else:
print("modifying alarm tags' attributes succeeds")
try:
tag1 = self.myTagMgr.get_tag(tagname=tagnames[0])
except Exception as e:
print("get_tag error: ", e.errcode)
try:
tag2 = self.myTagMgr.get_tag(tagname=tagnames[1])
except Exception as e:
print("get_tag error: ", e.errcode)
print("tagname: ", tag1.tagname, "descriptor: ", tag1.descriptor,"tagname: ", tag2.tagname, "descriptor: ", tag2.descriptor)