/// <summary>
        /// The last time in the buffer
        /// </summary>
        /// <returns>the latest time in the buffer</returns>
        public ITimeStamp GetLastBufferedTime()
        {
            ITime time = SmartBuffer.GetTimeAt(SmartBuffer.TimesCount - 1);

            if (time is ITimeSpan)
            {
                return(new TimeStamp(((ITimeSpan)time).End));
            }
            else
            {
                return((ITimeStamp)time);
            }
        }
示例#2
0
 public override bool IsAvailable(IExchangeItem querySpecifier)
 {
     CheckBuffer();
     if (buffer.TimesCount > 0)
     {
         ITime         lastTimeInBuffer      = buffer.GetTimeAt(buffer.TimesCount - 1);
         IList <ITime> consumerTimes         = querySpecifier.TimeSet.Times;
         ITime         lastConsumerTime      = consumerTimes[consumerTimes.Count - 1];
         const double  epsilon               = 1e-10;
         double        lastConsumerTimeAsMJD = lastConsumerTime.StampAsModifiedJulianDay +
                                               lastConsumerTime.DurationInDays;
         double lastTimeInBufferAsMJD = lastTimeInBuffer.StampAsModifiedJulianDay +
                                        lastTimeInBuffer.DurationInDays;
         return(lastConsumerTimeAsMJD < (lastTimeInBufferAsMJD + epsilon));
     }
     return(false);
 }