Пример #1
0
        private static IEnumerable <YieldAggregate> Get5minParts(Minute_Log_5 log)
        {
            Func <DateTime, double, YieldAggregate> factory =
                (moment, yield) => new YieldAggregate
                (
                    date: moment,
                    yield: yield,
                    applianceID: log.ApplianceID,
                    duration: TimeSpan.FromMinutes(5)
                );

            if (log.Usage_00 != null)
            {
                yield return(factory(log.LogDate.AddMinutes(00), -(double)log.Usage_00));
            }
            if (log.Usage_05 != null)
            {
                yield return(factory(log.LogDate.AddMinutes(05), -(double)log.Usage_05));
            }
            if (log.Usage_10 != null)
            {
                yield return(factory(log.LogDate.AddMinutes(10), -(double)log.Usage_10));
            }
            if (log.Usage_15 != null)
            {
                yield return(factory(log.LogDate.AddMinutes(15), -(double)log.Usage_15));
            }
            if (log.Usage_20 != null)
            {
                yield return(factory(log.LogDate.AddMinutes(20), -(double)log.Usage_20));
            }
            if (log.Usage_25 != null)
            {
                yield return(factory(log.LogDate.AddMinutes(25), -(double)log.Usage_25));
            }
            if (log.Usage_30 != null)
            {
                yield return(factory(log.LogDate.AddMinutes(30), -(double)log.Usage_30));
            }
            if (log.Usage_35 != null)
            {
                yield return(factory(log.LogDate.AddMinutes(35), -(double)log.Usage_35));
            }
            if (log.Usage_40 != null)
            {
                yield return(factory(log.LogDate.AddMinutes(40), -(double)log.Usage_40));
            }
            if (log.Usage_45 != null)
            {
                yield return(factory(log.LogDate.AddMinutes(45), -(double)log.Usage_45));
            }
            if (log.Usage_50 != null)
            {
                yield return(factory(log.LogDate.AddMinutes(50), -(double)log.Usage_50));
            }
            if (log.Usage_55 != null)
            {
                yield return(factory(log.LogDate.AddMinutes(55), -(double)log.Usage_55));
            }
        }
Пример #2
0
        private static IEnumerable<YieldAggregate> Get5minParts(Minute_Log_5 log)
        {
            Func<DateTime, double, YieldAggregate> factory =
                (moment, yield) => new YieldAggregate
                (
                    date: moment,
                    yield: yield,
                    applianceID: log.ApplianceID,
                    duration: TimeSpan.FromMinutes(5)
                );

            if (log.Usage_00 != null)
                yield return factory(log.LogDate.AddMinutes(00), -(double)log.Usage_00);
            if (log.Usage_05 != null)
                yield return factory(log.LogDate.AddMinutes(05), -(double)log.Usage_05);
            if (log.Usage_10 != null)
                yield return factory(log.LogDate.AddMinutes(10), -(double)log.Usage_10);
            if (log.Usage_15 != null)
                yield return factory(log.LogDate.AddMinutes(15), -(double)log.Usage_15);
            if (log.Usage_20 != null)
                yield return factory(log.LogDate.AddMinutes(20), -(double)log.Usage_20);
            if (log.Usage_25 != null)
                yield return factory(log.LogDate.AddMinutes(25), -(double)log.Usage_25);
            if (log.Usage_30 != null)
                yield return factory(log.LogDate.AddMinutes(30), -(double)log.Usage_30);
            if (log.Usage_35 != null)
                yield return factory(log.LogDate.AddMinutes(35), -(double)log.Usage_35);
            if (log.Usage_40 != null)
                yield return factory(log.LogDate.AddMinutes(40), -(double)log.Usage_40);
            if (log.Usage_45 != null)
                yield return factory(log.LogDate.AddMinutes(45), -(double)log.Usage_45);
            if (log.Usage_50 != null)
                yield return factory(log.LogDate.AddMinutes(50), -(double)log.Usage_50);
            if (log.Usage_55 != null)
                yield return factory(log.LogDate.AddMinutes(55), -(double)log.Usage_55);
        }