01: /**
02: * Java LX200DebugServer class.
03: * Copyright (C) 1999-2001 Mark Hale
04: */package JSci.astro.telescope;
05:
06: import java.io.*;
07: import java.rmi.*;
08: import java.rmi.registry.*;
09: import java.rmi.server.UnicastRemoteObject;
10:
11: public final class LX200DebugServer extends UnicastRemoteObject
12: implements LX200Remote {
13: private String ra = "00:00:00";
14: private String dec = "+00*00'00";
15:
16: public static void main(String arg[]) {
17: if (arg.length != 1) {
18: System.out.println("Usage: LX200DebugServer <remote name>");
19: return;
20: }
21: System.setSecurityManager(new RMISecurityManager());
22: try {
23: Registry localRegistry = LocateRegistry
24: .createRegistry(Registry.REGISTRY_PORT);
25: localRegistry.rebind(arg[0], new LX200DebugServer());
26: } catch (IOException e) {
27: e.printStackTrace();
28: }
29: }
30:
31: /**
32: * Constructs a telescope debug server.
33: */
34: public LX200DebugServer() throws RemoteException {
35: }
36:
37: public void setFocusRate(int rate) throws IOException,
38: RemoteException {
39: System.err.println("setFocusRate: " + rate);
40: }
41:
42: public void startFocus(int direction) throws IOException,
43: RemoteException {
44: System.err.println("startFocus: " + direction);
45: }
46:
47: public void stopFocus() throws IOException, RemoteException {
48: System.err.println("stopFocus");
49: }
50:
51: public void setSlewRate(int rate) throws IOException,
52: RemoteException {
53: System.err.println("setSlewRate: " + rate);
54: }
55:
56: public void startSlew(int direction) throws IOException,
57: RemoteException {
58: System.err.println("startSlew: " + direction);
59: }
60:
61: public void stopSlew(int direction) throws IOException,
62: RemoteException {
63: System.err.println("stopSlew: " + direction);
64: }
65:
66: public String getRA() throws IOException, RemoteException {
67: System.err.println("getRA");
68: return ra;
69: }
70:
71: public String getDec() throws IOException, RemoteException {
72: System.err.println("getDec");
73: return dec;
74: }
75:
76: public void setObjectCoords(String newRa, String newDec)
77: throws IOException, RemoteException {
78: System.err.println("setObjectCoords: " + newRa + ", " + newDec);
79: ra = newRa;
80: dec = newDec;
81: }
82:
83: public int slewToObject() throws IOException, RemoteException {
84: System.err.println("slewToObject");
85: return 0;
86: }
87:
88: public void syncCoords() throws IOException, RemoteException {
89: System.err.println("syncCoords");
90: }
91: }
|