@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.
Files changed (298) hide show
  1. package/README.md +37 -0
  2. package/dist/cell-status/buffers.d.ts +36 -0
  3. package/dist/cell-status/buffers.js +127 -0
  4. package/dist/cell-status/current-status.d.ts +30 -0
  5. package/dist/cell-status/current-status.js +200 -0
  6. package/dist/cell-status/estimated-cycle-times.d.ts +41 -0
  7. package/dist/cell-status/estimated-cycle-times.js +257 -0
  8. package/dist/cell-status/inspections.d.ts +55 -0
  9. package/dist/cell-status/inspections.js +213 -0
  10. package/dist/cell-status/loading.d.ts +26 -0
  11. package/dist/cell-status/loading.js +112 -0
  12. package/dist/cell-status/material-details.d.ts +116 -0
  13. package/dist/cell-status/material-details.js +422 -0
  14. package/dist/cell-status/material-summary.d.ts +52 -0
  15. package/dist/cell-status/material-summary.js +312 -0
  16. package/dist/cell-status/names.d.ts +19 -0
  17. package/dist/cell-status/names.js +134 -0
  18. package/dist/cell-status/pallet-cycles.d.ts +24 -0
  19. package/dist/cell-status/pallet-cycles.js +78 -0
  20. package/dist/cell-status/rebookings.d.ts +30 -0
  21. package/dist/cell-status/rebookings.js +139 -0
  22. package/dist/cell-status/scheduled-jobs.d.ts +18 -0
  23. package/dist/cell-status/scheduled-jobs.js +94 -0
  24. package/dist/cell-status/sim-day-usage.d.ts +14 -0
  25. package/dist/cell-status/sim-day-usage.js +54 -0
  26. package/dist/cell-status/sim-production.d.ts +22 -0
  27. package/dist/cell-status/sim-production.js +91 -0
  28. package/dist/cell-status/sim-station-use.d.ts +25 -0
  29. package/dist/cell-status/sim-station-use.js +71 -0
  30. package/dist/cell-status/station-cycles.d.ts +34 -0
  31. package/dist/cell-status/station-cycles.js +145 -0
  32. package/dist/cell-status/tool-replacements.d.ts +44 -0
  33. package/dist/cell-status/tool-replacements.js +155 -0
  34. package/dist/cell-status/tool-usage.d.ts +25 -0
  35. package/dist/cell-status/tool-usage.js +95 -0
  36. package/dist/components/App.d.ts +15 -0
  37. package/dist/components/App.js +549 -0
  38. package/dist/components/AxisAndGrid.d.ts +51 -0
  39. package/dist/components/AxisAndGrid.js +47 -0
  40. package/dist/components/BarcodeScanning.d.ts +6 -0
  41. package/dist/components/BarcodeScanning.js +150 -0
  42. package/dist/components/ChartTooltip.d.ts +28 -0
  43. package/dist/components/ChartTooltip.js +95 -0
  44. package/dist/components/ChooseMode.d.ts +18 -0
  45. package/dist/components/ChooseMode.js +136 -0
  46. package/dist/components/ChooseOperator.d.ts +1 -0
  47. package/dist/components/ChooseOperator.js +93 -0
  48. package/dist/components/ErrorsAndLoading.d.ts +9 -0
  49. package/dist/components/ErrorsAndLoading.js +55 -0
  50. package/dist/components/LoadingIcon.d.ts +1 -0
  51. package/dist/components/LoadingIcon.js +48 -0
  52. package/dist/components/LogEntry.d.ts +16 -0
  53. package/dist/components/LogEntry.js +365 -0
  54. package/dist/components/ManualSerialEntry.d.ts +5 -0
  55. package/dist/components/ManualSerialEntry.js +91 -0
  56. package/dist/components/MonthSelect.d.ts +6 -0
  57. package/dist/components/MonthSelect.js +67 -0
  58. package/dist/components/Navigation.d.ts +23 -0
  59. package/dist/components/Navigation.js +120 -0
  60. package/dist/components/VerboseLogging.d.ts +1 -0
  61. package/dist/components/VerboseLogging.js +47 -0
  62. package/dist/components/analysis/AnalysisSelectToolbar.d.ts +1 -0
  63. package/dist/components/analysis/AnalysisSelectToolbar.js +55 -0
  64. package/dist/components/analysis/BufferChart.d.ts +1 -0
  65. package/dist/components/analysis/BufferChart.js +139 -0
  66. package/dist/components/analysis/CostPerPiece.d.ts +2 -0
  67. package/dist/components/analysis/CostPerPiece.js +175 -0
  68. package/dist/components/analysis/CycleChart.d.ts +42 -0
  69. package/dist/components/analysis/CycleChart.js +281 -0
  70. package/dist/components/analysis/DataTable.d.ts +83 -0
  71. package/dist/components/analysis/DataTable.js +215 -0
  72. package/dist/components/analysis/EfficiencyPage.d.ts +2 -0
  73. package/dist/components/analysis/EfficiencyPage.js +138 -0
  74. package/dist/components/analysis/HeatChart.d.ts +22 -0
  75. package/dist/components/analysis/HeatChart.js +161 -0
  76. package/dist/components/analysis/InspectionDataTable.d.ts +10 -0
  77. package/dist/components/analysis/InspectionDataTable.js +148 -0
  78. package/dist/components/analysis/InspectionSankey.d.ts +12 -0
  79. package/dist/components/analysis/InspectionSankey.js +140 -0
  80. package/dist/components/analysis/PalletCycleCards.d.ts +1 -0
  81. package/dist/components/analysis/PalletCycleCards.js +137 -0
  82. package/dist/components/analysis/PartCycleCards.d.ts +2 -0
  83. package/dist/components/analysis/PartCycleCards.js +331 -0
  84. package/dist/components/analysis/QualityPage.d.ts +1 -0
  85. package/dist/components/analysis/QualityPage.js +49 -0
  86. package/dist/components/analysis/ScheduleHistory.d.ts +3 -0
  87. package/dist/components/analysis/ScheduleHistory.js +108 -0
  88. package/dist/components/analysis/StationDataTable.d.ts +25 -0
  89. package/dist/components/analysis/StationDataTable.js +246 -0
  90. package/dist/components/analysis/ToolReplacements.d.ts +1 -0
  91. package/dist/components/analysis/ToolReplacements.js +370 -0
  92. package/dist/components/operations/AllMaterial.d.ts +5 -0
  93. package/dist/components/operations/AllMaterial.js +267 -0
  94. package/dist/components/operations/ChartRangeEdit.d.ts +4 -0
  95. package/dist/components/operations/ChartRangeEdit.js +148 -0
  96. package/dist/components/operations/CloseoutReport.d.ts +2 -0
  97. package/dist/components/operations/CloseoutReport.js +172 -0
  98. package/dist/components/operations/CompletedParts.d.ts +2 -0
  99. package/dist/components/operations/CompletedParts.js +286 -0
  100. package/dist/components/operations/CurrentWorkorders.d.ts +3 -0
  101. package/dist/components/operations/CurrentWorkorders.js +368 -0
  102. package/dist/components/operations/Dashboard.d.ts +2 -0
  103. package/dist/components/operations/Dashboard.js +90 -0
  104. package/dist/components/operations/OEEChart.d.ts +10 -0
  105. package/dist/components/operations/OEEChart.js +173 -0
  106. package/dist/components/operations/Outliers.d.ts +4 -0
  107. package/dist/components/operations/Outliers.js +69 -0
  108. package/dist/components/operations/ProgramHighlight.d.ts +1 -0
  109. package/dist/components/operations/ProgramHighlight.js +9 -0
  110. package/dist/components/operations/Programs.d.ts +5 -0
  111. package/dist/components/operations/Programs.js +363 -0
  112. package/dist/components/operations/Rebookings.d.ts +1 -0
  113. package/dist/components/operations/Rebookings.js +213 -0
  114. package/dist/components/operations/RecentCycleChart.d.ts +4 -0
  115. package/dist/components/operations/RecentCycleChart.js +240 -0
  116. package/dist/components/operations/RecentProduction.d.ts +2 -0
  117. package/dist/components/operations/RecentProduction.js +213 -0
  118. package/dist/components/operations/RecentSchedules.d.ts +12 -0
  119. package/dist/components/operations/RecentSchedules.js +180 -0
  120. package/dist/components/operations/RecentStationCycles.d.ts +4 -0
  121. package/dist/components/operations/RecentStationCycles.js +159 -0
  122. package/dist/components/operations/ShiftSettings.d.ts +6 -0
  123. package/dist/components/operations/ShiftSettings.js +134 -0
  124. package/dist/components/operations/SimDayUsage.d.ts +1 -0
  125. package/dist/components/operations/SimDayUsage.js +133 -0
  126. package/dist/components/operations/ToolReport.d.ts +3 -0
  127. package/dist/components/operations/ToolReport.js +233 -0
  128. package/dist/components/operations/WorkorderGantt.d.ts +1 -0
  129. package/dist/components/operations/WorkorderGantt.js +124 -0
  130. package/dist/components/quality/QualityMaterial.d.ts +2 -0
  131. package/dist/components/quality/QualityMaterial.js +169 -0
  132. package/dist/components/quality/QualityPaths.d.ts +1 -0
  133. package/dist/components/quality/QualityPaths.js +53 -0
  134. package/dist/components/quality/RecentFailedInspections.d.ts +1 -0
  135. package/dist/components/quality/RecentFailedInspections.js +123 -0
  136. package/dist/components/routes.d.ts +170 -0
  137. package/dist/components/routes.js +301 -0
  138. package/dist/components/station-monitor/BulkRawMaterial.d.ts +11 -0
  139. package/dist/components/station-monitor/BulkRawMaterial.js +251 -0
  140. package/dist/components/station-monitor/Closeout.d.ts +5 -0
  141. package/dist/components/station-monitor/Closeout.js +162 -0
  142. package/dist/components/station-monitor/CustomStationMonitorDialog.d.ts +1 -0
  143. package/dist/components/station-monitor/CustomStationMonitorDialog.js +55 -0
  144. package/dist/components/station-monitor/Inspection.d.ts +8 -0
  145. package/dist/components/station-monitor/Inspection.js +164 -0
  146. package/dist/components/station-monitor/InvalidateCycle.d.ts +33 -0
  147. package/dist/components/station-monitor/InvalidateCycle.js +262 -0
  148. package/dist/components/station-monitor/JobDetails.d.ts +7 -0
  149. package/dist/components/station-monitor/JobDetails.js +108 -0
  150. package/dist/components/station-monitor/LoadStation.d.ts +10 -0
  151. package/dist/components/station-monitor/LoadStation.js +450 -0
  152. package/dist/components/station-monitor/Material.d.ts +77 -0
  153. package/dist/components/station-monitor/Material.js +489 -0
  154. package/dist/components/station-monitor/MoveMaterialArrows.d.ts +11 -0
  155. package/dist/components/station-monitor/MoveMaterialArrows.js +118 -0
  156. package/dist/components/station-monitor/PrintedLabel.d.ts +29 -0
  157. package/dist/components/station-monitor/PrintedLabel.js +166 -0
  158. package/dist/components/station-monitor/QuarantineButton.d.ts +4 -0
  159. package/dist/components/station-monitor/QuarantineButton.js +184 -0
  160. package/dist/components/station-monitor/Queues.d.ts +23 -0
  161. package/dist/components/station-monitor/Queues.js +312 -0
  162. package/dist/components/station-monitor/QueuesAddMaterial.d.ts +30 -0
  163. package/dist/components/station-monitor/QueuesAddMaterial.js +248 -0
  164. package/dist/components/station-monitor/SelectInspType.d.ts +2 -0
  165. package/dist/components/station-monitor/SelectInspType.js +99 -0
  166. package/dist/components/station-monitor/SelectWorkorder.d.ts +4 -0
  167. package/dist/components/station-monitor/SelectWorkorder.js +100 -0
  168. package/dist/components/station-monitor/StationToolbar.d.ts +3 -0
  169. package/dist/components/station-monitor/StationToolbar.js +168 -0
  170. package/dist/components/station-monitor/SystemOverview.d.ts +46 -0
  171. package/dist/components/station-monitor/SystemOverview.js +439 -0
  172. package/dist/components/station-monitor/Whiteboard.d.ts +10 -0
  173. package/dist/components/station-monitor/Whiteboard.js +67 -0
  174. package/dist/data/all-material-bins.d.ts +45 -0
  175. package/dist/data/all-material-bins.js +224 -0
  176. package/dist/data/chart-times.d.ts +20 -0
  177. package/dist/data/chart-times.js +99 -0
  178. package/dist/data/cost-per-piece.d.ts +32 -0
  179. package/dist/data/cost-per-piece.js +183 -0
  180. package/dist/data/current-cycles.d.ts +13 -0
  181. package/dist/data/current-cycles.js +144 -0
  182. package/dist/data/inspection-sankey.d.ts +15 -0
  183. package/dist/data/inspection-sankey.js +147 -0
  184. package/dist/data/move-arrows.d.ts +48 -0
  185. package/dist/data/move-arrows.js +217 -0
  186. package/dist/data/operators.d.ts +2 -0
  187. package/dist/data/operators.js +44 -0
  188. package/dist/data/part-summary.d.ts +17 -0
  189. package/dist/data/part-summary.js +107 -0
  190. package/dist/data/path-lookup.d.ts +13 -0
  191. package/dist/data/path-lookup.js +107 -0
  192. package/dist/data/queue-material.d.ts +46 -0
  193. package/dist/data/queue-material.js +256 -0
  194. package/dist/data/results.bufferchart.d.ts +10 -0
  195. package/dist/data/results.bufferchart.js +90 -0
  196. package/dist/data/results.completed-parts.d.ts +26 -0
  197. package/dist/data/results.completed-parts.js +181 -0
  198. package/dist/data/results.cycles.d.ts +86 -0
  199. package/dist/data/results.cycles.js +454 -0
  200. package/dist/data/results.inspection.d.ts +36 -0
  201. package/dist/data/results.inspection.js +188 -0
  202. package/dist/data/results.oee.d.ts +40 -0
  203. package/dist/data/results.oee.js +330 -0
  204. package/dist/data/results.schedules.d.ts +23 -0
  205. package/dist/data/results.schedules.js +157 -0
  206. package/dist/data/tools-programs.d.ts +78 -0
  207. package/dist/data/tools-programs.js +376 -0
  208. package/dist/index.d.ts +1 -0
  209. package/dist/index.js +60 -0
  210. package/dist/network/api.d.ts +1390 -0
  211. package/dist/network/api.js +4971 -0
  212. package/dist/network/backend-mock.d.ts +11 -0
  213. package/dist/network/backend-mock.js +512 -0
  214. package/dist/network/backend.d.ts +57 -0
  215. package/dist/network/backend.js +77 -0
  216. package/dist/network/load-specific-month.d.ts +13 -0
  217. package/dist/network/load-specific-month.js +77 -0
  218. package/dist/network/server-settings.d.ts +12 -0
  219. package/dist/network/server-settings.js +92 -0
  220. package/dist/network/websocket.d.ts +4 -0
  221. package/dist/network/websocket.js +165 -0
  222. package/dist/renderer.d.ts +8 -0
  223. package/dist/renderer.js +55 -0
  224. package/dist/seedtactics-logo.d.ts +2 -0
  225. package/dist/seedtactics-logo.js +4 -0
  226. package/dist/util/chart-colors.d.ts +1 -0
  227. package/dist/util/chart-colors.js +116 -0
  228. package/dist/util/chart-helpers.d.ts +3 -0
  229. package/dist/util/chart-helpers.js +51 -0
  230. package/dist/util/parseISODuration.d.ts +4 -0
  231. package/dist/util/parseISODuration.js +40 -0
  232. package/docs/client-efficiency.md +355 -0
  233. package/docs/client-engineering.md +54 -0
  234. package/docs/client-launch.md +55 -0
  235. package/docs/client-operations.md +88 -0
  236. package/docs/client-quality.md +74 -0
  237. package/docs/client-sales.md +61 -0
  238. package/docs/client-scanners.md +41 -0
  239. package/docs/client-station-monitor.md +149 -0
  240. package/docs/client-tools-programs.md +74 -0
  241. package/docs/improve-fms.md +141 -0
  242. package/docs/makino.md +40 -0
  243. package/docs/material-quarantine.md +82 -0
  244. package/docs/material-tracking.md +236 -0
  245. package/docs/mazak.md +115 -0
  246. package/docs/niigata.md +228 -0
  247. package/docs/operator-procedures.md +106 -0
  248. package/docs/part-instructions.md +63 -0
  249. package/docs/screenshots/insight-all-material.png +0 -0
  250. package/docs/screenshots/insight-analysis-pallets.png +0 -0
  251. package/docs/screenshots/insight-analysis-part-completed.png +0 -0
  252. package/docs/screenshots/insight-analysis-sankey.png +0 -0
  253. package/docs/screenshots/insight-analysis-station-oee.png +0 -0
  254. package/docs/screenshots/insight-buffer-occupancy.png +0 -0
  255. package/docs/screenshots/insight-choose-analysis-month.png +0 -0
  256. package/docs/screenshots/insight-closeout.png +0 -0
  257. package/docs/screenshots/insight-cost-percentages.png +0 -0
  258. package/docs/screenshots/insight-dashboard.png +0 -0
  259. package/docs/screenshots/insight-event-custom-view.jpg +0 -0
  260. package/docs/screenshots/insight-event-viewer.jpg +0 -0
  261. package/docs/screenshots/insight-inspection.png +0 -0
  262. package/docs/screenshots/insight-load-station-details.png +0 -0
  263. package/docs/screenshots/insight-load-station.png +0 -0
  264. package/docs/screenshots/insight-loadcycle-graph.png +0 -0
  265. package/docs/screenshots/insight-loadstation-small.jpg +0 -0
  266. package/docs/screenshots/insight-machinecycle-graph.png +0 -0
  267. package/docs/screenshots/insight-machinecycle-table.png +0 -0
  268. package/docs/screenshots/insight-machinecycles.png +0 -0
  269. package/docs/screenshots/insight-machinehours.png +0 -0
  270. package/docs/screenshots/insight-machineoutliers.png +0 -0
  271. package/docs/screenshots/insight-monthly-schedules.png +0 -0
  272. package/docs/screenshots/insight-operations-material.png +0 -0
  273. package/docs/screenshots/insight-operations-overview.png +0 -0
  274. package/docs/screenshots/insight-operations-reports.png +0 -0
  275. package/docs/screenshots/insight-part-cost.png +0 -0
  276. package/docs/screenshots/insight-program-report.png +0 -0
  277. package/docs/screenshots/insight-quality-material-details.png +0 -0
  278. package/docs/screenshots/insight-quality-material.png +0 -0
  279. package/docs/screenshots/insight-quality-quarantine.png +0 -0
  280. package/docs/screenshots/insight-quality-sankey.png +0 -0
  281. package/docs/screenshots/insight-quality-similar-paths.png +0 -0
  282. package/docs/screenshots/insight-queue-details.png +0 -0
  283. package/docs/screenshots/insight-queues-jobs-table.png +0 -0
  284. package/docs/screenshots/insight-queues.png +0 -0
  285. package/docs/screenshots/insight-sim-day-usage.png +0 -0
  286. package/docs/screenshots/insight-station-system-overview-buttons.png +0 -0
  287. package/docs/screenshots/insight-station-system-overview.png +0 -0
  288. package/docs/screenshots/insight-system-overview.png +0 -0
  289. package/docs/screenshots/insight-tool-replacements.png +0 -0
  290. package/docs/screenshots/insight-tool-report.png +0 -0
  291. package/docs/screenshots/insight-toolbar-btns.png +0 -0
  292. package/docs/screenshots/insight-workorder-gantt.png +0 -0
  293. package/docs/screenshots/insight-workorders.png +0 -0
  294. package/docs/security.md +131 -0
  295. package/docs/server-config.md +56 -0
  296. package/docs/server-errors.md +44 -0
  297. package/package.json +90 -0
  298. package/src/index.ts +65 -0
