-
Notifications
You must be signed in to change notification settings - Fork 301
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
Alazar add buffer completed callback #1234
Conversation
This can be used to step another instrument or trigger something when a buffer is complete
while (buffers_completed < self.buffers_per_acquisition.get()): | ||
# Wait for the buffer at the head of the list of available | ||
# buffers to be filled by the board. | ||
buf = self.buffer_list[buffers_completed % allocated_buffers] | ||
buf = self.buffer_list[buffers_completed % allocated_buffers ] |
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.
space before ]
?
@@ -1227,3 +1228,6 @@ def post_acquire(self): | |||
""" | |||
raise NotImplementedError( | |||
'This method should be implemented in a subclass') | |||
|
|||
def buffer_done_callback(self, buffer_number): |
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.
buffer_number or buffers_completed? and, no docs again? :(
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.
can't really say anything again
Codecov Report
@@ Coverage Diff @@
## master #1234 +/- ##
=======================================
Coverage 79.18% 79.18%
=======================================
Files 52 52
Lines 7201 7201
=======================================
Hits 5702 5702
Misses 1499 1499 |
@@ -679,8 +680,9 @@ def acquire(self, mode=None, samples_per_record=None, | |||
# -----set final configurations----- | |||
|
|||
# Abort any previous measurement | |||
# With AlazarAbortAsyncRead in a finally clause below | |||
# this should be fully redundant and is rather slow | |||
self._call_dll('AlazarAbortAsyncRead', self._handle) |
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.
since it "should be" redundant, shall this line be removed?
@jenshnielsen Do you think we can merge this, or is there more stuff coming? (to me it seems that this can be safely merged.) |
I think this is safe to merge. Lets remove the redundant line first |
The idea is to enable the user to perform an action such as stepping another instrument once a buffer is complete. There is a small performance hit of this. According to my benchmarks this costs ~80 ns per iteration if the function is a noopt.
Also fix some invalid parameters in the Alazar 9360 driver