stella.omc
Class MiniWheel

java.lang.Object
  extended by util.PropertyContainer
      extended by util.PropertyResources
          extended by util.PropertyBundles
              extended by io.AbstractDriver
                  extended by io.AbstractSerialDriver
                      extended by stella.omc.MotorController
                          extended by stella.omc.MiniWheel
All Implemented Interfaces:
Driver, Cloneable, MultiAxes, Positioning, Initializable, LocalizedSupplying, PropertySupplying, ResourceSupplying

public class MiniWheel
extends MotorController
implements Positioning

The class provide a simple interface for the mini filter wheel operation locates in the STELLA-SES top unit. The two important method can set the wheel in its zero position and (then) in arbitrary position specified by the wholes in the wheel. The class has syslog capabilities through the protomatter syslog classes. It is a copy of the FilterWheel class updated with the proper motor parameters.


Nested Class Summary
static class MiniWheel.Debug
          For debugging.
static class MiniWheel.FullTurn
          Reads the mini wheel configuration from a file and does a full turn.
static class MiniWheel.mw
           
static class MiniWheel.Set
          Reads the mini wheel configuration from a file and positions to the specified slot.
static class MiniWheel.Step
          Steps the mini wheel from the current position to the desired offset.
 
Nested classes/interfaces inherited from class stella.omc.MotorController
MotorController.AxesReset, MotorController.Dump, MotorController.Reset, MotorController.Status
 
Nested classes/interfaces inherited from class io.AbstractSerialDriver
AbstractSerialDriver.Available
 
Nested classes/interfaces inherited from class util.PropertyResources
PropertyResources.URLResource
 
Field Summary
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 mini 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 mini 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.
 
Fields inherited from class stella.omc.MotorController
axis, FAILED, HOME, KEY_ADDRESS, KEY_AXES, KEY_CONTROLLERTYPE, KEY_DELAY, KEY_EEPROMSTORE, KEY_FAILAXISMOVE, KEY_PROTOCOL, KEY_RETRYPOS, KEY_SERIALRETRY, KEY_SLEEPAXISMOVE, KEY_STEPTOLERANCE, KEY_TELEGRAM, KEY_WORKAROUND, MCC, OK, OMC, UNDEFINEDPOSITION
 
Fields inherited from class io.AbstractSerialDriver
inport, 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, outport, staticlock
 
Fields inherited from class io.AbstractDriver
KEY_DRIVERNAME
 
Fields inherited from class util.PropertyBundles
KEY_LOCALECOUNTRY, KEY_LOCALELANGUAGE, KEY_RESOURCEBUNDLES
 
Fields inherited from class util.PropertyResources
KEY_NOINITONCREATE, localurl, locate, POSTFIX_DIR, POSTFIX_EXT, POSTFIX_FILE, POSTFIX_LIST, POSTFIX_URL, urlset
 
Fields inherited from class util.PropertyContainer
KEY_LISTSEPARATOR, KEY_MAPKEYVALUECHAR, KEY_MAPSEPARATOR
 
Fields inherited from interface stella.omc.MultiAxes
KEY_INITZERO
 
Fields inherited from interface util.ResourceSupplying
KEY_URLRESOURCES, KEY_URLUSECONFIG, KEY_URLUSECURRENT, KEY_URLUSEHOME
 
Fields inherited from interface util.PropertySupplying
CONFIG, KEY_CLASS
 
Constructor Summary
MiniWheel(Map<String,String> config)
          Construct a new mini wheel similar to a motor controller, but defaulting its name to DEFDRIVERNAME.
 
Method Summary
private  long fullTurn()
          A method that performs a full turn of the mini 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 mini 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 mini wheel in its zero position.
 boolean setZeroPosition(String axis)
          Compatibility mode.
 
Methods inherited from class stella.omc.MotorController
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, writeString
 
Methods inherited from class io.AbstractSerialDriver
close, createPortEventListener, createPortEventListener, deregisterSoleEventListener, disableEvent, enableEvent, getDriverName, isOpen, registerSoleEventListener, resetOriginalParameters
 
Methods inherited from class io.AbstractDriver
createDriver, equals, hashCode
 
Methods inherited from class util.PropertyBundles
clone, getLocalized, getLocalized, getLocalizedString, getLocalizedString, loadResource
 
Methods inherited from class util.PropertyResources
createFrom, createFrom, createFrom, getApplet, getAsResources, getLocalClassLoader, getPropertiesToKey, getPropertiesToKey, getResource, getResourceAsStream, getResourceFromKey, getResources, keyCreate, keyCreate, reload, setApplet
 
Methods inherited from class util.PropertyContainer
augment, augment, augment, 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, isNew, parseObject, reload, removeProperty, rescanned, setObject, setProperties, setProperty, stringProperties, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface stella.omc.MultiAxes
getAxesNames, getStep, isContinuous
 
Methods inherited from interface io.Driver
close, getDriverName, isOpen
 
Methods inherited from interface util.ResourceSupplying
getResource, getResourceAsStream, getResources
 
Methods inherited from interface util.PropertySupplying
defaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsObject, getAsObject, getProperties, getProperty, has, parseObject, removeProperty, setObject, setProperty, stringProperties
 

Field Detail

KEY_POSITIONS

public static final String KEY_POSITIONS
The positions in the mini wheel.

See Also:
Constant Field Values

KEY_PARAMETERS

public static final String KEY_PARAMETERS
The parameters to send on init as a map.

See Also:
Constant Field Values

KEY_OVERSHOOT

