areaDetector / ADCore

The home of the core components of the EPICS areaDetector software. It includes base classes for drivers and code for all of the standard plugins.
https://areadetector.github.io/master/index.html
Other
20 stars 65 forks source link

Support XML string as well as file path in `NDAttributesFile` #502

Closed coretl closed 5 months ago

coretl commented 5 months ago

In bluesky we would like to configure an areaDetector without having to have a shared filesystem with the detector. This is almost possible at the moment, but if we need to set NDAttributesFile then we need to pass a filesystem path which is read here: https://github.com/areaDetector/ADCore/blob/9d2c32a210408cdc353331a4353a0b416d95444a/ADApp/ADSrc/asynNDArrayDriver.cpp#L329-L338

The pos plugin has a similar XML reading routine, but it supports the PV being either a blob of XML or a filename: https://github.com/areaDetector/ADCore/blob/9d2c32a210408cdc353331a4353a0b416d95444a/ADApp/pluginSrc/NDPosPluginFileReader.cpp#L65-L69

I propose we do something similar for NDAttributesFile:

if (fileName.find("<Attributes>") != std::string::npos){ 
    buffer = fileName;
} else {
    // The existing code
} 

Is this a reasonable thing to do? If so, then we can make a PR for it.

MarkRivers commented 5 months ago

That seems reasonable to me.

coretl commented 5 months ago

@marcelldls please could you take a look at this?

MarkRivers commented 5 months ago

Closed via #503