com.raben.telescope.comm
Class CelestronTelescope

java.lang.Object
  |
  +--com.raben.telescope.comm.CelestronTelescope
All Implemented Interfaces:
TelescopeInterface

public class CelestronTelescope
extends java.lang.Object
implements TelescopeInterface

Implementation of the TelescopeInterface for telescopes manufactured by Celestron (tm)

Version:
$Revision: 1.2 $ NOTE - this only hardware this has been tested on at present is Nexstar 11 GPS, Hand Control Version 2.2 and 2.3 using MS Windows XP and J2SDK 1.4.1
Author:
Vern Raben

Constructor Summary
CelestronTelescope()
          Creates a new instance of CelestronTelescope
 
Method Summary
 void cancelGoTo()
          Cancel goto command
 void close()
          Close connection to telescope
 void connect()
          Initialize connection to telescope
 java.awt.geom.Point2D getAzimuthAltitude()
          Get azimuth and altitude coordinate
 java.awt.geom.Point2D getGpsCoordinate()
          Get telescope geographic coordinate from GPS interface
 java.util.Calendar getGpsDateTime()
          Get Date and Time from GPS interface
 java.lang.String getHandControlVersion()
          Get control unit version
 java.util.Properties getProperties()
          Get telescope properties
 java.awt.geom.Point2D getRightAscensionDeclination()
          Get right ascension and declination
 TelescopeModel getTelescopeModel()
          Get telescope model
 void goToAzimuthAltitude(java.awt.geom.Point2D coordinate)
          Go to specificied azimuth/altitude coordinate
 void goToRightAscensionDeclination(java.awt.geom.Point2D coordinate)
          Go to specified right ascension/declination coordinate
 boolean isAligned()
          Check whether or not telescope is aligned
 boolean isCommunicating()
          Check if communication with telescope is established
 boolean isConnected()
          Check if connection is open
 boolean isDebug()
          Get debug flag
 boolean isGpsLinked()
          Check if GPS is linked
 boolean isSlewing()
          Check whether telescope is slewing to new coordinate
 void moveInAltitude(boolean direction, int rate)
          Move telescope in altitude
 void moveInAzimuth(boolean direction, int rate)
          Move telescope in azimuth
 void setAltitudeTrackingRate(int trackRate)
          Set altitude tracking rate Note - tracking will return to default in approximately 20 seconds unless tracking is turned off @see setTrackingMode
 void setAzimuthTrackingRate(int trackRate)
          Set azimuth tracking rate Note - tracking will return to default in approximately 20 seconds unless tracking is turned off @see setTrackingMode
 void setDebug(boolean debug)
          Set debug flag
 void setProperties(java.util.Properties props)
          Set telescope properties
 void setTelescopeModel(TelescopeModel model)
          Set the telescope model
 void setTrackingMode(int mode)
          Set tracking mode Must be aligned to switch from off to alt-az*
 java.lang.String toString()
          String describing telescope
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CelestronTelescope

public CelestronTelescope()
Creates a new instance of CelestronTelescope

Method Detail

cancelGoTo

public void cancelGoTo()
                throws java.io.IOException
Cancel goto command

Specified by:
cancelGoTo in interface TelescopeInterface
Throws:
java.io.IOException - may occur

getRightAscensionDeclination

public java.awt.geom.Point2D getRightAscensionDeclination()
                                                   throws java.io.IOException
Get right ascension and declination

Specified by:
getRightAscensionDeclination in interface TelescopeInterface
Returns:
Point2D May return NaN if coordinate not received
Throws:
java.io.IOException - may occur

goToAzimuthAltitude

public void goToAzimuthAltitude(java.awt.geom.Point2D coordinate)
                         throws java.io.IOException
Go to specificied azimuth/altitude coordinate

Specified by:
goToAzimuthAltitude in interface TelescopeInterface
Parameters:
coordinate - Point2D
Throws:
java.io.IOException - may be thrown

goToRightAscensionDeclination

public void goToRightAscensionDeclination(java.awt.geom.Point2D coordinate)
                                   throws java.io.IOException
Go to specified right ascension/declination coordinate

Specified by:
goToRightAscensionDeclination in interface TelescopeInterface
Parameters:
coordinate - Point2D
Throws:
java.io.IOException - may occur

getAzimuthAltitude

public java.awt.geom.Point2D getAzimuthAltitude()
                                         throws java.io.IOException
Get azimuth and altitude coordinate

Specified by:
getAzimuthAltitude in interface TelescopeInterface
Returns:
Current azimuth altitude coordinate
Throws:
java.io.IOException - may occur

isAligned

public boolean isAligned()
                  throws java.io.IOException
Check whether or not telescope is aligned

Specified by:
isAligned in interface TelescopeInterface
Returns:
true if aligned, false otherwise
Throws:
java.io.IOException - may occur

isCommunicating

public boolean isCommunicating()
                        throws java.io.IOException
Check if communication with telescope is established

Specified by:
isCommunicating in interface TelescopeInterface
Returns:
true if communicating, false otherwise
Throws:
java.io.IOException - may occur

