5 Replies Latest reply on Dec 29, 2010 12:23 AM by Ahmad Fattahi

    How to set maximum value for Time Range Scroll

    nfilatov

      When I try to set maximum value of Time Range Scroll like this:

       
                  PBCommandBar pbBar;
                  pbBar = CommandBars.Item("Time Range Toolbar");
                  m_pbScroll = (PBCommandBarScroll)pbBar.Controls.Item("Time Range Scroll");
                  m_pbScroll.Max = 100;
      

      it is doesn't set and always equal 10 000. How to do this correctly?

        • Re: How to set maximum value for Time Range Scroll
          Ahmad Fattahi

          By adjusting Max are you trying to adjust how long/wide the scroll shows up visually? If yes, then "width" and "height" should be the answers. If not, would "SetTimeRange" method be what you are looking for?

            • Re: How to set maximum value for Time Range Scroll
              nfilatov

              I am talking about Time Range Scroll, but I want to use it for scrolling only in limited time range. And I want to set that ranges. Is it possible?

                • Re: How to set maximum value for Time Range Scroll

                  @Nikolay: I observed the same behaviour when I tested that yesterday (same for the .SmallChange and .LargeChange properties, actually). I contacted the escalation team to see if they can shed some light on this - no response so far, but I know it's pretty busy for the few people who are not on vacation, this close to the Holidays ;)

                   

                  That said, changing the Max property would not exactly allow you to "scroll in a limited time range". As far as I know, there is no programmatic way to change this setting through ProcessBook's automation interface. However, you can use the "Time Range Scroll" section of the ProcBook.ini file, to set the minimum/maximum time that can be scrolled using the time range scroll bar (must be valid PI time strings):

                   

                  ProcBook.ini

                  [Time Range Scroll]
                  TimeRangeMin=*-100d
                  TimeRangeMax=*+10d

                   

                  Hope this helps!

                    • Re: How to set maximum value for Time Range Scroll
                      nfilatov

                      Thank you for your answer, Steve. But I need to set Time Range for scroll dynamical in code of add-in becouse I don't know start and end time of my oscillogramms until its will be add to Display.

                        • Re: How to set maximum value for Time Range Scroll
                          Ahmad Fattahi

                          The scroll range control is initialized when a display is opened (see PIDisplay::InitializeTimeRangeScroll()) . The minimum and maximum times for the slide control are read from the PRocbook.ini [Time Range Scroll] section, as Steve pointed out. There is no way to set these programmatically from the application object.  

                           

                          The following properties: Min, Max, LargeChange, SmallChange, and ScrollTipText  of the PBCommandScroll object can't be set if the control is a "built in" ProcessBook control (PBCommandScroll::BuiltIn property); which the scroll time range is. If you build your own control of this type then these properties are settable.    

                           

                          In PIDisplay::DoTimeRangeScroll it looks like PB uses the display object  min and max variables and not the time range scroll Min/Max settings, which it inherits from PISECScrollBtn,  to determine the  point resolution between the scroll control and the time range. This is hard-coded behavior.

                           

                          I hope it answers your question