22 Replies Latest reply on Feb 12, 2010 3:33 PM by cescamilla

    Custom webpart with Trend & TimeRangeWP

    ztelo

      I have a page with 3 webparts : TimeRangeWP, Trend and a custom webpart GridWP. The GridWP is connected to the Trend. A user selects pi point from the GridWP, he clicks sur "Envoyer" button. The pi points are displayed on the trend. see photo below:

       

       question_2D00_tr.bmp

       

      When i change the starttime in the TimeRangeWP and click on the Aplly button the trend display nothing! it lost the pi points that the GridWP sent to it. See photo below:

       

      question_2D00_tr1.bmp

       

       

       

      the Message in the Trend:

       

       question_2D00_tr1_2D00_msg.bmp

       

      How can i resolve this issue?

       

       Note:I have this issue after installing the new version of osisoft webpart Pi-WebPArt3.0.

       

      In the previous version i do not have this issue.

       

       

        • Re: Custom webpart with Trend & TimeRangeWP
          cchisholm

          If this is a client side connection, can you tell us what is in your _raiseParametersOut() function? Specifically, in the debugger select 2 tags and click Envoyer. What is the value you are sending in parametersOutReadyEventArgs.ParameterValues[0]?

           

          If it's a server-side connection we need the same information except you should look in the PartCommunicationMain() method.

            • Re: Custom webpart with Trend & TimeRangeWP
              ztelo

              This is a server side connection. the value in parametersOutReadyEventArgs.ParameterValues[0] is : pv151;pv152

               

               

                • Re: Custom webpart with Trend & TimeRangeWP
                  cchisholm

                  I can't reproduce your problem. In the picture below I'm using a Form Web Part to send a list of  PI tags.

                   

                   

                   

                  Can you do the same thing? That should tell us if the problem is in your custom web part.

                    • Re: Custom webpart with Trend & TimeRangeWP
                      ztelo

                      After you click on the Go button of your FormWebPArt the trend will display the graphe.

                       

                      Now, Try to change the date in the TimeRangeWebPart, and press on the Apply button... you will see that the trend did not display the graphe. I think because the trend has lost the list of pi tags.

                       

                       

                       

                      I was able to do that in the previous version (Rtwebpart 2.0).

                       

                       

                        • Re: Custom webpart with Trend & TimeRangeWP
                          cchisholm

                          I don't see the same behavior that you do. Here is a video of me configuring a web part page as you describe. It works perfectly for me.

                           

                          The video is attached to this post. Please watch it and verify you are setting up your page the same way.

                           

                           

                            • Re: Custom webpart with Trend & TimeRangeWP

                              Chad Chisholm

                              The video is attached to this post. Please watch it
                              Please note that you should right-click on the file and select "Save Target As..." to save it to your local machine. Due to the authentication mechanisms used by vCampus, Windows Media Player (or whatever your default player for .WMV files is) is probably not going to be able to play the file if you just click on it...

                              • Re: Custom webpart with Trend & TimeRangeWP
                                ztelo

                                I watched your video. I noticed that the FormWebPart keeps the list of pi points after clicking the Go button.

                                In my case, the Form webPart not keep a list of tags after pressed at the Go button. So when I press the Apply button of TimeRageWebPart, no longer shows the trend curves.

                                 

                                see photos below:

                                 

                                1- after entering pv152;pv152 in the FromWebPart and clicking on Go button. (Note that the Form webPart not keep the pv151;pv152 after clicking on Go)

                                 

                                formavant.bmp

                                 

                                 

                                 

                                2- after clicking on Apply:

                                 

                                formapres.bmp

                                 

                                Do you think that the Trend is supposed to keep the list of pi points (pv151;pv152) to be able to display them in the case if we change the date in TimeRangeWP?

                                  • Re: Custom webpart with Trend & TimeRangeWP
                                    cescamilla

                                    Could you try setting the "Do not replace ad-hoc trends" to checked in the trend configuration?

                                     

                                    but I would like to see if they do stay set when you set it to this.

                                      • Re: Custom webpart with Trend & TimeRangeWP
                                        ztelo

                                        Do you mean "Replace Ad Hoc Traces"?

                                         

                                        This box is selected by default.

                                         

                                        I deselected it, the new pi points are added to those sent previously. This does not resolve my issue.

                                         

                                        BUT I have a question:

                                         

                                        I keep box "Replace Ad Hoc Traces" checked. So data sent from FormWebPArt replaces data traces previously sent to a trend.

                                         

                                        I have two scenarios for my question:

                                         

                                        The first is when i keep the pi points in the FormWebPart after clicking on Go button;

                                         

                                        The second is when i do not keep the pi points in the FormWebPArt after clicking on Go button;

                                         

                                         

                                         

                                        For the first scenario:

                                         

                                        1- I entered a pi point pv151 in the FormWebPart then I clicked on Go button, The trend displays the graph. go1.bmp

                                         

                                        Now if i change the startTime of the TimeRangeWebPart and I click on Reply Button, the trend keeps the graph.

                                         

                                        apply1.bmp

                                         

                                         

                                         

                                        For the second scenario:

                                         

                                        2- (is same as 1 but now the FormWebPart DOT NOT have the pv151 after clicking on Go button)

                                         

                                        I entered a pi point pv151 in the FormWebPart then I clicked on Go button,  The trend displays the graph. Now, BEFORE I CLICK ON APPLY, I ERASE THE PV151 pi point FROM THE TEXT BOX OF THE FORMWEBPART.>

                                         

                                        go2.bmp

                                         

                                        Now if i change the startTime of the TimeRangeWebPart and I click on Repply Button, the trend LOSES THE GRAPH OF the pv151 pi point.

                                         

                                        apply2.bmp

                                         

                                        I understand that when i click on the Reply button, the FormWebPArt (connected to the trend) resends the pv151 to the trend?? In other word, the FormWebPArt recommunicates the data to the trend by executing the PartCommunicationMain method?

                                         

                                        Why the trend does not keep the pv 151 pi point?

                                          • Re: Custom webpart with Trend & TimeRangeWP
                                            cescamilla

                                            Question:
                                            What happends if you input text in the Form Web Part *whitout* clicking on go, and set the timerange part to '*-5h' to '*' and then click on the Apply button?

                                             

                                            Does the trend do both? add a tag and move time range?

                                              • Re: Custom webpart with Trend & TimeRangeWP
                                                ztelo

                                                in this case, the trend does not add tag and move time range.

                                                 

                                                apply3.bmp

                                                  • Re: Custom webpart with Trend & TimeRangeWP
                                                    cescamilla

                                                    Umm, that is interesting, but I guess I'll go on and nudge someone on the webparts team :)

                                                     

                                                    Just another question while I go there, if you do add a tag, go, change range, apply, change the tag name, (do not press GO), apply (on the time range) does the tag change in the trend?

                                                     

                                                    I'm still not sure if it does send or not the tag each time, or if it really depends on the webpart being called first or not. being cleared, or otherwise.

                                                      • Re: Custom webpart with Trend & TimeRangeWP
                                                        ztelo

                                                        yes.

                                                         

                                                        if you do add a tag (pv151), go (the graph is displayed on the trend with the start time *-2h), change range (*-5h), apply (the time is changes on the trend), change the tag name (now the tag name is pv152), (do not press GO), apply (on the time range) does the tag change in the trend? yes the pv152 is displayed on the trend with the time 5h

                                                         

                                                        i think, this proves that the trend does not keep the data when the Apply button is clicked..

                                                          • Re: Custom webpart with Trend & TimeRangeWP
                                                            cescamilla

                                                            I would have expected the web part to do exactly that, I've seen in some experimentes that the webparts DO reconnect to all webparts when a change occurs and recalculate all data, including the tag names, but since the Web Form has no "cache" to the tag values you are passing it won't be able to re send them when you click on apply.

                                                             

                                                            Is the originating webpart one made by you?

                                                              • Re: Custom webpart with Trend & TimeRangeWP
                                                                ztelo

                                                                My webpart does not re send data to the trend when the Apply button is clicked. I thought that the trend must keep data when I change the date in the timeRangeWP and click on Apply.

                                                                 


                                                                I have made a change in my webpart in order to resend the data when the Apply is clicked. It works fine.  BUT I am not convinced by that logic because the TimeRangeWP is concerned only by the trend (witch need the time) and not the FormWebPArt or my custom webPart GridWP (a datagrid webpart).

                                                                 

                                                                 

                                                                  • Re: Custom webpart with Trend & TimeRangeWP
                                                                    cescamilla

                                                                    I'm curious, What did you specifically change in your webpart?

                                                                     

                                                                    I would really like to try this on my own testing enviroment and your sollution amoungst other things. :)

                                                                     

                                                                    Care to share?

                                                                     

                                                                    I would really like to know if you did implement the passing of parameters using a private variable that gets assigned when you click on the button or if you passed the values directly from the object.

                                                                      • Re: Custom webpart with Trend & TimeRangeWP
                                                                        ztelo

                                                                        i test in the PartCommunicationMain method if the button "Envoyer" was clicked. if clicked then i call a method that check for the selected rows in my Grid. So this prevent my webpart to resend data to trend when the the Apply is clicked.

                                                                         

                                                                        See code below:

                                                                         

                                                                        if (_parametersReadyButtonClicked) //ParametersOutReady Button was clicked
                                                                        {
                                                                                               
                                                                            if (parametersOutReady != null)
                                                                            {                   
                                                                                parametersOutReadyEventArgs.ParameterValues = new string[1];

                                                                         

                                                                                parametersOutReadyEventArgs.ParameterValues[0] = GetSelctedTagList();//return a list of pi point ex:pv151;pv152;pv153
                                                                              
                                                                                                   
                                                                                // Fire the ParametersOutReady event.
                                                                                parametersOutReady(this, parametersOutReadyEventArgs);

                                                                         

                                                                                _parametersReadyButtonClicked = false;
                                                                             }
                                                                        }

                                                                         

                                                                        To be able to resend the data i deactivated : if (_parametersReadyButtonClicked).

                                                                         

                                                                         

                                                                         

                                                                        See below my webpart

                                                                         

                                                                        grid.bmp

                                                                          • Re: Custom webpart with Trend & TimeRangeWP
                                                                            cescamilla

                                                                            Ok, if I'm not mistaken the PartCommunicationMain is always accesed when there are changes in the web page.

                                                                             

                                                                            usually it is recommended to have a flag that will tell you if the webpart is connected. if it is not connected or if it has no parameters then you may skip this, but you may not skip it assuming that the parameters would be kept in the destination webpart, this is a design feature and is true for all webparts, is not specific to ours.

                                                                             

                                                                            So you may have to rethink the logic you had there, or even better, try debugging the webpart and see how many times you hit that part, hopefully you'll get as amazed as I was when I got the chance to try that out!