Access PI Vision TimeProvider from iframe

I am working on an iframe embedded application which will set the start and end time range in the PI Vision display. From the embedded application, I would like to get a handle on the TimeProvider instance so I can call the timeProvider.requestNewTime() function.

 

Is is available somewhere in the window.top.PIVisualization object?

  • Found a solution. Here it is if anyone else runs into this.

    Add a global variable outside of the extension initialization

    var DisplayTimeProvider;
    
    (function (CS) {
        'use strict';
        var myCustomSymbolDefinition = {

    Set it

       ...
     symbolVis.prototype.init = function (scope, elem, displayProvider, timeProvider) {
    	DisplayTimeProvider=timeProvider;
            this.onConfigChange = myCustomConfigurationChangeFunction;
    ...

    Call it in your embedded page

    window.top.DisplayTimeProvider.requestNewTime('7/20/2024 00:00:00','8/22/2024 00:00:00')