Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | List of all members
flexbe_core.core.jumpable_state_machine.JumpableStateMachine Class Reference
Inheritance diagram for flexbe_core.core.jumpable_state_machine.JumpableStateMachine:
Inheritance graph
[legend]

Public Member Functions

def __init__ (self, args, kwargs)
 
def destroy (self)
 
def jump_to (self, target_state_label)
 

Static Public Attributes

bool refresh = False
 

Private Member Functions

def _search_state (self, origin_state, target_state_label, container, seen_states, path)
 
def _transition_callback (self, msg)
 
def _wait_for_next_state (self, current_state, timeout, period=0.05)
 

Private Attributes

 _sub
 

Detailed Description

A state machine that runs in background and does not report any transition.
It can jump to any of its states, executing all states on a random way to the target
(so make sure its states have no side effects).

Definition at line 12 of file jumpable_state_machine.py.

Constructor & Destructor Documentation

def flexbe_core.core.jumpable_state_machine.JumpableStateMachine.__init__ (   self,
  args,
  kwargs 
)

Definition at line 20 of file jumpable_state_machine.py.

Member Function Documentation

def flexbe_core.core.jumpable_state_machine.JumpableStateMachine._search_state (   self,
  origin_state,
  target_state_label,
  container,
  seen_states,
  path 
)
private
Searches the given state to create an outcome path to it.
This is implemented by a hierarchical depth-first search.

@type origin_state: State
@param origin_state: The current origin for this search.

@type target_state_label: string
@param target_state_label: The name of the state to search.

@type container: StateMachine
@param container: The current container inside which the search is currently done.

@type seen_states: list of State
@param seen_states: A list of all states that already have been traversed.

@type path: string
@param path: The outcome path to the current origin_state

@return: The whole outcome path to the searched state.

Definition at line 61 of file jumpable_state_machine.py.

def flexbe_core.core.jumpable_state_machine.JumpableStateMachine._transition_callback (   self,
  msg 
)
private
Forces the state machine to do a transition with a specified outcome.

@type msg: OutcomeRequest
@param msg: A message containing all relevant information.

Definition at line 159 of file jumpable_state_machine.py.

def flexbe_core.core.jumpable_state_machine.JumpableStateMachine._wait_for_next_state (   self,
  current_state,
  timeout,
  period = 0.05 
)
private
Sleeps until the state machine proceeded with the next state.

@type current_state: State
@param current_state: The current state when this method is called.

@type timeout: float
@param timeout: The time in seconds when this method should stop waiting when no transition is done.

@type period: float
@param period: The time in seconds how often this method should check the current state.

@return: True if waiting was successful, False if current_state is still the same (timeout).

Definition at line 135 of file jumpable_state_machine.py.

def flexbe_core.core.jumpable_state_machine.JumpableStateMachine.destroy (   self)

Definition at line 191 of file jumpable_state_machine.py.

def flexbe_core.core.jumpable_state_machine.JumpableStateMachine.jump_to (   self,
  target_state_label 
)
Jumps to the specified state.

@type target_state_label: string
@param target_state_label: The name of the state to jump to.
    Should be unique. If not, the first occurrence will be chosen.

Definition at line 26 of file jumpable_state_machine.py.

Member Data Documentation

flexbe_core.core.jumpable_state_machine.JumpableStateMachine._sub
private

Definition at line 23 of file jumpable_state_machine.py.

bool flexbe_core.core.jumpable_state_machine.JumpableStateMachine.refresh = False
static

Definition at line 18 of file jumpable_state_machine.py.


The documentation for this class was generated from the following file:


flexbe_core
Author(s): Philipp Schillinger
autogenerated on Wed Jun 5 2019 21:51:59