Exemple #1
0
        static List <VTTQ> MakeTestData(int n)
        {
            var       list = new List <VTTQ>(n);
            Timestamp t    = Timestamp.FromISO8601("2021-03-20T10:00:00Z");

            int N = n / 4;

            AppendRegular(t, N, list);
            AppendRandom(t, N, list);
            AppendAllSame(t, N, list);
            AppendSemiRegular(t, N, list);

            AppendRegular(t, 1, list);
            AppendRandom(t, 1, list);
            AppendRegular(t, 2, list);
            AppendRandom(t, 1, list);
            AppendRegular(t, 2, list);
            AppendAllSame(t, 2, list);
            AppendRegular(t, 2, list);
            AppendRandom(t, 1, list);
            AppendAllSame(t, 1, list);
            AppendSemiRegular(t, 5, list);
            AppendRandom(t, 2, list);
            AppendSpecial(t, list);
            return(list);
        }
Exemple #2
0
        public Timestamp GetEnd()
        {
            switch (Type)
            {
            case TimeType.Last:
                return(Timestamp.Max);

            case TimeType.Range:
                return(Timestamp.FromISO8601(RangeEnd) + Duration.FromDays(1));

            default:
                throw new Exception("Unknown range type: " + Type);
            }
        }
Exemple #3
0
        public Timestamp GetStart()
        {
            switch (Type)
            {
            case TimeType.Last:
                return(Timestamp.Now - DurationFromTimeRange(this));

            case TimeType.Range:
                return(Timestamp.FromISO8601(RangeStart));

            default:
                throw new Exception("Unknown range type: " + Type);
            }
        }