diff --git a/src/components/readouts/single_readouts.jl b/src/components/readouts/single_readouts.jl index ee720375f41c546a3b166d8d2d615e9750db3273..c814763d3fa89bed7f2ee7f6242cfffd0058135c 100644 --- a/src/components/readouts/single_readouts.jl +++ b/src/components/readouts/single_readouts.jl @@ -12,6 +12,18 @@ Represents an instantaneous `Readout` of the signal. It has no parameters or variables to set. """ 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 duration(::SingleReadout) = 0.