Commit 7d790364 authored by Éric Thiébaut's avatar Éric Thiébaut
Browse files

Modify assumed API for deformable mirrors (work in progress)

parent 536a8adf
......@@ -26,23 +26,49 @@ export
using ..Tao
using ..Tao: indexed_layout
import ..Tao: send!, reference, set_reference!, device, layout
import ..Tao:
reset, send, send!, reference, set_reference!, device, layout,
floating_point_type
using Base: throw_boundserror, @propagate_inbounds
import Base: getindex, setindex!, checkbounds, flush, reset
import Base: getindex, setindex!, checkbounds, flush
import Sockets: send
using Statistics
using Statistics # FIXME: it is provided by Tao?
"""
Tao.AbstractDeformableMirror{T}
AbstractDeformableMirror{T}
is the abstract super-type of deformable mirror types. Parameter `T` is the
element type of the actuators commands.
The available methods for a deformable mirror `dm` are:
- `send(dm, cmd, mrk, tm=Inf)` sends the set of commands `cmd` (relative to the
reference), with a mark `mrk` and an optional timeout `tm`;
- `reset(dm, tm=Inf)` resets the deformable mirror as if null commands have
been sent;
is the abstract super-type of deformable mirror types, parameter `T` is the
element type of the actuator commands.
- `minimum(dm)`, `maximum(dm)`, and `extrema(dm)` yield the minimum, maximum,
and extreme values of an actuator command;
- `length(dm)` yields the number of actuators;
- `size(dm)` yields the dimensions of the grid of actuators;
- `layout(dm)` yields the layout of the actuators;
- `floating_point_type(dm)` yields the floating-point type of the actuators
commands.
"""
abstract type AbstractDeformableMirror{T} end
abstract type AbstractDeformableMirror{T<:AbstractFloat} end
Base.extrema(dm::AbstractDeformableMirror) = (minimum(dm), maximum(dm))
floating_point_type(dm::AbstractDeformableMirror) =
floating_point_type(typeof(dm))
floating_point_type(::Type{<:AbstractDeformableMirror{T}}) where {T} = T
# Fake deformable mirror for testing.
struct FakeDeformableMirrorDevice{T<:AbstractFloat}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment