I'm working with the Vision Tag Browser Tree on an Ad Hoc trend in vision. Client has requested mouseover behavior that shows the tool-tip or documentation property of the tag that's being moused over, but I am at a loss for how to execute this. I expect I'll need to use a custom method and dig into the java component? Any thoughts or guidance would be appreciated. Cheers!
There's two halves -
First, you'll need to create a new rendering function for the tree, by providing a custom tree cell renderer. In theory, something like this:
from com.inductiveautomation.ignition.client.tags.tree.node.HistoricalProvidersNode import HistoricalTreeRenderer
class CustomHistoricalTreeRenderer(HistoricalTreeRenderer):
def getTreeCellRendererComponent(self, tree, value, isSelected, isExpanded, isLeaf, rowIndex, isFocused):
ret = HistoricalTreeRenderer.getTreeCellRendererComponent(self, tree, value, isSelected, isExpanded, isLeaf, rowIndex, isFocused)
ret.toolTipText = "Something Custom Here"
ret.text = "TESTING"
return ret
event.source.tree.setCellRenderer(CustomHistoricalTreeRenderer())
The value object will be a com.inductiveautomation.ignition.common.browsing.Result object. That result object does not have the tooltip or documentation of the tag - because the only backing source of information it has is the historian. The historian may or may not be delivering data from an Ignition tag, so you'll have to issue the reads to do that yourself.
Doing that in a safe way, since the tooltip rendering code is running on the event dispatch thread, is non-trivial.
I'll call it a graze, at best
I pulled the ripcord once I had the obvious in hindsight realization that the metadata OP is after won't already be there.
This is the Vision "Tag Browser Tree" component, not the tag browser. I was hopefully it might be an easy feature to add, but seeing Paul pull the ripcord is not inspiring a lot of hope.
Ahh, my mistake. I am seeing that behavior as well, but only when configured as "Realtime Tag Tree," not "Historical Tag Tree". That's exactly the tooltip behavior I want.
Unfortunately, when dropping the tag onto an ad hoc trend from a Realtime Tag Tree, it doesn't populate with a working historical tag path.
I'll tweak it a little more and see if I can get it before barreling down Paul's rabbit hole.