Facility Control

 View Only
  • 1.  Baseball Stats Table

    Posted 11-27-2018 21:48
    I'm working on a baseball stats panel. I already have thought out what stats I want to calculate and what entries the statistician will need to enter during each plate appearance to determine these stats. Next, I began to create two tables, one for home and one for away. Each table is setup with rows for each player in the batting order, and columns for each plate appearance outcome, BUT baseball is a tricky sport, mostly because there is no way to know how many plate appearances (COLUMNS) will be necessary. To keep my table from being unnecessarily enormous, is there a way to add columns to a table, within tags in Dashboard? If so, is there also a way to add parameters at the same time in those new columns? thanks.


  • 2.  RE: Baseball Stats Table

    Posted 11-28-2018 20:33

    It might be a lot easier to use a structured parameter rather than trying to dynamically change the size of a table in a panel. There are no commands I'm aware of that will add or remove columns.

    Attached is an example panel that uses a structured parameter.

    EDIT: I tried to attach it, but the forum won't let me. Here is the content, copy and paste it to a .grid file:

    <abs contexttype="opengear" style="">
    <meta>
    <params>
    <param access="1" constrainttype="STRUCT" name="Clip Info" oid="templates.clipInfo" structtype="com.rossvideo.playinfo" type="STRUCT" widget="36">
    <value>
    <subparam access="1" maxlength="0" name="Clip Name" suboid="ClipName" type="STRING" value="Test" widget="0"/>
    <subparam access="1" maxlength="0" name="Director" suboid="Director" type="STRING" value="Test" widget="0"/>
    <subparam access="1" maxlength="0" name="Original Air Date" suboid="OriginalAirDate" type="STRING" value="Test" widget="0"/>
    <subparam access="1" maxlength="0" name="Author" suboid="Author" type="STRING" value="Test" widget="0"/>

    </value>



    </param>


    <param access="1" constrainttype="STRUCT" name="Clip List" oid="params.clipList" structtype="com.rossvideo.clipinfo" templateoid="templates.clipInfo" type="STRUCT_ARRAY" widget="36">
    <value>
    <subparam suboid="ClipName" value="Winter is Coming"/>
    <subparam suboid="Director" value="Tim Van Patten"/>
    <subparam suboid="OriginalAirDate" value="April 24, 2011"/>
    <subparam suboid="Author" value="David Benoiff & D.B. Weiss"/>

    </value>


    <value>
    <subparam suboid="ClipName" value="The Kingsroad"/>
    <subparam suboid="Director" value="Brian Kirk"/>
    <subparam suboid="OriginalAirDate" value="April 24, 2011"/>
    <subparam suboid="Author" value="David Benoiff & D.B. Weiss"/>

    </value>


    <value>
    <subparam suboid="ClipName" value="Lord Snow"/>
    <subparam suboid="Director" value="Brian Kirk"/>
    <subparam suboid="OriginalAirDate" value="May 1, 2011"/>
    <subparam suboid="Author" value="David Benoiff & D.B. Weiss"/>

    </value>


    <value>
    <subparam suboid="ClipName" value="Cripples, Bastards, and Broken Things"/>
    <subparam suboid="Director" value="Brian Kirk"/>
    <subparam suboid="OriginalAirDate" value="May 8, 2011"/>
    <subparam suboid="Author" value="Bryan Cogman"/>

    </value>


    <value>
    <subparam suboid="ClipName" value="A Golden Crown"/>
    <subparam suboid="Director" value="Daniel Minahan"/>
    <subparam suboid="OriginalAirDate" value="May 22, 2011"/>
    <subparam suboid="Author" value="David Benioff & D. B. Weiss"/>

    </value>



    </param>


    <param access="1" constrainttype="INT_NULL" name="Selection" oid="Selection" precision="0" strvalue="5" type="INT32" value="5" widget="100"/>

    </params>



    </meta>


    <param constrainttype="STRING_CHOICE" element="0" height="324" left="39" oid="params.clipList" precision="0" top="207" width="699">
    <config key="w.alwaysscroll">true</config>
    <config key="w.selectionparam">Selection</config>
    <constraint>ClipName</constraint>
    <constraint>Director</constraint>

    </param>


    <button buttontype="push" height="62" left="45" name="Insert" top="543" width="237">
    <task tasktype="ogscript">
    var newValue = { ClipName: "", Director: "", OriginalAirDate: "", Author: "" } var p = params.getParam('params.clipList', 0); p.setValueAt(p.getElementCount(), newValue);
    </task>



    </button>


    <param expand="true" height="103" left="78" oid="Selection" style="bdr:etched;bg#dark;font:bold;size:Biggest;o #000000;fg#FFFFFF;txt-align:center;" top="42" width="420"/>
    <button buttontype="push" height="51" left="307" name="Delete" top="547" width="162">
    <task tasktype="ogscript">
    var selection = params.getValue('Selection', 0); if (selection < 0) { return; } var newValue = new Array(); var clipList = params.getParam('params.clipList', 0); for (var i = 0; i < clipList.getElementCount(); i++) { if (i != selection) { newValue.push(clipList.getValueAt(i)); } } params.setAllValues('params.clipList', newValue);
    </task>



    </button>



    </abs>

    #DashBoard


  • 3.  RE: Baseball Stats Table

    Posted 11-28-2018 21:58

    I had read a little about structs while researching this issue on the forum here, but wasn't sure if it was the right solution for my situation. i'll mess around with it and see what i can come up with. thx bg.


    #DashBoard