@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,181 @@
|
|
|
1
|
+
/* Copyright (c) 2021, John Lenz
|
|
2
|
+
|
|
3
|
+
All rights reserved.
|
|
4
|
+
|
|
5
|
+
Redistribution and use in source and binary forms, with or without
|
|
6
|
+
modification, are permitted provided that the following conditions are met:
|
|
7
|
+
|
|
8
|
+
* Redistributions of source code must retain the above copyright
|
|
9
|
+
notice, this list of conditions and the following disclaimer.
|
|
10
|
+
|
|
11
|
+
* Redistributions in binary form must reproduce the above
|
|
12
|
+
copyright notice, this list of conditions and the following
|
|
13
|
+
disclaimer in the documentation and/or other materials provided
|
|
14
|
+
with the distribution.
|
|
15
|
+
|
|
16
|
+
* Neither the name of John Lenz, Black Maple Software, SeedTactics,
|
|
17
|
+
nor the names of other contributors may be used to endorse or
|
|
18
|
+
promote products derived from this software without specific
|
|
19
|
+
prior written permission.
|
|
20
|
+
|
|
21
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
22
|
+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
23
|
+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
24
|
+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
25
|
+
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
26
|
+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
27
|
+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
28
|
+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
29
|
+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
30
|
+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
31
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
32
|
+
*/
|
|
33
|
+
import { startOfDay } from "date-fns";
|
|
34
|
+
import copy from "copy-to-clipboard";
|
|
35
|
+
import { hashValues, LazySeq } from "@seedtactics/immutable-collections";
|
|
36
|
+
// --------------------------------------------------------------------------------
|
|
37
|
+
// Actual
|
|
38
|
+
// --------------------------------------------------------------------------------
|
|
39
|
+
class DayAndPart {
|
|
40
|
+
constructor(day, part) {
|
|
41
|
+
this.day = day;
|
|
42
|
+
this.part = part;
|
|
43
|
+
}
|
|
44
|
+
compare(other) {
|
|
45
|
+
const cmp = this.day.getTime() - other.day.getTime();
|
|
46
|
+
if (cmp === 0) {
|
|
47
|
+
return this.part.localeCompare(other.part);
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
return cmp;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
hash() {
|
|
54
|
+
return hashValues(this.day, this.part);
|
|
55
|
+
}
|
|
56
|
+
toString() {
|
|
57
|
+
return `{day: ${this.day.toISOString()}}, part: ${this.part}}`;
|
|
58
|
+
}
|
|
59
|
+
adjustDay(f) {
|
|
60
|
+
return new DayAndPart(f(this.day), this.part);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
class MatIdAndProcess {
|
|
64
|
+
constructor(matId, proc) {
|
|
65
|
+
this.matId = matId;
|
|
66
|
+
this.proc = proc;
|
|
67
|
+
}
|
|
68
|
+
compare(other) {
|
|
69
|
+
const cmp = this.matId - other.matId;
|
|
70
|
+
if (cmp === 0) {
|
|
71
|
+
return this.proc - other.proc;
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
return cmp;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
hash() {
|
|
78
|
+
return hashValues(this.matId, this.proc);
|
|
79
|
+
}
|
|
80
|
+
toString() {
|
|
81
|
+
return this.matId.toString() + "-" + this.proc.toString();
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
export function binCyclesByDayAndPart(cycles, matsById, start, end) {
|
|
85
|
+
const activeTimeByMatId = LazySeq.of(cycles)
|
|
86
|
+
.filter((cycle) => cycle.endTime >= start &&
|
|
87
|
+
cycle.endTime <= end &&
|
|
88
|
+
!cycle.isLabor &&
|
|
89
|
+
cycle.activeMinutes > 0 &&
|
|
90
|
+
cycle.material.length > 0)
|
|
91
|
+
.flatMap((cycle) => cycle.material.map((mat) => ({
|
|
92
|
+
matId: mat.id,
|
|
93
|
+
proc: mat.proc,
|
|
94
|
+
active: cycle.activeMinutes / cycle.material.length,
|
|
95
|
+
})))
|
|
96
|
+
.toHashMap((p) => [new MatIdAndProcess(p.matId, p.proc), p.active], (a1, a2) => a1 + a2);
|
|
97
|
+
return LazySeq.of(matsById)
|
|
98
|
+
.flatMap(([matId, details]) => LazySeq.ofObject(details.unloaded_processes ?? {})
|
|
99
|
+
.filter(([_, unloadTime]) => unloadTime >= start && unloadTime <= end)
|
|
100
|
+
.map(([proc, unloadTime]) => ({
|
|
101
|
+
day: startOfDay(unloadTime),
|
|
102
|
+
part: details.partName + "-" + proc.toString(),
|
|
103
|
+
value: {
|
|
104
|
+
count: 1,
|
|
105
|
+
activeMachineMins: activeTimeByMatId.get(new MatIdAndProcess(matId, parseInt(proc))) ?? 0,
|
|
106
|
+
},
|
|
107
|
+
})))
|
|
108
|
+
.toHashMap((p) => [new DayAndPart(p.day, p.part), p.value], (v1, v2) => ({
|
|
109
|
+
count: v1.count + v2.count,
|
|
110
|
+
activeMachineMins: v1.activeMachineMins + v2.activeMachineMins,
|
|
111
|
+
}));
|
|
112
|
+
}
|
|
113
|
+
// --------------------------------------------------------------------------------
|
|
114
|
+
// Planned
|
|
115
|
+
// --------------------------------------------------------------------------------
|
|
116
|
+
export function binSimProductionByDayAndPart(prod) {
|
|
117
|
+
return LazySeq.of(prod).toHashMap((p) => [
|
|
118
|
+
new DayAndPart(startOfDay(p.completeTime), p.partName + "-" + p.process.toString()),
|
|
119
|
+
{ count: p.quantity, activeMachineMins: p.expectedMachineMins },
|
|
120
|
+
], (v1, v2) => ({
|
|
121
|
+
count: v1.count + v2.count,
|
|
122
|
+
activeMachineMins: v1.activeMachineMins + v2.activeMachineMins,
|
|
123
|
+
}));
|
|
124
|
+
}
|
|
125
|
+
class HeatmapClipboardCell {
|
|
126
|
+
constructor(x, y) {
|
|
127
|
+
this.x = x;
|
|
128
|
+
this.y = y;
|
|
129
|
+
}
|
|
130
|
+
compare(other) {
|
|
131
|
+
const cmp = this.x - other.x;
|
|
132
|
+
if (cmp === 0) {
|
|
133
|
+
return this.y.localeCompare(other.y);
|
|
134
|
+
}
|
|
135
|
+
else {
|
|
136
|
+
return cmp;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
hash() {
|
|
140
|
+
return hashValues(this.x, this.y);
|
|
141
|
+
}
|
|
142
|
+
toString() {
|
|
143
|
+
return `{x: ${new Date(this.x).toISOString()}, y: ${this.y}}`;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
export function buildCompletedPartsHeatmapTable(points) {
|
|
147
|
+
const cells = LazySeq.of(points).toHashMap((p) => [new HeatmapClipboardCell(p.x.getTime(), p.y), p], (_, c) => c);
|
|
148
|
+
const days = LazySeq.of(points)
|
|
149
|
+
.map((p) => p.x.getTime())
|
|
150
|
+
.distinct()
|
|
151
|
+
.toSortedArray((x) => x);
|
|
152
|
+
const rows = LazySeq.of(points)
|
|
153
|
+
.aggregate((p) => p.y, (p) => p.activeMachineMins / p.count, (first, snd) => (isNaN(first) ? snd : first))
|
|
154
|
+
.sortBy(([name, _cycleMins]) => name);
|
|
155
|
+
let table = "<table>\n<thead><tr><th>Part</th><th>Expected Cycle Mins</th>";
|
|
156
|
+
for (const x of days) {
|
|
157
|
+
table += "<th>" + new Date(x).toDateString() + " Completed</th>";
|
|
158
|
+
table += "<th>" + new Date(x).toDateString() + " Std. Hours</th>";
|
|
159
|
+
}
|
|
160
|
+
table += "</tr></thead>\n<tbody>\n";
|
|
161
|
+
for (const [partName, cycleMins] of rows) {
|
|
162
|
+
table += "<tr><th>" + partName + "</th><th>" + cycleMins.toFixed(1) + "</th>";
|
|
163
|
+
for (const x of days) {
|
|
164
|
+
const cell = cells.get(new HeatmapClipboardCell(x, partName));
|
|
165
|
+
if (cell !== undefined) {
|
|
166
|
+
table += "<td>" + cell.count.toFixed(0) + "</td>";
|
|
167
|
+
table += "<td>" + (cell.activeMachineMins / 60).toFixed(1) + "</td>";
|
|
168
|
+
}
|
|
169
|
+
else {
|
|
170
|
+
table += "<td></td>";
|
|
171
|
+
table += "<td></td>";
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
table += "</tr>\n";
|
|
175
|
+
}
|
|
176
|
+
table += "</tbody>\n</table>";
|
|
177
|
+
return table;
|
|
178
|
+
}
|
|
179
|
+
export function copyCompletedPartsHeatmapToClipboard(points) {
|
|
180
|
+
copy(buildCompletedPartsHeatmapTable(points));
|
|
181
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import * as api from "../network/api.js";
|
|
2
|
+
import { MaterialSummaryAndCompletedData } from "../cell-status/material-summary.js";
|
|
3
|
+
import { PartAndStationOperation } from "../cell-status/estimated-cycle-times.js";
|
|
4
|
+
import { PartCycleData } from "../cell-status/station-cycles.js";
|
|
5
|
+
import { PalletCyclesByPallet } from "../cell-status/pallet-cycles.js";
|
|
6
|
+
import { HashMap, LazySeq } from "@seedtactics/immutable-collections";
|
|
7
|
+
export interface PartAndProcess {
|
|
8
|
+
readonly part: string;
|
|
9
|
+
readonly proc: number;
|
|
10
|
+
}
|
|
11
|
+
export interface CycleFilterOptions {
|
|
12
|
+
readonly allPartAndProcNames: ReadonlyArray<PartAndProcess>;
|
|
13
|
+
readonly allPalletNames: ReadonlyArray<number>;
|
|
14
|
+
readonly allLoadStationNames: ReadonlyArray<string>;
|
|
15
|
+
readonly allMachineNames: ReadonlyArray<string>;
|
|
16
|
+
readonly allMachineOperations: ReadonlyArray<PartAndStationOperation>;
|
|
17
|
+
}
|
|
18
|
+
export type PartCycleChartData = PartCycleData & {
|
|
19
|
+
readonly x: Date;
|
|
20
|
+
readonly y: number;
|
|
21
|
+
};
|
|
22
|
+
export interface FilteredStationCycles {
|
|
23
|
+
readonly seriesLabel: string;
|
|
24
|
+
readonly data: ReadonlyMap<string, ReadonlyArray<PartCycleChartData>>;
|
|
25
|
+
}
|
|
26
|
+
export declare const FilterAnyMachineKey = "@@@_FMSInsight_FilterAnyMachineKey_@@@";
|
|
27
|
+
export declare const FilterAnyLoadKey = "@@@_FMSInsigt_FilterAnyLoadKey_@@@";
|
|
28
|
+
export interface StationCycleFilter {
|
|
29
|
+
readonly zoom?: {
|
|
30
|
+
start: Date;
|
|
31
|
+
end: Date;
|
|
32
|
+
};
|
|
33
|
+
readonly partAndProc?: PartAndProcess;
|
|
34
|
+
readonly pallet?: number;
|
|
35
|
+
readonly station?: string;
|
|
36
|
+
readonly operation?: PartAndStationOperation;
|
|
37
|
+
}
|
|
38
|
+
export declare function emptyStationCycles(allCycles: Iterable<PartCycleData>): FilteredStationCycles & CycleFilterOptions;
|
|
39
|
+
export declare function filterStationCycles(allCycles: Iterable<PartCycleData>, { zoom, partAndProc, pallet, station, operation }: StationCycleFilter): FilteredStationCycles & CycleFilterOptions;
|
|
40
|
+
export interface LoadCycleData extends PartCycleChartData {
|
|
41
|
+
readonly operations?: ReadonlyArray<{
|
|
42
|
+
readonly mat: Readonly<api.ILogMaterial>;
|
|
43
|
+
readonly operation: string;
|
|
44
|
+
}>;
|
|
45
|
+
}
|
|
46
|
+
export interface FilteredLoadCycles {
|
|
47
|
+
readonly seriesLabel: string;
|
|
48
|
+
readonly data: ReadonlyMap<string, ReadonlyArray<LoadCycleData>>;
|
|
49
|
+
}
|
|
50
|
+
export interface LoadCycleFilter {
|
|
51
|
+
readonly zoom?: {
|
|
52
|
+
start: Date;
|
|
53
|
+
end: Date;
|
|
54
|
+
};
|
|
55
|
+
readonly partAndProc?: PartAndProcess;
|
|
56
|
+
readonly pallet?: number;
|
|
57
|
+
readonly station?: string;
|
|
58
|
+
}
|
|
59
|
+
export declare function loadOccupancyCycles(allCycles: Iterable<PartCycleData>, { zoom, partAndProc, pallet, station }: LoadCycleFilter): FilteredLoadCycles & CycleFilterOptions;
|
|
60
|
+
export declare function plannedOperationMinutes(s: FilteredStationCycles, forSingleMat: boolean): number | undefined;
|
|
61
|
+
export interface RecentCycle {
|
|
62
|
+
readonly station: string;
|
|
63
|
+
readonly startTime: Date;
|
|
64
|
+
readonly endOccupied: Date;
|
|
65
|
+
readonly endActive?: Date;
|
|
66
|
+
readonly outlier: boolean;
|
|
67
|
+
readonly parts: ReadonlyArray<{
|
|
68
|
+
part: string;
|
|
69
|
+
oper: string;
|
|
70
|
+
}>;
|
|
71
|
+
}
|
|
72
|
+
export declare function recentCycles(allCycles: LazySeq<PartCycleData>): ReadonlyArray<RecentCycle>;
|
|
73
|
+
export declare function format_cycle_inspection(c: PartCycleData, matsById: HashMap<number, MaterialSummaryAndCompletedData>): string;
|
|
74
|
+
export type ClipboardStationCycles = {
|
|
75
|
+
readonly seriesLabel: string;
|
|
76
|
+
readonly data: ReadonlyMap<string, ReadonlyArray<PartCycleData>>;
|
|
77
|
+
};
|
|
78
|
+
export declare function buildCycleTable(cycles: ClipboardStationCycles, matsById: HashMap<number, MaterialSummaryAndCompletedData>, startD: Date | undefined, endD: Date | undefined, hideMedian?: boolean): string;
|
|
79
|
+
export declare function copyCyclesToClipboard(cycles: ClipboardStationCycles, matsById: HashMap<number, MaterialSummaryAndCompletedData>, zoom: {
|
|
80
|
+
start: Date;
|
|
81
|
+
end: Date;
|
|
82
|
+
} | undefined, hideMedian?: boolean): void;
|
|
83
|
+
export declare function buildPalletCycleTable(points: PalletCyclesByPallet): string;
|
|
84
|
+
export declare function copyPalletCyclesToClipboard(points: PalletCyclesByPallet): void;
|
|
85
|
+
export declare function buildLogEntriesTable(cycles: Iterable<Readonly<api.ILogEntry>>): string;
|
|
86
|
+
export declare function copyLogEntriesToClipboard(cycles: Iterable<Readonly<api.ILogEntry>>): void;
|