Package dics :: Module mechanism :: Class mechanism
[hide private]
[frames] | no frames]

Class mechanism
source code

Known Subclasses:
filterwheel.filterwheel, linear.linear, wheel.wheel

Base clase for instrument mechanisms. Stores mechanism status information and provides methods corresponding to basic mechanism actions which dispacth the appropriate sequence of commands to a cortex instance.

Instance Methods [hide private]
  __init__(self, cortex, icu_num, axis_num, base_speed, max_speed, acceleration, deceleration, position, name='mechanism')
Initialiser for mechanism class.
  getMotorParams(self)
Returns a tuple of the four motor motion parameters, baseSpeed, maxSpeed, acceleration, deceleration.
  getPosition(self)
Returns the current motor position.
  moveBy(self, steps, blocking=True)
Initiates a movement of the mechanism by a given number of steps.
  moveTo(self, new_position, blocking=True)
  setMotorParams(self, baseSpeed, maxSpeed, acceleration, deceleration)
Sets the four motor motion parameters, baseSpeed, maxSpeed, acceleration and deceleration.
  setPosition(self, new_position=0)
Defines the current mechanism position to be equal to the single integer argument.
  updateConfig(self, config)
Should be called by the parent instrument object's destructor to enable status information to be saved to file on exit.

Method Details [hide private]

__init__(self, cortex, icu_num, axis_num, base_speed, max_speed, acceleration, deceleration, position, name='mechanism')
(Constructor)

source code 

Initialiser for mechanism class.

Arguments:
    cortex:      The cortex based ICU daisy chain instance that this
                 mechanism is a part of.
    icuNum:      Which ICU in the chain this mechanism is connected
                 to.
    axisNum:     Which axis of the ICU the mechansism is connected
                 to.
    baseSpeed:   Starting speed (steps/half steps per sec?)
    maxSpeed:    Peak speed (steps/half steps per sec?)
    acceleration:Acceleration (steps/half steps per sec^2?)
    deceleration:Deceleration (steps/half steps per sec^2?)
    position:    Initial position of the mechanism (steps)
    name:        Label used for logging purposes.

getMotorParams(self)

source code 
Returns a tuple of the four motor motion parameters, baseSpeed, maxSpeed, acceleration, deceleration.

getPosition(self)

source code 
Returns the current motor position.

moveBy(self, steps, blocking=True)

source code 
Initiates a movement of the mechanism by a given number of steps. Second, optional, boolean argument specifies whether the call should block until the movement has been completed or return immediately (default is True).

moveTo(self, new_position, blocking=True)

source code 

setMotorParams(self, baseSpeed, maxSpeed, acceleration, deceleration)

source code 
Sets the four motor motion parameters, baseSpeed, maxSpeed, acceleration and deceleration. Takes 4 integer arguments.

setPosition(self, new_position=0)

source code 
Defines the current mechanism position to be equal to the single integer argument. If no argument is given, the mechanism position is zeroed.

updateConfig(self, config)

source code 

Should be called by the parent instrument object's destructor to enable status information to be saved to file on exit.

Takes a ConfigParserRT.SafeConfigParser object as argument.