From 92a3604d6f18197ff82d9c56accba3e212f548d5 Mon Sep 17 00:00:00 2001
From: Michiel Cottaar <michiel.cottaar@ndcn.ox.ac.uk>
Date: Mon, 12 Feb 2024 10:14:03 +0000
Subject: [PATCH] Turn WaitBlock into another GenericOverlapping

---
 src/building_blocks.jl     | 2 +-
 src/overlapping/generic.jl | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/building_blocks.jl b/src/building_blocks.jl
index 7622987..4b753da 100644
--- a/src/building_blocks.jl
+++ b/src/building_blocks.jl
@@ -295,6 +295,6 @@ Replaces a [`BuildingBlock`](@ref) or whole sequence with a generic version.
 
 This replaces all functional RF pulses and gradient waveforms with their generic equivalents.
 """
-make_generic(grad::GradientBlock) = grad
+function make_generic end
 
 end
\ No newline at end of file
diff --git a/src/overlapping/generic.jl b/src/overlapping/generic.jl
index 92a3ebb..3ef5add 100644
--- a/src/overlapping/generic.jl
+++ b/src/overlapping/generic.jl
@@ -33,12 +33,13 @@ GenericOverlapping(other_waveform::AbstractOverlapping) = GenericOverlapping(dur
 
 make_generic(ao::AbstractOverlapping) = GenericOverlapping(
     duration(ao), 
-    make_generic.(waveform_sequence(ao)), 
+    waveform_sequence(ao), 
     [(index=i.index, time=i.time, object=make_generic(i.object)) for i in interruptions(ao)]
 )
 
 waveform_sequence(go::GenericOverlapping) = go.waveform
 interruptions(go::GenericOverlapping) = go.interruptions
 
+make_generic(wait::WaitBlock) = GenericOverlapping(wait.duration, [], [])
 
 end
\ No newline at end of file
-- 
GitLab