From 7cd8d060fa68f7c9079f05a2a55ad4d490719f58 Mon Sep 17 00:00:00 2001
From: Michiel Cottaar <michiel.cottaar@ndcn.ox.ac.uk>
Date: Mon, 12 Feb 2024 10:24:46 +0000
Subject: [PATCH] Fix creation of empty GenericOverlapping

---
 src/overlapping/generic.jl | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/overlapping/generic.jl b/src/overlapping/generic.jl
index 3ef5add..27bba0e 100644
--- a/src/overlapping/generic.jl
+++ b/src/overlapping/generic.jl
@@ -1,6 +1,6 @@
 module Generic
 import ..Abstract: AbstractOverlapping, interruptions, duration, waveform_sequence
-import ...Variables: VariableType
+import ...Variables: VariableType, duration
 import ...Wait: WaitBlock
 import ...Readouts: InstantReadout, ADC
 import ...Pulses: RFPulseBlock
@@ -21,7 +21,7 @@ struct GenericOverlapping <: AbstractOverlapping
     duration :: VariableType
     waveform :: Vector{Union{WaitBlock, GradientBlock}}
     interruptions :: Vector{NamedTuple{(:index, :time, :object), Tuple{Int64, <:VariableType, <:Union{RFPulseBlock, InstantReadout, ADC}}}}
-    function GenericOverlapping(duration::VariableType, waveform::AbstractVector{<:Union{WaitBlock, GradientBlock}}, interruptions::AbstractVector=[])
+    function GenericOverlapping(duration::VariableType, waveform::AbstractVector, interruptions::AbstractVector=[])
         res = new(duration, waveform, interruptions)
         scanner_constraints!.(waveform)
         return res
@@ -39,7 +39,8 @@ make_generic(ao::AbstractOverlapping) = GenericOverlapping(
 
 waveform_sequence(go::GenericOverlapping) = go.waveform
 interruptions(go::GenericOverlapping) = go.interruptions
+duration(go::GenericOverlapping) = go.duration
 
-make_generic(wait::WaitBlock) = GenericOverlapping(wait.duration, [], [])
+make_generic(wait::WaitBlock) = GenericOverlapping(duration(wait), [], [])
 
 end
\ No newline at end of file
-- 
GitLab