/// <summary> /// Returns a thread-safe wrapper for SequenceOutputDataStream. /// </summary> /// <param name="s"></param> /// <returns></returns> public static SequenceOutputDataStream Synchronized(SequenceOutputDataStream s) { return new SyncSequenceOutputDataStream(s); }
internal SyncSequenceOutputDataStream(SequenceOutputDataStream stream) { _stream = stream; }
public void SetUp() { const int srate = 1000; IList<IMeasurement> list = Enumerable.Range(0, srate * 2).Select(i => new Measurement(i, "V") as IMeasurement).ToList(); var data = new OutputData(list, new Measurement(srate, "Hz")); var stim1 = new RenderedStimulus("stim1", new Dictionary<string, object>(), data); stream1 = new StimulusOutputDataStream(stim1, TimeSpan.FromSeconds(0.1)); var stim2 = new RenderedStimulus("stim2", new Dictionary<string, object>(), data); stream2 = new StimulusOutputDataStream(stim2, TimeSpan.FromSeconds(0.1)); seqData = data.Concat(data); seqStream = new SequenceOutputDataStream(); seqStream.Add(stream1); seqStream.Add(stream2); }