@m4l/gclick 0.2.0-JAEBeta.3 → 0.2.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.
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { S as SourceDataBase } from "../base.js";
|
|
2
|
-
import { R as REAL_TIME_RT_DEVICES_DUMMMY_INITIAL, d as devicesIds } from "./constants.js";
|
|
2
|
+
import { R as REAL_TIME_RT_DEVICES_DUMMMY_INITIAL, d as devicesStatuses, a as devicesIds } from "./constants.js";
|
|
3
|
+
import { g as getDummyRandomCoordinates } from "./helpers.js";
|
|
3
4
|
class SourceDataDummy extends SourceDataBase {
|
|
4
5
|
intervalId = null;
|
|
5
6
|
constructor(config, onMessages) {
|
|
@@ -9,13 +10,45 @@ class SourceDataDummy extends SourceDataBase {
|
|
|
9
10
|
* Start the source data
|
|
10
11
|
*/
|
|
11
12
|
start() {
|
|
13
|
+
let first = true;
|
|
12
14
|
this.intervalId = setInterval(() => {
|
|
13
15
|
const deviceIndex = parseInt(Math.random() * devicesIds.length + "");
|
|
14
16
|
const deviceId = devicesIds[deviceIndex];
|
|
15
17
|
REAL_TIME_RT_DEVICES_DUMMMY_INITIAL[deviceId];
|
|
16
|
-
{
|
|
17
|
-
|
|
18
|
-
|
|
18
|
+
const payload = {
|
|
19
|
+
current: {
|
|
20
|
+
vpts: {
|
|
21
|
+
vptGnss: {
|
|
22
|
+
gnssAddress: "Vía Sabanalarga - Barranquilla, Km 2.42 Sabanalarga - Campeche Sabanalarga, Atlántico",
|
|
23
|
+
gnssSpeed: Math.round(Math.random() * 120),
|
|
24
|
+
gnssMotionStatus: { value: devicesStatuses[deviceIndex], updatedAt: (/* @__PURE__ */ new Date()).toISOString() },
|
|
25
|
+
// gnssCourse: fixedData ? initialData.current.vpts?.vptGnss?.gnssCourse || 0 : Math.round(Math.random() * 360),
|
|
26
|
+
...getDummyRandomCoordinates(void 0),
|
|
27
|
+
// gnssSignal: {
|
|
28
|
+
// value: GNSSEnumSignal.reliable,
|
|
29
|
+
// // updatedAt: undefined,
|
|
30
|
+
// },
|
|
31
|
+
// gnssHdop: 0,
|
|
32
|
+
gnssSatellitesInUse: 0,
|
|
33
|
+
gnssAltitude: 0,
|
|
34
|
+
gnssOdometer: 0
|
|
35
|
+
},
|
|
36
|
+
vptModem: {
|
|
37
|
+
modemLastConnection: (/* @__PURE__ */ new Date()).toISOString(),
|
|
38
|
+
modemLastEvent: (/* @__PURE__ */ new Date()).toISOString(),
|
|
39
|
+
modemCsq: Math.round(Math.random() * 31),
|
|
40
|
+
callActive: false
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
const dummyData = {
|
|
46
|
+
type: first ? "new" : "update",
|
|
47
|
+
resourceSerialId: deviceId,
|
|
48
|
+
payload
|
|
49
|
+
};
|
|
50
|
+
first = false;
|
|
51
|
+
this.onMessages(this.config.resourceTypeId, [dummyData]);
|
|
19
52
|
}, 1e3);
|
|
20
53
|
}
|
|
21
54
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@m4l/gclick",
|
|
3
|
-
"version": "0.2.0
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"license": "UNLICENSED",
|
|
5
5
|
"lint-staged": {
|
|
6
6
|
"*.{js,ts,tsx}": "eslint --fix --max-warnings 0 --no-warn-ignored"
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"@geoman-io/leaflet-geoman-free": "^2.14.2",
|
|
10
10
|
"@googlemaps/js-api-loader": "^1.16.6",
|
|
11
11
|
"@hookform/resolvers": "2.9.11",
|
|
12
|
-
"@m4l/components": "9.
|
|
12
|
+
"@m4l/components": "^9.0.0",
|
|
13
13
|
"@m4l/core": "^2.0.0",
|
|
14
14
|
"@m4l/graphics": "^7.0.0",
|
|
15
15
|
"@m4l/styles": "^7.0.0",
|