AR.source.classes namespace
AR.source.classes.AROGrEEToOGrEE module
- class AR.source.classes.AROGrEEToOGrEE.AROGrEEToOGrEE(url: str, headersGET: dict[str, Any], headersPOST: dict[str, Any], outputPath: str | None = None, AROutputPath: str | None = None, **kw)
Bases:
OGrEEToOGrEE
,IARConverter
Convert data from OGrEE to OGrEE-AR
- Parameters:
OGrEEToOGrEE (OGrEEToOGrEE) – Base class of OGrEE-to-OGrEE converters
IARConverter (IARConverter) – Interface of AR converters
- DownloadFbx(url: str) dict[str, str]
download fbx from url
- Parameters:
url (str) – fbx url
- Returns:
fbx data in bytes or b”” if the file could not be downloaded
- Return type:
str
- GetBuildingAndRoom(siteData: dict[str, Any], roomIdentifier: str) tuple[dict[str, Any], dict[str, Any], list[dict[str, Any]]]
Get building and room informations from OGrEE
- Parameters:
siteData (dict[str, Any]) – must contains “name”, “id” and “domain”
roomIdentifier (str) – name of the room in OGrEE
- Raises:
IncorrectResponseError – if the room was not found in OGrEE
- Returns:
two dicts describing an OGrEE building and room and a list of dict containing their templates if needed
- Return type:
tuple[dict[str, Any], dict[str, Any], list[dict[str,Any]]]
- GetDomain(domainName: str) dict[str, Any]
Create a domain for OGrEE :param domainName: name of the domain :type domainName: str :return: dict describing an OgrEE domain :rtype: dict[str, Any]
- GetList()
Not implemented
- GetRack(roomData: dict[str, Any], rackName: str) tuple[dict[str, Any], list[dict[str, Any]], list[str]]
Get rack informations from OGrEE
- Parameters:
roomData (dict[str, Any]) – must contains “name”, “id” and “domain”
rackName (str) – name of the rack in OGrEE
- Raises:
IncorrectResponseError – if the rack was not found in dcTracck
- Returns:
dict describing the rack and its children, a list of dict describing the templates needed, a list of fbx paths
- Return type:
tuple[dict[str, Any], list[dict[str, Any]],list[str]]
- GetSite(siteName: str) dict[str, Any]
Get site informations from OGrEE
- Parameters:
siteName (str) – name of the location of the site in OGrEE
- Raises:
IncorrectResponseError – if the site was not found in OGrEE
- Returns:
dict describing an OGrEE site
- Return type:
dict[str, Any]
- GetTemplatesAndFbxRec(objectData: dict[str, Any]) tuple[list[dict[str, Any]], dict[str, str]]
Recursively returns all children of the parent object and their templates
- Parameters:
parent_dctrack (dict[str,Any]) – parent object’s data from dctrack
- Returns:
a list of the templates, a list of fbx paths
- Return type:
tuple[list[dict[str, Any]],dict[str,str]]
- MakeFBX(data: dict[str, Any]) str
Not needed
- RackSearch(img: ndarray, domain: str, site: str, deviceType: str, debug: str = '') str
Perform OCR on a picture for a rack label, gets its info from OGrEE and convert it to OGrEE format
- Parameters:
img (ndarray) – the picture where the rack label is
customerAndSite (str) – [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:
a serialised message of OGrEE format containing all the data required to load the rack on OGrEE-3D-AR
- Return type:
str
- UpdateDomainRec(objectData: dict[str, Any], domain: str) dict[str, Any]
AR.source.classes.ARdcTrackToOGrEE module
- class AR.source.classes.ARdcTrackToOGrEE.ARdcTrackToOGrEE(url: str, headersGET: dict[str, Any], headersPOST: dict[str, Any], outputPath: str | None = None, AROutputPath: str | None = None, **kw)
Bases:
dcTrackToOGrEE
,IARConverter
Convert data from dcTrack to OGrEE-AR
- Parameters:
dcTrackToOGrEE (dcTrackToOGrEE) – Base class of dcTrack-to-OGrEE converters
IARConverter (IARConverter) – Interface of AR converters
- GetBuildingAndRoom(siteData: dict[str, Any], roomIdentifier: str) tuple[dict[str, Any], dict[str, Any]]
Get building and room informations from dcTrack
- Parameters:
siteData (dict[str, Any]) – must contains “name”, “id” and “domain”
roomIdentifier (str) – name of the room in dcTrack
- Raises:
IncorrectResponseError – if the room was not found in dcTrack
- Returns:
two dicts describing an OGrEE building and room
- Return type:
tuple[dict[str, Any], dict[str, Any]]
- GetChildren(parent_dctrack: dict[str, Any]) tuple[list[dict[str, Any]], list[dict[str, Any]], list[str]]
Recursively returns all children of the parent object and their templates
- Parameters:
parent_dctrack (dict[str,Any]) – parent object’s data from dctrack
- Returns:
a list of the children, a list of their templates and a list of paths to their fbx models
- Return type:
tuple[list[dict[str, Any]], list[dict[str, Any]], list[str]]
- GetDomain(domainName: str) dict[str, Any]
Create a domain for dcTrack :param domainName: name of the domain :type domainName: str :return: dict describing an OgrEE domain :rtype: dict[str, Any]
- GetList()
Not implemented
- GetRack(roomData: dict[str, Any], rackName: str) tuple[dict[str, Any], list[dict[str, Any]], dict[str, str]]
Get rack informations from dcTrack
- Parameters:
roomData (dict[str, Any]) – must contains “name”, “id” and “domain”
rackName (str) – name of the rack in dcTrack
- Raises:
IncorrectResponseError – if the rack was not found in dcTracck
- Returns:
dict describing the rack and its children, a list of dict describing the templates needed and a dict of fbx models
- Return type:
tuple[dict[str, Any], list[dict[str, Any]], dict[str, str]]
- GetSite(domainData: dict[str, Any], locationName: str) dict[str, Any]
Get site informations from dcTrack
- Parameters:
domainData (dict[str,Any]) – data of the site’s domain
locationName (str) – name of the location of the site in dcTrack
- Raises:
IncorrectResponseError – if the site was not found in dcTrack
- Returns:
dict describing an OGrEE site
- Return type:
dict[str, Any]
- MakeFBX(data: dict[str, Any]) str
Get pictures of a model from dcTrack then build a fbx model with them
- Parameters:
data (dict[str, Any]) – dcTrack model
- Returns:
the path to an fbx model or “” if no picture were found in dcTrack
- Return type:
str
- RackSearch(img: ndarray, domain: str, site: str, deviceType: str, debug: str = '') str
Perform OCR on a picture for a rack label, gets its info from dcTrack and convert it to OGrEE format
- Parameters:
img (ndarray) – the picture where the rack label is
customerAndSite (str) – [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:
a serialised message of OGrEE format containing all the data required to load the rack on OGrEE-3D-AR
- Return type:
str