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