csys: remove obsolete code
This commit is contained in:
parent
7dd2b1e137
commit
cdff646437
1 changed files with 4 additions and 12 deletions
|
|
@ -20,7 +20,7 @@ defmodule Scopes.CSys.Program do
|
|||
end
|
||||
|
||||
def get_proc(state) do
|
||||
get_proc(elem(state.prog, 0), state.stage)
|
||||
get_proc(state.prog, state.stage)
|
||||
end
|
||||
|
||||
defp get_proc(stages, stage) do
|
||||
|
|
@ -31,18 +31,11 @@ defmodule Scopes.CSys.Program do
|
|||
|
||||
def basic_prog(args) do
|
||||
default = basic_active(args)
|
||||
stages = %{
|
||||
default: default,
|
||||
%{default: default,
|
||||
initial: basic_initial(args),
|
||||
active: default,
|
||||
retired: default
|
||||
}
|
||||
transitions = %{
|
||||
restart: :initial,
|
||||
retire: :retired,
|
||||
next: [initial: :active, active: :retired]
|
||||
}
|
||||
{stages, transitions}
|
||||
end
|
||||
|
||||
def prepare_basic(args \\ []) do
|
||||
|
|
@ -67,8 +60,7 @@ defmodule Scopes.CSys.Program do
|
|||
[:csys, :connect | _rest] -> CSys.connect(msg, scope)
|
||||
[:csys, :create, :succ | _rest] -> create_succ(msg, scope)
|
||||
[:csys, :create, :pred | _rest] -> create_pred(msg, scope)
|
||||
#[:csys, :next | _rest] -> next(scope, meta)
|
||||
#[:csys, action | rest] -> transition(action, scope)
|
||||
#[:csys, :next | _rest] -> next(msg, scope)
|
||||
_ -> CSys.forward(msg, scope) || CSys.notify(msg, scope)
|
||||
end
|
||||
end
|
||||
|
|
@ -82,7 +74,7 @@ defmodule Scopes.CSys.Program do
|
|||
limit = args[:limit]
|
||||
data = Shape.data(msg)
|
||||
state = CSys.state(scope)
|
||||
Logger.info data: data, state_value: state.value, threshold: threshold
|
||||
Logger.info data: data, state_value: state.value, threshold: threshold, self: self()
|
||||
value_n = state.value + data.value
|
||||
if value_n >= threshold do
|
||||
value_out = limit && rem(value_n - 1, limit) + limit || value_n
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue