@m4l/gclick-realtime 1.4.0 → 1.5.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/contracts/deviceData.d.ts +2 -2
- package/contracts/vpts.d.ts +11 -6
- package/contracts/vpts.d.ts.map +1 -1
- package/dummy/catalogs/baseDeviceTemplate.d.ts.map +1 -1
- package/dummy/catalogs/baseDeviceTemplate.js +41 -11
- package/dummy/runtime/dummy.d.ts.map +1 -1
- package/dummy/runtime/dummy.js +109 -82
- package/dummy/runtime/simulation.d.ts.map +1 -1
- package/dummy/runtime/simulation.js +487 -418
- package/package.json +1 -1
- package/payload/types.d.ts +2 -1
- package/payload/types.d.ts.map +1 -1
- package/web/host/devicesResourceType.d.ts.map +1 -1
- package/web/host/devicesResourceType.js +7 -6
- package/web/host/hostRuntime.d.ts.map +1 -1
- package/web/host/hostRuntime.js +39 -28
- package/web/host/startupSnapshots.d.ts +13 -0
- package/web/host/startupSnapshots.d.ts.map +1 -1
- package/web/host/startupSnapshots.js +85 -32
|
@@ -40,7 +40,7 @@ export type DeviceCurrentVpts = {
|
|
|
40
40
|
vptOWTempX?: VPTMultiple<VPTCurrentOWTempX>;
|
|
41
41
|
vptModem?: VPTCurrentModem;
|
|
42
42
|
vptNetwork?: VPTCurrentNetwork;
|
|
43
|
-
|
|
43
|
+
vptAdcPower?: VPTCurrentADCPower;
|
|
44
44
|
};
|
|
45
45
|
export type DeviceCurrentReportProfileEvents = {
|
|
46
46
|
reportProfileLastEventDate?: PropertyValueWithTrack<string>;
|
|
@@ -88,7 +88,7 @@ export type DeviceSettingsVpts = {
|
|
|
88
88
|
vptDoX?: VPTMultiple<VPTSettingsDoX>;
|
|
89
89
|
vptTracking?: VPTSettingsTracking;
|
|
90
90
|
vptPwrSave?: VPTSettingsPwrSave;
|
|
91
|
-
|
|
91
|
+
vptAdcPower?: VPTSettingsADCPower;
|
|
92
92
|
};
|
|
93
93
|
/**
|
|
94
94
|
* Device settings received from the linked resource configuration.
|
package/contracts/vpts.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { ADCPowerEnum } from './constants';
|
|
2
1
|
import { PropertyValue, PropertyValueWithTrack } from './general';
|
|
3
2
|
export type VPTMultiple<T> = {
|
|
4
3
|
[key: string]: T;
|
|
@@ -58,11 +57,17 @@ export type VPTSettingsAVX = {
|
|
|
58
57
|
upperLimit: number;
|
|
59
58
|
};
|
|
60
59
|
export type VPTCurrentADCPower = {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
60
|
+
/**
|
|
61
|
+
* Backend battery status codes are numeric and may exceed the narrower enum
|
|
62
|
+
* values still used by deterministic dummy producers.
|
|
63
|
+
*/
|
|
64
|
+
adcPowerMainStatus?: PropertyValueWithTrack<number>;
|
|
65
|
+
adcPowerMainVolt?: PropertyValueWithTrack<number>;
|
|
66
|
+
adcPowerMainLevel?: PropertyValueWithTrack<number>;
|
|
67
|
+
adcPowerBackupVolt?: PropertyValueWithTrack<number>;
|
|
68
|
+
adcPowerBackupStatus?: PropertyValueWithTrack<number>;
|
|
69
|
+
adcPowerBackupLevel?: PropertyValueWithTrack<number>;
|
|
70
|
+
adcPowerSrcMainBatteryType?: PropertyValueWithTrack<number>;
|
|
66
71
|
};
|
|
67
72
|
export type VPTCurrentModem = {
|
|
68
73
|
modemCsq?: PropertyValue<number>;
|
package/contracts/vpts.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vpts.d.ts","sourceRoot":"","sources":["../../../../../packages/gclick-realtime/src/contracts/vpts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"vpts.d.ts","sourceRoot":"","sources":["../../../../../packages/gclick-realtime/src/contracts/vpts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAC;AAElE,MAAM,MAAM,W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AC,EAAE,MAAM,CAAC;IAClC,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC,yBAAyB,CAAC,EAAE,MAAM,CAAC;IACnC,0BAA0B,CAAC,EAAE,MAAM,CAAC;IACpC,8BAA8B,CAAC,EAAE,MAAM,CAAC;CACzC,CAAC;AAEF,KAAK,mCAAmC,GAAG,OAAO,CAAC,MAAM,CAAC,qBAAqB,MAAM,EAAE,EAAE,MAAM,CAAC,CAAC,CAAC;AAClG,KAAK,qCAAqC,GAAG,OAAO,CAAC,MAAM,CAAC,uBAAuB,MAAM,EAAE,EAAE,OAAO,CAAC,CAAC,CAAC;AAEvG,MAAM,MAAM,kBAAkB,GAAG;IAC/B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC,yBAAyB,CAAC,EAAE,MAAM,CAAC;IACnC,yBAAyB,CAAC,EAAE,MAAM,CAAC;IACnC,0BAA0B,CAAC,EAAE,MAAM,CAAC;CACrC,GAAG,mCAAmC,GAAG,qCAAqC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"baseDeviceTemplate.d.ts","sourceRoot":"","sources":["../../../../../../packages/gclick-realtime/src/dummy/catalogs/baseDeviceTemplate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAU5D;;GAEG;AACH,eAAO,MAAM,+BAA+B,sCAAkB,CAAC;AAE/D;;GAEG;AACH,eAAO,MAAM,oCAAoC,EAAE,IAAI,CAAC,cAAc,EAAE,IAAI,
|
|
1
|
+
{"version":3,"file":"baseDeviceTemplate.d.ts","sourceRoot":"","sources":["../../../../../../packages/gclick-realtime/src/dummy/catalogs/baseDeviceTemplate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAU5D;;GAEG;AACH,eAAO,MAAM,+BAA+B,sCAAkB,CAAC;AAE/D;;GAEG;AACH,eAAO,MAAM,oCAAoC,EAAE,IAAI,CAAC,cAAc,EAAE,IAAI,CAoL3E,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ADCPowerEnum as a, GNSSEnumSignal as
|
|
2
|
-
const e = "2026-04-21T12:00:00.000Z", t = "i_common_devices_type_light_truck", o = t,
|
|
1
|
+
import { ADCPowerEnum as a, GNSSEnumSignal as d, GNSSEnumMotionStatus as n } from "../../contracts/constants.js";
|
|
2
|
+
const e = "2026-04-21T12:00:00.000Z", t = "i_common_devices_type_light_truck", o = t, u = {
|
|
3
3
|
alias: "Simulation device",
|
|
4
4
|
deviceIcon: {
|
|
5
5
|
iconId: o
|
|
@@ -60,10 +60,10 @@ const e = "2026-04-21T12:00:00.000Z", t = "i_common_devices_type_light_truck", o
|
|
|
60
60
|
gnssHdop: 0.8,
|
|
61
61
|
gnssLatitude: 0,
|
|
62
62
|
gnssLongitude: 0,
|
|
63
|
-
gnssMotionStatus: { value:
|
|
63
|
+
gnssMotionStatus: { value: n.stopped, updatedAt: e },
|
|
64
64
|
gnssOdometer: 0,
|
|
65
65
|
gnssSatellitesInUse: 14,
|
|
66
|
-
gnssSignal: { value:
|
|
66
|
+
gnssSignal: { value: d.reliable, updatedAt: e },
|
|
67
67
|
gnssSpeed: 0,
|
|
68
68
|
pois: []
|
|
69
69
|
},
|
|
@@ -81,12 +81,42 @@ const e = "2026-04-21T12:00:00.000Z", t = "i_common_devices_type_light_truck", o
|
|
|
81
81
|
networkPort: { value: 20001, updatedAt: e },
|
|
82
82
|
networkPortType: { value: "udp", updatedAt: e }
|
|
83
83
|
},
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
84
|
+
vptAdcPower: {
|
|
85
|
+
adcPowerBackupLevel: {
|
|
86
|
+
state: "current",
|
|
87
|
+
updatedAt: e,
|
|
88
|
+
value: 92
|
|
89
|
+
},
|
|
90
|
+
adcPowerBackupStatus: {
|
|
91
|
+
state: "current",
|
|
92
|
+
updatedAt: e,
|
|
93
|
+
value: a.ok
|
|
94
|
+
},
|
|
95
|
+
adcPowerBackupVolt: {
|
|
96
|
+
state: "current",
|
|
97
|
+
updatedAt: e,
|
|
98
|
+
value: 4.2
|
|
99
|
+
},
|
|
100
|
+
adcPowerMainLevel: {
|
|
101
|
+
state: "current",
|
|
102
|
+
updatedAt: e,
|
|
103
|
+
value: 84
|
|
104
|
+
},
|
|
105
|
+
adcPowerMainStatus: {
|
|
106
|
+
state: "current",
|
|
107
|
+
updatedAt: e,
|
|
108
|
+
value: a.ok
|
|
109
|
+
},
|
|
110
|
+
adcPowerMainVolt: {
|
|
111
|
+
state: "current",
|
|
112
|
+
updatedAt: e,
|
|
113
|
+
value: 13.4
|
|
114
|
+
},
|
|
115
|
+
adcPowerSrcMainBatteryType: {
|
|
116
|
+
state: "current",
|
|
117
|
+
updatedAt: e,
|
|
118
|
+
value: 0
|
|
119
|
+
}
|
|
90
120
|
}
|
|
91
121
|
}
|
|
92
122
|
},
|
|
@@ -151,6 +181,6 @@ const e = "2026-04-21T12:00:00.000Z", t = "i_common_devices_type_light_truck", o
|
|
|
151
181
|
}
|
|
152
182
|
};
|
|
153
183
|
export {
|
|
154
|
-
|
|
184
|
+
u as REAL_TIME_DUMMY_BASE_DEVICE_TEMPLATE,
|
|
155
185
|
o as REAL_TIME_DUMMY_DEFAULT_ICON_ID
|
|
156
186
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dummy.d.ts","sourceRoot":"","sources":["../../../../../../packages/gclick-realtime/src/dummy/runtime/dummy.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"dummy.d.ts","sourceRoot":"","sources":["../../../../../../packages/gclick-realtime/src/dummy/runtime/dummy.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAihBvD;;GAEG;AACH,qBAAa,eAAgB,SAAQ,cAAc;IACjD,OAAO,CAAC,kBAAkB,CAAuD;IAEjF,OAAO,CAAC,gBAAgB,CAAS;IAEjC,OAAO,CAAC,eAAe,CAAqC;IAE5D;;OAEG;IACH,OAAO,CAAC,qBAAqB;IAQ7B;;OAEG;IACH,OAAO,CAAC,sBAAsB;IAU9B;;OAEG;IACH,OAAO,CAAC,yBAAyB;IA+BjC;;OAEG;IACH,OAAO,CAAC,qBAAqB;IAkC7B;;OAEG;IACH,OAAO,CAAC,aAAa;IASrB;;OAEG;IACH,OAAO,CAAC,cAAc;IAsBtB;;OAEG;IACH,KAAK,IAAI,IAAI;IAiDb;;OAEG;IACH,IAAI,IAAI,IAAI;CASb;AAED,eAAe,eAAe,CAAC"}
|
package/dummy/runtime/dummy.js
CHANGED
|
@@ -1,11 +1,19 @@
|
|
|
1
|
-
import { SourceDataBase as
|
|
1
|
+
import { SourceDataBase as E } from "@m4l/realtime-runtime";
|
|
2
2
|
import { buildRealTimeDummyRuntimeModel as k } from "./simulation.js";
|
|
3
|
-
import
|
|
3
|
+
import _ from "../../node_modules/lodash-es/cloneDeep.js";
|
|
4
4
|
const m = [
|
|
5
5
|
"gnssCourse",
|
|
6
6
|
"gnssLatitude",
|
|
7
7
|
"gnssLongitude",
|
|
8
8
|
"gnssSpeed"
|
|
9
|
+
], g = [
|
|
10
|
+
"adcPowerBackupLevel",
|
|
11
|
+
"adcPowerBackupStatus",
|
|
12
|
+
"adcPowerBackupVolt",
|
|
13
|
+
"adcPowerMainLevel",
|
|
14
|
+
"adcPowerMainStatus",
|
|
15
|
+
"adcPowerMainVolt",
|
|
16
|
+
"adcPowerSrcMainBatteryType"
|
|
9
17
|
];
|
|
10
18
|
let c = null;
|
|
11
19
|
function b() {
|
|
@@ -22,7 +30,7 @@ function b() {
|
|
|
22
30
|
}
|
|
23
31
|
}), e.__M4L_TEST_DUMMY_PLAYBACK_DRIVER__;
|
|
24
32
|
}
|
|
25
|
-
function
|
|
33
|
+
function y(e) {
|
|
26
34
|
c = e, b();
|
|
27
35
|
}
|
|
28
36
|
function o(e, t) {
|
|
@@ -31,32 +39,41 @@ function o(e, t) {
|
|
|
31
39
|
value: e
|
|
32
40
|
};
|
|
33
41
|
}
|
|
34
|
-
function
|
|
42
|
+
function D(e) {
|
|
35
43
|
return new Date(e).toISOString();
|
|
36
44
|
}
|
|
37
|
-
function
|
|
45
|
+
function d(e) {
|
|
38
46
|
return typeof e == "object" && e !== null && "value" in e;
|
|
39
47
|
}
|
|
40
48
|
function I(e, t) {
|
|
41
49
|
return {
|
|
50
|
+
adcPowerByKey: Object.fromEntries(
|
|
51
|
+
g.flatMap((s) => {
|
|
52
|
+
const a = e.current.vpts?.vptAdcPower?.[s];
|
|
53
|
+
return d(a) ? [[
|
|
54
|
+
s,
|
|
55
|
+
o(a.value, t)
|
|
56
|
+
]] : [];
|
|
57
|
+
})
|
|
58
|
+
),
|
|
42
59
|
diXByKey: Object.fromEntries(
|
|
43
|
-
Object.entries(e.current.vpts?.vptDiX ?? {}).map(([s,
|
|
60
|
+
Object.entries(e.current.vpts?.vptDiX ?? {}).map(([s, a]) => [
|
|
44
61
|
s,
|
|
45
|
-
o(
|
|
62
|
+
o(a.diXValue?.value, t)
|
|
46
63
|
])
|
|
47
64
|
),
|
|
48
65
|
doXByKey: Object.fromEntries(
|
|
49
|
-
Object.entries(e.current.vpts?.vptDoX ?? {}).map(([s,
|
|
66
|
+
Object.entries(e.current.vpts?.vptDoX ?? {}).map(([s, a]) => [
|
|
50
67
|
s,
|
|
51
|
-
o(
|
|
68
|
+
o(a.diXValue?.value, t)
|
|
52
69
|
])
|
|
53
70
|
),
|
|
54
71
|
gnssByKey: Object.fromEntries(
|
|
55
72
|
m.flatMap((s) => {
|
|
56
|
-
const
|
|
57
|
-
return
|
|
73
|
+
const a = e.current.vpts?.vptGnss?.[s];
|
|
74
|
+
return d(a) ? [[
|
|
58
75
|
s,
|
|
59
|
-
o(
|
|
76
|
+
o(a.value, t)
|
|
60
77
|
]] : [];
|
|
61
78
|
})
|
|
62
79
|
),
|
|
@@ -75,39 +92,39 @@ function I(e, t) {
|
|
|
75
92
|
};
|
|
76
93
|
}
|
|
77
94
|
function u(e, t, s) {
|
|
78
|
-
return e.value !== t && (e.value = t, e.updatedAtMs = s),
|
|
95
|
+
return e.value !== t && (e.value = t, e.updatedAtMs = s), D(e.updatedAtMs);
|
|
79
96
|
}
|
|
80
|
-
function
|
|
81
|
-
const
|
|
97
|
+
function P(e, t, s) {
|
|
98
|
+
const a = D(s);
|
|
82
99
|
return e.reportProfiles?.generalEvents?.reportProfileLastEventDate && (e.reportProfiles.generalEvents.reportProfileLastEventDate = {
|
|
83
100
|
...e.reportProfiles.generalEvents.reportProfileLastEventDate,
|
|
84
|
-
updatedAt:
|
|
85
|
-
value:
|
|
101
|
+
updatedAt: a,
|
|
102
|
+
value: a
|
|
86
103
|
}), e.reportProfiles?.generalEvents?.reportProfileLastEventId && (e.reportProfiles.generalEvents.reportProfileLastEventId = {
|
|
87
104
|
...e.reportProfiles.generalEvents.reportProfileLastEventId,
|
|
88
|
-
updatedAt:
|
|
105
|
+
updatedAt: a
|
|
89
106
|
}), e.reportProfiles?.systemEvents?.reportProfileLastEventDate && (e.reportProfiles.systemEvents.reportProfileLastEventDate = {
|
|
90
107
|
...e.reportProfiles.systemEvents.reportProfileLastEventDate,
|
|
91
|
-
updatedAt:
|
|
92
|
-
value:
|
|
108
|
+
updatedAt: a,
|
|
109
|
+
value: a
|
|
93
110
|
}), e.reportProfiles?.systemEvents?.reportProfileLastEventId && (e.reportProfiles.systemEvents.reportProfileLastEventId = {
|
|
94
111
|
...e.reportProfiles.systemEvents.reportProfileLastEventId,
|
|
95
|
-
updatedAt:
|
|
112
|
+
updatedAt: a
|
|
96
113
|
}), Object.entries(e.vpts?.vptDiX ?? {}).forEach(([r, n]) => {
|
|
97
|
-
const
|
|
98
|
-
t.diXByKey[r] =
|
|
99
|
-
|
|
114
|
+
const i = t.diXByKey[r] ?? o(n.diXValue?.value, s);
|
|
115
|
+
t.diXByKey[r] = i, n.diXStatus && (n.diXStatus.updatedAt = u(
|
|
116
|
+
i,
|
|
100
117
|
n.diXValue?.value,
|
|
101
118
|
s
|
|
102
119
|
)), n.diXValue && (n.diXValue.updatedAt = u(
|
|
103
|
-
|
|
120
|
+
i,
|
|
104
121
|
n.diXValue.value,
|
|
105
122
|
s
|
|
106
123
|
));
|
|
107
124
|
}), Object.entries(e.vpts?.vptDoX ?? {}).forEach(([r, n]) => {
|
|
108
|
-
const
|
|
109
|
-
t.doXByKey[r] =
|
|
110
|
-
|
|
125
|
+
const i = t.doXByKey[r] ?? o(n.diXValue?.value, s);
|
|
126
|
+
t.doXByKey[r] = i, n.diXValue && (n.diXValue.updatedAt = u(
|
|
127
|
+
i,
|
|
111
128
|
n.diXValue.value,
|
|
112
129
|
s
|
|
113
130
|
));
|
|
@@ -123,66 +140,76 @@ function y(e, t, s) {
|
|
|
123
140
|
t.ignition,
|
|
124
141
|
e.vpts.vptIgnition.ignitionValue.value,
|
|
125
142
|
s
|
|
126
|
-
)),
|
|
143
|
+
)), g.forEach((r) => {
|
|
144
|
+
const n = e.vpts?.vptAdcPower?.[r];
|
|
145
|
+
if (!d(n))
|
|
146
|
+
return;
|
|
147
|
+
const i = t.adcPowerByKey[r] ?? o(n.value, s);
|
|
148
|
+
t.adcPowerByKey[r] = i, n.updatedAt = u(
|
|
149
|
+
i,
|
|
150
|
+
n.value,
|
|
151
|
+
s
|
|
152
|
+
);
|
|
153
|
+
}), m.forEach((r) => {
|
|
127
154
|
const n = e.vpts?.vptGnss?.[r];
|
|
128
|
-
if (!
|
|
155
|
+
if (!d(n))
|
|
129
156
|
return;
|
|
130
|
-
const
|
|
131
|
-
t.gnssByKey[r] =
|
|
132
|
-
|
|
157
|
+
const i = t.gnssByKey[r] ?? o(n.value, s);
|
|
158
|
+
t.gnssByKey[r] = i, n.updatedAt = u(
|
|
159
|
+
i,
|
|
133
160
|
n.value,
|
|
134
161
|
s
|
|
135
162
|
);
|
|
136
163
|
}), e.vpts?.vptNetwork && (e.vpts.vptNetwork.networkLastConnectionDate && (e.vpts.vptNetwork.networkLastConnectionDate = {
|
|
137
164
|
...e.vpts.vptNetwork.networkLastConnectionDate,
|
|
138
|
-
updatedAt:
|
|
139
|
-
value:
|
|
165
|
+
updatedAt: a,
|
|
166
|
+
value: a
|
|
140
167
|
}), e.vpts.vptNetwork.networkLastEventDate && (e.vpts.vptNetwork.networkLastEventDate = {
|
|
141
168
|
...e.vpts.vptNetwork.networkLastEventDate,
|
|
142
|
-
updatedAt:
|
|
143
|
-
value:
|
|
169
|
+
updatedAt: a,
|
|
170
|
+
value: a
|
|
144
171
|
})), e;
|
|
145
172
|
}
|
|
146
|
-
function
|
|
173
|
+
function S(e, t, s) {
|
|
147
174
|
if (e.type === "delete")
|
|
148
175
|
return e;
|
|
149
176
|
if (e.type === "new") {
|
|
150
|
-
const
|
|
151
|
-
return
|
|
177
|
+
const a = e.payload;
|
|
178
|
+
return P(a.current, t, s), e;
|
|
152
179
|
}
|
|
153
|
-
return
|
|
180
|
+
return P(
|
|
154
181
|
e.payload.current,
|
|
155
182
|
t,
|
|
156
183
|
s
|
|
157
184
|
), e;
|
|
158
185
|
}
|
|
159
|
-
function
|
|
186
|
+
function v(e, t) {
|
|
160
187
|
return e.initialHashResources?.[t.resourceSerialId] ? t.initialMessageIndex : 0;
|
|
161
188
|
}
|
|
162
|
-
function
|
|
189
|
+
function R(e, t) {
|
|
163
190
|
return e.emissionOffsetMs <= 0 ? t : e.emissionOffsetMs;
|
|
164
191
|
}
|
|
165
|
-
function
|
|
192
|
+
function M(e, t, s, a, r) {
|
|
166
193
|
const n = [];
|
|
167
|
-
let
|
|
168
|
-
for (let l = 0; l <
|
|
169
|
-
if (
|
|
194
|
+
let i = s.get(t.resourceSerialId) ?? v(e, t);
|
|
195
|
+
for (let l = 0; l < a; l += 1) {
|
|
196
|
+
if (i >= t.messages.length) {
|
|
170
197
|
if (!r)
|
|
171
198
|
break;
|
|
172
|
-
|
|
199
|
+
i = 0;
|
|
173
200
|
}
|
|
174
|
-
const p = t.messages[
|
|
201
|
+
const p = t.messages[i];
|
|
175
202
|
if (!p)
|
|
176
203
|
break;
|
|
177
|
-
n.push(
|
|
204
|
+
n.push(_(p)), i += 1;
|
|
178
205
|
}
|
|
179
|
-
return s.set(t.resourceSerialId,
|
|
206
|
+
return s.set(t.resourceSerialId, i), n;
|
|
180
207
|
}
|
|
181
208
|
function T(e, t) {
|
|
182
209
|
return e.every((s) => (t.get(s.resourceSerialId) ?? 0) >= s.messages.length);
|
|
183
210
|
}
|
|
184
|
-
function
|
|
185
|
-
const l = Date.now(), p =
|
|
211
|
+
function L(e, t, s, a, r, n, i) {
|
|
212
|
+
const l = Date.now(), p = M(
|
|
186
213
|
e,
|
|
187
214
|
t,
|
|
188
215
|
s,
|
|
@@ -190,18 +217,18 @@ function M(e, t, s, i, r, n, a) {
|
|
|
190
217
|
n
|
|
191
218
|
);
|
|
192
219
|
if (p.length) {
|
|
193
|
-
const
|
|
194
|
-
|
|
220
|
+
const f = a.get(t.resourceSerialId);
|
|
221
|
+
i(
|
|
195
222
|
e.resourceTypeId,
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
223
|
+
f ? p.map((h) => S(
|
|
224
|
+
h,
|
|
225
|
+
f,
|
|
199
226
|
l
|
|
200
227
|
)) : p
|
|
201
228
|
);
|
|
202
229
|
}
|
|
203
230
|
}
|
|
204
|
-
class
|
|
231
|
+
class K extends E {
|
|
205
232
|
deviceSchedulerIds = /* @__PURE__ */ new Map();
|
|
206
233
|
isPlaybackPaused = !1;
|
|
207
234
|
playbackRuntime = null;
|
|
@@ -223,11 +250,11 @@ class x extends P {
|
|
|
223
250
|
* Schedule the next emission timeout for one runtime device.
|
|
224
251
|
*/
|
|
225
252
|
scheduleRuntimeDeviceTick(t, s) {
|
|
226
|
-
const
|
|
227
|
-
if (!
|
|
253
|
+
const a = this.playbackRuntime;
|
|
254
|
+
if (!a)
|
|
228
255
|
return;
|
|
229
|
-
const r =
|
|
230
|
-
if (!
|
|
256
|
+
const r = a.nextMessageIndexes.get(t.resourceSerialId) ?? v(a.config, t);
|
|
257
|
+
if (!a.runtime.playback.loop && r >= t.messages.length)
|
|
231
258
|
return;
|
|
232
259
|
const n = setTimeout(() => {
|
|
233
260
|
this.deviceSchedulerIds.delete(t.resourceSerialId), !(this.isPlaybackPaused || !this.playbackRuntime) && this.emitRuntimeDeviceTick(t);
|
|
@@ -240,7 +267,7 @@ class x extends P {
|
|
|
240
267
|
emitRuntimeDeviceTick(t) {
|
|
241
268
|
const s = this.playbackRuntime;
|
|
242
269
|
if (s) {
|
|
243
|
-
if (
|
|
270
|
+
if (L(
|
|
244
271
|
s.config,
|
|
245
272
|
t,
|
|
246
273
|
s.nextMessageIndexes,
|
|
@@ -274,13 +301,13 @@ class x extends P {
|
|
|
274
301
|
if (!this.playbackRuntime || !this.isPlaybackPaused)
|
|
275
302
|
return;
|
|
276
303
|
const { flushImmediately: s = !0 } = t ?? {};
|
|
277
|
-
this.isPlaybackPaused = !1, this.clearDeviceSchedulers(), this.playbackRuntime.runtime.devices.forEach((
|
|
304
|
+
this.isPlaybackPaused = !1, this.clearDeviceSchedulers(), this.playbackRuntime.runtime.devices.forEach((a) => {
|
|
278
305
|
if (s) {
|
|
279
|
-
this.emitRuntimeDeviceTick(
|
|
306
|
+
this.emitRuntimeDeviceTick(a);
|
|
280
307
|
return;
|
|
281
308
|
}
|
|
282
309
|
this.scheduleRuntimeDeviceTick(
|
|
283
|
-
|
|
310
|
+
a,
|
|
284
311
|
this.playbackRuntime?.runtime.playback.intervalMs ?? 0
|
|
285
312
|
);
|
|
286
313
|
});
|
|
@@ -290,16 +317,16 @@ class x extends P {
|
|
|
290
317
|
*/
|
|
291
318
|
start() {
|
|
292
319
|
this.stop();
|
|
293
|
-
const t = this.config, s = t.wallClockStartAtMs ?? Date.now(),
|
|
320
|
+
const t = this.config, s = t.wallClockStartAtMs ?? Date.now(), a = k(t.simulation, {
|
|
294
321
|
resourceTypeId: t.resourceTypeId,
|
|
295
322
|
wallClockStartAtMs: s
|
|
296
323
|
}), r = new Map(
|
|
297
|
-
|
|
324
|
+
a.devices.map((i) => [i.resourceSerialId, v(t, i)])
|
|
298
325
|
), n = new Map(
|
|
299
|
-
|
|
300
|
-
const l = t.initialHashResources?.[
|
|
326
|
+
a.devices.map((i) => {
|
|
327
|
+
const l = t.initialHashResources?.[i.resourceSerialId] ?? i.initialResource;
|
|
301
328
|
return [
|
|
302
|
-
|
|
329
|
+
i.resourceSerialId,
|
|
303
330
|
I(l, s)
|
|
304
331
|
];
|
|
305
332
|
})
|
|
@@ -307,29 +334,29 @@ class x extends P {
|
|
|
307
334
|
this.isPlaybackPaused = !1, this.playbackRuntime = {
|
|
308
335
|
config: t,
|
|
309
336
|
nextMessageIndexes: r,
|
|
310
|
-
runtime:
|
|
337
|
+
runtime: a,
|
|
311
338
|
timestampStates: n
|
|
312
|
-
},
|
|
339
|
+
}, y({
|
|
313
340
|
getState: () => this.getPlaybackDriverState(),
|
|
314
341
|
pause: () => {
|
|
315
342
|
this.pausePlayback();
|
|
316
343
|
},
|
|
317
|
-
resume: (
|
|
318
|
-
this.resumePlayback(
|
|
344
|
+
resume: (i) => {
|
|
345
|
+
this.resumePlayback(i);
|
|
319
346
|
}
|
|
320
|
-
}),
|
|
321
|
-
const l =
|
|
322
|
-
this.scheduleRuntimeDeviceTick(
|
|
347
|
+
}), a.devices.forEach((i) => {
|
|
348
|
+
const l = R(i, a.playback.intervalMs);
|
|
349
|
+
this.scheduleRuntimeDeviceTick(i, l);
|
|
323
350
|
});
|
|
324
351
|
}
|
|
325
352
|
/**
|
|
326
353
|
* Stop the deterministic dummy playback loop.
|
|
327
354
|
*/
|
|
328
355
|
stop() {
|
|
329
|
-
this.clearDeviceSchedulers(), this.isPlaybackPaused = !1, this.playbackRuntime = null, c?.getState() !== "stopped" &&
|
|
356
|
+
this.clearDeviceSchedulers(), this.isPlaybackPaused = !1, this.playbackRuntime = null, c?.getState() !== "stopped" && y(null);
|
|
330
357
|
}
|
|
331
358
|
}
|
|
332
359
|
export {
|
|
333
|
-
|
|
334
|
-
|
|
360
|
+
K as SourceDataDummy,
|
|
361
|
+
K as default
|
|
335
362
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"simulation.d.ts","sourceRoot":"","sources":["../../../../../../packages/gclick-realtime/src/dummy/runtime/simulation.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,eAAe,EACf,wBAAwB,EACxB,sBAAsB,EACvB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,KAAK,EAAiB,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAM3E,OAAO,KAAK,EAUV,6BAA6B,EAC7B,+BAA+B,EAC/B,0CAA0C,EAC3C,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"simulation.d.ts","sourceRoot":"","sources":["../../../../../../packages/gclick-realtime/src/dummy/runtime/simulation.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,eAAe,EACf,wBAAwB,EACxB,sBAAsB,EACvB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,KAAK,EAAiB,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAM3E,OAAO,KAAK,EAUV,6BAA6B,EAC7B,+BAA+B,EAC/B,0CAA0C,EAC3C,MAAM,iBAAiB,CAAC;AA2CzB,UAAU,gCAAgC;IACxC,cAAc,CAAC,EAAE,sBAAsB,CAAC;IACxC,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAoGD,UAAU,4CAA4C;IACpD,cAAc,EAAE,sBAAsB,CAAC;IACvC,UAAU,CAAC,EAAE,6BAA6B,CAAC;CAC5C;AAED,UAAU,sDAAsD;IAC9D,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,EA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