Skip to content

Commit

Permalink
Merge pull request #73 from neurogears/issue-72
Browse files Browse the repository at this point in the history
Ensure block size is set just before context start
  • Loading branch information
glopesdev authored Apr 9, 2024
2 parents 830f5bd + d08b161 commit 7ed4ada
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
12 changes: 3 additions & 9 deletions OpenEphys.Onix/OpenEphys.Onix/ContextTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -145,14 +145,16 @@ void ConfigureResources(StackDisposable disposable, Func<ContextTask, IDisposabl
}
}

internal void Start()
internal void Start(int blockReadSize, int blockWriteSize)
{
lock (regLock)
{
if (running) return;

// NB: Configure context before starting acquisition
ContextConfiguration = ConfigureContext();
ctx.BlockReadSize = blockReadSize;
ctx.BlockWriteSize = blockWriteSize;

// NB: Stuff related to sync mode is 100% ONIX, not ONI, so long term another place
// to do this separation might be needed
Expand Down Expand Up @@ -289,10 +291,6 @@ public int BlockReadSize
{
return ctx.BlockReadSize;
}
set
{
ctx.BlockReadSize = value;
}
}

public int BlockWriteSize
Expand All @@ -301,10 +299,6 @@ public int BlockWriteSize
{
return ctx.BlockWriteSize;
}
set
{
ctx.BlockWriteSize = value;
}
}

public PassthroughState HubState
Expand Down
4 changes: 1 addition & 3 deletions OpenEphys.Onix/OpenEphys.Onix/StartAcquisition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ public class StartAcquisition : Combinator<ContextTask, oni.Frame>
var disposable = context.FrameReceived.SubscribeSafe(observer);
try
{
context.BlockReadSize = ReadSize;
context.BlockWriteSize = WriteSize;
context.Start();
context.Start(ReadSize, WriteSize);
}
catch
{
Expand Down

0 comments on commit 7ed4ada

Please sign in to comment.