![]() Now, I just want to do the same thing on the other pen. I can see from my preview that my expression is working, so I'll go ahead and click okay here. Then I'll just link up the different parts of my final string using plus signs, and that's it. And in there, we'll just find our flex container and then our dropdown, and then pull that value property in. So, I'll put a break in the string right where it says machine one, and use that space to pull in a property. We just need one piece of it to be dynamic. And once I'm in there, I'll just paste in that path, put the whole thing in quotes to make it a string, and for those part, this is the right string to use here. So, I'll copy out the current source using Control C, and then click that chain link icon to pull up the binding interface and select an expression binding. So, to get our path to be indirect, we can just buy into that source property. If we'd like to configure indirection on the chart, we can drill down into the chart properties, specifically pens here, and then the first element, and then data, and then that source property is what controls what tag path we're looking at. These pens aren't currently tied to the dropdown in any way. Whichever approach you take, it's not too tricky to set up a power chart that looks at dynamic sets of tags based on a parameter. If we bind on the plots array property instead of the individual tag objects, we could use a script transform to populate the entire pen structure, which would allow us to make our solution a little more robust.įor instance, if each machine had a dynamic number of tags that we might want in our chart, we could use that script transform to pull them in. Just as one final note, it's possible to take an entirely different approach here. So, if I select a different machine in my dropdown, like so, it'll update the tags being shown on the chart. And that's it! That's all we need to do to make our chart indirect. Now, I just need to go in and change the temperature tag reference to a pressure tag reference. So I'll right click on that source property, say copy binding, and then open up my second pen here, go into the data property, right click on the source property there, and say paste binding. Now, one final bit of preparation I've done, I've pulled the temperature and pressure pens for machine one onto our chart, just to give us some sample pens to work with. So, if I go into preview mode and select machine two, for instance, then come out of preview mode and select the dropdown, we'll see that the string machine two ends up on that property. I've created a dropdown component that I've nested in a flex container across the top of my view here and that dropdown just allows the user to select a specific machine, which will end up on the value property of the dropdown. Now, I've taken some other steps, as well. Each instance has a temperature and a pressure tag. I've created a machine data type and currently I have four instances in my tag browser here. ![]() ![]() Now, to get us going I've done a little bit of work already. In short, we refer to this concept as an indirect power chart, meaning a power chart that is using indirection to pull different tag pens into the chart. In this lesson, we're going to be taking a look at a specific setup for a power chart, one in which the tag pens the chart is pointing at are tied to some kind of parameter.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |