Skip to content

Commit

Permalink
feat: add clock phase
Browse files Browse the repository at this point in the history
Co-authored-by: Fredrik Bagge Carlson <[email protected]>
  • Loading branch information
AayushSabharwal and baggepinnen committed Jul 2, 2024
1 parent f0fe494 commit 1afed50
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/clock.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ using Expronicon.ADT: @adt, @match
Continuous
struct PeriodicClock
dt::Union{Nothing, Float64, Rational{Int}}
phase::Float64 = 0.0
end
SolverStepClock
end
Expand All @@ -25,9 +26,9 @@ using .Clocks
The default periodic clock with tick interval `dt`. If `dt` is left unspecified, it will
be inferred (if possible).
"""
Clock(dt::Union{<:Rational, Float64}) = PeriodicClock(dt)
Clock(dt) = PeriodicClock(convert(Float64, dt))
Clock() = PeriodicClock(nothing)
Clock(dt::Union{<:Rational, Float64}; phase = 0.0) = PeriodicClock(dt, phase)
Clock(dt; phase = 0.0) = PeriodicClock(convert(Float64, dt), phase)
Clock(; phase = 0.0) = PeriodicClock(nothing, phase)

@doc """
SolverStepClock
Expand Down

0 comments on commit 1afed50

Please sign in to comment.