Hi all,
Is there a way to get a list of Tag History providers in Perspective? For instance, using something like:
def getDatabaseTagList():
parentPath = '[System]Gateway/Database'
results = system.tag.browse(parentPath)
obj = [{'value':idx, 'label':results[idx]['name']} for idx, result in enumerate(results.getResults())]
return obj
Many of the names listed do not have historical tags associated and or are not recognized as a Historical Tag Provider.
I am using this code in the Script Console and manually going through the names found on the Developer GW:
path='histprov:Sim_Coater:/drv:Ignition-TWCGHMIDT01:default'
def one(path):
tag_paths = []
results = system.tag.browseHistoricalTags(path).getResults()
print(system.tag.browseHistoricalTags(path).getReturnedSize())
for result in results:
strPath = result.getPath()
print(strPath)
if result.hasChildren():
one(strPath)
one(path)
Most of them do have tags, and many throw a Nonetype object is not iterable.
What I am looking for is a way to create a dictionary object for a dropdown, so I can select the Provider, and run some cleanup scripts on the historical tags.
Thanks