nopasaran.primitives.action_primitives.control_channel_primitives.ControlChannelPrimitives

class nopasaran.primitives.action_primitives.control_channel_primitives.ControlChannelPrimitives

Bases: object

Class containing control channel action primitives for the state machine.

__init__()

Methods

__init__()

configure_client_control_channel(inputs, ...)

Configure the client control channel using the controller configuration from the machine's state.

configure_server_control_channel(inputs, ...)

Configure the server control channel using the controller configuration from the machine's state.

load_control_channel_configuration(inputs, ...)

Load the control channel configuration from a file and store it in the machine's state.

start_control_channel(inputs, outputs, ...)

Start the control channel using the specified variable's value from the machine's state.

stop_control_channel(inputs, outputs, ...)

Stop the control channel using the specified variable's value from the machine's state.

sync(inputs, outputs, state_machine)

Send a synchronization message containing the provided inputs to the controller protocol.

wait_ready_signal(inputs, outputs, state_machine)

Wait for the local and remote status of the controller protocol to be READY.

wait_sync_signal(inputs, outputs, state_machine)

Wait for a synchronization message to be available in the controller protocol's queue.

static configure_client_control_channel(inputs, outputs, state_machine)

Configure the client control channel using the controller configuration from the machine’s state.

Number of input arguments: 1

Number of output arguments: 2

Optional input arguments: No

Optional output arguments: No

Args:

inputs (List[str]): The list of input variable names. It contains one mandatory input argument, which is the name of the variable storing the configuration, and two mandatory output arguments, which are the names of the variables where the configured controller and controller protocols will be stored.

outputs (List[str]): The list of output variable names. It contains two mandatory output arguments, which are the names of the variables where the configured controller and controller protocols will be stored.

state_machine: The state machine object.

Returns:

None

static configure_server_control_channel(inputs, outputs, state_machine)

Configure the server control channel using the controller configuration from the machine’s state.

Number of input arguments: 1

Number of output arguments: 2

Optional input arguments: No

Optional output arguments: No

Args:

inputs (List[str]): The list of input variable names. It contains one mandatory input argument, which is the name of the variable storing the configuration, and two mandatory output arguments, which are the names of the variables where the configured controller and controller protocols will be stored.

outputs (List[str]): The list of output variable names. It contains two mandatory output arguments, which are the names of the variables where the configured controller and controller protocols will be stored.

state_machine: The state machine object.

Returns:

None

static load_control_channel_configuration(inputs, outputs, state_machine)

Load the control channel configuration from a file and store it in the machine’s state.

Number of input arguments: 1

Number of output arguments: 1

Optional input arguments: No

Optional output arguments: No

Args:

inputs (List[str]): The list of input variable names. It contains one mandatory input argument, which is the name of the variable that contains the file path, and one mandatory output argument, which is the name of the variable to store the loaded configuration.

outputs (List[str]): The list of output variable names. It contains one mandatory output argument, which is the name of the variable where the loaded configuration will be stored.

state_machine: The state machine object.

Returns:

None

static start_control_channel(inputs, outputs, state_machine)

Start the control channel using the specified variable’s value from the machine’s state.

Number of input arguments: 1

Number of output arguments: 0

Optional input arguments: No

Optional output arguments: No

Args:

inputs (List[str]): The list of input variable names. It contains one mandatory input argument, which is the name of the variable storing the control channel object.

outputs (List[str]): The list of output variable names.

state_machine: The state machine object.

Returns:

None

static stop_control_channel(inputs, outputs, state_machine)

Stop the control channel using the specified variable’s value from the machine’s state.

Args:

inputs (List[str]): The list of input variable names. It contains one mandatory input argument, which is the name of the variable storing the control channel object. outputs (List[str]): The list of output variable names. state_machine: The state machine object.

Returns:

None

static sync(inputs, outputs, state_machine)

Send a synchronization message containing the provided inputs to the controller protocol. Triggers the event SYNC_SENT.

Number of input arguments: 1

Number of output arguments: 0

Optional input arguments: Yes

Optional output arguments: No

Args:

inputs (List[str]): The list of input variable names. It contains one mandatory input argument, which is the name of the variable storing the inputs to be synchronized, and optional input arguments representing additional synchronization inputs.

outputs (List[str]): The list of output variable names.

state_machine: The state machine object.

Returns:

None

static wait_ready_signal(inputs, outputs, state_machine)

Wait for the local and remote status of the controller protocol to be READY. If the status becomes READY within the specified timeout (input argument), triggers the event READY. Otherwise, triggers the event TIMEOUT.

Number of input arguments: 2

Number of output arguments: 0

Optional input arguments: No

Optional output arguments: No

Args:

inputs (List[str]): The list of input variable names. It contains two mandatory input arguments, which are the names of the local and remote status variables, and the timeout value.

outputs (List[str]): The list of output variable names.

state_machine: The state machine object.

Returns:

None

static wait_sync_signal(inputs, outputs, state_machine)

Wait for a synchronization message to be available in the controller protocol’s queue. If a message becomes available within the specified timeout (input argument), store its contents in the output variables and trigger the event SYNC_AVAILABLE. Otherwise, triggers the event TIMEOUT.

Number of input arguments: 2

Number of output arguments: 0

Optional input arguments: No

Optional output arguments: Yes

Args:

inputs (List[str]): The list of input variable names. It contains two mandatory input arguments, which are the name of the variable storing the received synchronization message, and the timeout value.

outputs (List[str]): The list of output variable names. It contains the names of the variables where the synchronization message will be stored (optional).

state_machine: The state machine object.

Returns:

None