Facility Control

 View Only
Expand all | Collapse all

params getting corrupted

  • 1.  params getting corrupted

    Posted 11-08-2024 20:36

    I have some struct tables, and my code is only reading from them.  

    At most, I have some code that hides them from streaming.

    However, something is changing them from:

    <param access="1" constrainttype="STRUCT" name="Team 1 Info" oid="team1.info" stream="false" templateoid="teamInfo.template" type="STRUCT" widget="table">

    to:  <param base="teamInfo.template" name="Team 1 Info" oid="team1.info" stream="false">

    I promise I didn't write the "base" attribute

    Also, the structs that are empty get deleted.  I used to have 8, now I have 4.

    I think this has happened twice.

    I'm adding in the template, in case it helps.

    <param access="1" constrainttype="STRUCT" name="Team Template" oid="teamInfo.template" stream="false" type="STRUCT" widget="table">
       <value>
          <subparam access="1" maxlength="0" name="Application Color" stream="false" suboid="applicationColor" type="STRING" value="#E40F0F" widget="color-picker"/>
          <subparam access="1" maxlength="0" name="Rank" stream="false" suboid="rank" type="STRING" value="" widget="text"/>
          <subparam access="1" maxlength="0" name="Tricode" stream="false" suboid="tricode" type="STRING" value="" widget="text"/>
          <subparam access="1" maxlength="0" name="City" stream="false" suboid="city" type="STRING" value="" widget="text"/>
          <subparam access="1" maxlength="0" name="Name" stream="false" suboid="name" type="STRING" value="" widget="text"/>
          <subparam access="1" maxlength="0" name="Mascot" stream="false" suboid="mascot" type="STRING" value="" widget="text"/>
          <subparam access="1" maxlength="0" name="Logo" stream="false" suboid="logo" type="STRING" value="" widget="file-picker"/>
          <subparam access="1" maxlength="0" name="ALT Logo" stream="false" suboid="altLogo" type="STRING" value="" widget="file-picker"/>
          <subparam access="1" maxlength="0" name="Swatch" stream="false" suboid="swatch" type="STRING" value="" widget="file-picker"/>
          <subparam access="1" constrainttype="INT_CHOICE" name="Swatch Selection" precision="0" stream="false" suboid="swatchSelection" type="INT16" value="0" widget="default">
             <constraint key="0">Logo - 0</constraint>
             <constraint key="1">Primary - 1</constraint>
             <constraint key="2">Secondary - 2</constraint>
             <constraint key="3">Bottomline - 3</constraint>
          </subparam>
          <subparam access="1" maxlength="0" name="Headshot Folder" stream="false" suboid="headshotFolder" type="STRING" value="" widget="file-picker"/>
          <subparam access="1" constrainttype="INT_CHOICE" name="Session Selector" precision="0" stream="false" suboid="sessionSelector" type="INT16" value="1" widget="default">
             <constraint key="1">1</constraint>
             <constraint key="2">2</constraint>
          </subparam>
          <subparam access="1" constrainttype="FLOAT_NULL" name="Vault Score" precision="0" stream="false" suboid="vaultScore" type="FLOAT32" value="0.0" widget="default"/>
          <subparam access="1" constrainttype="FLOAT_NULL" name="Uneven Bars Score" precision="0" stream="false" suboid="unevenBarsScore" type="FLOAT32" value="0.0" widget="default"/>
          <subparam access="1" constrainttype="FLOAT_NULL" name="Beam Score" precision="0" stream="false" suboid="beamScore" type="FLOAT32" value="0.0" widget="default"/>
          <subparam access="1" constrainttype="FLOAT_NULL" name="Floor Score" precision="0" stream="false" suboid="floorScore" type="FLOAT32" value="0.0" widget="default"/>
          <subparam access="1" constrainttype="FLOAT_NULL" name="Pommel Horse Score" precision="0" stream="false" suboid="pommelHorseScore" type="FLOAT32" value="0.0" widget="default"/>
          <subparam access="1" constrainttype="FLOAT_NULL" name="Still Rings Score" precision="0" stream="false" suboid="stillRingsScore" type="FLOAT32" value="0.0" widget="default"/>
          <subparam access="1" constrainttype="FLOAT_NULL" name="Parallel Bars Score" precision="0" stream="false" suboid="parallelBarsScore" type="FLOAT32" value="0.0" widget="default"/>
          <subparam access="1" constrainttype="FLOAT_NULL" name="Horizontal Bar Score" precision="0" stream="false" suboid="horizBarScore" type="FLOAT32" value="0.0" widget="default"/>
       </value>
    </param>



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


  • 2.  RE: params getting corrupted

    Posted 11-09-2024 20:09

    As I work on this, Im frequently looking at similar dashboards, could there be some cross-contamination?



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



  • 3.  RE: params getting corrupted

    Posted 11-13-2024 17:12

    Ok, I did some more research.  I can make this consistently when I try to params.setValue in one of those Structs.

    However, when I first wrote this, I didn't have any code that wrote to those structs at the time, I was just editing view params at that time.



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



  • 4.  RE: params getting corrupted

    Posted 11-13-2024 17:14

    Here's a sample struct pre-bug:

    <param access="1" constrainttype="STRUCT" name="Team 1 Info" oid="team0.info" stream="false" templateoid="teamInfo.template" type="STRUCT" widget="default">
       <value>
          <subparam suboid="applicationColor" value="#B20044"/>
          <subparam suboid="rank" value="1"/>
          <subparam suboid="tricode" value="ARK"/>
          <subparam suboid="city" value="Arkansas"/>
          <subparam suboid="name" value="Arkansas"/>
          <subparam suboid="mascot" value="Razorbacks"/>
          <subparam suboid="logo" value="file:/D:/IMS%20Images/Primary/ARKANSAS.PNG"/>
          <subparam suboid="altLogo" value="file:/D:/IMS%20Images/Secondary/ARKANSAS.PNG"/>
          <subparam suboid="swatch" value="file:/D:/IMS%20Images/Swatches/ARKANSAS.PNG"/>
          <subparam suboid="swatchSelection" value="0"/>
          <subparam suboid="headshotFolder" value=""/>
          <subparam suboid="sessionSelector" value="1"/>
          <subparam suboid="vaultScore" value="1.0"/>
          <subparam suboid="unevenBarsScore" value="2.0"/>
          <subparam suboid="beamScore" value="3.0"/>
          <subparam suboid="floorScore" value="4.0"/>
          <subparam suboid="pommelHorseScore" value="0.0"/>
          <subparam suboid="stillRingsScore" value="0.0"/>
          <subparam suboid="parallelBarsScore" value="0.0"/>
          <subparam suboid="horizBarScore" value="0.0"/>
          <subparam suboid="rotEvt0" value="1"/>
          <subparam suboid="rotEvt1" value="4"/>
          <subparam suboid="rotEvt2" value="3"/>
          <subparam suboid="rotEvt3" value="2"/>
          <subparam suboid="rotEvt4" value="-1"/>
          <subparam suboid="rotEvt5" value="-1"/>
          <subparam suboid="rotEvt6" value="-1"/>
          <subparam suboid="rotEvt7" value="-1"/>
          <subparam suboid="rotEvt8" value="-1"/>
          <subparam suboid="rotEvt9" value="-1"/>
          <subparam suboid="rotEvt10" value="-1"/>
          <subparam suboid="rotEvt11" value="-1"/>
          <subparam suboid="rotEvt12" value="-1"/>
          <subparam suboid="rotEvt13" value="-1"/>
          <subparam suboid="rotEvt14" value="-1"/>
          <subparam suboid="rotEvt15" value="-1"/>
       </value>
    </param>


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



  • 5.  RE: params getting corrupted

    Posted 11-13-2024 17:15

    Here's what it turns into:

    <param base="teamInfo.template" name="Team 1 Info" oid="team0.info" stream="false">
       <value>
          <subparam suboid="applicationColor" value="#B20044"/>
          <subparam suboid="rank" value="1"/>
          <subparam suboid="tricode" value="ARK"/>
          <subparam suboid="city" value="Arkansas"/>
          <subparam suboid="name" value="Arkansas"/>
          <subparam suboid="mascot" value="Razorbacks"/>
          <subparam suboid="logo" value="file:/D:/IMS%20Images/Primary/ARKANSAS.PNG"/>
          <subparam suboid="altLogo" value="file:/D:/IMS%20Images/Secondary/ARKANSAS.PNG"/>
          <subparam suboid="swatch" value="file:/D:/IMS%20Images/Swatches/ARKANSAS.PNG"/>
          <subparam suboid="swatchSelection" value="0"/>
          <subparam suboid="headshotFolder" value=""/>
          <subparam suboid="sessionSelector" value="1"/>
          <subparam suboid="vaultScore" value="1.0"/>
          <subparam suboid="unevenBarsScore" value="2.0"/>
          <subparam suboid="beamScore" value="3.0"/>
          <subparam suboid="floorScore" value="4.0"/>
          <subparam suboid="pommelHorseScore" value="0.0"/>
          <subparam suboid="stillRingsScore" value="0.0"/>
          <subparam suboid="parallelBarsScore" value="0.0"/>
          <subparam suboid="horizBarScore" value="0.0"/>
          <subparam suboid="rotEvt0" value="1"/>
          <subparam suboid="rotEvt1" value="4"/>
          <subparam suboid="rotEvt2" value="3"/>
          <subparam suboid="rotEvt3" value="2"/>
          <subparam suboid="rotEvt4" value="-1"/>
          <subparam suboid="rotEvt5" value="-1"/>
          <subparam suboid="rotEvt6" value="-1"/>
          <subparam suboid="rotEvt7" value="-1"/>
          <subparam suboid="rotEvt8" value="-1"/>
          <subparam suboid="rotEvt9" value="-1"/>
          <subparam suboid="rotEvt10" value="-1"/>
          <subparam suboid="rotEvt11" value="-1"/>
          <subparam suboid="rotEvt12" value="-1"/>
          <subparam suboid="rotEvt13" value="-1"/>
          <subparam suboid="rotEvt14" value="-1"/>
          <subparam suboid="rotEvt15" value="-1"/>
       </value>
    </param>


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



  • 6.  RE: params getting corrupted

    Posted 11-13-2024 17:17

    Here's the offending code:

    function clearTeamRotations() {
    
       for (var i = 0; i < 12; i++) {
          for (var j = 0; j < 16; j++) { 
             params.setValue('team' + i + '.info.rotEvt' + j, 0, -1);  
          }   
       }
    }
    
    function updateTeamRotations() {
       
       clearTeamRotations();
    
       // i is the rotation number in this session
       for (var i = 0; i < 8; i++) {
    
          var vaultTeam = params.getValue('womensSession1.'+ i +'.vaultSelector', 0);
          var barsTeam = params.getValue('womensSession1.'+ i +'.barsSelector', 0);
          var beamTeam = params.getValue('womensSession1.'+ i +'.beamSelector', 0);
          var floorTeam = params.getValue('womensSession1.'+ i +'.floorSelector', 0);
    
          // lookup the the team doing each event and set it's ith rotation to that event 
    
          if (floorTeam != -1) {
             params.setValue('team'+ floorTeam +'.info.rotEvt' + i, 0, 4);
          }
    
          if (beamTeam != -1) {
             params.setValue('team'+ beamTeam +'.info.rotEvt' + i, 0, 3);
          }
    
          if (barsTeam != -1) {
             params.setValue('team'+ barsTeam +'.info.rotEvt' + i, 0, 2);
          }
    
          if (vaultTeam != -1) {
             params.setValue('team'+ vaultTeam +'.info.rotEvt' + i, 0, 1);
          }
       }
    }


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



  • 7.  RE: params getting corrupted

    Posted 11-13-2024 17:21

    Updated Template since first post:

    <param access="1" constrainttype="STRUCT" name="Team Template" oid="teamInfo.template" stream="false" type="STRUCT" widget="default">
       <value>
          <subparam access="1" maxlength="0" name="Application Color" stream="false" suboid="applicationColor" type="STRING" value="#E40F0F" widget="color-picker"/>
          <subparam access="1" maxlength="0" name="Rank" stream="false" suboid="rank" type="STRING" value="" widget="text"/>
          <subparam access="1" maxlength="0" name="Tricode" stream="false" suboid="tricode" type="STRING" value="" widget="text"/>
          <subparam access="1" maxlength="0" name="City" stream="false" suboid="city" type="STRING" value="" widget="text"/>
          <subparam access="1" maxlength="0" name="Name" stream="false" suboid="name" type="STRING" value="" widget="text"/>
          <subparam access="1" maxlength="0" name="Mascot" stream="false" suboid="mascot" type="STRING" value="" widget="text"/>
          <subparam access="1" maxlength="0" name="Logo" stream="false" suboid="logo" type="STRING" value="" widget="file-picker"/>
          <subparam access="1" maxlength="0" name="ALT Logo" stream="false" suboid="altLogo" type="STRING" value="" widget="file-picker"/>
          <subparam access="1" maxlength="0" name="Swatch" stream="false" suboid="swatch" type="STRING" value="" widget="file-picker"/>
          <subparam access="1" constrainttype="INT_CHOICE" name="Swatch Selection" precision="0" stream="false" suboid="swatchSelection" type="INT32" value="0" widget="default">
             <constraint key="0">Logo - 0</constraint>
             <constraint key="1">Primary - 1</constraint>
             <constraint key="2">Secondary - 2</constraint>
             <constraint key="3">Bottomline - 3</constraint>
          </subparam>
          <subparam access="1" maxlength="0" name="Headshot Folder" stream="false" suboid="headshotFolder" type="STRING" value="" widget="file-picker"/>
          <subparam access="1" constrainttype="INT_CHOICE" name="Session Selector" precision="0" stream="false" suboid="sessionSelector" type="INT32" value="1" widget="default">
             <constraint key="1">1</constraint>
             <constraint key="2">2</constraint>
          </subparam>
          <subparam access="1" constrainttype="FLOAT_NULL" name="Vault Score" precision="0" stream="false" suboid="vaultScore" type="FLOAT32" value="0.0" widget="default"/>
          <subparam access="1" constrainttype="FLOAT_NULL" name="Uneven Bars Score" precision="0" stream="false" suboid="unevenBarsScore" type="FLOAT32" value="0.0" widget="default"/>
          <subparam access="1" constrainttype="FLOAT_NULL" name="Beam Score" precision="0" stream="false" suboid="beamScore" type="FLOAT32" value="0.0" widget="default"/>
          <subparam access="1" constrainttype="FLOAT_NULL" name="Floor Score" precision="0" stream="false" suboid="floorScore" type="FLOAT32" value="0.0" widget="default"/>
          <subparam access="1" constrainttype="FLOAT_NULL" name="Pommel Horse Score" precision="0" stream="false" suboid="pommelHorseScore" type="FLOAT32" value="0.0" widget="default"/>
          <subparam access="1" constrainttype="FLOAT_NULL" name="Still Rings Score" precision="0" stream="false" suboid="stillRingsScore" type="FLOAT32" value="0.0" widget="default"/>
          <subparam access="1" constrainttype="FLOAT_NULL" name="Parallel Bars Score" precision="0" stream="false" suboid="parallelBarsScore" type="FLOAT32" value="0.0" widget="default"/>
          <subparam access="1" constrainttype="FLOAT_NULL" name="Horizontal Bar Score" precision="0" stream="false" suboid="horizBarScore" type="FLOAT32" value="0.0" widget="default"/>
          <subparam access="1" constrainttype="INT_NULL" name="Rotation 1 Event" precision="0" stream="false" suboid="rotEvt0" type="INT32" value="0" widget="default"/>
          <subparam access="1" constrainttype="INT_NULL" name="Rotation 2 Event" precision="0" stream="false" suboid="rotEvt1" type="INT32" value="0" widget="default"/>
          <subparam access="1" constrainttype="INT_NULL" name="Rotation 3 Event" precision="0" stream="false" suboid="rotEvt2" type="INT32" value="0" widget="default"/>
          <subparam access="1" constrainttype="INT_NULL" name="Rotation 4 Event" precision="0" stream="false" suboid="rotEvt3" type="INT32" value="0" widget="default"/>
          <subparam access="1" constrainttype="INT_NULL" name="Rotation 5 Event" precision="0" stream="false" suboid="rotEvt4" type="INT32" value="0" widget="default"/>
          <subparam access="1" constrainttype="INT_NULL" name="Rotation 6 Event" precision="0" stream="false" suboid="rotEvt5" type="INT32" value="0" widget="default"/>
          <subparam access="1" constrainttype="INT_NULL" name="Rotation 7 Event" precision="0" stream="false" suboid="rotEvt6" type="INT32" value="0" widget="default"/>
          <subparam access="1" constrainttype="INT_NULL" name="Rotation 8 Event" precision="0" stream="false" suboid="rotEvt7" type="INT32" value="0" widget="default"/>
          <subparam access="1" constrainttype="INT_NULL" name="Rotation 9 Event" precision="0" stream="false" suboid="rotEvt8" type="INT32" value="0" widget="default"/>
          <subparam access="1" constrainttype="INT_NULL" name="Rotation 10 Event" precision="0" stream="false" suboid="rotEvt9" type="INT32" value="0" widget="default"/>
          <subparam access="1" constrainttype="INT_NULL" name="Rotation 11 Event" precision="0" stream="false" suboid="rotEvt10" type="INT32" value="0" widget="default"/>
          <subparam access="1" constrainttype="INT_NULL" name="Rotation 12 Event" precision="0" stream="false" suboid="rotEvt11" type="INT32" value="0" widget="default"/>
          <subparam access="1" constrainttype="INT_NULL" name="Rotation 13 Event" precision="0" stream="false" suboid="rotEvt12" type="INT32" value="0" widget="default"/>
          <subparam access="1" constrainttype="INT_NULL" name="Rotation 14 Event" precision="0" stream="false" suboid="rotEvt13" type="INT32" value="0" widget="default"/>
          <subparam access="1" constrainttype="INT_NULL" name="Rotation 15 Event" precision="0" stream="false" suboid="rotEvt14" type="INT32" value="0" widget="default"/>
          <subparam access="1" constrainttype="INT_NULL" name="Rotation 16 Event" precision="0" stream="false" suboid="rotEvt15" type="INT32" value="0" widget="default"/>
       </value>
    </param>


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



  • 8.  RE: params getting corrupted

    Posted 11-13-2024 17:24

    Update:  the code is irrelevant, even if I change a view param, this breaks



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



  • 9.  RE: params getting corrupted

    Posted 11-14-2024 09:55

    Hi David

    This definitely appears to be a bug in the parameter serialization code for structs - I will pass it along to the DashBoard dev team for evaluation.  In the meantime, you can work around it by changing your parameter "team0.info" from STRUCT to STRUCT_ARRAY.  Doing this, the XML serialization for the parameter appears to be working as expected.



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



  • 10.  RE: params getting corrupted

    Posted 11-14-2024 10:05

    For further info, If I change these individual structs to a struct array, the problem goes away.  Will this be a problem for datalinq?  I initially went with individual structs because they would always be present when I need to clear the info.

    How does datalinq handle dynamic params?



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



  • 11.  RE: params getting corrupted

    Posted 11-14-2024 10:06

    DataLinq should handle the parameters just fine but it will change the OIDs it receives.  Instead of getting "team0.info.name" the parameter will be listed as "team0.info.0.name"



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



  • 12.  RE: params getting corrupted

    Posted 11-14-2024 13:18

    Ok, cool, thanks James!



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



  • 13.  RE: params getting corrupted

    Posted 11-14-2024 14:54

    Is there any gotchas for datalinq for this?  I feel like if I use params.resetAllValues, it would wipe out the array and then what happens in datalinq?



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