Facility Control

 View Only
  • 1.  Timers for XPression

    Posted 05-16-2014 12:37
    Hi

    I'm new to dashboard

    Using panelbuilder I have built a scoreboard control for XPression

    Increase / Decrease scores Set timer for start / stop Set normal start times

    Everything works really well

    What I'm hoping to add is a user defined start time

    (If I join a game late .. or something happens ??)

    Thanks

    Joe


  • 2.  RE: Timers for XPression

    Posted 05-16-2014 12:47

    Hi Joe.

    That's something you can do through ogScript using the timer's "setTime" function. The trick is that the time must be given in milliseconds.

    So, for example, if I have timer called "gameTimer" that usually counts down from 1 hour and I want to set its time to 30 minutes, I could call:

    ogscript.getTimerManager().getTimer('gameTimer').setTime(1800000); // 1800000 = 30 * 60 * 1000 (minutes * seconds * milliseconds)

    If you already have controls to start/stop the timer, I assume you know how to add pieces of ogscript to button tasks. If not, let me know and I'll post a more complete example.

    James


    #DashBoard


  • 3.  RE: Timers for XPression

    Posted 05-16-2014 14:40
    Thanks for the quick response

    What I need to do is have an input box on the control that the operator types the start time

    say 27:31 (mm:ss) this is the tricky bit (not sure what the script would look like)

    TimerAction:Count Up : Set Time (Value = Cus_Time)

    Count Up is my timer

    Cus_Time is an interger parameter ................

    I then have a set button and a separate start button

    Joe

    #DashBoard


  • 4.  RE: Timers for XPression

    Posted 05-16-2014 15:00

    No problem. Here is a pretty stripped-down example that has a timer (sticking with my "gameTimer" example), and 2 parameters involved with setting the current time (one for minutes and one for seconds). You can copy and paste the example into a new Custom Panel *.grid file and it should run for you.

    params.setValue('p.display', 0, event.getDisplay());

    The important part is the script in the "Set" button that pulls the values out of the 2 parameters and sets the timer's value:

    var minutes = params.getValue('p.minutes', 0);
    
                var seconds = params.getValue('p.seconds', 0);
    
                ogscript.getTimerManager().getTimer('gameTimer').setTime((minutes * 60 + seconds) * 1000);

    #DashBoard


  • 5.  RE: Timers for XPression

    Posted 05-16-2014 17:25
    No - it does not run - I get

    Waiting to locate:

    null

    Any ideas

    Joe

    #DashBoard


  • 6.  RE: Timers for XPression

    Posted 05-16-2014 17:30
    Sounds like you're running DashBoard 6.0 - the sample I posted is designed for 6.1 (the current release).

    Please try again with 6.1.

    #DashBoard


  • 7.  RE: Timers for XPression

    Posted 05-16-2014 18:32
    You are correct ..... Works perfectly with 6.1

    Does exactly what I need ..

    Now all I have to do is made sense of It !!!!

    Thanks again

    Joe

    #DashBoard