Sure thing! I'll try and include everything relevant.
Here's the constraint (edited down, it's much longer than this)
<constraint constrainttype="STRING_CHOICE" id="trackList" precision="0">
<constraint>ALBANY</constraint>
<constraint>ALBURY</constraint>
<constraint>ARARAT</constraint>
<constraint>ARMIDALE</constraint>
<constraint>ASCOT</constraint>
<constraint>ATHERTON</constraint>
</constraint>
And here's parameters that use that constraint:
<param access="1" maxlength="0" name="TrackNameA" oid="TrackNameA" type="STRING" value="ALBANY" widget="combo"/>
<param access="1" maxlength="0" name="TrackNameB" oid="TrackNameB" type="STRING" value="BAIRNSDALE" widget="combo"/>
<param access="1" maxlength="0" name="TrackNameC" oid="TrackNameC" type="STRING" value="CANBERRA" widget="combo"/>
<param access="1" maxlength="0" name="TrackNameD" oid="TrackNameD" type="STRING" value="DEAGON" widget="combo"/>
<param access="1" maxlength="0" name="TrackA_UpNext" oid="TrackA_UpNext" type="STRING" value="ALBANY" widget="combo"/>
<param access="1" maxlength="0" name="TrackB_UpNext" oid="TrackB_UpNext" type="STRING" value="BAIRNSDALE" widget="combo"/>
<param access="1" maxlength="0" name="TrackC_UpNext" oid="TrackC_UpNext" type="STRING" value="CANBERRA" widget="combo"/>
<param access="1" maxlength="0" name="TrackD_UpNext" oid="TrackD_UpNext" type="STRING" value="DEAGON" widget="combo"/>
And the params on the panel:
<table bottom="60" left="20" right="20" top="25">
<tr>
<label colspan="2" fill="both" header="true" height="20" left="40" name="Tracks" pheight="20" pwidth="243" rowspan="1" style="txt-align:center;" top="40"/>
</tr>
<tr>
<label anchor="north" colspan="1" fill="both" left="20" name="<html><left>A<br><br>B<br><br>C<br><br>D" pheight="166" pwidth="40" rowspan="4" style="txt-align:center;" top="40" width="40"/>
<param colspan="1" constraint="trackList" constrainttype="ID_REFERENCE" expand="true" fill="both" left="60" name="" oid="TrackNameA" pheight="41" precision="0" pwidth="203" rowspan="1" top="40" type="STRING_PARAM" weightx="1.0" weighty="1.0"/>
</tr>
<tr>
<param colspan="1" constraint="trackList" constrainttype="ID_REFERENCE" expand="true" fill="both" left="60" name="" oid="TrackNameB" pheight="41" precision="0" pwidth="203" rowspan="1" top="80" type="STRING_PARAM" weightx="1.0" weighty="1.0"/>
</tr>
<tr>
<param colspan="1" constraint="trackList" constrainttype="ID_REFERENCE" expand="true" fill="both" left="60" name="" oid="TrackNameC" pheight="42" precision="0" pwidth="203" rowspan="1" top="120" type="STRING_PARAM" weightx="1.0" weighty="1.0"/>
</tr>
<tr>
<param colspan="1" constraint="trackList" constrainttype="ID_REFERENCE" expand="true" fill="both" left="60" name="" oid="TrackNameD" pheight="42" precision="0" pwidth="203" rowspan="1" top="160" type="STRING_PARAM" weightx="1.0" weighty="1.0"/>
</tr>
The original function I was using here works perfect (without the template constraint):
function AUS_Tracks() {
var path = "//APOLLO/Operations/Master Control/Config Files/Custom Panels/z_Scripts/Tracks/";
var content = ogscript.post(path + 'Tracks (AUS).txt', null)
if (content != null) {
var values = content.trim().split('\n');
values = values.sort()
var constraint = params.createStringChoiceConstraint(values);
params.replaceConstraint('TrackNameA', constraint);
params.replaceConstraint('TrackNameB', constraint);
params.replaceConstraint('TrackNameC', constraint);
params.replaceConstraint('TrackNameD', constraint);
params.replaceConstraint('TrackA_UpNext', constraint);
params.replaceConstraint('TrackB_UpNext', constraint);
params.replaceConstraint('TrackC_UpNext', constraint);
params.replaceConstraint('TrackD_UpNext', constraint);
}
}
I have tried a few of the different replaceConstraint functions, like this one, but honestly don't understand the difference:
function AUS_Tracks() {
var path = "//APOLLO/Operations/Master Control/Config Files/Custom Panels/z_Scripts/Tracks/";
var content = ogscript.post(path + 'Tracks (AUS).txt', null)
var trackList = params.getIdentifiedConstraint('trackList');
if (content != null) {
var values = content.trim().split('\n');
values = values.sort()
var constraint = params.createStringChoiceConstraint(values);
params.replaceIdentifiedConstraint(trackList, constraint);
//params.replaceConstraint('trackList', constraint);
}
}
I am able to make some progress with this, but it seems little unreliable.
I get a new Constraint Value in the dropdown: "com.rossvideo.gear.param.ConstraintStringChoice@3c2" and while the correct options will appear in the parameter choices, they disappear on refresh unless I open each parameter and apply changes, definitely not good for operators.
Likewise; the <constraint> that I'm trying to point them to in my meta does not receive the constraint list.
Hope all that makes sense! Thanks <x-zendesk-user data-user-name="James Peltzer">372651266391</x-zendesk-user>
#DashBoard