system.kanoa.quality.config.setChkItemDataSource(dataSourceInfo, userId)
Sets the tag a check item reads its value from without an attribute, replacing any it had. A check reads either an attribute's data source or its own tag, so a check linked to an attribute is refused.
Parameters
dataSourceInfo Dictionary
| - chkItemId | Integer | |
| - sourceTagPath | String | None or blank removes the check item's tag |
| - scaleFactor | Float | Can be None |
| - ignoreZeroValues | Boolean | A zero is read as no value. None is False |
| - enabled | Boolean | None is True |
userId Integer: Id of the user executing the function
Returns
(chkItemDataSourceId, msg): the id and None, None and None when the tag was removed, or None and the reason nothing was changed
Example
#Check 47 reads the line's supply temperature, which isn't specific to an asset
dataSourceInfo = {'chkItemId': 47, 'sourceTagPath': '[Kanoa]Utilities/Supply Temperature', 'scaleFactor': None, 'ignoreZeroValues': True}
userId = 5
chkItemDataSourceId, msg = system.kanoa.quality.config.setChkItemDataSource(dataSourceInfo, userId)
#Remove it again
chkItemDataSourceId, msg = system.kanoa.quality.config.setChkItemDataSource({'chkItemId': 47, 'sourceTagPath': None}, userId)