Facility Control

 View Only
  • 1.  Dashboard - Parameter References

    Posted 04-15-2025 16:23

    The documentation for Dashboard says: 

    "Parameter References
    Sub-params within a structure may also be defined as references to other parameters. These behave
    much like C++ or Java variable references. A parameter reference inherits the referenced parameter's
    type, attributes and constraints. "

    How do I actually do this?  I want to make a dropdown for the home and away team that lists all the possible penalties. 

    The naive way would be to make 2 duplicate array params, but I was hoping I could store the list of penalties somewhere, and make the home and away params inherit these options.



    ------------------------------
    David Levy
    Lead Real Time Graphics Developer
    ESPN
    Charlotte United States
    ------------------------------


  • 2.  RE: Dashboard - Parameter References

    Posted 04-16-2025 06:55
      |   view attached

    Hi David, 

    I hope this example can help. It shows a struct table, I've added a "pens" subparam to a struct that references values in the struct_array. If this subparam is added/deleted from it will update the choices on the struct. 



    ------------------------------
    Richard Crutwell
    Ross Video UK
    ------------------------------

    Attachment(s)

    txt
    StructuredParamArray.txt   12 KB 1 version


  • 3.  RE: Dashboard - Parameter References

    Posted 04-16-2025 14:36

    Thanks Richard!

    Can this also be done with Global Constraints?  Are those also scriptable?

    here's an example from the docs, can I script this type of constraint?

    <constraint constrainttype="INT_CHOICE" id="VideoFormat">
     <constraint key="0">480i-59.94</constraint>
     <constraint key="1">576i-50</constraint>
     <constraint key="2">1080i-29.97</constraint>
     <constraint key="3">1080i-25</constraint>
     <constraint key="4">720p-59.94</constraint>
     <constraint key="5">720p-50</constraint>
     <constraint key="6">1080p-59.94</constraint>
     <constraint key="7">1080p-50</constraint>
    </constraint>
    <param constrainttype="ID_REFERENCE" constraint="VideoFormat" name="Vid1"
    oid="0x501" type="INT16_PARAM"/>
    <param constrainttype="ID_REFERENCE" constraint="VideoFormat" name="Vid2"
    oid="0x502" type="INT16_PARAM"/>
    <param constrainttype="ID_REFERENCE" constraint="VideoFormat" name="Vid3"
    oid="0x503" type="INT16_PARAM"/> 



    ------------------------------
    David Levy
    Lead Real Time Graphics Developer
    ESPN
    Charlotte United States
    ------------------------------



  • 4.  RE: Dashboard - Parameter References

    Posted 04-17-2025 05:28

    I've not seen these global constraints used before, I think they may be an older implementation and there is a newer method, likely using structs.

    Do you have the examples dump of Dashboard panels? - it's a zip archive Tech Support can provide that has examples of how we use all the features including the params and constraints. I think it'd be best to review these and see if you can achieve what you are looking for from a combination of these examples. Dashboard has been built up over years, so some features like this global constraints have become deprecated, it may be the case here or there is just a simpler method for achieving the same thing.



    ------------------------------
    Richard Crutwell
    Ross Video UK
    ------------------------------



  • 5.  RE: Dashboard - Parameter References

    Posted 04-17-2025 09:52
      |   view attached

    Hi David,

    Now I've seen this question asked before and the issue is with self contained custom panels the <constraint/> tags actually get read in after the <param/> tags. So the solution to this is to use script to set these parameters constraints on load to the OID or just change the constraint on the individual instance of drawing that parameter in the interface to the ID Reference.

    I've attached a zip with an example panel where...

    • I made the Vid1 param update via script using the ID reference of the already existing <constraint> tag in the meta
    • I made a drawn in instance of the Vid2 param reference the already existing <constraint> tag in the meta
    • I made the Vid3 param take a completely new constraint generated by script
    • I made a drawn in instance of the Vid4 param reference a newly generated constaint ID made by script
    • Last I made the Vid6 param take the constraint of the Vid5 param with script

    One thing to be aware of is that in the case of Vid2 and Vid4 they only have the ID constraint on those drawn in instances.

    In my example look for the code in the API. I've set it to immediate="true" so that it runs the code in the API before the UI components get rendered.

    I've also taken the liberty to attach two other example panels in the zip. I believe these are Richard is referring to.

    Hope this helps and makes sense!



    ------------------------------
    Antony Giraldo
    DashBoard Custom Panel Developer
    Ross Video Creative Services | Rocket Surgery Triggering and Control
    ------------------------------

    Attachment(s)

    zip
    Constraints Examples.zip   4 KB 1 version


  • 6.  RE: Dashboard - Parameter References

    Posted 04-17-2025 09:54

    External constraints are still supported though they are not widely used (since no user interface for creating them and working with them was ever added).  They are created the same way other constrains are created (params.createIntChoice, params.createIntRange, prams.createStringChoice, params.createStringStringChoice, ...)

    They are updated via params.replaceIdentifiedConstraint('ID', updatedConstraint);
    OR
    params.replaceIdentifiedConstraint('ID', 'ID_OF_NEW');

    When you replace an identified constraint, anything referencing them should automatically update.



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



  • 7.  RE: Dashboard - Parameter References

    Posted 04-17-2025 09:51

    Hi David.

    Formal parameter references use a "_r_" prefix and are only available in custom panels if the data source is JSON (either OGP-JSON or an ogJSON file).  The built-in "self-contained" data for custom panels uses the XML encoding which does not implement any syntax for signaling a parameter reference.  The "base param" or "template param" mechanism that Richard shows in his example is about as close as you can get (and sounds like a better match for your use anyhow).  



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



  • 8.  RE: Dashboard - Parameter References

    Posted 04-17-2025 15:36

    Wow, thanks everyone!  I eventually saw some downsides with the external constraints and reverted.



    ------------------------------
    David Levy
    Lead Real Time Graphics Developer
    ESPN
    Charlotte United States
    ------------------------------