Skip to content
Snippets Groups Projects
Unverified Commit 254ac18e authored by Michiel Cottaar's avatar Michiel Cottaar
Browse files

Add missing `variables.`

parent 20673cc1
No related branches found
No related tags found
1 merge request!2Define variables through new @defvar macro
...@@ -107,11 +107,11 @@ function waveform(bb::BaseBuildingBlock) ...@@ -107,11 +107,11 @@ function waveform(bb::BaseBuildingBlock)
@assert all(abs.(prev_grad) .<= 1e-12) "$(typeof(bb)) inserts NoGradient before the gradient is zero. This is probably caused by an improper implementation of this BuildingBlock." @assert all(abs.(prev_grad) .<= 1e-12) "$(typeof(bb)) inserts NoGradient before the gradient is zero. This is probably caused by an improper implementation of this BuildingBlock."
push!(result, (new_time, prev_grad)) push!(result, (new_time, prev_grad))
elseif block isa ConstantGradient elseif block isa ConstantGradient
@assert all(isapprox.(gradient_strength(block), prev_grad, atol=tol, rtol=tol)) "$(typeof(bb)) inserts ConstantGradient that does not match previous gradient strength. This is probably caused by an improper implementation of this BuildingBlock." @assert all(isapprox.(variables.gradient_strength(block), prev_grad, atol=tol, rtol=tol)) "$(typeof(bb)) inserts ConstantGradient that does not match previous gradient strength. This is probably caused by an improper implementation of this BuildingBlock."
push!(result, (new_time, prev_grad)) push!(result, (new_time, prev_grad))
elseif block isa ChangingGradient elseif block isa ChangingGradient
@assert all(isapprox.(block.gradient_strength_start, prev_grad, atol=tol, rtol=tol)) "$(typeof(bb)) inserts ChangingGradient that does not match previous gradient strength. This is probably caused by an improper implementation of this BuildingBlock." @assert all(isapprox.(block.gradient_strength_start, prev_grad, atol=tol, rtol=tol)) "$(typeof(bb)) inserts ChangingGradient that does not match previous gradient strength. This is probably caused by an improper implementation of this BuildingBlock."
push!(result, (new_time, prev_grad .+ slew_rate(block) .* duration(block))) push!(result, (new_time, prev_grad .+ variables.slew_rate(block) .* variables.duration(block)))
else else
error("Unrecognised block type in BuildingBlock: $(typeof(bb)).") error("Unrecognised block type in BuildingBlock: $(typeof(bb)).")
end end
......
...@@ -103,7 +103,7 @@ struct SequenceDiagram ...@@ -103,7 +103,7 @@ struct SequenceDiagram
end end
function SequenceDiagram(actual_duration; kwargs...) function SequenceDiagram(actual_duration; kwargs...)
durations = duration.([values(kwargs)...]) durations = duration_line.([values(kwargs)...])
@assert all(isapprox.(actual_duration, durations, rtol=1e-3)) @assert all(isapprox.(actual_duration, durations, rtol=1e-3))
res = SinglePlotLine[] res = SinglePlotLine[]
for symbol in (:RFx, :RFy, :G, :Gx, :Gy, :Gz, :ADC) for symbol in (:RFx, :RFy, :G, :Gx, :Gy, :Gz, :ADC)
......
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