@aurora-blue/signalk-connector 0.2.0-dev.43 → 0.2.0-dev.45
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/VERSION +1 -1
- package/dist/src/connector.d.ts +1 -0
- package/dist/src/connector.js +18 -2
- package/dist/src/version.d.ts +1 -1
- package/dist/src/version.js +1 -1
- package/package.json +1 -1
package/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.2.0-dev.
|
|
1
|
+
0.2.0-dev.45
|
package/dist/src/connector.d.ts
CHANGED
|
@@ -51,6 +51,7 @@ export declare class ConnectorRuntime {
|
|
|
51
51
|
private readonly autoSchedule;
|
|
52
52
|
private readonly anchorAlarm;
|
|
53
53
|
private readonly telemetryReducer;
|
|
54
|
+
private readonly nmeaEnergyReducer;
|
|
54
55
|
private readonly monotonicNow;
|
|
55
56
|
private filesystemCapacity;
|
|
56
57
|
private nextCapacityRefreshAt;
|
package/dist/src/connector.js
CHANGED
|
@@ -15,8 +15,10 @@ const storage_budget_1 = require("./storage-budget");
|
|
|
15
15
|
const anchor_alarm_1 = require("./safety/anchor-alarm");
|
|
16
16
|
const telemetry_catalog_1 = require("./telemetry-catalog");
|
|
17
17
|
const telemetry_reducer_1 = require("./telemetry-reducer");
|
|
18
|
-
// Bound work waiting for flash writes in the shared Signal K process.
|
|
19
|
-
|
|
18
|
+
// Bound work waiting for flash writes in the shared Signal K process. The
|
|
19
|
+
// initial Signal K snapshot can contain several values for every nearby AIS
|
|
20
|
+
// target, so the bound must absorb that snapshot without becoming unbounded.
|
|
21
|
+
const MAXIMUM_PENDING_CAPTURE_EVENTS = 1_024;
|
|
20
22
|
const version_1 = require("./version");
|
|
21
23
|
var version_2 = require("./version");
|
|
22
24
|
Object.defineProperty(exports, "CONNECTOR_VERSION", { enumerable: true, get: function () { return version_2.CONNECTOR_VERSION; } });
|
|
@@ -67,6 +69,7 @@ class ConnectorRuntime {
|
|
|
67
69
|
autoSchedule;
|
|
68
70
|
anchorAlarm;
|
|
69
71
|
telemetryReducer;
|
|
72
|
+
nmeaEnergyReducer;
|
|
70
73
|
monotonicNow;
|
|
71
74
|
filesystemCapacity = null;
|
|
72
75
|
nextCapacityRefreshAt = 0;
|
|
@@ -93,6 +96,7 @@ class ConnectorRuntime {
|
|
|
93
96
|
const startedAt = Date.parse(this.now());
|
|
94
97
|
this.anchorAlarm = new anchor_alarm_1.AnchorAlarmEngine(config.anchorAlarm, Number.isFinite(startedAt) ? startedAt : Date.now());
|
|
95
98
|
this.telemetryReducer = new telemetry_reducer_1.TelemetryReducer(config.adaptiveTelemetryEnabled, (0, telemetry_reducer_1.rulesForProfile)(config.operatingProfile));
|
|
99
|
+
this.nmeaEnergyReducer = new telemetry_reducer_1.TelemetryReducer(true, (0, telemetry_reducer_1.rulesForProfile)(config.operatingProfile));
|
|
96
100
|
this.storageBudget = (0, storage_budget_1.resolveStorageBudget)(this.storageBudgetPolicy(), { events: 0, bytes: 0, averageRecordBytes: null }, null);
|
|
97
101
|
}
|
|
98
102
|
async start() {
|
|
@@ -753,6 +757,17 @@ class ConnectorRuntime {
|
|
|
753
757
|
return;
|
|
754
758
|
if (this.nmeaEnergySupported) {
|
|
755
759
|
for (const observation of this.nmeaEnergy.observe(message, this.app.getPath("/sources"), Date.parse(this.now()))) {
|
|
760
|
+
const event = {
|
|
761
|
+
boot_id: this.bootId,
|
|
762
|
+
context: "vessels.self",
|
|
763
|
+
path: observation.path,
|
|
764
|
+
value: observation.value,
|
|
765
|
+
source_timestamp: observation.at,
|
|
766
|
+
received_at: this.now(),
|
|
767
|
+
source: observation.source,
|
|
768
|
+
};
|
|
769
|
+
if (!this.nmeaEnergyReducer.shouldEmit(event))
|
|
770
|
+
continue;
|
|
756
771
|
this.app.handleMessage("aurora-blue-signalk-connector", {
|
|
757
772
|
context: "vessels.self",
|
|
758
773
|
updates: [
|
|
@@ -765,6 +780,7 @@ class ConnectorRuntime {
|
|
|
765
780
|
},
|
|
766
781
|
],
|
|
767
782
|
});
|
|
783
|
+
this.nmeaEnergyReducer.record(event);
|
|
768
784
|
}
|
|
769
785
|
}
|
|
770
786
|
if (!this.victronInputLimitSupported)
|
package/dist/src/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const CONNECTOR_VERSION = "0.2.0-dev.
|
|
1
|
+
export declare const CONNECTOR_VERSION = "0.2.0-dev.45";
|
package/dist/src/version.js
CHANGED
package/package.json
CHANGED