public class FilterWheel extends MotorController implements Positioning
| Modifier and Type | Class and Description |
|---|---|
static class |
FilterWheel.Debug
For debugging.
|
static class |
FilterWheel.FullTurn
Reads the filter wheel configuration from a file and does a full turn.
|
static class |
FilterWheel.fw |
MotorController.AxesReset, MotorController.Dump, MotorController.Reset, MotorController.Set, MotorController.Status, MotorController.StepAbstractSerialDriver.Available| Modifier and Type | Field and Description |
|---|---|
private static String |
DEFAXIS
The axis name.
|
static String |
DEFDRIVERNAME
Default driver name.
|
private static boolean |
DEFINITZERO
Default zero-positioning on init.
|
private static double |
DEFOVERSHOOT
Default maximum overshoot fraction.
|
private static String |
DEFPARAMETERS
The default initializing parameters.
|
private static String |
DEFPOSITIONS
The default position in the filter wheel.
|
static String |
KEY_OVERSHOOT
The maximum fraction of overshoot, 1 for full turn .
|
static String |
KEY_PARAMETERS
The parameters to send on init as a map.
|
static String |
KEY_POSITIONS
The positions in the filter wheel.
|
private int |
lastposition
Last position successfully obtained.
|
private boolean |
motorZeroPositioned
True, if motor was zero positioned.
|
private List<Double> |
positions
The list of true positions from properties.
|
axis, FAILED, HOME, KEY_ADDRESS, KEY_AXES, KEY_CONTROLLERTYPE, KEY_EEPROMSTORE, KEY_FAILAXISMOVE, KEY_PROTOCOL, KEY_RESPONSECHOP, KEY_RESPONSEDELAY, KEY_RETRYPOS, KEY_SERIALRETRY, KEY_SLEEPAXISMOVE, KEY_STEPTOLERANCE, KEY_TELEGRAM, KEY_WORKAROUND, MCC, OK, OMC, UNDEFINEDPOSITIONinport, 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_MAPSEPARATORKEY_INITZEROCONFIG, KEY_CLASS| Constructor and Description |
|---|
FilterWheel(Map<String,String> config)
Construct a new filter wheel similar to a motor controller, but
defaulting its name to
DEFDRIVERNAME. |
| Modifier and Type | Method and Description |
|---|---|
private long |
fullTurn()
A method that performs a full turn of the filter wheel.
|
protected double |
getControllerParameter(String param) |
protected double[] |
getControllerParameterArray(int[] ipar)
Returns the values of all parameters indicated in the list.
|
int |
getMaxPosition()
Returns the maximumk number of allowed positions.
|
int |
getMaxPosition(String axis)
Compatibility mode.
|
int |
getMaxStep(String axis)
Returns the maximal steps this axis can travel.
|
protected Map<String,String> |
getParametersFor(String ax)
We have only a single axis, thus, always return a single map.
|
int |
getPosition()
Returns the last position attained or
MotorController.UNDEFINEDPOSITION. |
int |
getPosition(String axis)
Compatibility mode.
|
protected int |
getStepResolution() |
void |
init()
Initializes position look-up table.
|
boolean |
offset(int diff)
Rotates the desired number of steps from the current position, no
nulling.
|
boolean |
offset(String axis,
int pos)
Compatibility mode.
|
boolean |
open()
Sets the filter wheel into zero position after opening.
|
protected void |
setControllerParameter(String param,
int value) |
boolean |
setPosition(int pos)
Sets the wheel in one of the 6 configured position.
|
boolean |
setPosition(String axis,
int pos)
Compatibility mode.
|
boolean |
setZeroPosition()
Set the filter wheel in its zero position.
|
boolean |
setZeroPosition(String axis)
Compatibility mode.
|
axisStop, encapsulate, ensureCommand, errorPower, errorStep, errorStop, getAxesNames, getControllerParameter, getControllerParameterArray, getControllerType, getStatus, getStatus, getStep, getStepResolution, isContinuous, powerOff, powerOn, readString, readString, remote, reset, resetAxis, setControllerParameter, waitWhileAxisMoving, waitWhileAxisMoving, writeCommand, writeCommand, writeString, writeStringclose, createPortEventListener, createPortEventListener, deregisterSoleEventListener, disableEvent, enableEvent, getDriverName, 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, toStringfinalize, getClass, notify, notifyAll, wait, wait, waitgetAxesNames, getStep, isContinuousclose, getDriverName, isOpenpublic static final String KEY_POSITIONS
public static final String KEY_PARAMETERS
public static final String KEY_OVERSHOOT
public static final String DEFDRIVERNAME
private static final String DEFAXIS
private static final String DEFPOSITIONS
private static final String DEFPARAMETERS
private static final boolean DEFINITZERO
private static final double DEFOVERSHOOT
private boolean motorZeroPositioned
private int lastposition
public FilterWheel(Map<String,String> config)
DEFDRIVERNAME.public void init()
throws InitException
init in interface Initializableinit in class MotorControllerInitExceptionprotected Map<String,String> getParametersFor(String ax)
getParametersFor in class MotorControllerpublic boolean open()
throws IOException
open in interface Driveropen in class MotorControllerIOExceptionpublic boolean setPosition(String axis, int pos) throws IOException
setPosition in interface MultiAxesaxis - The name of the axis to be zero-setted.pos - The numbered position to be attained.IOException - If driver communication failed.public boolean setPosition(int pos)
throws IOException
setPosition in interface Positioningpos - Integer (0 - 5) specifying the wheel position.IOException - If driver communication failed.public boolean offset(String axis, int pos) throws IOException
offset in interface MultiAxesaxis - The name of the axis to be zero-setted.pos - The number of step, positiv or negative in
driver-specific coordinates.IOException - If driver communication failed.public boolean offset(int diff)
throws IOException
offset in interface PositioningIOExceptionpublic boolean setZeroPosition(String axis) throws IOException
setZeroPosition in interface MultiAxesaxis - The name of the axis to be zero-setted.IOException - If driver communication failed.public boolean setZeroPosition()
throws IOException
setZeroPosition in interface PositioningIOException - If driver communication failed.public int getPosition(String axis) throws IOException
getPosition in interface MultiAxesaxis - The name of the axis to be zero-setted.IOException - If driver communication failed.public int getPosition()
MotorController.UNDEFINEDPOSITION.getPosition in interface Positioningpublic int getMaxPosition(String axis)
getMaxPosition in interface MultiAxesaxis - String representing the selected axis.public int getMaxPosition()
getMaxPosition in interface Positioningpublic int getMaxStep(String axis) throws IOException
MultiAxesMultiAxes.getMaxPosition(java.lang.String) to estimate the number of steps per position.getMaxStep in interface MultiAxesIOExceptionprotected double getControllerParameter(String param) throws IOException, NullPointerException
IOExceptionNullPointerExceptionprotected double[] getControllerParameterArray(int[] ipar)
throws IOException,
NullPointerException
IOExceptionNullPointerExceptionprotected int getStepResolution()
throws IOException,
NullPointerException
IOExceptionNullPointerExceptionprotected void setControllerParameter(String param, int value) throws IOException, NullPointerException
IOExceptionNullPointerExceptionprivate long fullTurn()
throws IOException
IOException