Facility Control

 View Only
  • 1.  Game Clocks in Dashboard

    Posted 01-11-2017 23:03
    I have a radio button that will set a countdown clock to either 20:00 (15000000) or 10:00 (600000). I also have a reset button that calls the reset timer function. However, the reset button will always reset to 20:00 even if I have selected the clock to only be 10 mins. I tried a script to set the time based on the value of the radio button (0 or 1), but that didn't seem to work either.

    Any thoughts?

    Thanks!
    Brian


  • 2.  RE: Game Clocks in Dashboard

    Posted 01-12-2017 22:16

    Are you just setting the time on the timer or are you changing its start time?
    Here is an example that sets the timer such that reset will restore it to whichever start time I most recently specified:

    <abs contexttype="opengear" style="">
       <meta>
          <params>
             <param access="1" maxlength="0" name="cddisplay" oid="cddisplay" type="STRING" value="39:58" widget="label"/>
             <param access="1" maxlength="0" name="cdvalue" oid="cdvalue" type="STRING" value="40:00" widget="text"/>
          </params>
       </meta>
       <timer autostart="false" id="cdtimer" pattern="mm:ss" rate="500" start="999:59" stop="00:00">
          <timertask tasktype="ogparamset">params.setValue('cddisplay', 0, event.getDisplay());</timertask>
       </timer>
       <param expand="true" height="60" left="40" oid="cddisplay" style="style:timerLabel" top="40" width="120"/>
       <param expand="true" height="60" left="40" oid="cdvalue" top="120" width="120"/>
       <button buttontype="push" height="60" left="180" name="Start / Pause" top="40" width="120">
          <task tasktype="ogscript">var timer = ogscript.getTimerManager().getTimer("cdtimer");
    if (!timer.isRunning())
    {
       timer.startTimer(false);
    }
    else
    {
       timer.stopTimer(false);
    }</task>
       </button>
       <button buttontype="push" height="60" left="180" name="Set Countdown" top="120" width="120">
          <task tasktype="timercontrol">var startValue = params.getValue('cdvalue', 0);
    var timer = ogscript.getTimerManager().getTimer('cdtimer');
    var parsedStartValue = timer.getFormat().parseObject(startValue);
    timer.setStart(parsedStartValue);
    timer.setTime(parsedStartValue);</task>
       </button>
    <button buttontype="push" height="140" left="320" name="Reset" top="40" width="80">
          <task tasktype="ogscript">var timer = ogscript.getTimerManager().getTimer('cdtimer');
    timer.resetTimer();</task>
       </button>
    </abs>

    #DashBoard


  • 3.  RE: Game Clocks in Dashboard

    Posted 01-12-2017 23:08
    I'll look this over... as the panel is being set up, the user would be selecting Men's or Women's - which would drive the time (20 mins vs 10 mins). So based on that radio button - the reset button would need to reset the clock to 20 or 10.
    #DashBoard