@seedtactics/insight-client 16.5.2 → 16.7.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.
Files changed (110) hide show
  1. package/dist/assets/ProgramHighlight-DPTeZ8Si.js +3 -0
  2. package/dist/assets/index-bPAFn3jp.js +364 -0
  3. package/dist/cell-status/basket-cycles.d.ts +21 -0
  4. package/dist/cell-status/basket-cycles.js +80 -0
  5. package/dist/cell-status/current-status.js +11 -3
  6. package/dist/cell-status/estimated-cycle-times.js +8 -4
  7. package/dist/cell-status/inspections.js +2 -2
  8. package/dist/cell-status/loading.js +4 -0
  9. package/dist/cell-status/material-details.d.ts +12 -4
  10. package/dist/cell-status/material-details.js +24 -13
  11. package/dist/cell-status/rebookings.js +15 -17
  12. package/dist/cell-status/scheduled-jobs.d.ts +1 -1
  13. package/dist/cell-status/scheduled-jobs.js +10 -3
  14. package/dist/cell-status/sim-production.js +3 -3
  15. package/dist/cell-status/sim-station-use.d.ts +1 -0
  16. package/dist/cell-status/sim-station-use.js +14 -8
  17. package/dist/cell-status/station-cycles.d.ts +29 -2
  18. package/dist/cell-status/station-cycles.js +81 -11
  19. package/dist/cell-status/tool-replacements.js +1 -1
  20. package/dist/cell-status/tool-usage.js +1 -1
  21. package/dist/components/App.js +101 -66
  22. package/dist/components/BarcodeScanning.js +12 -2
  23. package/dist/components/ErrorsAndLoading.js +10 -1
  24. package/dist/components/LogEntry.d.ts +0 -1
  25. package/dist/components/LogEntry.js +50 -26
  26. package/dist/components/Navigation.js +30 -4
  27. package/dist/components/analysis/AnalysisSelectToolbar.js +5 -1
  28. package/dist/components/analysis/BasketCycleCards.d.ts +1 -0
  29. package/dist/components/analysis/BasketCycleCards.js +145 -0
  30. package/dist/components/analysis/BufferChart.js +10 -4
  31. package/dist/components/analysis/CostPerPiece.js +28 -8
  32. package/dist/components/analysis/CycleChart.js +1 -1
  33. package/dist/components/analysis/DataTable.js +6 -4
  34. package/dist/components/analysis/HeatChart.js +27 -14
  35. package/dist/components/analysis/InspectionSankey.js +17 -6
  36. package/dist/components/analysis/PalletCycleCards.js +15 -4
  37. package/dist/components/analysis/PartCycleCards.js +62 -18
  38. package/dist/components/analysis/StationDataTable.js +14 -11
  39. package/dist/components/analysis/ToolReplacements.js +16 -10
  40. package/dist/components/log-entry-queue-filter.d.ts +2 -0
  41. package/dist/components/log-entry-queue-filter.js +21 -0
  42. package/dist/components/operations/AllMaterial.js +26 -10
  43. package/dist/components/operations/ChartRangeEdit.js +82 -4
  44. package/dist/components/operations/CloseoutReport.js +13 -4
  45. package/dist/components/operations/CompletedParts.js +23 -11
  46. package/dist/components/operations/CurrentWorkorders.js +31 -9
  47. package/dist/components/operations/OEEChart.js +8 -2
  48. package/dist/components/operations/Outliers.js +18 -7
  49. package/dist/components/operations/ProgramHighlight.js +4 -6
  50. package/dist/components/operations/Programs.js +9 -3
  51. package/dist/components/operations/Rebookings.js +8 -4
  52. package/dist/components/operations/RecentCycleChart.js +5 -3
  53. package/dist/components/operations/RecentProduction.js +30 -13
  54. package/dist/components/operations/RecentSchedules.js +6 -2
  55. package/dist/components/operations/RecentStationCycles.js +38 -11
  56. package/dist/components/operations/ShiftSettings.js +3 -3
  57. package/dist/components/operations/SimDayUsage.js +27 -4
  58. package/dist/components/operations/ToolReport.js +5 -1
  59. package/dist/components/operations/WorkorderGantt.js +22 -2
  60. package/dist/components/quality/QualityMaterial.js +11 -8
  61. package/dist/components/quality/RecentFailedInspections.js +3 -1
  62. package/dist/components/routes.d.ts +3 -0
  63. package/dist/components/routes.js +2 -0
  64. package/dist/components/station-monitor/BulkRawMaterial.js +11 -7
  65. package/dist/components/station-monitor/Closeout.js +14 -2
  66. package/dist/components/station-monitor/CustomStationMonitorDialog.js +1 -1
  67. package/dist/components/station-monitor/Inspection.js +23 -11
  68. package/dist/components/station-monitor/InvalidateCycle.js +3 -3
  69. package/dist/components/station-monitor/JobDetails.js +15 -2
  70. package/dist/components/station-monitor/LoadStation.js +274 -31
  71. package/dist/components/station-monitor/Material.js +71 -11
  72. package/dist/components/station-monitor/MoveMaterialArrows.js +4 -4
  73. package/dist/components/station-monitor/QuarantineButton.js +11 -0
  74. package/dist/components/station-monitor/Queues.js +28 -9
  75. package/dist/components/station-monitor/QueuesAddMaterial.js +8 -6
  76. package/dist/components/station-monitor/SelectInspType.js +1 -1
  77. package/dist/components/station-monitor/SelectWorkorder.js +1 -1
  78. package/dist/components/station-monitor/StationToolbar.js +17 -5
  79. package/dist/components/station-monitor/SystemOverview.d.ts +19 -1
  80. package/dist/components/station-monitor/SystemOverview.js +439 -20
  81. package/dist/components/station-monitor/Whiteboard.js +15 -7
  82. package/dist/data/all-material-bins.d.ts +7 -0
  83. package/dist/data/all-material-bins.js +47 -1
  84. package/dist/data/cost-per-piece.js +11 -8
  85. package/dist/data/current-cycles.d.ts +1 -1
  86. package/dist/data/current-cycles.js +62 -17
  87. package/dist/data/move-arrows.d.ts +5 -1
  88. package/dist/data/move-arrows.js +54 -4
  89. package/dist/data/part-summary.js +13 -13
  90. package/dist/data/path-lookup.js +6 -23
  91. package/dist/data/queue-material.d.ts +1 -1
  92. package/dist/data/queue-material.js +18 -17
  93. package/dist/data/results.completed-parts.js +4 -3
  94. package/dist/data/results.cycles.d.ts +15 -6
  95. package/dist/data/results.cycles.js +51 -30
  96. package/dist/data/results.inspection.js +11 -6
  97. package/dist/data/results.oee.js +8 -8
  98. package/dist/data/results.schedules.js +2 -11
  99. package/dist/data/tools-programs.js +5 -6
  100. package/dist/index.html +1 -1
  101. package/dist/network/api.d.ts +22 -4
  102. package/dist/network/api.js +40 -5
  103. package/dist/network/backend-mock.js +15 -8
  104. package/dist/network/backend.js +3 -3
  105. package/dist/network/websocket.js +15 -15
  106. package/dist/util/chart-helpers.d.ts +1 -1
  107. package/dist/util/chart-helpers.js +14 -8
  108. package/package.json +29 -31
  109. package/dist/assets/ProgramHighlight-LvRM40Qr.js +0 -3
  110. package/dist/assets/index-gAFi3Oss.js +0 -364
