open-ephys / onix-bonsai-onix1

Bonsai library for the Open Ephys Onix Acquisition System
https://open-ephys.github.io/onix1-bonsai-docs
MIT License
4 stars 3 forks source link

Improve ContextTask documentation #279

Closed jonnew closed 1 week ago

jonnew commented 2 weeks ago
cjsha commented 1 week ago

Can you confirm this? That these remarks for ContextTask's BlockReadSize might more aptly belong to StartAcquisition's ReadSize (which already has a decent description actually).
https://github.com/open-ephys/onix-bonsai-onix1/blob/6c67f9b0072721a8d0c66384432416fe155149bf/OpenEphys.Onix1/ContextTask.cs#L409-L416

cjsha commented 1 week ago

I decided to keep reading on the ContextTask page. There are a bunch of members of contextTask which would might be helpful knowing how/when/where they are set. For instance, it might be worth mentioning that BlockReadSize and BlockWriteSize are set by ReadSize and WriteSize properties in StartAcqusition.

jonnew commented 1 week ago

Can you confirm this? That these remarks for ContextTask's BlockReadSize might more aptly belong to StartAcquisition's ReadSize (which already has a decent description actually).

https://github.com/open-ephys/onix-bonsai-onix1/blob/6c67f9b0072721a8d0c66384432416fe155149bf/OpenEphys.Onix1/ContextTask.cs#L409-L416

Good find. It turns out that if we do the following:

/// <summary>
/// Gets the number of bytes read per cycle of the <see cref="ContextTask"/>'s acquisition
/// thread.
/// </summary>
/// <inheritdoc cref = "StartAcquisition.ReadSize"/>
public int BlockReadSize => ctx.BlockReadSize;

then we override the summary (since this property only has a getter) but we import the remarks from StartAcquisition.ReadSize. Very useful.

jonnew commented 1 week ago

I decided to keep reading on the ContextTask page. There are a bunch of members of contextTask which would might be helpful knowing how/when/where they are set. For instance, it might be worth mentioning that BlockReadSize and BlockWriteSize are set by ReadSize and WriteSize properties in StartAcqusition.

I decided to keep reading on the ContextTask page. There are a bunch of members of contextTask which would might be helpful knowing how/when/where they are set. For instance, it might be worth mentioning that BlockReadSize and BlockWriteSize are set by ReadSize and WriteSize properties in StartAcqusition.

I understand the concern, but they are not actually set by StartAcquisition. They are set either by hardware (everything besides read and write size) via setup handshake that is require by ONI or by whoever calls ContextTask.StartAsync, which happens to be by StartAcquisition in the bonsai editor.