Hi Dojo,
I'm in the process of creating an Automation Script which will switch our uplink sites via updating element parameters. One of the parameters I need to update/action is a button with an additional Message (param below).
<Param id="1019">
<Name>switchSitesButton</Name>
<Type>write</Type>
<Information>
<Subtext>Used to switch to the selected site.</Subtext>
</Information>
<Interprete>
<RawType>numeric text</RawType>
<Type>double</Type>
<LengthType>next param</LengthType>
</Interprete>
<Message>This action will switch the selected polarization and chain(s) to the selected site. Make sure the appropriate polarization and chain(s) are selected. Do you want to continue?</Message>
<Display>
<RTDisplay>true</RTDisplay>
<Positions>
<Position>
<Page>Switching Control</Page>
<Column>0</Column>
<Row>6</Row>
</Position>
</Positions>
</Display>
<Measurement>
<Type width="110">button</Type>
<Discreets>
<Discreet>
<Display>Switch to Site 2</Display>
<Value>2</Value>
</Discreet>
<Discreet>
<Display>Switch to Site 1</Display>
<Value>1</Value>
</Discreet>
</Discreets>
</Measurement>
</Param>
I have tried using the following code to action this with no luck:
IDmsStandaloneParameter<string> switchToSite1 = element.GetStandaloneParameter<string>(1019);
switchToSite1.SetValue("Switch to Site 1");
Is 'SetValue' not appropriate for selecting a button? Or could the problem be due to the associated message popup in the parameter?
Is there also anyway I can by pass the Message as I do not need this for the automation script?
Thanks,
Carys
As this question has now been inactive for a long time, I will close it. If you still want more information about this, could you post a new question?
Hi Carys,
I see that you are setting the display value of the discreet. Could you please try setting the raw value instead?
var switchToSite1 = element.GetStandaloneParameter<double?>(1019);
switchToSite1.SetValue(1);
Hi Tom,
Thank you for your quick response. I have tried this but it still doesn’t seem to be working and I don’t seem to be getting errors either. Do you have any other suggestions?
According to the following answer: https://community.dataminer.services/question/automation-script-to-overcome-confirmation-message/, you also need to set the “NoCheckingSets” flag. Could you please try this?
Hi Tom,
I have just tried this and it still doesn’t seem to be working I’m afraid.
Thanks so much for your help so far!
Hi Carys,
Instead of using the DataMinerSystem classes, you could also try using the standard engine element:
engine.SetFlag(RunTimeFlags.NoCheckingSets);
var element = engine.FindElement(…);
element.SetParameter(1019, 1);
I see that this question has been inactive for some time. Do you still need help with this? If not, could you select the answer (using the ✓ icon) to indicate that the question is resolved?