@@ -0,0 +1,262 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ /* Copyright (c) 2025, 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 { Box, Button, ListItemIcon, ListItemText, ListSubheader, Stack } from "@mui/material";
35
+ import { MenuItem } from "@mui/material";
36
+ import { TextField } from "@mui/material";
37
+ import { ActionType, LocType } from "../../network/api.js";
38
+ import { JobsBackend } from "../../network/backend.js";
39
+ import { LazySeq } from "@seedtactics/immutable-collections";
40
+ import { currentStatus } from "../../cell-status/current-status.js";
41
+ import { barcodePotentialNewMaterial, inProcessMaterialInDialog, materialDialogOpen, materialInDialogInfo, materialInDialogLargestUsedProcess, } from "../../cell-status/material-details.js";
42
+ import { currentOperator } from "../../data/operators.js";
43
+ import { fmsInformation } from "../../network/server-settings.js";
44
+ import { useAtomValue, useSetAtom } from "jotai";
45
+ import { useEffect, useRef } from "react";
46
+ import { last30Jobs } from "../../cell-status/scheduled-jobs.js";
47
+ import { PartIdenticon } from "./Material.js";
48
+ function InvalidateSelect(props) {
49
+ const lastMat = useAtomValue(materialInDialogLargestUsedProcess);
50
+ const possible = useAtomValue(barcodePotentialNewMaterial);
51
+ const currentSt = useAtomValue(currentStatus);
52
+ const history = useAtomValue(last30Jobs);
53
+ const castings = Object.values(possible?.possibleCastingsByQueue ?? {}).flatMap((cs) => cs);
54
+ const jobs = Object.values(possible?.possibleJobsByQueue ?? {})
55
+ .flatMap((js) => js)
56
+ .filter((j) => j.lastCompletedProcess === 0)
57
+ .map((j) => ({
58
+ jobUnique: j.jobUnique,
59
+ job: currentSt.jobs[j.jobUnique] ?? history.get(j.jobUnique) ?? null,
60
+ }));
61
+ const hasProc = lastMat !== null && lastMat.process >= 1;
62
+ const hasChangeMat = castings.length > 0 || jobs.length > 0;
63
+ function change(e) {
64
+ props.setState({
65
+ updating: false,
66
+ process: e.startsWith("proc") ? parseInt(e.substring(4)) : null,
67
+ changeRawMat: e.startsWith("rawMat") ? e.substring(6) : null,
68
+ changeJobUnique: e.startsWith("job") ? e.substring(3) : null,
69
+ });
70
+ }
71
+ return (_jsx(TextField, { value: props.st?.process
72
+ ? "proc" + props.st.process.toString()
73
+ : props.st?.changeRawMat
74
+ ? "rawMat" + props.st.changeRawMat
75
+ : props.st?.changeJobUnique
76
+ ? "job" + props.st.changeJobUnique
77
+ : "", select: true, onChange: (e) => change(e.target.value), variant: "outlined", label: props.st?.process || !hasChangeMat
78
+ ? "Invalidate Process"
79
+ : props.st?.changeRawMat
80
+ ? "Change Raw Material"
81
+ : props.st?.changeJobUnique
82
+ ? "Change Assigned Job"
83
+ : !hasProc
84
+ ? "Change Assignment"
85
+ : "", children: [
86
+ hasProc && hasChangeMat
87
+ ? [_jsx(ListSubheader, { children: "Invalidate Selected Process" }, "procheader")]
88
+ : [],
89
+ lastMat
90
+ ? [
91
+ ...LazySeq.ofRange(1, lastMat.process + 1).map((p) => (_jsxs(MenuItem, { value: "proc" + p.toString(), children: ["Invalidate Process ", p] }, p))),
92
+ ]
93
+ : [],
94
+ hasProc && hasChangeMat ? [_jsx(ListSubheader, { children: "Change Material Type" }, "matheader")] : [],
95
+ hasChangeMat
96
+ ? [
97
+ ...castings.map((c) => (_jsxs(MenuItem, { value: "rawMat" + c, children: ["Invalidate Everything And Change to ", c] }, "rawMat" + c))),
98
+ ...jobs.map(({ jobUnique, job }) => (_jsxs(MenuItem, { value: "job" + jobUnique, children: [job ? (_jsx(ListItemIcon, { children: _jsx(PartIdenticon, { part: job.partName }) })) : undefined, _jsx(ListItemText, { primary: "Invalidate Everything And Change To Job " + jobUnique, secondary: job?.partName })] }, "job" + jobUnique))),
99
+ ]
100
+ : [],
101
+ ] }));
102
+ }
103
+ export function InvalidateCycleDialogContent(props) {
104
+ const curMat = useAtomValue(materialInDialogInfo);
105
+ const show = props.st !== null && curMat !== null;
106
+ const boxRef = useRef(null);
107
+ useEffect(() => {
108
+ boxRef.current?.scrollIntoView({
109
+ behavior: "smooth",
110
+ block: "end",
111
+ });
112
+ }, [boxRef, show]);
113
+ if (!show)
114
+ return _jsx("div", {});
115
+ return (_jsx(Box, { ref: boxRef, sx: { display: "flex", flexDirection: "column", alignItems: "center", marginTop: "1em" }, children: _jsxs(Stack, { spacing: 2, children: [_jsx("p", { style: { maxWidth: "35em" }, children: "An invalidated cycle remains in the event log, but is not considered when determining the next process to be machined on a piece of material." }), _jsx(InvalidateSelect, { st: props.st, setState: props.setState })] }) }));
116
+ }
117
+ export function InvalidateCycleDialogButton(props) {
118
+ const fmsInfo = useAtomValue(fmsInformation);
119
+ const curMat = useAtomValue(materialInDialogInfo);
120
+ const inProcMat = useAtomValue(inProcessMaterialInDialog);
121
+ const lastMat = useAtomValue(materialInDialogLargestUsedProcess);
122
+ const possibleNew = useAtomValue(barcodePotentialNewMaterial);
123
+ const setMatToShow = useSetAtom(materialDialogOpen);
124
+ let operator = useAtomValue(currentOperator);
125
+ if (props.loadStation && !fmsInfo.allowInvalidateMaterialAtLoadStation)
126
+ return null;
127
+ if (!props.loadStation && !fmsInfo.allowInvalidateMaterialOnQueuesPage)
128
+ return null;
129
+ if (curMat === null)
130
+ return null;
131
+ if (inProcMat && inProcMat.location.type === LocType.OnPallet)
132
+ return null;
133
+ const allowChange = possibleNew !== null &&
134
+ (!LazySeq.ofObject(possibleNew.possibleCastingsByQueue ?? {}).isEmpty() ||
135
+ !LazySeq.ofObject(possibleNew.possibleJobsByQueue ?? {}).isEmpty());
136
+ if (!allowChange && (lastMat === null || lastMat.process < 1))
137
+ return null;
138
+ if (props.ignoreOperator)
139
+ operator = null;
140
+ function showInvalidate() {
141
+ props.setState({ process: null, updating: false, changeRawMat: null, changeJobUnique: null });
142
+ }
143
+ function invalidateCycle() {
144
+ if (curMat && (props.st?.process || props.st?.changeRawMat || props.st?.changeJobUnique)) {
145
+ props.setState({ ...props.st, updating: true });
146
+ JobsBackend.invalidatePalletCycle(curMat.materialID, operator, props.st?.changeRawMat, props.st?.changeJobUnique, props.st?.process ?? 0)
147
+ .then((mat) => {
148
+ if (mat) {
149
+ setMatToShow({
150
+ type: "MatDetails",
151
+ details: mat,
152
+ });
153
+ props.onClose();
154
+ }
155
+ else {
156
+ setMatToShow(null);
157
+ props.onClose();
158
+ }
159
+ })
160
+ .catch((e) => {
161
+ console.log(e);
162
+ setMatToShow(null);
163
+ props.onClose();
164
+ });
165
+ }
166
+ }
167
+ return (_jsxs(_Fragment, { children: [props.st === null ? (_jsx(Button, { color: "primary", onClick: showInvalidate, children: "Invalidate Cycle" })) : undefined, props.st !== null ? (_jsx(Button, { color: "primary", onClick: invalidateCycle, disabled: props.st.updating ||
168
+ (props.st.process === null && props.st.changeRawMat === null && props.st.changeJobUnique === null), children: props.st.process !== null
169
+ ? "Invalidate Process " + props.st.process.toString()
170
+ : props.st.changeJobUnique !== null
171
+ ? "Invalidate And Change To Job " + props.st.changeJobUnique
172
+ : props.st.changeRawMat !== null
173
+ ? "Invalidate And Change To " + props.st.changeRawMat
174
+ : "Invalidate Cycle" })) : undefined] }));
175
+ }
176
+ function isNullOrEmpty(s) {
177
+ return s === undefined || s === null || s == "";
178
+ }
179
+ function matCanSwap(curMat, job) {
180
+ return (newMat) => {
181
+ if (isNullOrEmpty(newMat.serial))
182
+ return false;
183
+ if (newMat.location.type === LocType.OnPallet)
184
+ return false;
185
+ if (newMat.process !== curMat.process - 1)
186
+ return false;
187
+ if (isNullOrEmpty(newMat.jobUnique)) {
188
+ // if part name is wrong, check casting
189
+ if (isNullOrEmpty(newMat.partName))
190
+ return false;
191
+ if (newMat.partName !== curMat.partName) {
192
+ if (!job)
193
+ return false;
194
+ if (!LazySeq.of(job.procsAndPaths)
195
+ .flatMap((p) => p.paths)
196
+ .some((p) => p.casting === newMat.partName)) {
197
+ return false;
198
+ }
199
+ }
200
+ }
201
+ else {
202
+ // check path
203
+ if (newMat.jobUnique !== curMat.jobUnique)
204
+ return false;
205
+ if (newMat.path !== curMat.path)
206
+ return false;
207
+ }
208
+ return true;
209
+ };
210
+ }
211
+ export function SwapMaterialDialogContent(props) {
212
+ const status = useAtomValue(currentStatus);
213
+ const curMat = useAtomValue(inProcessMaterialInDialog);
214
+ if (curMat === null || props.st === null)
215
+ return _jsx("div", {});
216
+ const curMatJob = status.jobs[curMat.jobUnique];
217
+ const availMats = status.material.filter(matCanSwap(curMat, curMatJob));
218
+ if (availMats.length === 0) {
219
+ return (_jsx("p", { style: { margin: "2em" }, children: "No material with the same job is available for swapping. You must edit the pallet using the cell controller software to remove the material from the pallet. Insight will automatically refresh once the cell controller software is updated." }));
220
+ }
221
+ else {
222
+ return (_jsxs("div", { style: { margin: "2em" }, children: [_jsx("p", { children: "Swap serial on pallet with material from the same job." }), _jsx("p", { children: "If material on the pallet is from a different job, you cannot use this screen. Instead, the material must first be removed from the pallet using the cell controller software. Insight will automatically refresh when this occurs." }), _jsx(TextField, { value: props.st?.selectedMatToSwap?.serial ?? "", select: true, onChange: (e) => props.st &&
223
+ props.setState({
224
+ ...props.st,
225
+ selectedMatToSwap: availMats.find((m) => m.serial === e.target.value) ?? null,
226
+ }), style: { width: "20em" }, variant: "outlined", label: "Select serial to swap with " + (curMat.serial ?? ""), children: availMats.map((m) => (_jsx(MenuItem, { value: m.serial, children: m.serial }, m.materialID))) })] }));
227
+ }
228
+ }
229
+ export function SwapMaterialButtons(props) {
230
+ const fmsInfo = useAtomValue(fmsInformation);
231
+ const curMat = useAtomValue(inProcessMaterialInDialog);
232
+ const closeMatDialog = useSetAtom(materialDialogOpen);
233
+ let operator = useAtomValue(currentOperator);
234
+ if (!fmsInfo.allowSwapSerialAtLoadStation)
235
+ return null;
236
+ if (props.ignoreOperator)
237
+ operator = null;
238
+ if (!curMat ||
239
+ curMat.location.type !== LocType.OnPallet ||
240
+ curMat.action.type === ActionType.Loading ||
241
+ curMat.action.type === ActionType.UnloadToCompletedMaterial ||
242
+ curMat.action.type === ActionType.UnloadToInProcess) {
243
+ return null;
244
+ }
245
+ function swapMats() {
246
+ if (curMat && props.st && props.st.selectedMatToSwap && curMat.location.type === LocType.OnPallet) {
247
+ props.setState({ selectedMatToSwap: props.st.selectedMatToSwap, updating: true });
248
+ JobsBackend.swapMaterialOnPallet(curMat.materialID, operator, {
249
+ pallet: curMat.location.palletNum ?? 0,
250
+ materialIDToSetOnPallet: props.st.selectedMatToSwap.materialID,
251
+ })
252
+ .catch(console.log)
253
+ .finally(() => {
254
+ closeMatDialog(null);
255
+ props.onClose();
256
+ });
257
+ }
258
+ }
259
+ return (_jsxs(_Fragment, { children: [props.st === null ? (_jsx(Button, { color: "primary", onClick: () => props.setState({ selectedMatToSwap: null, updating: false }), children: "Swap Serial" })) : undefined, props.st !== null ? (_jsx(Button, { color: "primary", onClick: swapMats, disabled: props.st.selectedMatToSwap === null || props.st.updating, children: props.st.selectedMatToSwap === null
260
+ ? "Swap Serial"
261
+ : "Swap with " + (props.st.selectedMatToSwap.serial ?? "") })) : undefined] }));
262
+ }
@@ -0,0 +1,7 @@
1
+ import { ReactNode } from "react";
2
+ import * as api from "../../network/api.js";
3
+ export interface JobDetailsProps {
4
+ readonly job: Readonly<api.IActiveJob> | null;
5
+ readonly checkAnalysisMonth: boolean;
6
+ }
7
+ export declare function JobDetails(props: JobDetailsProps): ReactNode;
@@ -0,0 +1,108 @@
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 { Fragment } from "react";
35
+ import * as api from "../../network/api.js";
36
+ import { IconButton } from "@mui/material";
37
+ import { Table } from "@mui/material";
38
+ import { TableBody } from "@mui/material";
39
+ import { TableCell } from "@mui/material";
40
+ import { TableHead } from "@mui/material";
41
+ import { TableRow } from "@mui/material";
42
+ import { durationToMinutes } from "../../util/parseISODuration.js";
43
+ import { materialDialogOpen } from "../../cell-status/material-details.js";
44
+ import { currentStatus } from "../../cell-status/current-status.js";
45
+ import { selectedAnalysisPeriod } from "../../network/load-specific-month.js";
46
+ import { last30MaterialSummary, specificMonthMaterialSummary } from "../../cell-status/material-summary.js";
47
+ import { LazySeq, HashSet } from "@seedtactics/immutable-collections";
48
+ import { MoreHoriz } from "@mui/icons-material";
49
+ import { useAtomValue, useSetAtom } from "jotai";
50
+ function displayDate(d) {
51
+ return d.toLocaleString(undefined, {
52
+ month: "short",
53
+ day: "numeric",
54
+ year: "numeric",
55
+ hour: "numeric",
56
+ minute: "2-digit",
57
+ });
58
+ }
59
+ function JobCompleted(props) {
60
+ const val = props.job.completed?.[props.procIdx]?.[props.pathIdx];
61
+ if (val !== undefined) {
62
+ return _jsxs("div", { children: ["Completed: ", val] });
63
+ }
64
+ return null;
65
+ }
66
+ function JobDisplay(props) {
67
+ return (_jsx("div", { children: _jsxs("dl", { children: [_jsx("dt", { children: "Job ID" }), _jsx("dd", { children: props.job.unique }), _jsx("dt", { children: "Time" }), _jsxs("dd", { children: [displayDate(props.job.routeStartUTC), " to ", displayDate(props.job.routeEndUTC)] }), props.job.cycles ? (_jsxs(_Fragment, { children: [_jsx("dt", { children: "Quantity" }), _jsx("dd", { children: props.job.cycles })] })) : undefined, props.job.comment !== undefined && props.job.comment !== "" ? (_jsxs(_Fragment, { children: [_jsx("dt", { children: "Comment" }), _jsx("dd", { children: props.job.comment })] })) : undefined, props.job.assignedWorkorders && props.job.assignedWorkorders.length > 0 ? (_jsxs(_Fragment, { children: [_jsx("dt", { children: "Workorders" }), _jsx("dd", { children: props.job.assignedWorkorders.join(", ") })] })) : undefined, props.job.procsAndPaths.map((proc, procIdx) => (_jsx(Fragment, { children: proc.paths.map((path, pathIdx) => (_jsxs(Fragment, { children: [_jsxs("dt", { children: ["Process ", procIdx + 1, proc.paths.length > 1 ? ", Path " + (pathIdx + 1).toString() : undefined] }), _jsxs("dd", { children: [_jsx(JobCompleted, { job: props.job, procIdx: procIdx, pathIdx: pathIdx }), _jsxs("div", { children: ["Estimated Start: ", displayDate(path.simulatedStartingUTC)] }), _jsxs("div", { children: ["Pallets: ", (path.palletNums ?? []).map((p) => p.toString()).join(",")] }), path.fixture ? (_jsxs("div", { children: ["Fixture: ", path.fixture, " ", path.face !== undefined ? ", Face: " + path.face.toString() : undefined] })) : undefined, path.inputQueue ? _jsxs("div", { children: ["Input Queue: ", path.inputQueue] }) : undefined, path.casting ? _jsxs("div", { children: ["Raw Material: ", path.casting] }) : undefined, _jsxs("div", { children: ["Load Stations: ", path.load.join(","), " |", " ", durationToMinutes(path.expectedLoadTime).toFixed(1), " mins", path.partsPerPallet > 1 ? " per piece" : ""] }), path.stops.map((stop, stopIdx) => (_jsx(Fragment, { children: _jsxs("div", { children: [stop.stationGroup, ": ", (stop.stationNums ?? []).join(","), " | Program: ", stop.program, stop.programRevision ? " rev" + stop.programRevision.toString() : undefined, " |", " ", (durationToMinutes(stop.expectedCycleTime) / path.partsPerPallet).toFixed(1), " mins", path.partsPerPallet > 1 ? " per piece" : ""] }) }, stopIdx))), _jsxs("div", { children: ["Unload Stations: ", path.unload.join(","), " |", " ", durationToMinutes(path.expectedUnloadTime).toFixed(1), " mins", path.partsPerPallet > 1 ? " per piece" : ""] }), path.outputQueue ? _jsxs("div", { children: ["Output Queue: ", path.outputQueue] }) : undefined, path.inspections && path.inspections.length > 0 ? (_jsxs("div", { children: ["Inspections: ", path.inspections.map((i) => i.inspectionType).join(",")] })) : undefined] })] }, pathIdx))) }, procIdx)))] }) }));
68
+ }
69
+ function MaterialStatus(props) {
70
+ if (props.inProcMat !== null && props.inProcMat.location.type === api.LocType.OnPallet) {
71
+ return _jsxs("span", { children: ["On pallet ", props.inProcMat.location.palletNum ?? ""] });
72
+ }
73
+ else if (props.inProcMat !== null && props.inProcMat.location.type === api.LocType.InQueue) {
74
+ return _jsxs("span", { children: ["In queue ", props.inProcMat.location.currentQueue ?? ""] });
75
+ }
76
+ else if (props.matSummary?.completed_last_proc_machining) {
77
+ return _jsx("span", { children: "Completed" });
78
+ }
79
+ else if (props.matSummary !== null && props.matSummary.startedProcess1 === false) {
80
+ return _jsx("span", { children: "Not yet started" });
81
+ }
82
+ else {
83
+ return _jsx("span", {});
84
+ }
85
+ }
86
+ function JobMaterial(props) {
87
+ const currentMaterial = useAtomValue(currentStatus).material;
88
+ const setMatToShow = useSetAtom(materialDialogOpen);
89
+ const mats = LazySeq.of(props.matIdsForJob.get(props.unique) ?? HashSet.empty())
90
+ .collect((matId) => props.matsFromEvents.get(matId))
91
+ .toRArray();
92
+ if (mats === null || mats.length === 0) {
93
+ return _jsx("div", {});
94
+ }
95
+ const matsById = LazySeq.of(currentMaterial).toHashMap((m) => [m.materialID, m], (m1, _m2) => m1);
96
+ const anyWorkorder = LazySeq.of(mats).some((m) => m.workorderId !== undefined && m.workorderId !== "" && m.workorderId !== m.serial);
97
+ return (_jsx("div", { children: _jsxs(Table, { size: "small", style: { width: props.fullWidth ? "100%" : "auto" }, children: [_jsx(TableHead, { children: _jsxs(TableRow, { children: [anyWorkorder ? _jsx(TableCell, { children: "Workorder" }) : undefined, _jsx(TableCell, { children: "Serial" }), _jsx(TableCell, { children: "Status" }), _jsx(TableCell, { padding: "checkbox" })] }) }), _jsx(TableBody, { children: mats.map((mat) => (_jsxs(TableRow, { children: [anyWorkorder ? _jsx(TableCell, { children: mat.workorderId ?? "" }) : undefined, _jsx(TableCell, { children: mat.serial ?? "" }), _jsx(TableCell, { children: _jsx(MaterialStatus, { matSummary: props.matsFromEvents.get(mat.materialID) ?? null, inProcMat: matsById.get(mat.materialID) ?? null }) }), _jsx(TableCell, { padding: "checkbox", children: _jsx(IconButton, { onClick: () => setMatToShow({
98
+ type: "MatSummary",
99
+ summary: mat,
100
+ }), size: "large", children: _jsx(MoreHoriz, { fontSize: "inherit" }) }) })] }, mat.materialID))) })] }) }));
101
+ }
102
+ export function JobDetails(props) {
103
+ const period = useAtomValue(selectedAnalysisPeriod);
104
+ const matsFromEvents = useAtomValue(props.checkAnalysisMonth && period.type === "SpecificMonth"
105
+ ? specificMonthMaterialSummary
106
+ : last30MaterialSummary);
107
+ return (_jsx("div", { style: { display: "flex", justifyContent: "space-evenly" }, children: props.job !== null ? (_jsxs(_Fragment, { children: [_jsx(JobDisplay, { job: props.job }), _jsx(JobMaterial, { unique: props.job.unique, fullWidth: false, matsFromEvents: matsFromEvents.matsById, matIdsForJob: matsFromEvents.matIdsForJob })] })) : undefined }));
108
+ }
@@ -0,0 +1,10 @@
1
+ import { ReactNode } from "react";
2
+ interface LoadStationProps {
3
+ readonly loadNum: number;
4
+ readonly queues: ReadonlyArray<string>;
5
+ readonly completed: boolean;
6
+ readonly whiteBackground?: boolean;
7
+ }
8
+ export declare function LoadStation(props: LoadStationProps): import("react/jsx-runtime").JSX.Element;
9
+ declare function LoadStationCheckWidth(props: LoadStationProps): ReactNode;
10
+ export default LoadStationCheckWidth;