Endorphin.Instrument.Twickenham.MagnetController


FieldTarget

Namespace: Endorphin.Instrument.Twickenham.MagnetController

Functions related to ramping a magnet controller to a specified field target.

Nested types and modules

TypeDescription
FieldTarget

Defines a magnetic field target which is associated with a magnet controller. This is created after the connection to the magnet controller has been established.

FieldTargetHandle

Represents a handle to a magnetic field target to which a magnet controller has been set to ramp. This can be used to wait for the field target to be reached.

FieldTargetParameers

Defines the parameters for a target magnetic field.

FieldTargetResult

Contains the result of ramping a magnet controller to a target magnetic field indicating whether the target was reached successfully, failed or was cancelled.

FieldTargetStatus

Indicates progress as a magnet controller ramps towards a target magnetic field.

ModuleDescription
Parameters

Functions for specifying magnetic field target parameters.

Functions and values

Function or valueDescription
create magnetController parameters
Signature: magnetController:MagnetController -> parameters:FieldTargetParameers -> FieldTarget

Creates a magnetic field target for the given magnet controller with the specified parameters.

go target
Signature: target:FieldTarget -> FieldTargetHandle

Ramps to a magnetic field target with the default cancellation token. If the ability to abort the ramp with a cancellation token is required then use goWithCancellationToken instead. Returns a handle which can be used to wait for the target to be reached asynchronously.

goAsChild target
Signature: target:FieldTarget -> Async<FieldTargetHandle>

Ramps to a magnetic field target as a child (sharing the same cancellation token) to the current asynchronous workflow. If the token is cancelled, then the ramp will be aborted and the magnet controller will be left in a paused state. To ensure that the ramp is stopped cleanly, no other cancellation compensations should be registered with this cancellation token which will post commands to the magnet controlller. Returns a handle which can be used to wait for the target to be reached asynchronously.

goWithCancellationToken (...)
Signature: target:FieldTarget -> cancellationToken:CancellationToken -> FieldTargetHandle

Ramps to a magnetic field target with the given cancellation token. If the token is cancelled, then the ramp will be aborted and the magnet controller will be left in a paused state. To ensure that the ramp is stopped cleanly, no other cancellation compensations should be registered with this cancellation token which will post commands to the magnet controlller. Returns a handle which can be used to wait for the target to be reached asynchronously.

status target
Signature: target:FieldTarget -> IObservable<FieldTargetStatus>

Returns an observable which fires when the magnetic field target status changes.

waitToFinish targetHandle
Signature: targetHandle:FieldTargetHandle -> Async<FieldTargetResult>

Asynchronously waits for the magnetic field target workflow associated with the handle to complete with success, failure or cancellation.

Fork me on GitHub