Main Page | Packages | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

ikayaki.squid.SquidEmulator Class Reference

Collaboration diagram for ikayaki.squid.SquidEmulator:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 SquidEmulator ()

Static Public Member Functions

static void writeMessage (String message, SerialIO port)
static void main (String[] args)

Private Member Functions

void jbInit () throws Exception

Static Private Attributes

static boolean online
static File logFile
static boolean usingOldLog
static int acceleration
static int deceleration
static int velocity
static String handlerStatus
static int commandedDistance
static int currentPosition
static int homePosition
static int commandedRotation
static int currentRotation
static int degausserCoil
static int degausserAmplitude
static int degausserDelay
static int degausserRamp
static char degausserStatus
static SerialIO handlerPort
static SerialIO magnetometerPort
static SerialIO degausserPort
static FileWriter logWriter = null
static HandlerEmu handler
static MagnetometerEmu magnetometer
static DegausserEmu degausser
static boolean running

Classes

class  DegausserEmu
class  HandlerEmu
class  MagnetometerEmu

Detailed Description

This class tries to emulate behavior of real squid-system. It starts 3 threads (handler,magnetometer,degausser), opens COM-ports for them and adds SerialIO Listeners. Threads generates random data values or loaded values as results and generates random error situations to see that program using real squid system does survive those. Uses 2-3 COM ports. Usage SquidEmulator x z.. filename where x is 0 or 1 and indicates if Magnetometer and Demagnetizer are on same COM port. z... values are COM ports (Handler,Magnetometer,Degausser). filename is name of log file we are using or it is existing log file, which is used to generate same sequence used to verify that old and new program behaves same way.

Author:
Aki Korpua

Deprecated:
This emulator is no up to date and behaves differently from the real machine. Test the program with the real machine instead.

Definition at line 43 of file SquidEmulator.java.


Constructor & Destructor Documentation

ikayaki.squid.SquidEmulator.SquidEmulator  ) 
 

Definition at line 44 of file SquidEmulator.java.

References ikayaki.squid.SquidEmulator.jbInit().

Here is the call graph for this function:


Member Function Documentation

void ikayaki.squid.SquidEmulator.jbInit  )  throws Exception [private]
 

Definition at line 247 of file SquidEmulator.java.

Referenced by ikayaki.squid.SquidEmulator.SquidEmulator().

static void ikayaki.squid.SquidEmulator.main String[]  args  )  [static]
 

First creates or loads log file and sets settings. Runs sequence where read data from buffer and run cheduled actions (move, rotate, demag, measure) and send feedback to COM ports.

Definition at line 186 of file SquidEmulator.java.

References ikayaki.squid.SquidEmulator.degausser, ikayaki.squid.SquidEmulator.degausserPort, ikayaki.squid.SquidEmulator.handler, ikayaki.squid.SquidEmulator.handlerPort, ikayaki.squid.SquidEmulator.logFile, ikayaki.squid.SquidEmulator.logWriter, ikayaki.squid.SquidEmulator.magnetometer, ikayaki.squid.SquidEmulator.magnetometerPort, ikayaki.squid.SerialIO.openPort(), and ikayaki.squid.SquidEmulator.running.

Here is the call graph for this function:

static void ikayaki.squid.SquidEmulator.writeMessage String  message,
SerialIO  port
[static]
 

send message to SerialIO to be sented.

Parameters:
message any message reply we are sending back
port port number to be sent

Definition at line 166 of file SquidEmulator.java.

References ikayaki.squid.SquidEmulator.logWriter, and ikayaki.squid.SerialIO.writeMessage().

Referenced by ikayaki.squid.SquidEmulator.DegausserEmu.run(), ikayaki.squid.SquidEmulator.MagnetometerEmu.run(), and ikayaki.squid.SquidEmulator.HandlerEmu.run().

Here is the call graph for this function:


Member Data Documentation

int ikayaki.squid.SquidEmulator.acceleration [static, private]
 

value between 0 and 127 default 5. Settings in the 20-50 range are usually employed.

Definition at line 74 of file SquidEmulator.java.

int ikayaki.squid.SquidEmulator.commandedDistance [static, private]
 

value between 1 and 16,777,215

Definition at line 98 of file SquidEmulator.java.

int ikayaki.squid.SquidEmulator.commandedRotation [static, private]
 

angles are between 0 (0) and 2000 (360)

Definition at line 113 of file SquidEmulator.java.

int ikayaki.squid.SquidEmulator.currentPosition [static, private]
 

value between 1 and 16,777,215

Definition at line 103 of file SquidEmulator.java.

