Photomechanics API
IRotationProvider Interface Reference

Provides basic turn table functions. More...

Inheritance diagram for IRotationProvider:
[legend]

Public Member Functions

Task CancelRotation ()
 Cancel currently running rotation. More...
 
Task< Int32 > GetStepsPerRound ()
 Get steps per round. More...
 
Task RotateDegrees (Double degrees)
 Rotate fixed angle. More...
 
Task RotateSteps (Int32 steps)
 Rotate given amount of steps. More...
 
Task RotateInfinite (Boolean clockwise)
 Rotate until canceled. More...
 
Task< ITurntableCommandStartRotateDegreesCommand (Double degrees)
 Same as RotateDegrees but returns TurntableCommandBase object instead of task. Use if you need to await entering TurntableCommandStatus.Processing state and finishing rotation separately.
 
Task< ITurntableCommandStartRotateStepsCommand (Int32 steps)
 Same as RotateSteps but returns TurntableCommandBase object instead of task. Use if you need to await entering TurntableCommandStatus.Processing state and finishing rotation separately.
 
Task< ITurntableCommandStartRotateInfiniteCommand (Boolean clockwise)
 Same as RotateInfinite but returns TurntableCommandBase object instead of task. Use if you need to await entering TurntableCommandStatus.Processing state and finishing rotation separately.
 
Task< ITurntableCommandStartCancelRotationCommand ()
 Same as CancelRotation but returns TurntableCommandBase object instead of task. Use if you need to await entering TurntableCommandStatus.Processing state and finishing cancel rotation command separately.
 
Task SetTargetSpeed (Double degreesPerSecond)
 Set maximal rotation speed. More...
 
Task< Double > GetMaxAllowedSpeed ()
 Get maximal speed allowed by turn table. More...
 
Task< Double > GetMaxAcceleration ()
 Get maximal acceleration supported by turntable. More...
 
Task< Double > GetInitialSpeed ()
 Get initial rotation speed. More...
 
void OverrideStepsPerRound (Int32 newStepsPerRound)
 Override default steps per round with user provided value. More...
 
void DisableStepsPerRoundOverride ()
 Revert value set by OverrideStepsPerRound.
 

Detailed Description

Provides basic turn table functions.

Member Function Documentation

◆ CancelRotation()

Task IRotationProvider.CancelRotation ( )

Cancel currently running rotation.

Exceptions
TurntableOperationFailedExceptionThrown when turn table returns fail result of operation.

◆ GetStepsPerRound()

Task< Int32 > IRotationProvider.GetStepsPerRound ( )

Get steps per round.

Used by methods that are working with degrees for correct conversion.

◆ RotateDegrees()

Task IRotationProvider.RotateDegrees ( Double  degrees)

Rotate fixed angle.

Due to the fact that most turntables use stepper motor steps instead of degrees, small rounding error might occur. Use RotateSteps with custom rounding error compensation logic to avoid error accumulation.

Parameters
degreesAmount of degrees to rotate.
Exceptions
TurntableOperationFailedExceptionThrown when turn table returns fail result of operation.

◆ RotateSteps()

Task IRotationProvider.RotateSteps ( Int32  steps)

Rotate given amount of steps.

Useful when maximal rotation accuracy is needed and degrees-steps conversion rounding error is not acceptable. For example, to rotate 360 degrees by making 36 turns 10 degree each and return exact same location.

Parameters
stepsSteps to rotate.
Exceptions
TurntableOperationFailedExceptionThrown when turn table returns fail result of operation.

◆ RotateInfinite()

Task IRotationProvider.RotateInfinite ( Boolean  clockwise)

Rotate until canceled.

Parameters
clockwiseRotation direction.
Exceptions
TurntableOperationFailedExceptionThrown when turn table returns fail result of operation.

◆ SetTargetSpeed()

Task IRotationProvider.SetTargetSpeed ( Double  degreesPerSecond)

Set maximal rotation speed.

Parameters
degreesPerSecondSpeed value in degrees per second.
Exceptions
TurntableOperationFailedExceptionThrown when turn table returns fail result of operation.

◆ GetMaxAllowedSpeed()

Task< Double > IRotationProvider.GetMaxAllowedSpeed ( )

Get maximal speed allowed by turn table.

Exceptions
TurntableOperationFailedExceptionThrown when turn table returns fail result of operation.

◆ GetMaxAcceleration()

Task< Double > IRotationProvider.GetMaxAcceleration ( )

Get maximal acceleration supported by turntable.

Usually acceleration is unlimited, but for trapezoidal acceleration profile it makes sense to use a=v and for S-Curve go slightly higher.

Exceptions
TurntableOperationFailedExceptionThrown when turn table returns fail result of operation.

◆ GetInitialSpeed()

Task< Double > IRotationProvider.GetInitialSpeed ( )

Get initial rotation speed.

Exceptions
TurntableOperationFailedExceptionThrown when turn table returns fail result of operation.

◆ OverrideStepsPerRound()

void IRotationProvider.OverrideStepsPerRound ( Int32  newStepsPerRound)

Override default steps per round with user provided value.

All new firmwares can send their steps per round and speed restrictions, so this should not be used. However, turntables with legacy firmware usually can't do that and user may need to provide this value manually using this method.