public void performAction(AFEventFrame lastestEventFrame, AFChangeInfoAction action)
 {
     if (timeLessQuery.IsMatch(lastestEventFrame))
     {
         if (action == AFChangeInfoAction.Added)
         {
             WriteValues(lastestEventFrame.StartTime);
         }
         else if (action == AFChangeInfoAction.Updated || action == AFChangeInfoAction.Removed)
         {
             ComputeStatistics();
         }
     }
 }
Пример #2
0
        internal bool timelessMatch(AFEventFrameSearch query, AFEventFrame ef)
        {
            List <AFSearchToken> tokens = query.Tokens.ToList();

            tokens.RemoveAll(t => t.Filter == AFSearchFilter.InProgress || t.Filter == AFSearchFilter.Start || t.Filter == AFSearchFilter.End || t.Filter == AFSearchFilter.Duration);

            AFEventFrameSearch timeless = new AFEventFrameSearch(query.Database, "AllEventFrames", tokens);

            logger.Debug($"{calculationName} : Attemps to match {timeless.ToString()} on event {ef.Name}");
            try
            {
                return(timeless.IsMatch(ef));
            }
            catch (System.FormatException e)
            {
                logger.Error($"There was an error with the query: {e.Message}");
                return(false);
            }
        }