@seedtactics/insight-client 16.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +37 -0
- package/dist/cell-status/buffers.d.ts +36 -0
- package/dist/cell-status/buffers.js +127 -0
- package/dist/cell-status/current-status.d.ts +30 -0
- package/dist/cell-status/current-status.js +200 -0
- package/dist/cell-status/estimated-cycle-times.d.ts +41 -0
- package/dist/cell-status/estimated-cycle-times.js +257 -0
- package/dist/cell-status/inspections.d.ts +55 -0
- package/dist/cell-status/inspections.js +213 -0
- package/dist/cell-status/loading.d.ts +26 -0
- package/dist/cell-status/loading.js +112 -0
- package/dist/cell-status/material-details.d.ts +116 -0
- package/dist/cell-status/material-details.js +422 -0
- package/dist/cell-status/material-summary.d.ts +52 -0
- package/dist/cell-status/material-summary.js +312 -0
- package/dist/cell-status/names.d.ts +19 -0
- package/dist/cell-status/names.js +134 -0
- package/dist/cell-status/pallet-cycles.d.ts +24 -0
- package/dist/cell-status/pallet-cycles.js +78 -0
- package/dist/cell-status/rebookings.d.ts +30 -0
- package/dist/cell-status/rebookings.js +139 -0
- package/dist/cell-status/scheduled-jobs.d.ts +18 -0
- package/dist/cell-status/scheduled-jobs.js +94 -0
- package/dist/cell-status/sim-day-usage.d.ts +14 -0
- package/dist/cell-status/sim-day-usage.js +54 -0
- package/dist/cell-status/sim-production.d.ts +22 -0
- package/dist/cell-status/sim-production.js +91 -0
- package/dist/cell-status/sim-station-use.d.ts +25 -0
- package/dist/cell-status/sim-station-use.js +71 -0
- package/dist/cell-status/station-cycles.d.ts +34 -0
- package/dist/cell-status/station-cycles.js +145 -0
- package/dist/cell-status/tool-replacements.d.ts +44 -0
- package/dist/cell-status/tool-replacements.js +155 -0
- package/dist/cell-status/tool-usage.d.ts +25 -0
- package/dist/cell-status/tool-usage.js +95 -0
- package/dist/components/App.d.ts +15 -0
- package/dist/components/App.js +549 -0
- package/dist/components/AxisAndGrid.d.ts +51 -0
- package/dist/components/AxisAndGrid.js +47 -0
- package/dist/components/BarcodeScanning.d.ts +6 -0
- package/dist/components/BarcodeScanning.js +150 -0
- package/dist/components/ChartTooltip.d.ts +28 -0
- package/dist/components/ChartTooltip.js +95 -0
- package/dist/components/ChooseMode.d.ts +18 -0
- package/dist/components/ChooseMode.js +136 -0
- package/dist/components/ChooseOperator.d.ts +1 -0
- package/dist/components/ChooseOperator.js +93 -0
- package/dist/components/ErrorsAndLoading.d.ts +9 -0
- package/dist/components/ErrorsAndLoading.js +55 -0
- package/dist/components/LoadingIcon.d.ts +1 -0
- package/dist/components/LoadingIcon.js +48 -0
- package/dist/components/LogEntry.d.ts +16 -0
- package/dist/components/LogEntry.js +365 -0
- package/dist/components/ManualSerialEntry.d.ts +5 -0
- package/dist/components/ManualSerialEntry.js +91 -0
- package/dist/components/MonthSelect.d.ts +6 -0
- package/dist/components/MonthSelect.js +67 -0
- package/dist/components/Navigation.d.ts +23 -0
- package/dist/components/Navigation.js +120 -0
- package/dist/components/VerboseLogging.d.ts +1 -0
- package/dist/components/VerboseLogging.js +47 -0
- package/dist/components/analysis/AnalysisSelectToolbar.d.ts +1 -0
- package/dist/components/analysis/AnalysisSelectToolbar.js +55 -0
- package/dist/components/analysis/BufferChart.d.ts +1 -0
- package/dist/components/analysis/BufferChart.js +139 -0
- package/dist/components/analysis/CostPerPiece.d.ts +2 -0
- package/dist/components/analysis/CostPerPiece.js +175 -0
- package/dist/components/analysis/CycleChart.d.ts +42 -0
- package/dist/components/analysis/CycleChart.js +281 -0
- package/dist/components/analysis/DataTable.d.ts +83 -0
- package/dist/components/analysis/DataTable.js +215 -0
- package/dist/components/analysis/EfficiencyPage.d.ts +2 -0
- package/dist/components/analysis/EfficiencyPage.js +138 -0
- package/dist/components/analysis/HeatChart.d.ts +22 -0
- package/dist/components/analysis/HeatChart.js +161 -0
- package/dist/components/analysis/InspectionDataTable.d.ts +10 -0
- package/dist/components/analysis/InspectionDataTable.js +148 -0
- package/dist/components/analysis/InspectionSankey.d.ts +12 -0
- package/dist/components/analysis/InspectionSankey.js +140 -0
- package/dist/components/analysis/PalletCycleCards.d.ts +1 -0
- package/dist/components/analysis/PalletCycleCards.js +137 -0
- package/dist/components/analysis/PartCycleCards.d.ts +2 -0
- package/dist/components/analysis/PartCycleCards.js +331 -0
- package/dist/components/analysis/QualityPage.d.ts +1 -0
- package/dist/components/analysis/QualityPage.js +49 -0
- package/dist/components/analysis/ScheduleHistory.d.ts +3 -0
- package/dist/components/analysis/ScheduleHistory.js +108 -0
- package/dist/components/analysis/StationDataTable.d.ts +25 -0
- package/dist/components/analysis/StationDataTable.js +246 -0
- package/dist/components/analysis/ToolReplacements.d.ts +1 -0
- package/dist/components/analysis/ToolReplacements.js +370 -0
- package/dist/components/operations/AllMaterial.d.ts +5 -0
- package/dist/components/operations/AllMaterial.js +267 -0
- package/dist/components/operations/ChartRangeEdit.d.ts +4 -0
- package/dist/components/operations/ChartRangeEdit.js +148 -0
- package/dist/components/operations/CloseoutReport.d.ts +2 -0
- package/dist/components/operations/CloseoutReport.js +172 -0
- package/dist/components/operations/CompletedParts.d.ts +2 -0
- package/dist/components/operations/CompletedParts.js +286 -0
- package/dist/components/operations/CurrentWorkorders.d.ts +3 -0
- package/dist/components/operations/CurrentWorkorders.js +368 -0
- package/dist/components/operations/Dashboard.d.ts +2 -0
- package/dist/components/operations/Dashboard.js +90 -0
- package/dist/components/operations/OEEChart.d.ts +10 -0
- package/dist/components/operations/OEEChart.js +173 -0
- package/dist/components/operations/Outliers.d.ts +4 -0
- package/dist/components/operations/Outliers.js +69 -0
- package/dist/components/operations/ProgramHighlight.d.ts +1 -0
- package/dist/components/operations/ProgramHighlight.js +9 -0
- package/dist/components/operations/Programs.d.ts +5 -0
- package/dist/components/operations/Programs.js +363 -0
- package/dist/components/operations/Rebookings.d.ts +1 -0
- package/dist/components/operations/Rebookings.js +213 -0
- package/dist/components/operations/RecentCycleChart.d.ts +4 -0
- package/dist/components/operations/RecentCycleChart.js +240 -0
- package/dist/components/operations/RecentProduction.d.ts +2 -0
- package/dist/components/operations/RecentProduction.js +213 -0
- package/dist/components/operations/RecentSchedules.d.ts +12 -0
- package/dist/components/operations/RecentSchedules.js +180 -0
- package/dist/components/operations/RecentStationCycles.d.ts +4 -0
- package/dist/components/operations/RecentStationCycles.js +159 -0
- package/dist/components/operations/ShiftSettings.d.ts +6 -0
- package/dist/components/operations/ShiftSettings.js +134 -0
- package/dist/components/operations/SimDayUsage.d.ts +1 -0
- package/dist/components/operations/SimDayUsage.js +133 -0
- package/dist/components/operations/ToolReport.d.ts +3 -0
- package/dist/components/operations/ToolReport.js +233 -0
- package/dist/components/operations/WorkorderGantt.d.ts +1 -0
- package/dist/components/operations/WorkorderGantt.js +124 -0
- package/dist/components/quality/QualityMaterial.d.ts +2 -0
- package/dist/components/quality/QualityMaterial.js +169 -0
- package/dist/components/quality/QualityPaths.d.ts +1 -0
- package/dist/components/quality/QualityPaths.js +53 -0
- package/dist/components/quality/RecentFailedInspections.d.ts +1 -0
- package/dist/components/quality/RecentFailedInspections.js +123 -0
- package/dist/components/routes.d.ts +170 -0
- package/dist/components/routes.js +301 -0
- package/dist/components/station-monitor/BulkRawMaterial.d.ts +11 -0
- package/dist/components/station-monitor/BulkRawMaterial.js +251 -0
- package/dist/components/station-monitor/Closeout.d.ts +5 -0
- package/dist/components/station-monitor/Closeout.js +162 -0
- package/dist/components/station-monitor/CustomStationMonitorDialog.d.ts +1 -0
- package/dist/components/station-monitor/CustomStationMonitorDialog.js +55 -0
- package/dist/components/station-monitor/Inspection.d.ts +8 -0
- package/dist/components/station-monitor/Inspection.js +164 -0
- package/dist/components/station-monitor/InvalidateCycle.d.ts +33 -0
- package/dist/components/station-monitor/InvalidateCycle.js +262 -0
- package/dist/components/station-monitor/JobDetails.d.ts +7 -0
- package/dist/components/station-monitor/JobDetails.js +108 -0
- package/dist/components/station-monitor/LoadStation.d.ts +10 -0
- package/dist/components/station-monitor/LoadStation.js +450 -0
- package/dist/components/station-monitor/Material.d.ts +77 -0
- package/dist/components/station-monitor/Material.js +489 -0
- package/dist/components/station-monitor/MoveMaterialArrows.d.ts +11 -0
- package/dist/components/station-monitor/MoveMaterialArrows.js +118 -0
- package/dist/components/station-monitor/PrintedLabel.d.ts +29 -0
- package/dist/components/station-monitor/PrintedLabel.js +166 -0
- package/dist/components/station-monitor/QuarantineButton.d.ts +4 -0
- package/dist/components/station-monitor/QuarantineButton.js +184 -0
- package/dist/components/station-monitor/Queues.d.ts +23 -0
- package/dist/components/station-monitor/Queues.js +312 -0
- package/dist/components/station-monitor/QueuesAddMaterial.d.ts +30 -0
- package/dist/components/station-monitor/QueuesAddMaterial.js +248 -0
- package/dist/components/station-monitor/SelectInspType.d.ts +2 -0
- package/dist/components/station-monitor/SelectInspType.js +99 -0
- package/dist/components/station-monitor/SelectWorkorder.d.ts +4 -0
- package/dist/components/station-monitor/SelectWorkorder.js +100 -0
- package/dist/components/station-monitor/StationToolbar.d.ts +3 -0
- package/dist/components/station-monitor/StationToolbar.js +168 -0
- package/dist/components/station-monitor/SystemOverview.d.ts +46 -0
- package/dist/components/station-monitor/SystemOverview.js +439 -0
- package/dist/components/station-monitor/Whiteboard.d.ts +10 -0
- package/dist/components/station-monitor/Whiteboard.js +67 -0
- package/dist/data/all-material-bins.d.ts +45 -0
- package/dist/data/all-material-bins.js +224 -0
- package/dist/data/chart-times.d.ts +20 -0
- package/dist/data/chart-times.js +99 -0
- package/dist/data/cost-per-piece.d.ts +32 -0
- package/dist/data/cost-per-piece.js +183 -0
- package/dist/data/current-cycles.d.ts +13 -0
- package/dist/data/current-cycles.js +144 -0
- package/dist/data/inspection-sankey.d.ts +15 -0
- package/dist/data/inspection-sankey.js +147 -0
- package/dist/data/move-arrows.d.ts +48 -0
- package/dist/data/move-arrows.js +217 -0
- package/dist/data/operators.d.ts +2 -0
- package/dist/data/operators.js +44 -0
- package/dist/data/part-summary.d.ts +17 -0
- package/dist/data/part-summary.js +107 -0
- package/dist/data/path-lookup.d.ts +13 -0
- package/dist/data/path-lookup.js +107 -0
- package/dist/data/queue-material.d.ts +46 -0
- package/dist/data/queue-material.js +256 -0
- package/dist/data/results.bufferchart.d.ts +10 -0
- package/dist/data/results.bufferchart.js +90 -0
- package/dist/data/results.completed-parts.d.ts +26 -0
- package/dist/data/results.completed-parts.js +181 -0
- package/dist/data/results.cycles.d.ts +86 -0
- package/dist/data/results.cycles.js +454 -0
- package/dist/data/results.inspection.d.ts +36 -0
- package/dist/data/results.inspection.js +188 -0
- package/dist/data/results.oee.d.ts +40 -0
- package/dist/data/results.oee.js +330 -0
- package/dist/data/results.schedules.d.ts +23 -0
- package/dist/data/results.schedules.js +157 -0
- package/dist/data/tools-programs.d.ts +78 -0
- package/dist/data/tools-programs.js +376 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +60 -0
- package/dist/network/api.d.ts +1390 -0
- package/dist/network/api.js +4971 -0
- package/dist/network/backend-mock.d.ts +11 -0
- package/dist/network/backend-mock.js +512 -0
- package/dist/network/backend.d.ts +57 -0
- package/dist/network/backend.js +77 -0
- package/dist/network/load-specific-month.d.ts +13 -0
- package/dist/network/load-specific-month.js +77 -0
- package/dist/network/server-settings.d.ts +12 -0
- package/dist/network/server-settings.js +92 -0
- package/dist/network/websocket.d.ts +4 -0
- package/dist/network/websocket.js +165 -0
- package/dist/renderer.d.ts +8 -0
- package/dist/renderer.js +55 -0
- package/dist/seedtactics-logo.d.ts +2 -0
- package/dist/seedtactics-logo.js +4 -0
- package/dist/util/chart-colors.d.ts +1 -0
- package/dist/util/chart-colors.js +116 -0
- package/dist/util/chart-helpers.d.ts +3 -0
- package/dist/util/chart-helpers.js +51 -0
- package/dist/util/parseISODuration.d.ts +4 -0
- package/dist/util/parseISODuration.js +40 -0
- package/docs/client-efficiency.md +355 -0
- package/docs/client-engineering.md +54 -0
- package/docs/client-launch.md +55 -0
- package/docs/client-operations.md +88 -0
- package/docs/client-quality.md +74 -0
- package/docs/client-sales.md +61 -0
- package/docs/client-scanners.md +41 -0
- package/docs/client-station-monitor.md +149 -0
- package/docs/client-tools-programs.md +74 -0
- package/docs/improve-fms.md +141 -0
- package/docs/makino.md +40 -0
- package/docs/material-quarantine.md +82 -0
- package/docs/material-tracking.md +236 -0
- package/docs/mazak.md +115 -0
- package/docs/niigata.md +228 -0
- package/docs/operator-procedures.md +106 -0
- package/docs/part-instructions.md +63 -0
- package/docs/screenshots/insight-all-material.png +0 -0
- package/docs/screenshots/insight-analysis-pallets.png +0 -0
- package/docs/screenshots/insight-analysis-part-completed.png +0 -0
- package/docs/screenshots/insight-analysis-sankey.png +0 -0
- package/docs/screenshots/insight-analysis-station-oee.png +0 -0
- package/docs/screenshots/insight-buffer-occupancy.png +0 -0
- package/docs/screenshots/insight-choose-analysis-month.png +0 -0
- package/docs/screenshots/insight-closeout.png +0 -0
- package/docs/screenshots/insight-cost-percentages.png +0 -0
- package/docs/screenshots/insight-dashboard.png +0 -0
- package/docs/screenshots/insight-event-custom-view.jpg +0 -0
- package/docs/screenshots/insight-event-viewer.jpg +0 -0
- package/docs/screenshots/insight-inspection.png +0 -0
- package/docs/screenshots/insight-load-station-details.png +0 -0
- package/docs/screenshots/insight-load-station.png +0 -0
- package/docs/screenshots/insight-loadcycle-graph.png +0 -0
- package/docs/screenshots/insight-loadstation-small.jpg +0 -0
- package/docs/screenshots/insight-machinecycle-graph.png +0 -0
- package/docs/screenshots/insight-machinecycle-table.png +0 -0
- package/docs/screenshots/insight-machinecycles.png +0 -0
- package/docs/screenshots/insight-machinehours.png +0 -0
- package/docs/screenshots/insight-machineoutliers.png +0 -0
- package/docs/screenshots/insight-monthly-schedules.png +0 -0
- package/docs/screenshots/insight-operations-material.png +0 -0
- package/docs/screenshots/insight-operations-overview.png +0 -0
- package/docs/screenshots/insight-operations-reports.png +0 -0
- package/docs/screenshots/insight-part-cost.png +0 -0
- package/docs/screenshots/insight-program-report.png +0 -0
- package/docs/screenshots/insight-quality-material-details.png +0 -0
- package/docs/screenshots/insight-quality-material.png +0 -0
- package/docs/screenshots/insight-quality-quarantine.png +0 -0
- package/docs/screenshots/insight-quality-sankey.png +0 -0
- package/docs/screenshots/insight-quality-similar-paths.png +0 -0
- package/docs/screenshots/insight-queue-details.png +0 -0
- package/docs/screenshots/insight-queues-jobs-table.png +0 -0
- package/docs/screenshots/insight-queues.png +0 -0
- package/docs/screenshots/insight-sim-day-usage.png +0 -0
- package/docs/screenshots/insight-station-system-overview-buttons.png +0 -0
- package/docs/screenshots/insight-station-system-overview.png +0 -0
- package/docs/screenshots/insight-system-overview.png +0 -0
- package/docs/screenshots/insight-tool-replacements.png +0 -0
- package/docs/screenshots/insight-tool-report.png +0 -0
- package/docs/screenshots/insight-toolbar-btns.png +0 -0
- package/docs/screenshots/insight-workorder-gantt.png +0 -0
- package/docs/screenshots/insight-workorders.png +0 -0
- package/docs/security.md +131 -0
- package/docs/server-config.md +56 -0
- package/docs/server-errors.md +44 -0
- package/package.json +90 -0
- package/src/index.ts +65 -0
|
@@ -0,0 +1,365 @@
|
|
|
1
|
+
import { jsxs as _jsxs, jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
/* Copyright (c) 2020, John Lenz
|
|
3
|
+
|
|
4
|
+
All rights reserved.
|
|
5
|
+
|
|
6
|
+
Redistribution and use in source and binary forms, with or without
|
|
7
|
+
modification, are permitted provided that the following conditions are met:
|
|
8
|
+
|
|
9
|
+
* Redistributions of source code must retain the above copyright
|
|
10
|
+
notice, this list of conditions and the following disclaimer.
|
|
11
|
+
|
|
12
|
+
* Redistributions in binary form must reproduce the above
|
|
13
|
+
copyright notice, this list of conditions and the following
|
|
14
|
+
disclaimer in the documentation and/or other materials provided
|
|
15
|
+
with the distribution.
|
|
16
|
+
|
|
17
|
+
* Neither the name of John Lenz, Black Maple Software, SeedTactics,
|
|
18
|
+
nor the names of other contributors may be used to endorse or
|
|
19
|
+
promote products derived from this software without specific
|
|
20
|
+
prior written permission.
|
|
21
|
+
|
|
22
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
23
|
+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
24
|
+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
25
|
+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
26
|
+
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
27
|
+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
28
|
+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
29
|
+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
30
|
+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
31
|
+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
32
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
33
|
+
*/
|
|
34
|
+
import { memo, useState } from "react";
|
|
35
|
+
import * as api from "../network/api.js";
|
|
36
|
+
import { styled, Table } from "@mui/material";
|
|
37
|
+
import { TableBody } from "@mui/material";
|
|
38
|
+
import { TableCell } from "@mui/material";
|
|
39
|
+
import { TableHead } from "@mui/material";
|
|
40
|
+
import { TableRow } from "@mui/material";
|
|
41
|
+
import { Tooltip } from "@mui/material";
|
|
42
|
+
import { IconButton } from "@mui/material";
|
|
43
|
+
import { ChevronRight as ChevronRightIcon, ImportExport } from "@mui/icons-material";
|
|
44
|
+
import { copyLogEntriesToClipboard } from "../data/results.cycles.js";
|
|
45
|
+
import { durationToMinutes, durationToSeconds } from "../util/parseISODuration.js";
|
|
46
|
+
import { LazySeq } from "@seedtactics/immutable-collections";
|
|
47
|
+
const ColoredSpan = styled("span", { shouldForwardProp: (prop) => prop.toString()[0] !== "$" })(({ $type }) => {
|
|
48
|
+
switch ($type) {
|
|
49
|
+
case "machine":
|
|
50
|
+
return { color: "#1565C0" };
|
|
51
|
+
case "loadStation":
|
|
52
|
+
return { color: "#795548" };
|
|
53
|
+
case "pallet":
|
|
54
|
+
return { color: "#00695C" };
|
|
55
|
+
case "queue":
|
|
56
|
+
return { color: "#6A1B9A" };
|
|
57
|
+
case "inspectionNotSignaled":
|
|
58
|
+
return { color: "#4527A0" };
|
|
59
|
+
case "inspectionSignaled":
|
|
60
|
+
return { color: "red" };
|
|
61
|
+
case "closeoutFailed":
|
|
62
|
+
return { color: "red" };
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
function logType(entry) {
|
|
66
|
+
switch (entry.type) {
|
|
67
|
+
case api.LogType.LoadUnloadCycle:
|
|
68
|
+
if (entry.startofcycle) {
|
|
69
|
+
return "Start " + entry.result.charAt(0).toUpperCase() + entry.result.substring(1).toLowerCase();
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
return "End " + entry.result.charAt(0).toUpperCase() + entry.result.substring(1).toLowerCase();
|
|
73
|
+
}
|
|
74
|
+
case api.LogType.MachineCycle:
|
|
75
|
+
if (entry.startofcycle) {
|
|
76
|
+
return "Start Cycle";
|
|
77
|
+
}
|
|
78
|
+
else {
|
|
79
|
+
return "End Cycle";
|
|
80
|
+
}
|
|
81
|
+
case api.LogType.PartMark:
|
|
82
|
+
return "Serial";
|
|
83
|
+
case api.LogType.OrderAssignment:
|
|
84
|
+
return "Workorder";
|
|
85
|
+
case api.LogType.Inspection:
|
|
86
|
+
case api.LogType.InspectionForce:
|
|
87
|
+
return "Signal";
|
|
88
|
+
case api.LogType.PalletCycle:
|
|
89
|
+
return "Pallet Cycle";
|
|
90
|
+
case api.LogType.WorkorderComment:
|
|
91
|
+
return "Workorder";
|
|
92
|
+
case api.LogType.CloseOut:
|
|
93
|
+
return "CloseOut";
|
|
94
|
+
case api.LogType.InspectionResult:
|
|
95
|
+
return "Inspection";
|
|
96
|
+
case api.LogType.AddToQueue:
|
|
97
|
+
return "Queue";
|
|
98
|
+
case api.LogType.RemoveFromQueue:
|
|
99
|
+
return "Queue";
|
|
100
|
+
case api.LogType.PalletInStocker:
|
|
101
|
+
return "Stocker";
|
|
102
|
+
case api.LogType.PalletOnRotaryInbound:
|
|
103
|
+
return "Rotary";
|
|
104
|
+
case api.LogType.SignalQuarantine:
|
|
105
|
+
return "Quarantine";
|
|
106
|
+
case api.LogType.SwapMaterialOnPallet:
|
|
107
|
+
return "Swap Serial";
|
|
108
|
+
case api.LogType.InvalidateCycle:
|
|
109
|
+
return "Invalidate Cycle";
|
|
110
|
+
case api.LogType.Rebooking:
|
|
111
|
+
return "Rebooking";
|
|
112
|
+
case api.LogType.CancelRebooking:
|
|
113
|
+
return "Cancel Rebooking";
|
|
114
|
+
default:
|
|
115
|
+
return "Message";
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
export function isLogEntryInvalidated(e) {
|
|
119
|
+
return e.details?.["PalletCycleInvalidated"] === "1";
|
|
120
|
+
}
|
|
121
|
+
function displayMat(mats) {
|
|
122
|
+
if (mats.length > 1) {
|
|
123
|
+
if (mats[0].numproc == 1) {
|
|
124
|
+
return `${mats[0].part} x${mats.length}`;
|
|
125
|
+
}
|
|
126
|
+
else {
|
|
127
|
+
return `${mats[0].part}-${LazySeq.of(mats)
|
|
128
|
+
.map((m) => m.proc)
|
|
129
|
+
.distinctAndSortBy((p) => p)
|
|
130
|
+
.toRArray()
|
|
131
|
+
.join("&")} x${mats.length}`;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
else if (mats.length == 1) {
|
|
135
|
+
if (mats[0].numproc == 1) {
|
|
136
|
+
return `${mats[0].part}`;
|
|
137
|
+
}
|
|
138
|
+
else {
|
|
139
|
+
return `${mats[0].part}-${mats[0].proc}`;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
else {
|
|
143
|
+
return "";
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
function displayQueueMat(mats) {
|
|
147
|
+
if (mats.length > 1) {
|
|
148
|
+
return `${mats[0].part} x${mats.length}`;
|
|
149
|
+
}
|
|
150
|
+
else if (mats.length === 1) {
|
|
151
|
+
return mats[0].part;
|
|
152
|
+
}
|
|
153
|
+
else {
|
|
154
|
+
return "";
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
function display(props) {
|
|
158
|
+
const entry = props.entry;
|
|
159
|
+
switch (entry.type) {
|
|
160
|
+
case api.LogType.LoadUnloadCycle:
|
|
161
|
+
return (_jsxs("span", { children: [displayMat(entry.material), " on ", _jsxs(ColoredSpan, { "$type": "pallet", children: ["pallet ", entry.pal] }), " at", " ", _jsxs(ColoredSpan, { "$type": "loadStation", children: ["station ", entry.locnum.toString()] })] }));
|
|
162
|
+
case api.LogType.MachineCycle:
|
|
163
|
+
return (_jsxs("span", { children: [displayMat(entry.material), " on ", _jsxs(ColoredSpan, { "$type": "pallet", children: ["pallet ", entry.pal] }), " at", " ", _jsxs(ColoredSpan, { "$type": "machine", children: [entry.loc, " ", entry.locnum.toString()] }), entry.program && entry.program !== "" ? _jsxs("span", { children: [" with program ", entry.program] }) : undefined] }));
|
|
164
|
+
case api.LogType.PartMark:
|
|
165
|
+
return (_jsxs("span", { children: [displayMat(entry.material), " marked with ", entry.result] }));
|
|
166
|
+
case api.LogType.OrderAssignment:
|
|
167
|
+
return (_jsxs("span", { children: [displayMat(entry.material), " assigned to workorder ", entry.result] }));
|
|
168
|
+
case api.LogType.PalletCycle:
|
|
169
|
+
if (entry.startofcycle) {
|
|
170
|
+
return _jsxs("span", { children: ["Pallet ", entry.pal, " started route"] });
|
|
171
|
+
}
|
|
172
|
+
else {
|
|
173
|
+
return _jsxs("span", { children: ["Pallet ", entry.pal, " completed route"] });
|
|
174
|
+
}
|
|
175
|
+
case api.LogType.Inspection: {
|
|
176
|
+
const inspName = (entry.details || {}).InspectionType || "";
|
|
177
|
+
const inspected = entry.result.toLowerCase() === "true" || entry.result === "1";
|
|
178
|
+
if (inspected) {
|
|
179
|
+
return (_jsxs("span", { children: [displayMat(entry.material), " signaled for inspection", " ", _jsx(ColoredSpan, { "$type": "inspectionSignaled", children: inspName })] }));
|
|
180
|
+
}
|
|
181
|
+
else {
|
|
182
|
+
return (_jsxs("span", { children: [displayMat(entry.material), " skipped inspection", " ", _jsx(ColoredSpan, { "$type": "inspectionNotSignaled", children: inspName })] }));
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
case api.LogType.InspectionForce: {
|
|
186
|
+
const forceInspName = entry.program;
|
|
187
|
+
const forced = entry.result.toLowerCase() === "true" || entry.result === "1";
|
|
188
|
+
if (forced) {
|
|
189
|
+
return (_jsxs("span", { children: [displayMat(entry.material), " declared for inspection", " ", _jsx(ColoredSpan, { "$type": "inspectionSignaled", children: forceInspName })] }));
|
|
190
|
+
}
|
|
191
|
+
else {
|
|
192
|
+
return (_jsxs("span", { children: [displayMat(entry.material), " passed over for inspection", " ", _jsx(ColoredSpan, { "$type": "inspectionNotSignaled", children: forceInspName })] }));
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
case api.LogType.WorkorderComment:
|
|
196
|
+
return _jsxs("span", { children: ["Workorder ", entry.result, " Comment"] });
|
|
197
|
+
case api.LogType.InspectionResult:
|
|
198
|
+
if (entry.result.toLowerCase() === "false") {
|
|
199
|
+
return _jsxs(ColoredSpan, { "$type": "inspectionSignaled", children: [entry.program, " Failed"] });
|
|
200
|
+
}
|
|
201
|
+
else {
|
|
202
|
+
return _jsxs(ColoredSpan, { "$type": "inspectionSignaled", children: [entry.program, " Succeeded"] });
|
|
203
|
+
}
|
|
204
|
+
case api.LogType.CloseOut:
|
|
205
|
+
if (entry.result.toLowerCase() === "failed") {
|
|
206
|
+
return (_jsxs(ColoredSpan, { "$type": "closeoutFailed", children: [entry.program && entry.program !== "" ? entry.program : "CloseOut", " Failed"] }));
|
|
207
|
+
}
|
|
208
|
+
else {
|
|
209
|
+
return _jsxs("span", { children: [entry.program && entry.program !== "" ? entry.program : "CloseOut", " Completed"] });
|
|
210
|
+
}
|
|
211
|
+
case api.LogType.AddToQueue:
|
|
212
|
+
switch (entry.program) {
|
|
213
|
+
case "Unloaded":
|
|
214
|
+
return (_jsxs("span", { children: [displayQueueMat(entry.material), " unloaded into queue", " ", _jsx(ColoredSpan, { "$type": "queue", children: entry.loc })] }));
|
|
215
|
+
case "SetByOperator":
|
|
216
|
+
return (_jsxs("span", { children: [displayQueueMat(entry.material), " set manually into queue", " ", _jsx(ColoredSpan, { "$type": "queue", children: entry.loc })] }));
|
|
217
|
+
case "Quarantine":
|
|
218
|
+
return (_jsxs("span", { children: [displayQueueMat(entry.material), " quarantined into queue", " ", _jsx(ColoredSpan, { "$type": "queue", children: entry.loc })] }));
|
|
219
|
+
case "SwapMaterial":
|
|
220
|
+
return (_jsxs("span", { children: [displayQueueMat(entry.material), " swapped off pallet into queue", " ", _jsx(ColoredSpan, { "$type": "queue", children: entry.loc })] }));
|
|
221
|
+
case "MaterialMissingOnPallet":
|
|
222
|
+
return (_jsxs("span", { children: [displayQueueMat(entry.material), " removed from cell controller, added to queue", " ", _jsx(ColoredSpan, { "$type": "queue", children: entry.loc })] }));
|
|
223
|
+
default:
|
|
224
|
+
return (_jsxs("span", { children: [displayQueueMat(entry.material), " added to queue", " ", _jsx(ColoredSpan, { "$type": "queue", children: entry.loc }), entry.program && entry.program !== "" ? " (" + entry.program + ")" : undefined] }));
|
|
225
|
+
}
|
|
226
|
+
case api.LogType.RemoveFromQueue:
|
|
227
|
+
return (_jsxs("span", { children: [displayQueueMat(entry.material), " removed from queue", " ", _jsx(ColoredSpan, { "$type": "queue", children: entry.loc })] }));
|
|
228
|
+
case api.LogType.PalletInStocker:
|
|
229
|
+
if (entry.startofcycle) {
|
|
230
|
+
return (_jsxs("span", { children: [_jsxs(ColoredSpan, { "$type": "pallet", children: ["Pallet ", entry.pal] }), " arrived at stocker ", entry.locnum] }));
|
|
231
|
+
}
|
|
232
|
+
else {
|
|
233
|
+
return (_jsxs("span", { children: [_jsxs(ColoredSpan, { "$type": "pallet", children: ["Pallet ", entry.pal] }), " departed stocker ", entry.locnum] }));
|
|
234
|
+
}
|
|
235
|
+
case api.LogType.PalletOnRotaryInbound:
|
|
236
|
+
if (entry.startofcycle) {
|
|
237
|
+
return (_jsxs("span", { children: [_jsxs(ColoredSpan, { "$type": "pallet", children: ["Pallet ", entry.pal] }), " arrived at", " ", _jsxs(ColoredSpan, { "$type": "machine", children: [entry.loc, " ", entry.locnum.toString()] })] }));
|
|
238
|
+
}
|
|
239
|
+
else if (entry.result == "RotateIntoWorktable") {
|
|
240
|
+
return (_jsxs("span", { children: [_jsxs(ColoredSpan, { "$type": "pallet", children: ["Pallet ", entry.pal] }), " rotated into", " ", _jsxs(ColoredSpan, { "$type": "machine", children: [entry.loc, " ", entry.locnum.toString()] }), " ", "worktable"] }));
|
|
241
|
+
}
|
|
242
|
+
else {
|
|
243
|
+
return (_jsxs("span", { children: [_jsxs(ColoredSpan, { "$type": "pallet", children: ["Pallet ", entry.pal] }), " left", " ", _jsxs(ColoredSpan, { "$type": "machine", children: [entry.loc, " ", entry.locnum.toString()] })] }));
|
|
244
|
+
}
|
|
245
|
+
case api.LogType.SignalQuarantine:
|
|
246
|
+
return _jsxs("span", { children: [displayMat(entry.material), " signaled for quarantine after unload"] });
|
|
247
|
+
case api.LogType.SwapMaterialOnPallet:
|
|
248
|
+
return _jsx("span", { children: entry.result });
|
|
249
|
+
case api.LogType.InvalidateCycle:
|
|
250
|
+
return _jsx("span", { children: entry.result });
|
|
251
|
+
case api.LogType.Rebooking:
|
|
252
|
+
return _jsxs("span", { children: ["Rebooking requested with ID ", entry.result] });
|
|
253
|
+
case api.LogType.CancelRebooking:
|
|
254
|
+
return _jsxs("span", { children: ["Rebooking ", entry.result, " canceled"] });
|
|
255
|
+
default:
|
|
256
|
+
return _jsx("span", { children: entry.result });
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
function detailsForEntry(e) {
|
|
260
|
+
const details = [];
|
|
261
|
+
if (e.details && e.details.operator) {
|
|
262
|
+
details.push({
|
|
263
|
+
name: "Operator",
|
|
264
|
+
value: e.details.operator,
|
|
265
|
+
});
|
|
266
|
+
}
|
|
267
|
+
if (e.details && e.details.note) {
|
|
268
|
+
details.push({
|
|
269
|
+
name: "Note",
|
|
270
|
+
value: e.details.note,
|
|
271
|
+
});
|
|
272
|
+
}
|
|
273
|
+
if (e.tooluse) {
|
|
274
|
+
for (const use of e.tooluse) {
|
|
275
|
+
let msg = null;
|
|
276
|
+
if (use.toolUseDuringCycle && use.toolUseDuringCycle !== "") {
|
|
277
|
+
msg = durationToMinutes(use.toolUseDuringCycle).toFixed(1) + " minutes used during cycle.";
|
|
278
|
+
if (use.totalToolUseAtEndOfCycle &&
|
|
279
|
+
use.configuredToolLife &&
|
|
280
|
+
use.totalToolUseAtEndOfCycle !== "" &&
|
|
281
|
+
use.configuredToolLife !== "") {
|
|
282
|
+
const total = durationToSeconds(use.totalToolUseAtEndOfCycle);
|
|
283
|
+
const life = durationToSeconds(use.configuredToolLife);
|
|
284
|
+
const pct = total / life;
|
|
285
|
+
msg += ` Total use at end of cycle: ${(total / 60).toFixed(1)}/${(life / 60).toFixed(1)} minutes (${(pct * 100).toFixed(0)}%).`;
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
if (use.toolUseCountDuringCycle && use.toolUseCountDuringCycle > 0) {
|
|
289
|
+
msg =
|
|
290
|
+
(msg === null ? "" : " | ") +
|
|
291
|
+
`${use.toolUseCountDuringCycle} use${use.toolUseCountDuringCycle > 1 ? "s" : ""} during cycle.`;
|
|
292
|
+
if (use.totalToolUseCountAtEndOfCycle && use.configuredToolLifeCount) {
|
|
293
|
+
msg += ` Total use count at end of cycle: ${use.totalToolUseCountAtEndOfCycle}/${use.configuredToolLifeCount} (${((use.totalToolUseCountAtEndOfCycle / use.configuredToolLifeCount) * 100).toFixed(0)}%).`;
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
if (msg !== null) {
|
|
297
|
+
let name = use.pocket > 0 ? `${use.tool} [${use.pocket}]` : use.tool;
|
|
298
|
+
const serial = use.toolSerialAtEndOfCycle ?? use.toolSerialAtStartOfCycle;
|
|
299
|
+
if (serial && serial !== "") {
|
|
300
|
+
name += ` (${serial})`;
|
|
301
|
+
}
|
|
302
|
+
details.push({
|
|
303
|
+
name,
|
|
304
|
+
value: msg,
|
|
305
|
+
});
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
return details;
|
|
310
|
+
}
|
|
311
|
+
const logTypesToHighlight = [
|
|
312
|
+
api.LogType.AddToQueue,
|
|
313
|
+
api.LogType.RemoveFromQueue,
|
|
314
|
+
api.LogType.LoadUnloadCycle,
|
|
315
|
+
api.LogType.MachineCycle,
|
|
316
|
+
];
|
|
317
|
+
const LogEntryTableRow = styled(TableRow, { shouldForwardProp: (prop) => prop.toString()[0] !== "$" })(({ $highlightProc, $invalidCycle }) => ({
|
|
318
|
+
...($highlightProc && { backgroundColor: "#eeeeee" }),
|
|
319
|
+
...($invalidCycle && { textDecoration: "line-through" }),
|
|
320
|
+
}));
|
|
321
|
+
export const LogEntry = memo(function LogEntry(props) {
|
|
322
|
+
const details = detailsForEntry(props.entry);
|
|
323
|
+
const highlight = props.highlightProcsGreaterOrEqualTo;
|
|
324
|
+
return (_jsxs(_Fragment, { children: [_jsxs(LogEntryTableRow, { "$highlightProc": highlight !== undefined &&
|
|
325
|
+
props.entry.material.findIndex((m) => m.proc >= highlight) >= 0 &&
|
|
326
|
+
logTypesToHighlight.indexOf(props.entry.type) >= 0, "$invalidCycle": isLogEntryInvalidated(props.entry), children: [_jsx(TableCell, { size: "small", children: props.entry.endUTC.toLocaleDateString(undefined, {
|
|
327
|
+
month: "short",
|
|
328
|
+
day: "numeric",
|
|
329
|
+
year: "2-digit",
|
|
330
|
+
}) }), _jsx(TableCell, { size: "small", children: props.entry.endUTC.toLocaleTimeString(undefined, {
|
|
331
|
+
hour: "numeric",
|
|
332
|
+
minute: "2-digit",
|
|
333
|
+
}) }), _jsx(TableCell, { size: "small", children: logType(props.entry) }), _jsx(TableCell, { size: "small", children: display(props) }), _jsx(TableCell, { padding: "checkbox", children: details.length > 0 ? (_jsx(IconButton, { style: {
|
|
334
|
+
transition: "all ease 200ms",
|
|
335
|
+
transform: props.entry.counter === props.detailLogCounter ? "rotate(90deg)" : "none",
|
|
336
|
+
}, onClick: (event) => {
|
|
337
|
+
props.setDetail(props.entry.counter === props.detailLogCounter ? null : props.entry.counter);
|
|
338
|
+
event.stopPropagation();
|
|
339
|
+
}, size: "small", children: _jsx(ChevronRightIcon, { fontSize: "inherit" }) })) : undefined })] }), details.length > 0 && props.entry.counter === props.detailLogCounter ? (_jsx(TableRow, { children: _jsx(TableCell, { colSpan: 5, children: _jsx("ul", { children: details.map((d, idx) => (_jsxs("li", { children: [d.name, ": ", d.value] }, idx))) }) }) })) : undefined] }));
|
|
340
|
+
});
|
|
341
|
+
export function* filterRemoveAddQueue(entries) {
|
|
342
|
+
let prev = null;
|
|
343
|
+
for (const e of entries) {
|
|
344
|
+
if (prev != null &&
|
|
345
|
+
prev.type === api.LogType.RemoveFromQueue &&
|
|
346
|
+
e.type === api.LogType.AddToQueue &&
|
|
347
|
+
prev.loc === e.loc) {
|
|
348
|
+
// skip both prev and e
|
|
349
|
+
prev = null;
|
|
350
|
+
}
|
|
351
|
+
else {
|
|
352
|
+
if (prev !== null) {
|
|
353
|
+
yield prev;
|
|
354
|
+
}
|
|
355
|
+
prev = e;
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
if (prev !== null) {
|
|
359
|
+
yield prev;
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
export const LogEntries = memo(function LogEntriesF(props) {
|
|
363
|
+
const [curDetail, setDetail] = useState(null);
|
|
364
|
+
return (_jsxs(Table, { children: [_jsx(TableHead, { children: _jsxs(TableRow, { children: [_jsx(TableCell, { children: "Date" }), _jsx(TableCell, { children: "Time" }), _jsx(TableCell, { children: "Type" }), _jsx(TableCell, { children: "Details" }), _jsx(TableCell, { padding: "checkbox", children: props.copyToClipboard ? (_jsx(Tooltip, { title: "Copy to Clipboard", children: _jsx(IconButton, { onClick: () => copyLogEntriesToClipboard(props.entries), style: { height: "25px", paddingTop: 0, paddingBottom: 0 }, size: "large", children: _jsx(ImportExport, {}) }) })) : undefined })] }) }), _jsx(TableBody, { children: Array.from(filterRemoveAddQueue(props.entries)).map((e, idx) => (_jsx(LogEntry, { entry: e, detailLogCounter: curDetail, setDetail: setDetail, highlightProcsGreaterOrEqualTo: props.highlightProcsGreaterOrEqualTo }, idx))) })] }));
|
|
365
|
+
});
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const ManualSerialEntryButton: import("react").NamedExoticComponent<object>;
|
|
2
|
+
export declare const enterSerialForNewMaterialDialog: import("jotai").PrimitiveAtom<string | null> & {
|
|
3
|
+
init: string | null;
|
|
4
|
+
};
|
|
5
|
+
export declare const AddBySerialDialog: import("react").NamedExoticComponent<object>;
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
/* Copyright (c) 2022, John Lenz
|
|
3
|
+
|
|
4
|
+
All rights reserved.
|
|
5
|
+
|
|
6
|
+
Redistribution and use in source and binary forms, with or without
|
|
7
|
+
modification, are permitted provided that the following conditions are met:
|
|
8
|
+
|
|
9
|
+
* Redistributions of source code must retain the above copyright
|
|
10
|
+
notice, this list of conditions and the following disclaimer.
|
|
11
|
+
|
|
12
|
+
* Redistributions in binary form must reproduce the above
|
|
13
|
+
copyright notice, this list of conditions and the following
|
|
14
|
+
disclaimer in the documentation and/or other materials provided
|
|
15
|
+
with the distribution.
|
|
16
|
+
|
|
17
|
+
* Neither the name of John Lenz, Black Maple Software, SeedTactics,
|
|
18
|
+
nor the names of other contributors may be used to endorse or
|
|
19
|
+
promote products derived from this software without specific
|
|
20
|
+
prior written permission.
|
|
21
|
+
|
|
22
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
23
|
+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
24
|
+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
25
|
+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
26
|
+
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
27
|
+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
28
|
+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
29
|
+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
30
|
+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
31
|
+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
32
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
33
|
+
*/
|
|
34
|
+
import { memo, useState } from "react";
|
|
35
|
+
import { Dialog } from "@mui/material";
|
|
36
|
+
import { Button } from "@mui/material";
|
|
37
|
+
import { DialogActions } from "@mui/material";
|
|
38
|
+
import { DialogContent } from "@mui/material";
|
|
39
|
+
import { DialogTitle } from "@mui/material";
|
|
40
|
+
import { Search as SearchIcon } from "@mui/icons-material";
|
|
41
|
+
import { TextField } from "@mui/material";
|
|
42
|
+
import { materialDialogOpen } from "../cell-status/material-details.js";
|
|
43
|
+
import { Tooltip } from "@mui/material";
|
|
44
|
+
import { IconButton } from "@mui/material";
|
|
45
|
+
import { atom, useAtom, useSetAtom } from "jotai";
|
|
46
|
+
export const ManualSerialEntryButton = memo(function ManualScan() {
|
|
47
|
+
const [serial, setSerial] = useState(null);
|
|
48
|
+
const [dialogOpen, setDialogOpen] = useState(false);
|
|
49
|
+
const setMatToShowDialog = useSetAtom(materialDialogOpen);
|
|
50
|
+
function close() {
|
|
51
|
+
setDialogOpen(false);
|
|
52
|
+
setSerial(null);
|
|
53
|
+
}
|
|
54
|
+
function open() {
|
|
55
|
+
if (serial && serial !== "") {
|
|
56
|
+
setMatToShowDialog({ type: "ManuallyEnteredSerial", serial });
|
|
57
|
+
close();
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
return (_jsxs(_Fragment, { children: [_jsx(Tooltip, { title: "Enter Serial", children: _jsx(IconButton, { onClick: () => setDialogOpen(true), size: "large", children: _jsx(SearchIcon, {}) }) }), _jsxs(Dialog, { open: dialogOpen, onClose: close, maxWidth: "md", children: [_jsx(DialogTitle, { children: "Enter a part's serial" }), _jsx(DialogContent, { children: _jsx("div", { style: { minWidth: "20em" }, children: _jsx(TextField, { sx: { mt: "5px" }, label: serial === null || serial === "" ? "Serial" : "Serial (press enter)", value: serial ?? "", fullWidth: true, autoFocus: true, onChange: (e) => setSerial(e.target.value), onKeyDown: (e) => {
|
|
61
|
+
if (e.key === "Enter" && serial && serial !== "") {
|
|
62
|
+
e.preventDefault();
|
|
63
|
+
open();
|
|
64
|
+
}
|
|
65
|
+
} }) }) }), _jsxs(DialogActions, { children: [_jsx(Button, { onClick: open, disabled: serial === null || serial === "", color: "secondary", children: "Open" }), _jsx(Button, { onClick: close, color: "secondary", children: "Cancel" })] })] })] }));
|
|
66
|
+
});
|
|
67
|
+
// A version of the above dialog that in addition passes along which queue the material
|
|
68
|
+
// is being added to, setting AddMatWithEnteredSerial instead of ManuallyEnteredSerial
|
|
69
|
+
export const enterSerialForNewMaterialDialog = atom(null);
|
|
70
|
+
export const AddBySerialDialog = memo(function AddBySerialDialog() {
|
|
71
|
+
const [queue, setQueue] = useAtom(enterSerialForNewMaterialDialog);
|
|
72
|
+
const setMatToDisplay = useSetAtom(materialDialogOpen);
|
|
73
|
+
const [serial, setSerial] = useState(undefined);
|
|
74
|
+
function lookup() {
|
|
75
|
+
if (serial && serial !== "" && queue !== null) {
|
|
76
|
+
setMatToDisplay({ type: "AddMatWithEnteredSerial", serial, toQueue: queue });
|
|
77
|
+
setQueue(null);
|
|
78
|
+
setSerial(undefined);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
function close() {
|
|
82
|
+
setQueue(null);
|
|
83
|
+
setSerial(undefined);
|
|
84
|
+
}
|
|
85
|
+
return (_jsxs(Dialog, { open: queue !== null, onClose: close, maxWidth: "md", children: [_jsxs(DialogTitle, { children: ["Lookup Material To Add To ", queue] }), _jsx(DialogContent, { children: _jsx(TextField, { label: "Serial", style: { marginTop: "0.5em" }, autoFocus: true, fullWidth: true, value: serial || "", onChange: (e) => setSerial(e.target.value), onKeyDown: (e) => {
|
|
86
|
+
if (e.key === "Enter" && serial && serial !== "") {
|
|
87
|
+
e.preventDefault();
|
|
88
|
+
lookup();
|
|
89
|
+
}
|
|
90
|
+
} }) }), _jsxs(DialogActions, { children: [_jsx(Button, { onClick: lookup, color: "secondary", children: "Lookup Serial" }), _jsx(Button, { onClick: close, color: "primary", children: "Cancel" })] })] }));
|
|
91
|
+
});
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
/* Copyright (c) 2019, John Lenz
|
|
3
|
+
|
|
4
|
+
All rights reserved.
|
|
5
|
+
|
|
6
|
+
Redistribution and use in source and binary forms, with or without
|
|
7
|
+
modification, are permitted provided that the following conditions are met:
|
|
8
|
+
|
|
9
|
+
* Redistributions of source code must retain the above copyright
|
|
10
|
+
notice, this list of conditions and the following disclaimer.
|
|
11
|
+
|
|
12
|
+
* Redistributions in binary form must reproduce the above
|
|
13
|
+
copyright notice, this list of conditions and the following
|
|
14
|
+
disclaimer in the documentation and/or other materials provided
|
|
15
|
+
with the distribution.
|
|
16
|
+
|
|
17
|
+
* Neither the name of John Lenz, Black Maple Software, SeedTactics,
|
|
18
|
+
nor the names of other contributors may be used to endorse or
|
|
19
|
+
promote products derived from this software without specific
|
|
20
|
+
prior written permission.
|
|
21
|
+
|
|
22
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
23
|
+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
24
|
+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
25
|
+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
26
|
+
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
27
|
+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
28
|
+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
29
|
+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
30
|
+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
31
|
+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
32
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
33
|
+
*/
|
|
34
|
+
import { memo, useState } from "react";
|
|
35
|
+
import { Input } from "@mui/material";
|
|
36
|
+
import { InputAdornment } from "@mui/material";
|
|
37
|
+
import { IconButton } from "@mui/material";
|
|
38
|
+
import { CalendarToday as CalendarIcon } from "@mui/icons-material";
|
|
39
|
+
import { Dialog } from "@mui/material";
|
|
40
|
+
import { DialogContent } from "@mui/material";
|
|
41
|
+
import { startOfMonth, addYears } from "date-fns";
|
|
42
|
+
import { KeyboardArrowLeft as LeftArrowIcon, KeyboardArrowRight as RightArrowIcon, } from "@mui/icons-material";
|
|
43
|
+
import { Button } from "@mui/material";
|
|
44
|
+
import { Typography } from "@mui/material";
|
|
45
|
+
import { LazySeq } from "@seedtactics/immutable-collections";
|
|
46
|
+
const months = LazySeq.ofRange(0, 12, 1)
|
|
47
|
+
.map((m) => new Date(2019, m, 1))
|
|
48
|
+
.chunk(3)
|
|
49
|
+
.toRArray();
|
|
50
|
+
export default memo(function MonthSelect(props) {
|
|
51
|
+
const [dialogOpen, setDialogOpen] = useState(false);
|
|
52
|
+
const [tempDialogCurMonth, setTempDialogCurMonth] = useState(undefined);
|
|
53
|
+
return (_jsxs(_Fragment, { children: [_jsx(Input, { type: "text", value: (tempDialogCurMonth || props.curMonth).toLocaleDateString(undefined, {
|
|
54
|
+
month: "long",
|
|
55
|
+
year: "numeric",
|
|
56
|
+
}), readOnly: true, endAdornment: _jsx(InputAdornment, { position: "end", children: _jsx(IconButton, { "aria-label": "Open month select", "data-testid": "open-month-select", onClick: () => {
|
|
57
|
+
setTempDialogCurMonth(startOfMonth(props.curMonth));
|
|
58
|
+
setDialogOpen(true);
|
|
59
|
+
}, size: "large", children: _jsx(CalendarIcon, {}) }) }) }), _jsx(Dialog, { open: dialogOpen, onClose: () => {
|
|
60
|
+
setDialogOpen(false);
|
|
61
|
+
setTempDialogCurMonth(undefined);
|
|
62
|
+
}, children: _jsxs(DialogContent, { children: [_jsxs("div", { style: { display: "flex", alignItems: "center" }, children: [_jsx(IconButton, { "data-testid": "select-month-dialog-previous-year", onClick: () => setTempDialogCurMonth(addYears(tempDialogCurMonth || props.curMonth, -1)), size: "large", children: _jsx(LeftArrowIcon, {}) }), _jsx("div", { style: { flexGrow: 1 }, children: _jsx(Typography, { variant: "h5", align: "center", "data-testid": "select-month-dialog-current-year", children: (tempDialogCurMonth || props.curMonth).toLocaleDateString(undefined, { year: "numeric" }) }) }), _jsx(IconButton, { onClick: () => setTempDialogCurMonth(addYears(tempDialogCurMonth || props.curMonth, 1)), size: "large", children: _jsx(RightArrowIcon, {}) })] }), _jsx("div", { "data-testid": "select-month-dialog-choose-month", children: months.map((monthRow, monthRowIdx) => (_jsx("div", { style: monthRowIdx > 0 ? { marginTop: "1.2em" } : undefined, children: monthRow.map((month, monthIdx) => (_jsx(Button, { color: "primary", style: monthIdx > 0 ? { marginLeft: "1.2em" } : undefined, onClick: () => {
|
|
63
|
+
props.onSelectMonth(new Date((tempDialogCurMonth || props.curMonth).getFullYear(), month.getMonth(), 1));
|
|
64
|
+
setTempDialogCurMonth(undefined);
|
|
65
|
+
setDialogOpen(false);
|
|
66
|
+
}, children: month.toLocaleDateString(undefined, { month: "short" }) }, monthIdx))) }, monthRowIdx))) })] }) })] }));
|
|
67
|
+
});
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ReactNode, ComponentType } from "react";
|
|
2
|
+
import { RouteState } from "./routes";
|
|
3
|
+
import { IFMSInfo } from "../network/api";
|
|
4
|
+
export type MenuNavItem = {
|
|
5
|
+
readonly name: string | ((info: Readonly<IFMSInfo>) => string);
|
|
6
|
+
readonly icon: ReactNode;
|
|
7
|
+
readonly route: RouteState;
|
|
8
|
+
readonly hidden?: (info: Readonly<IFMSInfo>) => boolean;
|
|
9
|
+
} | {
|
|
10
|
+
readonly separator: string;
|
|
11
|
+
};
|
|
12
|
+
export declare function Header({ showAlarms, showLogout, showSearch, showOperator, Nav1, Nav2, menuNavs, }: {
|
|
13
|
+
showAlarms: boolean;
|
|
14
|
+
showLogout: boolean;
|
|
15
|
+
showSearch: boolean;
|
|
16
|
+
showOperator: boolean;
|
|
17
|
+
Nav1: ComponentType | undefined;
|
|
18
|
+
Nav2: ComponentType | undefined;
|
|
19
|
+
menuNavs?: ReadonlyArray<MenuNavItem>;
|
|
20
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
export declare function SideMenu({ menuItems }: {
|
|
22
|
+
menuItems?: ReadonlyArray<MenuNavItem>;
|
|
23
|
+
}): import("react/jsx-runtime").JSX.Element | null;
|