diff --git a/AIS/bsmd.AIS2Service/AIS_Target.cs b/AIS/bsmd.AIS2Service/AIS_Target.cs index c8edd7ca..54e17e04 100644 --- a/AIS/bsmd.AIS2Service/AIS_Target.cs +++ b/AIS/bsmd.AIS2Service/AIS_Target.cs @@ -245,7 +245,15 @@ namespace bsmd.AIS2Service this.IsClassB = false; this.LastUpdate = DateTime.Now; - } + } + + internal void Update(AIS_ClassBStatic staticData) + { + + + + this.LastUpdate = DateTime.Now; + } internal static AIS_Target CreateFromReader(IDataReader reader) { diff --git a/AIS/bsmd.AIS2Service/SitRep.cs b/AIS/bsmd.AIS2Service/SitRep.cs index 49aff912..e655138d 100644 --- a/AIS/bsmd.AIS2Service/SitRep.cs +++ b/AIS/bsmd.AIS2Service/SitRep.cs @@ -77,6 +77,18 @@ namespace bsmd.AIS2Service _dbQueue.Enqueue(_sitRep[staticData.MMSI]); } break; + case AISClass.AISType.CLASS_B_STATIC_DATA: + { + AIS_ClassBStatic bStaticData = aisMessage as AIS_ClassBStatic; + if(!_sitRep.ContainsKey(bStaticData.MMSI)) + { + AIS_Target target = new AIS_Target(bStaticData.MMSI); + _sitRep[bStaticData.MMSI] = target; + } + _sitRep[bStaticData.MMSI].Update(bStaticData); + _dbQueue.Enqueue(_sitRep[bStaticData.MMSI]); + } + break; default: _log.InfoFormat("currently discarding AIS message {0}", aisMessage.MessageType); break; diff --git a/AIS/bsmd.AIS2Service/update.js b/AIS/bsmd.AIS2Service/update.js index 817d09ba..dadb0d79 100644 --- a/AIS/bsmd.AIS2Service/update.js +++ b/AIS/bsmd.AIS2Service/update.js @@ -10,22 +10,20 @@ console.log('error: ' + err); }); function updateData(data) { - var table = document.getElementById("aisTable"); - const table = document.getElementById('Table'); + const table = document.getElementById("aisTable"); let numItems = 1; - numItems++; - const row = document.createElement('tr'); - row.innerHTML = ` - - - - - - `; - // You could also do the same for the cells and inputs - table.appendChild(row); + numItems++; + const row = document.createElement('tr'); + row.innerHTML = ` + + + + +`; + // You could also do the same for the cells and inputs + table.appendChild(row); for (var i = 0; i < data.length; i++) {