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); } }
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); }
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); } }