So i am building a view that i will use for pointing at different pump stations based what was selected by the operator. Each pump station has varying amounts of pumps on them. Some will have just one, and others up to 4.
I am building the main view to contain 4 pumps since it is the max but i cant figure out if there is a way to hide extra pumps if I am pointing to a station that lets say has only 2 pumps?
What is the best way to do this? Is it even possible in Perspective?
I would also like to use this method for things like alarming indicator labels when one station has a generator and another doesn't, I would like to hide the generator alarm component if there is no tags for it.
Hopefully this all makes sense.
But I really want to avoid building out separate screens for each individual station, as building just one and having it point to the correct station is a big plus for using perspective.
You can also dynamically generate content based on what tags are defined within a folder in your tag database. The general use case would be to structure a section of your tag database with folders and dynamically create instances of a template. In this example I did that using a flex repeater to create instances of a template and pass in the parameters required to indirect bind the template.
You just manually create an instance in your flex repeater and copy/paste that node to notepad to get the json structure. Then you make your script populate it dynamically in a transform.
Unfortunately what everyone recommended did not work for me..
I was able to figure it out through an expression on the Display Property of the object.
This is it for anyone who needs this feature in the future.
Note that you shouldn't need this extra indirection/bitwise trickery - we overload the equality operator for quality codes, so qualityOf({value}) = "Bad_NotFound" or qualityOf({value}) = 519 should both work the same.
Don't use tag in an UI binding. Create an additional indirect tag binding on a custom property and then use an expression on display that brings in that custom property and does your isNull logic.
Basically, the tag() function is slow, and will slow down the rest of your UI disproportionately if overused. There are rare circumstances where it's appropriate, but Perspective isn't one of them.
Okay i see! This will definitely be overused, would you mind giving an example or explaining a little more in detail of how to go about the way you mentioned with
"Create an additional indirect tag binding on a custom property and then use an expression on display that brings in that custom property and does your isNull logic."
Create a custom property on the same component you're already working with.
Add an indirect tag binding to it; this will replace the tag() function - give it the "[default]Lift Stations/" + {view.params.stationName} + "/Pump3" part of your expression. Tag Bindings in Perspective | Ignition User Manual
In the expression binding you already have on the display property, use the property selector to reference that custom property with the indirect tag binding on it, instead of the tag() function call. So it'll become something like: !isNull({path.to.custom.property})