stella.command
Class FocusOffsetTelescope

java.lang.Object
  extended by java.util.EventObject
      extended by util.rmi.RmiEvent
          extended by stella.MessageEvent
              extended by stella.CommandEvent
                  extended by stella.command.FocusOffsetTelescope
All Implemented Interfaces:
Serializable, InitializerDepending, TargetDependingCommand, ParameterDepending, TelescopeCommand

public class FocusOffsetTelescope
extends CommandEvent
implements TelescopeCommand, InitializerDepending, TargetDependingCommand, ParameterDepending

The command to initiate a telescope focusing sequence. The parameter it carries in the command line is a focus position in mm.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class stella.CommandEvent
CommandEvent.Create
 
Field Summary
private  double offset
          The focus offset in mm.
 
Fields inherited from class stella.CommandEvent
COMMANDPACKAGE, JVIEWPACKAGE, TYPESEPARATOR
 
Fields inherited from class stella.MessageEvent
SEPCHAR
 
Fields inherited from class util.rmi.RmiEvent
localHost, sourceName
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
FocusOffsetTelescope(Object src)
          Constructs a abort adapter telescope, grabbing the type from the class name and setting the command time to the current system time.
FocusOffsetTelescope(Object src, String id, long time)
          Constructs a new focus telescope command.
 
Method Summary
 String[] getLine()
          Returns the command line of the move telescope command.
 double getOffset()
          Returns the right ascension of the target star.
 void initWith(String focus)
          If initialized with a parsable double, this gets the focus offset.
 boolean parseLine(String[] all)
          Parse the command line into a focus position.
 void registerParameter(Parameter focus)
          Registers a parameter to this command.
 void registerTargetProperties(Object setup)
          Calculates the command line from the properties registered.
 void setOffset(double pos)
          Sets the focus position.
 
Methods inherited from class stella.CommandEvent
classNameToTemplate, createCommand, createCommand, createJCommand, extractType, getExpectedAcknowledgeNumber, parseForStrings, templateToClassName
 
Methods inherited from class stella.MessageEvent
checkType, equals, equalTime, equalTime, fromAscii, getAllCommandLines, getExecuteGroupKey, getHead, getNr, getTime, getType, hashCode, isValid, parseFromSingleString, readFromBufferedStream, setNr, setTime, setType, setValid, toString
 
Methods inherited from class util.rmi.RmiEvent
getHost, getSourceName, setSourceName
 
Methods inherited from class java.util.EventObject
getSource
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

offset

private double offset
The focus offset in mm.

Constructor Detail

FocusOffsetTelescope

public FocusOffsetTelescope(Object src)
Constructs a abort adapter telescope, grabbing the type from the class name and setting the command time to the current system time.


FocusOffsetTelescope

public FocusOffsetTelescope(Object src,
                            String id,
                            long time)
Constructs a new focus telescope command. The command only gets valid either by calling the parseLine(java.lang.String[]) method or by registering an XML-Element to it.

Method Detail

initWith

public void initWith(String focus)
If initialized with a parsable double, this gets the focus offset.

Specified by:
initWith in interface InitializerDepending

registerTargetProperties

public void registerTargetProperties(Object setup)
Calculates the command line from the properties registered. Scans for the focus offset in ReservedConstants.FOCUSOFFSET.

Specified by:
registerTargetProperties in interface TargetDependingCommand

registerParameter

public void registerParameter(Parameter focus)
Registers a parameter to this command. The parameter handed over is queried for its current value and this focus offset is set.

Specified by:
registerParameter in interface ParameterDepending

getLine

public String[] getLine()
Returns the command line of the move telescope command.

Specified by:
getLine in class MessageEvent
Returns:
An array containing all command lines.

parseLine

public boolean parseLine(String[] all)
Parse the command line into a focus position. The first array element is parsed into a double.

Specified by:
parseLine in class MessageEvent
Returns:
True, if parsing was successful.

getOffset

public double getOffset()
Returns the right ascension of the target star.


setOffset

public void setOffset(double pos)
Sets the focus position.