Facility Control

 View Only
  • 1.  Scoring App On Dashboard

    Posted 04-04-2017 16:08
    Hi Guys!

    I know there are guys our there that will help me, please help, I need it!

    I am a Graphics Designer/Operator and I've been tasked to create a scoring app For Netball, Rugby and Football that will read data from CSV, Excel, Xml or even just have the Dialog boxes on the scoring app to enter data such as player name and number, officials names, coaches names, add stats via stat buttons, add goals etc. Much the same as the Example Chris Kaptein from Bamboo Shoots has developed for Hockey.

    I hope I made sense.

    Cheers guys


  • 2.  RE: Scoring App On Dashboard

    Posted 04-04-2017 17:20

    Hi Dennis.
    We can certainly help you with some specifics. Writing the overall application is up to you though.

    If you're looking for some example code to get going, here is an example that reads up to 15 columns of data from a CSV file called "CSV Reader Data.csv":

    It might look a little bit intimidating but most of what you're seeing in the XML is creating a bunch of "col.x" parameters to hold all of the values being read-in. The script that does everything is located in the button task.

    <abs contexttype="opengear" style="">
       <meta>
          <params>
             <param access="1" maxlength="0" name="Column 1" oid="cols.1" precision="0" stateless="true" type="STRING_ARRAY" value="" widget="label">
                <value>
                </value>
             </param>
             <param access="1" maxlength="0" name="Column 2" oid="cols.2" precision="0" stateless="true" type="STRING_ARRAY" value="" widget="label">
                <value>
                </value>
             </param>
             <param access="1" maxlength="0" name="Column 3" oid="cols.3" precision="0" stateless="true" type="STRING_ARRAY" value="" widget="label">
                <value>
                </value>
             </param>
             <param access="1" maxlength="0" name="Column 4" oid="cols.4" precision="0" stateless="true" type="STRING_ARRAY" value="" widget="label">
                <value>
                </value>
             </param>
             <param access="1" maxlength="0" name="Column 5" oid="cols.5" precision="0" stateless="true" type="STRING_ARRAY" value="" widget="label">
                <value>
                </value>
             </param>
             <param access="1" maxlength="0" name="Column 6" oid="cols.6" precision="0" stateless="true" type="STRING_ARRAY" value="" widget="label">
                <value>
                </value>
             </param>
             <param access="1" maxlength="0" name="Column 7" oid="cols.7" precision="0" stateless="true" type="STRING_ARRAY" value="" widget="label">
                <value>
                </value>
             </param>
             <param access="1" maxlength="0" name="Column 8" oid="cols.8" precision="0" stateless="true" type="STRING_ARRAY" value="" widget="label">
                <value>
                </value>
             </param>
             <param access="1" maxlength="0" name="Column 9" oid="cols.9" precision="0" stateless="true" type="STRING_ARRAY" value="" widget="label">
                <value>
                </value>
             </param>
             <param access="1" maxlength="0" name="Column 10" oid="cols.10" precision="0" stateless="true" type="STRING_ARRAY" value="" widget="label">
                <value>
                </value>
             </param>
             <param access="1" maxlength="0" name="Column 11" oid="cols.11" precision="0" stateless="true" type="STRING_ARRAY" value="" widget="label">
                <value>
                </value>
             </param>
             <param access="1" maxlength="0" name="Column 12" oid="cols.12" precision="0" stateless="true" type="STRING_ARRAY" value="" widget="label">
                <value>
                </value>
             </param>
             <param access="1" maxlength="0" name="Column 13" oid="cols.13" precision="0" stateless="true" type="STRING_ARRAY" value="" widget="label">
                <value>
                </value>
             </param>
             <param access="1" maxlength="0" name="Column 14" oid="cols.14" precision="0" stateless="true" type="STRING_ARRAY" value="" widget="label">
                <value>
                </value>
             </param>
             <param access="1" maxlength="0" name="Column 15" oid="cols.15" precision="0" stateless="true" type="STRING_ARRAY" value="" widget="label">
                <value>
                </value>
             </param>
             <param access="1" maxlength="0" name="Column 16" oid="cols.16" precision="0" stateless="true" type="STRING_ARRAY" value="" widget="label">
                <value>
                </value>
             </param>
             <param access="1" maxlength="0" name="Column 0" oid="cols.0" precision="0" stateless="true" type="STRING_ARRAY" value="" widget="label">
                <value>
                </value>
             </param>
             <param access="1" constrainttype="STRING_CHOICE" name="table" oid="table" precision="0" type="INT16" value="-1" widget="table">
                <constraint>cols.0</constraint>
                <constraint>cols.1</constraint>
                <constraint>cols.2</constraint>
                <constraint>cols.3</constraint>
                <constraint>cols.4</constraint>
                <constraint>cols.5</constraint>
                <constraint>cols.6</constraint>
                <constraint>cols.7</constraint>
                <constraint>cols.8</constraint>
                <constraint>cols.9</constraint>
                <constraint>cols.10</constraint>
                <constraint>cols.11</constraint>
                <constraint>cols.12</constraint>
                <constraint>cols.13</constraint>
                <constraint>cols.14</constraint>
                <constraint>cols.15</constraint>
                <constraint>cols.16</constraint>
             </param>
          </params>
       </meta>
       <param bottom="5" expand="true" left="6" oid="table" right="8" showlabel="false" top="104"/>
       <button buttontype="push" height="84" left="5" name="Read" top="7" width="186">
          <task tasktype="ogscript">function processCSV(fileContent)
    {
       if (fileContent == null)
       {
          ogscript.debug("CAN'T LOAD FILE");
          return;
       }
       
       var rows = fileContent.split('\n');
       var dataByColumn = []; //It is more efficient if we only call "SET" on the parameters once
       
       for (var r = 0; r &lt; rows.length; r++)
       {
          var cols = rows[r].trim().split(',');
          for (var c = 0; c &lt; cols.length; c++)
          {
             if (c &gt;= dataByColumn.length)
             {
                dataByColumn.push([]); //Add a new column if it wasn't already created
             }
             dataByColumn[c][r] = cols[c].trim(); //Push the cell's value into the array of column data at row "r"
          }
       }
       
       
       //Now that we have collected all of the data for each column into an array, we can call setAllValues for the array parameter
       for (var c = 0; c &lt; dataByColumn.length; c++)
       {
          params.setAllValues('cols.' + c, dataByColumn[c]); //Set all of the values in the column
       }
    }
    
    ogscript.asyncPost('CSV Reader Data.csv', null, processCSV);
    
    </task>
       </button>
    </abs>

    #DashBoard


  • 3.  RE: Scoring App On Dashboard

    Posted 04-04-2017 19:33
    Hi James

    Thank you so much for your reply! I am finding it a bit tough getting hold of the tutorial that will guide me in the right direction of where to use the script you have provided for me. I am a noob to dashboard so EVERYTHING seems greek to me. If you could recommend a tutorial?

    Once again, thank you for the assistance.

    Cheers
    #DashBoard


  • 4.  RE: Scoring App On Dashboard

    Posted 04-04-2017 20:56
    Hi Dennis.
    We're a little lacking in end-to-end sports scoreboard tutorials and examples. You can look at the examples on DashBoard U or read through the panels posted by Chris Kaptein to try to learn a little more but you're unlikely to find a step-by-step guide for your exact use.

    Your best bet is probably to pepper us with questions as you work your way through this and, most importantly, play around a bit in Panel Builder.

    What we often provide in the forum are little chunks of code. Examples that demonstrate a concept that you can incorporate into your panel and learn how to extend it.

    It sounds like you're looking for a place to start so let me provide you with some recommended steps: [LIST=1]
  • Draw out what you want your panel to look like

    • Try to be as detailed as possible
    • Figure out what you need in terms of actions - changing crosspoints on the switcher, bringing take IDs to air, updating DataLinq values in XPression, etc. and actually place them on the screen
    • Figure out what parameters you'll need: score, placeholders for statistics: Statistics for one player at a time? Statistics for home team vs away team? Each thing you want to be able to DataLinq to XPression would need a parameter built for it.

  • Create a new custom panel with a self-contained data source
  • Start to use the various container types in DashBoard (basic canvas, tabs, simple grid, etc.) to put your drawing on screen
  • Start to add your parameters to screen
  • Add buttons for the various actions you're looking for (things like "GOAL!")

  • Once you've got things mocked-up, that's where you start to want to do things like parse your CSV. Right now, you don't have a panel with parameters or lists where you can actually make use of the data in your CSV. Once you do, adding a "load" button to read the CSV into a data object for you to use will make more sense.

    One other bit of advise would be to keep several panels on the go. Back up your work regularly in case you want to return to an earlier version. Use a "scratch pad" panel (just a blank panel) to try out different controls and see how they look and how they work before putting them in your main one.

    Hope this helps you get started. Best of luck!

    James


    #DashBoard


  • 5.  RE: Scoring App On Dashboard

    Posted 04-05-2017 04:24
    Hi James

    Thank you for the advice, I will keep you updated on the progress and I look to what's to come.

    Cheers
    Dennis Hall
    #DashBoard


  • 6.  RE: Scoring App On Dashboard

    Posted 04-05-2017 09:31

    Hi James

    Just a quick question, I am creating these match stats as seen on my screen grab. Next to 'Goal Attempts" could you help out with the coding in terms of adding stats, the toggle box? I am using Chris Kaptein's Scoring app as my backbone however it will not allow me to cope and paste the script


    #DashBoard


  • 7.  RE: Scoring App On Dashboard

    Posted 04-05-2017 13:45
    Hi Dennis.
    In your screen grab, I see 2 numeric spinner controls (one on either side of "Goal Attempts"). I'm not sure which toggle you are talking about though.

    In his case, what we'd want to determine is what exactly you need the script to do:
    Setting parameter values?
    Taking an XPression Take ID to air?
    Clearing a Take ID?


    James
    #DashBoard


  • 8.  RE: Scoring App On Dashboard

    Posted 04-05-2017 14:13
    Hi Dennis.
    DashBoard's "XPression DataLinq Streaming" is what will allow XPression DataLinq to grab the parameters (live, as they are modified in DashBoard) over the network. Any time a parameter changes, DashBoard will write the new value over the network to XPression DataLinq if it is connected.

    I see you had another post Troy responded to about enabling streaming of parameters... this information is pretty much correct. You'll just want to make sure you are using the "DashBoard DataLinq Source" and not just "XML Data Source" on the XPression DataLinq side.

    Here are the steps again:Turn-on streaming to DataLinq for your Custom Panel (be sure to choose a port that is not already in use) [LIST=1]

    • In "edit mode", use the selection tool to double-click on a blank part of your panel to open the source editor
    • In the tree on the left side of the source editor, select the top-most (root) of the tree
    • Next to "XPression DashBoard Linq port:" select "Enable Streaming" and the port you'd like to use
    • Select "Apply and Close"

    • In DataLinq Server, select "Add New"
    • Select the "DashBaord DataLinq Source" as the type
    • Enter the IP of your DashBoard computer and the port you selected in your Custom Panel
    • Add the parameters you would like to feed to XPressionThe parameters should now be selectable as data sources for fields inside of your XPression templates.


      I

      #DashBoard


    • 9.  RE: Scoring App On Dashboard

      Posted 04-10-2017 18:55

      Dennis - Hi James

      after a bit of playing around, I managed to get it right.

      I am now stuck with the dilemma of connecting Dashboard to Xpression.

      Please have a look at the screen grab I have now attached.

      I need those stats to go live to air as well as the Lower Third names. 

      My problems are

      - Xpression is not run locally, it will be on the network (not on my PC)
      - I need stats to update continuously so they're available to go to air
      - Does the dashboard panel constantly write to a XML to update stats?

      So out of all of those questions, the main one is how to get Xpression graphics to read dashboard and output to air.

      Cheers 
      Dennis

       

      ------------------------------------------------------

      Hi Gents

      I managed to get the above questions right.

      I am however looking for help in using Dashboard to trigger Xpression graphics.

      Any help will be appreciated

      Regards


      #DashBoard