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

Fix calculation of waveform for changing block

parent 5b735fb7
No related branches found
No related tags found
No related merge requests found
module Abstract module Abstract
import StaticArrays: SVector
import ...BuildingBlocks: BuildingBlock, ContainerBlock, RFPulseBlock, get_children_indices, VariableNotAvailable import ...BuildingBlocks: BuildingBlock, ContainerBlock, RFPulseBlock, get_children_indices, VariableNotAvailable
import ...Wait: WaitBlock import ...Wait: WaitBlock
import ...Readouts: InstantReadout import ...Readouts: InstantReadout
...@@ -57,7 +58,7 @@ function waveform(ao::AbstractOverlapping) ...@@ -57,7 +58,7 @@ function waveform(ao::AbstractOverlapping)
push!(result, (new_time, prev_grad)) push!(result, (new_time, prev_grad))
elseif block isa ChangingGradientBlock elseif block isa ChangingGradientBlock
@assert all(block.gradient_strength_start . prev_grad) "$(typeof(ao)) inserts ChangingGradientBlock that does not match previous gradient strength. This is probably caused by an improper implementation of this gradient waveform." @assert all(block.gradient_strength_start . prev_grad) "$(typeof(ao)) inserts ChangingGradientBlock that does not match previous gradient strength. This is probably caused by an improper implementation of this gradient waveform."
push!(result, (new_time, prev_grad .+ slew_rate(block))) push!(result, (new_time, prev_grad .+ slew_rate(block) .* duration(block)))
else else
error("Unrecognised block type in gradient waveform: $(typeof(ao)).") error("Unrecognised block type in gradient waveform: $(typeof(ao)).")
end end
......
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