From 6c1cdac140b21f408705d3a236272bbe8e3a2c37 Mon Sep 17 00:00:00 2001
From: Michiel Cottaar <michiel.cottaar@ndcn.ox.ac.uk>
Date: Thu, 15 Feb 2024 18:06:57 +0000
Subject: [PATCH] Fix waveform_sequence between events

---
 src/all_building_blocks/base_building_blocks.jl | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/all_building_blocks/base_building_blocks.jl b/src/all_building_blocks/base_building_blocks.jl
index 5b3a318..bf59784 100644
--- a/src/all_building_blocks/base_building_blocks.jl
+++ b/src/all_building_blocks/base_building_blocks.jl
@@ -1,7 +1,7 @@
 module BaseBuildingBlocks
 import ...ContainerBlocks: ContainerBlock
 import ...Components: BaseComponent, GradientWaveform, EventComponent, NoGradient, ChangingGradient, ConstantGradient, split_gradient
-import ...Variables: qval, bmat_gradient
+import ...Variables: qval, bmat_gradient, effective_time
 
 """
 Basic BuildingBlock, which can consist of a gradient waveforms with any number of RF pulses/readouts overlaid
@@ -122,14 +122,14 @@ function waveform_sequence(bb::BaseBuildingBlock, first, last)
         if key == first
             @assert !started
             started = true
-            current_started = effective_time(bb[key])
+            current_start = effective_time(bb[key])
         end
         if key == last
             @assert started
-            if isnothing(current_started)
+            if isnothing(current_start)
                 push!(parts, (current_grad_key, split_gradient(bb[current_grad_key], effective_time(bb[key]))[1]))
             else
-                push!(parts, (current_grad_key, split_gradient(bb[current_grad_key], current_started, effective_time(bb[key]))[2]))
+                push!(parts, (current_grad_key, split_gradient(bb[current_grad_key], current_start, effective_time(bb[key]))[2]))
             end
         end
     end
-- 
GitLab