Facility Control

 View Only
Expand all | Collapse all

Work with me here... Roster and stats for hockey.

  • 1.  Work with me here... Roster and stats for hockey.

    Posted 03-26-2018 22:47
    So.. Work with me here, a little brainstorming.

    DashBoard is genius for producing and controlling a show, both on ROSS hardware, software and other stuff that can take commands from it as well.
    Xpression is pretty damn good for showing graphics, can be controlled from DashBoard, and intergrates extremly well with DataLinq and therefor statistics from a great variety of sources.

    Now, in allmost every video I have seen from the different Ross University channels (DashBoard U, Xpression U, DataLinq U(??), Carbonite U), most statistics for sports are kept within Excel, and then called upon with Xpression. All good so far! And DashBoard can control Xpression.

    HOWEVER!

    If I want to have those stats imported into DashBoard, so I can view, possibly edit, and update those stats (live in a game), I cant do that directly into Excel (there is no DataLinq into DashBoard, and no way to read/write directly into excel from DashBoard.
    Now, I CAN export that Excel as an XML, and then import it into DashBoard with some code. However this is not a "live" source. I could do a simple call of the graphics from DashBoard, but I would need someone to sit and correct the Excel sheet or manipulate Xpression in order to update it.

    What I'm trying to do is create a button in DashBoard that lets me call an event on the ice (be it interview, goal, penalty, whatever), that when pushed, asks me what player is in question, and then lets me choose a player, see his stats relevant to this game, possibly add a point (if he scores etc), and then show this info on the big screen.

    So in short, what I want...

    • Grab stats from an online source (I guess a REST call with JSON) or Excel sheet.
    • Store all those stats in parameters.
    • Manipulate those stats pr. event.
    Or does anyone else have a bright idea? DashBoard doesnt seem to work with MySQL at the moment, or through DataLinq (I really damn wish),
    as this would make the query for stats soooo much easier.


  • 2.  RE: Work with me here... Roster and stats for hockey.

    Posted 03-27-2018 03:18
    Dashboard has a very good XML parser (even better than Xpression I'd say). If you can get your stats in an XML format (such as what you get from StatCrew), there is a lot you can do.

    I haven't gone as far as trying to handle every statistic, but I've found it very helpful to populate rosters and resync statistics (like pitch count at the end of an inning).

    Getting your data in is only one part though, you still need to be able to manipulate it in a sane way. Unfortunately parameters tend to lend themselves mostly to individual variables. I had talked to somebody at NAB about taking a more object oriented approach, and the answer I was given was to use structs. Life happened though, and I never really got around to figuring out what a struct was in the context of Dashboard, and the documentation seems to be a bit confusing/sparse. That being said, this probably is the proper way to manipulate complicated data, like player statistics.

    At the same time, don't forget that you aren't limited to using only Dashboard. It's just one tool in the toolbox, and it works great for solving a lot of problems. Depending on how complicated you want to get though, you will eventually run into its limits. At that point you might have to write a shim or re-evaluate your tool choice. (Don't forget that Xpression has an API of its own. And thankfully RossTalk isn't a serial protocol developed in the 80's so it's a heck of a lot easier to integrate than something like AMP.)
    #DashBoard


  • 3.  RE: Work with me here... Roster and stats for hockey.

    Posted 03-28-2018 01:40
    Yeah that is kinda where I am at as well!

    Either use XML parser or a REST call and JSON to basically "GET" the values at the start of each game, then have our local "stats guys" update these live and on the fly.
    Combine the possibility to GET all the stats you want into a single DashBoard and then use the jsonport attribute on the main abs, I could make custom DashBoards for the guys doing the statistics to update my main DashBoard and then use those parameters into Xpression through DataLinq...

    I just... Miss easier ways to get external data INTO DashBoard I suppose...
    #DashBoard


  • 4.  RE: Work with me here... Roster and stats for hockey.

    Posted 03-28-2018 19:49

    Just to chime-in on the structured data parameters part of the discussion. Here are a few examples of how structures work in DashBoard:

    <abs contexttype="opengear" style="">
       <meta>
          <params>
             <param access="1" constrainttype="STRUCT" name="Race Definition" oid="raceDefinition" structtype="raceInfo" type="STRUCT" widget="36">
                <value>
                   <subparam access="1" name="Race Name" suboid="name" type="STRING" value="Test"/>
                   <subparam access="1" name="Id" suboid="identifier" type="STRING" value="Test"/>
                </value>
             </param>
             <param access="1" constrainttype="STRUCT" name="Race Definition" oid="raceList" structtype="raceInfo" templateoid="raceDefinition" type="STRUCT_ARRAY" widget="table">
                <value>
                   <subparam suboid="name" value=""/>
                   <subparam suboid="identifier" value=""/>
                </value>
             </param>
          </params>
       <ogscript handles="onload">function handler(tObj, rowIndex, subOid, paramObj, index)
    {
       ogscript.debug("CHANGE TO: " + subOid + " [" + rowIndex + "]");
    }
    
    var raceParam = params.getParam('raceList', 0);
    raceParam.addSubParamListener(raceParam, handler, null);</ogscript>
       </meta>
       <param element="0" expand="true" height="308" left="17" oid="raceList" showlabel="false" top="17" width="448"/>
       <button buttontype="push" height="53" left="18" name="Add" top="337" width="297">
          <task tasktype="ogscript">var structCount = params.getElementCount('raceList');
    
    if (structCount == 1 &amp;&amp; params.getValue('raceList.0.identifier', 0) == "") // If this is the first element and it has not been set yet
    {
       structCount = 0;
    }
    
    var newValue = {
       "name": "Name " + structCount,
       "identifier": "ID " + structCount
       };
    
    params.setValue('raceList', structCount, newValue);</task>
       </button>
       <button buttontype="push" height="54" left="318" name="Clear" top="337" width="140">
          <task tasktype="ogscript">var empty = [{"name":"", "identifier":""}];
    params.setAllValues('raceList', empty);</task>
       </button>
    </abs>

    This code reads structured data from a file to populate a parameter (note that the parameters are currently set to stateless so they'll reset whenever the panel is refreshed).

    <abs contexttype="opengear" id="_top">
       <meta>
          <params>
             <param access="1" maxlength="0" name="Data URL" oid="Data_URL" stateless="true" type="STRING" value="" widget="text"/>
             <param access="1" name="Structured Data" oid="struct-data" stateless="true" type="STRUCT_ARRAY" widget="table">
                <value>
                   <subparam access="1" maxlength="0" name="name" suboid="team" type="STRING" value="" widget="default"/>
                </value>
             </param>
          </params>
       </meta>
       <param expand="true" height="61" left="18" oid="Data_URL" right="17" top="20">
          <task tasktype="ogscript">function callback(resultStr)
    {
        if (resultStr != null)
        {
          var json = JSON.parse(resultStr);
          var a = null;
          if (Array.isArray(json))
          {
             a = json;
          }
          else
          {
             a = [];
             a.push(json);
          }
          params.setAllValues('struct-data', a);
        }
    }
    params.resetAllValues('struct-data');
    ogscript.asyncPost(params.getValue('Data_URL', 0), null, callback);</task>
       </param>
       <param bottom="10" expand="true" left="19" oid="struct-data" right="9" showlabel="false" top="94"/>
    </abs>
    Example JSON file "my-data.json" for the second example:
    [{
        "team":"Eagles",
        "sport":"Flight",
        "players": [
            "Eddie",
            "Sam",
            "Steagle"
        ]
     },
     {
        "team":"Dogs",
        "sport":"Fetch",
        "players": [
            "Rover",
            "Fido",
            "Rex"
        ]
     }]
     

     


    #DashBoard


  • 5.  RE: Work with me here... Roster and stats for hockey.

    Posted 04-02-2018 21:59
    If you figure this out, I'd be interested in seeing a sample panel. I use the StatCrew XMLs pretty heavily and something as simple as seeing the stats on the panel would be nice. Sending data from Dashboard would be a nice bonus. (On the flip side, StatCrew has it's own idiosyncrasies that make it frustrating)
    #DashBoard


  • 6.  RE: Work with me here... Roster and stats for hockey.

    Posted 04-21-2018 14:29
    March Madness returns to Salt Lake next year and I will be very interested in this thread. NCAA has a love affair with StatCrew that probably will never be broken. Once our NBA season is over this will be my summer. Any help would be greatly appreciated.
    #DashBoard


  • 7.  RE: Work with me here... Roster and stats for hockey.

    Posted 04-23-2018 20:21
    "‹@bellbd @malthepal do you guys have any example XMLs from StatCrew to share? Or just an URL to access one etc?
    #DashBoard


  • 8.  RE: Work with me here... Roster and stats for hockey.

    Posted 04-24-2018 12:26
    @jamespeltzer Hi again!

    I've been looking at your examples above, and I quite like'em!
    However there is one thing I am struggeling with. If you make a table the "old way" if you go through your DashBoard U videos, you make X number of parameters, that each contain data, then you make an integer list and populate that one, and change the widget type...

    At least this way you can mark a row, and get that index-value back if you then ask for that parameters value in code or visual-logic.
    But if I use your first example, and add say 10 rows. If I mark row number 4, with the ID of 4, how can I extract that value of each field, seeing as I cant access what index I am at?
    #DashBoard


  • 9.  RE: Work with me here... Roster and stats for hockey.

    Posted 05-04-2018 14:24
    Would it be possible to use datalinq keys on let's say "jersey" if that is the player number data field similar to a spreadsheet?
    #DashBoard


  • 10.  RE: Work with me here... Roster and stats for hockey.

    Posted 05-08-2018 09:22

    @jamespeltzer The reason I am asking for an ID for the table itself is to be able to choose a player in that table (by even setting the default widget to read only I cannot change it).
    In the following example, I used your Dashoard U tutorial: https://www.youtube.com/watch?v=Cfti9x2c7k8&list=PLfSczupBVAqjsDuZrJmwdHKpT2lDixUWm&index=9

    And with that, create a table with 3 collumns: [LIST=1]

    • Jersy nr (#) - Int
    • Name - String
    • Team - String

    Of course, other collumns may be added as well, like height, weight, goals, assists, etc... And this can be populated by a JSON parse from a database etc... Emptying the arrays, and then going through all the players in the database, and updating their respective stats etc, starting from ID 0 on each array.

    I can then pick whatever row I want in the player table, and it will then give me the ID of that row (this I cant seem to do in your example above).
    I then go through each collumn, and update a separate set of parameters with allmost the same names (this could also be a lower third name parameter, etc...).

    The parameters in question now is shown if you click "edit", wich lets you edit the player currently marked, and you can change the second set of parameters. Press "Apply" and they update in the table. I even took the liberty of stealing your GUI from DashBoard with "Apply" and "Apply and Close", meaning you can even pick different players in the table while the edit window is open and keep updating.

    The problem I have with the example above with structs, is that I cant seem to "pick" one row in the table, and therefor I cannot grab the ID either.

    <abs contexttype="opengear" gridsize="20" id="_top">
       <meta>
          <params>
             <param access="1" constrainttype="INT_NULL" name="JerseyNr" oid="0x2" precision="0" type="INT16_ARRAY" value="6;22;32;2;23;95" widget="text-display"/>
             <param access="1" maxlength="0" name="PlayerName" oid="0x3" precision="0" type="STRING_ARRAY" value="Jefferson;Stan;Jonas;Tom;Dave;Sam" widget="text-display">
                <value>Jefferson</value>
                <value>Stan</value>
                <value>Jonas</value>
                <value>Tom</value>
                <value>Dave</value>
                <value>Sam</value>
             </param>
             <param access="1" maxlength="0" name="TeamName" oid="0x4" precision="0" type="STRING_ARRAY" value="Team3;Team1;Team2;Team1;Team2;Team3" widget="text-display">
                <value>Team3</value>
                <value>Team1</value>
                <value>Team2</value>
                <value>Team1</value>
                <value>Team2</value>
                <value>Team3</value>
             </param>
             <param access="1" constrainttype="INT_CHOICE" name="PlayerTable" oid="0x5" precision="0" type="INT32" value="0" widget="default">
                <constraint key="2">#</constraint>
                <constraint key="3">Name</constraint>
                <constraint key="4">Team</constraint>
             </param>
             <param access="1" constrainttype="INT_NULL" name="plr_jersey" oid="0x6" precision="0" type="INT16" value="6" widget="default"/>
             <param access="1" maxlength="0" name="plr_name" oid="0x7" type="STRING" value="Jefferson" widget="default"/>
             <param access="1" maxlength="0" name="plr_team" oid="0x8" type="STRING" value="Team3" widget="default"/>
             <param access="1" constrainttype="INT_NULL" name="plrID" oid="0x9" precision="0" type="INT16" value="0" widget="default"/>
          </params>
       </meta>
       <param expand="true" height="301" left="40" oid="0x5" scrolling="vertical" showlabel="false" top="40" widget="table" width="563">
          <task tasktype="ogscript">var id = params.getValue(0x5, 0);
    var jersey = params.getValue(0x2, id);
    var name = params.getValue(0x3, id);
    var team = params.getValue(0x4, id);
    
    params.setValue(0x9, 0, id);
    params.setValue(0x6, 0, jersey);
    params.setValue(0x7, 0, name);
    params.setValue(0x8, 0, team);</task>
       </param>
       <label height="40" left="620" name="Table ID: " style="txt-align:east" top="40" width="60"/>
       <param expand="true" height="40" left="680" oid="0x9" top="40" widget="text-display" width="80"/>
       <button buttontype="push" height="80" left="620" name="EDIT" top="100" width="140">
          <task tasktype="ogscript">/*! block id=1000 !*/
    ogscript.reveal("edit_plr");
    /*!!
     &lt;block id="1000" type="ogscript_reveal" x="176" y="95" w="243" ID="edit_plr" /&gt;
    !!*/
    /*!!&lt;checksum&gt;a96dcb6c8215ee1e83b8cb44948f24d9&lt;/checksum&gt;!!*/</task>
       </button>
       <abs height="300" id="edit_plr" left="480" style="bg#333333;bdr#B8B8B8;bdr:thick;" top="380" width="560">
          <button buttontype="push" height="80" left="20" name="APPLY" style="bg#09AF00;" top="200" width="160">
             <task tasktype="ogscript">var id = params.getValue(0x5, 0);
    var newJersey = params.getValue(0x6, 0);
    var newName = params.getValue(0x7, 0);
    var newTeam = params.getValue(0x8, 0);
    
    params.setValue(0x2, id, newJersey);
    params.setValue(0x3, id, newName);
    params.setValue(0x4, id, newTeam);</task>
          </button>
          <button buttontype="push" height="80" left="380" name="CANCEL" style="bg#B70000;" top="200" width="160">
             <task tasktype="ogscript">/*! block id=1001 !*/
    ogscript.hide("edit_plr");
    /*!!
     &lt;block id="1001" type="ogscript_hide" x="214" y="122" w="243" ID="edit_plr" /&gt;
    !!*/
    /*!!&lt;checksum&gt;3deaa7edb586a35416c94b1d4e19b676&lt;/checksum&gt;!!*/</task>
          </button>
          <label height="40" left="20" name="#: " style="txt-align:east;font:bold;size:Big;" top="80" width="120"/>
          <label height="40" left="20" name="Player: " style="txt-align:east;font:bold;size:Big;" top="20" width="120"/>
          <label height="40" left="20" name="Team: " style="txt-align:east;font:bold;size:Big;" top="140" width="120"/>
          <param expand="true" height="40" left="160" oid="0x7" showlabel="false" top="20" width="380"/>
          <param expand="true" height="40" left="160" oid="0x6" showlabel="false" top="80" widget="text" width="60"/>
          <param expand="true" height="40" left="160" oid="0x8" showlabel="false" top="140" width="380"/>
          <button buttontype="push" height="80" left="200" name="APPLY AND CLOSE" style="bg#09AF00;" top="200" width="160">
             <task tasktype="ogscript">var id = params.getValue(0x5, 0);
    var newJersey = params.getValue(0x6, 0);
    var newName = params.getValue(0x7, 0);
    var newTeam = params.getValue(0x8, 0);
    
    params.setValue(0x2, id, newJersey);
    params.setValue(0x3, id, newName);
    params.setValue(0x4, id, newTeam);
    
    ogscript.hide('edit_plr');</task>
          </button>
       </abs>
    </abs>

    #DashBoard


  • 11.  RE: Work with me here... Roster and stats for hockey.

    Posted 05-09-2018 13:07

    You can tell the struct table to write the selected row index to a parameter with the w.selectionparam config option. I've added it to my example code here:

    <abs contexttype="opengear" id="_top">
       <meta>
          <params>
             <param access="1" maxlength="0" name="Data URL" oid="Data_URL" stateless="true" type="STRING" value="sample-data3.json" widget="text"/>
             <param access="1" name="Structured Data" oid="struct-data" stateless="true" type="STRUCT_ARRAY" widget="table">
                <value>
                   <subparam access="1" maxlength="0" name="name" suboid="team" type="STRING" value="" widget="default"/>
                </value>
             </param>
             <param access="1" constraint="0.0;100000.0;0.0;100000.0;1" constrainttype="INT_STEP_RANGE" name="Selection Parameter" oid="Selection_Parameter" precision="0" type="INT32" value="1" widget="label"/>
          </params>
       </meta>
       <param expand="true" height="61" left="18" oid="Data_URL" right="297" top="20">
          <task tasktype="ogscript">function callback(resultStr)
    {
        if (resultStr != null)
        {
          var json = JSON.parse(resultStr);
          var a = null;
          if (Array.isArray(json))
          {
             a = json;
          }
          else
          {
             a = [];
             a.push(json);
          }
          params.setAllValues('struct-data', a);
        }
    }
    params.resetAllValues('struct-data');
    ogscript.asyncPost(params.getValue('Data_URL', 0), null, callback);</task>
       </param>
       <param bottom="10" expand="true" left="19" oid="struct-data" right="9" showlabel="false" top="94">
          <config key="w.selectionparam">Selection_Parameter</config>
       </param>
    <param expand="true" height="56" left="1792" oid="Selection_Parameter" top="21" width="273"/>
    </abs>
    

    #DashBoard


  • 12.  RE: Work with me here... Roster and stats for hockey.

    Posted 05-09-2018 18:48
    You can tell the struct table to write the selected row index to a parameter with the w.selectionparam config option. I've added it to my example code here:




    Am I missing something here? I copy/pasted in your code, but nothing really happens?
    Do I need a .json file named sample-data3.json?


    #DashBoard


  • 13.  RE: Work with me here... Roster and stats for hockey.

    Posted 05-11-2018 11:56
    Hmmm.. still struggeling a bit with these structs...
    I do have another question though!

    I have a parameter that is a string array. It contains 8 entries (indexed 0-7).
    However, when listing these, I would hope to have a couple of buttons next to them, that lets me move the entry up/down the list.
    I know how to do this with a regular array in JS with some code examples online etc.

    However these parameters behave a bit differently than the regular array,
    Could you maybe give me an example of how I would be able to choose say item with index of 4, and move it up and switch places with index 3?
    #DashBoard


  • 14.  RE: Work with me here... Roster and stats for hockey.

    Posted 05-11-2018 13:22

    Your issue is that the parameter value is a Java array and not actually a JavaScript array.
    You can transform it into a JavaScript array by calling params.valueToJson(params.getAllValues('OID_OF_PARAM')); and then work with it as you did in your example.

    If you're not running DashBoard 8.4, you can do this:
    var newValues = [];
    var oldValues = params.getAllValues('OID_OF_PARAM');
    for (var i = 0; i < oldValues.length; i++)
    {
    newValues.push(oldValues[i]);
    }


    //DO WHATEVER YOU WANT

    params.setAllValues('OID_OF_PARAM', newValues);


    You can also turn on drag-to-reorder in a table parameter with "w.reorder"

    <param expand="true" height="268" left="17" oid="params.table" showlabel="false" top="18" width="174">
       <config key="w.reorder">true</config>
    </param>

    Lastly, you here's what is likely an over-complicated implementation of what you're asking about:

    <abs contexttype="opengear">
       <meta>
          <params>
             <param access="1" constrainttype="STRING_CHOICE" name="Table" oid="params.table" precision="0" type="INT16" value="2" widget="table">
                <constraint>value_param</constraint>
             </param>
             <param access="1" maxlength="0" name="Values" oid="value_param" precision="0" type="STRING_ARRAY" widget="default">
                <value>a</value>
                <value>b</value>
                <value>c</value>
                <value>d</value>
                <value>e</value>
                <value>f</value>
                <value>g</value>
             </param>
          </params>
          <api>function moveUp()
    {
       move(-1);
    }
    
    function moveDown()
    {
       move(1);
    }
    
    function move(direction)
    {
       var selection = params.getValue('params.table', 0);
       var newSelection = selection + direction;
       
       if (newSelection &lt; 0 || newSelection &gt; params.getElementCount('value_param'))
       {
          return; //If we are moving up but are already at the top or moving down and are already at the bottom
       }
    
       var newValues = [];
       var oldValues = params.getAllValues('value_param');
    
       ogscript.debug(selection + " " + newSelection);
    
       for (var i = 0; i &lt; oldValues.length; i++)
       {
          if (direction &gt; 0 &amp;&amp; i != selection) //If we are down, add the value already at index first
          {
             newValues.push(oldValues[i]);
          }
          
          if (i == newSelection)
          {
             newValues.push(oldValues[selection]);
          }
          
          if (direction &lt; 0 &amp;&amp; i != selection) //If we are up, add the value already at index after
          {
             newValues.push(oldValues[i]);
          }
       }
    
       params.setAllValues('value_param', newValues);
       params.setValue('params.table', 0, newSelection);
    }
    </api>
       </meta>
       <param expand="true" height="268" left="17" oid="params.table" showlabel="false" top="18" width="174">
          <config key="w.reorder">true</config>
       </param>
       <button buttontype="push" height="54" left="206" name="Move Up" top="34" width="145">
          <task tasktype="ogscript">moveUp();</task>
       </button>
       <button buttontype="push" height="54" left="208" name="Move Down" top="93" width="145">
          <task tasktype="ogscript">moveDown();</task>
       </button>
    </abs>

    #DashBoard


  • 15.  RE: Work with me here... Roster and stats for hockey.

    Posted 05-11-2018 15:41
    Well there we go @jamespeltzer ! The drag to reorder was an even smoother and better way of doing it! PERFECT!
    Now I have to ask, with these parts open and new to me... Is there a config to enable sorting when clicking the collumn headers as well?

    And thanks for the other two examples as well! Perfect for later use!
    #DashBoard


  • 16.  RE: Work with me here... Roster and stats for hockey.

    Posted 05-11-2018 15:46

    Yes, you can turn-on column sorting with a config option. Here's the current list (some are only available in DashBoard 8.4 Beta):

    The list is also available when you double-click on a parameter while in edit mode. There is a table where you can see the config options you have currently specified and a help button to show the full list of options.

    w.changeprompt   [Text to be displayed on change] A prompt is show after text is modified
    w.immediate   [true,false] Value in the text box is processed before all others
    w.format     The date format to be used by the date picker
        MMMM dd, yyyy May 21, 2017
    w.showstring   [true,false] Shows the string representation of the color in a combo box
    w.increment   [Value to be incremented by] Clicking the up/down arrow will increment/decrement the scroll bar by the given amount
    w.blockincrement   [Value to be incremented by] Clicking on the main part of the scroll bar will increment/decrement the scroll bar by the given amount
    w.buttonstyle   [style:styleid] Reference a style or give style information to change the style of the Browse button
    w.textstyle   [style:styleid] Reference a style or give style information to change the style of the text
    w.buttonname   [Text] Change the text on the Browse button
    w.images   [true,false] Shows image previews
    w.filetypes   [Title],[extensions] Only files with given extensions will be shown
    w.absolute   [true,false] If relative or absolute address is returned
    w.nouri   [true,false] If URI is returned
    w.notext   [true,false] If URI is displayed
    w.remove   [true,false] Hides the remove button next to the file picker
    w.save   [true,false] Save a file in the file picker
    w.framerate   [24,30,50,60,29.97,59.94] Sets the framerate of the time picker
    w.restricted   [true,false] The time picker will roll over at its highest value
    w.format     The time format to be used by the time picker
        HH:mm:ss:ff 12:34:56:12
        mm:ss:ff 34:56:12
        ss:ff 56:12
        ff 12
        HH:mm:ss 12:34:56
        HH:mm 12:34
        HH 12
    w.redcount   [Integer] Number of red ticks to show on Audio Meter
    w.yellowcount   [Integer] Number of yellow ticks to show on Audio Meter
    w.greencount   [Integer] Number of green ticks to show on Audio Meter
    w.redcolor   #[RGB value] Sets the red ticks to the new color
    w.yellowcolor   #[RGB value] Sets the yellow ticks to the new color
    w.greencolor   #[RGB value] Sets the green ticks to the new color
    w.orientation   [horizontal,vertical] Sets the orientation of the audio meter
    w.reverse   [true,false] Meter starts with lowest value at the top
    w.loop   [true,false] If true, the slider will rollover at its max/min value
    w.numloops   [Integer] Maximum number of loops allowed
    w.zero   [Integer] Sets the 0 point of the slider
    w.thumbcolor   #[RGB Value] Sets the color of the slider controller
    w.labels   [Labels] Labels to be shown on the slider
    w.nospinner   [true,false] If true, the spinner is not shown with the slider
    w.time   [Integer] Sets how many seconds are shown on the time axis
    w.grid   #[RGB Value] Sets the color of the grid lines
    w.plotfg   #[RGB Value] Sets the color of the plot line
    w.plotbg   #[RGB Value] Sets the color of the plot's background
    w.hidelegend   [true,false] If true, the legend is hidden
    w.hidex   [true,false] If true, the X axis is hidden
    w.hidey   [true,false] If true, the Y axis is hidden
    w.autoadvance   [true,false] If false, the graph will not automatically advance
    w.touchtree   [true,false] Creates a navigation tree with larger nodes for touch screens
    w.multiedit   [true,false] All selected cells are edited at the same time
    w.localselection   [true,false] Cell selection will select entire row
    w.scrollselection   [true,false] Table automatically scrolls to selection made
    w.reorder   [true,false] If reorder buttons are shown and are usable
    w.rowstyleparam   [OID of String Array] Provides style for all cells in each row
    w.rowheightparam   [OID of Integer] Provides row height for all rows
    w.selectionparam   [OID of Integer] Current row number is written into param value(Rows are 0 indexed)
    w.colselectionparam   [OID of Integer] Current column number is written into param value(Columns are 0 indexed)
    w.rowaccessparam   [OID of Integer] If param is 0: table is read only, if param is 1: table is read/write
    w.rowheaderparam   [OID of String Array] Array provides row names for the table
    w.rowheight   [Integer] All rows are set to static height given
    w.colwidth.[column index]   [Integer] Sets the width of the given column
    w.colminwidth.[column index]   [Integer] Sets the minimum width of the given column
    w.hscroll   [true,false] Is horizontal scrolling enabled or disabled
    w.alwaysscroll   [true,false,hidden] Is vertical scrolling enabled, disabled, or enabled but with scroll bar hidden
    w.hgrid   [true,false] If horizontal grid lines are shown
    w.vgrid   [true,false] If vertical grid lines are shown
    w.soratble   [true, false] Allows the table to be sorted
    w.scrollparam   [OID of scroll bar param] Scroll bar param controls scrolling of table
    w.scrollmaster   [true,false] When multiple tables are used in a grid, setting one to scroll master will make all others follow its scrolling
    w.cellediting   [true,false] Is editing allowed
    w.columns   [Column IDs] Only column IDs listed will be shown
    w.model   [JSON object] Returns the table model to the JSON object, below is a list of functions that can be implemented from the object that is returned
          void selectionChanged(int[] selRows, int[] selCols, int[] viewRows, int[] viewCols)
          void headerClicked(int colIndex)
          boolean isSortable()
          Comaptator getCompareFunction(int colIndex)
          int getRowHeight(int rowIndex)
          int getDefaultRowHeight()
          int getRowCount()
          int getColumnCount()
          boolean isRowHeaderVisible()
          int getHeaderWidth()
          String getRowHeader(int rowIndex)
          Object getValueAt(int rowIndex, int colIndex)
          Object getWidgetHint(int rowIndex, int colIndex)
          int getParamIndex(int rowIndex, int colIndex)
          String getColumnID(int column)
          String getColumnName(int column)
          OID getParamOid(int rowIndex, int colIndex)
          String getCellStyle(int rowIndex, int colIndex)
          boolean isCellEditable(int rowIndex, int colIndex)
          void setValueAt(Object newValue, int rowIndex, int colIndex)
          boolean swapRows(int row1, int row2)




    #DashBoard


  • 17.  RE: Work with me here... Roster and stats for hockey.

    Posted 05-11-2018 16:20
    BRILLIANT AS ALLWAYS!
    Just.. pointing out a small little typo you prob got there in your copy/paste (I assume you didnt TYPE all that in...).
    Fun fact, the one config option I need is spelled "w.soratble", while of course it should be "w.sortable".

    So... This project keeps on growing, and I guess I'll keep this post for most of the questions. Even though I am sure they could be sorted into different posts for others to find easier...
    Though I got a feeling I'd end up spamming your forums even more then.

    This time around! I'm looking at using the file-path parameter widget. It works great! And perfect that it gives me the relative path to the DashBoard .grid file. Work perfectly for me!
    However... And isnt there allways a "however"?

    Seeing I am from Norway, my filenames can, and will include, foreign letters to you. Namely Á†Á˜Á…. Using these they show up (in lower case) as %C3%B8 for Á˜ and %C3%A5 for Á…...
    Any tips on how to fix this? I understand the %20% for space and such, but yeah... Team names will include these letters from time to time...
    #DashBoard


  • 18.  RE: Work with me here... Roster and stats for hockey.

    Posted 05-11-2018 18:08
    Thanks for the typo find - I'll make sure that gets fixed.

    As for your special character issue - this is because we currently encode as a URI and that format only allows for a subset of ASCII - everything else gets escaped. One thing you could try is setting the w.nouri config option to true - this should cause it to show the file name on your file system instead of the URI-escaped version.

    James
    #DashBoard


  • 19.  RE: Work with me here... Roster and stats for hockey.

    Posted 05-11-2018 22:03
    Thanks for the typo find - I'll make sure that gets fixed.

    As for your special character issue - this is because we currently encode as a URI and that format only allows for a subset of ASCII - everything else gets escaped. One thing you could try is setting the w.nouri config option to true - this should cause it to show the file name on your file system instead of the URI-escaped version.

    James


    Hmmm... This did indeed help!

    However, as I suspected, I no longer have the relative path to the .grid file, but rather the full complete file-path on my computer.
    I MIGHT just be better off making a function that looks for the %20% and the other %C3%XX values and replace them with the characters I need instead.
    I'm fairly certain this would only ever apply to space, and to Á¦Á¸Á¥Á†Á˜Á…. Meaning I could most likly just replace those instances with the correct letter instead when updating the parameter.

    Update:
    Made a simple function that loops through the string as long as it find either the special characters of a space (%20) and replaces the characters.
    This way I can point graphics etc to the correct images so on so forth.

    #DashBoard


  • 20.  RE: Work with me here... Roster and stats for hockey.

    Posted 05-24-2018 10:44
    Hi again @jamespeltzer !

    Haha,this is becomming like a tradition once a week now or something...

    So, this time, I know that under "style" for different elements, there is this "tooltip" that can be used to help explain etc.
    However, I have several tables now, with statistics etc going on.
    The title for these collumns are in many cases just abreviations that I get from the stats source. Like GP = Games Played, SOG = Shots On Goal, etc etc...

    Is there any way to define a tooltip for a collumn header? At the moment I can only give a tooltip to the table itself.
    And if that's not possible. Is there a way to add a newline/break to the tooltip? Neither \n or
    in the tooltip seems to work.
    #DashBoard


  • 21.  RE: Work with me here... Roster and stats for hockey.

    Posted 05-29-2018 11:25
    Config Option

    In your list above, and looking at the ?-mark in DashBoard, I'm missing a quite usefull one for tables, and if it's not yet there (or a similar one), I would like to recommend/request it for future updates.

    w.cellpadding (int) - Pad cells with values top, right, bottom, left just like you can do with inset="4,4,4,4" ina table element for placing buttons etc.
    #DashBoard


  • 22.  RE: Work with me here... Roster and stats for hockey.

    Posted 05-30-2018 08:37
    Get JSON response as UTF-8 encoded.

    Got yet another one @jamespeltzer . Turns out, whenever I do a JSON call with DashBoard, any special European/Norwegian characters gets encoded as useless symbols.
    I know that if I set header and other info on a php site and try that way, it comes back as the correct info.

    So I know the JSON response from the server is sent as UTF8, however DashBoard seems to have trouble interpreting these characters.

    Few examples on team names. [LIST=1]
  • "LÁ¸renskog" comes back as "LÁƒ¸renskog".
  • "VÁ¥lerenga" comes back as "VÁƒ¥lerenga".
  • I could, again, make a function that looks for these anomalies and corrects them, but there must be a better way to do this in DashBoard? I mean, you cover most other things...
    #DashBoard


  • 23.  RE: Work with me here... Roster and stats for hockey.

    Posted 05-30-2018 10:18
    I'm working on a similar project to this so to save opening a new thread:


    DashBoard doesnt seem to work with MySQL at the moment


    Is there anyway to get dashboard to pull and push data to an SQL server? The only JS option i know about requires ActiveXObject to create the ADODB connection and recordset, which i don't believe is supported in Dashboard?
    I was hoping to avoid an extra process like exporting JSON/XML from the database so i'd only be using Dashbaord, XPression & an SQL server.

    Cheers
    #DashBoard


  • 24.  RE: Work with me here... Roster and stats for hockey.

    Posted 05-30-2018 13:48
    @OneMoreThing - If you have direct access to and can do some dev-work on the server, you could set up a service on the server that you CAN call upon and get a JSON response from the server containing the data from a predefined query. That's as close to it I have gotten so far. This can also be used to push data INTO the MySQL DB if done correctly.,
    #DashBoard


  • 25.  RE: Work with me here... Roster and stats for hockey.

    Posted 07-09-2018 13:02
    @jamespeltzer Here we go again! This time a two-part question. [LIST=1]
  • So, setting up a data-table in DashBoard, we get this little dropdown meny in the top-right corner that lets us select what collums should be visible etc.
  • Is it possible to set this as "default state" of the DashBoard? It's no problem hiding the specific collumns, but for an inexperienced user, I might not want to have them see the ID of that table row for example. Just to avoid confusion and showing more data than I need.

    If there is no way of setting this a "default state", is there a way to manipulate this in a script so that I can create a function that hides these collumns and run that function on-load?
  • Based on the above, I might want the table to be sorted on a specific collumn (a hidden one to make things "worse"). Now I am fully aware of the w.sortable config option, however, as mentioned that collumn is also hidden. And there is no need for my user to see that time_created from the Instagram API, as that is just a big number that to them makes no sense.
  • However on each "update" of that table, I would very much like to be able to force a sort on that collumn. Is there a script that let's me do the same as I would achieve by clicking the header of that collumn if w.sortable=true?

    #DashBoard


  • 26.  RE: Work with me here... Roster and stats for hockey.

    Posted 07-09-2018 17:55
    1. Unfortunately, there is no way to present a list of columns with a subset visible. You can use w.columns to show a subset but you won't be able to turn more back on.
    What we recommend is having a 'basic mode' and 'advanced mode' and have a toggle button to switch between them.
    If you are using a param table where each column is provided by an array parameter, you can update the constraint on the table when it is toggled.
    If you are using a struct table, you would generally show the table twice in a tab (with the tabs hidden) and change which one is visible.
    If you are using a script table, you can report 2 different column counts based on which mode you're in and, when the mode is changed, tell DashBoard that your table model has changed.

    2. At present, no, there is no programmatic way to change the sorting. You would just have to change the order of your data yourself and set new parameter values.

    #DashBoard


  • 27.  RE: Work with me here... Roster and stats for hockey.

    Posted 07-09-2018 20:54
    1: I'm using the param tables (what I had done before I was aware of structs, so I stuck with it). So I guess the w.collumns wont work with this sadly. It would sort my case though... Could you give me an example of how you would do what you mention with the param tables?

    I mean, if I have a "simple" view. How would choosing say index 5 of that array that only shows value A, B and C also give me value D and E from the "advanced" table?

    2:May I suggest this for future updates then? Both for structs and the param tables.
    #DashBoard


  • 28.  RE: Work with me here... Roster and stats for hockey.

    Posted 07-09-2018 21:04

    I'd still recommend giving the constraint update approach a try then:

    <abs contexttype="opengear" style="">
       <meta>
          <params>
             <param access="1" constrainttype="INT_CHOICE" name="Constriant Toggle" oid="Constriant_Toggle" precision="0" type="INT32" value="1" widget="radio-toggle">
                <constraint key="0">Advanced</constraint>
                <constraint key="1">Basic</constraint>
             </param>
             <param access="1" constrainttype="STRING_CHOICE" name="Table" oid="params.table" precision="0" type="INT32" value="-1" widget="table">
                <constraint>col1</constraint>
                <constraint>col2</constraint>
                <constraint>col3</constraint>
             </param>
             <param access="1" maxlength="0" name="Col 1" oid="col1" precision="0" type="STRING_ARRAY" widget="label">
                <value>a</value>
                <value>b</value>
                <value>c</value>
                <value>d</value>
                <value>e</value>
                <value>f</value>
                <value>g</value>
             </param>
             <param access="1" maxlength="0" name="Col 2" oid="col2" precision="0" type="STRING_ARRAY" widget="label">
                <value>1</value>
                <value>2</value>
                <value>3</value>
                <value>4</value>
                <value>5</value>
                <value>6</value>
                <value>7</value>
             </param>
             <param access="1" maxlength="0" name="Col 3" oid="col3" precision="0" type="STRING_ARRAY" widget="label">
                <value>i</value>
                <value>ii</value>
                <value>iii</value>
                <value>iv</value>
                <value>v</value>
                <value>vi</value>
                <value>vii</value>
             </param>
          </params>
       </meta>
       
       <param expand="true" height="90" left="17" oid="Constriant_Toggle" runtasksonload="true" style="style:toggleButton;" top="303" width="583">
          <task tasktype="ogscript">var cArray = null;
    if (this.getValue() == 0)
    {
       cArray = ['col1', 'col2', 'col3'];
    }
    else
    {
       cArray = ['col1', 'col2'];
    }
    
    var choiceConstraint = params.createStringChoiceConstraint(cArray);
    params.replaceConstraint('params.table', choiceConstraint);</task>
       </param>
    <param expand="true" height="278" left="17" oid="params.table" showlabel="false" top="17" width="580"/>
    </abs>
    

    #DashBoard


  • 29.  RE: Work with me here... Roster and stats for hockey.

    Posted 07-12-2018 00:45
    Yes. Just create a new IntChoiceConstraint instead of a StringChoiceConstraint.
    #DashBoard


  • 30.  RE: Work with me here... Roster and stats for hockey.

    Posted 07-12-2018 21:31
    Yes. Just create a new IntChoiceConstraint instead of a StringChoiceConstraint.


    Appreciate the help @jamespeltzer, but I must be missing something... Look at attached code, based on your example above.

    Table is created with a parameter with OID 0x6.
    The table is defined by the OID Hex values translated into normal INTs, in an Integer Array with Choice Constraints.
    The table collumns are as follows: [LIST=1]

    • Value: 2 (ref OID 0x2), with Name: "Data 1".
    • Value: 3 (ref OID 0x3), with Name: "Data 2".
    • Value: 4 (ref OID 0x4), with Name: "Int 1".

    Initial value: -1

    Now, if you uncomment that last line in the task in the toggle buttons below, that will change the look of the table, but not as wanted...
    "Basic" will be blank, and the advanced table will only show collumn "2" with "data 1" through "data 5". This in other words show the values of the parameter "data1" or 0x2 if you want...
    And if you look at the parameter that makes up the table (0x5), the table collumns are now as follows: [LIST=1]

    • Value: 0 (no OID with 0x0), with Name: "2"
    • Value: 1 (no OID with 0x1), with Name: "3"
    • Value: 2 (ref OID 0x2), with Name "4".

    So I guess that means we did set the Names of the collumns to 2,3,4 but the values it refer to was set automatically to an array starting from 0, wich in turn makes it fetch the completly wrong data.
    I still need it to fetch the OID 0x2, 0x3 and 0x4, but the only thing I can manipulate with this is "Name".

    How do I set both the Int Value AND the STRING Name Value in the parameter 0x5?
    Tried looking at the help documentation for createIntChoiceContraint and the createStringChoiceConstraint, and it's a little lacking to say the least...

    Attached code for example DashBoard:

    <abs contexttype="opengear" gridsize="20" style="">
       <meta>
          <params>
             <param access="1" maxlength="0" name="data1" oid="0x2" precision="0" type="STRING_ARRAY" widget="default">
                <value>data 1</value>
                <value>data 2</value>
                <value>data 3</value>
                <value>data 4</value>
                <value>data 5</value>
             </param>
             <param access="1" maxlength="0" name="data2" oid="0x3" precision="0" type="STRING_ARRAY" widget="default">
                <value>Val 1</value>
                <value>Val 2</value>
                <value>Val 3</value>
                <value>Val 4</value>
                <value>Val 5</value>
             </param>
             <param access="1" constrainttype="INT_NULL" name="Int1" oid="0x4" precision="0" type="INT16_ARRAY" value="11;22;33;44;55" widget="default"/>
             <param access="1" constrainttype="INT_CHOICE" name="hex_table" oid="0x5" precision="0" type="INT16_ARRAY" value="-1" widget="default">
                <constraint key="2">Data 1</constraint>
                <constraint key="3">Data 2</constraint>
                <constraint key="4">Int 1</constraint>
             </param>
             <param access="1" constrainttype="INT_CHOICE" name="Constraint Toggle 2" oid="0x6" precision="0" type="INT32" value="0" widget="radio-toggle">
                <constraint key="0">Advanced</constraint>
                <constraint key="1">Basic</constraint>
             </param>
          </params>
       </meta>
      
      
    <param expand="true" height="280" left="40" oid="0x5" showlabel="false" top="20" widget="table" width="580"/>
       <param expand="true" height="100" left="40" oid="0x6" runtasksonload="true" style="style:toggleButton;" top="300" width="580">
          <task tasktype="ogscript">var cArray = null;
    if (this.getValue() == 0)
    {
       cArray = [2, 3, 4];
    }
    else
    {
       cArray = [2, 3];
    }
    
    var choiceConstraint = params.createIntChoiceConstraint(cArray);
    //params.replaceConstraint(0x5, choiceConstraint);</task>
       </param>
    </abs>

    #DashBoard


  • 31.  RE: Work with me here... Roster and stats for hockey.

    Posted 07-12-2018 21:42

    And for the people wondering why I wanna stay with the Hex values, and not use the "name" of the parameter to create my tables collumns.
    This is my list of parameters as of now. And this is just a small bit of it. And seeing that the parameter list cannot be sorted any other way than through it's name, this is my only way of keeping my parameters sorted and possible to find again. But they are not really "user friendly" as headers for a table collumn...


    #DashBoard


  • 32.  RE: Work with me here... Roster and stats for hockey.

    Posted 07-13-2018 13:52
    AHA!!! They're OBJECTS with "key" and "value" properties!
    So by using arr.push({key:OID,value:"header"}) I can define both the key OID and the header value!
    Not used the createIntChoiceConstraint like that before, but ok!

    May I suggest updating the help documentation for the next version on this then? :) I see alot of posts comming back to choiceConstraints latley.
    https://discussions.rossvideo.com/forum/default-forum-gc1/dashboard-gc43/15923-renaming-parameter-constraints-from-another-parameter - this post is what pointed me in the right direction this time around, as the documentation doesnt have an example yet, and no mention of tje object properties.
    #DashBoard


  • 33.  RE: Work with me here... Roster and stats for hockey.

    Posted 07-13-2018 18:17

    You're close. The problem is that you're just passing a simple array into createIntChoiceConstraint - when you do this, DashBoard will automatically-generate numbers (starting with 0) associated with each entry in the array.

    Instead, you'll want to send an array of JSON Objects where the 'key' field is set to the numeric value and 'value' is set to the string you want displayed.

    <abs contexttype="opengear" gridsize="20" style="">
       <meta>
          <params>
             <param access="1" maxlength="0" name="data1" oid="0x2" precision="0" type="STRING_ARRAY" widget="default">
                <value>data 1</value>
                <value>data 2</value>
                <value>data 3</value>
                <value>data 4</value>
                <value>data 5</value>
             </param>
             <param access="1" maxlength="0" name="data2" oid="0x3" precision="0" type="STRING_ARRAY" widget="default">
                <value>Val 1</value>
                <value>Val 2</value>
                <value>Val 3</value>
                <value>Val 4</value>
                <value>Val 5</value>
             </param>
             <param access="1" constrainttype="INT_NULL" name="Int1" oid="0x4" precision="0" type="INT16_ARRAY" value="11;22;33;44;55" widget="default"/>
             <param access="1" constrainttype="INT_CHOICE" name="hex_table" oid="0x5" precision="0" type="INT16_ARRAY" value="-1" widget="default">
                <constraint key="2">Data 1</constraint>
                <constraint key="3">Data 2</constraint>
                <constraint key="4">Int 1</constraint>
             </param>
             <param access="1" constrainttype="INT_CHOICE" name="Constraint Toggle 2" oid="0x6" precision="0" type="INT32" value="0" widget="radio-toggle">
                <constraint key="0">Advanced</constraint>
                <constraint key="1">Basic</constraint>
             </param>
          </params>
       </meta>
       <param expand="true" height="280" left="40" oid="0x5" showlabel="false" top="20" widget="table" width="580"/>
       <param expand="true" height="100" left="40" oid="0x6" runtasksonload="true" style="style:toggleButton;" top="300" width="580">
          <task tasktype="ogscript">var cArray = null;
    if (this.getValue() == 0)
    {
       cArray = [
       {"key": 2, "value": "New Data 2"},
       {"key": 3, "value": "New Data 3"},
       {"key": 4, "value": "New Data 4"}];
    }
    else
    {
       cArray = [
       {"key": 2, "value": "Alt 2"},
       {"key": 3, "value": "Alt 3"}];
    }
    
    var choiceConstraint = params.createIntChoiceConstraint(cArray);
    params.replaceConstraint(0x5, choiceConstraint);</task>
       </param>
    </abs>
    

    #DashBoard


  • 34.  RE: Work with me here... Roster and stats for hockey.

    Posted 07-14-2018 00:08
    @jamespeltzer So this advanced and normal mode thingy works perfectly. Though I dunno if you are aware of this, but I seem to have run into a small bug with this one...

    On the table (parameter) that I change with the choice constraints, I have a task when selected/select a specific row.
    This function is just grab the URL from one of the collumns for that row, and set it as a background on a basic canvas. Works like a charm and does exactly what it's supposed to.

    However, if I then toggle from say advanced mode to basic mode, the debug info throws an error. And I also notice that no rows are selected.
    Everything still works as normal, and the function it tells me is wrong still works like a charm if I pick another post again. Then with a row selected in basic mode, I go back into advanced mode, and it throws the error message again. For no apparant reason really. Well, I get it.. There's no row selected for that new table/choice constraint, but it still works...

    Just a little something for you guys to think about.
    I'm sure I could replicate the error message in a smaller DashBoard if you want me to.
    #DashBoard


  • 35.  RE: Work with me here... Roster and stats for hockey.

    Posted 07-17-2018 00:32

    So. I was looking for a way to rearrange a table/the arrays making up the table.
    Now I'm fully aware of the sorting (we covered that earlier), and I am also aware of the w.reorder in the config options.
    However while these do sort the table contents as we see them, and lets us "sort" how we want the table, it does not change the index value of those entries.

    Is there a "best practise" on how to rearrange these arrays that make up a parameter table? Or are we back to the structs etc in that case?
    I need to be able to update the top 5 (0-4 index) parameters that will be sent to Xpression as for image URLs. And they should allways be the top 5 images in that table. Now the sorting doesnt fix it, and the w.reorder does not update the top 5 indexes, only move them around in the GUI.

    I kinda allready found a sollution, but having to make 9 arrays and sort each one the same and then setAllValues of all 9 parameters to those arrays again is a bit.. well.. much?
    Was wondering if there is a better way or a best practise included in DashBoard that I dont know about...

    See sollution example here:

    <abs contexttype="opengear" gridsize="20" style="">
       <meta>
          <params>
             <param access="1" maxlength="0" name="Navn" oid="0x2" precision="0" type="STRING_ARRAY" widget="default">
                <value>Value 5</value>
                <value>Value 1</value>
                <value>Value 2</value>
                <value>Value 3</value>
                <value>Value 4</value>
             </param>
             <param access="1" maxlength="0" name="poeng" oid="0x3" precision="0" type="STRING_ARRAY" widget="default">
                <value>16</value>
                <value>11</value>
                <value>18</value>
                <value>12</value>
                <value>14</value>
             </param>
             <param access="1" constrainttype="INT_CHOICE" name="table" oid="0x4" precision="0" type="INT16_ARRAY" value="0" widget="default">
                <constraint key="2">Navn</constraint>
                <constraint key="3">Poeng</constraint>
             </param>
          </params>
       </meta>
       <param expand="true" height="180" left="20" oid="0x4" showlabel="false" top="20" widget="table" width="340">
          <config key="w.cellediting">false</config>
       </param>
    
    <button buttontype="push" height="80" left="380" name="UP" top="20" width="80">
          <task tasktype="ogscript">function move(array, from, to) {
      if( to === from ) return array;
    
      var target = array[from];                         
      var increment = to &lt; from ? -1 : 1;
    
      for(var k = from; k != to; k += increment){
        array[k] = array[k + increment];
      }
      array[to] = target;
      return array;
    }
    
    var arr1 = [];
    var arr2 = [];
    
    for (var i = 0; i &lt; params.getElementCount(0x2); i++) {
       arr1.push(params.getValue(0x2, i));
       arr2.push(params.getValue(0x3, i));
    }
    
    var i = params.getValue(0x4, 0);
    var x = i-1;
    if (x &lt;= 0) { x = 0; }
    
    arr1 = move(arr1, i, x);
    arr2 = move(arr2, i, x);
    
    params.setAllValues(0x2, arr1);
    params.setAllValues(0x3, arr2);
    
    params.setValue(0x4, 0, x);</task>
       </button>
       <button buttontype="push" height="80" left="380" name="DOWN" top="120" width="80">
          <task tasktype="ogscript">function move(array, from, to) {
      if( to === from ) return array;
    
      var target = array[from];                         
      var increment = to &lt; from ? -1 : 1;
    
      for(var k = from; k != to; k += increment){
        array[k] = array[k + increment];
      }
      array[to] = target;
      return array;
    }
    
    var arr1 = [];
    var arr2 = [];
    
    for (var i = 0; i &lt; params.getElementCount(0x2); i++) {
       arr1.push(params.getValue(0x2, i));
       arr2.push(params.getValue(0x3, i));
    }
    
    var i = params.getValue(0x4, 0);
    var x = i+1;
    var max = params.getElementCount(0x2) - 1;
    
    if (x &gt;= params.getElementCount(0x2)) { x = max; }
    
    arr1 = move(arr1, i, x);
    arr2 = move(arr2, i, x);
    
    params.setAllValues(0x2, arr1);
    params.setAllValues(0x3, arr2);
    
    params.setValue(0x4, 0, x);</task>
       </button>
    </abs>

    #DashBoard


  • 36.  RE: Work with me here... Roster and stats for hockey.

    Posted 09-24-2018 13:08

    And we're back at it!

    Is there any way to control tabindex in DashBoard?
    Like in HTML forms you can specify the tab order with a tab-index="x" and direct the focus if you want it in a specific order.
    Ref: https://www.w3schools.com/tags/att_global_tabindex.asp

    In MOST cases, DashBoard does a really good job at this, usually go from left to right, top to bottom...
    However there are sooooome few cases where I would not want this...

    I've tried adding the "tabindex="x"" to the input fields, but this didnt work.
    I've also looked for a "focus" to target a specific ID under ogScript->Panel Elements for a task on said input. No luck...

    HOWEVER

    I did try a "reveal" with the ID of the desired next element, and this worked! However, the issue then is when you're tabbing through panel inputs, and the task only runs when the parameter is changed.

    Example DashBoard included below.
    In this example, you will see that when you DONT change the value of "test1" and tab it will go to "test2".
    However, if you change the value of "test1" the next tab value will be "test3".
    Another issue with this is that you will also change to "test3" if you use a simple "enter" and not tab.

    <abs contexttype="opengear" gridsize="20" id="_top">
       <meta>
          <params>
             <param access="1" maxlength="0" name="test1" oid="test1" type="STRING" value="test1" widget="text"/>
             <param access="1" maxlength="0" name="test 2" oid="test_2" type="STRING" value="test2" widget="text"/>
             <param access="1" maxlength="0" name="test 3" oid="test_3" type="STRING" value="test3" widget="text"/>
          </params>
       </meta>
       <param expand="true" height="60" id="test1" left="40" name="" oid="test1" top="40" width="320">
          <task tasktype="ogscript"/>
          <task tasktype="ogscript">
    
    
    /*! block id=1001 !*/
    ogscript.reveal("test3");
    /*!!
     &lt;block id="1001" type="ogscript_reveal" x="229" y="120" w="243" ID="test3" /&gt;
    !!*/
    /*!!&lt;checksum&gt;3b02fda6f4fc019113e69c38bcb54da3&lt;/checksum&gt;!!*/</task>
       </param>
       <param expand="true" height="60" id="test2" left="40" name="" oid="test_2" top="140" width="320"/>
       <param expand="true" height="60" id="test3" left="40" oid="test_3" top="240" width="320"/>
    </abs>

    Do you have another magical sollution for me @jamespeltzer ? :D


    #DashBoard


  • 37.  RE: Work with me here... Roster and stats for hockey.

    Posted 09-24-2018 14:25
    At present, I have no magical solution to offer you. You've already found the mechanism we provide for passing focus programmatically: ogscript.reveal(ID, FOCUS_FLAG). Unfortunately, while we do provide the ability to run events when keys are pressed, the "TAB" key to change focus is triggered before those event scripts are run, so you have no mechanism to work with that.

    For now, I can log this in our request database and we can look into it for a future DashBoard release.

    James
    #DashBoard


  • 38.  RE: Work with me here... Roster and stats for hockey.

    Posted 06-22-2021 15:04
    I would also like to express my interest in a set/limit tab focus feature. In addition, I'd like to see a way​ to highlight text when an element is in focus. I'd think this would be a great feature for quick keyboard entry during an event, where you can't keep taking your hand off the keyboard to mouse around.

    ------------------------------
    Roger Heyward
    ------------------------------



  • 39.  RE: Work with me here... Roster and stats for hockey.

    Posted 06-21-2019 14:42

    With time on my side and newer releases of DASH board, is there  now a simpler approach to importing an API (JSON formatted) data source?

     

    I too am working on a hockey system for both XPression, (running in the truck) and for vMix for streaming online. These would be separate entities.

    I have access to several APIs which vMix handles quite nicely to populate the graphics.

    Can I utilize these data sources in DASH Board and eventually populate the XPression graphics?

     

    I read thru the thread Aleksander Stalsberg & James Peltzer  and hoping for simplied approach ( for my simple mind)  now, a year later.

     

    Thanks

     

    Whit


    #DashBoard


  • 40.  RE: Work with me here... Roster and stats for hockey.

    Posted 07-04-2019 21:18

    Hi Whit.

    If you go with the STRUCT approach (earlier in the thread), you should be able to parse your JSON string and send it directly into the structure to fill-in the rows of your table.

    <abs contexttype="opengear" id="_top">
    <meta>
    <params>
    <param access="1" maxlength="0" name="Data URL" oid="Data_URL" stateless="true" type="STRING" value="" widget="text"/>
    <param access="1" name="Structured Data" oid="struct-data" stateless="true" type="STRUCT_ARRAY" widget="table">
    <value>
    <subparam access="1" maxlength="0" name="name" suboid="team" type="STRING" value="" widget="default"/>
    </value>
    </param>
    </params>
    </meta>
    <param expand="true" height="61" left="18" oid="Data_URL" right="17" top="20">
    <task tasktype="ogscript">function callback(resultStr)
    {
    if (resultStr != null)
    {
    var json = JSON.parse(resultStr);
    var a = null;
    if (Array.isArray(json))
    {
    a = json;
    }
    else
    {
    a = [];
    a.push(json);
    }
    params.setAllValues('struct-data', a);
    }
    }
    params.resetAllValues('struct-data');
    ogscript.asyncPost(params.getValue('Data_URL', 0), null, callback);</task>
    </param>
    <param bottom="10" expand="true" left="19" oid="struct-data" right="9" showlabel="false" top="94"/>
    </abs>

    Where my JSON data looks like this:

    [{"id":1,"first_name":"Janis","last_name":"Asey","email":"jasey0@fda.gov","gender":"Female","ip_address":"6.21.161.8"},
    {"id":2,"first_name":"Kerr","last_name":"Biasini","email":"kbiasini1@vinaora.com","gender":"Male","ip_address":"147.62.107.241"},
    {"id":3,"first_name":"Stormy","last_name":"Jillions","email":"sjillions2@intel.com","gender":"Female","ip_address":"78.135.109.53"},
    {"id":4,"first_name":"Adelice","last_name":"Sparwell","email":"asparwell3@moonfruit.com","gender":"Female","ip_address":"44.154.98.64"},
    {"id":5,"first_name":"Tally","last_name":"Illes","email":"tilles4@springer.com","gender":"Female","ip_address":"119.16.105.242"},
    {"id":6,"first_name":"Petronilla","last_name":"Armitage","email":"parmitage5@topsy.com","gender":"Female","ip_address":"83.194.66.133"},
    {"id":7,"first_name":"Major","last_name":"Van","email":"mvan6@google.ru","gender":"Male","ip_address":"33.11.63.60"},
    {"id":8,"first_name":"Blancha","last_name":"Sclanders","email":"bsclanders7@cbslocal.com","gender":"Female","ip_address":"235.126.116.159"},
    {"id":9,"first_name":"Tani","last_name":"Diwell","email":"tdiwell8@taobao.com","gender":"Female","ip_address":"89.211.158.1"},
    {"id":10,"first_name":"Marlin","last_name":"Juden","email":"mjuden9@whitehouse.gov","gender":"Male","ip_address":"121.234.50.69"},
    {"id":11,"first_name":"Wade","last_name":"Matusson","email":"wmatussona@psu.edu","gender":"Male","ip_address":"184.165.26.1"},
    {"id":12,"first_name":"Tad","last_name":"Skey","email":"tskeyb@icq.com","gender":"Male","ip_address":"102.60.253.92"},
    {"id":13,"first_name":"Odelinda","last_name":"Ubsdale","email":"oubsdalec@51.la","gender":"Female","ip_address":"65.140.208.184"},
    {"id":14,"first_name":"Anderea","last_name":"Cowlishaw","email":"acowlishawd@omniture.com","gender":"Female","ip_address":"203.46.217.203"},
    {"id":15,"first_name":"Tadeo","last_name":"Wrist","email":"twriste@linkedin.com","gender":"Male","ip_address":"67.207.1.119"},
    {"id":16,"first_name":"Hodge","last_name":"Rishbrook","email":"hrishbrookf@hp.com","gender":"Male","ip_address":"246.46.0.75"},
    {"id":17,"first_name":"Daniela","last_name":"Wiggett","email":"dwiggettg@youku.com","gender":"Female","ip_address":"181.44.139.91"},
    {"id":18,"first_name":"Joel","last_name":"Wolffers","email":"jwolffersh@umich.edu","gender":"Male","ip_address":"176.178.4.32"},
    {"id":19,"first_name":"Ashien","last_name":"Landall","email":"alandalli@themeforest.net","gender":"Female","ip_address":"166.29.153.239"},
    {"id":20,"first_name":"Kimbra","last_name":"Corington","email":"kcoringtonj@uol.com.br","gender":"Female","ip_address":"230.52.152.181"},
    {"id":21,"first_name":"Roddie","last_name":"Trousdale","email":"rtrousdalek@spiegel.de","gender":"Male","ip_address":"110.21.216.185"},
    {"id":22,"first_name":"Nelly","last_name":"Lies","email":"nliesl@harvard.edu","gender":"Female","ip_address":"88.164.178.247"},
    {"id":23,"first_name":"Yolande","last_name":"Henriques","email":"yhenriquesm@fema.gov","gender":"Female","ip_address":"82.129.162.110"},
    {"id":24,"first_name":"Elysee","last_name":"Ingarfield","email":"eingarfieldn@zdnet.com","gender":"Female","ip_address":"20.174.222.162"},
    {"id":25,"first_name":"Brendon","last_name":"Hendrikse","email":"bhendrikseo@wisc.edu","gender":"Male","ip_address":"10.202.62.4"},
    {"id":26,"first_name":"Claudianus","last_name":"Bonafant","email":"cbonafantp@sphinn.com","gender":"Male","ip_address":"212.67.17.22"},
    {"id":27,"first_name":"Bing","last_name":"Coatsworth","email":"bcoatsworthq@ustream.tv","gender":"Male","ip_address":"247.117.126.117"},
    {"id":28,"first_name":"Catharine","last_name":"Paradise","email":"cparadiser@cdc.gov","gender":"Female","ip_address":"233.74.20.72"},
    {"id":29,"first_name":"Westbrooke","last_name":"Langlois","email":"wlangloiss@state.gov","gender":"Male","ip_address":"14.80.172.32"},
    {"id":30,"first_name":"Lindsay","last_name":"Scotchmer","email":"lscotchmert@e-recht24.de","gender":"Female","ip_address":"215.205.207.128"},
    {"id":31,"first_name":"Thedrick","last_name":"Smewings","email":"tsmewingsu@yandex.ru","gender":"Male","ip_address":"42.229.207.66"},
    {"id":32,"first_name":"Glenn","last_name":"Holde","email":"gholdev@t-online.de","gender":"Male","ip_address":"109.45.167.2"},
    {"id":33,"first_name":"Barny","last_name":"Ghent","email":"bghentw@huffingtonpost.com","gender":"Male","ip_address":"173.109.232.44"},
    {"id":34,"first_name":"Maurita","last_name":"Revill","email":"mrevillx@ucoz.com","gender":"Female","ip_address":"102.104.242.151"},
    {"id":35,"first_name":"Floria","last_name":"Cockshot","email":"fcockshoty@histats.com","gender":"Female","ip_address":"109.219.59.226"},
    {"id":36,"first_name":"Hadleigh","last_name":"Lobbe","email":"hlobbez@theguardian.com","gender":"Male","ip_address":"164.80.228.25"},
    {"id":37,"first_name":"Niel","last_name":"McClenaghan","email":"nmcclenaghan10@biblegateway.com","gender":"Male","ip_address":"171.180.144.31"},
    {"id":38,"first_name":"Jenn","last_name":"Brixey","email":"jbrixey11@sohu.com","gender":"Female","ip_address":"165.131.195.0"},
    {"id":39,"first_name":"Caresa","last_name":"Hammersley","email":"chammersley12@unicef.org","gender":"Female","ip_address":"108.45.18.105"},
    {"id":40,"first_name":"Myles","last_name":"Cobson","email":"mcobson13@diigo.com","gender":"Male","ip_address":"208.87.4.183"},
    {"id":41,"first_name":"Sydel","last_name":"Vallerine","email":"svallerine14@ning.com","gender":"Female","ip_address":"211.229.45.111"},
    {"id":42,"first_name":"Keelia","last_name":"Woehler","email":"kwoehler15@ehow.com","gender":"Female","ip_address":"4.68.248.210"},
    {"id":43,"first_name":"Berkie","last_name":"Wooding","email":"bwooding16@cocolog-nifty.com","gender":"Male","ip_address":"76.29.61.62"},
    {"id":44,"first_name":"Maurie","last_name":"Ratcliff","email":"mratcliff17@earthlink.net","gender":"Male","ip_address":"58.166.137.154"},
    {"id":45,"first_name":"Anders","last_name":"Ege","email":"aege18@usda.gov","gender":"Male","ip_address":"173.56.201.209"},
    {"id":46,"first_name":"Vasili","last_name":"Goodliffe","email":"vgoodliffe19@nyu.edu","gender":"Male","ip_address":"103.176.120.95"},
    {"id":47,"first_name":"Kalinda","last_name":"Semmence","email":"ksemmence1a@craigslist.org","gender":"Female","ip_address":"88.177.189.228"},
    {"id":48,"first_name":"Nollie","last_name":"Dumbellow","email":"ndumbellow1b@behance.net","gender":"Female","ip_address":"20.254.122.58"},
    {"id":49,"first_name":"Sasha","last_name":"Ravenscraft","email":"sravenscraft1c@odnoklassniki.ru","gender":"Male","ip_address":"159.192.216.97"}]

     

    Or this:

    [{
    "name":"John",
    "age":30,
    "cars": {
    "car1":"Ford",
    "car2":"BMW",
    "car3":"Fiat"
    }
    },
    {
    "name":"John",
    "age":30,
    "cars": {
    "car1":"Ford",
    "car2":"BMW",
    "car3":"Fiat"
    }
    },
    {
    "name":"John",
    "age":30,
    "cars": {
    "car1":"Ford",
    "car2":"BMW",
    "car3":"Fiat"
    }
    },
    {
    "name":"John",
    "age":30,
    "cars": {
    "car1":"Ford",
    "car2":"BMW",
    "car3":"Fiat"
    }
    }]

    #DashBoard