Facility Control

 View Only
  • 1.  Create buttons from list/array of parameters

    Posted 04-03-2018 19:57
    So, I got yet another question here for you...
    I'm looking at creating a panel that you can automatically populate.
    Say I got a list of players on a team. And I get them aaaaaaall into DashBoard either through an XML import or through a REST-call (JSON).

    Now... I have a list of these players, with the numbers etc going down a table.
    Then I want a button, this button has tasks on it, that will let me trigger goal music, possibly a video from a source, and change the crosspoint on a ROSS Mixer, that is good and dandy.

    HOWEVER!

    Now I want to be able to get whoever scored easy! So when all of this happens, I want the user to be presented with a table of jersey numbers! And I want these jerseys to be populated with the numbers of the players that is on that team that scored. And all these team jerseys should be pulled from the table/array of players pulled from the database earlier.

    Is there a way to do a "for each" in this table, create a button that has the value from i++ going down the list?


  • 2.  RE: Create buttons from list/array of parameters

    Posted 04-05-2018 15:52

    Okay, so you have a table of data and you want to turn it into a choice list in another area?

    This example should give you what you need:

    <abs contexttype="opengear" style="">
       <meta>
          <params>
             <param access="1" constrainttype="STRING_CHOICE" name="Table" oid="params.table" precision="0" type="INT16" value="0" widget="table">
                <constraint>params.array</constraint>
             </param>
             <param access="1" maxlength="0" name="Array" oid="params.array" precision="0" type="STRING_ARRAY" value="a;;;" widget="text">
                <value>a</value>
                <value>
                </value>
                <value>
                </value>
                <value>
                </value>
             </param>
             <param access="1" constrainttype="INT_CHOICE" name="Dropdown" oid="params.combo" precision="0" type="INT16" value="0" widget="combo">
                <constraint key="0">a</constraint>
                <constraint key="1">b</constraint>
                <constraint key="2">c</constraint>
                <constraint key="3">d</constraint>
                <constraint key="4">e</constraint>
                <constraint key="5">f</constraint>
                <constraint key="6">g</constraint>
                <constraint key="7">h</constraint>
             </param>
          </params>
       </meta>
       <param expand="true" height="264" left="6" oid="params.table" showlabel="false" top="5" width="205"/>
       <param expand="true" height="43" left="329" oid="params.combo" showlabel="false" top="24" width="281">
          <task tasktype="ogscript">params.setValue('params.table', 0, this.getValue());</task>
       </param>
       <button buttontype="push" height="96" left="221" name="Go!" top="26" width="97">
          <task tasktype="ogscript">var newValues = params.getAllValues('params.array');
    var constraint = params.createIntChoiceConstraint(newValues);
    
    params.replaceConstraint('params.combo', constraint);</task>
       </button>
       <simplegrid height="42" left="4" rows="1" top="278" width="205">
          <button buttontype="push" name="Add">
             <task tasktype="ogscript">var elementCount = params.getElementCount('params.array');
    params.setValue('params.array', elementCount, '');
    params.setValue('params.table', 0, elementCount);</task>
          </button>
          <button buttontype="push" name="Remove">
             <task tasktype="ogscript">var selection = params.getValue('params.table', 0);
    var elemCount = params.getElementCount('params.array');
    if (selection &gt;= 0 &amp;&amp; selection &lt; elemCount &amp;&amp; elemCount &gt; 1)
    {
       params.getParam('params.array', selection).remove();
    }
    else if (elemCount == 1)
    {
       params.setValue('params.array', 0, '');
    }
    
    elemCount = params.getElementCount('params.array');
    if (selection &gt;= elemCount)
    {
       params.setValue('params.table', 0, params.getElementCount('params.array') - 1);
    }
    </task>
          </button>
       </simplegrid>
    </abs>

    #DashBoard


  • 3.  RE: Create buttons from list/array of parameters

    Posted 04-06-2018 07:28
    No, not quite. Done what you've described here before, and while that is also great, I'm thinking about in a touch interface it would be way easier to be able to push a button rather than to pull a dropdown, and then select, possibly scroll, then what if you click wrong, and then "send" this info back.

    I am wondering if there is a way to take a list of jersey numbers, and "echo" (what I would do in PHP), them out into each individual buttons in a grid?
    Like if there is a hidden widget type or anything of the sort? That takes all the values in an array parameter, and shows this as a grid of buttons?
    I did get a workaround going, but that is me manually making 36 buttons, that has an id x# that is numbered just like the array. And hides the buttons that are not in use and sets the canvas height accordingly.

    Being a bit creative with 3 parameters and some IF/ELSE IF combos I also have it so that when "GOAL" is triggered, the panels pops up for whoever gets the message about who scored and who gets the assist, and you can pick those values, then "send" (more like confirm) them back to the main panel.

    This is one part of a two-part question I supposed.
    I'll add an example panel of what I've done here:
    https://discussions.rossvideo.com/forum/default-forum-gc1/dashboard-gc43/15670-get-element-name-or-oid

    So no need to clutter the forum with more posts than needed.
    #DashBoard