Developers guide

92
The core of the JAS system revolves around its ability to execute commands. To add a command
to the APT system is a relatively simple process. Several JASChannels are designed to receive
Commands.
B.4.1. JASCommand object
public class MyCommand extends APTCommand {
// Command parameters as private variables
private int someData;
private transient Logger logger = Logger.getLogger( getClass().getName() );
public Object execute(Process parent) {
// Execute something...
...
}
public String getDescription() {
return "Do Something with someData";
}
...
public String getName() { return getClass().getName(); }
public String toString() { return "DO SOMETHING CMD";}
}
Figure B-1 JASCommand object
B.4.2. Installing commands
Once the command objects have been created, they must be added to the appropriate
command set, as shown in the code below.
static final Class[] sysCmds = {
RoofStatusBroadcaster.class,
SendAPTPropsCommand.class
};
static final Class[] genCmds = {
ImageListCommand.class,
ImageRetrieveCommand.class
};
static final Class[] privCmds = {
APTSetPropertyCommand.class,
ImageExposeCommand.class,
LightsCommand.class,
ParkForRoofMovement.class,
ParkTwilightFlat.class,
ParkZenith.class,
ParkZeroHour.class,
PtcsMoveOffsetCommand.class,
PtcsMovePOffset.class,
PtcsSetBaseCommand.class,
PtcsSetOffsetCommand.class,
PtcsSetPOffset.class,
PtcsSlewCommand.class,
PtcsSetSystemCommand.class,
RoofCommand.class,
RoofRefresh.class,