Download Base Software for Control Systems
Transcript
Base Software for Control Systems
between successive executions. The assumption is that the thread will be created at init, started at startup,
stopped at shutdown, and dereferenced at uninit.
There is a single abstract method (doRun()) that must be implemented to carry out the repetitive task.
Optionally there is a doPreRun() and a doPostRun() method that may be used to carry out any setup or
teardown needed. The Base Thread was created because of a need for in within other parts of Base. It is
used by both the Posting TAB and by the Update TAB and in many of the simulated hardware
connection.
10.2.5 Remote Actions
The RemoteAction Java class in the atst.base.util package allows the complete encapsulation of an
action being carried out in a remote controller. When a remote action is constructed, it takes, at
minimum, the action reference of the enclosing controller (parent-action), the handle of the remote
controller to submit the configuration to, and the configuration to submit. As part of construction the
remote action submits the configuration to the remote controller. After constructing the remote action,
the state of the remote action can be queried, it can be PRACed, or the caller can request to block until the
remote action has finished.
Remote actions are used internally by the ManagementController, and there are a few methods in the
class for generating them, or waiting on sets of them to complete. They are available
from within Jython scripts. One might use remote actions to perform something like:
atst.base.Misc
Action a = getAction(config.getId());
RemoteAction ra1 = Misc.submit(a, controller1, config1);
RemoteAction ra2 = Misc.submit(a, controller2, config2);
Misc.waitForRemoteActions(ra1, ra2);
if (ra1.finishedOK()) {
RemoteAction ra3 = Misc.submit(a, controller2, config3);
ra3.waitForFinish();
return ra3.getActionResponse();
} else {
return ra1.getActionResponse();
}
The big things that remote actions take care of for people is the generation of a callback, and threads
necessary to monitor the parent action for state changes (PRAC) and the propagation of those changes
down to the remote action. All of this functionality is encapsulation in a single object that can be easily
passed around. See the RemoteAction Javadoc for details about additional constructors and methods.
10.2.6 Misc
Just like CSF provides a Misc class, Base also provides a Misc class which is located in the
atst.base.util package. Just like the CSF version the base class contains only static methods, and may
TN-0088, Rev I
Page 56 of 45