Skip to content

Commit cb84bdc

Browse files
feat: allow namespacing statemachine equations
1 parent 95f9fdd commit cb84bdc

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

src/systems/abstractsystem.jl

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1207,6 +1207,26 @@ function namespace_expr(
12071207
O
12081208
end
12091209
end
1210+
1211+
function namespace_expr(
1212+
O::Transition, sys, n = nameof(sys); ivs = independent_variables(sys))
1213+
return Transition(
1214+
O.from === nothing ? O.from : renamespace(sys, O.from),
1215+
O.to === nothing ? O.to : renamespace(sys, O.to),
1216+
O.cond === nothing ? O.cond : namespace_expr(O.cond, sys),
1217+
O.immediate, O.reset, O.synchronize, O.priority
1218+
)
1219+
end
1220+
1221+
function namespace_expr(
1222+
O::InitialState, sys, n = nameof(sys); ivs = independent_variables(sys))
1223+
return InitialState(O.s === nothing ? O.s : renamespace(sys, O.s))
1224+
end
1225+
1226+
function namespace_expr(O::StateMachineOperator, sys, n = nameof(sys); kwargs...)
1227+
error("Unhandled state machine operator")
1228+
end
1229+
12101230
_nonum(@nospecialize x) = x isa Num ? x.val : x
12111231

12121232
"""

0 commit comments

Comments
 (0)