I am creating a template with Indirect tag bindings. The goal is to have a user click on a pump and a popup will open of a template to auto populate the tags within the template.
I have been making progress using custom parameters and the indirect tag bindings. However, I have ran into an issue where I need a button to change colors based if it is pressed or not. This button needs to see if the pump is in “Hand” AND if the pump is on or off. So if the pump is in “HAND” and you press the “ON” button, the button will change colors to signify the pump is on.
I have very limited knowledge when it comes to expressions and scripting so I came up with the following expression for this:
If the pump is NOT in “Auto” AND the pump is “On”, this will bring back a value of 1 which I can transform into a color.
So to make this an indirect binding, I would change the “SBS_PUMP_1/DS_AUTO” and the “SBS_PUMP_1/DI_ON” with the parameter in the template. So it will look like:
Use indirect binding to bring those booleans to custom properties in your template. (Internal or on the template’s components.) Then use those properties in your expressions.
Create view custom properties for each boolean that would otherwise need the tag() function. Use indirect binding to combine your static and dynamic tag path parts for those booleans to bring their live data into the view. Then construct your expression with those properties in place of the tag() expressions. It also eliminates multiple identical tag() expressions when you use a particular boolean in more than one spot in the expression.