@seedtactics/insight-client 17.0.3 → 17.0.4
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/dist/assets/index-B0B_a7c8.js +366 -0
- package/dist/cell-status/alarms.d.ts +16 -0
- package/dist/cell-status/alarms.js +71 -0
- package/dist/cell-status/loading.js +5 -0
- package/dist/cell-status/material-details.d.ts +1 -0
- package/dist/cell-status/material-details.js +10 -1
- package/dist/components/App.js +0 -1
- package/dist/components/Navigation.js +10 -5
- package/dist/components/station-monitor/BasketLoadStationWork.js +15 -8
- package/dist/components/station-monitor/BulkRawMaterial.js +31 -18
- package/dist/components/station-monitor/CancelLoadButton.js +8 -4
- package/dist/components/station-monitor/InvalidateCycle.js +23 -18
- package/dist/components/station-monitor/LoadStation.js +21 -17
- package/dist/components/station-monitor/Material.js +34 -29
- package/dist/components/station-monitor/MoveMaterialArrows.js +13 -2
- package/dist/components/station-monitor/QuarantineButton.js +12 -4
- package/dist/components/station-monitor/QueuesAddMaterial.js +54 -49
- package/dist/components/station-monitor/SystemAlarmTooltip.d.ts +6 -0
- package/dist/components/station-monitor/SystemAlarmTooltip.js +5 -0
- package/dist/fms-insight-api.json +48 -0
- package/dist/index.html +1 -1
- package/dist/network/api.d.ts +28 -0
- package/dist/network/api.js +54 -0
- package/dist/network/current-status-session.d.ts +13 -1
- package/dist/network/current-status-session.js +15 -0
- package/package.json +1 -1
- package/dist/assets/index-BfycE-BU.js +0 -366
|
@@ -45,6 +45,7 @@ import { currentOperator } from "../../data/operators.js";
|
|
|
45
45
|
import { DisplayLoadingAndError } from "../ErrorsAndLoading.js";
|
|
46
46
|
import { ErrorBoundary } from "react-error-boundary";
|
|
47
47
|
import { currentStatus } from "../../cell-status/current-status.js";
|
|
48
|
+
import { alarmsBlockingMaterialChanges, materialActionIsSuspended, } from "../../cell-status/alarms.js";
|
|
48
49
|
import { useAtom, useAtomValue, useSetAtom } from "jotai";
|
|
49
50
|
import { last30Rebookings } from "../../cell-status/rebookings.js";
|
|
50
51
|
import { fmsInformation } from "../../network/server-settings.js";
|
|
@@ -173,22 +174,28 @@ export function MaterialAction({ mat, displayActionForSinglePallet, displayActio
|
|
|
173
174
|
const curSt = useAtomValue(currentStatus);
|
|
174
175
|
const fmsInfo = useAtomValue(fmsInformation);
|
|
175
176
|
const basketName = basketDisplayName(fmsInfo.basketName);
|
|
177
|
+
const description = materialActionDescription(mat, curSt, basketName, displayActionForSinglePallet, displayActionForSingleBasket);
|
|
178
|
+
if (description === null)
|
|
179
|
+
return null;
|
|
180
|
+
return (_jsx(MatCardDetail, { fsize: fsize, children: materialActionIsSuspended(curSt, mat) ? "System alarm" : description }));
|
|
181
|
+
}
|
|
182
|
+
function materialActionDescription(mat, curSt, basketName, displayActionForSinglePallet, displayActionForSingleBasket) {
|
|
176
183
|
switch (mat.action.type) {
|
|
177
184
|
case api.ActionType.Loading:
|
|
178
185
|
// Check if loading from basket
|
|
179
186
|
if (mat.action.loadFromBasketId) {
|
|
180
187
|
if (mat.action.loadOntoPalletNum === null || mat.action.loadOntoPalletNum === undefined) {
|
|
181
|
-
return (_jsxs(
|
|
188
|
+
return (_jsxs(_Fragment, { children: ["Load into ", basketName, " ", mat.action.loadFromBasketId] }));
|
|
182
189
|
}
|
|
183
190
|
else if (displayActionForSinglePallet === undefined) {
|
|
184
|
-
return (_jsxs(
|
|
191
|
+
return (_jsxs(_Fragment, { children: ["Load from ", basketName, " ", mat.action.loadFromBasketId, " to pal", " ", mat.action.loadOntoPalletNum ?? ""] }));
|
|
185
192
|
}
|
|
186
193
|
else if (displayActionForSinglePallet === mat.action.loadOntoPalletNum) {
|
|
187
194
|
const faceNum = mat.action.loadOntoFace ?? 0;
|
|
188
195
|
const faceName = mat.action.loadOntoPalletNum
|
|
189
196
|
? curSt.pallets[mat.action.loadOntoPalletNum]?.faceNames?.[faceNum - 1]
|
|
190
197
|
: null;
|
|
191
|
-
return (_jsxs(
|
|
198
|
+
return (_jsxs(_Fragment, { children: ["Load from ", basketName, " ", mat.action.loadFromBasketId, " to", " ", faceName ?? `face ${faceNum}`] }));
|
|
192
199
|
}
|
|
193
200
|
else {
|
|
194
201
|
return null;
|
|
@@ -202,7 +209,7 @@ export function MaterialAction({ mat, displayActionForSinglePallet, displayActio
|
|
|
202
209
|
mat.action.loadOntoFace === mat.location.face) {
|
|
203
210
|
// material is not moving, just having some manual work done on it
|
|
204
211
|
if (mat.action.processAfterLoad && mat.action.processAfterLoad !== mat.process) {
|
|
205
|
-
return
|
|
212
|
+
return _jsxs(_Fragment, { children: ["Reclamp material to process # ", mat.action.processAfterLoad] });
|
|
206
213
|
}
|
|
207
214
|
else {
|
|
208
215
|
return null;
|
|
@@ -213,7 +220,7 @@ export function MaterialAction({ mat, displayActionForSinglePallet, displayActio
|
|
|
213
220
|
const faceName = mat.location.palletNum
|
|
214
221
|
? curSt.pallets[mat.location.palletNum]?.faceNames?.[faceNum - 1]
|
|
215
222
|
: null;
|
|
216
|
-
return
|
|
223
|
+
return _jsxs(_Fragment, { children: ["Transfer to ", faceName ?? `face ${faceNum}`] });
|
|
217
224
|
}
|
|
218
225
|
}
|
|
219
226
|
else {
|
|
@@ -225,10 +232,10 @@ export function MaterialAction({ mat, displayActionForSinglePallet, displayActio
|
|
|
225
232
|
? curSt.pallets[mat.action.loadOntoPalletNum]?.faceNames?.[faceNum - 1]
|
|
226
233
|
: null;
|
|
227
234
|
if (displayActionForSinglePallet === undefined) {
|
|
228
|
-
return (_jsxs(
|
|
235
|
+
return (_jsxs(_Fragment, { children: ["Load to ", faceName ?? `face ${faceNum}`, " of pal ", mat.action.loadOntoPalletNum ?? ""] }));
|
|
229
236
|
}
|
|
230
237
|
else if (displayActionForSinglePallet === mat.action.loadOntoPalletNum) {
|
|
231
|
-
return
|
|
238
|
+
return _jsxs(_Fragment, { children: ["Load to ", faceName ?? `face ${faceNum}`] });
|
|
232
239
|
}
|
|
233
240
|
else {
|
|
234
241
|
return null;
|
|
@@ -240,11 +247,11 @@ export function MaterialAction({ mat, displayActionForSinglePallet, displayActio
|
|
|
240
247
|
if (displayActionForSingleBasket !== undefined &&
|
|
241
248
|
displayActionForSingleBasket === mat.action.loadToBasketId &&
|
|
242
249
|
mat.action.loadToBasketSlot !== undefined) {
|
|
243
|
-
return (_jsxs(
|
|
250
|
+
return (_jsxs(_Fragment, { children: ["Load into slot ", basketSlotLabel(mat.action.loadToBasketSlot), mat.action.processAfterLoad !== undefined
|
|
244
251
|
? ` for process ${mat.action.processAfterLoad}`
|
|
245
252
|
: ""] }));
|
|
246
253
|
}
|
|
247
|
-
return (_jsxs(
|
|
254
|
+
return (_jsxs(_Fragment, { children: ["Load into ", basketName, " ", mat.action.loadToBasketId ?? "", mat.action.loadToBasketSlot !== undefined
|
|
248
255
|
? ` slot ${basketSlotLabel(mat.action.loadToBasketSlot)}`
|
|
249
256
|
: "", mat.action.processAfterLoad !== undefined
|
|
250
257
|
? ` for process ${mat.action.processAfterLoad}`
|
|
@@ -252,38 +259,38 @@ export function MaterialAction({ mat, displayActionForSinglePallet, displayActio
|
|
|
252
259
|
case api.ActionType.UnloadToInProcess:
|
|
253
260
|
case api.ActionType.UnloadToCompletedMaterial:
|
|
254
261
|
if (mat.action.unloadToBasketId) {
|
|
255
|
-
return (_jsxs(
|
|
262
|
+
return (_jsxs(_Fragment, { children: ["Unload to ", basketName, " ", mat.action.unloadToBasketId, mat.action.unloadToBasketSlot !== undefined
|
|
256
263
|
? ` slot ${basketSlotLabel(mat.action.unloadToBasketSlot)}`
|
|
257
264
|
: ""] }));
|
|
258
265
|
}
|
|
259
266
|
else if (mat.action.unloadIntoQueue) {
|
|
260
|
-
return
|
|
267
|
+
return _jsxs(_Fragment, { children: ["Unload into queue ", mat.action.unloadIntoQueue] });
|
|
261
268
|
}
|
|
262
269
|
else if (mat.action.type === api.ActionType.UnloadToCompletedMaterial &&
|
|
263
270
|
mat.location.type === api.LocType.InBasket) {
|
|
264
|
-
return (_jsxs(
|
|
271
|
+
return (_jsxs(_Fragment, { children: ["Unload completed from ", basketName, " ", mat.location.basketId] }));
|
|
265
272
|
}
|
|
266
273
|
else if (mat.location.type === api.LocType.InBasket) {
|
|
267
|
-
return (_jsxs(
|
|
274
|
+
return (_jsxs(_Fragment, { children: ["Unload from ", basketName, " ", mat.location.basketId] }));
|
|
268
275
|
}
|
|
269
276
|
else {
|
|
270
|
-
return _jsx(
|
|
277
|
+
return _jsx(_Fragment, { children: "Unload from pallet" });
|
|
271
278
|
}
|
|
272
279
|
case api.ActionType.Waiting:
|
|
273
280
|
if (mat.location.type === api.LocType.InQueue && !!mat.jobUnique && mat.jobUnique !== "") {
|
|
274
|
-
return
|
|
281
|
+
return _jsxs(_Fragment, { children: ["Waiting; next process is #", mat.process + 1] });
|
|
275
282
|
}
|
|
276
283
|
else if (mat.location.type === api.LocType.InBasket) {
|
|
277
|
-
return (_jsxs(
|
|
284
|
+
return (_jsxs(_Fragment, { children: ["In ", basketName, " ", mat.location.basketId] }));
|
|
278
285
|
}
|
|
279
286
|
else if (mat.location.type === api.LocType.OnPallet &&
|
|
280
287
|
(mat.lastCompletedMachiningRouteStopIndex === null ||
|
|
281
288
|
mat.lastCompletedMachiningRouteStopIndex === undefined)) {
|
|
282
|
-
return _jsx(
|
|
289
|
+
return _jsx(_Fragment, { children: "Waiting for machining" });
|
|
283
290
|
}
|
|
284
291
|
break;
|
|
285
292
|
case api.ActionType.Machining:
|
|
286
|
-
return
|
|
293
|
+
return _jsxs(_Fragment, { children: ["Machining program ", mat.action.program ?? ""] });
|
|
287
294
|
}
|
|
288
295
|
return null;
|
|
289
296
|
}
|
|
@@ -413,7 +420,9 @@ export const InProcMaterial = memo(function InProcMaterial(props) {
|
|
|
413
420
|
return (_jsx(MatCard, { mat: inproc_mat_to_summary(props.mat), materialCount: props.materialCount, inProcMat: props.mat, displayActionForSinglePallet: props.displayActionForSinglePallet, displayActionForSingleBasket: props.displayActionForSingleBasket, fsize: props.fsize, hideAvatar: props.hideAvatar, displayJob: props.displayJob, showDragHandle: props.showHandle, hideEmptySerial: props.hideEmptySerial, showRawMaterial: props.showRawMaterial, showJobComment: props.showJobComment, shake: props.shake }));
|
|
414
421
|
});
|
|
415
422
|
export const SortableInProcMaterial = memo(function SortableInProcMaterial(props) {
|
|
416
|
-
const
|
|
423
|
+
const changesSuspended = alarmsBlockingMaterialChanges(useAtomValue(currentStatus), [props.mat]).length > 0;
|
|
424
|
+
const canDrag = !changesSuspended &&
|
|
425
|
+
(canReorderQueuedMaterial(props.mat) || canAddOrMoveMaterialToQueue(props.mat));
|
|
417
426
|
const d = { mat: props.mat };
|
|
418
427
|
const { active, isDragging, attributes, listeners, setNodeRef, setActivatorNodeRef, transform, transition, } = useSortable({
|
|
419
428
|
id: props.mat.materialID,
|
|
@@ -434,7 +443,7 @@ export const SortableInProcMaterial = memo(function SortableInProcMaterial(props
|
|
|
434
443
|
: undefined,
|
|
435
444
|
transition: active !== null ? transition : undefined,
|
|
436
445
|
};
|
|
437
|
-
return (_jsx(MatCard, { ref: setNodeRef, dragRootProps: { style }, showDragHandle: canDrag, dragHandleProps: handleProps, setDragHandleRef: setActivatorNodeRef, isActiveDrag: isDragging, mat: inproc_mat_to_summary(props.mat), materialCount: props.materialCount, inProcMat: props.mat, displayActionForSinglePallet: props.displayActionForSinglePallet, displayActionForSingleBasket: props.displayActionForSingleBasket, hideAvatar: props.hideAvatar, displayJob: props.displayJob, hideEmptySerial: props.hideEmptySerial, fsize: props.fsize, shake: active ? undefined : props.shake, showRawMaterial: props.showRawMaterial, showJobComment: props.showJobComment }));
|
|
446
|
+
return (_jsx(MatCard, { ref: setNodeRef, dragRootProps: { style }, showDragHandle: canDrag, dragHandleProps: handleProps, setDragHandleRef: setActivatorNodeRef, isActiveDrag: isDragging, mat: inproc_mat_to_summary(props.mat), materialCount: props.materialCount, inProcMat: props.mat, displayActionForSinglePallet: props.displayActionForSinglePallet, displayActionForSingleBasket: props.displayActionForSingleBasket, hideAvatar: props.hideAvatar, displayJob: props.displayJob, hideEmptySerial: props.hideEmptySerial, fsize: props.fsize, shake: active || changesSuspended ? undefined : props.shake, showRawMaterial: props.showRawMaterial, showJobComment: props.showJobComment }));
|
|
438
447
|
});
|
|
439
448
|
export function DragOverlayInProcMaterial(props) {
|
|
440
449
|
return (_jsx(MatCard, { mat: inproc_mat_to_summary(props.mat), materialCount: props.materialCount, inProcMat: props.mat, displayActionForSinglePallet: props.displayActionForSinglePallet, displayActionForSingleBasket: props.displayActionForSingleBasket, showDragHandle: true, hideAvatar: props.hideAvatar, displayJob: props.displayJob, fsize: props.fsize, hideEmptySerial: props.hideEmptySerial, isDragOverlay: true }));
|
|
@@ -557,15 +566,11 @@ function RebookingNote() {
|
|
|
557
566
|
}
|
|
558
567
|
function MaterialOperationNotice() {
|
|
559
568
|
const material = useAtomValue(matDetails.inProcessMaterialInDialog);
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
const state = materialOperationState(material);
|
|
566
|
-
if (state.kind !== "ActiveLoadStationOperation" || state.cancellationId !== null)
|
|
567
|
-
return null;
|
|
568
|
-
return (_jsx(Typography, { variant: "caption", component: "p", children: "This material is part of the current load/unload operation. Complete the operation or cancel it at the machine control before making other changes." }));
|
|
569
|
+
const alarms = matDetails.useMaterialBlockingAlarms();
|
|
570
|
+
const state = material ? materialOperationState(material) : null;
|
|
571
|
+
return (_jsx(_Fragment, { children: material?.quarantineAfterUnload ? (_jsx(Typography, { variant: "caption", component: "p", children: "Quarantine requested" })) : alarms.length === 0 &&
|
|
572
|
+
state?.kind === "ActiveLoadStationOperation" &&
|
|
573
|
+
state.cancellationId === null ? (_jsx(Typography, { variant: "caption", component: "p", children: "This material is part of the current load/unload operation. Complete the operation or cancel it at the machine control before making other changes." })) : null }));
|
|
569
574
|
}
|
|
570
575
|
export const MaterialDetailContent = memo(function MaterialDetailContent({ highlightProcsGreaterOrEqualTo, }) {
|
|
571
576
|
const toShow = useAtomValue(matDetails.materialDialogOpen);
|
|
@@ -34,6 +34,10 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
34
34
|
import { memo, useState, useEffect, createContext, useRef, useMemo, useContext, } from "react";
|
|
35
35
|
import { computeArrows, uniqueIdForNodeKind, memoPropsForNodeKind, } from "../../data/move-arrows.js";
|
|
36
36
|
import { HashMap } from "@seedtactics/immutable-collections";
|
|
37
|
+
import { useAtomValue } from "jotai";
|
|
38
|
+
import { currentStatus } from "../../cell-status/current-status.js";
|
|
39
|
+
import { materialActionIsSuspended } from "../../cell-status/alarms.js";
|
|
40
|
+
import { MoveMaterialNodeKindType } from "../../data/move-arrows.js";
|
|
37
41
|
function elementToRect(e) {
|
|
38
42
|
const r = e.getBoundingClientRect();
|
|
39
43
|
return {
|
|
@@ -66,6 +70,7 @@ function arrowToPath(arr) {
|
|
|
66
70
|
return `M${arr.fromX},${arr.fromY} Q ${cx} ${cy} ${arr.toX} ${arr.toY}`;
|
|
67
71
|
}
|
|
68
72
|
const MoveMaterialArrows = memo(function MoveMaterialArrows({ container, arrowsWithRefs, }) {
|
|
73
|
+
const status = useAtomValue(currentStatus);
|
|
69
74
|
const [, setDims] = useState({
|
|
70
75
|
height: window.innerHeight,
|
|
71
76
|
width: window.innerWidth,
|
|
@@ -77,8 +82,14 @@ const MoveMaterialArrows = memo(function MoveMaterialArrows({ container, arrowsW
|
|
|
77
82
|
window.addEventListener("resize", handleResize);
|
|
78
83
|
return () => window.removeEventListener("resize", handleResize);
|
|
79
84
|
}, [setDims]);
|
|
80
|
-
const arrows = computeArrows(container.current ? elementToRect(container.current) : null, arrowsWithRefs.collectValues((r) =>
|
|
81
|
-
|
|
85
|
+
const arrows = computeArrows(container.current ? elementToRect(container.current) : null, arrowsWithRefs.collectValues((r) => {
|
|
86
|
+
if (r.type === MoveMaterialNodeKindType.Material &&
|
|
87
|
+
r.material &&
|
|
88
|
+
materialActionIsSuspended(status, r.material))
|
|
89
|
+
return null;
|
|
90
|
+
return r.elem.current ? { ...r, elem: elementToRect(r.elem.current) } : null;
|
|
91
|
+
}));
|
|
92
|
+
return (_jsx("g", { children: arrows.map((arr, idx) => (_jsx("path", { "data-testid": "material-movement-arrow", style: { fill: "none", stroke: "rgba(0,0,0,0.15)", strokeWidth: 2 }, d: arrowToPath(arr), markerEnd: `url(#arrow)` }, idx))) }));
|
|
82
93
|
});
|
|
83
94
|
const MoveMaterialArrowCtx = createContext(undefined);
|
|
84
95
|
export const MoveMaterialArrowContainer = memo(function MoveMaterialArrowContainer({ children, hideArrows, whiteBackground, }) {
|
|
@@ -32,13 +32,15 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
|
32
32
|
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
33
33
|
*/
|
|
34
34
|
import { useState } from "react";
|
|
35
|
-
import { Button, Dialog, DialogActions, DialogContent, DialogTitle, TextField,
|
|
35
|
+
import { Button, Dialog, DialogActions, DialogContent, DialogTitle, TextField, } from "@mui/material";
|
|
36
36
|
import { LazySeq } from "@seedtactics/immutable-collections";
|
|
37
37
|
import { currentStatus } from "../../cell-status/current-status.js";
|
|
38
|
+
import { alarmsBlockingMaterialChanges } from "../../cell-status/alarms.js";
|
|
38
39
|
import { inProcessMaterialInDialog, materialDialogOpen, useQuarantineQueuedMaterial, useRemoveFromQueue, useSignalForQuarantine, } from "../../cell-status/material-details.js";
|
|
39
40
|
import { currentOperator } from "../../data/operators.js";
|
|
40
41
|
import { LocType, QueueRole } from "../../network/api.js";
|
|
41
42
|
import { apiErrorMessage } from "../../network/api-errors.js";
|
|
43
|
+
import { SystemAlarmTooltip } from "./SystemAlarmTooltip.js";
|
|
42
44
|
import { fmsInformation } from "../../network/server-settings.js";
|
|
43
45
|
import { useAtomValue, useSetAtom } from "jotai";
|
|
44
46
|
import { canDirectlyQuarantine, canRemoveFromQueue, canSignalQuarantine, quarantineRoute, } from "../../data/material-operation-policy.js";
|
|
@@ -122,7 +124,10 @@ function RemoveFromQueuesButton({ material, removeFromQueues, removing, }) {
|
|
|
122
124
|
const [open, setOpen] = useState(false);
|
|
123
125
|
const [error, setError] = useState(null);
|
|
124
126
|
const setMatToShow = useSetAtom(materialDialogOpen);
|
|
127
|
+
const alarms = alarmsBlockingMaterialChanges(useAtomValue(currentStatus), [material]);
|
|
125
128
|
async function remove() {
|
|
129
|
+
if (alarms.length > 0)
|
|
130
|
+
return;
|
|
126
131
|
setError(null);
|
|
127
132
|
try {
|
|
128
133
|
await removeFromQueues();
|
|
@@ -144,7 +149,7 @@ function RemoveFromQueuesButton({ material, removeFromQueues, removing, }) {
|
|
|
144
149
|
setError(null);
|
|
145
150
|
setOpen(true);
|
|
146
151
|
}
|
|
147
|
-
return (_jsxs(_Fragment, { children: [_jsx(
|
|
152
|
+
return (_jsxs(_Fragment, { children: [_jsx(SystemAlarmTooltip, { suspended: alarms.length > 0, title: "Remove from the current queue so it can be rescanned", children: _jsx(Button, { color: "primary", disabled: removing || alarms.length > 0, onClick: openRemoval, children: "Remove from Queue" }) }), _jsxs(Dialog, { open: open, onClose: () => setOpen(false), children: [_jsx(DialogTitle, { children: "Remove Material from Queue" }), _jsxs(DialogContent, { children: [_jsx("p", { children: "Remove this material from its current queue. Its production history will remain available. You can scan it again to correct its history or assignment and then add it back to a queue." }), error ? _jsx("p", { role: "alert", children: error }) : null] }), _jsxs(DialogActions, { children: [_jsx(SystemAlarmTooltip, { suspended: alarms.length > 0, children: _jsx(Button, { color: "primary", disabled: removing || alarms.length > 0, onClick: remove, children: "Remove from Queue" }) }), _jsx(Button, { color: "secondary", disabled: removing, onClick: () => setOpen(false), children: "Cancel" })] })] })] }));
|
|
148
153
|
}
|
|
149
154
|
export function QuarantineMatButton({ onClose, ignoreOperator, }) {
|
|
150
155
|
const [open, setOpen] = useState(false);
|
|
@@ -173,6 +178,9 @@ export function QuarantineMatButton({ onClose, ignoreOperator, }) {
|
|
|
173
178
|
operator,
|
|
174
179
|
};
|
|
175
180
|
const displayedSnapshot = snapshot ?? currentSnapshot;
|
|
181
|
+
const status = useAtomValue(currentStatus);
|
|
182
|
+
const currentAlarms = alarmsBlockingMaterialChanges(status, currentSnapshot ? [currentSnapshot.material] : []);
|
|
183
|
+
const confirmationAlarms = alarmsBlockingMaterialChanges(status, snapshot ? [snapshot.material] : []);
|
|
176
184
|
function openQuarantine() {
|
|
177
185
|
if (currentSnapshot === null)
|
|
178
186
|
return;
|
|
@@ -210,7 +218,7 @@ export function QuarantineMatButton({ onClose, ignoreOperator, }) {
|
|
|
210
218
|
break;
|
|
211
219
|
}
|
|
212
220
|
async function quarantine() {
|
|
213
|
-
if (snapshot === null)
|
|
221
|
+
if (snapshot === null || confirmationAlarms.length > 0)
|
|
214
222
|
return;
|
|
215
223
|
setUpdating(true);
|
|
216
224
|
setError(null);
|
|
@@ -258,5 +266,5 @@ export function QuarantineMatButton({ onClose, ignoreOperator, }) {
|
|
|
258
266
|
? quarantiningQueued
|
|
259
267
|
: removingFromQueue);
|
|
260
268
|
const removeFromQueues = q?.canRemoveFromQueues === true ? () => removeFromQueue(q.material.materialID, operator) : null;
|
|
261
|
-
return (_jsxs(_Fragment, { children: [q ? (_jsx(
|
|
269
|
+
return (_jsxs(_Fragment, { children: [q ? (_jsx(SystemAlarmTooltip, { suspended: currentAlarms.length > 0, title: title, children: _jsx(Button, { color: "primary", disabled: removing || currentAlarms.length > 0, onClick: openQuarantine, children: btnTxt }) })) : null, removeFromQueues && q ? (_jsx(RemoveFromQueuesButton, { material: q.material, removeFromQueues: removeFromQueues, removing: removingFromQueue })) : null, _jsxs(Dialog, { open: open && snapshot !== null, onClose: closeQuarantine, children: [_jsx(DialogTitle, { children: "Quarantine Material" }), _jsxs(DialogContent, { children: [_jsx("p", { children: title }), _jsx(TextField, { label: "Reason", value: reason, onChange: (e) => setReason(e.target.value), fullWidth: true, autoFocus: true, multiline: true }), error ? _jsx("p", { role: "alert", children: error }) : null] }), _jsxs(DialogActions, { children: [_jsx(SystemAlarmTooltip, { suspended: confirmationAlarms.length > 0, children: _jsx(Button, { color: "primary", disabled: removing || confirmationAlarms.length > 0, onClick: quarantine, children: btnTxt }) }), _jsx(Button, { color: "secondary", disabled: removing, onClick: closeQuarantine, children: "Cancel" })] })] })] }));
|
|
262
270
|
}
|
|
@@ -32,7 +32,7 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
|
32
32
|
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
33
33
|
*/
|
|
34
34
|
import { useState, Fragment, useEffect, useRef } from "react";
|
|
35
|
-
import { Button, Collapse, List, ListItem, ListItemButton, ListItemIcon, ListItemText, TextField,
|
|
35
|
+
import { Button, Collapse, List, ListItem, ListItemButton, ListItemIcon, ListItemText, TextField, Typography, styled, } from "@mui/material";
|
|
36
36
|
import { ExpandMore as ExpandMoreIcon } from "@mui/icons-material";
|
|
37
37
|
import { PartIdenticon, WorkorderFromBarcode } from "./Material.js";
|
|
38
38
|
import * as api from "../../network/api.js";
|
|
@@ -44,6 +44,7 @@ import { fmsInformation } from "../../network/server-settings.js";
|
|
|
44
44
|
import { useAddNewCastingToQueue } from "../../cell-status/material-details.js";
|
|
45
45
|
import { useAtomValue, useSetAtom } from "jotai";
|
|
46
46
|
import { canAddOrMoveMaterialToQueue } from "../../data/material-operation-policy.js";
|
|
47
|
+
import { SystemAlarmTooltip } from "./SystemAlarmTooltip.js";
|
|
47
48
|
function useAllowAddToQueue(queueNames) {
|
|
48
49
|
const existingMat = useAtomValue(matDetails.materialInDialogInfo);
|
|
49
50
|
const inProcMat = useAtomValue(matDetails.inProcessMaterialInDialog);
|
|
@@ -178,6 +179,7 @@ export function AddToQueueButton({ st: { enteredOperator, newMaterialTy, toQueue
|
|
|
178
179
|
const existingMat = useAtomValue(matDetails.materialInDialogInfo);
|
|
179
180
|
const inProcMat = useAtomValue(matDetails.inProcessMaterialInDialog);
|
|
180
181
|
const lastProcMat = useAtomValue(matDetails.materialInDialogLargestUsedProcess);
|
|
182
|
+
const blockingAlarms = matDetails.useMaterialBlockingAlarms();
|
|
181
183
|
const [addExistingMat, addingExistingMat] = matDetails.useAddExistingMaterialToQueue();
|
|
182
184
|
const [addNewMat, addingNewMat] = matDetails.useAddNewMaterialToQueue();
|
|
183
185
|
const [addNewCasting, addingNewCasting] = useAddNewCastingToQueue();
|
|
@@ -212,58 +214,61 @@ export function AddToQueueButton({ st: { enteredOperator, newMaterialTy, toQueue
|
|
|
212
214
|
withSerialMsg = " With Serial " + newSerial;
|
|
213
215
|
}
|
|
214
216
|
const curQueue = inProcMat?.location.currentQueue ?? null;
|
|
215
|
-
return (_jsxs(_Fragment, { children: [_jsx(
|
|
217
|
+
return (_jsxs(_Fragment, { children: [_jsx(SystemAlarmTooltip, { suspended: blockingAlarms.length > 0, title: toQueue === null
|
|
216
218
|
? "Select a queue to add the material to"
|
|
217
219
|
: fmsInfo.requireOperatorNamePromptWhenAddingMaterial &&
|
|
218
220
|
(enteredOperator === null || enteredOperator === "")
|
|
219
221
|
? "Please enter an operator name"
|
|
220
|
-
: "", children: _jsx(
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
newMaterialTy.jobUnique) {
|
|
240
|
-
await addNewMat({
|
|
241
|
-
jobUnique: newMaterialTy.jobUnique,
|
|
242
|
-
lastCompletedProcess: newMaterialTy.last_proc,
|
|
243
|
-
serial: newSerial ?? undefined,
|
|
244
|
-
workorder: newWorkorder ?? newMaterialTy?.workorder,
|
|
245
|
-
queue: toQueue ?? "",
|
|
246
|
-
queuePosition: -1,
|
|
247
|
-
operator: enteredOperator ?? operator,
|
|
248
|
-
});
|
|
249
|
-
}
|
|
250
|
-
else if (newMaterialTy &&
|
|
251
|
-
newMaterialTy.kind === "RawMat" &&
|
|
252
|
-
newMaterialTy.rawMatName) {
|
|
253
|
-
await addNewCasting({
|
|
254
|
-
casting: newMaterialTy.rawMatName,
|
|
255
|
-
quantity: 1,
|
|
256
|
-
queue: toQueue ?? "",
|
|
257
|
-
serials: newSerial ? [newSerial] : undefined,
|
|
258
|
-
workorder: newWorkorder,
|
|
259
|
-
operator: enteredOperator ?? operator,
|
|
260
|
-
});
|
|
261
|
-
}
|
|
262
|
-
setMatToShow(null);
|
|
263
|
-
onClose();
|
|
222
|
+
: "", children: _jsx(Button, { color: "primary", disabled: blockingAlarms.length > 0 ||
|
|
223
|
+
toQueue === null ||
|
|
224
|
+
addingExistingMat ||
|
|
225
|
+
addingNewMat ||
|
|
226
|
+
addingNewCasting ||
|
|
227
|
+
(existingMat === null && newMaterialTy === null) ||
|
|
228
|
+
(fmsInfo.requireOperatorNamePromptWhenAddingMaterial &&
|
|
229
|
+
(enteredOperator === null || enteredOperator === "")), onClick: async () => {
|
|
230
|
+
if (blockingAlarms.length > 0)
|
|
231
|
+
return;
|
|
232
|
+
setAddError(null);
|
|
233
|
+
try {
|
|
234
|
+
if (existingMat) {
|
|
235
|
+
await addExistingMat({
|
|
236
|
+
materialId: existingMat.materialID,
|
|
237
|
+
queue: toQueue ?? "",
|
|
238
|
+
queuePosition: -1,
|
|
239
|
+
operator: enteredOperator ?? operator,
|
|
240
|
+
});
|
|
264
241
|
}
|
|
265
|
-
|
|
266
|
-
|
|
242
|
+
else if (newMaterialTy &&
|
|
243
|
+
newMaterialTy.kind === "JobAndProc" &&
|
|
244
|
+
newMaterialTy.jobUnique) {
|
|
245
|
+
await addNewMat({
|
|
246
|
+
jobUnique: newMaterialTy.jobUnique,
|
|
247
|
+
lastCompletedProcess: newMaterialTy.last_proc,
|
|
248
|
+
serial: newSerial ?? undefined,
|
|
249
|
+
workorder: newWorkorder ?? newMaterialTy?.workorder,
|
|
250
|
+
queue: toQueue ?? "",
|
|
251
|
+
queuePosition: -1,
|
|
252
|
+
operator: enteredOperator ?? operator,
|
|
253
|
+
});
|
|
267
254
|
}
|
|
268
|
-
|
|
255
|
+
else if (newMaterialTy &&
|
|
256
|
+
newMaterialTy.kind === "RawMat" &&
|
|
257
|
+
newMaterialTy.rawMatName) {
|
|
258
|
+
await addNewCasting({
|
|
259
|
+
casting: newMaterialTy.rawMatName,
|
|
260
|
+
quantity: 1,
|
|
261
|
+
queue: toQueue ?? "",
|
|
262
|
+
serials: newSerial ? [newSerial] : undefined,
|
|
263
|
+
workorder: newWorkorder,
|
|
264
|
+
operator: enteredOperator ?? operator,
|
|
265
|
+
});
|
|
266
|
+
}
|
|
267
|
+
setMatToShow(null);
|
|
268
|
+
onClose();
|
|
269
|
+
}
|
|
270
|
+
catch (e) {
|
|
271
|
+
setAddError(apiErrorMessage(e));
|
|
272
|
+
}
|
|
273
|
+
}, children: toQueue === null ? ("Add to Queue") : (_jsxs("span", { children: [curQueue !== null ? `Move From ${curQueue} To` : "Add To", " ", toQueue, withSerialMsg, addProcMsg] })) }) }), addError ? _jsx("p", { role: "alert", children: addError }) : null] }));
|
|
269
274
|
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Tooltip } from "@mui/material";
|
|
3
|
+
export function SystemAlarmTooltip({ suspended, title = "", children, }) {
|
|
4
|
+
return (_jsx(Tooltip, { title: suspended ? "System alarm" : title, describeChild: true, children: _jsx("span", { style: { display: "inline-flex" }, tabIndex: suspended ? 0 : undefined, children: children }) }));
|
|
5
|
+
}
|
|
@@ -3335,6 +3335,13 @@
|
|
|
3335
3335
|
"type": "string"
|
|
3336
3336
|
}
|
|
3337
3337
|
},
|
|
3338
|
+
"AlarmDetails": {
|
|
3339
|
+
"type": "array",
|
|
3340
|
+
"nullable": true,
|
|
3341
|
+
"items": {
|
|
3342
|
+
"$ref": "#/components/schemas/CurrentStatusAlarm"
|
|
3343
|
+
}
|
|
3344
|
+
},
|
|
3338
3345
|
"Queues": {
|
|
3339
3346
|
"type": "object",
|
|
3340
3347
|
"additionalProperties": {
|
|
@@ -3772,6 +3779,47 @@
|
|
|
3772
3779
|
"LoadingToBasket"
|
|
3773
3780
|
]
|
|
3774
3781
|
},
|
|
3782
|
+
"CurrentStatusAlarm": {
|
|
3783
|
+
"type": "object",
|
|
3784
|
+
"additionalProperties": false,
|
|
3785
|
+
"required": ["Code", "Message", "Impact", "Code", "Message", "Impact"],
|
|
3786
|
+
"properties": {
|
|
3787
|
+
"Code": {
|
|
3788
|
+
"type": "string"
|
|
3789
|
+
},
|
|
3790
|
+
"Message": {
|
|
3791
|
+
"type": "string"
|
|
3792
|
+
},
|
|
3793
|
+
"Impact": {
|
|
3794
|
+
"$ref": "#/components/schemas/AlarmImpact"
|
|
3795
|
+
},
|
|
3796
|
+
"Activity": {
|
|
3797
|
+
"nullable": true,
|
|
3798
|
+
"oneOf": [
|
|
3799
|
+
{
|
|
3800
|
+
"$ref": "#/components/schemas/AlarmActivity"
|
|
3801
|
+
}
|
|
3802
|
+
]
|
|
3803
|
+
},
|
|
3804
|
+
"BasketId": {
|
|
3805
|
+
"type": "integer",
|
|
3806
|
+
"format": "int32",
|
|
3807
|
+
"nullable": true
|
|
3808
|
+
}
|
|
3809
|
+
}
|
|
3810
|
+
},
|
|
3811
|
+
"AlarmImpact": {
|
|
3812
|
+
"type": "string",
|
|
3813
|
+
"description": "",
|
|
3814
|
+
"x-enumNames": ["Informational", "SuspendChanges"],
|
|
3815
|
+
"enum": ["Informational", "SuspendChanges"]
|
|
3816
|
+
},
|
|
3817
|
+
"AlarmActivity": {
|
|
3818
|
+
"type": "string",
|
|
3819
|
+
"description": "",
|
|
3820
|
+
"x-enumNames": ["BasketMovement", "BasketLoadStation"],
|
|
3821
|
+
"enum": ["BasketMovement", "BasketLoadStation"]
|
|
3822
|
+
},
|
|
3775
3823
|
"QueueInfo": {
|
|
3776
3824
|
"type": "object",
|
|
3777
3825
|
"additionalProperties": false,
|
package/dist/index.html
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
<link rel="shortcut icon" href="/assets/favicon-gWFxiJK2.ico" />
|
|
7
7
|
<title>SeedTactic FMS Insight</title>
|
|
8
8
|
<style type="text/css">.download-loader{width:100px;height:100px;display:inline-block}.download-circular{width:100px;height:100px;animation:2s linear infinite rotate}.download-path{stroke-dasharray:1 200;stroke-dashoffset:0;stroke-linecap:round;stroke:#8d6e63;animation:1.5s ease-out infinite dash}@keyframes rotate{to{transform:rotate(360deg)}}@keyframes dash{0%{stroke-dasharray:1 200;stroke-dashoffset:0}50%{stroke-dasharray:89 200;stroke-dashoffset:-35px}to{stroke-dasharray:89 200;stroke-dashoffset:-124px}}</style>
|
|
9
|
-
<script type="module" crossorigin src="/assets/index-
|
|
9
|
+
<script type="module" crossorigin src="/assets/index-B0B_a7c8.js"></script>
|
|
10
10
|
<link rel="stylesheet" crossorigin href="/assets/index-DXfAwuj-.css">
|
|
11
11
|
</head>
|
|
12
12
|
<body>
|
package/dist/network/api.d.ts
CHANGED
|
@@ -705,6 +705,7 @@ export declare class CurrentStatus implements ICurrentStatus {
|
|
|
705
705
|
};
|
|
706
706
|
material: InProcessMaterial[];
|
|
707
707
|
alarms: string[];
|
|
708
|
+
alarmDetails?: CurrentStatusAlarm[] | undefined;
|
|
708
709
|
queues: {
|
|
709
710
|
[key: string]: QueueInfo;
|
|
710
711
|
};
|
|
@@ -730,6 +731,7 @@ export interface ICurrentStatus {
|
|
|
730
731
|
};
|
|
731
732
|
material: InProcessMaterial[];
|
|
732
733
|
alarms: string[];
|
|
734
|
+
alarmDetails?: CurrentStatusAlarm[] | undefined;
|
|
733
735
|
queues: {
|
|
734
736
|
[key: string]: QueueInfo;
|
|
735
737
|
};
|
|
@@ -945,6 +947,32 @@ export declare enum ActionType {
|
|
|
945
947
|
Machining = "Machining",
|
|
946
948
|
LoadingToBasket = "LoadingToBasket"
|
|
947
949
|
}
|
|
950
|
+
export declare class CurrentStatusAlarm implements ICurrentStatusAlarm {
|
|
951
|
+
code: string;
|
|
952
|
+
message: string;
|
|
953
|
+
impact: AlarmImpact;
|
|
954
|
+
activity?: AlarmActivity | undefined;
|
|
955
|
+
basketId?: number | undefined;
|
|
956
|
+
constructor(data?: ICurrentStatusAlarm);
|
|
957
|
+
init(_data?: any): void;
|
|
958
|
+
static fromJS(data: any): CurrentStatusAlarm;
|
|
959
|
+
toJSON(data?: any): any;
|
|
960
|
+
}
|
|
961
|
+
export interface ICurrentStatusAlarm {
|
|
962
|
+
code: string;
|
|
963
|
+
message: string;
|
|
964
|
+
impact: AlarmImpact;
|
|
965
|
+
activity?: AlarmActivity | undefined;
|
|
966
|
+
basketId?: number | undefined;
|
|
967
|
+
}
|
|
968
|
+
export declare enum AlarmImpact {
|
|
969
|
+
Informational = "Informational",
|
|
970
|
+
SuspendChanges = "SuspendChanges"
|
|
971
|
+
}
|
|
972
|
+
export declare enum AlarmActivity {
|
|
973
|
+
BasketMovement = "BasketMovement",
|
|
974
|
+
BasketLoadStation = "BasketLoadStation"
|
|
975
|
+
}
|
|
948
976
|
export declare class QueueInfo implements IQueueInfo {
|
|
949
977
|
maxSizeBeforeStopUnloading?: number | undefined;
|
|
950
978
|
role?: QueueRole | undefined;
|
package/dist/network/api.js
CHANGED
|
@@ -3632,6 +3632,11 @@ export class CurrentStatus {
|
|
|
3632
3632
|
for (let item of _data["Alarms"])
|
|
3633
3633
|
this.alarms.push(item);
|
|
3634
3634
|
}
|
|
3635
|
+
if (Array.isArray(_data["AlarmDetails"])) {
|
|
3636
|
+
this.alarmDetails = [];
|
|
3637
|
+
for (let item of _data["AlarmDetails"])
|
|
3638
|
+
this.alarmDetails.push(CurrentStatusAlarm.fromJS(item));
|
|
3639
|
+
}
|
|
3635
3640
|
if (_data["Queues"]) {
|
|
3636
3641
|
this.queues = {};
|
|
3637
3642
|
for (let key in _data["Queues"]) {
|
|
@@ -3703,6 +3708,11 @@ export class CurrentStatus {
|
|
|
3703
3708
|
for (let item of this.alarms)
|
|
3704
3709
|
data["Alarms"].push(item);
|
|
3705
3710
|
}
|
|
3711
|
+
if (Array.isArray(this.alarmDetails)) {
|
|
3712
|
+
data["AlarmDetails"] = [];
|
|
3713
|
+
for (let item of this.alarmDetails)
|
|
3714
|
+
data["AlarmDetails"].push(item ? item.toJSON() : undefined);
|
|
3715
|
+
}
|
|
3706
3716
|
if (this.queues) {
|
|
3707
3717
|
data["Queues"] = {};
|
|
3708
3718
|
for (let key in this.queues) {
|
|
@@ -4133,6 +4143,50 @@ export var ActionType;
|
|
|
4133
4143
|
ActionType["Machining"] = "Machining";
|
|
4134
4144
|
ActionType["LoadingToBasket"] = "LoadingToBasket";
|
|
4135
4145
|
})(ActionType || (ActionType = {}));
|
|
4146
|
+
export class CurrentStatusAlarm {
|
|
4147
|
+
constructor(data) {
|
|
4148
|
+
if (data) {
|
|
4149
|
+
for (var property in data) {
|
|
4150
|
+
if (data.hasOwnProperty(property))
|
|
4151
|
+
this[property] = data[property];
|
|
4152
|
+
}
|
|
4153
|
+
}
|
|
4154
|
+
}
|
|
4155
|
+
init(_data) {
|
|
4156
|
+
if (_data) {
|
|
4157
|
+
this.code = _data["Code"];
|
|
4158
|
+
this.message = _data["Message"];
|
|
4159
|
+
this.impact = _data["Impact"];
|
|
4160
|
+
this.activity = _data["Activity"];
|
|
4161
|
+
this.basketId = _data["BasketId"];
|
|
4162
|
+
}
|
|
4163
|
+
}
|
|
4164
|
+
static fromJS(data) {
|
|
4165
|
+
data = typeof data === "object" ? data : {};
|
|
4166
|
+
let result = new CurrentStatusAlarm();
|
|
4167
|
+
result.init(data);
|
|
4168
|
+
return result;
|
|
4169
|
+
}
|
|
4170
|
+
toJSON(data) {
|
|
4171
|
+
data = typeof data === "object" ? data : {};
|
|
4172
|
+
data["Code"] = this.code;
|
|
4173
|
+
data["Message"] = this.message;
|
|
4174
|
+
data["Impact"] = this.impact;
|
|
4175
|
+
data["Activity"] = this.activity;
|
|
4176
|
+
data["BasketId"] = this.basketId;
|
|
4177
|
+
return data;
|
|
4178
|
+
}
|
|
4179
|
+
}
|
|
4180
|
+
export var AlarmImpact;
|
|
4181
|
+
(function (AlarmImpact) {
|
|
4182
|
+
AlarmImpact["Informational"] = "Informational";
|
|
4183
|
+
AlarmImpact["SuspendChanges"] = "SuspendChanges";
|
|
4184
|
+
})(AlarmImpact || (AlarmImpact = {}));
|
|
4185
|
+
export var AlarmActivity;
|
|
4186
|
+
(function (AlarmActivity) {
|
|
4187
|
+
AlarmActivity["BasketMovement"] = "BasketMovement";
|
|
4188
|
+
AlarmActivity["BasketLoadStation"] = "BasketLoadStation";
|
|
4189
|
+
})(AlarmActivity || (AlarmActivity = {}));
|
|
4136
4190
|
export class QueueInfo {
|
|
4137
4191
|
constructor(data) {
|
|
4138
4192
|
if (data) {
|