# the FiniteStateMachine provides helperclasses for states and transition each class is a representation of the state- and transition-variabletype
# if the state node already exist for example from xml model you can assign it here aswell as if its a substate this is importent for the change of the state
state1=State(None,"Idle",1)
state1=State("State-Id-1","Idle",1)
# adds the state (StateType) to the statemachine childs - this is mandatory for the FiniteStateMachine!
awaitmystatemachine.add_state(state1,state_type=ua.NodeId(2309,0))#this is a init state -> InitialStateType: ua.NodeId(2309, 0)
state2=State(None,"Loading",2)
state2=State("State-Id-2","Loading",2)
awaitmystatemachine.add_state(state2)
state3=State(None,"Initializing",3)
state3=State("State-Id-3","Initializing",3)
awaitmystatemachine.add_state(state3)
state4=State(None,"Processing",4)
state4=State("State-Id-4","Processing",4)
awaitmystatemachine.add_state(state4)
state5=State(None,"Finished",5)
state5=State("State-Id-5","Finished",5)
awaitmystatemachine.add_state(state5)
# sets the avalible states of the FiniteStateMachine
...
...
@@ -44,16 +44,16 @@ if __name__ == "__main__":
# setup your transition helperclass
# if the transition node already exist for example from xml model you can assign it here
trans1=Transition(None,"to Idle",1)
trans1=Transition("Transition-Id-1","to Idle",1)
# adds the state (TransitionType) to the statemachine childs - this is optional for the FiniteStateMachine
# the StateMachine provides helperclasses for states and transition each class is a representation of the state- and transition-variabletype
# "def __init__(self, name, id=0, node=None):"
# if the state node already exist for example from xml model you can assign it here aswell as if its a substate this is importent for the change of the state
state1=State("S-Id-1","Idle",1)
state1=State("State-Id-1","Idle",1)
# adds the state (StateType) to the statemachine childs - this is optional!
awaitmystatemachine.add_state(state1,state_type=ua.NodeId(2309,0))#this is a init state -> InitialStateType: ua.NodeId(2309, 0)
state2=State("S-Id-2","Loading",2)
state2=State("State-Id-2","Loading",2)
awaitmystatemachine.add_state(state2)
state3=State("S-Id-3","Initializing",3)
state3=State("State-Id-3","Initializing",3)
awaitmystatemachine.add_state(state3)
state4=State("S-Id-4","Processing",4)
state4=State("State-Id-4","Processing",4)
awaitmystatemachine.add_state(state4)
state5=State("S-Id-5","Finished",5)
state5=State("State-Id-5","Finished",5)
awaitmystatemachine.add_state(state5)
# setup your transition helperclass
# "def __init__(self, name, id=0, node=None):"
# if the transition node already exist for example from xml model you can assign it here
trans1=Transition("T-Id-1","to Idle",1)
trans1=Transition("Transition-Id-1","to Idle",1)
# adds the state (TransitionType) to the statemachine childs - this is optional!