ControllerCommandSetup

Qualified name: loads.controller_command.api.controller_command_api.ControllerCommandSetup

class loads.controller_command.api.controller_command_api.ControllerCommandSetup(item)[source]

Bases: LoadSetup

The API handler for controller commands

The following example shows how to create a controller command using the API, it is assumed that these steps were performed in each of the examples for other methods in this class.

Example

>>> from more.api import ApiGateway
>>> api = ApiGateway(proj=proj)
>>> simulation_setup = api.create_simulation_setup()
>>> lcc_setup = simulation_setup.create_load_case_container_setup().set_name(name='Example LCC')
>>> lc_setup = lcc_setup.create_load_case_setup(lc_type='Mechanical load case').set_name(name='Example LC')
>>> controller_command_setup = lc_setup.create_load_setup(load_type='Controller command')

The next example shows how to get an API object for an already existing load.

Example

>>> from more.api import ApiGateway
>>> api = ApiGateway(proj=proj)
>>> simulation_setup = api.create_simulation_setup()
>>> lcc_setup = simulation_setup.create_load_case_container_setup().set_name(name='Example LCC')
>>> lc_setup = lcc_setup.create_load_case_setup(lc_type='Mechanical load case').set_name(name='Example LC')
>>> controller_command_setup = lc_setup.get_load_setup(index=0) # The load under this index must already exist

Methods

set_command_value

Deprecated method

set_command_value_by_name

Sets the command value for the associated controller command

set_controller

Deprecated method

set_controller_by_name

Sets the controller for the associated controller command

Attributes

available_command_value_names

Returns the list of available command value names

available_command_values_dict

Deprecated method

property available_command_value_names: List[str]

Returns the list of available command value names

See example at the top for how to create a controller command setup object

Example

>>> controller_command_setup.available_command_value_names
['Position command value', 'Velocity command value', 'Position command value with setpoint scaling']
Returns:

The list of available command values

Return type:

list of strings

property available_command_values_dict

Deprecated method

Deprecated

available_command_values_dict will be removed in a future MORe release, it is replaced by available_command_value_names()

set_command_value(command_value)[source]

Deprecated method

Deprecated

set_command_value will be removed in a future MORe release, it is replaced by set_command_value_by_name()

set_command_value_by_name(command_value_name) ControllerCommandSetup[source]

Sets the command value for the associated controller command

See example at the top for how to create a controller command setup object

Example

>>> controller_command_setup = controller_command_setup.set_controller_by_name(controller_name='example controller') # The controller with this name must already exist
>>> controller_command_setup = controller_command_setup.set_command_value_by_name(command_value_name='Position command value')
Returns:

self

Return type:

ControllerCommandSetup

Raises:

NameNotFoundError – Raised if a key in there is no command value with the given name

set_controller(controller)[source]

Deprecated method

Deprecated

set_controller will be removed in a future MORe release, it is replaced by set_controller_by_name()

set_controller_by_name(controller_name: str) ControllerCommandSetup[source]

Sets the controller for the associated controller command

See example at the top for how to create a controller command setup object

Example

>>> controller_command_setup = controller_command_setup.set_controller_by_name(controller_name='example controller') # The controller with this name must already exist
Returns:

self

Return type:

ControllerCommandSetup

Raises:

NameNotFoundError – Raised if a key in the name is not a viable controller