11 Replies Latest reply on Jun 29, 2010 8:58 PM by ldieffenbach

    Link Docking Window & IDataProvider3 Add-Ins

    bpolaski
      We're looking to create a couple add-ins to mimic some of the functionality of the AF ERD plug-in.  Specifically, we want to create a docking window where the user selects a node from a tree, and this causes the tags used in the display to update accordingly.  Also, we would potentially like to save the list of nodes in the ProcessBook display.  The example Visual Studio templates show how to create a docking window and also the IDataProvider3 add-ins, but not how to make them work together. Does anyone have any examples of this?
        • Re: Link Docking Window & IDataProvider3 Add-Ins
          ldieffenbach

          Hi Brian. I'm the Product Manager for PI ProcessBook, so I wanted to ask a little about what you need to accomplish with a tree presentation.

           

          Were you aware that the current ERD search results will show nested children for a parent element? I'm wondering whether this will serve the purpose for which you wanted to develop a tree presentation. Also, the PI WebParts product offers a tree of AF elements, so you could drive a PI Graphic display built in PI ProcessBook using a tree there.

           

          You may also be interested to know that we just released a patch to the ERD add-in that better handles automation to feed the selected contexts from the ERD to ProcessBook. A support bulletin just went out last week, I believe.

           

          Regards,

           

          Laurie Dieffenbach

            • Re: Link Docking Window & IDataProvider3 Add-Ins
              bpolaski

              Laurie,

               

              The main reason we want to write our own tree isn't directly related to AF.  The customer already has a SQL Server database that defines a hierarchical configuration that they use for their Sharepoint site.  We were looking at the possibility of referencing this database directly instead of copying the structure over to AF.  This way we eliminate the need to create the code that creates and updates AF with the data/changes to the hierarchy in their SQL Server database.

               

               

                • Re: Link Docking Window & IDataProvider3 Add-Ins
                  ldieffenbach

                  Thank you, Brian. That is helpful information. Did you get the information you needed to accomplish your goal? There are some papers posted here on vCampus about writing custom add-ins, but I didn't know whether they provided what you needed.

                   

                   

                   

                  Regards,

                   

                  Laurie

                    • Re: Link Docking Window & IDataProvider3 Add-Ins
                      bpolaski

                      Laurie,

                       

                      The examples on the docking window and IDataProvider3 are good, but I didn't find anything that shows how to link the two.  Is there anything like that hanging around elsewhere?

                       

                       

                        • Re: Link Docking Window & IDataProvider3 Add-Ins
                          ldieffenbach

                          Hi again, Brian.

                           

                          I'll see if the development team has anything else that can be posted for you. In the meantime, you might check the vCampus Live archives from 2008, when there was a presentation on building ProcessBook add-ins that featured both docking windows and custom datasets. I don't remember whether the two were connected in that talk.

                           

                          I'll let you know what I come up with.

                           

                          Regards,

                           

                          Laurie

                            • Re: Link Docking Window & IDataProvider3 Add-Ins

                              These add-ins don't get "connected" per se... they can leverage each other but they are in fact totally independent add-ins. The IDataProvider3 add-in adds a new Data Set in PI ProcessBook, which can be used by users (in symbols like the Trend, the Value, the Bar, etc.) and by developers (in VBA automation or in .NET add-ins such as a "Docking Window" one).

                               

                              Take the AF2 data set for example... it's a .NET add-in that implements IDataProvider3 (see "AF 2.x Data Set" in Tools > Add-In Manager) and it shows up as "AF2" under Tools > Data Sets and in any configuration dialog for dynamic symbols such as the Value or the Trend. For a Docking Window add-in to make use of it is just a matter of configuring dynamic symbols with the appropriate configuration string (e.g. AF2.<path_to_the_AF_attribute>;<UoM>).

                               

                              Hope this addresses your question... are you thinking of some other type of interconnection/linkage between add-ins?

                              • Re: Link Docking Window & IDataProvider3 Add-Ins

                                Hi Brian,

                                 

                                Depends on what linking you want.

                                 

                                The data provider can be configured at a couple of levels, the dataset level (for settings that effect dataset directly) and then column level.  If you have a docked window addin that you want to interact with your data provider then you would be looking to modify the column value to reconfigure symbols.  If you want to go a step up and reconfigure all symbols using your data provider, you would store some kind of property at the dataset level (I guess even hidden in a column).

                                 

                                So, your logic for accessing data is put in your data provider assembly.  Your logic for forming a correct column name for the dataset should be shared between both assemblies (data provider & docked window), possibly via an intermediate assembly.  If you look at the ERD data provider, you have the "E" dataset that handles access to AF.  I assume that OSI are using some method for storing the element of interest (maybe a column that has an af path to the element of interest); this column value is referenced when the GetData method is called by ProcessBook.  Then the ERD docked window addin will simply modify the column containing the af path thus next time "Refresh" or "GetData" is called, it will update the data accordingly.  Well this is how I would have done it. 

                                 

                                Me being me though, for your particular issue I would still go with AF - using the AF2 dataset and the AF Table Data Reference.  Obviously I don't have enough detail on your particular scenario.

                                 

                                 

                                 

                                Edit: I see Steve posted above too along the same lines of thought....great minds think alike!

                                 

                                 

                                  • Re: Link Docking Window & IDataProvider3 Add-Ins
                                    ldieffenbach

                                    Thanks for your input, Rhys. And Steve, too, of course.

                                     

                                    Brian, are you looking for ways to set the context of a symbol by linking the item selected on a tree (in the docking window) to the custom dataset used to configure a symbol? If that's where you're stuck, you might look into the ContextResolver objects as well as the NamedValues collection. Those are the means by which the Module Relative Display (MRD) and Element Relative Display (ERD) add-ins dynamically change the data stream referenced by a symbol.

                                     

                                    Let me know if that's what you're looking for.

                                     

                                    Regards,

                                     

                                    Laurie

                                      • Re: Link Docking Window & IDataProvider3 Add-Ins
                                        dhollebeek

                                        Just a further note.  There is no need to write two separate add-ins for something like this.  The ERD add-in for example contains a docking window, a custom dataset, and a context resolver all in the same add-in.  I don't have any examples for this, but basically if you took the dataset and the docking window templates and combined the code so that you had one addin with one Connect object that created both the docking window and the dataset, then you can pass references to each other in the constructors so that the two can call methods in another.  It just all gets simpler if everything is in the same assembly.

                                        • Re: Link Docking Window & IDataProvider3 Add-Ins
                                          bpolaski
                                          Laurie/David, Thanks for the info - we are looking for ways to set the context of a symbol by linking the item selected on a tree (in the docking window) to the custom dataset used to configure a symbol. Are there any examples of using the ContextResolver objects?
                                            • Re: Link Docking Window & IDataProvider3 Add-Ins
                                              ldieffenbach

                                              Brian,

                                               

                                              Unfortunately, we don't have any extended examples of using the ContextHandler objects, just what's in the pipbvb.chm VBA help file (in terms of the available properties, methods, syntax, etc.). Hopefully, the information in the help file can get you started.

                                               

                                              Also, consider David's suggestion of combining the custom dataset with the docking window code.

                                               

                                              Regards,

                                               

                                              Laurie