AR.source.interfaces namespace

AR.source.interfaces.IARConverter module

class AR.source.interfaces.IARConverter.IARConverter

Bases: ABC

abstract GetList()

Not implemented

abstract MakeFBX(data: dict[str, Any]) str

Create an Fbx file from data describing an object

Parameters:

data (dict[str, Any]) – data used to get the dimensions and textures of an object

Returns:

the path to the created Fbx

Return type:

str

abstract RackSearch(img: ndarray, domain: str, site: str, deviceType: str, debug: str = '') str

Perform OCR on a picture to get a rack name, then build the data describing him

Parameters:
  • img (ndarray) – the image with a rack name in it

  • customerAndSite (str) – customer and site names : [CUSTOMER].[SITE]

  • deviceType (str) – “rack” or “mdi”

  • debug (str) – if not empty, the function will skip picture read and will use this argument value as “ROOMNAME.RACKNAME”

Returns:

the data describing a rack

Return type:

str

exception AR.source.interfaces.IARConverter.IncorrectResponseError(url: str, endpoint: str, payload: dict[str, Any] | None = None, message: str = '')

Bases: Exception

Custom error class used when the API do not send back expected data

class AR.source.interfaces.IARConverter.OgreeMessage(data: dict[str, Any], message: str = 'successfully got object', status: bool = True)

Bases: object

Represents a message be sent and received by OGrEE software

classmethod FormatDict(data: dict[str, Any]) str

Take a dict representing an OGrEE object and returns a message to be sent to OGrEE-3D

Parameters:

data (dict[str, Any]) – OGrEE data

Returns:

a string containing the OGrEE data and formatted as a message sent to OGrEE-3D

Return type:

str

data: dict[str, Any]
message: str = 'successfully got object'
status: bool = True