AIS-B WIP

This commit is contained in:
Daniel Schick 2022-10-14 14:12:20 +02:00
parent 47539cc72a
commit 5577fd22b5
3 changed files with 32 additions and 14 deletions

View File

@ -245,7 +245,15 @@ namespace bsmd.AIS2Service
this.IsClassB = false; this.IsClassB = false;
this.LastUpdate = DateTime.Now; this.LastUpdate = DateTime.Now;
} }
internal void Update(AIS_ClassBStatic staticData)
{
this.LastUpdate = DateTime.Now;
}
internal static AIS_Target CreateFromReader(IDataReader reader) internal static AIS_Target CreateFromReader(IDataReader reader)
{ {

View File

@ -77,6 +77,18 @@ namespace bsmd.AIS2Service
_dbQueue.Enqueue(_sitRep[staticData.MMSI]); _dbQueue.Enqueue(_sitRep[staticData.MMSI]);
} }
break; 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: default:
_log.InfoFormat("currently discarding AIS message {0}", aisMessage.MessageType); _log.InfoFormat("currently discarding AIS message {0}", aisMessage.MessageType);
break; break;

View File

@ -10,22 +10,20 @@
console.log('error: ' + err); console.log('error: ' + err);
}); });
function updateData(data) { function updateData(data) {
var table = document.getElementById("aisTable");
const table = document.getElementById('Table'); const table = document.getElementById("aisTable");
let numItems = 1; let numItems = 1;
numItems++; numItems++;
const row = document.createElement('tr'); const row = document.createElement('tr');
row.innerHTML = ` row.innerHTML = `<td>
<td> <input type="text" id="itemDescription${numItems}" placeholder="Item" />
<input type="text" id="itemDescription${numItems}" placeholder="Item" /> </td>
</td> <td>
<td> <input type="text" id="itemValue${numItems}" placeholder="Value" />
<input type="text" id="itemValue${numItems}" placeholder="Value" /> </td>`;
</td>`; // You could also do the same for the cells and inputs
// You could also do the same for the cells and inputs table.appendChild(row);
table.appendChild(row);
for (var i = 0; i < data.length; i++) { for (var i = 0; i < data.length; i++) {