Filterung angefangen
This commit is contained in:
parent
ff1a036124
commit
210d042c09
@ -21,8 +21,8 @@ namespace bsmd.AIS2Service
|
||||
|
||||
#region Fields
|
||||
|
||||
ConcurrentDictionary<int, AIS_Target> _sitRepDict;
|
||||
AIS_SQLiteStorage _storage;
|
||||
private readonly ConcurrentDictionary<int, AIS_Target> _sitRepDict;
|
||||
private readonly AIS_SQLiteStorage _storage;
|
||||
private Thread _thread;
|
||||
private bool _stopFlag = false;
|
||||
private static readonly ILog _log = LogManager.GetLogger(typeof(AISZoneMonitor));
|
||||
|
||||
@ -1,17 +1,25 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Web.Http;
|
||||
using log4net;
|
||||
|
||||
namespace bsmd.AIS2Service
|
||||
{
|
||||
public class SLRController : ApiController
|
||||
{
|
||||
private static readonly ILog _log = LogManager.GetLogger(typeof(SLRController));
|
||||
|
||||
[HttpGet]
|
||||
public IEnumerable<ShipLocationReport> Get([FromUri] int? id)
|
||||
{
|
||||
if (!id.HasValue) return null;
|
||||
List<ShipLocationReport> result = AISManager.SQLiteStorage.GetShipLocationReports(id.Value);
|
||||
|
||||
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?
|
||||
|
||||
// auch alles entfernen was "abgelaufen" ist und nicht im SitRep enthalten ist
|
||||
|
||||
Dictionary<int, List<ShipLocationReport>> mmsiDict = new Dictionary<int, List<ShipLocationReport>>();
|
||||
foreach(ShipLocationReport report in result) {
|
||||
if (!mmsiDict.ContainsKey(report.MMSI)) mmsiDict[report.MMSI] = new List<ShipLocationReport>();
|
||||
@ -22,7 +30,7 @@ namespace bsmd.AIS2Service
|
||||
report.Name = AISManager.SitRep[report.MMSI].Name;
|
||||
report.NavStatus = AIS_PosReport.GetNavStatus(AISManager.SitRep[report.MMSI].NavStatus);
|
||||
report.IMO = AISManager.SitRep[report.MMSI].IMO;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// determine "state" of vessel through alarm comparison. Possible values are:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user