stella.command
Class PointingModelSave

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.PointingModelSave
All Implemented Interfaces:
Serializable, ParameterDepending, TelescopeCommand

public class PointingModelSave
extends CommandEvent
implements TelescopeCommand, ParameterDepending

The command to save the current pointing list in Pilar to a file constructed from the current date.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class stella.CommandEvent
CommandEvent.Create
 
Field Summary
private static SimpleDateFormat df
          The date formatter using day-grainity.
private static String SAVEEXT
          The save-file extension.
private static String SAVELEAD
          The save-file header.
private  File unique
          The unique identifier, gained from a Time instance.
 
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
PointingModelSave(Object src)
          Constructs a abort adapter telescope, grabbing the type from the class name and setting the command time to the current system time.
PointingModelSave(Object src, String type, long time)
          Construct a fully qualified abort telescope command.
 
Method Summary
private  File formatDate(Date now)
          Formate the given date into a file name.
 String[] getLine()
          Returns the command line of the move telescope command.
 File getSaveFile()
          Returns the right ascension of the target star.
 boolean parseLine(String[] all)
          Parse the command line into a focus position.
 void registerParameter(Parameter uniq)
          Registers a parameter which is normally the time.
 void setSaveFile(File 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

df

private static final transient SimpleDateFormat df
The date formatter using day-grainity.


SAVELEAD

private static final String SAVELEAD
The save-file header.

See Also:
Constant Field Values

SAVEEXT

private static final String SAVEEXT
The save-file extension.

See Also:
Constant Field Values

unique

private File unique
The unique identifier, gained from a Time instance.

Constructor Detail

PointingModelSave

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


PointingModelSave

public PointingModelSave(Object src,
                         String type,
                         long time)
Construct a fully qualified abort telescope command.

Method Detail

registerParameter

public void registerParameter(Parameter uniq)
Registers a parameter which is normally the time. If so, the current time is formatted using #DATEFORMAT to get a valid date-id, which is then squeezed between SAVELEAD and SAVEEXT to form a valid file name. If the parameter is not a time, its string value is used unchanged as the save file.

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 trimmed into unique.

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

getSaveFile

public File getSaveFile()
Returns the right ascension of the target star.


setSaveFile

public void setSaveFile(File pos)
Sets the focus position.


formatDate

private File formatDate(Date now)
Formate the given date into a file name.