From 2e33c5c7d78e33aa6f8e4b471a8c3afb19bb7f0d Mon Sep 17 00:00:00 2001
From: Michiel Cottaar <MichielCottaar@protonmail.com>
Date: Sat, 25 May 2024 15:34:14 +0100
Subject: [PATCH] Import get_* functions

---
 src/parts/trapezoids.jl | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/parts/trapezoids.jl b/src/parts/trapezoids.jl
index 7fc7aa6..aa32bf9 100644
--- a/src/parts/trapezoids.jl
+++ b/src/parts/trapezoids.jl
@@ -6,7 +6,7 @@ module Trapezoids
 import JuMP: @constraint
 import StaticArrays: SVector
 import LinearAlgebra: norm
-import ...Variables: variables, @defvar, scanner_constraints!, get_free_variable, set_simple_constraints!, gradient_orientation, VariableType
+import ...Variables: variables, @defvar, scanner_constraints!, get_free_variable, set_simple_constraints!, gradient_orientation, VariableType, get_gradient, get_pulse, get_readout
 import ...BuildSequences: global_model
 import ...Components: ChangingGradient, ConstantGradient, RFPulseComponent, ADC
 import ...Containers: BaseBuildingBlock
@@ -106,18 +106,19 @@ gradient_orientation(pg::Trapezoid{1}) = pg.orientation
 get_group(pg::Trapezoid) = pg.group
 get_group(pg::BaseTrapezoid) = get_group(get_gradient(pg))
 
-@defvar begin
+@defvar gradient begin
     rise_time(pg::Trapezoid) = pg.rise_time
     flat_time(pg::Trapezoid) = pg.flat_time
     slew_rate(g::Trapezoid) = g.slew_rate
 end
 
-@defvar begin
+@defvar gradient begin
     gradient_strength(g::Trapezoid) = slew_rate(g) .* rise_time(g)
     δ(g::Trapezoid) = rise_time(g) + flat_time(g)
-    duration(g::BaseTrapezoid) = 2 * rise_time(g) + flat_time(g)
 end
 
+@defvar duration(g::BaseTrapezoid) = 2 * rise_time(g) + flat_time(g)
+
 @defvar qval(g::BaseTrapezoid, ::Nothing, ::Nothing) = variables.δ(g) .* gradient_strength(g) .* 2π
 
 adjustable(::BaseTrapezoid) = :gradient
-- 
GitLab