5 Replies Latest reply on Aug 2, 2009 11:27 PM by JLG

    Differentiating User Selected Tabs Vs Script Selected Tabs

    JLG

      Title

      Differentiating User Selected Tabs Vs Script Selected Tabs

      Post

      I have a program displaying facility equipment status (Out of Service, Run, Standby,etc) and it uses a layout with four tabs to display all the information.  The tabs are selected via a script with a short time delay and a loop so the information can all be seen by a user with no input (big screen display).  But sometimes the user needs to look a particular tab longer to get more details.  I have tried using a script trigger on the tab to activate a longer time delay script when the user clicks on a tab.  Only problem is the script running the loop also activates the script trigger (which starts the longer delay) when it moves to the next tab.  So my question is how to differentiate between when a script selects a tab (via go to object) verses when a user clicks on the tab?  Currently I am using buttons for pausing and resuming the loop script.  But was hoping for a better way.

       

      Thanks.

        • 1. Re: Differentiating User Selected Tabs Vs Script Selected Tabs
          gunnerstudio
            

          Hey JLG

           

          thanks for you post.

           

          Since it is bit of programming innvoled to make Script triggers for a Tab Control.

           

          would it be better off designing different layout that looks like tabs. (create x Noi of duplicates of your current layout )Then you can control each layout with script triggers on the designed Tab.

          you can add a Pause/Resume button. with a nice red button for stop and a nice green for start. :)

           

          hope that helps

           

          Kind Regards

          Gunner. 

          • 2. Re: Differentiating User Selected Tabs Vs Script Selected Tabs
            JLG
              

            Thanks for the reply.  Really hoping I had just missed something on the script trigger (maybe differences between types).  Also like the smooth transition using the built in tab control.  Guess I will just stick with the pause/resume button they are currently using before trying to change the layouts.

             

            Thanks,

            -=J

            • 3. Re: Differentiating User Selected Tabs Vs Script Selected Tabs
              JLG
                

              Just thought of a possible simple solution.  How about setting up a global variable as a switch.  On the script with the loop that transitions between tabs, before the go to object turn the swith off and then back on before the pause timer.  Then on the script trigger with the longer delay for data entry, test to see if the switch is on or off before continuing.  That way, the script trigger would ignore when the tab is selected via the loop script.

               

              -=J

              • 4. Re: Differentiating User Selected Tabs Vs Script Selected Tabs
                comment_1
                  

                JLG wrote:

                How about setting up a global variable as a switch.


                That would be my approach, too. This will NOT prevent the triggered script from running, though. The trick is to make the triggered script look at the variable and act accordingly. For example, you could make your looping script select tabs this way:

                 

                ...
                SetVariable [ $$autoSwitch ; 1 ]
                Go to Object [ <next tab> ]
                SetVariable [ $$autoSwitch ; "" ]
                ...

                then place the entire triggered script inside an If block:

                If [ not $$autoSwitch ]
                # actual script steps here
                End If

                 

                This way, the triggered script will exit immediately - unless it was triggered by user switching a tab while the looping script is paused.





                • 5. Re: Differentiating User Selected Tabs Vs Script Selected Tabs
                  JLG
                    

                  Worked great!  Thanks for everyone's input!

                   

                  -=J