Skip to content

Commit

Permalink
Propogate boolean in Headstage64 stimulator triggers
Browse files Browse the repository at this point in the history
- These operators were not acting as sinks because they were not
  propogating their observable sequence
- Fixes #83
  • Loading branch information
jonnew committed Aug 15, 2024
1 parent 7ac700f commit 3305365
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion OpenEphys.Onix1/Headstage64ElectricalStimulatorTrigger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,11 @@ public override IObservable<bool> Process(IObservable<bool> source)
{
var device = deviceInfo.GetDeviceContext(typeof(Headstage64ElectricalStimulator));
var triggerObserver = Observer.Create<bool>(
value => device.WriteRegister(Headstage64ElectricalStimulator.TRIGGER, value ? 1u : 0u),
value =>
{
device.WriteRegister(Headstage64ElectricalStimulator.TRIGGER, value ? 1u : 0u);
observer.OnNext(value);
},
observer.OnError,
observer.OnCompleted);

Expand Down
6 changes: 5 additions & 1 deletion OpenEphys.Onix1/Headstage64OpticalStimulatorTrigger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,11 @@ public override IObservable<bool> Process(IObservable<bool> source)
{
var device = deviceInfo.GetDeviceContext(typeof(Headstage64OpticalStimulator));
var triggerObserver = Observer.Create<bool>(
value => device.WriteRegister(Headstage64OpticalStimulator.TRIGGER, value ? 1u : 0u),
value =>
{
device.WriteRegister(Headstage64OpticalStimulator.TRIGGER, value ? 1u : 0u);
observer.OnNext(value);
},
observer.OnError,
observer.OnCompleted);

Expand Down

0 comments on commit 3305365

Please sign in to comment.