UNIVERSITY OF NEW SOUTH WALES School of Computer Science & Engineering Hardware control systems using Java November 2002 Oliver
10 Figure 9-6 Scan status panel 76 Figure 9-7 Signal strength vs. scan number 77 Figure 9-8 Signal strength vs. frequency and scan number 78 Fig
100 Figure E-2 Equatorial coordinates, sourced from [ 4 ]. Right Ascension is analogous to the longitude of the earth. It is essentially the
101 E.2. Astronomical times E.2.1. Universal time Universal time (UT) is the precise measurement of time used as the basis for civil time keepi
102 E.2.5. Dynamical time Dynamical Time, introduced in 1984 as a replacement for ephemeris time, more accurately defines a uniform
103 The APT has the following filters available: • Ultraviolet (R) • Blue (B) • Visible (V) • Visible Red (VR) • Infrared (I) • Clear E.5.
105 F. Selected code listings F.1. Masterswitch module F.1.1. Masterswitch.java /** * $Id: Masterswitch.java,v 1.4 2002/10/22 08:23:11 oliverm
106 * valid for MasterSwitch firmware version 1.X. */ public static final String OUTLET_ON_WITH_DELAY = "On with delay";
107 * @param outlet The Masterswitch outlet. This is a number between 1 and 8 * @return The String value corresponding to the outlets sta
108 /** * $Id: AbstractMasterswitch.java,v 1.2 2002/10/22 08:23:11 oliverm Exp $ * Author: Oliver Mather * */ package apt.masterswitch; imp
109 if( listener instanceof MasterswitchListener ) { if( listeners.contains(listener) ) { logger.log(Level.INFO
11 1 Introduction 1.1 Overview This thesis documents the application of the Java language across several projects, the majority of which, are
110 F.1.3. MasterswitchListener.java /** * $Id: MasterswitchListener.java,v 1.2 2002/10/22 08:23:11 oliverm Exp $ * Author: Oliver Mather * *
111 F.1.4. MasterswitchException.java /** * $Id: MasterswitchException.java,v 1.2 2002/10/22 08:23:11 oliverm Exp $ * Author: Oliver Mather *
112 F.1.5. SNMPMasterswitch.java /** * $Id: SNMPMasterswitch.java,v 1.6 2002/10/22 08:23:11 oliverm Exp $ * Author: Oliver Mather * */ pack
113 private static final String sPDUOutletCtlName = "sPDUOutletCtlName"; // This is similar to sPDUOutletName, except only sPDUOutlet
114 throw new MasterswitchException("Cannot initialise Masterswitch",e); } catch (FileNotFoundException e) {
115 private SnmpSyntax doSNMPSet( String oid, SnmpSyntax data ) throws MasterswitchException { SnmpVarBind[] vblist = { new SnmpVarB
116 } else if(outletInt == SNMP_OUTLET_OFF ) { return OUTLET_OFF; } else if(outletInt == SNMP_OUTLET_REBOOT ) {
117 log.log(Level.WARNING, "Request ignored by apt.masterswitch.masterswitch. Another user is probably logged in"); }
118 int command, SnmpPduPacket pdu) { SnmpPduRequest req = null; if(
119 log.log(Level.WARNING, "An unexpected error occured with the SNMP Session"); log.log(Level.WARNING, "The error
120 System.out.println("fireOutletNameChanged("+((int)(i+1))+", "+currName+");");
121 F.1.6. SnmpTrapDaemon.java /** * $Id: SnmpTrapDaemon.java,v 1.3 2002/10/22 08:23:11 oliverm Exp $ * Author: Oliver Mather * */ package
122 F.1.7. AbstractSnmpTrapDaemon.java /** * $Id: AbstractSnmpTrapDaemon.java,v 1.3 2002/10/22 08:23:11 oliverm Exp $ * Author: Oliver Mather
123 protected void fireSnmpTrapDaemonStarted() { Iterator i = listeners.iterator(); while (i.hasNext()) { SnmpTrapL
124 F.1.8. SnmpTrapDaemonImpl.java /** * $Id: SnmpTrapDaemonImpl.java,v 1.4 2002/10/22 08:23:11 oliverm Exp $ * Author: Oliver Mather * */ p
125 logger.log( Level.INFO, "Java SnmpTrapDaemon Started"); fireSnmpTrapDaemonStarted(); } catch (SocketE
126 * allow the handler to determine the host, port, * and community string of the received PDU.</P> * * @param session The SNMP
127 F.1.9. LinuxSnmpTrapDaemonImpl.java /** * $Id: LinuxSnmpTrapDaemonImpl.java,v 1.2 2002/10/22 08:23:11 oliverm Exp $ * Author: Oliver Mather
128 buffer = new BufferedReader(reader,1); readerThread = new StdErrReader(); readerThread.start()
129 } } /** * output of "man snmptrapd" * ************************************************************* SNMPTRAPD(8)
13 2 APT hardware 2.1 Introduction The APT is a term often used not simply to refer the Telescope itself, but rather to a comple
130 %W Trap description %q Trap sub-type (numeric, in decimal) %P Security information from the PDU (community n
131 F.1.10. SnmpTrapListener.java /** * $Id: SnmpTrapListener.java,v 1.3 2002/10/22 08:23:11 oliverm Exp $ * Author: Oliver Mather * */ pac
132 F.2. APT deployment system F.2.1. apt-client-base.jnlp <?xml version="1.0" encoding="utf-8"?> <!-- JNLP base f
133 F.2.2. apt-client-keith.jnlp <?xml version="1.0" encoding="utf-8"?> <!-- JNLP base file for the apt client gui
134 F.2.3. apt build.xml <?xml version="1.0"?> <!-- $Id: build.xml,v 1.24 2002/10/24 01:35:35 oliverm Exp $ Buildfile for apt
135 Note: if you install an additional library here, please add it to the check below at the init target
136 SCP Setup Note that to use scp, authenticed remote ssh must be setup on mcba5 AND mistral. This is done by
137 classpathref="classpath" srcdir="${src-dir}" > <exclude name="apt/sp/**"/>
138 <delete file="${apt.src.tar}"/> </target> <!-- ********** END DIST ********** --> <!-- ***
139 <copy file="${bin-dir}/runOliversGui-base.bat" tofile="${dist-dir}/runOliversGui.bat" /> <repl
14 Control of the sliding roof, discussed in more detail in 2.10, gives the telescope rapid access to any part of the sky. The building also contai
140 <property name="scp-upload-mistral-args" value=" -C -r ${scp.mcba5.source} ${scp.mistral.destination}" />
141 F.2.4. lib build.xml <?xml version="1.0"?> <!-- $Id: build.xml,v 1.4 2002/10/03 08:32:20 oliverm Exp $ Ant build file for
142 SCP Setup Note that to use scp, authenticed remote ssh must be setup on mcba5 AND mist
143 <arg line="${scp-mcba5-args}" /> </exec> </target> <target name="upload-mistral"
144 F.3. CSIRO / SEARFE F.3.1. Sample data file <?xml version="1.0" encoding="UTF-8"?> <?xml:stylesheet type="
145 F.4. TextSkin F.4.1. TextSkin zipfile listing [oliverm@mcba5:~] unzip -l BacklitLCD.zip Archive: BacklitLCD.zip Length Date Time
147 G. CDROM directory structure apt The base directory for the apt files cvs-workspace Build environments for the apt, ja
15 Figure 2-2 Telescope Originally a Baker-Nunn satellite tracking camera, the telescope was donated to The University of New South Wales by
16 2.5 CCD The CCD, or Charge Coupled Device, is a digital camera, similar to those commonly found in the marketplace today. The telescope is
17 Each servo motor is powered by its own DC servo amplifier which receives an analogue voltage from the Macrostation (see 2.6.4). In October 20
18 pushing the mount in the opposite direction to which it is travelling. Note that this motion will not be recorded by the software, which only m
19 Figure 2-8 Inner RA limit switches 2.6.3 Tilt sensor The tilt sensor is used for calibration of the telescope. This is necessary to correctl
20 2.7 Masterswitch Figure 2-9 APC Masterswitch power distribution unit AP9212 In principle, the Masterswitch is a very simple device. It allo
21 The Management Interface Board also supports up to 16 user accounts, although this functionality is not required as the JAS provides
22 2.9 Controller Area Network (CAN) Controller Area Network (CAN) is a serial bus system especially suited to interconnect smart dev
23 2.11 ROTSE Figure 2-13 Nearby ROTSE Enclosure The ROTSE (Robotic Optical Transient Search Experiment) enclosure is situated just a few metres
24 Roof ControlSwitchboadSwitchboardNodeRoof NodeUPSLightsPower Outlets150.203.153.2mistral.anu.edu.au150.203.153.1gatewayCAN BusInternetIR Cam150.
25 3 APT software 3.1 Introduction As stated in 2.3, the GNU Linux operating system is an integral part of the APT system. It provides a centrali
26 3.3 Command line tools BASHPERLIRAFImagingapt_exposure_display apt_imageapt_image_abortEnclosureapt_imsaveTelescopeaptEmergencySystemaptSet
27 3.4 Java Automation System (JAS) 3.4.1 Introduction The Java Automation System (JAS), developed by Keith Bannister in [ 52 ], w
28 public void sendToOthers(JASMessage message) { ... } public void sendToClient(JASMessage message, String clientName) { ... } JASMessages can c
29 subsystems as a set of key-value properties. The Masterswitch, discussed in detail in Chapter 4, is controlled in this way.
3 Abstract The purpose of this thesis is to apply Java technology to facilitate the creation of more reliable, portable, flexible and logical ha
31 4 APT Masterswitch implementation 4.1 Introduction Currently the Masterswitch is controlled via an “Expect” script which runs a t
32 These requirements were translated into the Java interfaces shown below: // Java interface to the APC AP9212 Masterswitch public interface Mas
33 The AdventNet package is clearly of the highest quality. Feature rich, and backed by comprehensive documentation. However,
34 which is represented internally as “.1.3.6.1.4.1.318.1.1.4.5.2.1.3”.This string is then appended with “.<outlet-number>” to sp
35 • Provide initialised references to the Masterswitch Object to be used by Commands to interact with the hardware 4.4.1 Commands
36 4.4.2 Messages Masterswitch status information is broadcast to clients on the CHANNEL_MASTERSWITCH, initialised at the APTServer star
37 public static final String KEY_OUTLET_1_STATE = "Outlet 1"; ... public static final String KEY_OUTLET_8_STATE = "Outlet 8";
38 4.6 Conclusion The design proposed and developed is being successfully used in the live system, providing a more reliable fine gra
39 5 APT user interface implementation 5.1 Introduction The existing user interface (shown below), was originally developed by Keith Bannister to
40 5.2 Architecture The user interface has been isolated as much as possible from the JAS to ease its portability to future versions of the JAS,
41 time. This way, any connected users would be able to discern exactly what the system was doing, an invaluable tool for debugging
42 • POWER: The status of the roofs power supply. It is either ON, or OFF • MOVING:Possible values are OPENING, CLOSING, STOPPED, UNKNOWN These
43 5.5 Chat system Given the distributed nature and complexity of the APT control system it is desirable to be able to communicate with other user
44 Figure 5-8 APT chat system
45 5.6 Look and Feel The Java Language comes with a rich user interface toolkit, the Java Foundation Classes, also known as JFC-Swing. Swing
46 5.6.2 Problems • SwingUtilities.updateComponentTreeUI() in certain circumstances does not function as desired. For example, compone
47 Figure 5-11 Aqua Look and Feel with Blue Digits textSkin 5.7 Conclusion This GUI is significantly more attractive, responsive and eas
49 6 APT software deployment 6.1 Introduction The APT software is a very complex system of integrated software components and is constantly under
5 Acknowledgements Special thanks must be extended to my supervisor, Michael Ashley, and to Keith Bannister for their consistent p
50 Web Start is designed to address several of the problems traditionally associated with the deployment of standalone applications:
51 6.3.2 Security By default, all Web Start applications are run in a restricted sandbox with the following limitations (sourced from [ 49 ] ):
52 6.3.3 Resource loading Resources such as images, sounds, and any other additional application files cannot simply be referenced in the same wa
53 mistralAPTServermcba5workspace/apt__V3.0/apt__V2.0/apt__V1.0apt-client.jnlprunServerapt.jarconfig.jar. . . /libjas__V1.0.jarjas__V2.0.jar. . ./a
54 Once the workspace has been checked out from CVS the developer should manually edit the build.xml (see Appendix F.2.3) file and modify the vers
55 doc-tar.gz Packages the JavaDocs and content of the doc directory code into the archive apt__V<version-key>/apt-docs__V<
56 6.5.1 External libraries The solution discussed previously must be further developed to account for the versioning of the library files that t
57 The ant upload targets discussed previously are simply calls to the scp command line tool. The deploy directory is uploaded to mcba5, and then
59 7 APT suggestions and enhancements 7.1 Introduction This Chapter contains a collection of improvements designed to increase the reli
60 7.3.2 Maintenance The APT system relies heavily on several external software libraries and tools. Such as PTCS, DRAMA, JAS, JSDT
61 diagram was developed. Also, additional hardware and software components will inevitably need to be added to provide information suc
62 Note that this command could be implemented as a SP command or as a very simple Java application, bypassing the JAS entirely. 7.
63 8 SkinnedTextField 8.1 Introduction Given the complex architecture of the APT System, the development of a rich user interface in Java will r
64 /* Abbreviated SkinnedTextField API */ public class SkinnedTextField { ... public SkinnedTextField() { ... } public void setSkin
65 In order to support skins downloaded from [ 36], as well as those I have extended to include additional characters, Skins are
66 BackLitLCD 57ChevySkin Figure 8-3 SkinnedTextFieldDemo
67 Figure 8-4 SkinnedTextField menu Unfortunately, the Web Start deployment of SkinnedTextFieldDemo can not be distributed with Skins pre-load
68 8.6 Suggestions and enhancements • Support for Classes of SkinnedTextFields. This would allow users display to have different areas of their
69 9 CSIRO SEARFE project 9.1 Background The SEARFE (Students Exploring Australia’s Radio-Frequency Environment) project is designed to act as a
7 Contents 1 Introduction 11 1.1 Overview 11 1.2 Automated Patrol Telescope 11 1.3 Additional projects 11 2 APT hardware 13 2.1 Introdu
70 This prototype was used as a basis for preparing the requirements of the Spectrum Scanner application. 9.3 Requirements The primary purpose of
71 9.4 Hardware Figure 9-1 AOR – AR3000A Radio Receiver The software interfaces to a AOR-AR3000A professional radio receiver. The features ut
72 StatusWidgetsStatusWidgetsStatusWidgetsStatusWidgetsStatusWidgetsStatusWidgetsGUISpectrum ScannerAR3000ARS232Acquire ScanCommandSetScan DataData
73 9.6 User interface The main application window shown in Figure 9-3 provides access to all the data files currently loaded in memory, access to
74 Figure 9-4 Scan conditions panel
75 Figure 9-5 Receiver parameters
76 Figure 9-6 Scan status panel 9.6.2 Data visualisation VisAD was chosen as a graphical package primarily because of its ability to plot imag
77 Figure 9-7 Signal strength vs. scan number
78 Figure 9-8 Signal strength vs. frequency and scan number
79 Figure 9-9 Signal strength vs. frequency
8 8 SkinnedTextField 63 8.1 Introduction 63 8.2 Requirements 63 8.3 Design 63 8.4 TextSkin 64 8.5 SkinnedTextFieldDemo 65 8.6 Suggesti
80 Figure 9-10 3D plot 9.7 Suggestions and enhancements Version 2.0 of the Spectrum Scanner satisfies all the requirements outlined in 9.3. Since
81 • The XML data files also utilise XML style sheets to automatically format the data into comma delimited text. These style s
82
83 10 Conclusion 10.1 Introduction Despite the fact that Java’s platform independence and design principles are focussed on abstracti
84 10.3 Failure and fault analysis As the complexity of any system grows, so does the likelihood of a individual components failure. The conseque
85 An implementation based on the java.util.logging framework is capable of achieving this. Searches could be performed on LogRecord objects usi
87 Bibliography [ 1 ] Delta Tau Website. http://www.deltatau.com/ [ 2 ] CAN in Automation workgroup. http://www.can-cia.de [ 3 ] PCI Watchdog Webs
88 [ 39 ] AOR. AR – 3000A Professional Monitor Receiver Instruction Manual. [ 40 ] Java Communications API Website. http://java.sun.com/products/ja
89 A. Glossary AAO Anglo Australian Observatory APT Automated Patrol Telescope CAN Controller Area Network CCD Charge Coupled Device - Camera
9 List of Figures Figure 2-1 APT building 13 Figure 2-2 Telescope 15 Figure 2-3 Focus motor interface 16 Figure 2-4 Right ascension motor 17 F
91 B. JAS programming techniques B.1. Introduction This appendix is intended to be a simple programming guide for interacting with the APT usi
92 The core of the JAS system revolves around its ability to execute commands. To add a command to the APT system is a relatively simple pr
93 LogCommand.class, MasterswitchSwitchOutletCommand.class, MasterswitchRenameOutletCommand.class }; Figure B-
95 C. Software tools C.1. CVS - Windows Instructions for accessing the APT CVS repository on Linux based machines is available from Keith Banni
96 set CVS_RSH=C:\Program Files\NetworkSimplicity\ssh\ssh.exe C.1.3. Checkout the code Create a cvs-workspace directory on your local machine. C
97 D. SNMP overview D.1. Architecture The Simple Network Management Protocol (SNMP), is a standard designed to allow the remote management of
98 o Each of the Request messages will immediately generate a response message. • Trap o Agents can asynchronously send Traps (similar to i
99 E. Astronomy primer E.1. Celestial coordinate systems Several Celestial Coordinate Systems are used by astronomers to record the positions of
Kommentare zu diesen Handbüchern