@m4l/gclick-realtime 1.10.0 → 1.11.0
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/consumer/RealTimeConsumerContext.d.ts +10 -0
- package/consumer/RealTimeConsumerContext.d.ts.map +1 -0
- package/consumer/RealTimeConsumerContext.js +128 -0
- package/consumer/index.d.ts +4 -0
- package/consumer/index.d.ts.map +1 -0
- package/consumer/index.js +7 -0
- package/consumer/types.d.ts +47 -0
- package/consumer/types.d.ts.map +1 -0
- package/consumer/useRealTimeConsumer.d.ts.map +1 -0
- package/{web/consumer → consumer}/useRealTimeConsumer.js +2 -2
- package/contracts/deviceData.d.ts +19 -22
- package/contracts/deviceData.d.ts.map +1 -1
- package/contracts/deviceDetail.d.ts +0 -2
- package/contracts/deviceDetail.d.ts.map +1 -1
- package/contracts/index.d.ts +1 -1
- package/contracts/index.d.ts.map +1 -1
- package/dummy/catalogs/baseDeviceTemplate.d.ts.map +1 -1
- package/dummy/catalogs/baseDeviceTemplate.js +4 -35
- package/dummy/catalogs/blueprints.d.ts +9 -54
- package/dummy/catalogs/blueprints.d.ts.map +1 -1
- package/dummy/catalogs/blueprints.js +25 -42
- package/dummy/catalogs/departments.d.ts +10 -0
- package/dummy/catalogs/departments.d.ts.map +1 -0
- package/dummy/catalogs/departments.js +43 -0
- package/dummy/index.d.ts +3 -3
- package/dummy/index.d.ts.map +1 -1
- package/dummy/index.js +28 -28
- package/dummy/shared/types.d.ts +2 -4
- package/dummy/shared/types.d.ts.map +1 -1
- package/dummy/{runtime → simulation}/simulation.d.ts +1 -1
- package/dummy/simulation/simulation.d.ts.map +1 -0
- package/dummy/{runtime → simulation}/simulation.js +333 -423
- package/dummy/{runtime/dummy.d.ts → source-data/SourceDataDummy.d.ts} +8 -3
- package/dummy/source-data/SourceDataDummy.d.ts.map +1 -0
- package/dummy/{runtime/dummy.js → source-data/SourceDataDummy.js} +117 -128
- package/mobile/index.d.ts +4 -0
- package/mobile/index.d.ts.map +1 -0
- package/mobile/index.js +23 -0
- package/mobile/resourceTypes.d.ts +48 -0
- package/mobile/resourceTypes.d.ts.map +1 -0
- package/mobile/resourceTypes.js +54 -0
- package/mobile/runtime/atmosphere.d.ts +10 -0
- package/mobile/runtime/atmosphere.d.ts.map +1 -0
- package/mobile/runtime/atmosphere.js +16 -0
- package/mobile/runtime/dummy.d.ts +11 -0
- package/mobile/runtime/dummy.d.ts.map +1 -0
- package/mobile/runtime/dummy.js +16 -0
- package/mobile/runtime/index.d.ts +11 -0
- package/mobile/runtime/index.d.ts.map +1 -0
- package/mobile/runtime/runtimeRegistry.d.ts +17 -0
- package/mobile/runtime/runtimeRegistry.d.ts.map +1 -0
- package/mobile/runtime/runtimeRegistry.js +24 -0
- package/mobile/runtime/sourceDataFactory.d.ts +6 -0
- package/mobile/runtime/sourceDataFactory.d.ts.map +1 -0
- package/mobile/runtime/sourceDataFactory.js +29 -0
- package/mobile/runtime/types.d.ts +8 -0
- package/mobile/runtime/types.d.ts.map +1 -0
- package/package.json +37 -1
- package/payload/mergeDevicePayloadWithUpdatedAtGuard.d.ts +1 -1
- package/payload/mergeDevicePayloadWithUpdatedAtGuard.d.ts.map +1 -1
- package/rt_alarms/constants.d.ts +6 -0
- package/rt_alarms/constants.d.ts.map +1 -0
- package/rt_alarms/constants.js +7 -0
- package/rt_alarms/index.d.ts +15 -0
- package/rt_alarms/index.d.ts.map +1 -0
- package/rt_alarms/index.js +18 -0
- package/rt_devices/constants.d.ts +4 -0
- package/rt_devices/constants.d.ts.map +1 -0
- package/rt_devices/constants.js +5 -0
- package/rt_devices/index.d.ts +22 -0
- package/rt_devices/index.d.ts.map +1 -0
- package/rt_devices/index.js +150 -0
- package/rt_devices/resourceTypeMergeStrategies.d.ts +12 -0
- package/rt_devices/resourceTypeMergeStrategies.d.ts.map +1 -0
- package/rt_devices/resourceTypeMergeStrategies.js +19 -0
- package/shared/atmosphereHost.d.ts +5 -0
- package/shared/atmosphereHost.d.ts.map +1 -0
- package/shared/atmosphereHost.js +7 -0
- package/shared/index.d.ts +5 -0
- package/shared/index.d.ts.map +1 -0
- package/shared/index.js +11 -0
- package/shared/performanceMetrics.d.ts +64 -0
- package/shared/performanceMetrics.d.ts.map +1 -0
- package/shared/performanceMetrics.js +73 -0
- package/shared/runtimeRegistry.d.ts +17 -0
- package/shared/runtimeRegistry.d.ts.map +1 -0
- package/shared/runtimeRegistry.js +27 -0
- package/shared/runtimeResourceTypesKey.d.ts +14 -0
- package/shared/runtimeResourceTypesKey.d.ts.map +1 -0
- package/shared/runtimeResourceTypesKey.js +18 -0
- package/shared/startupSnapshots.d.ts +28 -0
- package/shared/startupSnapshots.d.ts.map +1 -0
- package/shared/startupSnapshots.js +29 -0
- package/web/diagnostics/performanceMetrics.d.ts +34 -0
- package/web/diagnostics/performanceMetrics.d.ts.map +1 -0
- package/web/diagnostics/performanceMetrics.js +61 -0
- package/web/host/devicesResourceType.d.ts +3 -11
- package/web/host/devicesResourceType.d.ts.map +1 -1
- package/web/host/devicesResourceType.js +58 -171
- package/web/host/hostRuntime.d.ts +6 -8
- package/web/host/hostRuntime.d.ts.map +1 -1
- package/web/host/hostRuntime.js +29 -38
- package/web/host/index.d.ts +2 -2
- package/web/host/index.d.ts.map +1 -1
- package/web/host/launchContract.d.ts +19 -13
- package/web/host/launchContract.d.ts.map +1 -1
- package/web/host/launchContract.js +82 -76
- package/web/index.d.ts +2 -7
- package/web/index.d.ts.map +1 -1
- package/web/index.js +34 -62
- package/web/runtime/atmosphere.d.ts +12 -0
- package/web/runtime/atmosphere.d.ts.map +1 -0
- package/web/runtime/atmosphere.js +22 -0
- package/web/runtime/dummy.d.ts +11 -0
- package/web/runtime/dummy.d.ts.map +1 -0
- package/web/runtime/dummy.js +22 -0
- package/web/runtime/index.d.ts +8 -9
- package/web/runtime/index.d.ts.map +1 -1
- package/web/runtime/performanceMetricReporter.d.ts +8 -0
- package/web/runtime/performanceMetricReporter.d.ts.map +1 -0
- package/web/runtime/performanceMetricReporter.js +10 -0
- package/web/runtime/runtimeRegistry.d.ts +21 -5
- package/web/runtime/runtimeRegistry.d.ts.map +1 -1
- package/web/runtime/runtimeRegistry.js +22 -7
- package/web/runtime/sourceDataFactory.d.ts +7 -0
- package/web/runtime/sourceDataFactory.d.ts.map +1 -0
- package/web/runtime/sourceDataFactory.js +26 -0
- package/web/{producer → runtime}/types.d.ts +2 -7
- package/web/runtime/types.d.ts.map +1 -0
- package/dummy/catalogs/group.d.ts +0 -10
- package/dummy/catalogs/group.d.ts.map +0 -1
- package/dummy/catalogs/group.js +0 -46
- package/dummy/runtime/dummy.d.ts.map +0 -1
- package/dummy/runtime/simulation.d.ts.map +0 -1
- package/libs/observability/mf/src/browserRuntimeHandles.js +0 -350
- package/libs/observability/mf/src/diagnosticPolicies/catalog.js +0 -12
- package/libs/observability/mf/src/diagnosticPolicies/contracts.js +0 -8
- package/libs/observability/mf/src/diagnosticPolicies/host.js +0 -127
- package/libs/observability/mf/src/diagnosticPolicies/operativeMyGpsDevices.js +0 -79
- package/web/consumer/RealTimeConsumerContext.d.ts +0 -10
- package/web/consumer/RealTimeConsumerContext.d.ts.map +0 -1
- package/web/consumer/RealTimeConsumerContext.js +0 -156
- package/web/consumer/index.d.ts +0 -6
- package/web/consumer/index.d.ts.map +0 -1
- package/web/consumer/store.d.ts +0 -10
- package/web/consumer/store.d.ts.map +0 -1
- package/web/consumer/store.helpers.d.ts +0 -62
- package/web/consumer/store.helpers.d.ts.map +0 -1
- package/web/consumer/store.helpers.js +0 -141
- package/web/consumer/store.js +0 -227
- package/web/consumer/types.d.ts +0 -161
- package/web/consumer/types.d.ts.map +0 -1
- package/web/consumer/useRealTimeConsumer.d.ts.map +0 -1
- package/web/host/startupSnapshots.d.ts +0 -45
- package/web/host/startupSnapshots.d.ts.map +0 -1
- package/web/host/startupSnapshots.js +0 -103
- package/web/producer/RealTimeProducerContext.d.ts +0 -9
- package/web/producer/RealTimeProducerContext.d.ts.map +0 -1
- package/web/producer/RealTimeProducerContext.js +0 -16
- package/web/producer/index.d.ts +0 -7
- package/web/producer/index.d.ts.map +0 -1
- package/web/producer/sourceDataFactory.d.ts +0 -13
- package/web/producer/sourceDataFactory.d.ts.map +0 -1
- package/web/producer/sourceDataFactory.js +0 -32
- package/web/producer/store.d.ts +0 -7
- package/web/producer/store.d.ts.map +0 -1
- package/web/producer/store.js +0 -5
- package/web/producer/types.d.ts.map +0 -1
- package/web/producer/useRealTimeProducer.d.ts +0 -7
- package/web/producer/useRealTimeProducer.d.ts.map +0 -1
- package/web/producer/useRealTimeProducer.js +0 -15
- package/web/runtime/resourceTypeMergeStrategies.d.ts +0 -10
- package/web/runtime/resourceTypeMergeStrategies.d.ts.map +0 -1
- package/web/runtime/resourceTypeMergeStrategies.js +0 -19
- package/web/runtime/runtime.d.ts +0 -16
- package/web/runtime/runtime.d.ts.map +0 -1
- package/web/runtime/runtime.js +0 -28
- package/web/runtime/runtimeAtmosphereOnly.d.ts +0 -11
- package/web/runtime/runtimeAtmosphereOnly.d.ts.map +0 -1
- package/web/runtime/runtimeAtmosphereOnly.js +0 -28
- package/web/runtime/runtimeRegistry.shared.d.ts +0 -23
- package/web/runtime/runtimeRegistry.shared.d.ts.map +0 -1
- package/web/runtime/runtimeRegistry.shared.js +0 -47
- package/web/runtime/runtimeRegistryAtmosphereOnly.d.ts +0 -9
- package/web/runtime/runtimeRegistryAtmosphereOnly.d.ts.map +0 -1
- package/web/runtime/runtimeRegistryAtmosphereOnly.js +0 -13
- package/web/shared/constants.d.ts +0 -11
- package/web/shared/constants.d.ts.map +0 -1
- package/web/shared/constants.js +0 -11
- package/web/shared/index.d.ts +0 -3
- package/web/shared/index.d.ts.map +0 -1
- package/web/shared/performanceMetrics.d.ts +0 -48
- package/web/shared/performanceMetrics.d.ts.map +0 -1
- package/web/shared/performanceMetrics.js +0 -70
- package/web/shared/runtimeTypes.d.ts +0 -4
- package/web/shared/runtimeTypes.d.ts.map +0 -1
- /package/{web/consumer → consumer}/useRealTimeConsumer.d.ts +0 -0
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { getVptValueWithGuard as
|
|
2
|
-
import { GNSSEnumSignal as
|
|
3
|
-
import { calculateDistanceMeters as
|
|
4
|
-
import { createRealTimeDummySimulationConfigFromPreset as
|
|
5
|
-
import { REAL_TIME_DUMMY_DEFAULT_SCENARIO_ID as
|
|
6
|
-
import
|
|
1
|
+
import { getVptValueWithGuard as L } from "../../payload/getVptValueWithGuard.js";
|
|
2
|
+
import { GNSSEnumSignal as w, ADCPowerEnum as y, GNSSEnumMotionStatus as p } from "../../contracts/constants.js";
|
|
3
|
+
import { calculateDistanceMeters as W, calculatePolylineDistanceMeters as te, resolveFrameSpeedKph as ne, interpolateCoordinate as se, calculateCourseDegrees as ae } from "../shared/helpers.js";
|
|
4
|
+
import { createRealTimeDummySimulationConfigFromPreset as ie, REAL_TIME_DUMMY_SIMULATION_PRESETS as oe } from "../catalogs/presets.js";
|
|
5
|
+
import { REAL_TIME_DUMMY_DEFAULT_SCENARIO_ID as re, REAL_TIME_DUMMY_SCENARIOS as U, REAL_TIME_DUMMY_DEFAULT_PLAYBACK as E } from "../catalogs/scenarios.js";
|
|
6
|
+
import D from "../../node_modules/lodash-es/cloneDeep.js";
|
|
7
7
|
import { REAL_TIME_DUMMY_ROUTE_TEMPLATES as G } from "../catalogs/routes.js";
|
|
8
8
|
import { REAL_TIME_DUMMY_EXECUTION_PLANS as N } from "../catalogs/plans.js";
|
|
9
9
|
import { REAL_TIME_DUMMY_DEVICE_BLUEPRINTS as x } from "../catalogs/blueprints.js";
|
|
10
|
-
import
|
|
11
|
-
import { REAL_TIME_DUMMY_DEFAULT_ICON_ID as
|
|
12
|
-
import
|
|
13
|
-
const C = Date.parse("2026-04-21T12:00:00.000Z"),
|
|
10
|
+
import b from "../../node_modules/lodash-es/merge.js";
|
|
11
|
+
import { REAL_TIME_DUMMY_DEFAULT_ICON_ID as ce, REAL_TIME_DUMMY_BASE_DEVICE_TEMPLATE as ue } from "../catalogs/baseDeviceTemplate.js";
|
|
12
|
+
import T from "../../node_modules/lodash-es/unset.js";
|
|
13
|
+
const C = Date.parse("2026-04-21T12:00:00.000Z"), H = [
|
|
14
14
|
"gnssCourse",
|
|
15
15
|
"gnssLatitude",
|
|
16
16
|
"gnssLongitude",
|
|
17
17
|
"gnssSpeed"
|
|
18
|
-
],
|
|
18
|
+
], Z = [
|
|
19
19
|
"adcPowerBackupLevel",
|
|
20
20
|
"adcPowerBackupStatus",
|
|
21
21
|
"adcPowerBackupVolt",
|
|
@@ -24,27 +24,11 @@ const C = Date.parse("2026-04-21T12:00:00.000Z"), Q = [
|
|
|
24
24
|
"adcPowerMainVolt",
|
|
25
25
|
"adcPowerSrcMainBatteryType"
|
|
26
26
|
];
|
|
27
|
-
function
|
|
27
|
+
function A(e, t) {
|
|
28
28
|
return Object.hasOwn(e, t);
|
|
29
29
|
}
|
|
30
|
-
const
|
|
31
|
-
function
|
|
32
|
-
if (e)
|
|
33
|
-
return {
|
|
34
|
-
bgColor: e.color,
|
|
35
|
-
id: e.id,
|
|
36
|
-
name: e.name
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
function ge(e) {
|
|
40
|
-
if (e)
|
|
41
|
-
return {
|
|
42
|
-
color: e.bgColor,
|
|
43
|
-
id: e.id,
|
|
44
|
-
name: e.name
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
function S(e, t) {
|
|
30
|
+
const le = "rt_devices";
|
|
31
|
+
function h(e, t) {
|
|
48
32
|
if (!e)
|
|
49
33
|
return e;
|
|
50
34
|
const n = Date.parse(e);
|
|
@@ -52,103 +36,73 @@ function S(e, t) {
|
|
|
52
36
|
t + (n - C)
|
|
53
37
|
).toISOString() : e;
|
|
54
38
|
}
|
|
55
|
-
function
|
|
39
|
+
function I(e) {
|
|
56
40
|
return typeof e == "object" && e !== null && "value" in e;
|
|
57
41
|
}
|
|
58
|
-
function
|
|
42
|
+
function de(e, t, n) {
|
|
59
43
|
const a = e.vpts?.vptGnss?.[t];
|
|
60
|
-
|
|
44
|
+
I(a) && (a.updatedAt = h(
|
|
61
45
|
a.updatedAt,
|
|
62
46
|
n
|
|
63
47
|
));
|
|
64
48
|
}
|
|
65
49
|
function F(e, t) {
|
|
66
|
-
e && (e.updatedAt =
|
|
50
|
+
e && (e.updatedAt = h(
|
|
67
51
|
e.updatedAt,
|
|
68
52
|
t
|
|
69
|
-
), e.value =
|
|
53
|
+
), e.value = h(
|
|
70
54
|
e.value,
|
|
71
55
|
t
|
|
72
56
|
) ?? e.value);
|
|
73
57
|
}
|
|
74
|
-
function
|
|
75
|
-
e && (e.updatedAt = S(
|
|
76
|
-
e.updatedAt,
|
|
77
|
-
t
|
|
78
|
-
), e.value = S(
|
|
79
|
-
e.value,
|
|
80
|
-
t
|
|
81
|
-
) ?? e.value);
|
|
82
|
-
}
|
|
83
|
-
function q(e, t) {
|
|
84
|
-
e && (e.updatedAt = S(
|
|
85
|
-
e.updatedAt,
|
|
86
|
-
t
|
|
87
|
-
));
|
|
88
|
-
}
|
|
89
|
-
function ye(e, t, n) {
|
|
58
|
+
function pe(e, t, n) {
|
|
90
59
|
const a = e.vpts?.vptGnss?.[t];
|
|
91
|
-
|
|
60
|
+
I(a) && (a.updatedAt = n);
|
|
92
61
|
}
|
|
93
|
-
function
|
|
94
|
-
e && (e.updatedAt = t, e.value = t);
|
|
95
|
-
}
|
|
96
|
-
function $(e, t) {
|
|
62
|
+
function K(e, t) {
|
|
97
63
|
e && (e.updatedAt = t, e.value = t);
|
|
98
64
|
}
|
|
99
|
-
function
|
|
100
|
-
|
|
101
|
-
}
|
|
102
|
-
function P(e, t, n) {
|
|
103
|
-
return L(e) ? {
|
|
65
|
+
function R(e, t, n) {
|
|
66
|
+
return I(e) ? {
|
|
104
67
|
...e,
|
|
105
68
|
updatedAt: n,
|
|
106
69
|
value: t
|
|
107
|
-
} :
|
|
70
|
+
} : {
|
|
71
|
+
updatedAt: n,
|
|
72
|
+
value: t
|
|
73
|
+
};
|
|
108
74
|
}
|
|
109
75
|
function X(e, t) {
|
|
110
|
-
return
|
|
111
|
-
|
|
112
|
-
t
|
|
113
|
-
), q(
|
|
114
|
-
e.reportProfiles?.generalEvents?.reportProfileLastEventId,
|
|
115
|
-
t
|
|
116
|
-
), K(
|
|
117
|
-
e.reportProfiles?.systemEvents?.reportProfileLastEventDate,
|
|
118
|
-
t
|
|
119
|
-
), q(
|
|
120
|
-
e.reportProfiles?.systemEvents?.reportProfileLastEventId,
|
|
121
|
-
t
|
|
122
|
-
), Object.values(e.vpts?.vptDiX ?? {}).forEach((n) => {
|
|
123
|
-
n.diXStatus && (n.diXStatus.updatedAt = S(
|
|
76
|
+
return Object.values(e.vpts?.vptDiX ?? {}).forEach((n) => {
|
|
77
|
+
n.diXStatus && (n.diXStatus.updatedAt = h(
|
|
124
78
|
n.diXStatus.updatedAt,
|
|
125
79
|
t
|
|
126
|
-
)), n.diXValue && (n.diXValue.updatedAt =
|
|
80
|
+
)), n.diXValue && (n.diXValue.updatedAt = h(
|
|
127
81
|
n.diXValue.updatedAt,
|
|
128
82
|
t
|
|
129
83
|
));
|
|
130
84
|
}), Object.values(e.vpts?.vptDoX ?? {}).forEach((n) => {
|
|
131
|
-
n.diXValue && (n.diXValue.updatedAt =
|
|
85
|
+
n.diXValue && (n.diXValue.updatedAt = h(
|
|
132
86
|
n.diXValue.updatedAt,
|
|
133
87
|
t
|
|
134
88
|
));
|
|
135
|
-
}), e.vpts?.vptGnss?.gnssMotionStatus && (e.vpts.vptGnss.gnssMotionStatus.updatedAt =
|
|
89
|
+
}), e.vpts?.vptGnss?.gnssMotionStatus && (e.vpts.vptGnss.gnssMotionStatus.updatedAt = h(
|
|
136
90
|
e.vpts.vptGnss.gnssMotionStatus.updatedAt,
|
|
137
91
|
t
|
|
138
|
-
)), e.vpts?.vptGnss?.gnssSignal && (e.vpts.vptGnss.gnssSignal.updatedAt =
|
|
92
|
+
)), e.vpts?.vptGnss?.gnssSignal && (e.vpts.vptGnss.gnssSignal.updatedAt = h(
|
|
139
93
|
e.vpts.vptGnss.gnssSignal.updatedAt,
|
|
140
94
|
t
|
|
141
|
-
)), e.vpts?.vptIgnition?.ignitionValue && (e.vpts.vptIgnition.ignitionValue.updatedAt =
|
|
95
|
+
)), e.vpts?.vptIgnition?.ignitionValue && (e.vpts.vptIgnition.ignitionValue.updatedAt = h(
|
|
142
96
|
e.vpts.vptIgnition.ignitionValue.updatedAt,
|
|
143
97
|
t
|
|
144
|
-
)),
|
|
98
|
+
)), Z.forEach((n) => {
|
|
145
99
|
const a = e.vpts?.vptAdcPower?.[n];
|
|
146
|
-
|
|
100
|
+
I(a) && (a.updatedAt = h(
|
|
147
101
|
a.updatedAt,
|
|
148
102
|
t
|
|
149
103
|
));
|
|
150
|
-
}),
|
|
151
|
-
|
|
104
|
+
}), H.forEach((n) => {
|
|
105
|
+
de(e, n, t);
|
|
152
106
|
}), e.vpts?.vptNetwork && (F(
|
|
153
107
|
e.vpts.vptNetwork.networkLastConnectionDate,
|
|
154
108
|
t
|
|
@@ -157,47 +111,35 @@ function X(e, t) {
|
|
|
157
111
|
t
|
|
158
112
|
)), e;
|
|
159
113
|
}
|
|
160
|
-
function
|
|
161
|
-
const n =
|
|
114
|
+
function me(e, t) {
|
|
115
|
+
const n = D(e);
|
|
162
116
|
return X(n.current, t), n;
|
|
163
117
|
}
|
|
164
|
-
function
|
|
165
|
-
const n =
|
|
166
|
-
return
|
|
167
|
-
n.current.reportProfiles?.generalEvents?.reportProfileLastEventDate,
|
|
168
|
-
a
|
|
169
|
-
), j(
|
|
170
|
-
n.current.reportProfiles?.generalEvents?.reportProfileLastEventId,
|
|
171
|
-
a
|
|
172
|
-
), $(
|
|
173
|
-
n.current.reportProfiles?.systemEvents?.reportProfileLastEventDate,
|
|
174
|
-
a
|
|
175
|
-
), j(
|
|
176
|
-
n.current.reportProfiles?.systemEvents?.reportProfileLastEventId,
|
|
177
|
-
a
|
|
178
|
-
), Object.values(n.current.vpts?.vptDiX ?? {}).forEach((s) => {
|
|
118
|
+
function ve(e, t) {
|
|
119
|
+
const n = D(e), a = new Date(t).toISOString();
|
|
120
|
+
return Object.values(n.current.vpts?.vptDiX ?? {}).forEach((s) => {
|
|
179
121
|
s.diXStatus && (s.diXStatus.updatedAt = a), s.diXValue && (s.diXValue.updatedAt = a);
|
|
180
122
|
}), Object.values(n.current.vpts?.vptDoX ?? {}).forEach((s) => {
|
|
181
123
|
s.diXValue && (s.diXValue.updatedAt = a);
|
|
182
|
-
}), n.current.vpts?.vptGnss?.gnssMotionStatus && (n.current.vpts.vptGnss.gnssMotionStatus.updatedAt = a), n.current.vpts?.vptGnss?.gnssSignal && (n.current.vpts.vptGnss.gnssSignal.updatedAt = a), n.current.vpts?.vptIgnition?.ignitionValue && (n.current.vpts.vptIgnition.ignitionValue.updatedAt = a),
|
|
183
|
-
const
|
|
184
|
-
|
|
185
|
-
}),
|
|
186
|
-
|
|
124
|
+
}), n.current.vpts?.vptGnss?.gnssMotionStatus && (n.current.vpts.vptGnss.gnssMotionStatus.updatedAt = a), n.current.vpts?.vptGnss?.gnssSignal && (n.current.vpts.vptGnss.gnssSignal.updatedAt = a), n.current.vpts?.vptIgnition?.ignitionValue && (n.current.vpts.vptIgnition.ignitionValue.updatedAt = a), Z.forEach((s) => {
|
|
125
|
+
const i = n.current.vpts?.vptAdcPower?.[s];
|
|
126
|
+
I(i) && (i.updatedAt = a);
|
|
127
|
+
}), H.forEach((s) => {
|
|
128
|
+
pe(
|
|
187
129
|
n.current,
|
|
188
130
|
s,
|
|
189
131
|
a
|
|
190
132
|
);
|
|
191
|
-
}), n.current.vpts?.vptNetwork && (
|
|
133
|
+
}), n.current.vpts?.vptNetwork && (K(
|
|
192
134
|
n.current.vpts.vptNetwork.networkLastConnectionDate,
|
|
193
135
|
a
|
|
194
|
-
),
|
|
136
|
+
), K(
|
|
195
137
|
n.current.vpts.vptNetwork.networkLastEventDate,
|
|
196
138
|
a
|
|
197
139
|
)), n;
|
|
198
140
|
}
|
|
199
|
-
function
|
|
200
|
-
const n =
|
|
141
|
+
function ge(e, t) {
|
|
142
|
+
const n = D(e);
|
|
201
143
|
if (n.type === "delete")
|
|
202
144
|
return n;
|
|
203
145
|
if (n.type === "new") {
|
|
@@ -209,51 +151,51 @@ function Ee(e, t) {
|
|
|
209
151
|
t
|
|
210
152
|
), n;
|
|
211
153
|
}
|
|
212
|
-
function
|
|
154
|
+
function q(e, t) {
|
|
213
155
|
return {
|
|
214
|
-
...
|
|
156
|
+
...E,
|
|
215
157
|
...e,
|
|
216
158
|
...t,
|
|
217
159
|
framesPerTick: Math.max(
|
|
218
160
|
1,
|
|
219
|
-
t?.framesPerTick ?? e?.framesPerTick ??
|
|
161
|
+
t?.framesPerTick ?? e?.framesPerTick ?? E.framesPerTick
|
|
220
162
|
),
|
|
221
163
|
intervalMs: Math.max(
|
|
222
164
|
1,
|
|
223
|
-
t?.intervalMs ?? e?.intervalMs ??
|
|
165
|
+
t?.intervalMs ?? e?.intervalMs ?? E.intervalMs
|
|
224
166
|
),
|
|
225
167
|
logicalSampleSeconds: Math.max(
|
|
226
168
|
1,
|
|
227
|
-
t?.logicalSampleSeconds ?? e?.logicalSampleSeconds ??
|
|
169
|
+
t?.logicalSampleSeconds ?? e?.logicalSampleSeconds ?? E.logicalSampleSeconds
|
|
228
170
|
)
|
|
229
171
|
};
|
|
230
172
|
}
|
|
231
|
-
function
|
|
232
|
-
if (!
|
|
173
|
+
function fe(e) {
|
|
174
|
+
if (!A(x, e))
|
|
233
175
|
throw new Error(`Unknown dummy blueprint "${e}"`);
|
|
234
176
|
return x[e];
|
|
235
177
|
}
|
|
236
|
-
function
|
|
237
|
-
if (!
|
|
178
|
+
function Me(e) {
|
|
179
|
+
if (!A(G, e))
|
|
238
180
|
throw new Error(`Unknown dummy route "${e}"`);
|
|
239
181
|
return G[e];
|
|
240
182
|
}
|
|
241
|
-
function
|
|
242
|
-
if (!
|
|
183
|
+
function Se(e) {
|
|
184
|
+
if (!A(N, e))
|
|
243
185
|
throw new Error(`Unknown dummy plan "${e}"`);
|
|
244
186
|
return N[e];
|
|
245
187
|
}
|
|
246
|
-
function
|
|
247
|
-
const t =
|
|
188
|
+
function ye(e) {
|
|
189
|
+
const t = oe[e];
|
|
248
190
|
if (!t)
|
|
249
191
|
throw new Error(`Unknown dummy simulation preset "${e}"`);
|
|
250
192
|
return t;
|
|
251
193
|
}
|
|
252
|
-
function
|
|
194
|
+
function De(e) {
|
|
253
195
|
const t = e.reduce(
|
|
254
|
-
(n, a, s,
|
|
255
|
-
const
|
|
256
|
-
return
|
|
196
|
+
(n, a, s, i) => {
|
|
197
|
+
const o = a.assignment.resourceSerialId;
|
|
198
|
+
return i.findIndex((r) => r.assignment.resourceSerialId === o) !== s && !n.includes(o) && n.push(o), n;
|
|
257
199
|
},
|
|
258
200
|
[]
|
|
259
201
|
);
|
|
@@ -262,50 +204,50 @@ function Le(e) {
|
|
|
262
204
|
`Dummy simulation resolved duplicate device ids: ${t.join(", ")}. Each preset must contribute its own unique resourceSerialId values.`
|
|
263
205
|
);
|
|
264
206
|
}
|
|
265
|
-
function
|
|
266
|
-
const t = e?.presetId, n = t ?
|
|
267
|
-
if (!
|
|
207
|
+
function he(e) {
|
|
208
|
+
const t = e?.presetId, n = t ? ye(t).simulation : void 0, a = e?.scenarioId ?? n?.scenarioId ?? re;
|
|
209
|
+
if (!A(U, a))
|
|
268
210
|
throw new Error(`Unknown dummy scenario "${a}"`);
|
|
269
|
-
const s = U[a],
|
|
270
|
-
(
|
|
271
|
-
assignment:
|
|
272
|
-
blueprint:
|
|
273
|
-
plan:
|
|
274
|
-
route:
|
|
211
|
+
const s = U[a], i = (e?.devices ?? n?.devices ?? s.devices).map(
|
|
212
|
+
(o) => ({
|
|
213
|
+
assignment: o,
|
|
214
|
+
blueprint: fe(o.blueprintId),
|
|
215
|
+
plan: Se(o.planId),
|
|
216
|
+
route: Me(o.routeId)
|
|
275
217
|
})
|
|
276
218
|
);
|
|
277
|
-
return
|
|
278
|
-
devices:
|
|
279
|
-
playback:
|
|
280
|
-
|
|
219
|
+
return De(i), {
|
|
220
|
+
devices: i,
|
|
221
|
+
playback: q(
|
|
222
|
+
q(s.playback, n?.playback),
|
|
281
223
|
e?.playback
|
|
282
224
|
)
|
|
283
225
|
};
|
|
284
226
|
}
|
|
285
|
-
function
|
|
227
|
+
function z(e) {
|
|
286
228
|
switch (e) {
|
|
287
|
-
case
|
|
229
|
+
case w.noSignal:
|
|
288
230
|
return 2;
|
|
289
|
-
case
|
|
231
|
+
case w.acceptable:
|
|
290
232
|
return 19;
|
|
291
|
-
case
|
|
233
|
+
case w.reliable:
|
|
292
234
|
default:
|
|
293
235
|
return 31;
|
|
294
236
|
}
|
|
295
237
|
}
|
|
296
|
-
function
|
|
238
|
+
function we(e) {
|
|
297
239
|
switch (e) {
|
|
298
|
-
case
|
|
240
|
+
case w.noSignal:
|
|
299
241
|
return {
|
|
300
242
|
gnssHdop: 4.9,
|
|
301
243
|
gnssSatellitesInUse: 0
|
|
302
244
|
};
|
|
303
|
-
case
|
|
245
|
+
case w.acceptable:
|
|
304
246
|
return {
|
|
305
247
|
gnssHdop: 1.7,
|
|
306
248
|
gnssSatellitesInUse: 8
|
|
307
249
|
};
|
|
308
|
-
case
|
|
250
|
+
case w.reliable:
|
|
309
251
|
default:
|
|
310
252
|
return {
|
|
311
253
|
gnssHdop: 0.8,
|
|
@@ -316,17 +258,17 @@ function Pe(e) {
|
|
|
316
258
|
function O(e, t, n) {
|
|
317
259
|
return Math.min(n, Math.max(t, e));
|
|
318
260
|
}
|
|
319
|
-
function
|
|
261
|
+
function Y(e) {
|
|
320
262
|
return Math.round(e * 10) / 10;
|
|
321
263
|
}
|
|
322
|
-
function
|
|
323
|
-
return e <= 0 ?
|
|
264
|
+
function $(e, t) {
|
|
265
|
+
return e <= 0 ? y.lost : t === "4.5" ? e >= 4.1 ? y.ok : y.low : t === "12" ? e >= 12.4 ? y.ok : y.low : e >= 24.8 ? y.ok : y.low;
|
|
324
266
|
}
|
|
325
|
-
function
|
|
267
|
+
function j(e, t) {
|
|
326
268
|
const [n, a] = t === "4.5" ? [3.8, 4.2] : t === "12" ? [12, 13.8] : [24.3, 27.9], s = (e - n) / (a - n);
|
|
327
269
|
return Math.round(O(s, 0, 1) * 100);
|
|
328
270
|
}
|
|
329
|
-
function
|
|
271
|
+
function V(e, t) {
|
|
330
272
|
const n = [0, 0.04, -0.03, 0.06, -0.02], a = n[t % n.length] ?? 0;
|
|
331
273
|
let s = e.ignition ? 13.6 : 12.3;
|
|
332
274
|
switch (e.motionStatus) {
|
|
@@ -356,142 +298,142 @@ function A(e, t) {
|
|
|
356
298
|
s = e.ignition ? 13.6 : 12.3;
|
|
357
299
|
break;
|
|
358
300
|
}
|
|
359
|
-
e.signal ===
|
|
360
|
-
let
|
|
301
|
+
e.signal === w.noSignal && (s -= 0.2);
|
|
302
|
+
let i = e.ignition ? 4.16 : 4.04;
|
|
361
303
|
switch (e.motionStatus) {
|
|
362
304
|
case p.notDetectable:
|
|
363
|
-
|
|
305
|
+
i = e.ignition ? 4.05 : 3.98;
|
|
364
306
|
break;
|
|
365
307
|
case p.off:
|
|
366
|
-
|
|
308
|
+
i = 4;
|
|
367
309
|
break;
|
|
368
310
|
case p.towing:
|
|
369
|
-
|
|
311
|
+
i = 3.96;
|
|
370
312
|
break;
|
|
371
313
|
case p.stopped:
|
|
372
|
-
|
|
314
|
+
i = e.ignition ? 4.08 : 4;
|
|
373
315
|
break;
|
|
374
316
|
case p.stoppedRalenti:
|
|
375
|
-
|
|
317
|
+
i = 4.13;
|
|
376
318
|
break;
|
|
377
319
|
case p.stoppedExcesiveRalenti:
|
|
378
|
-
|
|
320
|
+
i = 4.1;
|
|
379
321
|
break;
|
|
380
322
|
case p.maxSpeed:
|
|
381
|
-
|
|
323
|
+
i = 4.18;
|
|
382
324
|
break;
|
|
383
325
|
case p.moving:
|
|
384
326
|
default:
|
|
385
|
-
|
|
327
|
+
i = e.ignition ? 4.16 : 4.04;
|
|
386
328
|
break;
|
|
387
329
|
}
|
|
388
|
-
e.signal ===
|
|
389
|
-
const
|
|
330
|
+
e.signal === w.acceptable && (i -= 0.03), e.signal === w.noSignal && (i -= 0.08);
|
|
331
|
+
const o = Y(O(s + a, 11.8, 13.9)), c = Y(O(i + a / 2, 3.8, 4.2));
|
|
390
332
|
return {
|
|
391
|
-
backupLevel:
|
|
392
|
-
backupStatus:
|
|
393
|
-
backupVolt:
|
|
394
|
-
mainLevel:
|
|
395
|
-
mainStatus:
|
|
396
|
-
mainVolt:
|
|
333
|
+
backupLevel: j(c, "4.5"),
|
|
334
|
+
backupStatus: $(c, "4.5"),
|
|
335
|
+
backupVolt: c,
|
|
336
|
+
mainLevel: j(o, "12"),
|
|
337
|
+
mainStatus: $(o, "12"),
|
|
338
|
+
mainVolt: o,
|
|
397
339
|
srcMainBatteryType: 0
|
|
398
340
|
};
|
|
399
341
|
}
|
|
400
|
-
function
|
|
342
|
+
function ke(e) {
|
|
401
343
|
return Object.fromEntries(
|
|
402
|
-
Object.entries(e.vpts?.vptDiX ?? {}).map(([t, n]) => [t, !!
|
|
344
|
+
Object.entries(e.vpts?.vptDiX ?? {}).map(([t, n]) => [t, !!L(n.diXValue, !1)])
|
|
403
345
|
);
|
|
404
346
|
}
|
|
405
|
-
function
|
|
347
|
+
function Te(e) {
|
|
406
348
|
return Object.fromEntries(
|
|
407
|
-
Object.entries(e.vpts?.vptDoX ?? {}).map(([t, n]) => [t, !!
|
|
349
|
+
Object.entries(e.vpts?.vptDoX ?? {}).map(([t, n]) => [t, !!L(n.diXValue, !1)])
|
|
408
350
|
);
|
|
409
351
|
}
|
|
410
352
|
function B(e, t) {
|
|
411
353
|
return e.motionStatus !== void 0 ? e.motionStatus : t.ignition ? e.speedKph >= 55 ? p.maxSpeed : p.moving : p.towing;
|
|
412
354
|
}
|
|
413
|
-
function
|
|
355
|
+
function J(e, t) {
|
|
414
356
|
return e.motionStatus !== void 0 ? e.motionStatus : t.ignition ? p.stopped : p.off;
|
|
415
357
|
}
|
|
416
|
-
function
|
|
358
|
+
function Q(e, t) {
|
|
417
359
|
const n = t.signal ?? e.signal;
|
|
418
360
|
return {
|
|
419
361
|
diX: t.diX ? { ...e.diX, ...t.diX } : { ...e.diX },
|
|
420
362
|
doX: t.doX ? { ...e.doX, ...t.doX } : { ...e.doX },
|
|
421
363
|
ignition: t.ignition ?? e.ignition,
|
|
422
|
-
modemCsq: t.modemCsq ?? (t.signal !== void 0 ?
|
|
364
|
+
modemCsq: t.modemCsq ?? (t.signal !== void 0 ? z(n) : e.modemCsq),
|
|
423
365
|
signal: n
|
|
424
366
|
};
|
|
425
367
|
}
|
|
426
|
-
function
|
|
368
|
+
function be(e, t) {
|
|
427
369
|
return e.omitDeviceIcon ?? t.omitDeviceIcon ?? !1;
|
|
428
370
|
}
|
|
429
|
-
function
|
|
430
|
-
const n =
|
|
431
|
-
|
|
432
|
-
const a = e.
|
|
433
|
-
if (n.department =
|
|
371
|
+
function Ie(e, t) {
|
|
372
|
+
const n = D(ue);
|
|
373
|
+
b(n.current, t.currentPatch ?? {}), b(n.current, e.currentPatch ?? {}), b(n.settings, t.settingsPatch ?? {}), n.settings.active = e.active ?? t.active ?? n.settings.active, n.alias = e.alias ?? t.alias ?? n.alias;
|
|
374
|
+
const a = e.department ?? t.department ?? n.department;
|
|
375
|
+
if (n.department = a, n.settings.iconBgColor = e.iconBgColor ?? t.iconBgColor ?? n.settings.iconBgColor, be(e, t))
|
|
434
376
|
n.deviceIcon = void 0;
|
|
435
377
|
else {
|
|
436
378
|
n.deviceIcon ??= {
|
|
437
|
-
iconId:
|
|
379
|
+
iconId: ce
|
|
438
380
|
};
|
|
439
381
|
const i = e.iconId ?? t.iconId ?? n.deviceIcon.iconId;
|
|
440
382
|
n.deviceIcon.iconId = i;
|
|
441
383
|
}
|
|
442
384
|
n.name = e.name ?? t.name, n.settings.properties?.internal_name && (n.settings.properties.internal_name.value = `${n.name}-${e.resourceSerialId}`);
|
|
443
|
-
const
|
|
385
|
+
const s = String(e.resourceSerialId);
|
|
444
386
|
return {
|
|
445
387
|
...n,
|
|
446
|
-
id: Number(
|
|
388
|
+
id: Number(s)
|
|
447
389
|
};
|
|
448
390
|
}
|
|
449
|
-
function
|
|
450
|
-
const t = e.current.vpts?.vptGnss?.gnssSignal?.value ??
|
|
391
|
+
function Ee(e) {
|
|
392
|
+
const t = e.current.vpts?.vptGnss?.gnssSignal?.value ?? w.reliable;
|
|
451
393
|
return {
|
|
452
|
-
diX:
|
|
453
|
-
doX:
|
|
454
|
-
ignition: !!
|
|
455
|
-
modemCsq:
|
|
394
|
+
diX: ke(e.current),
|
|
395
|
+
doX: Te(e.current),
|
|
396
|
+
ignition: !!L(e.current.vpts?.vptIgnition?.ignitionValue, !0),
|
|
397
|
+
modemCsq: L(
|
|
456
398
|
e.current.vpts?.vptModem?.modemCsq,
|
|
457
|
-
|
|
399
|
+
z(t)
|
|
458
400
|
),
|
|
459
401
|
signal: t
|
|
460
402
|
};
|
|
461
403
|
}
|
|
462
|
-
function
|
|
404
|
+
function Re(e, t) {
|
|
463
405
|
if (e.playbackOffsetSeconds !== void 0)
|
|
464
406
|
return Math.max(0, e.playbackOffsetSeconds);
|
|
465
407
|
const n = Number(e.resourceSerialId);
|
|
466
408
|
return Number.isFinite(n) ? Math.abs(n) % 12 * t.logicalSampleSeconds * 4 : 0;
|
|
467
409
|
}
|
|
468
|
-
function
|
|
410
|
+
function Le(e, t) {
|
|
469
411
|
if (e.emissionOffsetMs !== void 0)
|
|
470
412
|
return Math.max(0, e.emissionOffsetMs % t.intervalMs);
|
|
471
413
|
const n = Number(e.resourceSerialId);
|
|
472
414
|
return Number.isFinite(n) ? Math.abs(n * 137 % t.intervalMs) : 0;
|
|
473
415
|
}
|
|
474
|
-
function
|
|
416
|
+
function Ae(e) {
|
|
475
417
|
return {
|
|
476
|
-
cumulativeDistancesMeters: e.waypoints.reduce((n, a, s,
|
|
418
|
+
cumulativeDistancesMeters: e.waypoints.reduce((n, a, s, i) => {
|
|
477
419
|
if (s === 0)
|
|
478
420
|
return n.push(0), n;
|
|
479
|
-
const
|
|
480
|
-
return n.push(
|
|
421
|
+
const o = i[s - 1], c = n[s - 1] ?? 0;
|
|
422
|
+
return n.push(c + W(o, a)), n;
|
|
481
423
|
}, []),
|
|
482
|
-
totalDistanceMeters:
|
|
424
|
+
totalDistanceMeters: te(e.waypoints),
|
|
483
425
|
waypoints: e.waypoints
|
|
484
426
|
};
|
|
485
427
|
}
|
|
486
|
-
function
|
|
428
|
+
function Ve(e) {
|
|
487
429
|
const t = e.waypoints[0], n = e.waypoints[e.waypoints.length - 1];
|
|
488
|
-
return !t || !n ? !1 :
|
|
430
|
+
return !t || !n ? !1 : W(t, n) <= 1;
|
|
489
431
|
}
|
|
490
|
-
function
|
|
432
|
+
function _e(e) {
|
|
491
433
|
return e.phases.reduce((t, n) => n.type !== "drive" ? t : t + n.speedKph * 1e3 / 3600 * n.durationSeconds, 0);
|
|
492
434
|
}
|
|
493
|
-
function
|
|
494
|
-
const a =
|
|
435
|
+
function Pe(e, t, n) {
|
|
436
|
+
const a = _e(n), s = Math.max(150, t.totalDistanceMeters * 0.03);
|
|
495
437
|
if (a > t.totalDistanceMeters + s)
|
|
496
438
|
throw new Error(
|
|
497
439
|
`Dummy plan "${n.planId}" exceeds route "${e.routeId}" by ${Math.round(
|
|
@@ -499,7 +441,7 @@ function Ge(e, t, n) {
|
|
|
499
441
|
)} meters`
|
|
500
442
|
);
|
|
501
443
|
}
|
|
502
|
-
function
|
|
444
|
+
function _(e, t, n) {
|
|
503
445
|
const a = e.waypoints[0];
|
|
504
446
|
if (!a)
|
|
505
447
|
throw new Error("Dummy route must contain at least one waypoint");
|
|
@@ -514,34 +456,34 @@ function V(e, t, n) {
|
|
|
514
456
|
Math.max(0, t),
|
|
515
457
|
e.totalDistanceMeters
|
|
516
458
|
);
|
|
517
|
-
for (let
|
|
518
|
-
const
|
|
519
|
-
if (s > v &&
|
|
459
|
+
for (let o = 0; o < e.waypoints.length - 1; o += 1) {
|
|
460
|
+
const c = e.waypoints[o], r = e.waypoints[o + 1], M = e.cumulativeDistancesMeters[o] ?? 0, v = e.cumulativeDistancesMeters[o + 1] ?? M;
|
|
461
|
+
if (s > v && o < e.waypoints.length - 2)
|
|
520
462
|
continue;
|
|
521
|
-
const
|
|
463
|
+
const g = Math.max(0, v - M), l = g === 0 ? 0 : (s - M) / g, u = se(c, r, l), d = g === 0 ? n : ae(c, r);
|
|
522
464
|
return {
|
|
523
|
-
address: l < 0.5 ?
|
|
465
|
+
address: l < 0.5 ? c.address : r.address,
|
|
524
466
|
course: d,
|
|
525
|
-
lat:
|
|
526
|
-
lng:
|
|
467
|
+
lat: u.lat,
|
|
468
|
+
lng: u.lng
|
|
527
469
|
};
|
|
528
470
|
}
|
|
529
|
-
const
|
|
471
|
+
const i = e.waypoints[e.waypoints.length - 1];
|
|
530
472
|
return {
|
|
531
|
-
address:
|
|
473
|
+
address: i.address,
|
|
532
474
|
course: n,
|
|
533
|
-
lat:
|
|
534
|
-
lng:
|
|
475
|
+
lat: i.lat,
|
|
476
|
+
lng: i.lng
|
|
535
477
|
};
|
|
536
478
|
}
|
|
537
|
-
function
|
|
479
|
+
function Ce(e, t, n) {
|
|
538
480
|
const a = t.phases.find((r) => r.type !== "delete");
|
|
539
481
|
if (!a)
|
|
540
482
|
throw new Error(`Dummy plan "${t.planId}" must contain at least one executable phase`);
|
|
541
|
-
const s =
|
|
483
|
+
const s = Q(n, a), i = _(e, 0, 0), o = a.type === "drive" ? B(a, s) : J(a, s), c = V(
|
|
542
484
|
{
|
|
543
485
|
ignition: s.ignition,
|
|
544
|
-
motionStatus:
|
|
486
|
+
motionStatus: o,
|
|
545
487
|
signal: s.signal
|
|
546
488
|
},
|
|
547
489
|
0
|
|
@@ -550,47 +492,47 @@ function Ne(e, t, n) {
|
|
|
550
492
|
cursor: {
|
|
551
493
|
currentTimestampMs: C,
|
|
552
494
|
frameIndex: 0,
|
|
553
|
-
lastCourse:
|
|
495
|
+
lastCourse: i.course,
|
|
554
496
|
odometerMeters: 0,
|
|
555
497
|
routeDistanceMeters: 0
|
|
556
498
|
},
|
|
557
499
|
frameState: {
|
|
558
|
-
address:
|
|
559
|
-
backupLevel:
|
|
560
|
-
backupStatus:
|
|
561
|
-
backupVolt:
|
|
562
|
-
course:
|
|
500
|
+
address: i.address,
|
|
501
|
+
backupLevel: c.backupLevel,
|
|
502
|
+
backupStatus: c.backupStatus,
|
|
503
|
+
backupVolt: c.backupVolt,
|
|
504
|
+
course: i.course,
|
|
563
505
|
diX: { ...s.diX },
|
|
564
506
|
doX: { ...s.doX },
|
|
565
507
|
ignition: s.ignition,
|
|
566
|
-
lat:
|
|
567
|
-
lng:
|
|
568
|
-
mainLevel:
|
|
569
|
-
mainStatus:
|
|
570
|
-
mainVolt:
|
|
508
|
+
lat: i.lat,
|
|
509
|
+
lng: i.lng,
|
|
510
|
+
mainLevel: c.mainLevel,
|
|
511
|
+
mainStatus: c.mainStatus,
|
|
512
|
+
mainVolt: c.mainVolt,
|
|
571
513
|
modemCsq: s.modemCsq,
|
|
572
|
-
motionStatus:
|
|
514
|
+
motionStatus: o,
|
|
573
515
|
odometerMeters: 0,
|
|
574
516
|
signal: s.signal,
|
|
575
517
|
speedKph: a.type === "drive" ? a.speedKph : 0,
|
|
576
|
-
srcMainBatteryType:
|
|
518
|
+
srcMainBatteryType: c.srcMainBatteryType,
|
|
577
519
|
timestampMs: C
|
|
578
520
|
},
|
|
579
521
|
persistentState: s
|
|
580
522
|
};
|
|
581
523
|
}
|
|
582
|
-
function
|
|
583
|
-
const
|
|
584
|
-
if (!
|
|
524
|
+
function Xe(e, t, n, a, s) {
|
|
525
|
+
const i = t.reduce((m, f, S) => ((f.type === "new" || f.type === "update") && m.push(S), m), []);
|
|
526
|
+
if (!i.length)
|
|
585
527
|
return {
|
|
586
528
|
initialMessageIndex: 1,
|
|
587
529
|
initialResource: e,
|
|
588
530
|
playbackMessages: t
|
|
589
531
|
};
|
|
590
|
-
const
|
|
532
|
+
const o = Re(a, n), c = Math.floor(o / n.logicalSampleSeconds), r = Math.min(c, i.length - 1), M = i[r], v = t[M], g = (v.type === "new", v.payload.current), l = {
|
|
591
533
|
...e,
|
|
592
|
-
current:
|
|
593
|
-
},
|
|
534
|
+
current: D(g)
|
|
535
|
+
}, u = t.slice(M + 1), d = n.loop ? t.slice(1, M + 1) : [];
|
|
594
536
|
return {
|
|
595
537
|
initialMessageIndex: 1,
|
|
596
538
|
initialResource: l,
|
|
@@ -601,129 +543,97 @@ function xe(e, t, n, a, s) {
|
|
|
601
543
|
resourceSerialId: a.resourceSerialId,
|
|
602
544
|
type: "new"
|
|
603
545
|
},
|
|
604
|
-
...
|
|
546
|
+
...u,
|
|
605
547
|
...d
|
|
606
548
|
]
|
|
607
549
|
};
|
|
608
550
|
}
|
|
609
|
-
function
|
|
551
|
+
function Oe(e, t) {
|
|
610
552
|
const n = t.messagePayloadPatches ?? [];
|
|
611
553
|
if (!n.length)
|
|
612
554
|
return e;
|
|
613
555
|
const a = {
|
|
614
556
|
...e,
|
|
615
|
-
initialResource:
|
|
616
|
-
messages: e.messages.map((s) =>
|
|
557
|
+
initialResource: D(e.initialResource),
|
|
558
|
+
messages: e.messages.map((s) => D(s))
|
|
617
559
|
};
|
|
618
560
|
return n.forEach((s) => {
|
|
619
|
-
const
|
|
620
|
-
if (!
|
|
561
|
+
const i = a.messages[s.messageIndex];
|
|
562
|
+
if (!i)
|
|
621
563
|
throw new Error(
|
|
622
564
|
`Dummy hostile payload patch targeted missing message index ${s.messageIndex} for device ${t.resourceSerialId}.`
|
|
623
565
|
);
|
|
624
|
-
if (
|
|
566
|
+
if (i.type === "delete")
|
|
625
567
|
throw new Error(
|
|
626
568
|
`Dummy hostile payload patch cannot target delete message index ${s.messageIndex} for device ${t.resourceSerialId}.`
|
|
627
569
|
);
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
), s.messageIndex === 0 &&
|
|
570
|
+
b(
|
|
571
|
+
i.payload,
|
|
572
|
+
D(s.payloadPatch)
|
|
573
|
+
), s.messageIndex === 0 && i.type === "new" && b(
|
|
632
574
|
a.initialResource,
|
|
633
|
-
|
|
575
|
+
D(s.payloadPatch)
|
|
634
576
|
);
|
|
635
577
|
}), a;
|
|
636
578
|
}
|
|
637
|
-
function
|
|
579
|
+
function Be(e, t) {
|
|
638
580
|
const n = t.omittedGnssFields, a = t.omitSyntheticModemTimestamps === !0;
|
|
639
581
|
if (!n?.gnssLatitude && !n?.gnssLongitude && !n?.gnssMotionStatus && !n?.gnssSignal && !a)
|
|
640
582
|
return e;
|
|
641
583
|
const s = {
|
|
642
584
|
...e,
|
|
643
|
-
initialResource:
|
|
644
|
-
messages: e.messages.map((
|
|
645
|
-
},
|
|
646
|
-
n?.gnssLatitude &&
|
|
585
|
+
initialResource: D(e.initialResource),
|
|
586
|
+
messages: e.messages.map((o) => D(o))
|
|
587
|
+
}, i = (o) => {
|
|
588
|
+
n?.gnssLatitude && T(o, "vpts.vptGnss.gnssLatitude"), n?.gnssLongitude && T(o, "vpts.vptGnss.gnssLongitude"), n?.gnssMotionStatus && T(o, "vpts.vptGnss.gnssMotionStatus"), n?.gnssSignal && T(o, "vpts.vptGnss.gnssSignal"), a && (T(o, "vpts.vptNetwork.networkLastConnectionDate"), T(o, "vpts.vptNetwork.networkLastEventDate"));
|
|
647
589
|
};
|
|
648
|
-
return
|
|
590
|
+
return i(
|
|
649
591
|
s.initialResource.current
|
|
650
|
-
), s.messages.forEach((
|
|
651
|
-
if (
|
|
652
|
-
if (
|
|
653
|
-
o
|
|
592
|
+
), s.messages.forEach((o) => {
|
|
593
|
+
if (o.type !== "delete") {
|
|
594
|
+
if (o.type === "new") {
|
|
595
|
+
i(o.payload.current);
|
|
654
596
|
return;
|
|
655
597
|
}
|
|
656
|
-
|
|
657
|
-
|
|
598
|
+
i(
|
|
599
|
+
o.payload.current
|
|
658
600
|
);
|
|
659
601
|
}
|
|
660
602
|
}), s;
|
|
661
603
|
}
|
|
662
|
-
function
|
|
663
|
-
const n = new Date(t.timestampMs).toISOString(), a =
|
|
664
|
-
return s.
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
...s.reportProfiles?.generalEvents,
|
|
668
|
-
reportProfileLastEventDate: {
|
|
669
|
-
...s.reportProfiles?.generalEvents?.reportProfileLastEventDate,
|
|
670
|
-
state: "current",
|
|
671
|
-
updatedAt: n,
|
|
672
|
-
value: n
|
|
673
|
-
},
|
|
674
|
-
reportProfileLastEventId: {
|
|
675
|
-
...s.reportProfiles?.generalEvents?.reportProfileLastEventId,
|
|
676
|
-
state: "current",
|
|
677
|
-
updatedAt: n,
|
|
678
|
-
value: 20
|
|
679
|
-
}
|
|
680
|
-
},
|
|
681
|
-
systemEvents: {
|
|
682
|
-
...s.reportProfiles?.systemEvents,
|
|
683
|
-
reportProfileLastEventDate: {
|
|
684
|
-
...s.reportProfiles?.systemEvents?.reportProfileLastEventDate,
|
|
685
|
-
state: "current",
|
|
686
|
-
updatedAt: n,
|
|
687
|
-
value: n
|
|
688
|
-
},
|
|
689
|
-
reportProfileLastEventId: {
|
|
690
|
-
...s.reportProfiles?.systemEvents?.reportProfileLastEventId,
|
|
691
|
-
state: "current",
|
|
692
|
-
updatedAt: n,
|
|
693
|
-
value: 1304
|
|
694
|
-
}
|
|
695
|
-
}
|
|
696
|
-
}, s.vpts = s.vpts ?? {}, s.vpts.vptDiX = Object.fromEntries(
|
|
697
|
-
Object.entries(t.diX).map(([o, i]) => [
|
|
698
|
-
o,
|
|
604
|
+
function P(e, t) {
|
|
605
|
+
const n = new Date(t.timestampMs).toISOString(), a = we(t.signal), s = D(e);
|
|
606
|
+
return s.vpts = s.vpts ?? {}, s.vpts.vptDiX = Object.fromEntries(
|
|
607
|
+
Object.entries(t.diX).map(([i, o]) => [
|
|
608
|
+
i,
|
|
699
609
|
{
|
|
700
610
|
diXStatus: { value: !0, updatedAt: n },
|
|
701
|
-
diXValue: { value:
|
|
611
|
+
diXValue: { value: o, updatedAt: n }
|
|
702
612
|
}
|
|
703
613
|
])
|
|
704
614
|
), s.vpts.vptDoX = Object.fromEntries(
|
|
705
|
-
Object.entries(t.doX).map(([
|
|
706
|
-
|
|
615
|
+
Object.entries(t.doX).map(([i, o]) => [
|
|
616
|
+
i,
|
|
707
617
|
{
|
|
708
|
-
diXValue: { value:
|
|
618
|
+
diXValue: { value: o, updatedAt: n }
|
|
709
619
|
}
|
|
710
620
|
])
|
|
711
621
|
), s.vpts.vptGnss = {
|
|
712
622
|
...s.vpts.vptGnss,
|
|
713
623
|
gnssAddress: t.address,
|
|
714
624
|
gnssAltitude: 1520,
|
|
715
|
-
gnssCourse:
|
|
625
|
+
gnssCourse: R(
|
|
716
626
|
s.vpts.vptGnss?.gnssCourse,
|
|
717
627
|
Math.round(t.course),
|
|
718
628
|
n
|
|
719
629
|
),
|
|
720
630
|
gnssHdop: a.gnssHdop,
|
|
721
|
-
gnssLatitude:
|
|
631
|
+
gnssLatitude: R(
|
|
722
632
|
s.vpts.vptGnss?.gnssLatitude,
|
|
723
633
|
t.lat,
|
|
724
634
|
n
|
|
725
635
|
),
|
|
726
|
-
gnssLongitude:
|
|
636
|
+
gnssLongitude: R(
|
|
727
637
|
s.vpts.vptGnss?.gnssLongitude,
|
|
728
638
|
t.lng,
|
|
729
639
|
n
|
|
@@ -732,7 +642,7 @@ function _(e, t) {
|
|
|
732
642
|
gnssOdometer: Math.round(t.odometerMeters),
|
|
733
643
|
gnssSatellitesInUse: a.gnssSatellitesInUse,
|
|
734
644
|
gnssSignal: { value: t.signal, updatedAt: n },
|
|
735
|
-
gnssSpeed:
|
|
645
|
+
gnssSpeed: R(
|
|
736
646
|
s.vpts.vptGnss?.gnssSpeed,
|
|
737
647
|
t.speedKph,
|
|
738
648
|
n
|
|
@@ -795,42 +705,42 @@ function _(e, t) {
|
|
|
795
705
|
}
|
|
796
706
|
}, s;
|
|
797
707
|
}
|
|
798
|
-
function
|
|
708
|
+
function ee(e, t) {
|
|
799
709
|
return Math.max(1, Math.ceil(e.durationSeconds / t.logicalSampleSeconds));
|
|
800
710
|
}
|
|
801
|
-
function
|
|
802
|
-
const M =
|
|
711
|
+
function Ue(e, t, n, a, s, i, o, c, r) {
|
|
712
|
+
const M = ee(i, c);
|
|
803
713
|
for (let v = 0; v < M; v += 1) {
|
|
804
|
-
const
|
|
714
|
+
const g = ne(i.speedKph, r.frameIndex + 1), l = g * 1e3 / 3600 * c.logicalSampleSeconds, u = Math.min(
|
|
805
715
|
s.totalDistanceMeters,
|
|
806
716
|
r.routeDistanceMeters + l
|
|
807
|
-
), d =
|
|
808
|
-
r.currentTimestampMs +=
|
|
809
|
-
const
|
|
717
|
+
), d = u - r.routeDistanceMeters, m = _(s, u, r.lastCourse);
|
|
718
|
+
r.currentTimestampMs += c.logicalSampleSeconds * 1e3, r.frameIndex += 1, r.lastCourse = m.course, r.odometerMeters += d, r.routeDistanceMeters = u;
|
|
719
|
+
const f = {
|
|
810
720
|
address: m.address,
|
|
811
721
|
backupLevel: 0,
|
|
812
|
-
backupStatus:
|
|
722
|
+
backupStatus: y.lost,
|
|
813
723
|
backupVolt: 0,
|
|
814
724
|
course: m.course,
|
|
815
|
-
diX: { ...
|
|
816
|
-
doX: { ...
|
|
817
|
-
ignition:
|
|
725
|
+
diX: { ...o.diX },
|
|
726
|
+
doX: { ...o.doX },
|
|
727
|
+
ignition: o.ignition,
|
|
818
728
|
lat: m.lat,
|
|
819
729
|
lng: m.lng,
|
|
820
730
|
mainLevel: 0,
|
|
821
|
-
mainStatus:
|
|
731
|
+
mainStatus: y.lost,
|
|
822
732
|
mainVolt: 0,
|
|
823
|
-
modemCsq:
|
|
824
|
-
motionStatus: B(
|
|
733
|
+
modemCsq: o.modemCsq,
|
|
734
|
+
motionStatus: B(i, o),
|
|
825
735
|
odometerMeters: r.odometerMeters,
|
|
826
|
-
signal:
|
|
827
|
-
speedKph: d > 0 ?
|
|
736
|
+
signal: o.signal,
|
|
737
|
+
speedKph: d > 0 ? g : 0,
|
|
828
738
|
srcMainBatteryType: 0,
|
|
829
739
|
timestampMs: r.currentTimestampMs
|
|
830
|
-
},
|
|
831
|
-
|
|
740
|
+
}, S = V(f, r.frameIndex);
|
|
741
|
+
f.mainLevel = S.mainLevel, f.mainStatus = S.mainStatus, f.mainVolt = S.mainVolt, f.backupLevel = S.backupLevel, f.backupStatus = S.backupStatus, f.backupVolt = S.backupVolt, f.srcMainBatteryType = S.srcMainBatteryType, e.push({
|
|
832
742
|
payload: {
|
|
833
|
-
current:
|
|
743
|
+
current: P(a, f)
|
|
834
744
|
},
|
|
835
745
|
resourceTypeId: t,
|
|
836
746
|
resourceSerialId: n,
|
|
@@ -838,36 +748,36 @@ function qe(e, t, n, a, s, o, i, u, r) {
|
|
|
838
748
|
});
|
|
839
749
|
}
|
|
840
750
|
}
|
|
841
|
-
function
|
|
842
|
-
const M =
|
|
751
|
+
function Ge(e, t, n, a, s, i, o, c, r) {
|
|
752
|
+
const M = ee(i, c);
|
|
843
753
|
for (let v = 0; v < M; v += 1) {
|
|
844
|
-
const
|
|
845
|
-
r.currentTimestampMs +=
|
|
754
|
+
const g = _(s, r.routeDistanceMeters, r.lastCourse);
|
|
755
|
+
r.currentTimestampMs += c.logicalSampleSeconds * 1e3, r.frameIndex += 1;
|
|
846
756
|
const l = {
|
|
847
|
-
address:
|
|
757
|
+
address: g.address,
|
|
848
758
|
backupLevel: 0,
|
|
849
|
-
backupStatus:
|
|
759
|
+
backupStatus: y.lost,
|
|
850
760
|
backupVolt: 0,
|
|
851
|
-
course:
|
|
852
|
-
diX: { ...
|
|
853
|
-
doX: { ...
|
|
854
|
-
ignition:
|
|
855
|
-
lat:
|
|
856
|
-
lng:
|
|
761
|
+
course: i.courseOverrideDegrees ?? r.lastCourse,
|
|
762
|
+
diX: { ...o.diX },
|
|
763
|
+
doX: { ...o.doX },
|
|
764
|
+
ignition: o.ignition,
|
|
765
|
+
lat: g.lat,
|
|
766
|
+
lng: g.lng,
|
|
857
767
|
mainLevel: 0,
|
|
858
|
-
mainStatus:
|
|
768
|
+
mainStatus: y.lost,
|
|
859
769
|
mainVolt: 0,
|
|
860
|
-
modemCsq:
|
|
861
|
-
motionStatus:
|
|
770
|
+
modemCsq: o.modemCsq,
|
|
771
|
+
motionStatus: J(i, o),
|
|
862
772
|
odometerMeters: r.odometerMeters,
|
|
863
|
-
signal:
|
|
773
|
+
signal: o.signal,
|
|
864
774
|
speedKph: 0,
|
|
865
775
|
srcMainBatteryType: 0,
|
|
866
776
|
timestampMs: r.currentTimestampMs
|
|
867
|
-
},
|
|
868
|
-
l.mainLevel =
|
|
777
|
+
}, u = V(l, r.frameIndex);
|
|
778
|
+
l.mainLevel = u.mainLevel, l.mainStatus = u.mainStatus, l.mainVolt = u.mainVolt, l.backupLevel = u.backupLevel, l.backupStatus = u.backupStatus, l.backupVolt = u.backupVolt, l.srcMainBatteryType = u.srcMainBatteryType, e.push({
|
|
869
779
|
payload: {
|
|
870
|
-
current:
|
|
780
|
+
current: P(a, l)
|
|
871
781
|
},
|
|
872
782
|
resourceTypeId: t,
|
|
873
783
|
resourceSerialId: n,
|
|
@@ -875,39 +785,39 @@ function Ye(e, t, n, a, s, o, i, u, r) {
|
|
|
875
785
|
});
|
|
876
786
|
}
|
|
877
787
|
}
|
|
878
|
-
function
|
|
788
|
+
function Ne({
|
|
879
789
|
baseCurrent: e,
|
|
880
790
|
cursor: t,
|
|
881
791
|
messages: n,
|
|
882
792
|
persistentState: a,
|
|
883
793
|
playback: s,
|
|
884
|
-
resourceTypeId:
|
|
885
|
-
resourceSerialId:
|
|
886
|
-
routeIndex:
|
|
794
|
+
resourceTypeId: i,
|
|
795
|
+
resourceSerialId: o,
|
|
796
|
+
routeIndex: c,
|
|
887
797
|
speedKph: r
|
|
888
798
|
}) {
|
|
889
|
-
if (r === void 0 || !
|
|
799
|
+
if (r === void 0 || !Ve(c) || t.routeDistanceMeters >= c.totalDistanceMeters)
|
|
890
800
|
return;
|
|
891
801
|
const M = Math.max(r, 8);
|
|
892
|
-
for (; t.routeDistanceMeters <
|
|
893
|
-
const v = M * 1e3 / 3600 * s.logicalSampleSeconds,
|
|
894
|
-
|
|
802
|
+
for (; t.routeDistanceMeters < c.totalDistanceMeters; ) {
|
|
803
|
+
const v = M * 1e3 / 3600 * s.logicalSampleSeconds, g = Math.min(
|
|
804
|
+
c.totalDistanceMeters,
|
|
895
805
|
t.routeDistanceMeters + v
|
|
896
|
-
), l =
|
|
897
|
-
t.currentTimestampMs += s.logicalSampleSeconds * 1e3, t.frameIndex += 1, t.lastCourse =
|
|
806
|
+
), l = g - t.routeDistanceMeters, u = _(c, g, t.lastCourse);
|
|
807
|
+
t.currentTimestampMs += s.logicalSampleSeconds * 1e3, t.frameIndex += 1, t.lastCourse = u.course, t.odometerMeters += l, t.routeDistanceMeters = g;
|
|
898
808
|
const d = {
|
|
899
|
-
address:
|
|
809
|
+
address: u.address,
|
|
900
810
|
backupLevel: 0,
|
|
901
|
-
backupStatus:
|
|
811
|
+
backupStatus: y.lost,
|
|
902
812
|
backupVolt: 0,
|
|
903
|
-
course:
|
|
813
|
+
course: u.course,
|
|
904
814
|
diX: { ...a.diX },
|
|
905
815
|
doX: { ...a.doX },
|
|
906
816
|
ignition: a.ignition,
|
|
907
|
-
lat:
|
|
908
|
-
lng:
|
|
817
|
+
lat: u.lat,
|
|
818
|
+
lng: u.lng,
|
|
909
819
|
mainLevel: 0,
|
|
910
|
-
mainStatus:
|
|
820
|
+
mainStatus: y.lost,
|
|
911
821
|
mainVolt: 0,
|
|
912
822
|
modemCsq: a.modemCsq,
|
|
913
823
|
motionStatus: B(
|
|
@@ -922,40 +832,40 @@ function $e({
|
|
|
922
832
|
speedKph: l > 0 ? M : 0,
|
|
923
833
|
srcMainBatteryType: 0,
|
|
924
834
|
timestampMs: t.currentTimestampMs
|
|
925
|
-
}, m =
|
|
835
|
+
}, m = V(d, t.frameIndex);
|
|
926
836
|
d.mainLevel = m.mainLevel, d.mainStatus = m.mainStatus, d.mainVolt = m.mainVolt, d.backupLevel = m.backupLevel, d.backupStatus = m.backupStatus, d.backupVolt = m.backupVolt, d.srcMainBatteryType = m.srcMainBatteryType, n.push({
|
|
927
837
|
payload: {
|
|
928
|
-
current:
|
|
838
|
+
current: P(e, d)
|
|
929
839
|
},
|
|
930
|
-
resourceTypeId:
|
|
931
|
-
resourceSerialId:
|
|
840
|
+
resourceTypeId: i,
|
|
841
|
+
resourceSerialId: o,
|
|
932
842
|
type: "update"
|
|
933
843
|
});
|
|
934
844
|
}
|
|
935
845
|
}
|
|
936
|
-
function
|
|
937
|
-
const { assignment: a, blueprint: s, plan:
|
|
938
|
-
|
|
939
|
-
const r =
|
|
940
|
-
|
|
941
|
-
|
|
846
|
+
function xe(e, t, n) {
|
|
847
|
+
const { assignment: a, blueprint: s, plan: i, route: o } = e, c = Ae(o);
|
|
848
|
+
Pe(o, c, i);
|
|
849
|
+
const r = Ie(a, s), M = Ee(r), { cursor: v, frameState: g, persistentState: l } = Ce(
|
|
850
|
+
c,
|
|
851
|
+
i,
|
|
942
852
|
M
|
|
943
|
-
),
|
|
853
|
+
), u = {
|
|
944
854
|
...r,
|
|
945
|
-
current:
|
|
855
|
+
current: P(r.current, g)
|
|
946
856
|
};
|
|
947
|
-
let d = l, m =
|
|
948
|
-
const
|
|
857
|
+
let d = l, m = i.phases.find((k) => k.type === "drive")?.speedKph;
|
|
858
|
+
const f = [
|
|
949
859
|
{
|
|
950
|
-
payload:
|
|
860
|
+
payload: u,
|
|
951
861
|
resourceTypeId: n,
|
|
952
862
|
resourceSerialId: a.resourceSerialId,
|
|
953
863
|
type: "new"
|
|
954
864
|
}
|
|
955
865
|
];
|
|
956
|
-
for (const
|
|
957
|
-
if (
|
|
958
|
-
|
|
866
|
+
for (const k of i.phases) {
|
|
867
|
+
if (k.type === "delete") {
|
|
868
|
+
f.push({
|
|
959
869
|
payload: {},
|
|
960
870
|
resourceTypeId: n,
|
|
961
871
|
resourceSerialId: a.resourceSerialId,
|
|
@@ -963,65 +873,65 @@ function je(e, t, n) {
|
|
|
963
873
|
});
|
|
964
874
|
break;
|
|
965
875
|
}
|
|
966
|
-
if (d =
|
|
967
|
-
m =
|
|
968
|
-
|
|
876
|
+
if (d = Q(d, k), k.type === "drive") {
|
|
877
|
+
m = k.speedKph, Ue(
|
|
878
|
+
f,
|
|
969
879
|
n,
|
|
970
880
|
a.resourceSerialId,
|
|
971
881
|
r.current,
|
|
972
|
-
|
|
973
|
-
|
|
882
|
+
c,
|
|
883
|
+
k,
|
|
974
884
|
d,
|
|
975
885
|
t,
|
|
976
886
|
v
|
|
977
887
|
);
|
|
978
888
|
continue;
|
|
979
889
|
}
|
|
980
|
-
|
|
981
|
-
|
|
890
|
+
Ge(
|
|
891
|
+
f,
|
|
982
892
|
n,
|
|
983
893
|
a.resourceSerialId,
|
|
984
894
|
r.current,
|
|
985
|
-
|
|
986
|
-
|
|
895
|
+
c,
|
|
896
|
+
k,
|
|
987
897
|
d,
|
|
988
898
|
t,
|
|
989
899
|
v
|
|
990
900
|
);
|
|
991
901
|
}
|
|
992
|
-
|
|
902
|
+
Ne({
|
|
993
903
|
baseCurrent: r.current,
|
|
994
904
|
cursor: v,
|
|
995
|
-
messages:
|
|
905
|
+
messages: f,
|
|
996
906
|
persistentState: d,
|
|
997
907
|
playback: t,
|
|
998
908
|
resourceTypeId: n,
|
|
999
909
|
resourceSerialId: a.resourceSerialId,
|
|
1000
|
-
routeIndex:
|
|
910
|
+
routeIndex: c,
|
|
1001
911
|
speedKph: m
|
|
1002
912
|
});
|
|
1003
|
-
const
|
|
913
|
+
const S = Xe(
|
|
1004
914
|
r,
|
|
1005
|
-
|
|
915
|
+
f,
|
|
1006
916
|
t,
|
|
1007
917
|
a,
|
|
1008
918
|
n
|
|
1009
919
|
);
|
|
1010
|
-
return
|
|
1011
|
-
|
|
1012
|
-
emissionOffsetMs:
|
|
1013
|
-
initialMessageIndex:
|
|
1014
|
-
initialResource:
|
|
1015
|
-
messages:
|
|
920
|
+
return Be(
|
|
921
|
+
Oe({
|
|
922
|
+
emissionOffsetMs: Le(a, t),
|
|
923
|
+
initialMessageIndex: S.initialMessageIndex,
|
|
924
|
+
initialResource: S.initialResource,
|
|
925
|
+
messages: S.playbackMessages,
|
|
1016
926
|
resourceSerialId: a.resourceSerialId
|
|
1017
927
|
}, a),
|
|
1018
928
|
a
|
|
1019
929
|
);
|
|
1020
930
|
}
|
|
1021
|
-
function
|
|
1022
|
-
const n =
|
|
1023
|
-
devices: n.devices.map((
|
|
1024
|
-
|
|
931
|
+
function Fe(e, t) {
|
|
932
|
+
const n = he(e), a = t?.resourceTypeId ?? le, s = {
|
|
933
|
+
devices: n.devices.map((i) => xe(
|
|
934
|
+
i,
|
|
1025
935
|
n.playback,
|
|
1026
936
|
a
|
|
1027
937
|
)),
|
|
@@ -1029,32 +939,32 @@ function We(e, t) {
|
|
|
1029
939
|
};
|
|
1030
940
|
return t?.wallClockStartAtMs === void 0 ? s : {
|
|
1031
941
|
...s,
|
|
1032
|
-
devices: s.devices.map((
|
|
1033
|
-
...
|
|
1034
|
-
initialResource:
|
|
1035
|
-
|
|
942
|
+
devices: s.devices.map((i) => ({
|
|
943
|
+
...i,
|
|
944
|
+
initialResource: me(
|
|
945
|
+
i.initialResource,
|
|
1036
946
|
t.wallClockStartAtMs
|
|
1037
947
|
),
|
|
1038
|
-
messages:
|
|
1039
|
-
|
|
948
|
+
messages: i.messages.map((o) => ge(
|
|
949
|
+
o,
|
|
1040
950
|
t.wallClockStartAtMs
|
|
1041
951
|
))
|
|
1042
952
|
}))
|
|
1043
953
|
};
|
|
1044
954
|
}
|
|
1045
|
-
function
|
|
1046
|
-
return
|
|
955
|
+
function Ke(e, t) {
|
|
956
|
+
return Fe(e).devices.reduce((a, s) => (a[s.resourceSerialId] = t?.wallClockStartAtMs === void 0 ? s.initialResource : ve(
|
|
1047
957
|
s.initialResource,
|
|
1048
958
|
t.wallClockStartAtMs
|
|
1049
959
|
), a), {});
|
|
1050
960
|
}
|
|
1051
|
-
function
|
|
961
|
+
function qe({
|
|
1052
962
|
resourceTypeId: e,
|
|
1053
963
|
simulation: t
|
|
1054
964
|
}) {
|
|
1055
965
|
const n = Date.now();
|
|
1056
966
|
return {
|
|
1057
|
-
initialHashResources:
|
|
967
|
+
initialHashResources: Ke(t, {
|
|
1058
968
|
wallClockStartAtMs: n
|
|
1059
969
|
}),
|
|
1060
970
|
resourceTypeId: e,
|
|
@@ -1063,22 +973,22 @@ function Ze({
|
|
|
1063
973
|
wallClockStartAtMs: n
|
|
1064
974
|
};
|
|
1065
975
|
}
|
|
1066
|
-
function
|
|
976
|
+
function st({
|
|
1067
977
|
presetId: e,
|
|
1068
978
|
resourceTypeId: t,
|
|
1069
979
|
simulationOverrides: n
|
|
1070
980
|
}) {
|
|
1071
|
-
return
|
|
981
|
+
return qe({
|
|
1072
982
|
resourceTypeId: t,
|
|
1073
|
-
simulation:
|
|
983
|
+
simulation: ie({
|
|
1074
984
|
overrides: n,
|
|
1075
985
|
presetId: e
|
|
1076
986
|
})
|
|
1077
987
|
});
|
|
1078
988
|
}
|
|
1079
989
|
export {
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
990
|
+
Fe as buildRealTimeDummyRuntimeModel,
|
|
991
|
+
Ke as createRealTimeDummyInitialResources,
|
|
992
|
+
qe as createRealTimeDummyResourceTypeConfig,
|
|
993
|
+
st as createRealTimeDummyResourceTypeConfigFromPreset
|
|
1084
994
|
};
|