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

Fix function/type names

parent d5244ee3
No related branches found
No related tags found
No related merge requests found
......@@ -2,8 +2,8 @@ module Sequences
import StaticArrays: SVector
import JuMP: @constraint
import ...Variables: get_free_variable, TR, VariableType
import ...BuildingBlocks: WaitBlock, BuildingBlock
import ...BuildSequences: get_global_model
import ...AllBuildingBlocks: Wait, BuildingBlock
import ...BuildSequences: global_model
import ...Components: EventComponent
import ..BaseSequences: ContainerBlock, BaseSequence, nrepeat
......@@ -29,7 +29,7 @@ function Sequence(blocks::AbstractVector; TR=:min, nrepeat=0)
end
res = sequence(SVector{length(blocks)}(to_block.(blocks)), get_free_variable(TR), nrepeat)
if !(res.TR isa Number) || !(duration(res) isa Number)
@constraint get_global_model() res.TR >= duration(res)
@constraint global_model() res.TR >= duration(res)
end
end
......@@ -41,13 +41,13 @@ Base.getindex(s::Sequence, i::Integer) = s.blocks[i]
to_block(block_like)
Converst object into something that can be included in the sequence:
- :min/:max/number/variable/nothing => [`WaitBlock`](@ref).
- :min/:max/number/variable/nothing => [`Wait`](@ref).
- `building_block` or `sequence` => no change.
- RF pulse/readout => will be embedded within a [`BuildingBlock`](@ref).
"""
to_block(cb::ContainerBlock) = cb
to_block(s::Symbol) = to_block(Val(s))
to_block(s::Union{VariableType, Nothing, Val{:min}, Val{:max}}) = WaitBlock(s)
to_block(s::Union{VariableType, Nothing, Val{:min}, Val{:max}}) = Wait(s)
to_block(ec::EventComponent) = BuildingBlock([], [(0, ec)]; duration=duration(ec))
......
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