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.LastUpdate = DateTime.Now;
}
}
internal void Update(AIS_ClassBStatic staticData)
{
this.LastUpdate = DateTime.Now;
}
internal static AIS_Target CreateFromReader(IDataReader reader)
{

View File

@ -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;

View File

@ -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 = `
<td>
<input type="text" id="itemDescription${numItems}" placeholder="Item" />
</td>
<td>
<input type="text" id="itemValue${numItems}" placeholder="Value" />
</td>`;
// You could also do the same for the cells and inputs
table.appendChild(row);
numItems++;
const row = document.createElement('tr');
row.innerHTML = `<td>
<input type="text" id="itemDescription${numItems}" placeholder="Item" />
</td>
<td>
<input type="text" id="itemValue${numItems}" placeholder="Value" />
</td>`;
// You could also do the same for the cells and inputs
table.appendChild(row);
for (var i = 0; i < data.length; i++) {