Facility Control

 View Only
  • 1.  Running a Ross-Talk command from an ogScript

    Posted 07-10-2013 18:35
    Hi !

    In my xPression Custom Panel I would like to xpression to take a scene when a timer reaches a certain level (this to show an extratime clock automatically in a soccer match).

    Is it possible to run a Ross-Talk command to take the scene from an ogScript which checks the timer value, or do is there another maybe simpler way to accomplish what I want to do ?

    BR,

    Ole A.


  • 2.  RE: Running a Ross-Talk command from an ogScript

    Posted 07-11-2013 00:46

    Greetings Ole A,

    You can accomplish this with some fairly simple scripting.

    Here's an example that shows a timer triggering one Ross Talk command if the timer exceeds 10s, and another Ross Talk command if it is reset.

    Here is the code for the OGL ( .grid) file:



    And here is the code for tha parameters (.xml) file:

    params.setValue(0x2, 0, event.getDisplay());
    
          //if the value is greater than 10000ms (10 seconds)
    
    if (event.getCurrentValue() >= 10000)
    
    {
    
      //if we aren't are already in 'extra time'
    
      if (params.getValue(0x03, 0) != 1)
    
      {
    
        //Set the 'extra time' parameter to 'on'
    
        params.setValue(0x03, 0, 1);
    
        //Send RossTalk command to turn on Sequence 1, Layer 2
    
        rosstalk.sendMessage('localhost', 7788, 'SEQI 1:2');
    
      }
    
    }
    
    else
    
    {
    
      //if we are still in 'extra time'
    
      if (params.getValue(0x03, 0) != 1)
    
      {
    
        //Set the 'extra time' parameter to 'off'
    
        params.setValue(0x03, 0, 1);
    
        //Send RossTalk command to turn on Sequence 1, Layer 1
    
        rosstalk.sendMessage('localhost', 7788, 'SEQI 1:1');
    
      }
    
    }

    And here is the code for tha parameters (.xml) file:

    EXTRA TIME

    Good luck!

    John


    #DashBoard


  • 3.  RE: Running a Ross-Talk command from an ogScript

    Posted 07-11-2013 00:56
    Sorry, Ole.

    I because the code I'm trying to paste is XML, it's getting munged by the blogging system. I'm new to the blogging tools and can't figure this out tonight. Please email me directly at jnaylor@rossvideo.com and I'll attach the files to my reply.

    John

    #DashBoard


  • 4.  RE: Running a Ross-Talk command from an ogScript

    Posted 07-11-2013 17:34
    download

    Ole,

    You can download the example files from the link above.

    Good luck!

    John

    #DashBoard


  • 5.  RE: Running a Ross-Talk command from an ogScript

    Posted 07-12-2013 06:14
    Hi John !

    Thanks a bunch ! Exactly what I was looking for :)

    Dashboard seems to be a very good solution for game graphics !

    BR,

    Ole

    #DashBoard


  • 6.  RE: Running a Ross-Talk command from an ogScript

    Posted 07-12-2013 12:52
    It's great that we could help you out, Ole. :-)

    I'd love to know what you're doing with PanelBuilder. Please share if you're able.

    John

    #DashBoard


  • 7.  RE: Running a Ross-Talk command from an ogScript

    Posted 07-12-2013 13:39
    Hi again John !

    I'm making a dashboard custom panel which controls playout of graphics on live soccer matches in Norway. I've gotten pretty far now so I have most of my basic functionality in place and works fine :).

    I have another question :

    Is it possible from ogScript to read files from the file system ? I would like to be able to load a team player list from a CSV file or similar and use it to make a player presentation list. The list should contain all available players of a given team, but not all of them are playing so I thought I could have a text field in the dashboard where one could input the numbers of the players that are on the field, and then make the list based on these. From JavaScript I can see that as of today this is not implemented yet, but might be in the future. Is there another way to do this ?

    The only other way I can see to do this is to make a new Datalinq source and use excel as source, this would be a bit of a stretch for our operators.

    BR,

    Ole

    #DashBoard


  • 8.  RE: Running a Ross-Talk command from an ogScript

    Posted 07-12-2013 14:06
    Hi Ole.

    If you're able to supply your player list as an XML file instead of a CSV, you can parse/load the XML through ogScript.

    The code is:

    var myXmlDoc = ogscript.parseXML('c:\my player data\playerdata.xml');

    This returns an org.w3c.dom.Document object (documented here)

    You can also run XPath commands (if you're familiar with XPath) on the document with

    var myNodeList = ogscript.runXPath('[xpath]', myXmlDoc);

    This returns an org.w3c.dom.NodeList (documented here) from which you can get the individual org.w3c.dom.Element nodes.

    #DashBoard


  • 9.  RE: Running a Ross-Talk command from an ogScript

    Posted 07-12-2013 17:50

    Hi John,

    I'm including a little bit of additional script from a project I created as an example, modified to match your application a little bit.

    (I've not run it, so apologies if I have a typo in it).

    If you have any problems getting this to work please contact James or I and we'll help you work through it.

    Additionally, we'd love to see your final panel when you get it done! (or post an image of it to the forums here!)

    Example:

    XMLDoc = ogscript.parseXML('c:my player dataplayerdata.xml');

    if (null==XMLDoc)

    {

    ogscript.debug("Could not open File");

    return;

    }

    //Get all elements that match the first element key

    var first_set =ogscript.runXPath('/Team/Player', XMLDoc);

    // Iterate through all the players in the XML file

    for (i =0;i < first_set.length; i++)

    {

    var temp = first_set.item(i);

    var name = temp.getAttribute('Name');

    var team = temp.getAttribute('Team');

    }

    #DashBoard


  • 10.  RE: Running a Ross-Talk command from an ogScript

    Posted 07-17-2013 07:00
    Hi Guys !

    Thank you ! I can use XML, no problem. I have already made a test and it works perfectly :)

    I must say the support here in the forums is excellent !

    I will post some screenshots as soon as I get things up and running :)

    BR,

    Ole

    #DashBoard