Skip to content
Snippets Groups Projects
Verified Commit a7b48b59 authored by Michiel Cottaar's avatar Michiel Cottaar
Browse files

Do not add scanner constraints if no scanner is provided

parent b44eab14
No related branches found
No related tags found
No related merge requests found
...@@ -312,7 +312,16 @@ Adds the gradient strength and slew rate constraints from a specific [`Scanner`] ...@@ -312,7 +312,16 @@ Adds the gradient strength and slew rate constraints from a specific [`Scanner`]
This is applied iteratively to each part of a `Sequence`. This is applied iteratively to each part of a `Sequence`.
""" """
scanner_constraints!(building_block::BuildingBlock) = scanner_constraints!(building_block, global_scanner()) function scanner_constraints!(building_block::BuildingBlock)
try
scanner_constraints!(building_block, global_scanner())
catch e
if occursin("No valid scanner", e.msg)
return
end
rethrow()
end
end
function scanner_constraints!(building_block::BuildingBlock, scanner::Scanner) function scanner_constraints!(building_block::BuildingBlock, scanner::Scanner)
for func in [gradient_strength, slew_rate] for func in [gradient_strength, slew_rate]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment