stella.util
Class PointingGrabber

java.lang.Object
  extended by util.PropertyContainer
      extended by util.PropertyResources
          extended by util.PropertyBundles
              extended by util.rmi.RmiPropertyContainer
                  extended by util.rmi.AbstractRmiListener
                      extended by stella.util.PointingGrabber
All Implemented Interfaces:
Cloneable, Remote, EventListener, RmiErrorListener, ExitCleaning, Initializable, LocalizedSupplying, PropertySupplying, ResourceSupplying, RmiEventListener, RmiListener, RmiPropertyBearing
Direct Known Subclasses:
JPointingGrabber

public class PointingGrabber
extends AbstractRmiListener
implements RmiErrorListener

A simple extension to a RmiErrorListener with the sole purpose to send status commands to the telescope and retrieve the pointing information from the telescope out of the received TelescopeStatus status. The proceedure is as follows: Start the pointing model with

   java stella.util.PointingModel\$Crutch [pointing.prop]
   
The properties file contains info needed to connect to the telescope server. For a pure listening setup, you can rely on the default properties, thus starting the pointing model without any argument. Then, incomming TelescopeStatus is parsed for the necessary information and displayed on the screen as well as writtn into the #KEY_POINTINGFILE in plain ascii. Once you've recorded enough data, press exit and use the data file as input in the pointing model. If you are brave, you can hand-edit the pointing data file and add some errors to it, per default we write all 1s.
Now, feed the data into the pointing model calculator (issue without arguments for a description):
   java stella.util.PointingModel pointing.data
   
Feed the fitting values into pilar's classical pointing model (~observer/pilar/config/pilar.pm.prop), considering What to do if something does not work:


Nested Class Summary
static class PointingGrabber.Crutch
          Stats the pointing grabber.
 
Nested classes/interfaces inherited from class util.PropertyResources
PropertyResources.URLResource
 
Field Summary
private static DecimalFormat DEFDATAFORMAT
          The default offset data formatter.
private static SimpleDateFormat DEFPOINTINGDATE
          The key to a file containing a (long) list of all jcommands.
private static String DEFPOINTINGEXT
          The key to a file containing a (long) list of all jcommands.
private static String DEFPOINTINGHEAD
          The key to a file containing a (long) list of all jcommands.
private static String DEFTELESCOPE
          The key to the rmi-error caster to bind to, resolvable URL.
static String KEY_DATAFORMAT
          The data formt how to write data.
static String KEY_POINTINGDATE
          The name of the file we write pointing data into.
static String KEY_POINTINGEXT
          The name of the file we write pointing data into.
static String KEY_POINTINGHEAD
          The name of the file we write pointing data into.
static String KEY_TELESCOPE
          The binding name of the telescope that send errors.
private  PrintWriter out
          The print writer that prints into a file.
 
Fields inherited from class util.rmi.AbstractRmiListener
KEY_ALIVE, KEY_EXPORTPORT, KEY_INIT, KEY_LISTENERNAME, KEY_RETRY, KEY_RETRYSLEEP, KEY_SHUTDOWNDELAY
 
Fields inherited from class util.PropertyBundles
KEY_LOCALECOUNTRY, KEY_LOCALELANGUAGE, KEY_RESOURCEBUNDLES
 
Fields inherited from class util.PropertyResources
KEY_NOINITONCREATE, localurl, locate, POSTFIX_DIR, POSTFIX_EXT, POSTFIX_FILE, POSTFIX_LIST, POSTFIX_URL, urlset
 
Fields inherited from class util.PropertyContainer
KEY_LISTSEPARATOR, KEY_MAPKEYVALUECHAR, KEY_MAPSEPARATOR
 
Fields inherited from interface util.ResourceSupplying
KEY_URLRESOURCES, KEY_URLUSECONFIG, KEY_URLUSECURRENT, KEY_URLUSEHOME
 
Fields inherited from interface util.PropertySupplying
CONFIG, KEY_CLASS
 
Constructor Summary
PointingGrabber(Map prop)
          Constructs a new pointing grabber object.
 
Method Summary
protected  void addPointingData(String dataline)
          Adds a single pointing data line to our data file.
protected  File compose()
          Composes the file we write data to.
protected  boolean deregisterAtCaster(RmiCaster rmi, Class single)
          Deregisters at caster.
 void exit()
          On exit, we have to close the data file.
 void init()
          Register at the appropriate casters found in the various lists.
protected  boolean registerAtCaster(RmiCaster rmi, Class single)
          Registers at the specified caster if the caster is one of the four possible caster instances this class listens to.
 void rmiErrorOccured(ErrorEvent ee)
          The receiving edge of the error listener.
 
