public static void AssertBackgroundsEqual(Background expected, IPersistentBackground actual)
 {
     Assert.AreEqual(expected.Value, actual.Value);
     Assert.AreEqual(expected.SampleRate, actual.SampleRate);
     AssertConfigurationSpansEqual(expected.OutputConfigurationSpans.Consolidate(), actual.ConfigurationSpans);
 }
Пример #2
0
        /// <summary>
        /// Constructs an output data stream with the given Background, of a given duration.
        /// </summary>
        /// <param name="background"></param>
        /// <param name="duration">Duration of stream</param>
        public BackgroundOutputDataStream(Background background, Option<TimeSpan> duration)
        {
            if (background == null)
                throw new ArgumentNullException("background");

            if (duration == null)
                throw new ArgumentNullException("duration");

            Background = background;
            Duration = duration;
            Position = TimeSpan.Zero;
            OutputPosition = TimeSpan.Zero;
        }
Пример #3
0
 public void SetBackground(IExternalDevice dev, IMeasurement background, IMeasurement sampleRate)
 {
     Backgrounds[dev] = new Background(background, sampleRate);
 }
Пример #4
0
 /// <summary>
 /// Constructs an output data stream with the given Background, of indefinite duration.
 /// </summary>
 /// <param name="background"></param>
 public BackgroundOutputDataStream(Background background)
     : this(background, Option<TimeSpan>.None())
 {
 }