Пример #1
0
 /// <inheritdoc />
 public void Start(Action <DateTime> notifyCompletionTime)
 {
     // notify that this is an infinite source component
     notifyCompletionTime(DateTime.MaxValue);
     if (this.collector != null)
     {
         this.timerDelegate = new Time.TimerDelegate((i, m, c, d1, d2) => this.Update());
         this.timer         = Platform.Specific.TimerStart((uint)this.Config.SamplingInterval.TotalMilliseconds, this.timerDelegate);
         this.running       = true;
     }
 }
Пример #2
0
        /// <inheritdoc/>
        public void Start(Action <DateTime> notifyCompletionTime)
        {
            this.notifyCompletionTime = notifyCompletionTime;

            this.startTime = this.pipeline.StartTime;
            this.endTime   = this.pipeline.ReplayDescriptor.End;
            uint realTimeInterval = (uint)this.pipeline.ConvertToRealTime(this.timerInterval).TotalMilliseconds;

            this.timerDelegate = new Time.TimerDelegate(this.PublishTime);
            this.timer         = Platform.Specific.TimerStart(realTimeInterval, this.timerDelegate);
            this.running       = true;
        }
Пример #3
0
        /// <summary>
        /// Called when the component is about to start running.
        /// </summary>
        /// <param name="onCompleted">Callback to invoke when done</param>
        /// <param name="replayContext">Describes the playback constraints</param>
        public void Start(Action onCompleted, ReplayDescriptor replayContext)
        {
            if (replayContext.Start == DateTime.MinValue)
            {
                this.startTime = this.pipeline.GetCurrentTime();
            }
            else
            {
                this.startTime = replayContext.Start;
            }

            this.endTime     = replayContext.End;
            this.onCompleted = onCompleted;
            this.currentTime = this.startTime;
            uint realTimeInterval = (uint)this.pipeline.ConvertToRealTime(this.timerInterval).TotalMilliseconds;

            this.timer   = Platform.Specific.TimerStart(realTimeInterval, this.timerDelegate);
            this.running = true;
        }
Пример #4
0
        /// <summary>
        /// Starts the timer. Called by the runtime when the pipeline starts.
        /// </summary>
        private void OnPipelineStart()
        {
            var replay = this.pipeline.ReplayDescriptor;

            if (replay.Start == DateTime.MinValue)
            {
                this.startTime = this.pipeline.GetCurrentTime();
            }
            else
            {
                this.startTime = replay.Start;
            }

            this.endTime     = replay.End;
            this.currentTime = this.startTime;
            uint realTimeInterval = (uint)this.pipeline.ConvertToRealTime(this.timerInterval).TotalMilliseconds;

            this.timerDelegate = new Time.TimerDelegate(this.PublishTime);
            this.timer         = Platform.Specific.TimerStart(realTimeInterval, this.timerDelegate);
            this.running       = true;
        }