@@ -31,11 +31,11 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31
31
  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
32
32
  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33
33
  */
34
- import { useState, useRef, memo } from "react";
34
+ import { useState, useRef, memo, Fragment } from "react";
35
35
  import { Paper, ButtonBase, Box, Typography, Collapse, Stack, Menu, MenuItem, LinearProgress, Badge, Button, Dialog, DialogContent, AppBar, Toolbar, IconButton, useTheme, } from "@mui/material";
36
36
  import { Close as CloseIcon } from "@mui/icons-material";
37
37
  import { InProcMaterial, MaterialAction, MaterialDialog, PartIdenticon } from "./Material.js";
38
- import { ActionType, LocType, PalletLocationEnum, } from "../../network/api.js";
38
+ import { ActionType, BasketLocationEnum, LocType, PalletLocationEnum, } from "../../network/api.js";
39
39
  import { currentStatus, secondsSinceEpochAtom } from "../../cell-status/current-status.js";
40
40
  import { LazySeq, OrderedMap } from "@seedtactics/immutable-collections";
41
41
  import { materialDialogOpen } from "../../cell-status/material-details.js";
@@ -47,14 +47,22 @@ import { QuarantineMatButton } from "./QuarantineButton.js";
47
47
  import { SelectInspTypeDialog, SignalInspectionButton } from "./SelectInspType.js";
48
48
  import { useSetTitle } from "../routes.js";
49
49
  import { useAtomValue, useSetAtom } from "jotai";
50
+ import { fmsInformation } from "../../network/server-settings.js";
51
+ import { basketDisplayName, loadStationDisplayName } from "../../cell-status/station-cycles.js";
50
52
  const CollapsedIconSize = 45;
51
53
  const rowSize = CollapsedIconSize + 10; // each material row has 5px above and 5px below for padding
52
54
  function useCellOverview() {
53
55
  const currentSt = useAtomValue(currentStatus);
54
56
  const jobs = useAtomValue(last30Jobs);
57
+ const fmsInfo = useAtomValue(fmsInformation);
55
58
  const matByPal = LazySeq.of(currentSt.material)
56
59
  .filter((m) => m.location.type === LocType.OnPallet || m.action.type === ActionType.Loading)
57
60
  .toRLookup((m) => m.location.palletNum ?? m.action.loadOntoPalletNum ?? 0);
61
+ const matByBasket = LazySeq.of(currentSt.material)
62
+ .filter((m) => m.location.type === LocType.InBasket &&
63
+ m.location.basketId !== null &&
64
+ m.location.basketId !== undefined)
65
+ .toRLookup((m) => m.location.basketId ?? 0);
58
66
  let loads = LazySeq.ofObject(currentSt.pallets)
59
67
  .filter(([_, p]) => p.currentPalletLocation.loc === PalletLocationEnum.LoadUnload)
60
68
  .toOrderedMap(([_, p]) => [
@@ -62,6 +70,9 @@ function useCellOverview() {
62
70
  {
63
71
  lulNum: p.currentPalletLocation.num,
64
72
  pal: { pallet: p, mats: matByPal.get(p.palletNum) ?? [] },
73
+ basket: null,
74
+ staging: [],
75
+ sources: [],
65
76
  },
66
77
  ]);
67
78
  let machines = LazySeq.ofObject(currentSt.pallets)
@@ -115,12 +126,19 @@ function useCellOverview() {
115
126
  let maxNumFacesOnPallet = 1;
116
127
  const cutoff = addDays(new Date(), -7);
117
128
  // now add empty locations
118
- const allPaths = jobs
129
+ // Materialize ProcessInfo so we can iterate it at two levels (proc for basket stations, paths for the rest)
130
+ const allProcs = jobs
119
131
  .valuesToLazySeq()
120
132
  .filter((j) => j.routeEndUTC > cutoff)
121
133
  .concat(LazySeq.ofObject(currentSt.jobs).map(([_, j]) => j))
122
134
  .flatMap((j) => j.procsAndPaths)
123
- .flatMap((p) => p.paths);
135
+ .toRArray();
136
+ for (const proc of allProcs) {
137
+ for (const lul of (proc.basketLoadStations ?? []).concat(proc.basketUnloadStations ?? [])) {
138
+ maxLoadNum = Math.max(maxLoadNum, lul);
139
+ }
140
+ }
141
+ const allPaths = LazySeq.of(allProcs).flatMap((p) => p.paths);
124
142
  for (const path of allPaths) {
125
143
  for (const lul of path.load.concat(path.unload)) {
126
144
  maxLoadNum = Math.max(maxLoadNum, lul);
@@ -154,6 +172,9 @@ function useCellOverview() {
154
172
  return {
155
173
  lulNum: i,
156
174
  pal: null,
175
+ basket: null,
176
+ staging: [],
177
+ sources: [],
157
178
  };
158
179
  });
159
180
  }
@@ -211,12 +232,120 @@ function useCellOverview() {
211
232
  }
212
233
  }
213
234
  }
235
+ const stagedBaskets = new Map();
236
+ const activeBaskets = new Map();
237
+ const floatingBaskets = new Map();
238
+ let storageEmpty = 0;
239
+ let storageFilled = 0;
240
+ for (const basket of LazySeq.ofObject(currentSt.baskets ?? {})
241
+ .map(([_, b]) => b)
242
+ .sortBy((b) => b.basketId)) {
243
+ const basketWithMaterial = {
244
+ basket,
245
+ mats: matByBasket.get(basket.basketId) ?? [],
246
+ };
247
+ switch (basket.location) {
248
+ case BasketLocationEnum.Storage:
249
+ if (basketWithMaterial.mats.length > 0) {
250
+ storageFilled += 1;
251
+ }
252
+ else {
253
+ storageEmpty += 1;
254
+ }
255
+ break;
256
+ case BasketLocationEnum.LoadUnload:
257
+ case BasketLocationEnum.LoadStationStaging: {
258
+ const loadNum = basket.locationNum;
259
+ if (loadNum === null) {
260
+ floatingBaskets.set(basket.basketId, basketWithMaterial);
261
+ break;
262
+ }
263
+ const byLoad = basket.location === BasketLocationEnum.LoadUnload ? activeBaskets : stagedBaskets;
264
+ const prev = byLoad.get(loadNum) ?? [];
265
+ prev.push(basketWithMaterial);
266
+ byLoad.set(loadNum, prev);
267
+ break;
268
+ }
269
+ case BasketLocationEnum.InTransit:
270
+ floatingBaskets.set(basket.basketId, basketWithMaterial);
271
+ break;
272
+ }
273
+ }
274
+ let maxNumStagingRows = 0;
275
+ let maxNumSourceRows = 0;
276
+ loads = loads.mapValues((load) => {
277
+ const sourceRows = new Map();
278
+ const sourceMats = LazySeq.of(load.pal?.mats ?? load.basket?.mats ?? [])
279
+ .filter((mat) => mat.location.type !== LocType.OnPallet)
280
+ .toRArray();
281
+ for (const mat of sourceMats) {
282
+ if (mat.location.type === LocType.Free) {
283
+ const key = "free";
284
+ const row = sourceRows.get(key) ?? {
285
+ label: "To Load",
286
+ mats: [],
287
+ };
288
+ row.mats.push(mat);
289
+ sourceRows.set(key, row);
290
+ continue;
291
+ }
292
+ if (mat.action.loadFromBasketId !== null && mat.action.loadFromBasketId !== undefined) {
293
+ const key = `basket:${mat.action.loadFromBasketId}`;
294
+ const row = sourceRows.get(key) ?? {
295
+ label: `From ${basketDisplayName(fmsInfo.basketName)} ${mat.action.loadFromBasketId}`,
296
+ mats: [],
297
+ };
298
+ row.mats.push(mat);
299
+ sourceRows.set(key, row);
300
+ continue;
301
+ }
302
+ if (mat.location.type === LocType.InQueue && mat.location.currentQueue) {
303
+ const key = `queue:${mat.location.currentQueue}`;
304
+ const row = sourceRows.get(key) ?? {
305
+ label: `From ${mat.location.currentQueue}`,
306
+ mats: [],
307
+ };
308
+ row.mats.push(mat);
309
+ sourceRows.set(key, row);
310
+ }
311
+ }
312
+ const currentBasket = LazySeq.of(activeBaskets.get(load.lulNum) ?? [])
313
+ .sortBy((b) => b.basket.locationNum)
314
+ .toRArray();
315
+ // Extras beyond the first active basket at this station fall back to floating
316
+ for (const extra of currentBasket.slice(1)) {
317
+ floatingBaskets.set(extra.basket.basketId, extra);
318
+ }
319
+ const loadingFromBasketIds = new Set(LazySeq.of(load.pal?.mats ?? [])
320
+ .collect((mat) => mat.action.loadFromBasketId ?? null)
321
+ .toRArray());
322
+ const staging = LazySeq.of(stagedBaskets.get(load.lulNum) ?? [])
323
+ .filter((basket) => !loadingFromBasketIds.has(basket.basket.basketId))
324
+ .sortBy((b) => b.basket.locationNum)
325
+ .toRArray();
326
+ maxNumStagingRows = Math.max(maxNumStagingRows, staging.length);
327
+ const sources = LazySeq.of(sourceRows)
328
+ .map(([key, row]) => ({ key, label: row.label, mats: row.mats }))
329
+ .sortBy((row) => row.label)
330
+ .toRArray();
331
+ maxNumSourceRows = Math.max(maxNumSourceRows, sources.length);
332
+ return {
333
+ ...load,
334
+ basket: currentBasket[0] ?? null,
335
+ staging,
336
+ sources,
337
+ };
338
+ });
214
339
  return {
215
340
  machines: machines.mapValues((group) => group.valuesToAscLazySeq().toRArray()),
216
341
  loads: loads.valuesToAscLazySeq().toRArray(),
217
342
  stockerPals: stockerPals.valuesToAscLazySeq().toRArray(),
343
+ floatingBaskets: LazySeq.of(floatingBaskets.values()).toRArray(),
344
+ storageBaskets: storageEmpty + storageFilled > 0 ? { empty: storageEmpty, filled: storageFilled } : null,
218
345
  machineAtLoad: machAtLoad.valuesToAscLazySeq().toRArray(),
219
346
  maxNumFacesOnPallet,
347
+ maxNumStagingRows,
348
+ maxNumSourceRows,
220
349
  };
221
350
  }
