Facility Control

 View Only
Expand all | Collapse all

DashBoard Text Field Updates Xpression Clock Timer Widget

  • 1.  DashBoard Text Field Updates Xpression Clock Timer Widget

    Posted 12-08-2021 15:52
    Hail and Well Met,

    I'm a DashBoard and Xpression newbie so please forgive me if this is a silly question. 
    I'm trying to create an editable text field in a custom DashBoard panel that updates a clock timer widget in Xpression whenever an operator enters text into it (HH:MM:SS format). I'm able to achieve this using a Choice Parameter button and assigning GPI/RossTalk numbers to the various times, but I was hoping to give our operators the option to fully customize the timer via DashBoard.

    ------------------------------
    Nick Kubinski
    ------------------------------


  • 2.  RE: DashBoard Text Field Updates Xpression Clock Timer Widget

    Posted 12-12-2021 14:51
    Is this a countdown timer or a count up? To my mind, setting the time is easy, but you will need to trigger the countdown. Fill me in a little and I will see what I can do. Actually, we could use a little scripting that would start the timer as soon as you changed the data. Let me know.

    ------------------------------
    Malcolm Thorpe
    Free Lance Xpression Designer/Carbonite TD
    ------------------------------



  • 3.  RE: DashBoard Text Field Updates Xpression Clock Timer Widget

    Posted 12-15-2021 11:55
    Hi Malcolm,

    It's a countdown timer. In regards to starting the timer, I think either method would be cool. Starting with a specific button, or having it start when data is changed.

    ------------------------------
    Nick Kubinski
    ------------------------------



  • 4.  RE: DashBoard Text Field Updates Xpression Clock Timer Widget

    Posted 12-13-2021 01:18
    The other question, do you want the XPression Timer Widget to be controlled by DashBoard or do you have datalinq and want to use a DashBoard Timer sending data to XPression?

    ------------------------------
    Jos Ford
    Ross Video
    ------------------------------



  • 5.  RE: DashBoard Text Field Updates Xpression Clock Timer Widget

    Posted 12-15-2021 11:57
    Hi Jos,

    We do have access to Xpression Datalinq Server, so either of the methods you mentioned would work.

    ------------------------------
    Nick Kubinski
    ------------------------------



  • 6.  RE: DashBoard Text Field Updates Xpression Clock Timer Widget

    Posted 12-16-2021 06:33

    Figured I could chime in with my two cents here...
    As Jos asked here, from my experience you have the two options...

    1. Have a widget controlling the timer in Xpression. This way you have to map up the GPI/RossTalks to control each button.
      However as far as I know, this will not let you set the time (other than reset) in the timer.
      Might be possible with some Xpression scripting? I'll leave that one to others to decide.

      Pros: All computing of the timer are within Xpression, and even if you loose the connection with the DashBoard, the timer will still work/run.
      No latency in the timer. The timer is on Xpression locally and is not affected by latency in the network.
      Cons: Not as much control over the timer as you can get with DashBoard.


    2. Have the timer in DashBoard and stream the value of that parameter through DataLinq. Requires a bit of setup, but once you're done, you can have a very versatile timer in DashBoard streaming over into Xpression. Relatively simple to set up the buttons required in DashBoard without much coding knowledge. If you have that knowledge however, it can be even more rewarding.

      Pros: Plenty of options and loads of customization etc you can do based on the value of the timer. Sky's the limit really...
      Cons: You are 100% reliable on both DashBoard and DataLinq and a connection with both of them in order to get the data over to XPression.
      Not had this as an issue yet, but it's worth noting if you're on an unreliable network for example.


    ------------------------------
    Aleksander Stalsberg
    Lillehammer Icehockey Club
    ------------------------------



  • 7.  RE: DashBoard Text Field Updates Xpression Clock Timer Widget

    Posted 12-16-2021 14:48
    Hey Aleksander,

    Option 2 sounds great, but our network isn't 100% reliable so option 1 is probably what I'd want to pursue. However, I'd still like to know the steps for option 2.

    ------------------------------
    Nick Kubinski
    ------------------------------



  • 8.  RE: DashBoard Text Field Updates Xpression Clock Timer Widget

    Posted 10-07-2022 16:58
    Hi Nick, 
    Did you ever get the steps to option 2? If so, can you share? I have a similar scenario. I want the Dashboard operator to enter the time in a text field and then click a button that starts the countdown. I am using a Clock parameter in Dashboard at the moment, but it seems to be limited to whatever start time you specify when setting up the parameter.

    ------------------------------
    Matt Finlayson
    Brigham Young University
    ------------------------------



  • 9.  RE: DashBoard Text Field Updates Xpression Clock Timer Widget

    Posted 10-10-2022 14:05
    Hi Matt,

    Actually I wasn't able to figure out either option so this project got left by the wayside.

    Sorry I can't be of any help to you. Do let me know if you get anything to work.

    ------------------------------
    Nick Kubinski
    ------------------------------



  • 10.  RE: DashBoard Text Field Updates Xpression Clock Timer Widget

    Posted 10-10-2022 18:27

    I dont have time right now to give you a good example... But it's a fairly straight forward process...
    Can be done without scripting as well if you need to I believe.

    The timer in DashBoard accepts milliseconds on it's set value, so:

    1. First you got to separate the minutes and seconds you punch in in DashBoard.
    2. Then do seconds * 1000
    3. Do minutes * 60 * 1000
    4. Add those two together, and then send that value to the "setTimer" command.
    5. Possibly add a start/stopp button(s) for the timer.
    6. And all you do to get it over do Xpression then is to send that parameter over via DataLinq like any other.


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



  • 11.  RE: DashBoard Text Field Updates Xpression Clock Timer Widget

    Posted 10-11-2022 09:26
    You can also pull the parser out of the timer and ask it to take care of translating the hours, minutes, and seconds into milliseconds for you.  We have an example panel that does this with a timer using an hours:minutes encoding.

    <abs contexttype="opengear" gridsize="20" style="">
       <meta>
          <params>
             <param access="1" maxlength="0" name="cddisplay" oid="cddisplay" stateless="true" type="STRING" value="37:55" widget="label"/>
             <param access="1" maxlength="0" name="cdvalue" oid="cdvalue" type="STRING" value="40:00" widget="text"/>
             <param access="1" maxlength="0" name="cdstop" oid="cdstop" type="STRING" value="39:45" widget="text"/>
             <param access="1" maxlength="0" name="cdcurrent" oid="cdcurrent" type="STRING" value="20: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 Start" 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="220" left="320" name="Reset" top="40" width="80">
          <task tasktype="ogscript">var timer = ogscript.getTimerManager().getTimer('cdtimer');
    timer.resetTimer();</task>
       </button>
    <param expand="true" height="60" left="40" oid="cdstop" top="200" width="120"/>
       <button buttontype="push" height="60" left="180" name="Set Stop" top="200" width="120">
          <task tasktype="timercontrol">var startValue = params.getValue('cdstop', 0);
    var timer = ogscript.getTimerManager().getTimer('cdtimer');
    var parsedStartValue = timer.getFormat().parseObject(startValue);
    timer.setStop(parsedStartValue);
    //timer.setTime(parsedStartValue);</task>
       </button>
    <param expand="true" height="60" left="40" oid="cdcurrent" top="280" width="120"/>
       <button buttontype="push" height="60" left="180" name="Set Current" top="280" width="120">
          <task tasktype="timercontrol">var startValue = params.getValue('cdcurrent', 0);
    var timer = ogscript.getTimerManager().getTimer('cdtimer');
    var parsedStartValue = timer.getFormat().parseObject(startValue);
    timer.setTime(parsedStartValue);
    </task>
       </button>
    </abs>
    ​

    The key part of the code is this:
    var timer = ogscript.getTimerManager().getTimer('cdtimer');
    var parsedStartValue = timer.getFormat().parseObject(startTimeAsText);
    timer.setStart(parsedStartValue); //set the starting value of the timer
    timer.setTime(parsedStartValue);  //set the current value of the timer​


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



  • 12.  RE: DashBoard Text Field Updates Xpression Clock Timer Widget

    Posted 01-13-2023 12:51
    James and Aleksander,

    Thank you for your help! I've finally been able to implement the timer and its controls in each of our control rooms and it works like a charm.

    Here is the final code that I ended up using.
    <abs height="298" left="943" style="bdr#buttonbg;bdr:etched;" top="98" width="172">
       <param expand="true" height="97" left="7" oid="BreakTimerDisplay" style="style:timerLabel" top="6" width="157"/>
       <table height="88" left="6" top="105" width="159">
          <tr>
             <button buttontype="push" colspan="1" fill="both" name="Start / Pause" rowspan="1" weightx="1.0" weighty="1.0">
                <task tasktype="ogscript">var timer = ogscript.getTimerManager().getTimer("BreakTimer");
    if (!timer.isRunning())
    {
       timer.startTimer(false);
    }
    else
    {
       timer.stopTimer(false);
    }</task>
             </button>
             <button buttontype="push" colspan="1" fill="both" name="Reset" rowspan="1" weightx="1.0" weighty="1.0">
                <task tasktype="timercontrol">ogscript.getTimerManager().getTimer('BreakTimer').stopTimer(false);</task>
                <task tasktype="timercontrol">ogscript.getTimerManager().getTimer('BreakTimer').resetTimer();</task>
             </button>
          </tr>
       </table>
       <param expand="true" height="70" left="7" oid="BreakTimerValue" style="size:Big;txt-align:center;" top="199" width="159"/>
       <button buttontype="push" height="57" left="7" name="Set Timer" right="7" top="269">
          <task tasktype="timercontrol">var startValue = params.getValue('BreakTimerValue', 0);
    var timer = ogscript.getTimerManager().getTimer('BreakTimer');
    var parsedStartValue = timer.getFormat().parseObject(startValue);
    timer.setStart(parsedStartValue);
    timer.setTime(parsedStartValue);</task>
       </button>
    </abs>​


    ------------------------------
    [Nick] [Kubinski]
    [Studio Production Specialist]
    [Sysmex America Inc.]
    [Vernon Hills] [USA]
    ------------------------------