Esempio n. 1
0
        public static void PurgeSignalByTime(SNetTSignalSecSetF8 tSignal, CtkTimeSecond time)
        {
            var now   = DateTime.Now;
            var query = tSignal.Signals.Where(x => x.Key < time).ToList();

            foreach (var row in query)
            {
                tSignal.Signals.Remove(row.Key);
            }
        }
Esempio n. 2
0
        protected override void Purge()
        {
            if (this.PurgeSeconds <= 0)
            {
                return;
            }
            var now    = DateTime.Now;
            var oldKey = new CtkTimeSecond(now.AddSeconds(-this.PurgeSeconds));

            PurgeSignalByTime(this.TSignal, oldKey);
        }
Esempio n. 3
0
        public static void PurgeSignalByTime(SNetTSignalSecSetF8 tSignal, CtkTimeSecond start, CtkTimeSecond end)
        {
            var now   = DateTime.Now;
            var query = (from row in tSignal.Signals
                         where row.Key <start || row.Key> end
                         select row).ToList();

            foreach (var row in query)
            {
                tSignal.Signals.Remove(row.Key);
            }
        }