diff --git a/src/build_sequences.jl b/src/build_sequences.jl index 6115899b44e20ba4eff134d96239f035d3e63bd0..8ae15d65c340943515cc6e45c636cf88a6e425df 100644 --- a/src/build_sequences.jl +++ b/src/build_sequences.jl @@ -228,6 +228,7 @@ It is used internally by [`build_sequence`](@ref). """ fixed(some_value) = some_value fixed(jump_variable::AbstractJuMPScalar) = value(jump_variable) +fixed(jump_variable::GenericVariableRef) = is_integer(jump_variable) ? Int(value(jump_variable)) : value(jump_variable) fixed(jump_variable::AbstractArray) = fixed.(jump_variable) fixed(dict_variable::AbstractDict) = typeof(dict_variable)(k => fixed(v) for (k, v) in pairs(dict_variable)) fixed(tuple_variable::Tuple) = fixed.(tuple_variable) diff --git a/src/components/readouts/ADCs.jl b/src/components/readouts/ADCs.jl index 5e745848ccd0b59dd0f17687f90b7dcbeebee50b..116fe5aac640dba8c164e902520807abc37cd406 100644 --- a/src/components/readouts/ADCs.jl +++ b/src/components/readouts/ADCs.jl @@ -99,17 +99,6 @@ variables.nsamples effective_time(adc::ADC) = variables.time_to_center(adc) end -function fixed(adc::ADC) - # round nsamples during fixing - r = Int(round(value(variables.resolution(adc)), RoundNearest)) - n = Int(round(value(variables.nsamples(adc)), RoundNearest)) - if iszero(n) - return ADC(0, NaN, NaN, NaN) - end - oversample = n // r - return ADC(r, value(adc.dwell_time), value(adc.time_to_center), oversample) -end - make_generic(adc::ADC) = adc end \ No newline at end of file