Description of the Telescope Interface

The telescope interface consists of the classes: TelescopeInterface, TelescopeModel, TelescopeFactory, and SerialConnection. For each telescope manufacture, there is a concrete implementation of the TelescopeInterface and supporting classes. The diagram below shows classes to interface the Celestron telescope. (The complete Javadoc is available online as is a source code cross reference).

Class diagram of telescope interface

Figure 1. Class Diagram of the Telescope Interface

The TelescopeInterface class is an interface that defines all the methods that will be publicly available to an application.

The TelescopeModel class is a type-safe enumation of various telescope models. It permits different telescope models from different manufactures to be selected.

The TelescopeFactory class is used by an application to select which telescope commands are to be used.

 

The CelestronTelescope class is a concrete implementation of the telescope interface. It takes care of all details of setting up the serial port to communicate with the telescope. In addition, it sends commands to the telescope and receives responses.

The CelestronCommand class is a facade used by CelestronNexstar to select command strings that are to be used for a particular telescope model.

The CelestronCoordinateConverter class is used by the CelestronCommand class to convert coordinates for a telescope model.

Though not yet completely implemented or tested, there are equivalent classes for Meade telescopes: MeadeTelescope, MeadeCommand, and MeadeCoordinateConverter.

The SerialConnection class is used to send command strings and receive responses to the telescope through the computers comm port. It provides a buffer to help synchronize commands and responses. It used used to set up communication parameters such as the comm port to be used, the baud rate, stop bits, bits-per-character, and communication handshake to be used.

To use the telescope interface, the application developer needs to write code to do the following:

  1. Import the "com.raben.telescope.comm.TelescopeInterface", "com.raben.telescope.comm.TelescopeModel" and "com.raben.telescope.comm.TelescopeFactory" classes
  2. Call the "TelescopeFactory.newInstance" static method and pass the name of a TelescopeModel such as "TelescopeModel.CELSTRON_NEXSTAR_GPS".
  3. Create and instance of java.util.properties and set a key "com.raben.telescope.port" to "COM1", "COM2", or whatever comm port is to be used to connect to the telescope.
  4. Call the telescope method "setProperties" and pass the comm properties as a parameter
  5. Initialize communication to the telescope by calling the "initialize" method.
  6. Test whether communication to the telescope has been established by calling the "isCommunicating" method.
  7. Implement the application by sending various commands to the telescope such as "go-to" a given coordinate or read the telescopes current position.
  8. Call the telescope method "close" to release the comm port connection to the telescope


Back to introduction Next an example application