Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue 120: set TangoDataWriter properties from NeXusWriterProperties variable #121

Merged
merged 2 commits into from
Jun 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
2024-06-06 Jan Kotanski <jankotan@gmail.com>
* set TangoDataWriter properties from NeXusWriterProperties variable (#121)
* tagged as 3.24.0

2024-06-04 Jan Kotanski <jankotan@gmail.com>
* skip acquisition for the modes listed in NeXusSkipAcquisitionModes variable (#117)
* tagged as 3.23.0
Expand Down
1 change: 1 addition & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -225,4 +225,5 @@ The NeXus file recorder uses the following sardana environment variables
* **ScicatMeasurements** *(dict)* - a dictionary of measurement names indexed by ``ScanDir`` and used by ``scingestor``, default: ``{}``
* **CreateMeasurementFile** *(bool)* - create a measurement file with its filename releated to ``ScicatMeasurements`` or ``ScanFile``, default: ``False``
* **NeXusSkipAcquisitionModes** *(list)* - a list of strategy modes for which acquisition is skip
* **NeXusWriterProperties** *(dict)* - a dictionary of TangoDataWriter (NXSDataWriter) properties (starting with a small letter)

2 changes: 1 addition & 1 deletion sardananxsrecorder/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@
""" Sardana Scan Recorders """

#: package version
__version__ = "3.23.0"
__version__ = "3.24.0"
12 changes: 12 additions & 0 deletions sardananxsrecorder/nxsrecorder.py
Original file line number Diff line number Diff line change
Expand Up @@ -543,6 +543,18 @@ def __setNexusDevices(self, onlyconfig=False):
if self.__nexuswriter_device is None:
from nxswriter import TangoDataWriter
self.__nexuswriter_device = TangoDataWriter.TangoDataWriter()
try:
properties = dict(
self.__getEnvVar("NeXusWriterProperties", {}))
except Exception as e:
self.warning(
"Cannot load NeXusWriterProperties %s" % (str(e)))
self.__macro().warning(
"Cannot load NeXusWriterProperties %s" % (str(e)))
properties = {}
for ky, vl in properties.items():
if hasattr(self.__nexuswriter_device, ky):
setattr(self.__nexuswriter_device, ky, vl)

def __get_alias(self, name):
""" provides a device alias
Expand Down
Loading