operator_gui_logic module

class operator_gui_logic.GUIControllers(agent_object)[source]

Bases: object

This class contains all the controller to be added to SMIA in order to manage the operator actions.

async static hello_controller(request)[source]

Generic controller during the request of SMIA GUI webpages via HTTP GET call.

async operator_load_controller(request)[source]
async operator_select_controller(request)[source]
async operator_request_controller(request)[source]
async get_smia_attrib_by_file_name(file_name, smia_attrib)[source]
async get_aas_elem_of_model_by_id_short(file_name, id_short)[source]
class operator_gui_logic.GUIFeatures[source]

Bases: object

This class contains the methods related to SPADE web interface customization.

FAVICON_PATH = 'htmls/static/SMIA_favicon.ico'
async static add_new_menu_entry(agent, entry_name, entry_url, entry_icon)[source]

This method adds a new entry to the SPADE web interface menu.

Parameters:
  • agent (smia.agents.smia_agent.SMIAAgent) – SMIA SPADE agent object.

  • entry_name (str) – name of the new entry.

  • entry_url (str) – url to access the new entry.

  • entry_icon (str) – icon identifier from Font Awesome collection.

async static handle_favicon(request)[source]

This method represents the controller that will handle the requests when the Favicon is requested.

Parameters:

request – request object to get the favicon file.

Returns:

response to the web browser.

Return type:

web.FileResponse

async static add_custom_favicon(agent)[source]

This method adds a custom Favicon to the SMIA GUI.

Parameters:

agent (spade.agent.Agent) – SMIA SPADE agent object.

static build_avatar_url(jid: str) str[source]

This method overrides the original SPADE method to use the Favicon as the avatar in SMIA SPADE web interface.

async static read_aasx_file_object_store(aas_file_path)[source]

This method reads the AAS model of a given file path according to the AASX serialization format.

Parameters:

aas_file_path (str) – path to the AAS model file.

Returns:

object with all Python elements of the AAS model.

Return type:

basyx.aas.model.DictObjectStore

async static analyze_aas_model_store(agent_object, aas_model_store)[source]

This method parses an AAS model store (BaSyx Python object for storing AAS models) to get information such as the CSS model.

Parameters:
  • agent_object (smia.agents.smia_agent.SMIAAgent) – SMIA SPADE agent object.

  • aas_model_store (basyx.aas.model.DictObjectStore) – Python object with the AAS model.

Returns:

information about the AAS.

Return type:

dict

async static get_smia_jid_from_aas_store(agent_object, aas_model_store)[source]

This method gets the SMIA JID value from the AAS model store. The SMIA approach establishes that this information need to be added within the ‘’ standardized submodel.

Parameters:
  • agent_object (smia.agents.smia_agent.SMIAAgent) – SMIA SPADE agent object.

  • aas_model_store (basyx.aas.model.DictObjectStore) – Python object with the AAS model.

Returns:

SMIA JID value.

Return type:

JID

async static get_smia_version_from_aas_store(agent_object, aas_model_store)[source]

This method gets the SMIA software version from the AAS model store. The SMIA approach establishes that this information need to be added within the ‘SoftwareNameplate’ standardized submodel.

Parameters:
  • agent_object (smia.agents.smia_agent.SMIAAgent) – SMIA SPADE agent object.

  • aas_model_store (basyx.aas.model.DictObjectStore) – Python object with the AAS model.

Returns:

SMIA version value.

Return type:

version (str)

async static get_asset_id_from_aas_store(aas_model_store)[source]

This method gets the SMIA JID value from the AAS model store. The SMIA approach establishes that this information need to be added within the ‘’ standardized submodel.

Parameters:
  • agent_object (smia.agents.smia_agent.SMIAAgent) – SMIA SPADE agent object.

  • aas_model_store (basyx.aas.model.DictObjectStore) – Python object with the AAS model.

Returns:

SMIA JID value.

Return type:

JID