Skip to content
Snippets Groups Projects
Verified Commit ae99052c authored by Michiel Cottaar's avatar Michiel Cottaar
Browse files

Allow meaningless variables in SingleReadout

parent d682a330
No related branches found
No related tags found
No related merge requests found
...@@ -12,6 +12,18 @@ Represents an instantaneous `Readout` of the signal. ...@@ -12,6 +12,18 @@ Represents an instantaneous `Readout` of the signal.
It has no parameters or variables to set. It has no parameters or variables to set.
""" """
struct SingleReadout <: ReadoutComponent struct SingleReadout <: ReadoutComponent
SingleReadout(s::Symbol) = new()
end
function SingleReadout(; duration=nothing, kwargs...)
bad_keys = [key for (key, value) in pairs(kwargs) if !(isnothing(value) || (value isa Union{AbstractArray, Tuple} && all(isnothing.(value))))]
if length(bad_keys) > 0
error("SingleReadout does not expect any variables, yet it received $bad_keys.")
end
if !(duration in (nothing, :min, :max, 0, 0.))
error("SingleReadout did not expect a value for duration, yet received $duration.")
end
return SingleReadout(:prevent_loop)
end end
duration(::SingleReadout) = 0. duration(::SingleReadout) = 0.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment