Make DigitalOutput work in newer versions of SpikeGLX#12
Conversation
Update submodules to most recent commit of SpikeGLX-CPP-SDK. Alter paths in Bonsai.SpikeGLX.csproj to point to correct subdirectory in new SpikeGLX-CPP-SDK commit. Replace SetDigitalOut with SetNIDigitalOut in SpikeGLX.cs. Update DigitalOutput to use SetNIDigitalOut.
|
@glopesdev, this should make There's also the question of whether |
src/Bonsai.SpikeGLX/DigitalOutput.cs
Outdated
| return Process(source.Select(input => input ? 1 : 0)); | ||
| return Observable.Using(() => new SpikeGLX(Host, Port), | ||
| connection => source.Do(input => connection.SetNIDigitalOut(Channels, | ||
| input != 0 ? uint.MaxValue : uint.MinValue))); |
There was a problem hiding this comment.
@J-M-White I was wondering whether here we might want to simply pass on the unmodified int value itself, so we afford the possibility of setting the state of individual channels according to the bitmask?
In fact, it might be easier to simply make the overload take a uint directly so that it aligns exactly with the SpikeGLX API.
In order to reduce the git diff from the current version, you might also want to swap the order of the overloads (uint first, then the bool) so that it becomes easier to spot the relevant differences.
|
Hi @glopesdev, Sorry this took a little while - I wanted to test this on one of our rigs to make sure the new API function worked how I thought it did (especially when using a bitmask input). |
glopesdev
left a comment
There was a problem hiding this comment.
LGTM, just left a few final comments, but I'm happy to merge anytime.
Also make formatting of NI ports in comments consistent (no space between port and number). Co-authored-by: glopesdev <g.lopes@neurogears.org>
|
@glopesdev, great - thanks! Your suggested changes to when I think you need to approve before I can merge. |
Correct DigitalOutput so that the same Channel freezing on subscription happens for boolean inputs as for uint inputs. Co-authored-by: glopesdev <g.lopes@neurogears.org>
As mentioned in #10,
DigitalOutputcurrently doesn't work with the most recent version of SpikeGLX.Here, we move to the newest version of the SpikeGLX-CPP-SDK. To be consistent with the new API functions,
SetDigitalOutis replaced withSetNIDigitalOutin theSpikeGLXclass.DigitalOutputis updated to useSetNIDigitalOutwhile maintaining the same functionality.Fixes #10