24.08.2013 Views

Tango ATK Tutorial

Tango ATK Tutorial

Tango ATK Tutorial

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

The code sample below can be used for these two viewers indifferently:<br />

ICommand ic;<br />

CommandList cmdl = new CommandList();<br />

VoidVoidCommandViewer vvcv = new VoidVoidCommandViewer();<br />

Try<br />

{<br />

ic = (ICommand)cmdl.add("elin/gun/beam/Off");<br />

vvcv.setAttModel(ic);<br />

}<br />

catch (Exception ex)<br />

{<br />

System.out.println("Cannot connect device");<br />

ex.printStackTrace();<br />

}<br />

Commands with DevBoolean input argument and no output argument<br />

(BooleanVoidCommand)<br />

The commands with DevBoolean input argument and no output argument are called<br />

BooleanVoid commands in <strong>ATK</strong>. The following list presents all the command viewers<br />

suitable for BooleanVoidCommands:<br />

1. OnOffCheckBoxCommandViewer: is a sub-classes of swing JCheckBox. A click on a<br />

OnOffCheckBoxCommandViewer will immediately execute the corresponding<br />

command on the tango device. The value of the input parameter passed to the device<br />

command depends on the state of the checkBox. If the checkBox is selected the device<br />

command is called with “true” parameter, otherwise the “false” parameter is sent to<br />

the command.<br />

2. OnOffSwitchCommandViewer: A click on a OnOffSwitchCommandViewer will<br />

immediately execute the corresponding command on the tango device. The value of<br />

the input parameter passed to the device command depends on the state of the switch.<br />

The difference with the previous viewer is only in the graphical representation.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!