@@ -4,6 +4,7 @@ struct SampleTime <: Operator
4
4
SampleTime () = SymbolicUtils. term (SampleTime, type = Real)
5
5
end
6
6
SymbolicUtils. promote_symtype (:: Type{<:SampleTime} , t... ) = Real
7
+ Base. nameof (:: SampleTime ) = :SampleTime
7
8
8
9
# Shift
9
10
@@ -32,6 +33,8 @@ struct Shift <: Operator
32
33
end
33
34
Shift (steps:: Int ) = new (nothing , steps)
34
35
normalize_to_differential (s:: Shift ) = Differential (s. t)^ s. steps
36
+ Base. nameof (:: Shift ) = :Shift
37
+
35
38
function (D:: Shift )(x, allow_zero = false )
36
39
! allow_zero && D. steps == 0 && return x
37
40
Term {symtype(x)} (D, Any[x])
@@ -108,6 +111,7 @@ Sample(x) = Sample()(x)
108
111
(D:: Sample )(x) = Term {symtype(x)} (D, Any[x])
109
112
(D:: Sample )(x:: Num ) = Num (D (value (x)))
110
113
SymbolicUtils. promote_symtype (:: Sample , x) = x
114
+ Base. nameof (:: Sample ) = :Sample
111
115
112
116
Base. show (io:: IO , D:: Sample ) = print (io, " Sample(" , D. clock, " )" )
113
117
137
141
(D:: Hold )(x) = Term {symtype(x)} (D, Any[x])
138
142
(D:: Hold )(x:: Num ) = Num (D (value (x)))
139
143
SymbolicUtils. promote_symtype (:: Hold , x) = x
144
+ Base. nameof (:: Hold ) = :Hold
140
145
141
146
Hold (x) = Hold ()(x)
142
147
0 commit comments