-
Notifications
You must be signed in to change notification settings - Fork 29
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
Add support for a continuous acquisition interface for AD dets #793
base: main
Are you sure you want to change the base?
Conversation
…or AD detectors with the CB plugin
The test failures appear to be all tango related, so nothing to do with the changes in the PR... |
Tested w/ real camera and most recent changes and it all works as expected. |
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.
Looks good, a couple of small suggestions
self, | ||
prefix: str, | ||
path_provider: PathProvider, | ||
drv_suffix: str = "cam1:", |
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.
Should we add a drv_cls = ADBaseIO
here in case we want to expose the extra PVs the class has? Most of the time I imagine that doesn't matter, but it would probably be useful to have the option...
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.
Would it also make sense to do this with cb_suffix
-> cb_cls
?
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.
Alternatively, the user might want to pass in a custom controller instead which would already have the custom driver and circular buffer classes.
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.
at the moment there is only one circular buffer class in areaDetector, so I think we should hardcode that, while there are many detector drivers that we should probably support
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.
Right, since the Circular Buffer plugin is a default plugin that will be included with every driver, and there is only one variant, I think we can leave as is. There are multiple different writers and drivers, hence passing in classes.
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.
Good with me then
@pytest.fixture | ||
def one_shot_trigger_info_factory(): | ||
def generate_one_shot_trigger_info( | ||
trigger_mode=DetectorTrigger.INTERNAL, livetime=0.8 | ||
): | ||
if trigger_mode != DetectorTrigger.INTERNAL: | ||
return TriggerInfo( | ||
number_of_triggers=1, | ||
trigger=trigger_mode, | ||
livetime=livetime, | ||
deadtime=0.001, | ||
) | ||
else: | ||
return TriggerInfo( | ||
number_of_triggers=1, trigger=trigger_mode, livetime=livetime | ||
) | ||
|
||
return generate_one_shot_trigger_info |
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'm not a fan of wrapping functions as fixtures, not sure it adds anything...
@pytest.fixture | |
def one_shot_trigger_info_factory(): | |
def generate_one_shot_trigger_info( | |
trigger_mode=DetectorTrigger.INTERNAL, livetime=0.8 | |
): | |
if trigger_mode != DetectorTrigger.INTERNAL: | |
return TriggerInfo( | |
number_of_triggers=1, | |
trigger=trigger_mode, | |
livetime=livetime, | |
deadtime=0.001, | |
) | |
else: | |
return TriggerInfo( | |
number_of_triggers=1, trigger=trigger_mode, livetime=livetime | |
) | |
return generate_one_shot_trigger_info | |
def generate_one_shot_trigger_info( | |
trigger_mode=DetectorTrigger.INTERNAL, livetime=0.8 | |
): | |
if trigger_mode != DetectorTrigger.INTERNAL: | |
return TriggerInfo( | |
number_of_triggers=1, | |
trigger=trigger_mode, | |
livetime=livetime, | |
deadtime=0.001, | |
) | |
else: | |
return TriggerInfo( | |
number_of_triggers=1, trigger=trigger_mode, livetime=livetime | |
) |
async def test_cont_acq_controller_invalid_trigger_mode( | ||
cont_acq_controller: adcore.ADBaseContAcqController, one_shot_trigger_info_factory | ||
): | ||
trigger_info = one_shot_trigger_info_factory( | ||
trigger_mode=DetectorTrigger.CONSTANT_GATE | ||
) |
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.
...
async def test_cont_acq_controller_invalid_trigger_mode( | |
cont_acq_controller: adcore.ADBaseContAcqController, one_shot_trigger_info_factory | |
): | |
trigger_info = one_shot_trigger_info_factory( | |
trigger_mode=DetectorTrigger.CONSTANT_GATE | |
) | |
async def test_cont_acq_controller_invalid_trigger_mode( | |
cont_acq_controller: adcore.ADBaseContAcqController, | |
): | |
trigger_info = generate_one_shot_trigger_info( | |
trigger_mode=DetectorTrigger.CONSTANT_GATE | |
) |
self, | ||
prefix: str, | ||
path_provider: PathProvider, | ||
drv_suffix: str = "cam1:", |
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.
Would it also make sense to do this with cb_suffix
-> cb_cls
?
self, | ||
prefix: str, | ||
path_provider: PathProvider, | ||
drv_suffix: str = "cam1:", |
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.
Alternatively, the user might want to pass in a custom controller instead which would already have the custom driver and circular buffer classes.
Co-authored-by: Thomas Hopkins <[email protected]>
Co-authored-by: Thomas Hopkins <[email protected]>
…-cont-acq-trigger
Uses the Circular Buffer plugin.
I've tested that this works with the
ContAcqVimbaDetector
. Before I continue it would be good if someone could take this for a spin, or have a look-over.TODO:
Addresses #596