-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8a9b9ac
commit 06c7a13
Showing
7 changed files
with
101 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,6 @@ | |
FileWriteMode, | ||
ImageMode, | ||
NDAttributeDataType, | ||
NDAttributesXML, | ||
) | ||
from .vimba import VimbaDetector | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
from typing import Sequence | ||
from xml.etree import cElementTree as ET | ||
|
||
import bluesky.plan_stubs as bps | ||
|
||
from ophyd_async.epics.areadetector.utils import ( | ||
NDAttributeDataType, | ||
NDAttributeParam, | ||
NDAttributePv, | ||
) | ||
from ophyd_async.epics.areadetector.writers.nd_plugin import NDArrayBase, NDPluginStats | ||
|
||
|
||
def setup_ndattributes(device: NDArrayBase, | ||
ndattributes: Sequence[NDAttributePv | NDAttributeParam]): | ||
xml_text = ET.Element("Attributes") | ||
_dbr_types = { | ||
None: "DBR_NATIVE", | ||
NDAttributeDataType.INT: "DBR_LONG", | ||
NDAttributeDataType.DOUBLE: "DBR_DOUBLE", | ||
NDAttributeDataType.STRING: "DBR_STRING", | ||
} | ||
if isinstance(ndattributes,NDAttributeParam): | ||
ET.SubElement( | ||
xml_text, | ||
"Attribute", | ||
name=ndattributes.name, | ||
type="PARAM", | ||
source=ndattributes.param, | ||
addr=str(ndattributes.addr), | ||
datatype=_dbr_types[ndattributes.datatype], | ||
description=ndattributes.description, | ||
) | ||
elif isinstance(ndattributes,NDAttributePv): | ||
ET.SubElement( | ||
xml_text, | ||
"Attribute", | ||
name=ndattributes.name, | ||
type="EPICS_PV", | ||
source=ndattributes.signal.source, | ||
datatype=_dbr_types[ndattributes.datatype], | ||
description=ndattributes.description, | ||
) | ||
yield from bps.abs_set(device.nd_attributes_file, xml_text) | ||
|
||
def setup_ndstats_sum(stats: NDPluginStats): | ||
pass | ||
#NDAttributeParam(name=f"{stats.parent.name}-sum", ...) |
This file was deleted.
Oops, something went wrong.