
public final class BladeSetSimulator extends Object implements BladeSet
At present the simulation doesn't yet use any configuration data and so calculates only relative blade set positions for both the motor samples and the Hall transitions. The motor simulation calculates position samples at intervals of roughly 50 milliseconds.
Thread publication policy: shared, thread-safe. Instances can be accessed safely through the public interface by multiple threads.
| Constructor and Description |
|---|
BladeSetSimulator(ShutterSide side,
BladeSetConfiguration config,
ShutterConfiguration shutterConfig,
List<HallConfiguration> hallConfigs)
Sets the index and initial relative position of the blade set.
|
| Modifier and Type | Method and Description |
|---|---|
double |
absoluteToEncoder(double absolute)
The inverse of
BladeSet.encoderToAbsolute(double). |
double |
absoluteToRelative(double abs)
Converts an absolute position along the camera X axis to a relative
blade set position in the range [0.0, 1.0], where 0.0 means fully retracted
(open) and 1.0 means fully extended (closed).
|
double |
encoderToAbsolute(double encoderValue)
Converts a motor position encoder value to an absolute position in mm of the leading
edge of the blade set on the camera X axis.
|
BladeSetConfiguration |
getBladeSetConfiguration()
Gets the (as yet unused) blade set configuration..
|
double |
getRelativePosition()
Gets the current relative position of the edge of the blade set.
|
ShutterSide |
getSide()
Gets the side of the shutter that this object simulates.
|
boolean |
isFullyExtended()
Is the blade set fully extended? That is, is its absolute position within the
shutter tolerance of the closed position?
|
boolean |
isFullyRetracted()
Is the blade set fully retracted? That is, is its absolute position within the
shutter tolerance of the open position?
|
MovementHistory |
moveToPosition(double targetPosition,
double moveTimeSeconds)
Performs a simulated motion of the blade set.
|
double |
relativeToAbsolute(double rel)
The inverse of
BladeSet.absoluteToRelative(double). |
public BladeSetSimulator(ShutterSide side, BladeSetConfiguration config, ShutterConfiguration shutterConfig, List<HallConfiguration> hallConfigs)
side - the side of the shutter this blade set simulatesconfig - the blase-set configurationshutterConfig - the general, side-independent shutter configurationhallConfigs - the Hall sensor configurationspublic BladeSetConfiguration getBladeSetConfiguration()
getBladeSetConfiguration in interface BladeSetUnsupportedOperationException - alwayspublic double getRelativePosition()
getRelativePosition in interface BladeSetBladePositionpublic ShutterSide getSide()
public MovementHistory moveToPosition(double targetPosition, double moveTimeSeconds)
moveToPosition in interface BladeSettargetPosition - The desired final relative position of the blade set's edge.moveTimeSeconds - How long the move should take.After returning the current position will be seen to be targetPosition in any thread.
public double encoderToAbsolute(double encoderValue)
BladeSetencoderToAbsolute in interface BladeSetencoderValue - the value read from the encoder.UnsupportedOperationExceptionpublic double absoluteToEncoder(double absolute)
BladeSetBladeSet.encoderToAbsolute(double).absoluteToEncoder in interface BladeSetabsolute - the absolute position.UnsupportedOperationExceptionpublic double absoluteToRelative(double abs)
BladeSetrelative = (absolute - absoluteOpen) / (absoluteClosed - absoluteOpen).absoluteToRelative in interface BladeSetabs - the absolute position.UnsupportedOperationExceptionBladeSetConfigurationpublic double relativeToAbsolute(double rel)
BladeSetBladeSet.absoluteToRelative(double).relativeToAbsolute in interface BladeSetrel - the relative position.UnsupportedOperationExceptionBladeSetConfigurationpublic boolean isFullyRetracted()
isFullyRetracted in interface BladeSetShutterConfiguration,
BladeSetConfigurationpublic boolean isFullyExtended()
isFullyExtended in interface BladeSetShutterConfiguration,
BladeSetConfigurationCopyright © 2016 LSST. All rights reserved.