public static final String KEY_OVERSHOOT
The maximum fraction of overshoot, 1 for full turn .

See Also:
Constant Field Values

DEFDRIVERNAME

public static final String DEFDRIVERNAME
Default driver name.

See Also:
Constant Field Values

DEFAXIS

private static final String DEFAXIS
The axis name.

See Also:
Constant Field Values

DEFPOSITIONS

private static final String DEFPOSITIONS
The default position in the mini wheel.

See Also:
Constant Field Values

DEFPARAMETERS

private static final String DEFPARAMETERS
The default initializing parameters.

See Also:
Constant Field Values

DEFINITZERO

private static final boolean DEFINITZERO
Default zero-positioning on init.

See Also:
Constant Field Values

DEFOVERSHOOT

private static final double DEFOVERSHOOT
Default maximum overshoot fraction.

See Also:
Constant Field Values

positions

private List<Double> positions
The list of true positions from properties.


motorZeroPositioned

private boolean motorZeroPositioned
True, if motor was zero positioned.


lastposition

private int lastposition
Last position successfully obtained.

Constructor Detail

MiniWheel

public MiniWheel(Map<String,String> config)
Construct a new mini wheel similar to a motor controller, but defaulting its name to DEFDRIVERNAME.

Method Detail

init

public void init()
Initializes position look-up table. Additionall move to zero position if init of super class succeeds.

Specified by:
init in interface Initializable
Overrides:
init in class MotorController

getParametersFor

protected Map<String,String> getParametersFor(String ax)
We have only a single axis, thus, always return a single map.

Specified by:
getParametersFor in class MotorController

open

public boolean open()
             throws IOException
Sets the mini wheel into zero position after opening.

Specified by:
open in interface Driver
Overrides:
open in class MotorController
Returns:
True if initialization was successful.
Throws:
IOException

setPosition

public boolean setPosition(String axis,
                           int pos)
                    throws IOException
Compatibility mode.

Specified by:
setPosition in interface MultiAxes
Parameters:
axis - The name of the axis to be zero-setted.
pos - The numbered position to be attained.
Returns:
True on success
Throws:
IOException - If driver communication failed.

offset

public boolean offset(String axis,
                      int pos)
               throws IOException
Compatibility mode.

Specified by:
offset in interface MultiAxes
Parameters:
axis - The name of the axis to be zero-setted.
pos - The number of step, positiv or negative in driver-specific coordinates.
Returns:
True on success
Throws:
IOException - If driver communication failed.

setZeroPosition

public boolean setZeroPosition(String axis)
                        throws IOException
Compatibility mode.

Specified by:
setZeroPosition in interface MultiAxes
Parameters:
axis - The name of the axis to be zero-setted.
Returns:
True on success
Throws:
IOException - If driver communication failed.

getPosition

public int getPosition(String axis)
                throws IOException
Compatibility mode.

Specified by:
getPosition in interface MultiAxes
Parameters:
axis - The name of the axis to be zero-setted.
Returns:
A integer denoting one of the attainable positions.
Throws:
IOException - If driver communication failed.

getMaxPosition

public int getMaxPosition(String axis)
                   throws IOException
Compatibility mode.

Specified by:
getMaxPosition in interface MultiAxes
Parameters:
axis - String representing the selected axis.
Throws:
IOException

getMaxStep

public int getMaxStep(String axis)
               throws IOException
Description copied from interface: MultiAxes
Returns the maximal steps this axis can travel. Used together with MultiAxes.getMaxPosition(java.lang.String) to estimate the number of steps per position.

Specified by:
getMaxStep in interface MultiAxes
Throws:
IOException

setPosition

public boolean setPosition(int pos)
                    throws IOException
Sets the wheel in one of the 6 configured position.

Specified by:
setPosition in interface Positioning
Parameters:
pos - Integer (0 - 5) specifying the wheel position.
Returns:
True on success
Throws:
IOException - If driver communication failed.

offset

public boolean offset(int diff)
               throws IOException
Rotates the desired number of steps from the current position, no nulling.

Specified by:
offset in interface Positioning
Throws:
IOException

setZeroPosition

public boolean setZeroPosition()
                        throws IOException
Set the mini wheel in its zero position. The motor is in its zero position when the controller's digital input-1 gets into high state by the motor's output wire.

Specified by:
setZeroPosition in interface Positioning
Returns:
True on success
Throws:
IOException - If driver communication failed.

getPosition

public int getPosition()
Returns the last position attained or MotorController.UNDEFINEDPOSITION.

Specified by:
getPosition in interface Positioning
Returns:
A integer denoting one of the attainable positions.

getMaxPosition

public int getMaxPosition()
Returns the maximumk number of allowed positions.

Specified by:
getMaxPosition in interface Positioning

getControllerParameter

protected double getControllerParameter(String param)
                                 throws IOException,
                                        NullPointerException
Throws:
IOException
NullPointerException

getControllerParameterArray

protected double[] getControllerParameterArray(int[] ipar)
                                        throws IOException,
                                               NullPointerException
Returns the values of all parameters indicated in the list.

Throws:
IOException
NullPointerException

getStepResolution

protected int getStepResolution()
                         throws IOException,
                                NullPointerException
Throws:
IOException
NullPointerException

setControllerParameter

protected void setControllerParameter(String param,
                                      int value)
                               throws IOException,
                                      NullPointerException
Throws:
IOException
NullPointerException

fullTurn

private long fullTurn()
               throws IOException
A method that performs a full turn of the mini wheel.

Throws:
IOException