Facility Control

 View Only
  • 1.  Outputting String Value and String Constraint to Datalinq

    Posted 03-20-2019 21:30
    Hi All,

    I have a data dashboard that we are using to select which stat categories we'd like to display for graphics. So for our operators, I've built dropdown lists connected to parameters that use a string for its value and its constraint. It works all well and good in dashboard, anytime we choose a category with the dropdown, the value changes to the corresponding value. However, in datalinq I want to be able to output both the constraint that is selected by the operator (as in the whole string they choose like Shots) as well as the value tied to that constraint (scoring_att). Currently, it is only outputting just the constraint selected by the operator.

    Anyone have any ideas? I can share some code if needed.


  • 2.  RE: Outputting String Value and String Constraint to Datalinq

    Posted 03-21-2019 14:17

    Hi drewshealy97
    At present, we show both the parameter's numeric value and string representation for INT16/INT32 parameters but there is not currently a dual-representation of the parameter value for String/String parameters.

    The easiest workaround for now would be to create a hidden parameter to store the other value you want to stream and, when your String/String parameter changes, write the new value to the hidden copy.

    <abs contexttype="opengear" gridsize="20" id="_top">
    <meta>
    <params>
    <param access="1" constraintstrict="false" constrainttype="STRING_STRING_CHOICE" maxlength="0" name="Real Parameter" oid="param.real" type="STRING" value="val3" widget="default">
    <constraint key="val1">Name 1</constraint>
    <constraint key="val2">Name 2</constraint>
    <constraint key="val3">Name 3</constraint>
    </param>
    <param access="1" maxlength="0" name="Copy Parameter" oid="param.copy" type="STRING" value="val3" widget="default"/>
    </params>
    </meta>
    <param expand="true" height="60" left="100" oid="param.real" runtasksonload="true" showlabel="false" top="120" width="320">
    <task tasktype="ogscript">params.setValue('param.copy', 0, params.getValue('param.real', 0));</task>
    </param>
    </abs>

    #DashBoard


  • 3.  RE: Outputting String Value and String Constraint to Datalinq

    Posted 03-21-2019 15:31
    Gotcha, I'll be sure to try this out. Is there any plans to implement this in a future release?
    #DashBoard


  • 4.  RE: Outputting String Value and String Constraint to Datalinq

    Posted 04-02-2019 14:29

    Hi James,

    I'm just getting around to this and for some reason, the copy task isn't working properly. I'm able to change the constraint value on the real parameter, but in datalinq, my copy param isn't showing that it is updating. Instead, it just remains on the initial value I typed into it.


    #DashBoard


  • 5.  RE: Outputting String Value and String Constraint to Datalinq

    Posted 04-02-2019 18:15

    Question Drew, is your goal here to pick "shots" and then show the number of shots from that team, choose another category like "goals" and then get that value?


    #DashBoard


  • 6.  RE: Outputting String Value and String Constraint to Datalinq

    Posted 04-02-2019 22:14

    Hi Drew.

    The copy parameter in the example panel I sent you is updating properly. Are you able to post your panel's code so I can see the difference?

    The next release of DashBoard (due out within the next month) will publish an additional field to show the alternate value for the original parameter.

    James


    #DashBoard


  • 7.  RE: Outputting String Value and String Constraint to Datalinq

    Posted 04-03-2019 14:13

    Hi James,

     

    Here's my code below:

     

    Real Parameter:

    <param access="1" constraintstrict="true" constrainttype="STRING_STRING_CHOICE" maxlength="0" name="OPTA.PLAYER_1_CAT_1" oid="OPTA.PLAYER_1_CAT_1" type="STRING" value="gk_smother" widget="combo">
    <constraint key=""/>
    <constraint key="accurate_fwd_zone_pass">Accurate Forward Zone Passes</constraint>
    <constraint key="accurate_long_balls">Accurate Long Balls</constraint>
    <constraint key="accurate_pass">Accurate Passes</constraint>
    <constraint key="ball_recovery">Recoveries</constraint>
    <constraint key="blocked_scoring_att">Blocked Shots</constraint>
    <constraint key="clean_sheet">Clean Sheets</constraint>
    <constraint key="clearance_off_line">Clearances off the Line</constraint>
    <constraint key="dive_catch">Diving Catches</constraint>
    <constraint key="dive_save">Diving Saves</constraint>
    <constraint key="effective_clearance">Clearances</constraint>
    <constraint key="fouls">Fouls</constraint>
    <constraint key="gk_smother">Smothers</constraint>
    <constraint key="goal_assist">Assists</constraint>
    <constraint key="goal_kicks">Goal Kicks</constraint>
    <constraint key="goals">Goals</constraint>
    <constraint key="last_man_tackle">Last Man Tackles</constraint>
    <constraint key="mins_played">Minutes</constraint>
    <constraint key="penalty_save">Penalties Saved</constraint>
    <constraint key="punches">Punches</constraint>
    <constraint key="saved_ibox">Shots Saved from Inside the Box</constraint>
    <constraint key="saved_obox">Shots Saved from Outside the Box</constraint>
    <constraint key="saves">Saves</constraint>
    <constraint key="stand_save">Standing Saves</constraint>
    <constraint key="total_fwd_zone_pass">Total Forward Zone Passes</constraint>
    <constraint key="total_long_balls">Total Long Balls</constraint>
    <constraint key="total_pass">Passes</constraint>
    <constraint key="total_tackle">Tackles</constraint>
    <constraint key="total_yel_card">Yellow Cards</constraint>
    <constraint key="total_red_card">Red Cards</constraint>
    <constraint key="touches">Touches</constraint>
    <constraint key="was_fouled">Fouled</constraint>
    <constraint key="won_tackle">Tackles Won</constraint>
    </param>

     

    Copy Parameter:

    <param access="1" maxlength="0" name="OPTA.PLAYER_1_TYPE_1" oid="OPTA.PLAYER_1_TYPE_1" type="STRING" value="fouls" widget="default"/>

     

    Ogscript task:

    <param expand="true" height="60" left="100" oid="OPTA.PLAYER_1_CAT_1" runtasksonload="true" showlabel="false" top="120" width="320">
    <task tasktype="ogscript">params.setValue('OPTA.PLAYER_1_TYPE_1', 0, params.getValue=('OPTA.PLAYER_1_CAT_1', 0));</task>
    </param>

     

    Obviously this isn't my whole panel, but is instead just those few different items. 


    #DashBoard


  • 8.  RE: Outputting String Value and String Constraint to Datalinq

    Posted 04-03-2019 20:22

    Never mind James, realized I could get this working just by using the OGscript Visual Logic blocks for my two parameters. It works now and streams correctly. Thank you!


    #DashBoard


  • 9.  RE: Outputting String Value and String Constraint to Datalinq

    Posted 04-03-2019 20:37

    Okay, Drew.

    Just in case anyone else gets here with a similar question, the issue appears to be an extra "=" sign in your ogsCript task.  It should just be

    params.setValue('OPTA.PLAYER_1_TYPE_1', 0, params.getValue('OPTA.PLAYER_1_CAT_1', 0));

    #DashBoard