int ikayaki.squid.SquidEmulator.currentRotation [static, private]
 

angles are between 0 (0) and 2000 (360)

Definition at line 118 of file SquidEmulator.java.

int ikayaki.squid.SquidEmulator.deceleration [static, private]
 

value between 0 and 127 default 10. Settings in the 20-50 range are usually employed.

Definition at line 79 of file SquidEmulator.java.

DegausserEmu ikayaki.squid.SquidEmulator.degausser [static, private]
 

Definition at line 157 of file SquidEmulator.java.

Referenced by ikayaki.squid.SquidEmulator.main().

int ikayaki.squid.SquidEmulator.degausserAmplitude [static, private]
 

0->3000 default amp 0

Definition at line 128 of file SquidEmulator.java.

int ikayaki.squid.SquidEmulator.degausserCoil [static, private]
 

(X, Y, Z) = (0,1,2) default axis Z

Definition at line 123 of file SquidEmulator.java.

int ikayaki.squid.SquidEmulator.degausserDelay [static, private]
 

1-9 seconds default delay 1 second

Definition at line 133 of file SquidEmulator.java.

SerialIO ikayaki.squid.SquidEmulator.degausserPort [static, private]
 

Definition at line 151 of file SquidEmulator.java.

Referenced by ikayaki.squid.SquidEmulator.main().

int ikayaki.squid.SquidEmulator.degausserRamp [static, private]
 

(3, 5, 7, 9) default 3

Definition at line 138 of file SquidEmulator.java.

char ikayaki.squid.SquidEmulator.degausserStatus [static, private]
 

Z=Zero, T=Tracking, ?=Unknown

Definition at line 143 of file SquidEmulator.java.

HandlerEmu ikayaki.squid.SquidEmulator.handler [static, private]
 

Definition at line 155 of file SquidEmulator.java.

Referenced by ikayaki.squid.SquidEmulator.main().

SerialIO ikayaki.squid.SquidEmulator.handlerPort [static, private]
 

starts Threads which reads messages from selected COM port. Own listener for each. Offers write commads to port too.

Definition at line 149 of file SquidEmulator.java.

Referenced by ikayaki.squid.SquidEmulator.main().

String ikayaki.squid.SquidEmulator.handlerStatus [static, private]
 

5 end of move, previous G command complete, 7 hard limit stop, G motor is currently indexing

Definition at line 93 of file SquidEmulator.java.

int ikayaki.squid.SquidEmulator.homePosition [static, private]
 

value between 1 and 16,777,215

Definition at line 108 of file SquidEmulator.java.

File ikayaki.squid.SquidEmulator.logFile [static, private]
 

log file we are using read or write

Definition at line 64 of file SquidEmulator.java.

Referenced by ikayaki.squid.SquidEmulator.main().

FileWriter ikayaki.squid.SquidEmulator.logWriter = null [static, private]
 

Definition at line 153 of file SquidEmulator.java.

Referenced by ikayaki.squid.SquidEmulator.main(), and ikayaki.squid.SquidEmulator.writeMessage().

MagnetometerEmu ikayaki.squid.SquidEmulator.magnetometer [static, private]
 

Definition at line 156 of file SquidEmulator.java.

Referenced by ikayaki.squid.SquidEmulator.main().

SerialIO ikayaki.squid.SquidEmulator.magnetometerPort [static, private]
 

Definition at line 150 of file SquidEmulator.java.

Referenced by ikayaki.squid.SquidEmulator.main().

boolean ikayaki.squid.SquidEmulator.online [static, private]
 

indicates if system have been started

Definition at line 59 of file SquidEmulator.java.

boolean ikayaki.squid.SquidEmulator.running [static, private]
 

Definition at line 158 of file SquidEmulator.java.

Referenced by ikayaki.squid.SquidEmulator.main().

boolean ikayaki.squid.SquidEmulator.usingOldLog [static, private]
 

indicates have we loaded log file for using or are we writing it

Definition at line 69 of file SquidEmulator.java.

int ikayaki.squid.SquidEmulator.velocity [static, private]
 

value between 50 and 12 000. The decimal number issued is 10 times the actual pulse rate to the motor. Since the motor requires 200 pulses (full step) or 400 pulses (half step) per revolution, a speed setting of M10000 sets the motor to revolve at 5 revolutions per second in full step or 2.5 revolutions in half step. This rate is one-half the sample rate rotation due to the pulley ratios. The sample handler is set up at the factory for half stepping.

Definition at line 88 of file SquidEmulator.java.


The documentation for this class was generated from the following file:
Generated on Fri May 6 16:01:22 2005 for Squid by  doxygen 1.4.1