# hbp_nrp_excontrol.StateMachineManager module¶

This module contains a manager class for state machine

class StateMachineManager[source]

Bases: object

This class represents a managing class for state machines

add_all(paths, sim_id, sim_dir)[source]

Adds all given paths to the state machines managed by this instance

Parameters
• paths – A dictionary of unique state machine identifiers and paths to the

• sim_id – The simulation id under which the state machines should be run

• sim_dir – Absolute path to the folder where the simulation is running state machine sources

create_state_machine(name, sim_id, sim_dir)[source]

Create new StateMachineInstance with the given name and simulation id

Parameters
• name – The state machine name

• sim_id – The simulation id under which the state machines should be run

• sim_dir – Absolute path to the folder where the simulation is running state machine sources

Returns

A new state machine

get_state_machine(name)[source]

Gets the state machine with the given name or none

Parameters

name – The state machine name

Returns

The state machine with the given name

initialize_all()[source]

Initializes all state machines

restart_all()[source]

Restarts all state machines

shutdown()[source]

Shutdown the manager, terminating all state machines

start_all(fail_if_started=True)[source]

Starts all state machines

Parameters

fail_if_started – If True, the object raises an exception when any state machine was already started

property state_machines

Gets the state machines contained in this manager

terminate_all(timeout=0.2)[source]

Terminates all state machines