diff --git a/AIS/bsmd.AIS2Service/AISManager.cs b/AIS/bsmd.AIS2Service/AISManager.cs index d61a9d18..c0cdcb2e 100644 --- a/AIS/bsmd.AIS2Service/AISManager.cs +++ b/AIS/bsmd.AIS2Service/AISManager.cs @@ -49,6 +49,7 @@ namespace bsmd.AIS2Service { _sitRepList.TryAdd(key, targets[key]); } + _log.InfoFormat("preloaded {0} targets", _sitRepList.Count); foreach (var task in _tasks) { diff --git a/AIS/bsmd.AIS2Service/webservice/SLRController.cs b/AIS/bsmd.AIS2Service/webservice/SLRController.cs index f0fd13a8..acb66a2e 100644 --- a/AIS/bsmd.AIS2Service/webservice/SLRController.cs +++ b/AIS/bsmd.AIS2Service/webservice/SLRController.cs @@ -15,10 +15,13 @@ namespace bsmd.AIS2Service if (!id.HasValue) return null; List result = AISManager.SQLiteStorage.GetShipLocationReports(id.Value); + // Class B targets entfernen int classBReportCnt = result.RemoveAll(x => AISManager.SitRep.ContainsKey(x.MMSI) && (AISManager.SitRep[x.MMSI].IsClassB ?? false)); - _log.DebugFormat("removed {0} class B SLR reports from list"); // tut des? + _log.DebugFormat("removed {0} class B alarms from list"); // tut des? // auch alles entfernen was "abgelaufen" ist und nicht im SitRep enthalten ist + int expiredCnt = result.RemoveAll(x => AISManager.SitRep.ContainsKey(x.MMSI) && ((DateTime.Now - x.Timestamp_Last).TotalMinutes > 1440)); + _log.InfoFormat("removed {0} expired (> 1 day) alarms from list"); Dictionary> mmsiDict = new Dictionary>(); foreach(ShipLocationReport report in result) {