Performance verbessert und die Darstellung.. auch :P
This commit is contained in:
parent
6a11764fe2
commit
3cac798fae
@ -50,7 +50,7 @@
|
|||||||
<value>60</value>
|
<value>60</value>
|
||||||
</setting>
|
</setting>
|
||||||
<setting name="SQLiteDBConnectionString" serializeAs="String">
|
<setting name="SQLiteDBConnectionString" serializeAs="String">
|
||||||
<value>Data Source=ais_initial.db;Version=3;</value>
|
<value>Data Source=ais_initial.db;Version=3;Synchronous=OFF;Journal Mode=MEMORY;</value>
|
||||||
</setting>
|
</setting>
|
||||||
<setting name="PosReportDBCleanupDays" serializeAs="String">
|
<setting name="PosReportDBCleanupDays" serializeAs="String">
|
||||||
<value>7</value>
|
<value>7</value>
|
||||||
|
|||||||
@ -12,7 +12,7 @@ namespace bsmd.AIS2Service.Properties {
|
|||||||
|
|
||||||
|
|
||||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.4.0.0")]
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.2.0.0")]
|
||||||
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
|
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
|
||||||
|
|
||||||
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||||
@ -70,7 +70,7 @@ namespace bsmd.AIS2Service.Properties {
|
|||||||
|
|
||||||
[global::System.Configuration.ApplicationScopedSettingAttribute()]
|
[global::System.Configuration.ApplicationScopedSettingAttribute()]
|
||||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
[global::System.Configuration.DefaultSettingValueAttribute("Data Source=ais_initial.db;Version=3;")]
|
[global::System.Configuration.DefaultSettingValueAttribute("Data Source=ais_initial.db;Version=3;Synchronous=OFF;Journal Mode=MEMORY;")]
|
||||||
public string SQLiteDBConnectionString {
|
public string SQLiteDBConnectionString {
|
||||||
get {
|
get {
|
||||||
return ((string)(this["SQLiteDBConnectionString"]));
|
return ((string)(this["SQLiteDBConnectionString"]));
|
||||||
|
|||||||
@ -18,7 +18,7 @@
|
|||||||
<Value Profile="(Default)">60</Value>
|
<Value Profile="(Default)">60</Value>
|
||||||
</Setting>
|
</Setting>
|
||||||
<Setting Name="SQLiteDBConnectionString" Type="System.String" Scope="Application">
|
<Setting Name="SQLiteDBConnectionString" Type="System.String" Scope="Application">
|
||||||
<Value Profile="(Default)">Data Source=ais_initial.db;Version=3;</Value>
|
<Value Profile="(Default)">Data Source=ais_initial.db;Version=3;Synchronous=OFF;Journal Mode=MEMORY;</Value>
|
||||||
</Setting>
|
</Setting>
|
||||||
<Setting Name="PosReportDBCleanupDays" Type="System.Int32" Scope="Application">
|
<Setting Name="PosReportDBCleanupDays" Type="System.Int32" Scope="Application">
|
||||||
<Value Profile="(Default)">7</Value>
|
<Value Profile="(Default)">7</Value>
|
||||||
|
|||||||
@ -15,13 +15,21 @@ namespace bsmd.AIS2Service
|
|||||||
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);
|
||||||
|
|
||||||
|
// remove results not in SitRep
|
||||||
|
int obscureTargetCnt = result.RemoveAll(x => !AISManager.SitRep.ContainsKey(x.MMSI));
|
||||||
|
_log.InfoFormat("removed {0} obscure targets", obscureTargetCnt);
|
||||||
|
|
||||||
|
// remove targets w/o name (i.e. static data)
|
||||||
|
int unnamedPlayerCnt = result.RemoveAll(x => string.IsNullOrEmpty(AISManager.SitRep[x.MMSI].Name));
|
||||||
|
_log.InfoFormat("removed {0} unnamed targets", unnamedPlayerCnt);
|
||||||
|
|
||||||
// Class B targets entfernen
|
// Class B targets entfernen
|
||||||
int classBReportCnt = result.RemoveAll(x => AISManager.SitRep.ContainsKey(x.MMSI) && (AISManager.SitRep[x.MMSI].IsClassB ?? false));
|
int classBReportCnt = result.RemoveAll(x => AISManager.SitRep[x.MMSI].IsClassB ?? false);
|
||||||
_log.DebugFormat("removed {0} class B alarms from list"); // tut des?
|
_log.InfoFormat("removed {0} class B alarms from list", classBReportCnt); // tut des?
|
||||||
|
|
||||||
// auch alles entfernen was "abgelaufen" ist und nicht im SitRep enthalten ist
|
// auch alles entfernen was "abgelaufen" ist und nicht im SitRep enthalten ist
|
||||||
int expiredCnt = result.RemoveAll(x => AISManager.SitRep.ContainsKey(x.MMSI) && ((DateTime.Now - x.Timestamp_Last).TotalMinutes > 1440));
|
int expiredCnt = result.RemoveAll(x => (DateTime.Now - x.Timestamp_Last).TotalMinutes > 1440);
|
||||||
_log.InfoFormat("removed {0} expired (> 1 day) alarms from list");
|
_log.InfoFormat("removed {0} expired (> 1 day) alarms from list", expiredCnt);
|
||||||
|
|
||||||
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) {
|
||||||
|
|||||||
@ -59,7 +59,7 @@ function updateData(data, groupId) {
|
|||||||
|
|
||||||
table.childNodes[1].appendChild(row); // append row to tbody subelement
|
table.childNodes[1].appendChild(row); // append row to tbody subelement
|
||||||
}
|
}
|
||||||
|
row.setAttribute("isActive", "true");
|
||||||
const colCount = row.childNodes.length;
|
const colCount = row.childNodes.length;
|
||||||
row.childNodes[0].innerHTML = data[i].Name;
|
row.childNodes[0].innerHTML = data[i].Name;
|
||||||
if(data[i].VoyageDirection == 0) row.childNodes[1].innerHTML = '<img src="img/bullet_square_yellow.png" />';
|
if(data[i].VoyageDirection == 0) row.childNodes[1].innerHTML = '<img src="img/bullet_square_yellow.png" />';
|
||||||
@ -82,7 +82,15 @@ function updateData(data, groupId) {
|
|||||||
row.childNodes[colCount - 1].innerHTML = data[i].Destination;
|
row.childNodes[colCount - 1].innerHTML = data[i].Destination;
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: remove rows (after an interval) that are not in the result set any more
|
// array in-place removal taking place
|
||||||
|
var i = table.childNodes[1].rows.length;
|
||||||
|
while (i--) {
|
||||||
|
row = table.childNodes[1].rows[i];
|
||||||
|
if(row["isActive"] !== "true") {
|
||||||
|
table.childNodes[1].rows.remove(row);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function update() {
|
function update() {
|
||||||
@ -154,6 +162,8 @@ function createAreas()
|
|||||||
th6.innerHTML='Destination';
|
th6.innerHTML='Destination';
|
||||||
tr.appendChild(th6);
|
tr.appendChild(th6);
|
||||||
|
|
||||||
|
tr.setAttribute("isActive", "true"); // set marker so it won't get deleted later
|
||||||
|
|
||||||
aTable.appendChild(document.createElement('tbody'));
|
aTable.appendChild(document.createElement('tbody'));
|
||||||
aDiv.appendChild(aTable);
|
aDiv.appendChild(aTable);
|
||||||
aDiv.appendChild(document.createElement('hr'));
|
aDiv.appendChild(document.createElement('hr'));
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user