isSlewing

public boolean isSlewing()
                  throws java.io.IOException
Check whether telescope is slewing to new coordinate

Specified by:
isSlewing in interface TelescopeInterface
Returns:
true if telescope is slewing, false otherwise
Throws:
java.io.IOException - may occur

close

public void close()
Close connection to telescope

Specified by:
close in interface TelescopeInterface

getHandControlVersion

public java.lang.String getHandControlVersion()
                                       throws java.io.IOException
Get control unit version

Specified by:
getHandControlVersion in interface TelescopeInterface
Returns:
version
Throws:
java.io.IOException - may occur

connect

public void connect()
             throws java.io.IOException
Initialize connection to telescope

Specified by:
connect in interface TelescopeInterface
Throws:
java.io.IOException - may be thrown

isConnected

public boolean isConnected()
Check if connection is open

Specified by:
isConnected in interface TelescopeInterface
Returns:
True if connection is open

setTrackingMode

public void setTrackingMode(int mode)
                     throws java.io.IOException
Set tracking mode Must be aligned to switch from off to alt-az*

Specified by:
setTrackingMode in interface TelescopeInterface
Parameters:
mode - (0=tracking off,1=Alt-Az tracking,2=Eq-North,3=Eq-South
Throws:
java.io.IOException - may be thrown

getGpsCoordinate

public java.awt.geom.Point2D getGpsCoordinate()
                                       throws java.io.IOException
Get telescope geographic coordinate from GPS interface

Specified by:
getGpsCoordinate in interface TelescopeInterface
Returns:
Geographic coordinate of telescope in degrees
Throws:
java.io.IOException - may occur

getGpsDateTime

public java.util.Calendar getGpsDateTime()
                                  throws java.io.IOException
Get Date and Time from GPS interface

Specified by:
getGpsDateTime in interface TelescopeInterface
Returns:
Calendar set to GPS date/time
Throws:
java.io.IOException - may occur

isGpsLinked

public boolean isGpsLinked()
                    throws java.io.IOException
Check if GPS is linked

Specified by:
isGpsLinked in interface TelescopeInterface
Returns:
True if GPS is linked, false otherwise
Throws:
java.io.IOException - may occur

setAzimuthTrackingRate

public void setAzimuthTrackingRate(int trackRate)
                            throws java.io.IOException
Set azimuth tracking rate Note - tracking will return to default in approximately 20 seconds unless tracking is turned off @see setTrackingMode

Specified by:
setAzimuthTrackingRate in interface TelescopeInterface
Parameters:
trackRate - in arc-sec/sec
Throws:
java.io.IOException - may occur

setAltitudeTrackingRate

public void setAltitudeTrackingRate(int trackRate)
                             throws java.io.IOException
Set altitude tracking rate Note - tracking will return to default in approximately 20 seconds unless tracking is turned off @see setTrackingMode

Specified by:
setAltitudeTrackingRate in interface TelescopeInterface
Parameters:
trackRate - in arc-sec/sec
Throws:
java.io.IOException - may occur

getTelescopeModel

public TelescopeModel getTelescopeModel()
Get telescope model

Specified by:
getTelescopeModel in interface TelescopeInterface
Returns:
TelescopeModel

setTelescopeModel

public void setTelescopeModel(TelescopeModel model)
Set the telescope model

Specified by:
setTelescopeModel in interface TelescopeInterface
Parameters:
model - of telescope @see TelescopeModel ISSUE - Generic Celestron telescope not yet implemented

toString

public java.lang.String toString()
String describing telescope

Overrides:
toString in class java.lang.Object
Returns:
String

getProperties

public java.util.Properties getProperties()
Get telescope properties

Specified by:
getProperties in interface TelescopeInterface
Returns:
Telescope properties

setProperties

public void setProperties(java.util.Properties props)
Set telescope properties

Specified by:
setProperties in interface TelescopeInterface
Parameters:
props - Properties for setting up telescope such as comm port, and debug. Supported keys are com.raben.telescope.port com.raben.telescope.debug

isDebug

public boolean isDebug()
Get debug flag

Specified by:
isDebug in interface TelescopeInterface
Returns:
True if in debug mode, false otherwise

setDebug

public void setDebug(boolean debug)
Set debug flag

Specified by:
setDebug in interface TelescopeInterface
Parameters:
debug - flag

moveInAzimuth

public void moveInAzimuth(boolean direction,
                          int rate)
                   throws java.io.IOException
Description copied from interface: TelescopeInterface
Move telescope in azimuth

Specified by:
moveInAzimuth in interface TelescopeInterface
Parameters:
direction - true = right, false = left
rate - 0=stop,1=slow, 9=fast
java.io.IOException

moveInAltitude

public void moveInAltitude(boolean direction,
                           int rate)
                    throws java.io.IOException
Description copied from interface: TelescopeInterface
Move telescope in altitude

Specified by:
moveInAltitude in interface TelescopeInterface
Parameters:
direction - true = up, false = down
rate - 0=stop, 1=slow, 9=fast
java.io.IOException


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