Methods inherited from class util.rmi.AbstractRmiListener
allBound, blockBinding, blockBinding, disconnect, getIP, getListenerName, isConnected, listenerName, releaseBinding, releaseBinding, rescanned, startBinding, startBinding
 
Methods inherited from class util.rmi.RmiPropertyContainer
containsRemoteProperty, getRemoteProperties, getRemoteProperty, setRemoteProperty
 
Methods inherited from class util.PropertyBundles
clone, getLocalized, getLocalized, getLocalizedString, getLocalizedString, loadResource
 
Methods inherited from class util.PropertyResources
createFrom, createFrom, createFrom, getApplet, getAsResources, getLocalClassLoader, getPropertiesToKey, getPropertiesToKey, getResource, getResourceAsStream, getResourceFromKey, getResources, keyCreate, keyCreate, reload, setApplet
 
Methods inherited from class util.PropertyContainer
augment, augment, augment, defaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsEnums, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsMap, getAsObject, getAsObject, getProperties, getProperty, has, isNew, parseObject, reload, removeProperty, setObject, setProperties, setProperty, stringProperties, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface util.rmi.RmiEventListener
getListenerName
 
Methods inherited from interface util.rmi.RmiListener
disconnect, isConnected
 
Methods inherited from interface util.ResourceSupplying
getResource, getResourceAsStream, getResources
 
Methods inherited from interface util.PropertySupplying
defaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsObject, getAsObject, getProperties, getProperty, has, parseObject, removeProperty, setObject, setProperty, stringProperties
 

Field Detail

KEY_POINTINGHEAD

public static final String KEY_POINTINGHEAD
The name of the file we write pointing data into.

See Also:
Constant Field Values

KEY_POINTINGDATE

public static final String KEY_POINTINGDATE
The name of the file we write pointing data into.

See Also:
Constant Field Values

KEY_POINTINGEXT

public static final String KEY_POINTINGEXT
The name of the file we write pointing data into.

See Also:
Constant Field Values

KEY_TELESCOPE

public static final String KEY_TELESCOPE
The binding name of the telescope that send errors.

See Also:
Constant Field Values

KEY_DATAFORMAT

public static final String KEY_DATAFORMAT
The data formt how to write data.

See Also:
Constant Field Values

DEFTELESCOPE

private static final String DEFTELESCOPE
The key to the rmi-error caster to bind to, resolvable URL.

See Also:
Constant Field Values

DEFPOINTINGHEAD

private static final String DEFPOINTINGHEAD
The key to a file containing a (long) list of all jcommands.

See Also:
Constant Field Values

DEFPOINTINGEXT

private static final String DEFPOINTINGEXT
The key to a file containing a (long) list of all jcommands.

See Also:
Constant Field Values

DEFPOINTINGDATE

private static final SimpleDateFormat DEFPOINTINGDATE
The key to a file containing a (long) list of all jcommands.


DEFDATAFORMAT

private static final DecimalFormat DEFDATAFORMAT
The default offset data formatter.


out

private PrintWriter out
The print writer that prints into a file.

Constructor Detail

PointingGrabber

public PointingGrabber(Map prop)
                throws RemoteException
Constructs a new pointing grabber object.

Throws:
RemoteException
Method Detail

registerAtCaster

protected boolean registerAtCaster(RmiCaster rmi,
                                   Class single)
Registers at the specified caster if the caster is one of the four possible caster instances this class listens to.

Specified by:
registerAtCaster in class AbstractRmiListener
Returns:
True, if this listener can register at the specified caster

deregisterAtCaster

protected boolean deregisterAtCaster(RmiCaster rmi,
                                     Class single)
Deregisters at caster. Simply checks if the caster handed over is of one of the four supported types and removes itself from its listener list. Note that this can also mean de-registering from casters we never registered to because this info is lost.

Specified by:
deregisterAtCaster in class AbstractRmiListener
Returns:
True, if this listener can deregister at the specified caster

init

public void init()
Register at the appropriate casters found in the various lists.

Specified by:
init in interface Initializable
Overrides:
init in class PropertyResources

compose

protected File compose()
Composes the file we write data to.


rmiErrorOccured

public void rmiErrorOccured(ErrorEvent ee)
                     throws RemoteException
The receiving edge of the error listener. Passes the error/status message received to the status field's error channel.

Specified by:
rmiErrorOccured in interface RmiErrorListener
Throws:
RemoteException

addPointingData

protected void addPointingData(String dataline)
Adds a single pointing data line to our data file.


exit

public void exit()
On exit, we have to close the data file.

Specified by:
exit in interface ExitCleaning
Overrides:
exit in class AbstractRmiListener