222
351
  function MaterialIcon({ mats }) {
@@ -253,27 +382,77 @@ function MaterialIcon({ mats }) {
253
382
  const name = pallet != null && pallet != undefined ? curSt.pallets[pallet]?.faceNames?.[faceNum - 1] : null;
254
383
  return name ?? "Face: " + faceNum.toString();
255
384
  }
256
- return (_jsxs(Box, { sx: { width: CollapsedIconSize, height: CollapsedIconSize, overflow: "visible" }, children: [_jsx(Paper, { elevation: 4, onPointerEnter: enter, onPointerLeave: leave, sx: { position: "relative", zIndex: open ? 10 : 0, width: "max-content", height: "max-content" }, children: _jsx(Badge, { badgeContent: mats.length > 1 ? mats.length : 0, color: "secondary", children: _jsx(ButtonBase, { focusRipple: true, onClick: click, ref: btnRef, children: _jsx(Collapse, { orientation: "horizontal", in: open, collapsedSize: CollapsedIconSize, children: _jsxs(Box, { display: "flex", children: [_jsx(PartIdenticon, { part: mats[0].partName, size: CollapsedIconSize }), _jsx(Box, { marginLeft: "10px", marginRight: "10px", whiteSpace: "nowrap", textAlign: "left", children: _jsx(Collapse, { in: open, collapsedSize: CollapsedIconSize, children: _jsxs(Stack, { direction: "column", marginBottom: "0.2em", children: [_jsxs(Typography, { variant: "h6", children: [mats[0].partName, "-", mats[0].process] }), _jsx("div", { children: _jsx("small", { children: faceName(mats[0].location.palletNum, mats[0].location.face) ??
385
+ return (_jsxs(Box, { sx: { width: CollapsedIconSize, height: CollapsedIconSize, overflow: "visible" }, children: [_jsx(Paper, { elevation: 4, onPointerEnter: enter, onPointerLeave: leave, sx: { position: "relative", zIndex: open ? 10 : 0, width: "max-content", height: "max-content" }, children: _jsx(Badge, { badgeContent: mats.length > 1 ? mats.length : 0, color: "secondary", children: _jsx(ButtonBase, { focusRipple: true, onClick: click, ref: btnRef, children: _jsx(Collapse, { orientation: "horizontal", in: open, collapsedSize: CollapsedIconSize, children: _jsxs(Box, { sx: {
386
+ display: "flex",
387
+ }, children: [_jsx(PartIdenticon, { part: mats[0].partName, size: CollapsedIconSize }), _jsx(Box, { sx: {
388
+ marginLeft: "10px",
389
+ marginRight: "10px",
390
+ whiteSpace: "nowrap",
391
+ textAlign: "left",
392
+ }, children: _jsx(Collapse, { in: open, collapsedSize: CollapsedIconSize, children: _jsxs(Stack, { direction: "column", sx: {
393
+ marginBottom: "0.2em",
394
+ }, children: [_jsxs(Typography, { variant: "h6", children: [mats[0].partName, "-", mats[0].process] }), _jsx("div", { children: _jsx("small", { children: faceName(mats[0].location.palletNum, mats[0].location.face) ??
257
395
  faceName(mats[0].action.loadOntoPalletNum, mats[0].action.loadOntoFace) }) }), LazySeq.of(mats).collect((mat) => mat.serial ? (_jsx("div", { children: _jsxs("small", { children: ["Serial: ", mat.serial] }) }, mat.materialID)) : undefined), _jsx("div", { children: _jsx(MaterialAction, { mat: mats[0] }) })] }) }) })] }) }) }) }) }), _jsx(Menu, { anchorEl: btnRef.current, open: menuOpen, onClose: () => setMenuOpen(false), anchorOrigin: { vertical: "top", horizontal: "left" }, children: LazySeq.of(mats).map((mat, idx) => (_jsx(MenuItem, { onClick: () => {
258
396
  setMenuOpen(false);
259
397
  setMatToShow({ type: "MatDetails", details: mat });
260
398
  }, children: mat.serial && mat.serial !== "" ? mat.serial : (idx + 1).toString() }, mat.materialID))) })] }));
261
399
  }
262
- function PalletFaces({ maxNumFaces, mats, loadingOntoPallet, noFilter, showExpanded, }) {
400
+ function PalletFaces({ maxNumFaces, mats: allMats, loadingOntoPallet, noFilter, showExpanded, }) {
263
401
  if (showExpanded && maxNumFaces === 1) {
264
- return (_jsx(Box, { display: "flex", flexDirection: "column", flexWrap: "wrap", children: mats.map((mat) => (_jsx(InProcMaterial, { mat: mat }, mat.materialID))) }));
402
+ return (_jsx(Box, { sx: {
403
+ display: "flex",
404
+ flexDirection: "column",
405
+ flexWrap: "wrap",
406
+ }, children: allMats.map((mat) => (_jsx(InProcMaterial, { mat: mat }, mat.materialID))) }));
265
407
  }
266
408
  else {
267
409
  const byFace = loadingOntoPallet
268
- ? LazySeq.of(mats)
410
+ ? LazySeq.of(allMats)
269
411
  .filter((m) => noFilter || m.location.type !== LocType.OnPallet)
270
412
  .orderedGroupBy((m) => m.action.loadOntoFace ?? 1)
271
- : LazySeq.of(mats)
413
+ : LazySeq.of(allMats)
272
414
  .filter((m) => noFilter || m.location.type === LocType.OnPallet)
273
415
  .orderedGroupBy((m) => m.action.type === ActionType.Loading ? (m.action.loadOntoFace ?? 1) : (m.location.face ?? 1));
274
- return (_jsx(Box, { display: "grid", gridTemplateRows: `${CollapsedIconSize}px`, gridTemplateColumns: `repeat(${maxNumFaces}, ${CollapsedIconSize}px)`, columnGap: "5px", height: "100%", alignContent: "center", justifyContent: "center", children: byFace.map(([face, mats]) => (_jsx(Box, { gridColumn: face, gridRow: 1, children: _jsx(MaterialIcon, { mats: mats }) }, face))) }));
416
+ return (_jsx(Box, { sx: {
417
+ display: "grid",
418
+ gridTemplateRows: `${CollapsedIconSize}px`,
419
+ gridTemplateColumns: `repeat(${maxNumFaces}, ${CollapsedIconSize}px)`,
420
+ columnGap: "5px",
421
+ height: "100%",
422
+ alignContent: "center",
423
+ justifyContent: "center",
424
+ }, children: byFace.map(([face, mats]) => (_jsx(Box, { sx: {
425
+ gridColumn: face,
426
+ gridRow: 1,
427
+ }, children: _jsx(MaterialIcon, { mats: mats }) }, face))) }));
275
428
  }
276
429
  }
430
+ function BasketContents({ mats }) {
431
+ const byPosition = LazySeq.of(mats).orderedGroupBy((m) => (m.location.basketSubPosition ?? 0) + 1);
432
+ return (_jsx(Box, { sx: {
433
+ display: "flex",
434
+ flexWrap: "wrap",
435
+ justifyContent: "flex-start",
436
+ alignItems: "flex-start",
437
+ gap: "5px",
438
+ minHeight: `${CollapsedIconSize}px`,
439
+ paddingLeft: "5px",
440
+ paddingRight: "5px",
441
+ height: "100%",
442
+ alignContent: "center",
443
+ }, children: byPosition.map(([position, bucketMats]) => (_jsx(Box, { children: _jsx(MaterialIcon, { mats: bucketMats }) }, position))) }));
444
+ }
445
+ function SourceRowContents({ mats, maxNumFaces, }) {
446
+ return (_jsx(Box, { sx: {
447
+ minHeight: `${rowSize}px`,
448
+ display: "flex",
449
+ alignItems: "center",
450
+ justifyContent: "flex-start",
451
+ paddingLeft: "5px",
452
+ gap: "5px",
453
+ paddingRight: "5px",
454
+ }, children: _jsx(PalletFaces, { mats: mats, maxNumFaces: maxNumFaces, loadingOntoPallet: true }) }));
455
+ }
277
456
  function gridTemplateColumns(maxNumFaces, includeLabelCol) {
278
457
  // each material column is at least CollapsedIconSize * (maxNumFaces) for the icon + 5px * (maxNumFaces + 1) for the columnGap in PalletFaces
279
458
  const colSize = CollapsedIconSize * maxNumFaces + 5 * (maxNumFaces + 1);
@@ -337,7 +516,52 @@ function MachineLabel({ machine }) {
337
516
  return (_jsxs("div", { children: [_jsx(Typography, { variant: "h5", children: machine.name }), _jsx(Typography, { variant: "subtitle1", children: status }), machining ? (elapsed === null ? (_jsx(LinearProgress, {})) : elapsed < 0 ? (_jsx(LinearProgress, { color: "error" })) : (_jsx(LinearProgress, { variant: "determinate", value: elapsed }))) : undefined] }));
338
517
  }
339
518
  function Machine({ maxNumFaces, machine }) {
340
- return (_jsxs(Box, { display: "grid", border: "1px solid black", margin: "5px", gridTemplateRows: `auto ${rowSize}px ${rowSize}px ${rowSize}px`, gridTemplateColumns: gridTemplateColumns(maxNumFaces, true), gridTemplateAreas: `"machname machname" "inboundpal inboundmat" "worktablepal worktablemat" "outboundpal outboundmat"`, children: [_jsx(Box, { gridArea: "machname", padding: "0.2em", borderBottom: "1px solid black", children: _jsx(MachineLabel, { machine: machine }) }), _jsx(Box, { gridArea: "inboundpal", borderRight: "1px solid black", borderBottom: "1px solid black", padding: "2px", children: _jsxs(Stack, { children: [_jsx(Typography, { variant: "body1", textAlign: "center", children: "In" }), machine.inbound ? (_jsx(Typography, { variant: "h6", textAlign: "center", children: machine.inbound.pallet.palletNum })) : undefined] }) }), _jsx(Box, { gridArea: "inboundmat", borderBottom: "1px solid black", children: machine.inbound ? _jsx(PalletFaces, { mats: machine.inbound.mats, maxNumFaces: maxNumFaces }) : undefined }), _jsx(Box, { gridArea: "worktablepal", borderRight: "1px solid black", borderBottom: "1px solid black", padding: "2px", children: _jsxs(Stack, { children: [_jsx(Typography, { variant: "body1", textAlign: "center", children: "Work" }), machine.worktable ? (_jsx(Typography, { variant: "h6", textAlign: "center", children: machine.worktable.pallet.palletNum })) : undefined] }) }), _jsx(Box, { gridArea: "worktablemat", borderBottom: "1px solid black", children: machine.worktable ? (_jsx(PalletFaces, { mats: machine.worktable.mats, maxNumFaces: maxNumFaces })) : undefined }), _jsx(Box, { gridArea: "outboundpal", borderRight: "1px solid black", padding: "2px", children: _jsxs(Stack, { children: [_jsx(Typography, { variant: "body1", textAlign: "center", children: "Out" }), machine.outbound ? (_jsx(Typography, { variant: "h6", textAlign: "center", children: machine.outbound.pallet.palletNum })) : undefined] }) }), _jsx(Box, { gridArea: "outboundmat", children: machine.outbound ? (_jsx(PalletFaces, { mats: machine.outbound.mats, maxNumFaces: maxNumFaces })) : undefined })] }));
519
+ return (_jsxs(Box, { sx: {
520
+ display: "grid",
521
+ border: "1px solid black",
522
+ margin: "5px",
523
+ gridTemplateRows: `auto ${rowSize}px ${rowSize}px ${rowSize}px`,
524
+ gridTemplateColumns: gridTemplateColumns(maxNumFaces, true),
525
+ gridTemplateAreas: `"machname machname" "inboundpal inboundmat" "worktablepal worktablemat" "outboundpal outboundmat"`,
526
+ }, children: [_jsx(Box, { sx: {
527
+ gridArea: "machname",
528
+ padding: "0.2em",
529
+ borderBottom: "1px solid black",
530
+ }, children: _jsx(MachineLabel, { machine: machine }) }), _jsx(Box, { sx: {
531
+ gridArea: "inboundpal",
532
+ borderRight: "1px solid black",
533
+ borderBottom: "1px solid black",
534
+ padding: "2px",
535
+ }, children: _jsxs(Stack, { children: [_jsx(Typography, { variant: "body1", sx: {
536
+ textAlign: "center",
537
+ }, children: "In" }), machine.inbound ? (_jsx(Typography, { variant: "h6", sx: {
538
+ textAlign: "center",
539
+ }, children: machine.inbound.pallet.palletNum })) : undefined] }) }), _jsx(Box, { sx: {
540
+ gridArea: "inboundmat",
541
+ borderBottom: "1px solid black",
542
+ }, children: machine.inbound ? _jsx(PalletFaces, { mats: machine.inbound.mats, maxNumFaces: maxNumFaces }) : undefined }), _jsx(Box, { sx: {
543
+ gridArea: "worktablepal",
544
+ borderRight: "1px solid black",
545
+ borderBottom: "1px solid black",
546
+ padding: "2px",
547
+ }, children: _jsxs(Stack, { children: [_jsx(Typography, { variant: "body1", sx: {
548
+ textAlign: "center",
549
+ }, children: "Work" }), machine.worktable ? (_jsx(Typography, { variant: "h6", sx: {
550
+ textAlign: "center",
551
+ }, children: machine.worktable.pallet.palletNum })) : undefined] }) }), _jsx(Box, { sx: {
552
+ gridArea: "worktablemat",
553
+ borderBottom: "1px solid black",
554
+ }, children: machine.worktable ? (_jsx(PalletFaces, { mats: machine.worktable.mats, maxNumFaces: maxNumFaces })) : undefined }), _jsx(Box, { sx: {
555
+ gridArea: "outboundpal",
556
+ borderRight: "1px solid black",
557
+ padding: "2px",
558
+ }, children: _jsxs(Stack, { children: [_jsx(Typography, { variant: "body1", sx: {
559
+ textAlign: "center",
560
+ }, children: "Out" }), machine.outbound ? (_jsx(Typography, { variant: "h6", sx: {
561
+ textAlign: "center",
562
+ }, children: machine.outbound.pallet.palletNum })) : undefined] }) }), _jsx(Box, { sx: {
563
+ gridArea: "outboundmat",
564
+ }, children: machine.outbound ? (_jsx(PalletFaces, { mats: machine.outbound.mats, maxNumFaces: maxNumFaces })) : undefined })] }));
341
565
  }
342
566
  function useElapsedLoadTime(material) {
343
567
  const mat = material?.find((m) => m.action.type === ActionType.Loading ||
@@ -359,11 +583,95 @@ function useElapsedLoadTime(material) {
359
583
  }
360
584
  }
361
585
  function LoadStationLabel({ load }) {
362
- const status = useElapsedLoadTime(load.pal?.mats);
363
- return (_jsxs(Box, { display: "flex", justifyContent: "space-between", alignItems: "baseline", children: [_jsxs(Typography, { variant: "h5", children: ["L/U ", load.lulNum] }), _jsx(Typography, { variant: "body1", children: status })] }));
586
+ const status = useElapsedLoadTime(load.pal?.mats ?? load.basket?.mats);
587
+ const fmsInfo = useAtomValue(fmsInformation);
588
+ return (_jsxs(Box, { sx: {
589
+ display: "flex",
590
+ justifyContent: "space-between",
591
+ alignItems: "baseline",
592
+ }, children: [_jsx(Typography, { variant: "h5", children: loadStationDisplayName(load.lulNum, fmsInfo.loadStationNames) }), _jsx(Typography, { variant: "body1", children: status })] }));
364
593
  }
365
- function LoadStation({ maxNumFaces, load }) {
366
- return (_jsxs(Box, { display: "grid", border: "1px solid black", margin: "5px", gridTemplateRows: `auto ${rowSize}px ${rowSize}px`, gridTemplateColumns: gridTemplateColumns(maxNumFaces, true), gridTemplateAreas: `"lulname lulname" "loading loadingmat" "currentpal currentmat"`, children: [_jsx(Box, { gridArea: "lulname", padding: "0.2em", borderBottom: "1px solid black", children: _jsx(LoadStationLabel, { load: load }) }), _jsx(Box, { gridArea: "loading", borderRight: "1px solid black", borderBottom: "1px solid black", padding: "2px", children: _jsxs(Stack, { children: [_jsx(Typography, { variant: "body1", textAlign: "center", children: "To" }), _jsx(Typography, { variant: "body1", textAlign: "center", children: "Load" })] }) }), _jsx(Box, { sx: { gridArea: "loadingmat", borderBottom: "1px solid black" }, children: load.pal ? (_jsx(PalletFaces, { mats: load.pal.mats, maxNumFaces: maxNumFaces, loadingOntoPallet: true })) : undefined }), _jsx(Box, { gridArea: "currentpal", borderRight: "1px solid black", padding: "2px", children: _jsxs(Stack, { children: [_jsx(Typography, { variant: "body1", textAlign: "center", children: "Pallet" }), load.pal ? (_jsx(Typography, { variant: "h6", textAlign: "center", children: load.pal.pallet.palletNum })) : undefined] }) }), _jsx(Box, { gridArea: "currentmat", children: load.pal ? _jsx(PalletFaces, { mats: load.pal.mats, maxNumFaces: maxNumFaces }) : undefined })] }));
594
+ function LoadStation({ maxNumFaces, maxNumStagingRows, maxNumSourceRows, load, }) {
595
+ const fmsInfo = useAtomValue(fmsInformation);
596
+ const basketName = basketDisplayName(fmsInfo.basketName);
597
+ const currentLabel = load.pal ? "Pallet" : load.basket ? basketName : null;
598
+ const currentValue = load.pal
599
+ ? load.pal.pallet.palletNum.toString()
600
+ : load.basket
601
+ ? load.basket.basket.basketId.toString()
602
+ : null;
603
+ const numSourceRows = Math.max(1, maxNumSourceRows);
604
+ const numStagingRows = Math.max(1, maxNumStagingRows);
605
+ const sourceAreaRows = Array.from({ length: numSourceRows }, (_, i) => `"source${i} sourcemat${i}"`);
606
+ const stagingAreaRows = Array.from({ length: numStagingRows }, (_, i) => `"stage${i} stagemat${i}"`);
607
+ const gridTemplateAreas = [
608
+ '"lulname lulname"',
609
+ ...sourceAreaRows,
610
+ '"current currentmat"',
611
+ ...stagingAreaRows,
612
+ ].join(" ");
613
+ const totalDataRows = numSourceRows + 1 + numStagingRows;
614
+ return (_jsxs(Box, { sx: {
615
+ display: "grid",
616
+ border: "1px solid black",
617
+ margin: "5px",
618
+ gridTemplateRows: `auto repeat(${totalDataRows}, ${rowSize}px)`,
619
+ gridTemplateColumns: gridTemplateColumns(maxNumFaces, true),
620
+ gridTemplateAreas,
621
+ }, children: [_jsx(Box, { sx: {
622
+ gridArea: "lulname",
623
+ padding: "0.2em",
624
+ borderBottom: "1px solid black",
625
+ }, children: _jsx(LoadStationLabel, { load: load }) }), Array.from({ length: numSourceRows }, (_, i) => {
626
+ const row = load.sources[i] ?? null;
627
+ return (_jsxs(Fragment, { children: [_jsx(Box, { sx: {
628
+ gridArea: `source${i}`,
629
+ borderRight: "1px solid black",
630
+ borderBottom: "1px solid black",
631
+ padding: "2px",
632
+ display: "flex",
633
+ alignItems: "center",
634
+ justifyContent: "center",
635
+ }, children: row ? (_jsx(Typography, { variant: "body2", sx: { textAlign: "center" }, children: row.label })) : undefined }), _jsx(Box, { sx: {
636
+ gridArea: `sourcemat${i}`,
637
+ borderBottom: "1px solid black",
638
+ display: "flex",
639
+ flexDirection: "column",
640
+ justifyContent: "center",
641
+ }, children: row ? _jsx(SourceRowContents, { mats: row.mats, maxNumFaces: maxNumFaces }) : undefined })] }, `source-${i}`));
642
+ }), _jsx(Box, { sx: {
643
+ gridArea: "current",
644
+ borderRight: "1px solid black",
645
+ borderBottom: "1px solid black",
646
+ padding: "2px",
647
+ display: "flex",
648
+ alignItems: "center",
649
+ justifyContent: "center",
650
+ }, children: _jsxs(Stack, { children: [currentLabel ? (_jsx(Typography, { variant: "body1", sx: { textAlign: "center" }, children: currentLabel })) : undefined, currentValue ? (_jsx(Typography, { variant: "h6", sx: { textAlign: "center" }, children: currentValue })) : undefined] }) }), _jsxs(Box, { sx: {
651
+ gridArea: "currentmat",
652
+ display: "flex",
653
+ flexDirection: "column",
654
+ justifyContent: "center",
655
+ borderBottom: "1px solid black",
656
+ }, children: [load.pal ? _jsx(PalletFaces, { mats: load.pal.mats, maxNumFaces: maxNumFaces }) : undefined, !load.pal && load.basket ? _jsx(BasketContents, { mats: load.basket.mats }) : undefined] }), Array.from({ length: numStagingRows }, (_, i) => {
657
+ const row = load.staging[i] ?? null;
658
+ const isLastRow = i === numStagingRows - 1;
659
+ return (_jsxs(Fragment, { children: [_jsx(Box, { sx: {
660
+ gridArea: `stage${i}`,
661
+ borderRight: "1px solid black",
662
+ ...(isLastRow ? {} : { borderBottom: "1px solid black" }),
663
+ padding: "2px",
664
+ display: "flex",
665
+ alignItems: "center",
666
+ justifyContent: "center",
667
+ }, children: row ? (_jsxs(Typography, { variant: "body2", sx: { textAlign: "center" }, children: ["Staging ", basketName, " ", row.basket.basketId] })) : undefined }), _jsx(Box, { sx: {
668
+ gridArea: `stagemat${i}`,
669
+ ...(isLastRow ? {} : { borderBottom: "1px solid black" }),
670
+ display: "flex",
671
+ flexDirection: "column",
672
+ justifyContent: "center",
673
+ }, children: row ? _jsx(BasketContents, { mats: row.mats }) : undefined })] }, `stage-${i}`));
674
+ })] }));
367
675
  }
368
676
  function MachineAtLoadLabel({ status }) {
369
677
  const lulStatus = useElapsedLoadTime(status.loadingMats);
@@ -371,13 +679,118 @@ function MachineAtLoadLabel({ status }) {
371
679
  return (_jsxs("div", { children: [_jsxs(Typography, { variant: "h5", children: ["Station ", status.lulNum] }), status.machineCurrentlyAtLoad ? (_jsxs(_Fragment, { children: [_jsxs(Typography, { variant: "h5", children: [status.machineCurrentlyAtLoad.group, " ", status.machineCurrentlyAtLoad.num] }), _jsx(Typography, { variant: "subtitle1", children: mcStatus === "Idle" ? lulStatus : mcStatus }), machining ? (mcElapsed === null ? (_jsx(LinearProgress, {})) : mcElapsed < 0 ? (_jsx(LinearProgress, { color: "error" })) : (_jsx(LinearProgress, { variant: "determinate", value: mcElapsed }))) : undefined] })) : (_jsxs(_Fragment, { children: [status.machineMoving ? _jsx(Typography, { variant: "subtitle2", children: "Machine Moving" }) : undefined, _jsxs(Typography, { variant: "subtitle1", children: ["Loading ", lulStatus] })] }))] }));
372
680
  }
373
681
  function MachineAtLoad({ maxNumFaces, status }) {
374
- return (_jsxs(Box, { display: "grid", border: "1px solid black", margin: "5px", gridTemplateRows: `minmax(104px, max-content) repeat(3, ${maxNumFaces > 1 ? rowSize.toString() + "px" : "minmax(110px, max-content)"})`, gridTemplateColumns: maxNumFaces === 1 ? "60px minmax(230px, max-content)" : gridTemplateColumns(maxNumFaces, true), gridTemplateAreas: `"name name" "ready readymat" "machining machiningmat" "loadstation loadstationmat"`, children: [_jsx(Box, { gridArea: "name", padding: "0.2em", borderBottom: "1px solid black", children: _jsx(MachineAtLoadLabel, { status: status }) }), _jsx(Box, { gridArea: "ready", borderRight: "1px solid black", borderBottom: "1px solid black", padding: "2px", children: _jsx(Typography, { variant: "body1", textAlign: "center", children: "Ready" }) }), _jsx(Box, { gridArea: "readymat", borderBottom: "1px solid black", display: "flex", flexDirection: "column", justifyContent: "center", children: _jsx(PalletFaces, { mats: status.readyMats, maxNumFaces: maxNumFaces, showExpanded: true }) }), _jsx(Box, { gridArea: "machining", borderRight: "1px solid black", borderBottom: "1px solid black", padding: "2px", children: _jsx(Typography, { variant: "body1", textAlign: "center", children: "Work" }) }), _jsx(Box, { gridArea: "machiningmat", borderBottom: "1px solid black", display: "flex", flexDirection: "column", justifyContent: "center", children: _jsx(PalletFaces, { mats: status.machiningMats, maxNumFaces: maxNumFaces, showExpanded: true }) }), _jsx(Box, { gridArea: "loadstation", borderRight: "1px solid black", padding: "2px", children: _jsxs(Stack, { children: [_jsx(Typography, { variant: "body1", textAlign: "center", children: "Load" }), _jsx(Typography, { variant: "body1", textAlign: "center", children: "Station" })] }) }), _jsx(Box, { gridArea: "loadstationmat", display: "flex", flexDirection: "column", justifyContent: "center", children: _jsx(PalletFaces, { mats: status.loadingMats, maxNumFaces: maxNumFaces, showExpanded: true, noFilter: true }) })] }));
682
+ return (_jsxs(Box, { sx: {
683
+ display: "grid",
684
+ border: "1px solid black",
685
+ margin: "5px",
686
+ gridTemplateRows: `minmax(104px, max-content) repeat(3, ${maxNumFaces > 1 ? rowSize.toString() + "px" : "minmax(110px, max-content)"})`,
687
+ gridTemplateColumns: maxNumFaces === 1 ? "60px minmax(230px, max-content)" : gridTemplateColumns(maxNumFaces, true),
688
+ gridTemplateAreas: `"name name" "ready readymat" "machining machiningmat" "loadstation loadstationmat"`,
689
+ }, children: [_jsx(Box, { sx: {
690
+ gridArea: "name",
691
+ padding: "0.2em",
692
+ borderBottom: "1px solid black",
693
+ }, children: _jsx(MachineAtLoadLabel, { status: status }) }), _jsx(Box, { sx: {
694
+ gridArea: "ready",
695
+ borderRight: "1px solid black",
696
+ borderBottom: "1px solid black",
697
+ padding: "2px",
698
+ }, children: _jsx(Typography, { variant: "body1", sx: {
699
+ textAlign: "center",
700
+ }, children: "Ready" }) }), _jsx(Box, { sx: {
701
+ gridArea: "readymat",
702
+ borderBottom: "1px solid black",
703
+ display: "flex",
704
+ flexDirection: "column",
705
+ justifyContent: "center",
706
+ }, children: _jsx(PalletFaces, { mats: status.readyMats, maxNumFaces: maxNumFaces, showExpanded: true }) }), _jsx(Box, { sx: {
707
+ gridArea: "machining",
708
+ borderRight: "1px solid black",
709
+ borderBottom: "1px solid black",
710
+ padding: "2px",
711
+ }, children: _jsx(Typography, { variant: "body1", sx: {
712
+ textAlign: "center",
713
+ }, children: "Work" }) }), _jsx(Box, { sx: {
714
+ gridArea: "machiningmat",
715
+ borderBottom: "1px solid black",
716
+ display: "flex",
717
+ flexDirection: "column",
718
+ justifyContent: "center",
719
+ }, children: _jsx(PalletFaces, { mats: status.machiningMats, maxNumFaces: maxNumFaces, showExpanded: true }) }), _jsx(Box, { sx: {
720
+ gridArea: "loadstation",
721
+ borderRight: "1px solid black",
722
+ padding: "2px",
723
+ }, children: _jsxs(Stack, { children: [_jsx(Typography, { variant: "body1", sx: {
724
+ textAlign: "center",
725
+ }, children: "Load" }), _jsx(Typography, { variant: "body1", sx: {
726
+ textAlign: "center",
727
+ }, children: "Station" })] }) }), _jsx(Box, { sx: {
728
+ gridArea: "loadstationmat",
729
+ display: "flex",
730
+ flexDirection: "column",
731
+ justifyContent: "center",
732
+ }, children: _jsx(PalletFaces, { mats: status.loadingMats, maxNumFaces: maxNumFaces, showExpanded: true, noFilter: true }) })] }));
375
733
  }
376
734
  function StockerPallet({ maxNumFaces, pallet }) {
377
- return (_jsxs(Box, { display: "grid", border: "1px solid black", margin: "5px", gridTemplateRows: `auto ${rowSize}px`, gridTemplateColumns: gridTemplateColumns(maxNumFaces, false), gridTemplateAreas: `"palname" "palmat"`, children: [_jsxs(Typography, { variant: "h5", gridArea: "palname", padding: "0.2em", borderBottom: "1px solid black", children: ["Pallet ", pallet.pallet.palletNum] }), _jsx(Box, { gridArea: "palmat", children: _jsx(PalletFaces, { mats: pallet.mats, maxNumFaces: maxNumFaces }) })] }));
735
+ return (_jsxs(Box, { sx: {
736
+ display: "grid",
737
+ border: "1px solid black",
738
+ margin: "5px",
739
+ gridTemplateRows: `auto ${rowSize}px`,
740
+ gridTemplateColumns: gridTemplateColumns(maxNumFaces, false),
741
+ gridTemplateAreas: `"palname" "palmat"`,
742
+ }, children: [_jsxs(Typography, { variant: "h5", sx: {
743
+ gridArea: "palname",
744
+ padding: "0.2em",
745
+ borderBottom: "1px solid black",
746
+ }, children: ["Pallet ", pallet.pallet.palletNum] }), _jsx(Box, { sx: {
747
+ gridArea: "palmat",
748
+ }, children: _jsx(PalletFaces, { mats: pallet.mats, maxNumFaces: maxNumFaces }) })] }));
749
+ }
750
+ function FloatingBasket({ basket }) {
751
+ const basketName = basketDisplayName(useAtomValue(fmsInformation).basketName);
752
+ return (_jsxs(Box, { sx: {
753
+ display: "grid",
754
+ border: "1px solid black",
755
+ margin: "5px",
756
+ gridTemplateRows: `auto ${rowSize}px`,
757
+ gridTemplateColumns: "minmax(120px, max-content)",
758
+ gridTemplateAreas: '"basketname" "basketmat"',
759
+ }, children: [_jsxs(Typography, { variant: "h5", sx: {
760
+ gridArea: "basketname",
761
+ padding: "0.2em",
762
+ borderBottom: "1px solid black",
763
+ }, children: [basketName, " ", basket.basket.basketId] }), _jsx(Box, { sx: { gridArea: "basketmat" }, children: _jsx(BasketContents, { mats: basket.mats }) })] }));
764
+ }
765
+ function BasketStorageSummary({ empty, filled }) {
766
+ const basketName = basketDisplayName(useAtomValue(fmsInformation).basketName);
767
+ return (_jsxs(Box, { sx: {
768
+ display: "grid",
769
+ border: "1px solid black",
770
+ margin: "5px",
771
+ padding: "0.5em 1em",
772
+ alignContent: "center",
773
+ minWidth: "170px",
774
+ }, children: [_jsxs(Typography, { variant: "h5", children: [basketName, " Storage"] }), _jsxs(Typography, { variant: "body1", children: ["Empty: ", empty] }), _jsxs(Typography, { variant: "body1", children: ["Filled: ", filled] })] }));
378
775
  }
379
776
  export const SystemOverview = memo(function SystemOverview({ overview }) {
380
- return (_jsxs("div", { children: [overview.machines.toAscLazySeq().map(([group, machines]) => (_jsx(Box, { display: "flex", flexWrap: "wrap", justifyContent: "space-evenly", children: machines.map((machine) => (_jsx(Machine, { machine: machine, maxNumFaces: overview.maxNumFacesOnPallet }, machine.name))) }, group))), overview.loads.length > 0 ? (_jsx(Box, { display: "flex", flexWrap: "wrap", justifyContent: "space-evenly", children: overview.loads.map((machine) => (_jsx(LoadStation, { load: machine, maxNumFaces: overview.maxNumFacesOnPallet }, machine.lulNum))) })) : undefined, overview.machineAtLoad.length > 0 ? (_jsx(Box, { display: "flex", flexWrap: "wrap", justifyContent: "space-evenly", children: overview.machineAtLoad.map((status) => (_jsx(MachineAtLoad, { status: status, maxNumFaces: overview.maxNumFacesOnPallet }, status.lulNum))) })) : undefined, overview.stockerPals.length > 0 ? (_jsx(Box, { display: "flex", flexWrap: "wrap", justifyContent: "space-evenly", children: overview.stockerPals.map((pal) => (_jsx(StockerPallet, { pallet: pal, maxNumFaces: overview.maxNumFacesOnPallet }, pal.pallet.palletNum))) })) : undefined] }));
777
+ return (_jsxs("div", { children: [overview.machines.toAscLazySeq().map(([group, machines]) => (_jsx(Box, { sx: {
778
+ display: "flex",
779
+ flexWrap: "wrap",
780
+ justifyContent: "space-evenly",
781
+ }, children: machines.map((machine) => (_jsx(Machine, { machine: machine, maxNumFaces: overview.maxNumFacesOnPallet }, machine.name))) }, group))), overview.loads.length > 0 ? (_jsx(Box, { sx: {
782
+ display: "flex",
783
+ flexWrap: "wrap",
784
+ justifyContent: "space-evenly",
785
+ }, children: overview.loads.map((machine) => (_jsx(LoadStation, { load: machine, maxNumFaces: overview.maxNumFacesOnPallet, maxNumStagingRows: overview.maxNumStagingRows, maxNumSourceRows: overview.maxNumSourceRows }, machine.lulNum))) })) : undefined, overview.machineAtLoad.length > 0 ? (_jsx(Box, { sx: {
786
+ display: "flex",
787
+ flexWrap: "wrap",
788
+ justifyContent: "space-evenly",
789
+ }, children: overview.machineAtLoad.map((status) => (_jsx(MachineAtLoad, { status: status, maxNumFaces: overview.maxNumFacesOnPallet }, status.lulNum))) })) : undefined, overview.stockerPals.length > 0 || overview.floatingBaskets.length > 0 || overview.storageBaskets ? (_jsxs(Box, { sx: {
790
+ display: "flex",
791
+ flexWrap: "wrap",
792
+ justifyContent: "space-evenly",
793
+ }, children: [overview.stockerPals.map((pal) => (_jsx(StockerPallet, { pallet: pal, maxNumFaces: overview.maxNumFacesOnPallet }, pal.pallet.palletNum))), overview.floatingBaskets.map((basket) => (_jsx(FloatingBasket, { basket: basket }, basket.basket.basketId))), overview.storageBaskets ? (_jsx(BasketStorageSummary, { empty: overview.storageBaskets.empty, filled: overview.storageBaskets.filled })) : undefined] })) : undefined] }));
381
794
  });
382
795
  const SystemOverviewMaterialDialog = memo(function SystemOverviewMaterialDialog({ ignoreOperator, }) {
383
796
  const [swapSt, setSwapSt] = useState(null);
@@ -409,7 +822,9 @@ function MachineIcon({ machine }) {
409
822
  }
410
823
  function LoadStationIcon({ load }) {
411
824
  const theme = useTheme();
412
- return (_jsx("polygon", { points: "3,27 27,27 15,3", fill: load.pal === null ? "white" : theme.palette.secondary.main, stroke: "black" }));
825
+ return (_jsx("polygon", { points: "3,27 27,27 15,3", fill: load.pal === null && load.basket === null && load.staging.length === 0
826
+ ? "white"
827
+ : theme.palette.secondary.main, stroke: "black" }));
413
828
  }
414
829
  function MachineAtLoadIcon({ status }) {
415
830
  const theme = useTheme();
@@ -435,5 +850,9 @@ const StatusIcons = memo(function StatusIcons({ overview }) {
435
850
  export const SystemOverviewDialogButton = memo(function SystemOverviewDialogButton({ full, }) {
436
851
  const [open, setOpen] = useState(false);
437
852
  const overview = useCellOverview();
438
- return (_jsxs(_Fragment, { children: [_jsx(Button, { onClick: () => setOpen(true), children: _jsx(StatusIcons, { overview: overview }) }), _jsxs(Dialog, { open: open, onClose: () => setOpen(false), maxWidth: "xl", fullScreen: full, children: [full ? (_jsx(AppBar, { sx: { position: "relative" }, children: _jsxs(Toolbar, { children: [_jsx(IconButton, { edge: "start", color: "inherit", onClick: () => setOpen(false), "aria-label": "close", children: _jsx(CloseIcon, {}) }), _jsx(Typography, { sx: { ml: 2, flex: 1 }, variant: "h6", component: "div", children: "System Overview" })] }) })) : undefined, _jsx(DialogContent, { children: _jsx(Box, { paddingBottom: "2em", paddingLeft: "5em", paddingRight: "5em", children: _jsx(SystemOverview, { overview: overview }) }) })] })] }));
853
+ return (_jsxs(_Fragment, { children: [_jsx(Button, { onClick: () => setOpen(true), children: _jsx(StatusIcons, { overview: overview }) }), _jsxs(Dialog, { open: open, onClose: () => setOpen(false), maxWidth: "xl", fullScreen: full, children: [full ? (_jsx(AppBar, { sx: { position: "relative" }, children: _jsxs(Toolbar, { children: [_jsx(IconButton, { edge: "start", color: "inherit", onClick: () => setOpen(false), "aria-label": "close", children: _jsx(CloseIcon, {}) }), _jsx(Typography, { sx: { ml: 2, flex: 1 }, variant: "h6", component: "div", children: "System Overview" })] }) })) : undefined, _jsx(DialogContent, { children: _jsx(Box, { sx: {
854
+ paddingBottom: "2em",
855
+ paddingLeft: "5em",
856
+ paddingRight: "5em",
857
+ }, children: _jsx(SystemOverview, { overview: overview }) }) })] })] }));
439
858
  });