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

Create constructors with same number of arguments

parent de6cb4c6
No related branches found
No related tags found
No related merge requests found
......@@ -14,6 +14,7 @@ Usually, you do not want to create this object directly, use a `BuildingBlock` i
"""
abstract type ChangingGradient{N} <: GradientWaveform{N} end
(::Type{ChangingGradient})(grad1::VariableType, slew_rate::VariableType, orientation::AbstractVector, duration::VariableType, group=nothing) = ChangingGradient1D(grad1, slew_rate, orientation, duration, group)
(::Type{ChangingGradient})(grad1::AbstractVector, slew_rate::AbstractVector, ::Nothing, duration::VariableType, group=nothing) = ChangingGradient3D(grad1, slew_rate, duration, group)
(::Type{ChangingGradient})(grad1::AbstractVector, slew_rate::AbstractVector, duration::VariableType, group=nothing) = ChangingGradient3D(grad1, slew_rate, duration, group)
struct ChangingGradient1D <: ChangingGradient{1}
......
......@@ -13,7 +13,8 @@ Underlying type for any flat part in a 3D (first constructor) or 3D (second cons
Usually, you do not want to create this object directly, use a `BuildingBlock` instead.
"""
abstract type ConstantGradient{N} <: GradientWaveform{N} end
(::Type{ConstantGradient})(grad1::VariableType, orientation::AbsractVector, duration::VariableType, group=nothing) = ConstantGradient1D(grad1, duration, orientation, group)
(::Type{ConstantGradient})(grad1::VariableType, orientation::AbstractVector, duration::VariableType, group=nothing) = ConstantGradient1D(grad1, duration, orientation, group)
(::Type{ConstantGradient})(grad1::AbstractVector, ::Nothing, duration::VariableType, group=nothing) = ConstantGradient3D(grad1, duration, group)
(::Type{ConstantGradient})(grad1::AbstractVector, duration::VariableType, group=nothing) = ConstantGradient3D(grad1, duration, group)
struct ConstantGradient1D <: ConstantGradient{1}
......
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