-
Notifications
You must be signed in to change notification settings - Fork 1
Add top level attributes and commands to simplify API #82
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| from fastcs.attributes import AttrRW | ||
| from fastcs_odin.controllers.odin_data.frame_processor import ( | ||
| FrameProcessorAdapterController, | ||
| ) | ||
|
|
||
|
|
||
| class EigerFrameProcessorAdapterController(FrameProcessorAdapterController): | ||
| data_compression: AttrRW[str] | ||
| data_datatype: AttrRW[str] |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,21 +1,59 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| from fastcs.attributes import AttrR | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| from fastcs.attributes import AttrR, AttrRW | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| from fastcs.controllers import BaseController | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| from fastcs.datatypes import Bool | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| from fastcs.datatypes import Bool, Int, String | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| from fastcs_odin.controllers import OdinController as _OdinController | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| from fastcs_odin.controllers.odin_data.meta_writer import MetaWriterAdapterController | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| from fastcs_odin.http_connection import HTTPConnection | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| from fastcs_odin.io import StatusSummaryAttributeIORef | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| from fastcs_odin.io.config_fan_sender_attribute_io import ConfigFanAttributeIORef | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| from fastcs_odin.util import OdinParameter | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| from fastcs_eiger.controllers.odin.eiger_fan import EigerFanAdapterController | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| from fastcs_eiger.controllers.odin.eiger_fp_adapter_controller import ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| EigerFrameProcessorAdapterController, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| class OdinController(_OdinController): | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| """Eiger-specific Odin controller""" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| writing: AttrR = AttrR( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| FP: EigerFrameProcessorAdapterController | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| EF: EigerFanAdapterController | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| MW: MetaWriterAdapterController | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| writing = AttrR( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Bool(), io_ref=StatusSummaryAttributeIORef([("MW", "FP")], "writing", any) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| async def initialise(self): | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| await super().initialise() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| self.file_path = AttrRW( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| String(), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| io_ref=ConfigFanAttributeIORef([self.FP.file_path, self.MW.directory]), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| self.file_prefix = AttrRW( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| String(), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| io_ref=ConfigFanAttributeIORef([self.FP.file_prefix, self.MW.file_prefix]), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| self.acquisition_id = AttrRW( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| String(), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| io_ref=ConfigFanAttributeIORef( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| [ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| self.file_prefix, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| self.FP.acquisition_id, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| self.MW.acquisition_id, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| self.EF.acqid, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+35
to
+49
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm assuming the
Suggested change
such that one should/could only poke one PV consistently?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is not any real reason to set them differently, but I think some do. We could check that with some DAQ people.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @DominicOram do you have any thoughts on this? |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| self.block_size = AttrRW( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Int(), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| io_ref=ConfigFanAttributeIORef( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| [self.FP.process_frames_per_block, self.EF.block_size] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| def _create_adapter_controller( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| self, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| connection: HTTPConnection, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -26,6 +64,10 @@ def _create_adapter_controller( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| """Create Eiger-specific adapter controllers.""" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| match module: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| case "FrameProcessorAdapter": | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| return EigerFrameProcessorAdapterController( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| connection, parameters, f"{self.API_PREFIX}/{adapter}", self._ios | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| case "EigerFanAdapter": | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| return EigerFanAdapterController( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| connection, parameters, f"{self.API_PREFIX}/{adapter}", self._ios | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could: Now that we have
wait_for_valuewith atimeoutshould we expose aDEFAULT_TIMEOUTinFastCS, such that we can ensure observation timeouts are consistent unless they explicitly shouldn't be?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure there is a widely useful default - what else would you use that default for?
I am actually not sure if 1 second here is sufficient. Perhaps it should be an Attribute so it can be changed at runtime?