Facility Control

 View Only
  • 1.  Persistent Parameter Data in Dashboard Widgets

    Posted 02-02-2022 09:19
    I am wondering if there is a way to keep parameter values in a widget. I have several internal parameters that I am using, but on panel reload, all those parameters get reset to the default values stored in the widget descriptor.

    For example, I am building a widget that allows the user to enter several Xpression Take IDs and generates a button that takes that item for each item in the list. Currently I just have this working directly in the panel, so as you can imagine there is a lot of repeating code and parameters. I know I could keep the param that holds all the take IDs outside the widget and just reference it in the widget, but I would like the user to be able to keep as much contained in the widget as possible so it's easier to add and delete these widgets as needed. 

    If this isn't possible, my current plan it to build a "database" as a structured param, and use that to manage data for each widget, but if there is an easier way to go about this I would prefer that.

    As always, thank you all for your help!

    ------------------------------
    Andy Bentley
    Broadcast Support Engineer
    Elevation Church
    ------------------------------


  • 2.  RE: Persistent Parameter Data in Dashboard Widgets

    Posted 02-08-2022 09:35
    To add some clarity to this question, I am looking for a similar functionality to the ogscript macro group widget that ships with dashboard. It looks like this just has a structured param as a config param, but must have some custom config layout since that parameter doesn't show up in the widget editor. There are a couple other things I was hoping to reverse engineer from this widget, but it looks like the widget descriptor has been compiled to machine code, so I can't see how it works. Is there any way to peek at the source code for this widget?

    If not, am I on the right track with the idea of using a structured param as a config param and hiding it from the widget editor using a custom oglml block?

    Thank you!

    ------------------------------
    Andy Bentley
    Broadcast Support Engineer
    Elevation Church
    ------------------------------



  • 3.  RE: Persistent Parameter Data in Dashboard Widgets

    Posted 02-08-2022 15:39
    Hi Andy
    Parameters defined in the <config/> block of a widget descriptor are written to each widget instance in a panel. Parameters described inside of the widget's OGLML body are reset to the value they were defined with.
    <abs contexttype="opengear" keepalive="true">
       <meta>
          <widgets>
             <widgetdescriptor id="com.rossvideo.sample">
                <config>
                   <params>
                      <param access="1" maxlength="0" name="Text" oid="My_Text" type="STRING" value="" widget="text"/>
                   </params>
                </config>
                <oglml>
                   <abs>
                      <meta>
                         <params>
                            <param access="1" constrainttype="INT_CHOICE" name="Selectable" oid="Selectable" precision="0" type="INT32" value="-1" widget="radio-toggle">
                               <constraint key="0">0</constraint>
                               <constraint key="1">1</constraint>
                               <constraint key="2">2</constraint>
                               <constraint key="3">3</constraint>
                               <constraint key="4">4</constraint>
                               <constraint key="5">5</constraint>
                               <constraint key="6">6</constraint>
                               <constraint key="7">7</constraint>
                               <constraint key="8">8</constraint>
                               <constraint key="9">9</constraint>
                               <constraint key="10">10</constraint>
                            </param>
                         </params>
                      </meta>
                      <simplegrid bottom="65" cols="4" hspace="2" left="0" right="0" top="0" vspace="2">
                         <param expand="true" height="100" oid="Selectable" style="style:toggleButton" width="100"/>
                      </simplegrid>
                      <param bottom="0" expand="true" height="60" left="0" oid="My_Text" right="0"/>
                   </abs>
                </oglml>
             </widgetdescriptor>
          </widgets>
       </meta>
       <param expand="true" height="106" left="4" oid="Selection" top="4" width="124"/>
       <widget height="349" left="28" top="29" widgetid="com.rossvideo.sample" width="425">
          <config>
             <params>
                <param oid="My_Text" value="asdf"/>
             </params>
          </config>
       </widget>
    </abs>
    ​

    The above example has 2 parameters in the widget - "My_Text" is a config parameter and "Selectable" is defined in the body.
    Hope this helps!

    ------------------------------
    James Peltzer
    Ross Video
    ------------------------------



  • 4.  RE: Persistent Parameter Data in Dashboard Widgets

    Posted 02-08-2022 15:58
    Hey James! Yes, that makes sense. After playing around with it some more I feel like I have a good understanding of how they work now.

    Thanks again!

    ------------------------------
    Andy Bentley
    Broadcast Support Engineer
    Elevation Church
    ------------------------------