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

Fix start_time for both event and gradient waveform

parent 197d83dd
No related branches found
No related tags found
No related merge requests found
......@@ -112,14 +112,16 @@ equal_key(i1, i2) = i1 == i2
function start_time(building_block::BaseBuildingBlock, index)
time = 0.
prev_time = 0.
for key in keys(building_block)
if equal_key(key, index)
return time
end
component = building_block[key]
if component isa GradientWaveform
prev_time = time
time += duration(component)
end
if equal_key(key, index)
return prev_time
end
end
error("Building block with index '$index' not found")
end
......@@ -219,7 +221,6 @@ function edge_times(bb::BaseBuildingBlock)
for key in keys(bb)
object = bb[key]
if object isa Union{GradientWaveform, RFPulseComponent, InstantGradient}
@show key start_time(bb, key) end_time(bb, key)
push!(res, start_time(bb, key))
push!(res, end_time(bb, key))
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