KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > JSci > astro > telescope > LX200DebugServer


1 /**
2 * Java LX200DebugServer class.
3 * Copyright (C) 1999-2001 Mark Hale
4 */

5
6 package JSci.astro.telescope;
7
8 import java.io.*;
9 import java.rmi.*;
10 import java.rmi.registry.*;
11 import java.rmi.server.UnicastRemoteObject JavaDoc;
12
13 public final class LX200DebugServer extends UnicastRemoteObject JavaDoc implements LX200Remote {
14         private String JavaDoc ra="00:00:00";
15         private String JavaDoc dec="+00*00'00";
16
17         public static void main(String JavaDoc arg[]) {
18                 if(arg.length!=1) {
19                         System.out.println("Usage: LX200DebugServer <remote name>");
20                         return;
21                 }
22                 System.setSecurityManager(new RMISecurityManager());
23                 try {
24                         Registry localRegistry=LocateRegistry.createRegistry(Registry.REGISTRY_PORT);
25                         localRegistry.rebind(arg[0],new LX200DebugServer());
26                 } catch(IOException e) {
27                         e.printStackTrace();
28                 }
29         }
30         /**
31         * Constructs a telescope debug server.
32         */

33         public LX200DebugServer() throws RemoteException {}
34         public void setFocusRate(int rate) throws IOException, RemoteException {
35                 System.err.println("setFocusRate: "+rate);
36         }
37         public void startFocus(int direction) throws IOException, RemoteException {
38                 System.err.println("startFocus: "+direction);
39         }
40         public void stopFocus() throws IOException, RemoteException {
41                 System.err.println("stopFocus");
42         }
43         public void setSlewRate(int rate) throws IOException, RemoteException {
44                 System.err.println("setSlewRate: "+rate);
45         }
46         public void startSlew(int direction) throws IOException, RemoteException {
47                 System.err.println("startSlew: "+direction);
48         }
49         public void stopSlew(int direction) throws IOException, RemoteException {
50                 System.err.println("stopSlew: "+direction);
51         }
52         public String JavaDoc getRA() throws IOException, RemoteException {
53                 System.err.println("getRA");
54                 return ra;
55         }
56         public String JavaDoc getDec() throws IOException, RemoteException {
57                 System.err.println("getDec");
58                 return dec;
59         }
60         public void setObjectCoords(String JavaDoc newRa,String JavaDoc newDec) throws IOException, RemoteException {
61                 System.err.println("setObjectCoords: "+newRa+", "+newDec);
62                 ra=newRa;
63                 dec=newDec;
64         }
65         public int slewToObject() throws IOException, RemoteException {
66                 System.err.println("slewToObject");
67                 return 0;
68         }
69         public void syncCoords() throws IOException, RemoteException {
70                 System.err.println("syncCoords");
71         }
72 }
73
74
Popular Tags