From 47b0a13724852b2a1035d425ebea547e9588ee79 Mon Sep 17 00:00:00 2001
From: Michiel Cottaar <michiel.cottaar@ndcn.ox.ac.uk>
Date: Fri, 16 Feb 2024 13:57:05 +0000
Subject: [PATCH] Fix constraint notation

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

diff --git a/src/all_building_blocks/spoilt_slice_selects.jl b/src/all_building_blocks/spoilt_slice_selects.jl
index 7345b8d..c07d073 100644
--- a/src/all_building_blocks/spoilt_slice_selects.jl
+++ b/src/all_building_blocks/spoilt_slice_selects.jl
@@ -70,9 +70,9 @@ function SpoiltSliceSelect(pulse::RFPulseComponent; orientation=[0, 0, 1], group
         for time_var in (res.rise_time1, res.flat_time1, res.diff_time, res.flat_time2, res.fall_time2)
             @constraint model time_var >= 0
         end
-        #@constraint model res.diff_time <= res.rise_time1
-        #@constraint model res.diff_time <= res.fall_time2
-        #@constraint model qval(res, nothing, 1) == qval(res, 1, nothing)
+        @constraint model res.diff_time <= res.rise_time1
+        @constraint model res.diff_time <= res.fall_time2
+        @constraint model qval(res, nothing, :pulse) == qval(res, :pulse, nothing)
     end
 
     if !isnothing(spoiler_scale)
@@ -81,7 +81,7 @@ function SpoiltSliceSelect(pulse::RFPulseComponent; orientation=[0, 0, 1], group
         elseif spoiler_scale == :max
             @objective model Min objective_function(model) + qval(res, nothing, 1)
         else
-            @constraint model qval(res, nothing, 1) >= 2Ï€ * 1e-3 / spoiler_scale
+            @constraint model qval(res, nothing, :pulse) >= 2Ï€ * 1e-3 / spoiler_scale
         end
     end
     set_simple_constraints!(res, kwargs)
-- 
GitLab