Facility Control

 View Only
  • 1.  how would i connect a graphic to cue when a timer hits a certain value that is input by the user?

    Posted 11-10-2020 22:42


  • 2.  RE: how would i connect a graphic to cue when a timer hits a certain value that is input by the user?

    Posted 11-11-2020 14:09

    Here is a panel that outputs a debug statement when a timer hits a value specified by the user.   Use Views->openGear Debug Information to see the debug console.

     

    <abs contexttype="opengear" gridsize="20" id="_top" keepalive="false" style="">
    <timer autostart="false" id="Countdown" pattern="HH:mm:ss" rate="1000" start="00:00:10" stop="00:00:00">
    <timertask tasktype="ogparamset">params.setValue('time', 0, event.getDisplay());</timertask>
    <timertask tasktype="timercontrol">timer = ogscript.getTimerManager().getTimer('Countdown');
    if (timer.getCurrent() == params.getValue("cueTime",0) * 1000) {
    ogscript.debug("SEND TAKE COMMAND TO XP");
    }

    </timertask>
    </timer>
    <meta>
    <params>
    <param access="1" maxlength="0" name="time" oid="time" type="STRING" value="00:00:00" widget="label"/>
    <param access="1" constraint="0.0;10.0;0.0;10.0;1" constrainttype="INT_STEP_RANGE" name="Cue Time" oid="cueTime" precision="0" type="INT16" value="3" widget="default"/>
    </params>
    </meta>

    <param expand="true" height="60" left="300" oid="time" style="style:timerLabel" top="100" width="260"/>
    <button buttontype="push" height="60" left="580" name="GO" top="100" width="120">
    <task tasktype="timercontrol">ogscript.getTimerManager().getTimer('Countdown').startTimer(true);</task>
    </button>
    <param expand="true" height="60" left="60" oid="cueTime" showlabel="false" top="100" width="200"/>
    <label height="20" left="60" name="Do Action at: " style="txt-align:west" top="80" width="200"/>
    </abs>

     

     

    As you can see, the timer has a task.   I set the frequency of the timer to be every 1000 ms, so that task runs once per second.   Every time the task runs, I check if the current time is the same as the value set by the user in a parameter.   If it is, then I do the debug statement.

    Instead of the debug statement, you'll likely want to send a command to your graphic engine.   It's not clear if you are using XPression, or something else.    If it's XP, then you can just send a RossTalk command to XP:

    Something like:

    rosstalk.sendMessage("1.2.3.4", 7788, "TAKE 1001");

    Where 1001 is the takeid of the graphic, and 1.2.3.4 is the IP of the XPression machine.

     


    #DashBoard


  • 3.  RE: how would i connect a graphic to cue when a timer hits a certain value that is input by the user?

    Posted 11-14-2020 21:18

    would all of the code be under one source code for the timer? 


    #DashBoard


  • 4.  RE: how would i connect a graphic to cue when a timer hits a certain value that is input by the user?

    Posted 11-16-2020 14:13

    I don't have much context as to what you are doing, so it's hard to say.

    Everything that needs to be timed by the timer would be in the source code for the timer.

    If you need something else to be triggered by something else (like a button press), then the code for that trigger would go with the button.

     


    #DashBoard


  • 5.  RE: how would i connect a graphic to cue when a timer hits a certain value that is input by the user?

    Posted 11-27-2020 18:21

    So I made an up and down button[connected to XP] and i want to connect it to this timer so that if the user wants the next graphic to display, they can click the down button and then input a time and then click go and the next graphic will display at that time. Is there some way to do this?


    #DashBoard