com.raben.telescope.comm
Class CelestronCoordinateConverter

java.lang.Object
  |
  +--com.raben.telescope.comm.CelestronCoordinateConverter

public class CelestronCoordinateConverter
extends java.lang.Object

Facade to encode and decode Celestron coordinate formats

Author:
Vern Raben

Constructor Summary
CelestronCoordinateConverter()
          Creates a new instance of CelestronCoordinateAdapater
 
Method Summary
 void decodeHexadecimal(java.lang.String str, java.awt.geom.Point2D coord)
          Decode hexadecimal string
 java.lang.String encodeHexadecimal(double val)
          Encode angle as hexadecimal value
 java.lang.String encodeHexadecimal16(double val)
          Encode as 16 bit hexadecimal value
 java.lang.String encodeHexadecimal24(double val)
          Encode as 24 bit hexadecimal value
 TelescopeModel getTelescopeModel()
          Get the Telescope model
 boolean isHighPrecision()
          Returns whether precision is high or not
 void setHighPrecision(boolean precision)
          Set whether encode/decode should be high precision (24 bit)
 void setTelescopeModel(TelescopeModel telescopeModel)
          Set the Telescope model
 java.lang.String toString()
          Return String representation of CelestronCoordinateAdapter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CelestronCoordinateConverter

public CelestronCoordinateConverter()
Creates a new instance of CelestronCoordinateAdapater

Method Detail

encodeHexadecimal

public java.lang.String encodeHexadecimal(double val)
Encode angle as hexadecimal value

Parameters:
val - Angle to be encoded
Returns:
Hexadecimal string for encode precision

encodeHexadecimal16

public java.lang.String encodeHexadecimal16(double val)
Encode as 16 bit hexadecimal value

Parameters:
val - Value to be converted
Returns:
String containing coordinate encoded as a hexadecimal

encodeHexadecimal24

public java.lang.String encodeHexadecimal24(double val)
Encode as 24 bit hexadecimal value

Parameters:
val - Value to be converted
Returns:
String containing coordinate encoded as a hexadecimal

decodeHexadecimal

public void decodeHexadecimal(java.lang.String str,
                              java.awt.geom.Point2D coord)
Decode hexadecimal string

Parameters:
str - String containing coordinate from telescope
coord - Point2D coordinate to be set

setHighPrecision

public void setHighPrecision(boolean precision)
Set whether encode/decode should be high precision (24 bit)

Parameters:
precision - True if high precision is to be used

isHighPrecision

public boolean isHighPrecision()
Returns whether precision is high or not

Returns:
boolean true if high precision

setTelescopeModel

public void setTelescopeModel(TelescopeModel telescopeModel)
Set the Telescope model

Parameters:
telescopeModel - to be used

getTelescopeModel

public TelescopeModel getTelescopeModel()
Get the Telescope model

Returns:
Model of telescope

toString

public java.lang.String toString()
Return String representation of CelestronCoordinateAdapter

Overrides:
toString in class java.lang.Object
Returns:
String containing TelescopeModel and highPrecision flag


Copyright © 2003 Raben Systems, Inc.. All Rights Reserved.