open-ephys / liboni

API for controlling ONI-compliant hardware
https://open-ephys.github.io/onix-docs/API%20Reference/index.html
0 stars 5 forks source link

Add the ability to refresh the device table without closing the context #10

Closed aacuevas closed 1 year ago

aacuevas commented 1 year ago

For clroni. This is useful for cases when a device has settings that affect its block size and a full disposal of the context after changing said setting, which is only effective after a reset, is undesired. Thus, allows for creating a context, setting the relevant parameters, refreshing the table and continue work.

Mainly, this PR adds a new oni.Context.Refresh() method to issue a reset and reload the device table, moves the device table query to its own private function that can be calles from both Refresh() and the constructor and changes DeviceTable from a readonly member to a private set property so functionality remains the same.