@7365admin1/layer-common 4.97.1-staging.552 → 4.97.1-staging.553
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/package.json +1 -1
- package/utils/robot-setup.ts +8 -9
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@7365admin1/layer-common",
|
|
3
3
|
"license": "MIT",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"version": "4.97.1-staging.
|
|
5
|
+
"version": "4.97.1-staging.553",
|
|
6
6
|
"author": "7365admin1",
|
|
7
7
|
"main": "./nuxt.config.ts",
|
|
8
8
|
"//files": "What a consumer extending this layer actually loads. Without this npm ships the whole working tree - the changesets, the CI workflows, the render harness in tools/ and any scratch directory that happened to exist at publish time. Nuxt resolves a layer by directory, so every runtime directory below has to stay listed; adding a new top-level runtime directory means adding it here too.",
|
package/utils/robot-setup.ts
CHANGED
|
@@ -186,14 +186,12 @@ export function robotSetupSteps(input: TSetupInput): TSetupStep[] {
|
|
|
186
186
|
|
|
187
187
|
// 5. Floors present: one per floor the robots report.
|
|
188
188
|
const floors = floorsOf(map);
|
|
189
|
-
const
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
.map((s) => Number(s.floorNo)),
|
|
194
|
-
),
|
|
195
|
-
];
|
|
189
|
+
const onFloor = (robots ?? [])
|
|
190
|
+
.map((r) => ({ name: String(r?.name || "A robot"), s: input.states?.[String(r?._id)] }))
|
|
191
|
+
.filter((x) => x.s?.ok && x.s.floorKnown === true && Number.isInteger(x.s.floorNo));
|
|
192
|
+
const reported = [...new Set<number>(onFloor.map((x) => Number(x.s!.floorNo)))];
|
|
196
193
|
const missing = reported.filter((f) => !floors.includes(f));
|
|
194
|
+
const who = (f: number) => onFloor.filter((x) => Number(x.s!.floorNo) === f).map((x) => x.name).join(", ");
|
|
197
195
|
if (map === undefined) {
|
|
198
196
|
steps.push({ key: "floors", title: "Floors on the map", status: "check", reason: "Could not read the saved building map.", button: { label: "Open building map", target: "map" } });
|
|
199
197
|
} else if (!map) {
|
|
@@ -206,7 +204,7 @@ export function robotSetupSteps(input: TSetupInput): TSetupStep[] {
|
|
|
206
204
|
reason: !floors.length
|
|
207
205
|
? "The saved map has no floors. Use Edit map → Add floor."
|
|
208
206
|
: missing.length
|
|
209
|
-
?
|
|
207
|
+
? `${missing.map((f) => `${who(f)} report${who(f).includes(",") ? "" : "s"} ${floorName(f)}`).join("; ")} - the map has no such floor (it has ${floors.map(floorName).join(", ")}). Add it in Edit map → Add floor, or check the floor set in the robot's own app.`
|
|
210
208
|
: `${floors.map(floorName).join(", ")}${reported.length ? " - every floor the robots report." : "."}`,
|
|
211
209
|
button: { label: "Edit floors", target: "map" },
|
|
212
210
|
});
|
|
@@ -268,7 +266,8 @@ export function robotSetupSteps(input: TSetupInput): TSetupStep[] {
|
|
|
268
266
|
? "Floor and door are read from the real lift."
|
|
269
267
|
: "Floor and door not decoded yet - waiting on the lift company's register list."
|
|
270
268
|
: undefined,
|
|
271
|
-
|
|
269
|
+
// An existing (not connected) gateway is checked on the lift queue; Connect there would replace its code.
|
|
270
|
+
button: { label: up.length || gws.length ? "Open lift queue" : "Connect gateway", target: "lifts" },
|
|
272
271
|
});
|
|
273
272
|
}
|
|
274
273
|
|