public class CalibUnit extends SerialDriver
| Modifier and Type | Class and Description |
|---|---|
static class |
CalibUnit.Concurrent |
static class |
CalibUnit.gohome |
static class |
CalibUnit.Relative
Steps the motor relatively for the given number of steps.
|
static class |
CalibUnit.setpos1 |
static class |
CalibUnit.setpos2 |
static class |
CalibUnit.setpos3 |
static class |
CalibUnit.setpos4 |
static class |
CalibUnit.setpos5 |
static class |
CalibUnit.Status
Retrieves all of the status there is and pipe it to standard out.
|
static class |
CalibUnit.Test
Test the class.
|
SerialDriver.Debug, SerialDriver.ScanAbstractSerialDriver.Available| Modifier and Type | Field and Description |
|---|---|
static int |
BADPOSITION
The return code for an unknown position at movement.
|
private String |
current
This is the current position.
|
private static int |
DEFACCELERATION
Default acceleration.
|
static String |
DEFDRIVERNAME
driver generic name.
|
private static int |
DEFHOMESPEED
Default speed to move to home (rpm).
|
private static boolean |
DEFINITHOME
Default zero-positioning on init.
|
private static int |
DEFMAXSPEED
Default maximal speed (rpm).
|
private static String |
DEFPOSITIONS
Default position names and offsets.
|
static long |
DEFPOSITIONTIMEOUT
Default position wait timeout.
|
private static long |
DEFSTATUSTIMEOUT
Default status time out.
|
static String |
HOMEPOSITION
The reserved home position name.
|
static String |
KEY_ACCELERATION
Acceleration at changing position.
|
static String |
KEY_HOMESPEED
The speed at which the home position will be reached (rpm).
|
static String |
KEY_INITHOME
If true, we move to the zero position on init.
|
static String |
KEY_MAXSPEED
Maximum speed at changing position (rpm).
|
static String |
KEY_POSITIONS
A lookup-table linking position names to slider position.
|
static String |
KEY_POSITIONTIMEOUT
Time out for positioning.
|
static String |
KEY_STATUSTIMEOUT
Time out for status queries.
|
private Map<String,String> |
lookup
The lookup table linking position names to offsets.
|
static int |
OK
The return code for correct movement.
|
static int |
TIMEOUT
The return code for time out at movement.
|
private gnu.io.SerialPortEventListener |
wakeup
This object notifies me on data available.
|
private Object |
wakeupmonitor
This object notifies me on serial port events.
|
KEY_DELAY, KEY_RWCOOLDOWN, KEY_STATICLOCKinport, KEY_BAUDRATE, KEY_CLOSETIMEOUT, KEY_DATABIT, KEY_FLOWCONTROL, KEY_INBUFFER, KEY_NOTIFYCOOLDOWN, KEY_OUTBUFFER, KEY_PARITYBIT, KEY_PORTNAME, KEY_RECEIVEFRAMING, KEY_RECEIVETHRESHOLD, KEY_RECEIVETIMEOUT, KEY_STOPBIT, KEY_TIMEOUT, LOCK, outport, STATICLOCKKEY_DRIVERNAMEKEY_LISTSEPARATOR, KEY_MAPKEYVALUECHAR, KEY_MAPSEPARATORCONFIG, KEY_CLASS| Constructor and Description |
|---|
CalibUnit(Map<String,String> info)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
private static boolean |
consistsOf(String response,
char p)
Checks if a response string consists of only a single char, in arbitrary
repetition.
|
String |
getCurrentPosition()
Returns the current position as a string or null if we are moving or not
initialized.
|
String |
getStatus()
Returns the status of the calibration unit.
|
private String |
getStatus(boolean all)
Returns the status of the calibration unit.
|
private String |
getStatusCommand(String statcom)
Sends the specified status command to the controller and waits for the
response.
|
int |
goHomePosition()
Go to the home (= 0) position.
|
int |
goRelative(int steps)
Moves the stage relatively to the current position.
|
int |
goToPosition(String posID)
Set the position.
|
boolean |
open()
Initializing the communication port.
|
private String |
synchedRead(long timeout)
Does a sync on the wakeup monitor, waits at max for the given timeout,
then reads.
|
String |
writeString(String comm)
We add a cr before sending with the parental method.
|
close, exit, readString, readString, writeCommandcreatePortEventListener, createPortEventListener, deregisterSoleEventListener, disableEvent, enableEvent, getDriverName, init, isOpen, registerSoleEventListener, resetOriginalParameterscreateDriver, equals, hashCodeaugment, augment, augment, augment, augment, clone, defaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsEnums, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsMap, getAsObject, getAsObject, getProperties, getProperty, has, initProperties, isNew, parseObject, parseObject, reload, reload, removeProperty, requires, rescanned, setObject, setProperties, setProperty, stringProperties, toStringpublic static final int OK
public static final int TIMEOUT
public static final int BADPOSITION
public static final String HOMEPOSITION
public static final String KEY_POSITIONS
public static final String KEY_POSITIONTIMEOUT
public static final String KEY_STATUSTIMEOUT
public static final String KEY_ACCELERATION
public static final String KEY_MAXSPEED
public static final String KEY_HOMESPEED
public static final String KEY_INITHOME
public static final String DEFDRIVERNAME
private static final String DEFPOSITIONS
public static final long DEFPOSITIONTIMEOUT
private static final long DEFSTATUSTIMEOUT
private static final int DEFACCELERATION
private static final int DEFMAXSPEED
private static final int DEFHOMESPEED
private static final boolean DEFINITHOME
private Object wakeupmonitor
private gnu.io.SerialPortEventListener wakeup
private String current
public boolean open()
throws IOException
open in interface Driveropen in class SerialDriverIOExceptionpublic int goToPosition(String posID) throws IOException
posID - string ID of the requested position.IOExceptionpublic int goRelative(int steps)
public int goHomePosition()
throws IOException
IOExceptionpublic String getStatus()
private String getStatus(boolean all)
private String getStatusCommand(String statcom)
private String synchedRead(long timeout) throws IOException
timeout - IOExceptionprivate static boolean consistsOf(String response, char p)
public String getCurrentPosition()
public String writeString(String comm) throws IOException
writeString in class SerialDriverIOException