Facility Control

 View Only
  • 1.  Are multiple

    Posted 10-28-2020 01:39

    I'm trying to logically/visually sort many parameters; is it acceptable practice to use multiple <params> tags, each say with their own name as a category, rather than having every parameter under the one?

    With of course multiple <param> in each 'group'.

    Are there any repercussions I should know about in doing so?

    Thanks!

    Paul



  • 2.  RE: Are multiple

    Posted 10-28-2020 13:50

    I can't think of any repercussions to doing that.   I just tried it in my custom panel and it works fine.

    EDIT: After talking it over with the creator of DB, he says that it is not a recommended practice, because the OGScript context only tracks and writes to one of the tags.   So you could end up with data being missed.   Put all your parameters in one <params> tag. 

    You could organize them using their OIDs.  So anything that has to do with "teams" could be prefixed with "teams_".


    #DashBoard


  • 3.  RE: Are multiple

    Posted 10-29-2020 09:01

    Great thanks!
    On a side note, I feel like I would like to know a little more about structs/suboids. Is there one of your great example files that specifically demonstrates how (and more importantly why) you would use these?
    Thanks!


    #DashBoard


  • 4.  RE: Are multiple

    Posted 10-29-2020 13:43

    In the example panels (https://support.rossvideo.com/hc/en-us/community/posts/360065970252-Free-DashBoard-Example-Panels-for-Everyone), there is a folder called "Parameters".   In there there is one for Arrays, then StructuredParam, and then StructuredParamArray, which build up to making a table of information using a structured parameter that's an array.

     

    Structured parameters are great for holding a lot of data in one parameter and being able to loop through all that data, or display it all in one place.    Imagine you want to have all the data about a sports team, including the first name and last name of each player, their jersey number.

    If you have 20 players, you could create 60 different parameters to hold all this data.  E.g. player1_fname, player2_fname, player3_fname, etc.   Then you would have to put all 60 parameters on your panel to see all the data.   Which is hard to do.

    Then someone decided there should be 24 players instead of 20.   You have to modify your panel and add 12 new parameters.   It's hard to maintain.

    Instead you could use subparams in an structured parameter, and use an array of them to make a table.   That way all your data is in one parameter.   You can drop that parameter in your panel and see all the data.   The array also means that you can have a variable amount of data.

     

     

    Here is another one I just created for other reasons which creates a "RunDown" type of panel.

     

    <abs contexttype="opengear" gridsize="20" id="_top" keepalive="false">
    <meta>
    <params>
    <param access="1" constrainttype="STRUCT" name="recall_template" oid="recall_template" type="STRUCT" widget="table">
    <value>
    <subparam access="1" maxlength="0" name="Name" suboid="name" type="STRING" value="Recall" widget="default"/>
    <subparam access="1" constrainttype="INT_CHOICE" name="Program" precision="0" suboid="program" type="INT16" value="1000" widget="default">
    <constraint key="1000">Cam1</constraint>
    <constraint key="1001">Cam2</constraint>
    <constraint key="1002">Cam3</constraint>
    <constraint key="1003">Video</constraint>
    <constraint key="1004">XP</constraint>
    <constraint key="1005">Presenter</constraint>
    </subparam>
    <subparam access="1" constrainttype="INT_CHOICE" name="Preview" precision="0" suboid="preview" type="INT16" value="1000" widget="default">
    <constraint key="1000">Cam1</constraint>
    <constraint key="1001">Cam2</constraint>
    <constraint key="1002">Cam3</constraint>
    <constraint key="1003">Video</constraint>
    <constraint key="1004">XP</constraint>
    <constraint key="1005">Presenter</constraint>
    </subparam>
    <subparam access="1" constrainttype="INT_CHOICE" name="Lights" precision="0" suboid="lights" type="INT16" value="1000" widget="default">
    <constraint key="1">On</constraint>
    <constraint key="2">75%</constraint>
    <constraint key="3">50%</constraint>
    <constraint key="4">25%</constraint>
    <constraint key="5">Off</constraint>
    </subparam>
    </value>
    </param>
    <param access="1" constrainttype="STRUCT" name="recall_template" oid="recalls" templateoid="recall_template" type="STRUCT_ARRAY" widget="table">
    <value>
    <subparam suboid="name" value="PreShow"/>
    <subparam suboid="program" value="1003"/>
    <subparam suboid="preview" value="1000"/>
    <subparam suboid="lights" value="4"/>
    </value>
    <value>
    <subparam suboid="name" value="Opening"/>
    <subparam suboid="program" value="1000"/>
    <subparam suboid="preview" value="1004"/>
    <subparam suboid="lights" value="1"/>
    </value>
    <value>
    <subparam suboid="name" value="First Event"/>
    <subparam suboid="program" value="1002"/>
    <subparam suboid="preview" value="1002"/>
    <subparam suboid="lights" value="2"/>
    </value>
    <value>
    <subparam suboid="name" value="Second Event"/>
    <subparam suboid="program" value="1005"/>
    <subparam suboid="preview" value="1004"/>
    <subparam suboid="lights" value="3"/>
    </value>
    <value>
    <subparam suboid="name" value="Third Event"/>
    <subparam suboid="program" value="1001"/>
    <subparam suboid="preview" value="1001"/>
    <subparam suboid="lights" value="4"/>
    </value>
    <value>
    <subparam suboid="name" value="Fourth Event"/>
    <subparam suboid="program" value="1001"/>
    <subparam suboid="preview" value="1003"/>
    <subparam suboid="lights" value="2"/>
    </value>
    <value>
    <subparam suboid="name" value="Fifth Event"/>
    <subparam suboid="program" value="1004"/>
    <subparam suboid="preview" value="1002"/>
    <subparam suboid="lights" value="4"/>
    </value>
    <value>
    <subparam suboid="name" value="Show End"/>
    <subparam suboid="program" value="1003"/>
    <subparam suboid="preview" value="1003"/>
    <subparam suboid="lights" value="5"/>
    </value>
    </param>
    <param access="1" constrainttype="INT_NULL" name="selection" oid="selection" precision="0" type="INT16" value="2" widget="default"/>
    <param access="1" constrainttype="INT_CHOICE" name="program" oid="program" precision="0" type="INT16" value="1005" widget="radio-toggle">
    <constraint key="1000">Cam1</constraint>
    <constraint key="1001">Cam2</constraint>
    <constraint key="1002">Cam3</constraint>
    <constraint key="1003">Video</constraint>
    <constraint key="1004">XP</constraint>
    <constraint key="1005">Presenter</constraint>
    </param>
    <param access="1" constrainttype="INT_CHOICE" name="preview" oid="preview" precision="0" type="INT16" value="1005" widget="radio-toggle">
    <constraint key="1000">Cam1</constraint>
    <constraint key="1001">Cam2</constraint>
    <constraint key="1002">Cam3</constraint>
    <constraint key="1003">Video</constraint>
    <constraint key="1004">XP</constraint>
    <constraint key="1005">Presenter</constraint>
    </param>
    <param access="1" constrainttype="INT_CHOICE" name="lights" oid="lights" precision="0" type="INT16" value="1" widget="radio-toggle">
    <constraint key="1">On</constraint>
    <constraint key="2">75%</constraint>
    <constraint key="3">50%</constraint>
    <constraint key="4">25%</constraint>
    <constraint key="5">Off</constraint>
    </param>
    <param access="1" maxlength="0" name="store name" oid="store_name" type="STRING" value="AfterShow" widget="default"/>
    </params>
    <api>function recallSelected() {
    var selected = params.getValue("selection",0);
    params.setValue("program",0,params.getValue("recalls." + selected + ".program",0));
    params.setValue("preview",0,params.getValue("recalls." + selected + ".preview",0));
    params.setValue("lights",0,params.getValue("recalls." + selected + ".lights",0));
    }</api>
    </meta>
    <split bottom="0" left="0" orientation="horizontal" right="0" top="0">
    <abs weight="0.5">
    <param expand="true" height="40" left="50" oid="program" right="150" showlabel="false" style="size:Small;t:bg#red;f:bg#buttonbg;" top="40">
    <task tasktype="ogscript">/*! block id=1000,1001,1002 !*/
    ogscript.reveal(("top_tab" + params.getValue('program', 0)));
    /*!!
    &lt;block id="1000" type="ogscript_reveal" x="408" y="108" w="243" ID="ID:1001" /&gt;
    &lt;block id="1001" type="math_add" x="212" y="214" VALUE="top_tab" VAL_1="ID:1002" w="218" VAL_1_1="" /&gt;
    &lt;block id="1002" type="param__top&amp;amp;program (program)[0]" x="10" y="354" w="243" SET="" /&gt;
    !!*/
    /*!!&lt;checksum&gt;6101c215138606f16f5a9822a3fa7f4e&lt;/checksum&gt;!!*/</task>
    </param>
    <param expand="true" height="40" left="50" oid="preview" right="150" showlabel="false" style="size:Small;t:bg#green;f:bg#buttonbg;" top="100">
    <task tasktype="ogscript">/*! block id=1003,1004,1006 !*/
    ogscript.reveal(("bottom_tab" + params.getValue('preview', 0)));
    /*!!
    &lt;block id="1003" type="ogscript_reveal" x="539" y="60" w="243" ID="ID:1004" /&gt;
    &lt;block id="1004" type="math_add" x="319" y="104" VALUE="bottom_tab" VAL_1="ID:1006" w="218" VAL_1_1="" /&gt;
    &lt;block id="1006" type="param__top&amp;amp;preview (preview)[0]" x="10" y="262" w="243" SET="" /&gt;
    !!*/
    /*!!&lt;checksum&gt;52213b66fa9f6daa8672408f5d51fb22&lt;/checksum&gt;!!*/</task>
    </param>
    <button buttontype="push" height="100" name="Cut" right="50" top="40" width="80">
    <task tasktype="ogscript">var temp = params.getValue("program",0);
    params.setValue("program", 0,params.getValue("preview",0));
    params.setValue("preview", 0, temp);</task>
    </button>
    <simplegrid bottom="100" left="50" right="50" rows="2" top="160" vspace="10">
    <tab tabposition="none">
    <abs id="top_tab1000" name="Tab 1">
    <label bottom="0" left="0" name="CAM1" right="0" style="txt-align:center;size:Biggest;bg#orange;" top="0"/>
    </abs>
    <abs id="top_tab1001" name="Tab 2">
    <label bottom="0" left="0" name="CAM2" right="0" style="txt-align:center;size:Biggest;bg#green;" top="0"/>
    </abs>
    <abs id="top_tab1002" name="Tab 3">
    <label bottom="0" left="0" name="CAM3" right="0" style="txt-align:center;size:Biggest;bg#red;" top="0"/>
    </abs>
    <abs id="top_tab1003" name="Tab 4">
    <label bottom="0" left="0" name="VIDEO" right="0" style="txt-align:center;size:Biggest;bg#purple;" top="0"/>
    </abs>
    <abs id="top_tab1004" name="Tab 5">
    <label bottom="0" left="0" name="XPRESSION" right="0" style="txt-align:center;size:Biggest;bg#pink;" top="0"/>
    </abs>
    <abs id="top_tab1005" name="Tab 6">
    <label bottom="0" left="0" name="PRESENTER" right="0" style="txt-align:center;size:Biggest;bg#blue;" top="0"/>
    </abs>
    </tab>
    <tab tabposition="none">
    <abs id="bottom_tab1000" name="Tab 1">
    <label bottom="0" left="0" name="CAM1" right="0" style="txt-align:center;size:Biggest;bg#orange;" top="0"/>
    </abs>
    <abs id="bottom_tab1001" name="Tab 2">
    <label bottom="0" left="0" name="CAM2" right="0" style="txt-align:center;size:Biggest;bg#green;" top="0"/>
    </abs>
    <abs id="bottom_tab1002" name="Tab 3">
    <label bottom="0" left="0" name="CAM3" right="0" style="txt-align:center;size:Biggest;bg#red;" top="0"/>
    </abs>
    <abs id="bottom_tab1003" name="Tab 4">
    <label bottom="0" left="0" name="VIDEO" right="0" style="txt-align:center;size:Biggest;bg#purple;" top="0"/>
    </abs>
    <abs id="bottom_tab1004" name="Tab 5">
    <label bottom="0" left="0" name="XPRESSION" right="0" style="txt-align:center;size:Biggest;bg#pink;" top="0"/>
    </abs>
    <abs id="bottom_tab1005" name="Tab 6">
    <label bottom="0" left="0" name="PRESENTER" right="0" style="txt-align:center;size:Biggest;bg#blue;" top="0"/>
    </abs>
    </tab>
    </simplegrid>
    <table bottom="20" height="60" left="50" oid="lights" right="50">
    <tr>
    <label anchor="east" fill="none" insets="0,0,0,5" name="lights" weightx="0.0"/>
    <param anchor="west" expand="true" fill="both" oid="lights" showlabel="false" weightx="1.0" weighty="1.0"/>
    </tr>
    </table>
    </abs>
    <abs>
    <table bottom="20" left="20" right="20" top="100">
    <tr>
    <param colspan="1" expand="true" fill="both" oid="recalls" rowspan="1" showlabel="false" weightx="1.0" weighty="1.0">
    <config key="w.rowheight">30</config>
    <config key="w.selectionparam">selection</config>
    </param>
    <simplegrid cols="1" expand="true" fill="both" insets="0,20,0,0" weightx="0.0" weighty="1.0" width="120">
    <button buttontype="push" name="Start">
    <task tasktype="ogscript">


    /*! block id=1013,1014 !*/
    params.setValue('selection', 0, 0);
    /*! block id=1018 !*/
    recallSelected()
    /*!!
    &lt;block id="1013" type="param__top&amp;amp;selection (selection)[0]" x="208" y="10" w="243" SET="ID:1014" next="ID:1018" /&gt;
    &lt;block id="1014" type="integer" x="10" y="10" w="168" VALUE="0" /&gt;
    &lt;block id="1018" type="function_recallSelected" x="208" y="82" w="243" /&gt;
    !!*/
    /*!!&lt;checksum&gt;7eefd051806073b2bf293e6122ecf696&lt;/checksum&gt;!!*/</task>
    </button>
    <button buttontype="push" name="Next">
    <task tasktype="ogscript">


    /*! block id=1015 !*/
    params.setValue('selection', 0, params.getValue('selection', 0) + 1);
    /*! block id=1019 !*/
    recallSelected()
    /*!!
    &lt;block id="1015" type="math_increment_param" x="10" y="10" w="363" PARAM="[root, Params for RundownStart.grid, Not In Menu, selection (selection)]" VALUE="1" next="ID:1019" /&gt;
    &lt;block id="1019" type="function_recallSelected" x="10" y="106" w="243" /&gt;
    !!*/
    /*!!&lt;checksum&gt;0295c511f0828a30bdf3c9539545594d&lt;/checksum&gt;!!*/</task>
    </button>
    <button buttontype="push" name="Prev">
    <task tasktype="ogscript">


    /*! block id=1016 !*/
    params.setValue('selection', 0, params.getValue('selection', 0) + -1);
    /*! block id=1020 !*/
    recallSelected()
    /*!!
    &lt;block id="1016" type="math_increment_param" x="10" y="10" w="353" PARAM="[root, Params for RundownStart.grid, Not In Menu, selection (selection)]" VALUE="-1" next="ID:1020" /&gt;
    &lt;block id="1020" type="function_recallSelected" x="10" y="106" w="243" /&gt;
    !!*/
    /*!!&lt;checksum&gt;5183bc7045d27eb7e44a2475d85c5cb8&lt;/checksum&gt;!!*/</task>
    </button>
    <abs/>
    <button buttontype="push" name="Recall Selected">
    <task tasktype="ogscript">/*! block id=1017 !*/
    recallSelected()
    /*!!
    &lt;block id="1017" type="function_recallSelected" x="10" y="100" w="243" /&gt;
    !!*/
    /*!!&lt;checksum&gt;f3631071b9084b849eec34c59cdef151&lt;/checksum&gt;!!*/</task>
    </button>
    <abs/>
    <button buttontype="push" name="Move Up">
    <task tasktype="ogscript">var newarray = new Array();
    var index = params.getValue("selection",0);
    if (index&gt;0) {

    // Recreate the array of values, with a new order.
    var count = params.getElementCount("recalls");
    for (var i=0; i &lt; count; i++) {
    if (i == index-1) {
    newarray.push(params.getValue("recalls",index));
    continue;
    }
    if (i == index) {
    newarray.push(params.getValue("recalls",index-1));
    continue;
    }
    newarray.push(params.getValue("recalls",i));

    }

    params.setAllValues("recalls", newarray);
    params.setValue("selection",0,index-1);
    }</task>
    </button>
    <button buttontype="push" name="Move Down">
    <task tasktype="ogscript">var newarray = new Array();
    var index = params.getValue("selection",0);

    var count = params.getElementCount("recalls");
    if (index&lt;count-1) {
    // Recreate the array with a new order.
    for (var i=0; i &lt; count; i++) {
    if (i == index+1) {
    newarray.push(params.getValue("recalls",index));
    continue;
    }
    if (i == index) {
    newarray.push(params.getValue("recalls",index+1));
    continue;
    }
    newarray.push(params.getValue("recalls",i));

    }

    params.setAllValues("recalls", newarray);
    params.setValue("selection",0,index+1);
    }</task>
    </button>
    <abs/>
    <button buttontype="push" name="Delete">
    <task tasktype="ogscript">
    var index = params.getValue("selection",0);

    var newarray = new Array();
    var count = params.getElementCount("recalls");
    // recreate the array, but leave out the one that is selected.
    for (var i=0; i &lt; count; i++) {
    if (i != index) {
    newarray.push(params.getValue("recalls",i));
    }
    }

    params.setAllValues("recalls", newarray);</task>
    </button>
    </simplegrid>
    </tr>
    <tr>
    <param colspan="1" expand="true" fill="both" insets="10,0,10,0" oid="store_name" rowspan="1" showlabel="false" weightx="0.99" weighty="0.0"/>
    <button buttontype="push" colspan="1" fill="both" insets="10,20,10,0" name="Add to Rundown" rowspan="1" weightx="0.0" weighty="0.0" width="60">
    <task tasktype="ogscript">
    var newrecall = {
    name: params.getValue("store_name",0),
    program: params.getValue("program",0),
    preview: params.getValue("preview",0),
    lights: params.getValue("lights",0),
    };

    var count = params.getElementCount("recalls");
    var p = params.getParam("recalls",0);
    p.setValueAt(count, newrecall);</task>
    </button>
    </tr>
    </table>
    <label height="60" left="20" name="Rundown" style="txt-align:west;size:Bigger;" top="40" width="400"/>
    <param expand="true" height="20" oid="selection" right="24" showlabel="false" top="60" width="80"/>
    <label height="20" name="Currently Selected:" right="84" style="txt-align:west;" top="60" width="140"/>
    </abs>
    </split>
    </abs>


    #DashBoard


  • 5.  RE: Are multiple

    Posted 10-29-2020 15:15

    Hi Ben, your rundown panel looking very well!

    The fact that you can insert constraints with drop-menu choices in table rows is fantastic!  

    Wondering if 'enter' shortcut can be assigned to trigger 'next' button.

    Also, if it possible to disable cell editing on table, but allow to change dropdown constraints (pretty sure script table is the answer).


    #DashBoard


  • 6.  RE: Are multiple

    Posted 10-29-2020 15:40

    Pressing enter will change the selection.   We could add a task to the selection parameter so that when it changes, it triggers the recalls.

     


    #DashBoard


  • 7.  RE: Are multiple

    Posted 10-29-2020 20:53

    After talking it over with the creator of DB, he says that it is not a recommended practice to use multiple <params> tag, because the OGScript context only tracks and writes to one of the tags.   So you could end up with data being missed.   Put all your parameters in one <params> tag. 

    You could organize them using their OIDs.  So anything that has to do with "teams" could be prefixed with "teams_".


    #DashBoard


  • 8.  RE: Are multiple

    Posted 10-30-2020 06:17

    Thank you, appreciate the quick follow-up before I moved them all!
    And very grateful for the response re structured parameters, I will have a look at your example!

    Would you be interested in taking a look at a panel I have built, for feedback on how it might be made more efficiently? I have a tab element that I want to replicate 9x, and if I do so how it is now (rather clunky) it will require large replications of parameters and I just know there's a better way to store things! And I'd like to make the first 'copy' well before duplicating poor code.


    #DashBoard


  • 9.  RE: Are multiple

    Posted 10-30-2020 13:38

    If you're replicating a portion of you panel multiple times, you may be better to use widgets.   I just made a series of tutorial videos for the Worship Production market.   One of those is how to make widgets.

    You can find those videos here: https://www.rossvideo.com/applications/house-of-worship/.   Just scroll down to the "House of Worship U" section.   

    Widgets basically allow you to have "sub-panels" repeated over and over.   Each widget has its own set of internal parameters.


    #DashBoard