aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.Insights
diff options
context:
space:
mode:
authorRoy Ben Shabat <Roy.mail.net@gmail.com>2020-08-21 12:58:15 +0300
committerRoy Ben Shabat <Roy.mail.net@gmail.com>2020-08-21 12:58:15 +0300
commit7bd70fcb311c808b65b62e774755dcbd6b0d63cd (patch)
tree56db3c489de3665252c44d9ff477bb47bb722dc1 /Software/Visual_Studio/Tango.Insights
parentb0255ed4ae2827801d13cec175e57108a0666db9 (diff)
downloadTango-7bd70fcb311c808b65b62e774755dcbd6b0d63cd.tar.gz
Tango-7bd70fcb311c808b65b62e774755dcbd6b0d63cd.zip
Insights anomalies.
Diffstat (limited to 'Software/Visual_Studio/Tango.Insights')
-rw-r--r--Software/Visual_Studio/Tango.Insights/InsightsManager.cs27
1 files changed, 26 insertions, 1 deletions
diff --git a/Software/Visual_Studio/Tango.Insights/InsightsManager.cs b/Software/Visual_Studio/Tango.Insights/InsightsManager.cs
index b0c7b78ac..73b74bff6 100644
--- a/Software/Visual_Studio/Tango.Insights/InsightsManager.cs
+++ b/Software/Visual_Studio/Tango.Insights/InsightsManager.cs
@@ -105,7 +105,21 @@ namespace Tango.Insights
return collection.DeleteMany(x => x.Time < maxDateUTC);
}
- public virtual List<InsightsEvent> GetEvents(DateTime startUTC, DateTime endUTC)
+ public DateTime? GetFramesMinDate()
+ {
+ var collection = GetInsightsCollection();
+
+ if (collection.Count() > 0)
+ {
+ return collection.Min(x => x.Time);
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ public virtual List<InsightsEvent> GetEvents(DateTime startUTC, DateTime endUTC, bool limitToMinFramesTime = true)
{
using (ObservablesContext db = ObservablesContext.CreateDefault())
{
@@ -128,6 +142,17 @@ namespace Tango.Insights
.OrderBy(x => x.Time)
.ToList();
+ if (limitToMinFramesTime)
+ {
+ var collection = GetInsightsCollection();
+
+ if (collection.Count() > 0)
+ {
+ var minTime = collection.Min(x => x.Time);
+ events.RemoveAll(x => x.Time < minTime);
+ }
+ }
+
return events;
}
}