Facility Control

 View Only
  • 1.  Pause a Dashboard Script Execution

    Posted 07-06-2023 16:18

    Hi all,
    I think I have a scenario where I 'might' be sending commands to an external device via the ogscript.asyncPost method to fast (I'm using the stringify function to assemble the commands). I'd like to be able to 'pause' and give the receiving device a set amount of time to act on the command.

    Is there a method like wait(milliseconds) that can be used?

    Thanks,



    ------------------------------
    JerryB
    ------------------------------


  • 2.  RE: Pause a Dashboard Script Execution

    Posted 07-07-2023 09:21

    Hi Jerry

    You have 2 options to pause scripts:

    1. Put each call into a separate task in your task list. Between each script task, add a "pause" task.
    2. Run your script in an asyncExec block and use ogscript.pause(milliseconds); between your calls (this is most easily done when working in ogScript as opposed to Visual Logic).


    ------------------------------
    James Peltzer
    Ross Video
    ------------------------------



  • 3.  RE: Pause a Dashboard Script Execution

    Posted 07-08-2023 06:32

    Question @James Peltzer ... Not played around with the opt. 1 of pausing for years now.
    But before, if you used the pause task and then a following task etc, you would lock down the dashboard until the pause was over, due to it not being on a different asyncExec.
    Has this been "fixed", and you no longer lock down the main exec while using this pause task?



    ------------------------------
    Aleksander Stalsberg
    Inland Norway University of Applied Sciences/Lillehammer Icehockey Club
    Norway
    ------------------------------



  • 4.  RE: Pause a Dashboard Script Execution

    Posted 07-10-2023 13:48

    Pause as a task type has always worked without blocking the thread (as far as I can remember). The ogscript.pause function call has been (and continues to be) disabled when running in the main user interface thread to avoid accidentally locking-up your application.

    This panel should work as far back as you care to go in DashBoard Custom Panels.

    <abs contexttype="opengear">
       <button buttontype="push" height="136" left="91" name="Pauses" top="169" width="290">
          <task tasktype="ogscript">ogscript.debug("Hello");</task>
          <task tasktype="pause">2000</task>
          <task tasktype="ogscript">ogscript.debug("World");</task>
       </button>
    </abs>
    


    ------------------------------
    James Peltzer
    Ross Video
    ------------------------------



  • 5.  RE: Pause a Dashboard Script Execution

    Posted 07-09-2023 15:17

    Thanks James - I'll give the ogscript route a try.



    ------------------------------
    JerryB
    ------------------------------