static IObservable <oni.Frame> Generate(ONIController controller)
        {
            return(Observable.Create <oni.Frame>((observer, cancellationToken) =>
            {
                return Task.Factory.StartNew(() =>
                {
                    try
                    {
                        controller.AcqContext.BlockReadSize = controller.BlockReadSize;
                        controller.AcqContext.BlockWriteSize = controller.WritePreAllocSize;
                        controller.AcqContext.Start();

                        while (!cancellationToken.IsCancellationRequested)
                        {
                            observer.OnNext(controller.AcqContext.ReadFrame());
                        }
                    }
                    finally
                    {
                        controller.AcqContext.Stop();
                    }
                },
                                             cancellationToken,
                                             TaskCreationOptions.LongRunning,
                                             TaskScheduler.Default);
            })
                   .PublishReconnectable()
                   .RefCount());
        }
示例#2
0
 public NeuropixelsV1Probe(ONIController controller, uint?device_index)
     : base(controller, device_index, 0x70)
 {
     if (controller != null)
     {
         ResetProbe();
     }
 }
示例#3
0
 public NeuropixelsV1Flex(ONIController controller, uint?device_index)
     : base(controller, device_index, 0x50)
 {
     if (controller != null)
     {
         Update();
     }
 }
示例#4
0
        protected override Expression VisitExtension(Expression node)
        {
            var hidden_controller = node as HiddenONIControllerExpression;

            if (hidden_controller != null)
            {
                Controller = hidden_controller.Tag;
            }

            return(base.VisitExtension(node));
        }
 public ONIXControllerBuilder()
 {
     Controller = new ONIController();
 }
示例#6
0
 public I2CConfiguration(ONIController controller, uint?device_index, uint i2c_addr)
 {
     ctrl     = controller;
     dev_idx  = device_index;
     I2C_ADDR = i2c_addr;
 }