Now that we have both a Turbine Overview Display and Turbine Detail Display we would like to
have a way to jump directly from the overview display to the detail display. We would also
like this link to be able to automatically pass the context of the overview display to
the detail display. This way we can use our on-screen navigation collections to select
a turbine we are interested in and have a link that opens up the detail display
and automatically adjust the context to be the turbine we were looking at.
This can be done by leveraging PI AF and templates to create an attribute on our
turbine element that can be used to link to our Turbine Detail Display. That link can use
Vision URL parameters to adjust the context of the details display. To get started with
this we can minimize Chrome and open PI System Explorer by using the shortcut on the desktop.
Once opened we can select the Library tab in the bottom left. This is where all of our AF templates
are defined. We want to make our navigation link attribute on our turbine template so
this attribute can be applied to all turbines. In the element templates section you can see we have
templates configured for each level of our AF hierarchy, we have a template for our region,
farm and turbines. Let's select the Turbine template and now go to Attribute Templates.
Here we can see all the attributes that are set on the turbine template;
this means that every element created using this template will have all of these attributes.
You can also see that we have an attribute called Details URL; this is the attribute we will use to
create the link to the turbine details display. To create this link we will change our data reference
to URI Builder. The URI Builder data reference is a good choice for this because it will provide us
a UI for building out our PI vision URLs. Now we can click Settings to get started setting this
up. Here we can paste in our URL to our PI Vision Turbine Event Details display. We can grab that by
going back to Chrome and copying the URL from the address bar. Now we can hit continue. You can see
the UI automatically separates our Vision website URL and our display. This will be done provided we
have PI Vision selected as the type. To change the asset context with the URL we are going to
use the asset URL parameter. For its value we need something that will represent the full path to the
turbine element that we are using for the new context. This can easily be done by leveraging
substitution parameters to build out the full path to the element. %System% represents the
name of the AF server, %Database% represents the name of the database, and %ElementPath% is
the path to the element. Once everything looks correct we can press OK to define the attribute.
You may notice there's a second attribute called Details URL Yesterday, the purpose
of this attribute is to not only update the asset context but to also change the time of
the display to be the previous day. To define this attribute we can change the data reference
to URI builder just as before. Then we can click settings and here again paste our URL
to our PI Vision turbine events details display. Then, in addition to our Asset parameter we can
add a StartTime parameter and set its value equal to Y which corresponds to yesterday at midnight.
To update the end time we can add another parameter called EndTime and set that equal
to t which corresponds to today at midnight. To define the attribute we can press ok. Now let's
check in these changes and save them which will push them out to all of our turbines.
Now that we have created these attributes let's test them out in our Vision displays; to do this
we can first minimize System Explorer and go back into Chrome; then we can open our
overview display and now we can make an Asset Comparison Table for these new attributes. But
making the Asset Comparison Table it's recommended to make it using the same element that's already
selected on the display; so for this display our context is already set to NY001. So I'll
go there and select my new attributes. Now let's try changing the context of the display and using
these links to open the event details display. I'll change this from New York to Philadelphia
and select turbine PH001. Before navigating away I'll make sure to save my display and now I'll
click one of these links. You can see that the events details display opened up with the same
context as the overview display and now we are looking at the event frames from turbine PH001.
If we go back to the overview display we can also try the Details URL Yesterday attribute. You can
see again we pass the correct context and we also changed our start time to midnight yesterday and
end time to midnight today. You probably notice that when these attributes got pulled in we
see this icon. This indicates that it's a URL which means everything's working as expected.
I encourage you to check out other URL parameters in the URL parameter
reference in the PI Vision documentation and try those out on your displays.