When I configure a mouse action for a component, FPMI gives me the following property string: --set this property: {$.border}
Since I am setting the border of the container of this object, I presume that the syntax “$” moves me up one level in the project tree. In another place, “$\” moves me up two levels in the tree.
I tried a similar syntax to get a property state in a SQL query for binding, but FPMI always returns an error stating that “the property is not defined or not bindable for component ‘Root Container’”. Any number of “” (or none) gets the same response. Is there some way to do this?
Yes, that relative path syntax only works in Jython action builders.
For SQL queries (and all other types of bindings), simply press the property link button (it looks like a little chain link in the upper-righthand corner of the window) and browse for the property you want to bind into your query.
Yea, I know that one. However, I wonder whether it might save me headaches later (when I try to reuse grouped components and components with dynamic properties) if I could just refer to a property of “this” component or the container of this component, making the reusable component more generic.
I do see that grouped components maintain their relationships (query items get renamed) when they get copied, so maybe I don’t need this, but I do wonder if it’s possible.
Actually, references in bindings are much smarter than those in jython scripts. They aren’t a literal text path (hence the “renaming” effect that you’ve noticed), they are a symbolic link to the component that you are binding to. So, if a component has a property binding that references itself, and you copy that component, the copy’s binding will reference the copy, not the original, just like you’d want it to do. If a component has a binding that references its parent, and you copy the parent, the new inner component’s binding will reference the new parent.
To make a long story short, the answer is “yes” it is possible, in fact, that is how it always works.
I still think that this would be useful, especially when copying and pasting bindings between components.
In my case, I have an EasyChart on the page with a bunch of analogue transmitter templates arranged in a P&ID. The analogue transmitter PV is trended on the chart, but clicking on it will show/hide the pen.
I have a chart icon also inside the template to show the colour of the pen, and this is bound to the Colour template parameter. I then need to bind the Colour parameter to a lookup expression to lookup the colour from the chart’s tagpens dataset. I can’t see how this is possible to do in the template (this template will only ever by used on this one page, so this would have been a valid solution), and so instead I need to bind the parameter for each one and change the binding arguments for each due to the clipboard still holding onto the symbolic reference that I copied it from (in effect it’s an absolute reference for all intents and purposes). If we could use relative referencing instead, then I’d only need to paste the bindings.