Skip to content

Commit

Permalink
meaning
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter Wegmann committed Sep 10, 2024
1 parent dc8287e commit 6b976cd
Showing 1 changed file with 24 additions and 2 deletions.
26 changes: 24 additions & 2 deletions src/secop_ophyd/SECoPDevices.py
Original file line number Diff line number Diff line change
Expand Up @@ -521,14 +521,36 @@ async def generate_nexus_struct(self) -> str:
implementation: str = str(await self.implementation.get_value())
description: str = str(await self.description.get_value())

measurement_line = ""
importance_line = ""
key_line = ""
link_line = ""

if self.meaning is not None:
meaning:dict = self.meaning.get_value()

if meaning.get('function'):
function:str = self.meaning.get_value().get('function')
measurement_line = f"\n\tmeasurement:NX_CHAR = {function}"

importance_line = f"\n\t\t@secop_importance:NX_INT32 = {meaning.get('importance')}" if meaning.get('importance') else ""
key_line = f"\n\t\t@secop_key:NX_CHAR = {meaning.get('key')}" if meaning.get('key') else ""
link_line = f"\n\t\t@secop_link:NX_CHAR = {meaning.get('link')}" if meaning.get('link') else ""








## remove new line chars
description = ''.join(description.splitlines())

text = f"""
{self._module}:NXsensor
\t@NX_class = NXsensor
\tname:NX_CHAR = "{self._module}"
\tmeasurement:NX_CHAR = "TODO"
\tname:NX_CHAR = "{self._module}"{measurement_line}{importance_line}{key_line}{link_line}
\t\t@secop_importance:NX_INT= 0
\tmodel:NX_CHAR = "{implementation}"
\tdescription:NX_CHAR = "{description}"
Expand Down

0 comments on commit 6b976cd

Please sign in to comment.