@things-factory/station 10.1.33
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 +124 -0
- package/dist-client/index.d.ts +11 -0
- package/dist-client/index.js +13 -0
- package/dist-client/index.js.map +1 -0
- package/dist-client/station/scene/index.d.ts +11 -0
- package/dist-client/station/scene/index.js +12 -0
- package/dist-client/station/scene/index.js.map +1 -0
- package/dist-client/station/scene/station-context-binding.d.ts +25 -0
- package/dist-client/station/scene/station-context-binding.js +39 -0
- package/dist-client/station/scene/station-context-binding.js.map +1 -0
- package/dist-client/station/scene/station-context-scene.d.ts +28 -0
- package/dist-client/station/scene/station-context-scene.js +138 -0
- package/dist-client/station/scene/station-context-scene.js.map +1 -0
- package/dist-client/station/scene/station-counts-scene.d.ts +6 -0
- package/dist-client/station/scene/station-counts-scene.js +51 -0
- package/dist-client/station/scene/station-counts-scene.js.map +1 -0
- package/dist-client/station/scene/station-field-scene.d.ts +6 -0
- package/dist-client/station/scene/station-field-scene.js +89 -0
- package/dist-client/station/scene/station-field-scene.js.map +1 -0
- package/dist-client/station/scene/station-icons.d.ts +82 -0
- package/dist-client/station/scene/station-icons.js +131 -0
- package/dist-client/station/scene/station-icons.js.map +1 -0
- package/dist-client/station/scene/station-numpad-scene.d.ts +9 -0
- package/dist-client/station/scene/station-numpad-scene.js +144 -0
- package/dist-client/station/scene/station-numpad-scene.js.map +1 -0
- package/dist-client/station/scene/station-scene-style.d.ts +51 -0
- package/dist-client/station/scene/station-scene-style.js +108 -0
- package/dist-client/station/scene/station-scene-style.js.map +1 -0
- package/dist-client/station/scene/station-scene.d.ts +295 -0
- package/dist-client/station/scene/station-scene.js +68 -0
- package/dist-client/station/scene/station-scene.js.map +1 -0
- package/dist-client/station/scene/station-who-scene.d.ts +6 -0
- package/dist-client/station/scene/station-who-scene.js +48 -0
- package/dist-client/station/scene/station-who-scene.js.map +1 -0
- package/dist-client/station/scene/station-work-panel-scene.d.ts +28 -0
- package/dist-client/station/scene/station-work-panel-scene.js +37 -0
- package/dist-client/station/scene/station-work-panel-scene.js.map +1 -0
- package/dist-client/station/station-board-binding.d.ts +16 -0
- package/dist-client/station/station-board-binding.js +20 -0
- package/dist-client/station/station-board-binding.js.map +1 -0
- package/dist-client/station/station-context.d.ts +178 -0
- package/dist-client/station/station-context.js +30 -0
- package/dist-client/station/station-context.js.map +1 -0
- package/dist-client/station/station-palette.d.ts +34 -0
- package/dist-client/station/station-palette.js +119 -0
- package/dist-client/station/station-palette.js.map +1 -0
- package/dist-client/station/station-runtime.d.ts +47 -0
- package/dist-client/station/station-runtime.js +47 -0
- package/dist-client/station/station-runtime.js.map +1 -0
- package/dist-client/station/station-scene-context.d.ts +68 -0
- package/dist-client/station/station-scene-context.js +62 -0
- package/dist-client/station/station-scene-context.js.map +1 -0
- package/dist-client/station/station-screen-flow.d.ts +16 -0
- package/dist-client/station/station-screen-flow.js +58 -0
- package/dist-client/station/station-screen-flow.js.map +1 -0
- package/dist-client/station/station-tile-registry.d.ts +89 -0
- package/dist-client/station/station-tile-registry.js +86 -0
- package/dist-client/station/station-tile-registry.js.map +1 -0
- package/dist-client/station/station-work-panel-view.d.ts +23 -0
- package/dist-client/station/station-work-panel-view.js +125 -0
- package/dist-client/station/station-work-panel-view.js.map +1 -0
- package/dist-client/station/station-work-runtime.d.ts +47 -0
- package/dist-client/station/station-work-runtime.js +161 -0
- package/dist-client/station/station-work-runtime.js.map +1 -0
- package/dist-client/station/station-work-scenarios.d.ts +41 -0
- package/dist-client/station/station-work-scenarios.js +59 -0
- package/dist-client/station/station-work-scenarios.js.map +1 -0
- package/dist-client/station/task-counts.d.ts +32 -0
- package/dist-client/station/task-counts.js +26 -0
- package/dist-client/station/task-counts.js.map +1 -0
- package/dist-client/tsconfig.tsbuildinfo +1 -0
- package/dist-server/activities/activity-station-screen-control-withdrawal.d.ts +62 -0
- package/dist-server/activities/activity-station-screen-control-withdrawal.js +147 -0
- package/dist-server/activities/activity-station-screen-control-withdrawal.js.map +1 -0
- package/dist-server/activities/activity-station-screen-release.d.ts +81 -0
- package/dist-server/activities/activity-station-screen-release.js +147 -0
- package/dist-server/activities/activity-station-screen-release.js.map +1 -0
- package/dist-server/activities/index.d.ts +49 -0
- package/dist-server/activities/index.js +21 -0
- package/dist-server/activities/index.js.map +1 -0
- package/dist-server/index.d.ts +3 -0
- package/dist-server/index.js +8 -0
- package/dist-server/index.js.map +1 -0
- package/dist-server/service/index.d.ts +23 -0
- package/dist-server/service/index.js +41 -0
- package/dist-server/service/index.js.map +1 -0
- package/dist-server/service/station/deletion-changes.d.ts +14 -0
- package/dist-server/service/station/deletion-changes.js +25 -0
- package/dist-server/service/station/deletion-changes.js.map +1 -0
- package/dist-server/service/station/index.d.ts +13 -0
- package/dist-server/service/station/index.js +25 -0
- package/dist-server/service/station/index.js.map +1 -0
- package/dist-server/service/station/reversibility.d.ts +21 -0
- package/dist-server/service/station/reversibility.js +24 -0
- package/dist-server/service/station/reversibility.js.map +1 -0
- package/dist-server/service/station/screen-model-digest.d.ts +60 -0
- package/dist-server/service/station/screen-model-digest.js +97 -0
- package/dist-server/service/station/screen-model-digest.js.map +1 -0
- package/dist-server/service/station/staged-material.d.ts +62 -0
- package/dist-server/service/station/staged-material.js +44 -0
- package/dist-server/service/station/staged-material.js.map +1 -0
- package/dist-server/service/station/station-argument-sources.d.ts +31 -0
- package/dist-server/service/station/station-argument-sources.js +66 -0
- package/dist-server/service/station/station-argument-sources.js.map +1 -0
- package/dist-server/service/station/station-assignment-choice.d.ts +81 -0
- package/dist-server/service/station/station-assignment-choice.js +105 -0
- package/dist-server/service/station/station-assignment-choice.js.map +1 -0
- package/dist-server/service/station/station-assignment-resolver.d.ts +104 -0
- package/dist-server/service/station/station-assignment-resolver.js +426 -0
- package/dist-server/service/station/station-assignment-resolver.js.map +1 -0
- package/dist-server/service/station/station-assignment-service.d.ts +33 -0
- package/dist-server/service/station/station-assignment-service.js +64 -0
- package/dist-server/service/station/station-assignment-service.js.map +1 -0
- package/dist-server/service/station/station-axes.d.ts +9 -0
- package/dist-server/service/station/station-axes.js +16 -0
- package/dist-server/service/station/station-axes.js.map +1 -0
- package/dist-server/service/station/station-flow.d.ts +156 -0
- package/dist-server/service/station/station-flow.js +255 -0
- package/dist-server/service/station/station-flow.js.map +1 -0
- package/dist-server/service/station/station-generate.d.ts +76 -0
- package/dist-server/service/station/station-generate.js +178 -0
- package/dist-server/service/station/station-generate.js.map +1 -0
- package/dist-server/service/station/station-product.d.ts +123 -0
- package/dist-server/service/station/station-product.js +77 -0
- package/dist-server/service/station/station-product.js.map +1 -0
- package/dist-server/service/station/station-runtime-binding.d.ts +6 -0
- package/dist-server/service/station/station-runtime-binding.js +46 -0
- package/dist-server/service/station/station-runtime-binding.js.map +1 -0
- package/dist-server/service/station/station-screen-assignment.d.ts +94 -0
- package/dist-server/service/station/station-screen-assignment.js +154 -0
- package/dist-server/service/station/station-screen-assignment.js.map +1 -0
- package/dist-server/service/station/station-screen-control-withdrawal-resolver.d.ts +37 -0
- package/dist-server/service/station/station-screen-control-withdrawal-resolver.js +130 -0
- package/dist-server/service/station/station-screen-control-withdrawal-resolver.js.map +1 -0
- package/dist-server/service/station/station-screen-control-withdrawal.d.ts +104 -0
- package/dist-server/service/station/station-screen-control-withdrawal.js +128 -0
- package/dist-server/service/station/station-screen-control-withdrawal.js.map +1 -0
- package/dist-server/service/station/station-screen-draft-resolver.d.ts +47 -0
- package/dist-server/service/station/station-screen-draft-resolver.js +153 -0
- package/dist-server/service/station/station-screen-draft-resolver.js.map +1 -0
- package/dist-server/service/station/station-screen-layout.d.ts +119 -0
- package/dist-server/service/station/station-screen-layout.js +202 -0
- package/dist-server/service/station/station-screen-layout.js.map +1 -0
- package/dist-server/service/station/station-screen-list-resolver.d.ts +69 -0
- package/dist-server/service/station/station-screen-list-resolver.js +215 -0
- package/dist-server/service/station/station-screen-list-resolver.js.map +1 -0
- package/dist-server/service/station/station-screen-publish-subscriber.d.ts +22 -0
- package/dist-server/service/station/station-screen-publish-subscriber.js +90 -0
- package/dist-server/service/station/station-screen-publish-subscriber.js.map +1 -0
- package/dist-server/service/station/station-screen-release-gate.d.ts +66 -0
- package/dist-server/service/station/station-screen-release-gate.js +67 -0
- package/dist-server/service/station/station-screen-release-gate.js.map +1 -0
- package/dist-server/service/station/station-screen-release-record.d.ts +62 -0
- package/dist-server/service/station/station-screen-release-record.js +139 -0
- package/dist-server/service/station/station-screen-release-record.js.map +1 -0
- package/dist-server/service/station/station-screen-release-signature.d.ts +23 -0
- package/dist-server/service/station/station-screen-release-signature.js +32 -0
- package/dist-server/service/station/station-screen-release-signature.js.map +1 -0
- package/dist-server/service/station/station-screen-scorecard.d.ts +15 -0
- package/dist-server/service/station/station-screen-scorecard.js +35 -0
- package/dist-server/service/station/station-screen-scorecard.js.map +1 -0
- package/dist-server/service/station/station-screen-spec-resolver.d.ts +36 -0
- package/dist-server/service/station/station-screen-spec-resolver.js +202 -0
- package/dist-server/service/station/station-screen-spec-resolver.js.map +1 -0
- package/dist-server/service/station/station-screen-spec.d.ts +104 -0
- package/dist-server/service/station/station-screen-spec.js +114 -0
- package/dist-server/service/station/station-screen-spec.js.map +1 -0
- package/dist-server/service/station/station-screen-thumbnail.d.ts +11 -0
- package/dist-server/service/station/station-screen-thumbnail.js +36 -0
- package/dist-server/service/station/station-screen-thumbnail.js.map +1 -0
- package/dist-server/service/station/station-service-resolver.d.ts +27 -0
- package/dist-server/service/station/station-service-resolver.js +95 -0
- package/dist-server/service/station/station-service-resolver.js.map +1 -0
- package/dist-server/tsconfig.tsbuildinfo +1 -0
- package/package.json +44 -0
- package/shared/station-axes.d.ts +4 -0
- package/shared/station-axes.js +155 -0
- package/shared/station-screen-flow-check.d.ts +12 -0
- package/shared/station-screen-flow-check.js +74 -0
- package/things-scene.config.js +15 -0
- package/translations/en.json +42 -0
- package/translations/ja.json +42 -0
- package/translations/ko.json +42 -0
- package/translations/ms.json +42 -0
- package/translations/zh.json +42 -0
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import i18next from 'i18next';
|
|
2
|
+
export const WORK_SERVICE = 'station-work-sandbox';
|
|
3
|
+
/** Values come from scanners and inputs; Lit escapes them when it renders. */
|
|
4
|
+
const unescaped = { escapeValue: false };
|
|
5
|
+
/** Isolated, deterministic acceptance harness. It never calls Plant mutation APIs. */
|
|
6
|
+
export class StationWorkRuntime {
|
|
7
|
+
constructor(scenario) {
|
|
8
|
+
this.sequence = 0;
|
|
9
|
+
this.receipts = [];
|
|
10
|
+
this.sandbox = true;
|
|
11
|
+
this.listeners = new Set();
|
|
12
|
+
this.scenario = scenario;
|
|
13
|
+
this.current = { orderId: '', serials: [], inputs: {}, checks: [], role: 'operator', qualified: true, equipmentReady: true, online: true, calibrated: true, message: '', events: [] };
|
|
14
|
+
}
|
|
15
|
+
get state() { return structuredClone(this.current); }
|
|
16
|
+
subscribe(listener) { this.listeners.add(listener); return () => { this.listeners.delete(listener); }; }
|
|
17
|
+
emit(message) {
|
|
18
|
+
this.current.message = message;
|
|
19
|
+
this.current.events = [...this.current.events.slice(-29), message];
|
|
20
|
+
this.listeners.forEach(listener => listener());
|
|
21
|
+
}
|
|
22
|
+
editable() { if (!this.current.completed)
|
|
23
|
+
return true; this.emit(i18next.t('text.station-sim-already-confirmed')); return false; }
|
|
24
|
+
selectOrder(id) {
|
|
25
|
+
if (!this.editable())
|
|
26
|
+
return;
|
|
27
|
+
const order = this.scenario.orders.find(order => order.id === id);
|
|
28
|
+
if (!order?.ready)
|
|
29
|
+
return this.emit(i18next.t('text.station-sim-order-not-available'));
|
|
30
|
+
if (id === this.current.orderId)
|
|
31
|
+
return;
|
|
32
|
+
this.current.orderId = id;
|
|
33
|
+
this.current.serials = [];
|
|
34
|
+
this.current.inputs = {};
|
|
35
|
+
this.current.checks = [];
|
|
36
|
+
this.emit(i18next.t('text.station-sim-order-selected', { id, interpolation: unescaped }));
|
|
37
|
+
}
|
|
38
|
+
scan(raw) {
|
|
39
|
+
if (!this.editable())
|
|
40
|
+
return;
|
|
41
|
+
if (!this.current.orderId)
|
|
42
|
+
return this.emit(i18next.t('text.station-sim-select-order-first'));
|
|
43
|
+
const serial = raw.trim();
|
|
44
|
+
const item = this.scenario.stock.find(item => item.serial === serial);
|
|
45
|
+
if (!item)
|
|
46
|
+
return this.emit(i18next.t('text.station-sim-unknown-barcode', { serial: serial || i18next.t('text.station-sim-empty-value'), interpolation: unescaped }));
|
|
47
|
+
if (!item.eligible)
|
|
48
|
+
return this.emit(i18next.t('text.station-sim-serial-reason', { serial, reason: item.note || i18next.t('text.station-sim-not-usable'), interpolation: unescaped }));
|
|
49
|
+
if (this.current.serials.includes(serial))
|
|
50
|
+
return this.emit(i18next.t('text.station-sim-duplicate-scan', { serial, interpolation: unescaped }));
|
|
51
|
+
const required = this.scenario.requirements[item.item];
|
|
52
|
+
const count = this.current.serials.filter(id => this.scenario.stock.find(s => s.serial === id)?.item === item.item).length;
|
|
53
|
+
if (!required || count >= required)
|
|
54
|
+
return this.emit(i18next.t('text.station-sim-over-or-other-item', { item: item.item, interpolation: unescaped }));
|
|
55
|
+
this.current.serials.push(serial);
|
|
56
|
+
this.emit(i18next.t('text.station-sim-serial-added', { serial, interpolation: unescaped }));
|
|
57
|
+
}
|
|
58
|
+
remove(serial) { if (this.editable()) {
|
|
59
|
+
this.current.serials = this.current.serials.filter(id => id !== serial);
|
|
60
|
+
this.emit(i18next.t('text.station-sim-serial-removed', { serial, interpolation: unescaped }));
|
|
61
|
+
} }
|
|
62
|
+
input(key, value) {
|
|
63
|
+
if (!this.editable() || !this.scenario.inputs.some(input => input.key === key))
|
|
64
|
+
return;
|
|
65
|
+
this.current.inputs[key] = value;
|
|
66
|
+
this.emit(i18next.t('text.station-sim-input-changed', { key, interpolation: unescaped }));
|
|
67
|
+
}
|
|
68
|
+
check(label, checked) {
|
|
69
|
+
if (!this.editable() || !this.scenario.checks.includes(label))
|
|
70
|
+
return;
|
|
71
|
+
this.current.checks = this.current.checks.filter(value => value !== label);
|
|
72
|
+
if (checked)
|
|
73
|
+
this.current.checks.push(label);
|
|
74
|
+
this.emit(checked ? i18next.t('text.station-sim-check-on', { label, interpolation: unescaped }) : i18next.t('text.station-sim-check-off', { label, interpolation: unescaped }));
|
|
75
|
+
}
|
|
76
|
+
environment(key, value) {
|
|
77
|
+
if (!this.editable())
|
|
78
|
+
return;
|
|
79
|
+
if (key === 'role')
|
|
80
|
+
this.current.role = String(value);
|
|
81
|
+
else
|
|
82
|
+
this.current[key] = Boolean(value);
|
|
83
|
+
this.emit(i18next.t('text.station-sim-condition-changed', { key, interpolation: unescaped }));
|
|
84
|
+
}
|
|
85
|
+
validate() {
|
|
86
|
+
const s = this.current, definition = this.scenario, problems = [];
|
|
87
|
+
const order = definition.orders.find(order => order.id === s.orderId && order.ready);
|
|
88
|
+
if (!order)
|
|
89
|
+
problems.push(i18next.t('text.station-sim-no-order-or-held'));
|
|
90
|
+
if (s.role !== definition.role)
|
|
91
|
+
problems.push(i18next.t('text.station-sim-role-required', { role: definition.role, interpolation: unescaped }));
|
|
92
|
+
if (!s.qualified)
|
|
93
|
+
problems.push(i18next.t('text.station-sim-operator-not-qualified'));
|
|
94
|
+
if (!s.equipmentReady)
|
|
95
|
+
problems.push(i18next.t('text.station-sim-equipment-not-ready'));
|
|
96
|
+
if (!s.online)
|
|
97
|
+
problems.push(i18next.t('text.station-sim-offline'));
|
|
98
|
+
if (definition.calibrated && !s.calibrated)
|
|
99
|
+
problems.push(i18next.t('text.station-sim-calibration-expired'));
|
|
100
|
+
for (const [item, required] of Object.entries(definition.requirements)) {
|
|
101
|
+
const actual = s.serials.filter(id => definition.stock.some(stock => stock.serial === id && stock.item === item && stock.eligible)).length;
|
|
102
|
+
if (actual !== required)
|
|
103
|
+
problems.push(i18next.t('text.station-sim-item-count', { item, actual, required, interpolation: unescaped }));
|
|
104
|
+
}
|
|
105
|
+
for (const field of definition.inputs) {
|
|
106
|
+
const value = s.inputs[field.key]?.trim();
|
|
107
|
+
if (!value && !(field.key === 'reason' && Number(s.inputs.scrap) === 0)) {
|
|
108
|
+
problems.push(i18next.t('text.station-sim-input-required', { label: field.label, interpolation: unescaped }));
|
|
109
|
+
continue;
|
|
110
|
+
}
|
|
111
|
+
if (field.kind === 'number' && (!Number.isFinite(Number(value)) || Number(value) < field.min || Number(value) > field.max))
|
|
112
|
+
problems.push(i18next.t('text.station-sim-out-of-spec', { label: field.label, min: field.min, max: field.max, interpolation: unescaped }));
|
|
113
|
+
if (field.kind === 'text' && value && value.length > 120)
|
|
114
|
+
problems.push(i18next.t('text.station-sim-text-too-long', { label: field.label, max: 120, interpolation: unescaped }));
|
|
115
|
+
}
|
|
116
|
+
for (const check of definition.checks)
|
|
117
|
+
if (!s.checks.includes(check))
|
|
118
|
+
problems.push(i18next.t('text.station-sim-check-required', { check, interpolation: unescaped }));
|
|
119
|
+
if (definition.rule === 'balance') {
|
|
120
|
+
const amounts = ['good', 'scrap', 'remaining'].map(key => Number(s.inputs[key]));
|
|
121
|
+
if (amounts.some(value => !Number.isInteger(value)) || amounts.reduce((a, b) => a + b, 0) !== order?.quantity)
|
|
122
|
+
problems.push(i18next.t('text.station-sim-balance-mismatch'));
|
|
123
|
+
}
|
|
124
|
+
if (s.inputs.output && (definition.stock.some(stock => stock.serial === s.inputs.output.trim()) || s.inputs.output.trim() === 'EXISTING-001'))
|
|
125
|
+
problems.push(i18next.t('text.station-sim-output-id-used'));
|
|
126
|
+
if (definition.rule === 'location' && s.inputs.location?.trim() !== definition.expectedLocation)
|
|
127
|
+
problems.push(i18next.t('text.station-sim-location-mismatch', { location: definition.expectedLocation, interpolation: unescaped }));
|
|
128
|
+
if (definition.id === 'changeover' && s.inputs.program?.trim() !== 'B-REV4')
|
|
129
|
+
problems.push(i18next.t('text.station-sim-program-mismatch', { program: 'B-REV4', interpolation: unescaped }));
|
|
130
|
+
return problems;
|
|
131
|
+
}
|
|
132
|
+
commit() {
|
|
133
|
+
if (this.current.completed)
|
|
134
|
+
return true; // repeat confirmation cannot create a second receipt
|
|
135
|
+
const problems = this.validate();
|
|
136
|
+
if (problems.length) {
|
|
137
|
+
this.emit(i18next.t('text.station-sim-confirm-blocked', { problem: problems[0], interpolation: unescaped }));
|
|
138
|
+
return false;
|
|
139
|
+
}
|
|
140
|
+
const s = this.current;
|
|
141
|
+
s.completed = { id: `SIM-${this.scenario.id}-${String(++this.sequence).padStart(3, '0')}`, result: this.scenario.result, orderId: s.orderId, serials: [...s.serials], inputs: { ...s.inputs }, checks: [...s.checks], role: s.role };
|
|
142
|
+
this.receipts.push(structuredClone(s.completed));
|
|
143
|
+
this.emit(i18next.t('text.station-sim-completed', { result: this.scenario.result, interpolation: unescaped }));
|
|
144
|
+
return true;
|
|
145
|
+
}
|
|
146
|
+
resetWork(scope, afterCompletion = false) {
|
|
147
|
+
if (this.current.completed && !afterCompletion)
|
|
148
|
+
throw new Error(i18next.t('text.station-sim-confirmed-cannot-reset'));
|
|
149
|
+
if (scope === 'none')
|
|
150
|
+
return;
|
|
151
|
+
this.current.serials = [];
|
|
152
|
+
this.current.inputs = {};
|
|
153
|
+
this.current.checks = [];
|
|
154
|
+
if (scope === 'work') {
|
|
155
|
+
this.current.orderId = '';
|
|
156
|
+
this.current.completed = undefined;
|
|
157
|
+
}
|
|
158
|
+
this.emit(i18next.t('text.station-sim-input-reset'));
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
//# sourceMappingURL=station-work-runtime.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"station-work-runtime.js","sourceRoot":"","sources":["../../client/station/station-work-runtime.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,SAAS,CAAA;AAG7B,MAAM,CAAC,MAAM,YAAY,GAAG,sBAAsB,CAAA;AAClD,8EAA8E;AAC9E,MAAM,SAAS,GAAG,EAAC,WAAW,EAAC,KAAK,EAAC,CAAA;AASrC,sFAAsF;AACtF,MAAM,OAAO,kBAAkB;IAO7B,YAAY,QAAqB;QANzB,aA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CAAA;IACtD,CAAC;CACF","sourcesContent":["import i18next from 'i18next'\nimport type { WorkScenario } from './station-work-scenarios'\n\nexport const WORK_SERVICE = 'station-work-sandbox'\n/** Values come from scanners and inputs; Lit escapes them when it renders. */\nconst unescaped = {escapeValue:false}\n\nexport interface WorkState {\n orderId:string; serials:string[]; inputs:Record<string,string>; checks:string[]\n role:string; qualified:boolean; equipmentReady:boolean; online:boolean; calibrated:boolean\n message:string; completed?:{id:string; result:string; orderId:string; serials:string[]; inputs:Record<string,string>; checks:string[]; role:string}\n events:string[]\n}\n\n/** Isolated, deterministic acceptance harness. It never calls Plant mutation APIs. */\nexport class StationWorkRuntime {\n private sequence=0\n readonly receipts:WorkState['completed'][]=[]\n readonly sandbox = true\n readonly scenario:WorkScenario\n private current:WorkState\n private listeners = new Set<() => void>()\n constructor(scenario:WorkScenario) {\n this.scenario = scenario\n this.current = {orderId:'',serials:[],inputs:{},checks:[],role:'operator',qualified:true,equipmentReady:true,online:true,calibrated:true,message:'',events:[]}\n }\n get state():WorkState { return structuredClone(this.current) }\n subscribe(listener:()=>void) { this.listeners.add(listener); return () => { this.listeners.delete(listener) } }\n private emit(message:string) {\n this.current.message = message\n this.current.events = [...this.current.events.slice(-29),message]\n this.listeners.forEach(listener => listener())\n }\n private editable() { if (!this.current.completed) return true; this.emit(i18next.t('text.station-sim-already-confirmed')); return false }\n selectOrder(id:string) {\n if (!this.editable()) return\n const order = this.scenario.orders.find(order => order.id === id)\n if (!order?.ready) return this.emit(i18next.t('text.station-sim-order-not-available'))\n if (id === this.current.orderId) return\n this.current.orderId=id; this.current.serials=[]; this.current.inputs={}; this.current.checks=[]\n this.emit(i18next.t('text.station-sim-order-selected',{id,interpolation:unescaped}))\n }\n scan(raw:string) {\n if (!this.editable()) return\n if (!this.current.orderId) return this.emit(i18next.t('text.station-sim-select-order-first'))\n const serial=raw.trim()\n const item=this.scenario.stock.find(item => item.serial === serial)\n if (!item) return this.emit(i18next.t('text.station-sim-unknown-barcode',{serial:serial || i18next.t('text.station-sim-empty-value'),interpolation:unescaped}))\n if (!item.eligible) return this.emit(i18next.t('text.station-sim-serial-reason',{serial,reason:item.note || i18next.t('text.station-sim-not-usable'),interpolation:unescaped}))\n if (this.current.serials.includes(serial)) return this.emit(i18next.t('text.station-sim-duplicate-scan',{serial,interpolation:unescaped}))\n const required=this.scenario.requirements[item.item]\n const count=this.current.serials.filter(id => this.scenario.stock.find(s => s.serial===id)?.item===item.item).length\n if (!required || count>=required) return this.emit(i18next.t('text.station-sim-over-or-other-item',{item:item.item,interpolation:unescaped}))\n this.current.serials.push(serial); this.emit(i18next.t('text.station-sim-serial-added',{serial,interpolation:unescaped}))\n }\n remove(serial:string) { if (this.editable()) {this.current.serials=this.current.serials.filter(id => id!==serial); this.emit(i18next.t('text.station-sim-serial-removed',{serial,interpolation:unescaped}))} }\n input(key:string,value:string) {\n if (!this.editable() || !this.scenario.inputs.some(input=>input.key===key)) return\n this.current.inputs[key]=value; this.emit(i18next.t('text.station-sim-input-changed',{key,interpolation:unescaped}))\n }\n check(label:string,checked:boolean) {\n if (!this.editable() || !this.scenario.checks.includes(label)) return\n this.current.checks=this.current.checks.filter(value=>value!==label)\n if (checked) this.current.checks.push(label)\n this.emit(checked?i18next.t('text.station-sim-check-on',{label,interpolation:unescaped}):i18next.t('text.station-sim-check-off',{label,interpolation:unescaped}))\n }\n environment(key:'role'|'qualified'|'equipmentReady'|'online'|'calibrated',value:string|boolean) {\n if (!this.editable()) return\n if (key==='role') this.current.role=String(value)\n else this.current[key]=Boolean(value)\n this.emit(i18next.t('text.station-sim-condition-changed',{key,interpolation:unescaped}))\n }\n validate():string[] {\n const s=this.current, definition=this.scenario, problems:string[]=[]\n const order=definition.orders.find(order=>order.id===s.orderId && order.ready)\n if (!order) problems.push(i18next.t('text.station-sim-no-order-or-held'))\n if (s.role!==definition.role) problems.push(i18next.t('text.station-sim-role-required',{role:definition.role,interpolation:unescaped}))\n if (!s.qualified) problems.push(i18next.t('text.station-sim-operator-not-qualified'))\n if (!s.equipmentReady) problems.push(i18next.t('text.station-sim-equipment-not-ready'))\n if (!s.online) problems.push(i18next.t('text.station-sim-offline'))\n if (definition.calibrated && !s.calibrated) problems.push(i18next.t('text.station-sim-calibration-expired'))\n for (const [item,required] of Object.entries(definition.requirements)) {\n const actual=s.serials.filter(id=>definition.stock.some(stock=>stock.serial===id && stock.item===item && stock.eligible)).length\n if (actual!==required) problems.push(i18next.t('text.station-sim-item-count',{item,actual,required,interpolation:unescaped}))\n }\n for (const field of definition.inputs) {\n const value=s.inputs[field.key]?.trim()\n if (!value && !(field.key==='reason' && Number(s.inputs.scrap)===0)) { problems.push(i18next.t('text.station-sim-input-required',{label:field.label,interpolation:unescaped})); continue }\n if (field.kind==='number' && (!Number.isFinite(Number(value)) || Number(value)<field.min! || Number(value)>field.max!)) problems.push(i18next.t('text.station-sim-out-of-spec',{label:field.label,min:field.min,max:field.max,interpolation:unescaped}))\n if (field.kind==='text' && value && value.length>120) problems.push(i18next.t('text.station-sim-text-too-long',{label:field.label,max:120,interpolation:unescaped}))\n }\n for (const check of definition.checks) if (!s.checks.includes(check)) problems.push(i18next.t('text.station-sim-check-required',{check,interpolation:unescaped}))\n if (definition.rule==='balance') {\n const amounts=['good','scrap','remaining'].map(key=>Number(s.inputs[key]))\n if (amounts.some(value=>!Number.isInteger(value)) || amounts.reduce((a,b)=>a+b,0)!==order?.quantity) problems.push(i18next.t('text.station-sim-balance-mismatch'))\n }\n if (s.inputs.output && (definition.stock.some(stock=>stock.serial===s.inputs.output.trim()) || s.inputs.output.trim()==='EXISTING-001')) problems.push(i18next.t('text.station-sim-output-id-used'))\n if (definition.rule==='location' && s.inputs.location?.trim()!==definition.expectedLocation) problems.push(i18next.t('text.station-sim-location-mismatch',{location:definition.expectedLocation,interpolation:unescaped}))\n if (definition.id==='changeover' && s.inputs.program?.trim()!=='B-REV4') problems.push(i18next.t('text.station-sim-program-mismatch',{program:'B-REV4',interpolation:unescaped}))\n return problems\n }\n commit():boolean {\n if (this.current.completed) return true // repeat confirmation cannot create a second receipt\n const problems=this.validate()\n if (problems.length) {this.emit(i18next.t('text.station-sim-confirm-blocked',{problem:problems[0],interpolation:unescaped})); return false}\n const s=this.current\n s.completed={id:`SIM-${this.scenario.id}-${String(++this.sequence).padStart(3,'0')}`,result:this.scenario.result,orderId:s.orderId,serials:[...s.serials],inputs:{...s.inputs},checks:[...s.checks],role:s.role}\n this.receipts.push(structuredClone(s.completed))\n this.emit(i18next.t('text.station-sim-completed',{result:this.scenario.result,interpolation:unescaped}))\n return true\n }\n resetWork(scope:'none'|'inputs'|'work',afterCompletion=false){\n if(this.current.completed&&!afterCompletion)throw new Error(i18next.t('text.station-sim-confirmed-cannot-reset'))\n if(scope==='none')return\n this.current.serials=[];this.current.inputs={};this.current.checks=[]\n if(scope==='work'){this.current.orderId='';this.current.completed=undefined}\n this.emit(i18next.t('text.station-sim-input-reset'))\n }\n}\n"]}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export type WorkPanel = 'orders' | 'materials' | 'scan' | 'inputs' | 'checks' | 'status' | 'commit' | 'navigation';
|
|
2
|
+
export interface WorkOrder {
|
|
3
|
+
id: string;
|
|
4
|
+
product: string;
|
|
5
|
+
quantity: number;
|
|
6
|
+
ready: boolean;
|
|
7
|
+
}
|
|
8
|
+
export interface WorkStock {
|
|
9
|
+
serial: string;
|
|
10
|
+
item: string;
|
|
11
|
+
eligible: boolean;
|
|
12
|
+
note?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface WorkInput {
|
|
15
|
+
key: string;
|
|
16
|
+
label: string;
|
|
17
|
+
kind: 'number' | 'text';
|
|
18
|
+
min?: number;
|
|
19
|
+
max?: number;
|
|
20
|
+
sample: string;
|
|
21
|
+
}
|
|
22
|
+
export interface WorkScenario {
|
|
23
|
+
id: string;
|
|
24
|
+
title: string;
|
|
25
|
+
task: string;
|
|
26
|
+
result: string;
|
|
27
|
+
context: string[];
|
|
28
|
+
checks: string[];
|
|
29
|
+
orders: WorkOrder[];
|
|
30
|
+
stock: WorkStock[];
|
|
31
|
+
requirements: Record<string, number>;
|
|
32
|
+
inputs: WorkInput[];
|
|
33
|
+
role: 'operator' | 'quality' | 'supervisor';
|
|
34
|
+
rule?: 'balance' | 'genealogy' | 'location';
|
|
35
|
+
expectedLocation?: string;
|
|
36
|
+
calibrated?: boolean;
|
|
37
|
+
}
|
|
38
|
+
export declare const stationWorkScenarios: WorkScenario[];
|
|
39
|
+
/** The screen is a normal editable things-scene model; no executable code is serialized. */
|
|
40
|
+
export declare function scenarioScreen(scenario: WorkScenario): Record<string, any>;
|
|
41
|
+
export declare const scenarioById: (id: string) => WorkScenario | undefined;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/** Executable examples, not production commands or invented MES service contracts. */
|
|
2
|
+
import i18next from 'i18next';
|
|
3
|
+
/*
|
|
4
|
+
* Words on screen are translation keys, read through getters so the language in effect when the
|
|
5
|
+
* screen reads them wins. Products, items, serials and sample input values are demo data and stay
|
|
6
|
+
* as written: requirements are keyed by item name.
|
|
7
|
+
*/
|
|
8
|
+
const orders = (prefix, product, quantity = 1) => [
|
|
9
|
+
{ id: `${prefix}-001`, product, quantity, ready: true },
|
|
10
|
+
{ id: `${prefix}-HOLD`, product, quantity, ready: false }
|
|
11
|
+
];
|
|
12
|
+
const stock = (item, prefix, count) => [
|
|
13
|
+
...Array.from({ length: count }, (_, i) => ({ serial: `${prefix}-${String(i + 1).padStart(3, '0')}`, item, eligible: true })),
|
|
14
|
+
{ serial: `${prefix}-HOLD`, item, eligible: false, get note() { return i18next.t('text.station-sim-stock-held'); } }
|
|
15
|
+
];
|
|
16
|
+
const number = (key, labelKey, min, max, sample) => ({ key, get label() { return i18next.t(labelKey); }, kind: 'number', min, max, sample });
|
|
17
|
+
const text = (key, labelKey, sample) => ({ key, get label() { return i18next.t(labelKey); }, kind: 'text', sample });
|
|
18
|
+
/** Keys follow the scenario id: title.station-sim-{id} · text.station-sim-{id}-task · label.station-sim-{id}-result. */
|
|
19
|
+
const scenario = (id, order, context, checks, data, itemsInTask = false) => ({
|
|
20
|
+
...data, id,
|
|
21
|
+
get title() { return `${order} · ${i18next.t(`title.station-sim-${id}`)}`; },
|
|
22
|
+
get task() {
|
|
23
|
+
const key = `text.station-sim-${id}-task`;
|
|
24
|
+
if (!itemsInTask)
|
|
25
|
+
return i18next.t(key);
|
|
26
|
+
const [first, second] = Object.keys(data.requirements);
|
|
27
|
+
return i18next.t(key, { first, second, interpolation: { escapeValue: false } });
|
|
28
|
+
},
|
|
29
|
+
get result() { return i18next.t(`label.station-sim-${id}-result`); },
|
|
30
|
+
get context() { return context.map(key => i18next.t(key)); },
|
|
31
|
+
get checks() { return checks.map(key => i18next.t(key)); }
|
|
32
|
+
});
|
|
33
|
+
export const stationWorkScenarios = [
|
|
34
|
+
scenario('dispatch', '01', ['label.station-sim-context-order-status', 'label.station-sim-context-operator-qualification', 'label.station-sim-context-equipment-ready', 'label.station-sim-context-operation', 'label.station-sim-context-shift'], ['label.station-sim-check-work-standard', 'label.station-sim-check-equipment-safety'], { role: 'operator', orders: orders('WO-CUT', '절단 소재', 10), stock: [], requirements: {}, inputs: [] }),
|
|
35
|
+
scenario('kit', '02', ['label.station-sim-context-bom-quantity', 'label.station-sim-context-serial-availability', 'label.station-sim-context-quality-hold', 'label.station-sim-context-input-reservation'], ['label.station-sim-check-picking-tray'], { role: 'operator', orders: orders('WO-KIT', '구동 유닛'), stock: [...stock('모터', 'MOTOR', 2), ...stock('센서', 'SENSOR', 3)], requirements: { '모터': 1, '센서': 2 }, inputs: [] }, true),
|
|
36
|
+
scenario('packing', '03', ['label.station-sim-context-packing-order-items', 'label.station-sim-context-product-serial', 'label.station-sim-context-package-id', 'label.station-sim-context-quantity-per-item', 'label.station-sim-context-packing-inspection'], ['label.station-sim-check-enclosures-labels', 'label.station-sim-check-seal-appearance'], { role: 'operator', orders: orders('PACK', '고객 A 세트'), stock: [...stock('제품', 'UNIT', 3), ...stock('액세서리', 'ACC', 2)], requirements: { '제품': 2, '액세서리': 1 }, inputs: [text('output', 'label.station-sim-input-box-id', 'BOX-1001')] }, true),
|
|
37
|
+
scenario('genealogy', '04', ['label.station-sim-context-part-product-trace', 'label.station-sim-context-duplicate-consumption', 'label.station-sim-context-new-product-serial', 'label.station-sim-context-assembly-standard'], ['label.station-sim-check-connector'], { role: 'operator', rule: 'genealogy', orders: orders('ASM', '제어기'), stock: [...stock('PCB', 'PCB', 2), ...stock('하우징', 'CASE', 2)], requirements: { 'PCB': 1, '하우징': 1 }, inputs: [text('output', 'label.station-sim-input-new-product-serial', 'CTRL-9001')] }, true),
|
|
38
|
+
scenario('inspection', '05', ['label.station-sim-context-inspection-item', 'label.station-sim-context-spec-unit', 'label.station-sim-context-gauge-calibration', 'label.station-sim-context-inspector-role', 'label.station-sim-context-measured-values'], ['label.station-sim-check-measuring-method'], { role: 'quality', calibrated: true, orders: orders('QC', '검사 대상품'), stock: stock('검사품', 'QC', 2), requirements: { '검사품': 1 }, inputs: [number('diameter', 'label.station-sim-input-outer-diameter', 9.95, 10.05, '10.01'), number('torque', 'label.station-sim-input-torque', 4.8, 5.2, '5.0')] }),
|
|
39
|
+
scenario('weighing', '06', ['label.station-sim-context-recipe-version', 'label.station-sim-context-material-lot', 'label.station-sim-context-expiry-hold', 'label.station-sim-context-scale-calibration', 'label.station-sim-context-target-tolerance'], ['label.station-sim-check-recipe-tare'], { role: 'operator', calibrated: true, orders: orders('MIX', '수지 배합'), stock: [...stock('수지 로트', 'RESIN', 1), ...stock('경화제 로트', 'HARD', 1)], requirements: { '수지 로트': 1, '경화제 로트': 1 }, inputs: [number('resin', 'label.station-sim-input-resin', 9.9, 10.1, '10'), number('hardener', 'label.station-sim-input-hardener', 1.98, 2.02, '2')] }),
|
|
40
|
+
scenario('completion', '07', ['label.station-sim-context-previous-operation', 'label.station-sim-context-wip-ten', 'label.station-sim-context-good-reject-remaining', 'label.station-sim-context-reject-reason', 'label.station-sim-context-quantity-balance'], ['label.station-sim-check-previous-operation'], { role: 'operator', rule: 'balance', orders: orders('OP', '가공품', 10), stock: [], requirements: {}, inputs: [number('good', 'label.station-sim-input-good', 0, 10, '8'), number('scrap', 'label.station-sim-input-reject', 0, 10, '1'), number('remaining', 'label.station-sim-input-remaining', 0, 10, '1'), text('reason', 'label.station-sim-input-reject-reason-code', 'DIMENSION')] }),
|
|
41
|
+
scenario('rework', '08', ['label.station-sim-context-reject-ticket', 'label.station-sim-context-rework-scope', 'label.station-sim-context-repair-history', 'label.station-sim-context-reinspection-spec', 'label.station-sim-context-quality-release'], ['label.station-sim-check-repair-procedure', 'label.station-sim-check-reinspection-appearance'], { role: 'quality', orders: orders('RW', '불량 티켓 D-017'), stock: stock('재작업 대상', 'RW', 2), requirements: { '재작업 대상': 1 }, inputs: [text('repair', 'label.station-sim-input-repair-details', '커넥터 재체결'), number('resistance', 'label.station-sim-input-reinspection-resistance', 0, 0.5, '0.2')] }),
|
|
42
|
+
scenario('changeover', '09', ['label.station-sim-context-old-new-product', 'label.station-sim-context-tooling', 'label.station-sim-context-program-version', 'label.station-sim-context-first-article-result', 'label.station-sim-context-approver-role'], ['label.station-sim-check-remove-clean', 'label.station-sim-check-mount-tooling', 'label.station-sim-check-compare-program', 'label.station-sim-check-first-article-appearance'], { role: 'supervisor', orders: orders('SETUP', 'B형 제품 전환'), stock: [], requirements: {}, inputs: [text('program', 'label.station-sim-input-program-version', 'B-REV4'), number('firstArticle', 'label.station-sim-input-first-article-length', 99.8, 100.2, '100')] }),
|
|
43
|
+
scenario('pallet', '10', ['label.station-sim-context-box-pallet-trace', 'label.station-sim-context-load-limit', 'label.station-sim-context-duplicate-aggregation', 'label.station-sim-context-shipping-staging', 'label.station-sim-context-handover-check'], ['label.station-sim-check-load-damage', 'label.station-sim-check-shipping-label'], { role: 'operator', rule: 'location', expectedLocation: 'STAGE-A', orders: orders('SHIP', '출하 팔레트'), stock: stock('포장 박스', 'BOX', 4), requirements: { '포장 박스': 3 }, inputs: [text('output', 'label.station-sim-input-pallet-id', 'PALLET-1001'), text('location', 'label.station-sim-input-handover-location', 'STAGE-A')] })
|
|
44
|
+
];
|
|
45
|
+
/** The screen is a normal editable things-scene model; no executable code is serialized. */
|
|
46
|
+
export function scenarioScreen(scenario) {
|
|
47
|
+
const panel = (view, label, left, top, width, height) => ({ type: 'station-work-panel', id: `${scenario.id}-${view}`, view, label, left, top, width, height });
|
|
48
|
+
return { width: 1440, height: 1000, threed: false, stationScenario: scenario.id, stationScenarioVersion: 1, components: [
|
|
49
|
+
panel('orders', i18next.t('label.station-sim-panel-orders'), 24, 24, 420, 250),
|
|
50
|
+
panel('materials', i18next.t('label.station-sim-panel-materials'), 24, 294, 420, 682),
|
|
51
|
+
panel('scan', i18next.t('label.station-sim-panel-scan'), 464, 24, 520, 180),
|
|
52
|
+
panel('inputs', i18next.t('label.station-sim-panel-inputs'), 464, 224, 520, 490),
|
|
53
|
+
panel('checks', i18next.t('label.station-sim-panel-checks'), 464, 734, 520, 242),
|
|
54
|
+
panel('status', i18next.t('label.station-sim-panel-status'), 1004, 24, 412, 702),
|
|
55
|
+
panel('commit', scenario.result, 1004, 746, 412, 230)
|
|
56
|
+
] };
|
|
57
|
+
}
|
|
58
|
+
export const scenarioById = (id) => stationWorkScenarios.find(scenario => scenario.id === id);
|
|
59
|
+
//# sourceMappingURL=station-work-scenarios.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"station-work-scenarios.js","sourceRoot":"","sources":["../../client/station/station-work-scenarios.ts"],"names":[],"mappings":"AAAA,sFAAsF;AACtF,OAAO,OAAO,MAAM,SAAS,CAAA;AAY7B;;;;GAIG;AACH,MAAM,MAAM,GAAG,CAAC,MAAa,EAAE,OAAc,EAAE,QAAQ,GAAC,CAAC,EAAc,EAAE,CAAC;IACxE,EAAC,EAAE,EAAC,GAAG,MAAM,MAAM,EAAC,OAAO,EAAC,QAAQ,EAAC,KAAK,EAAC,IAAI,EAAC;IAChD,EAAC,EAAE,EAAC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C,GAAG,EAAC,EAAE,EAAC,GAAG,EAAC,GAAG,CAAC;YACtE,KAAK,CAAC,QAAQ,EAAC,OAAO,CAAC,CAAC,CAAC,gCAAgC,CAAC,EAAC,GAAG,EAAC,GAAG,EAAC,GAAG,EAAC,GAAG,CAAC;YAC3E,KAAK,CAAC,QAAQ,EAAC,OAAO,CAAC,CAAC,CAAC,gCAAgC,CAAC,EAAC,GAAG,EAAC,GAAG,EAAC,GAAG,EAAC,GAAG,CAAC;YAC3E,KAAK,CAAC,QAAQ,EAAC,OAAO,CAAC,CAAC,CAAC,gCAAgC,CAAC,EAAC,IAAI,EAAC,EAAE,EAAC,GAAG,EAAC,GAAG,CAAC;YAC3E,KAAK,CAAC,QAAQ,EAAC,QAAQ,CAAC,MAAM,EAAC,IAAI,EAAC,GAAG,EAAC,GAAG,EAAC,GAAG,CAAC;SACjD,EAAC,CAAA;AACJ,CAAC;AACD,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,EAAS,EAAE,EAAE,CAAC,oBAAoB,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,QAAQ,CAAC,EAAE,KAAK,EAAE,CAAC,CAAA","sourcesContent":["/** Executable examples, not production commands or invented MES service contracts. */\nimport i18next from 'i18next'\n\nexport type WorkPanel = 'orders' | 'materials' | 'scan' | 'inputs' | 'checks' | 'status' | 'commit' | 'navigation'\nexport interface WorkOrder { id:string; product:string; quantity:number; ready:boolean }\nexport interface WorkStock { serial:string; item:string; eligible:boolean; note?:string }\nexport interface WorkInput { key:string; label:string; kind:'number'|'text'; min?:number; max?:number; sample:string }\nexport interface WorkScenario {\n id:string; title:string; task:string; result:string; context:string[]; checks:string[]\n orders:WorkOrder[]; stock:WorkStock[]; requirements:Record<string,number>; inputs:WorkInput[]\n role:'operator'|'quality'|'supervisor'; rule?:'balance'|'genealogy'|'location'\n expectedLocation?:string; calibrated?:boolean\n}\n/*\n * Words on screen are translation keys, read through getters so the language in effect when the\n * screen reads them wins. Products, items, serials and sample input values are demo data and stay\n * as written: requirements are keyed by item name.\n */\nconst orders = (prefix:string, product:string, quantity=1):WorkOrder[] => [\n {id:`${prefix}-001`,product,quantity,ready:true},\n {id:`${prefix}-HOLD`,product,quantity,ready:false}\n]\nconst stock = (item:string, prefix:string, count:number):WorkStock[] => [\n ...Array.from({length:count},(_,i) => ({serial:`${prefix}-${String(i+1).padStart(3,'0')}`,item,eligible:true})),\n {serial:`${prefix}-HOLD`,item,eligible:false,get note(){return i18next.t('text.station-sim-stock-held')}}\n]\nconst number = (key:string,labelKey:string,min:number,max:number,sample:string):WorkInput => ({key,get label(){return i18next.t(labelKey)},kind:'number',min,max,sample})\nconst text = (key:string,labelKey:string,sample:string):WorkInput => ({key,get label(){return i18next.t(labelKey)},kind:'text',sample})\ntype ScenarioData = Omit<WorkScenario,'id'|'title'|'task'|'result'|'context'|'checks'>\n/** Keys follow the scenario id: title.station-sim-{id} · text.station-sim-{id}-task · label.station-sim-{id}-result. */\nconst scenario = (id:string, order:string, context:string[], checks:string[], data:ScenarioData, itemsInTask=false):WorkScenario => ({\n ...data, id,\n get title(){return `${order} · ${i18next.t(`title.station-sim-${id}`)}`},\n get task(){\n const key=`text.station-sim-${id}-task`\n if (!itemsInTask) return i18next.t(key)\n const [first,second]=Object.keys(data.requirements)\n return i18next.t(key, {first,second,interpolation:{escapeValue:false}})\n },\n get result(){return i18next.t(`label.station-sim-${id}-result`)},\n get context(){return context.map(key => i18next.t(key))},\n get checks(){return checks.map(key => i18next.t(key))}\n})\nexport const stationWorkScenarios:WorkScenario[] = [\n scenario('dispatch','01',\n ['label.station-sim-context-order-status','label.station-sim-context-operator-qualification','label.station-sim-context-equipment-ready','label.station-sim-context-operation','label.station-sim-context-shift'],\n ['label.station-sim-check-work-standard','label.station-sim-check-equipment-safety'],\n {role:'operator',orders:orders('WO-CUT','절단 소재',10),stock:[],requirements:{},inputs:[]}),\n scenario('kit','02',\n ['label.station-sim-context-bom-quantity','label.station-sim-context-serial-availability','label.station-sim-context-quality-hold','label.station-sim-context-input-reservation'],\n ['label.station-sim-check-picking-tray'],\n {role:'operator',orders:orders('WO-KIT','구동 유닛'),stock:[...stock('모터','MOTOR',2),...stock('센서','SENSOR',3)],requirements:{'모터':1,'센서':2},inputs:[]},true),\n scenario('packing','03',\n ['label.station-sim-context-packing-order-items','label.station-sim-context-product-serial','label.station-sim-context-package-id','label.station-sim-context-quantity-per-item','label.station-sim-context-packing-inspection'],\n ['label.station-sim-check-enclosures-labels','label.station-sim-check-seal-appearance'],\n {role:'operator',orders:orders('PACK','고객 A 세트'),stock:[...stock('제품','UNIT',3),...stock('액세서리','ACC',2)],requirements:{'제품':2,'액세서리':1},inputs:[text('output','label.station-sim-input-box-id','BOX-1001')]},true),\n scenario('genealogy','04',\n ['label.station-sim-context-part-product-trace','label.station-sim-context-duplicate-consumption','label.station-sim-context-new-product-serial','label.station-sim-context-assembly-standard'],\n ['label.station-sim-check-connector'],\n {role:'operator',rule:'genealogy',orders:orders('ASM','제어기'),stock:[...stock('PCB','PCB',2),...stock('하우징','CASE',2)],requirements:{'PCB':1,'하우징':1},inputs:[text('output','label.station-sim-input-new-product-serial','CTRL-9001')]},true),\n scenario('inspection','05',\n ['label.station-sim-context-inspection-item','label.station-sim-context-spec-unit','label.station-sim-context-gauge-calibration','label.station-sim-context-inspector-role','label.station-sim-context-measured-values'],\n ['label.station-sim-check-measuring-method'],\n {role:'quality',calibrated:true,orders:orders('QC','검사 대상품'),stock:stock('검사품','QC',2),requirements:{'검사품':1},inputs:[number('diameter','label.station-sim-input-outer-diameter',9.95,10.05,'10.01'),number('torque','label.station-sim-input-torque',4.8,5.2,'5.0')]}),\n scenario('weighing','06',\n ['label.station-sim-context-recipe-version','label.station-sim-context-material-lot','label.station-sim-context-expiry-hold','label.station-sim-context-scale-calibration','label.station-sim-context-target-tolerance'],\n ['label.station-sim-check-recipe-tare'],\n {role:'operator',calibrated:true,orders:orders('MIX','수지 배합'),stock:[...stock('수지 로트','RESIN',1),...stock('경화제 로트','HARD',1)],requirements:{'수지 로트':1,'경화제 로트':1},inputs:[number('resin','label.station-sim-input-resin',9.9,10.1,'10'),number('hardener','label.station-sim-input-hardener',1.98,2.02,'2')]}),\n scenario('completion','07',\n ['label.station-sim-context-previous-operation','label.station-sim-context-wip-ten','label.station-sim-context-good-reject-remaining','label.station-sim-context-reject-reason','label.station-sim-context-quantity-balance'],\n ['label.station-sim-check-previous-operation'],\n {role:'operator',rule:'balance',orders:orders('OP','가공품',10),stock:[],requirements:{},inputs:[number('good','label.station-sim-input-good',0,10,'8'),number('scrap','label.station-sim-input-reject',0,10,'1'),number('remaining','label.station-sim-input-remaining',0,10,'1'),text('reason','label.station-sim-input-reject-reason-code','DIMENSION')]}),\n scenario('rework','08',\n ['label.station-sim-context-reject-ticket','label.station-sim-context-rework-scope','label.station-sim-context-repair-history','label.station-sim-context-reinspection-spec','label.station-sim-context-quality-release'],\n ['label.station-sim-check-repair-procedure','label.station-sim-check-reinspection-appearance'],\n {role:'quality',orders:orders('RW','불량 티켓 D-017'),stock:stock('재작업 대상','RW',2),requirements:{'재작업 대상':1},inputs:[text('repair','label.station-sim-input-repair-details','커넥터 재체결'),number('resistance','label.station-sim-input-reinspection-resistance',0,0.5,'0.2')]}),\n scenario('changeover','09',\n ['label.station-sim-context-old-new-product','label.station-sim-context-tooling','label.station-sim-context-program-version','label.station-sim-context-first-article-result','label.station-sim-context-approver-role'],\n ['label.station-sim-check-remove-clean','label.station-sim-check-mount-tooling','label.station-sim-check-compare-program','label.station-sim-check-first-article-appearance'],\n {role:'supervisor',orders:orders('SETUP','B형 제품 전환'),stock:[],requirements:{},inputs:[text('program','label.station-sim-input-program-version','B-REV4'),number('firstArticle','label.station-sim-input-first-article-length',99.8,100.2,'100')]}),\n scenario('pallet','10',\n ['label.station-sim-context-box-pallet-trace','label.station-sim-context-load-limit','label.station-sim-context-duplicate-aggregation','label.station-sim-context-shipping-staging','label.station-sim-context-handover-check'],\n ['label.station-sim-check-load-damage','label.station-sim-check-shipping-label'],\n {role:'operator',rule:'location',expectedLocation:'STAGE-A',orders:orders('SHIP','출하 팔레트'),stock:stock('포장 박스','BOX',4),requirements:{'포장 박스':3},inputs:[text('output','label.station-sim-input-pallet-id','PALLET-1001'),text('location','label.station-sim-input-handover-location','STAGE-A')]})\n]\n\n/** The screen is a normal editable things-scene model; no executable code is serialized. */\nexport function scenarioScreen(scenario:WorkScenario):Record<string,any> {\n const panel = (view:WorkPanel,label:string,left:number,top:number,width:number,height:number) => ({type:'station-work-panel',id:`${scenario.id}-${view}`,view,label,left,top,width,height})\n return {width:1440,height:1000,threed:false,stationScenario:scenario.id,stationScenarioVersion:1,components:[\n panel('orders',i18next.t('label.station-sim-panel-orders'),24,24,420,250),\n panel('materials',i18next.t('label.station-sim-panel-materials'),24,294,420,682),\n panel('scan',i18next.t('label.station-sim-panel-scan'),464,24,520,180),\n panel('inputs',i18next.t('label.station-sim-panel-inputs'),464,224,520,490),\n panel('checks',i18next.t('label.station-sim-panel-checks'),464,734,520,242),\n panel('status',i18next.t('label.station-sim-panel-status'),1004,24,412,702),\n panel('commit',scenario.result,1004,746,412,230)\n ]}\n}\nexport const scenarioById = (id:string) => stationWorkScenarios.find(scenario => scenario.id === id)\n"]}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Counts for **one task**, kept apart from the window total.
|
|
3
|
+
*
|
|
4
|
+
* The station sends counts cumulative per task: the task's report takes the number as it is. The window
|
|
5
|
+
* total (`today`) sums every task at this equipment, so sending it made the second task of a shift
|
|
6
|
+
* record the first task's output again, and the window then counted it twice.
|
|
7
|
+
*/
|
|
8
|
+
export interface TaskCounts {
|
|
9
|
+
good: number;
|
|
10
|
+
scrap: number;
|
|
11
|
+
}
|
|
12
|
+
export declare const NO_TASK_COUNTS: TaskCounts;
|
|
13
|
+
/** After the operator adds `good` and `scrap` to the running task. */
|
|
14
|
+
export declare function countsAfter(task: TaskCounts, good: number, scrap: number): TaskCounts;
|
|
15
|
+
/**
|
|
16
|
+
* The task counts to hold after a read.
|
|
17
|
+
*
|
|
18
|
+
* - The read left after this screen last changed the counts, and its open task is the one this screen
|
|
19
|
+
* started: take what the server recorded.
|
|
20
|
+
* - The read left before the last change: keep what the screen has. That read comes back behind, and
|
|
21
|
+
* taking it would make the next count send an older total. Which read is newer is decided by order,
|
|
22
|
+
* not by which number is larger, because a count can legitimately go down.
|
|
23
|
+
* - This screen started a task the read does not show yet: keep what the screen has.
|
|
24
|
+
* - No task on this screen: nothing is being counted.
|
|
25
|
+
*/
|
|
26
|
+
export declare function taskCountsOnRead(read: {
|
|
27
|
+
runningTaskName?: string;
|
|
28
|
+
runningCounts?: TaskCounts | null;
|
|
29
|
+
}, held: {
|
|
30
|
+
taskName?: string;
|
|
31
|
+
task: TaskCounts;
|
|
32
|
+
}, leftAfterLastWrite: boolean): TaskCounts;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export const NO_TASK_COUNTS = { good: 0, scrap: 0 };
|
|
2
|
+
/** After the operator adds `good` and `scrap` to the running task. */
|
|
3
|
+
export function countsAfter(task, good, scrap) {
|
|
4
|
+
return { good: task.good + good, scrap: task.scrap + scrap };
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* The task counts to hold after a read.
|
|
8
|
+
*
|
|
9
|
+
* - The read left after this screen last changed the counts, and its open task is the one this screen
|
|
10
|
+
* started: take what the server recorded.
|
|
11
|
+
* - The read left before the last change: keep what the screen has. That read comes back behind, and
|
|
12
|
+
* taking it would make the next count send an older total. Which read is newer is decided by order,
|
|
13
|
+
* not by which number is larger, because a count can legitimately go down.
|
|
14
|
+
* - This screen started a task the read does not show yet: keep what the screen has.
|
|
15
|
+
* - No task on this screen: nothing is being counted.
|
|
16
|
+
*/
|
|
17
|
+
export function taskCountsOnRead(read, held, leftAfterLastWrite) {
|
|
18
|
+
if (!held.taskName) {
|
|
19
|
+
return NO_TASK_COUNTS;
|
|
20
|
+
}
|
|
21
|
+
if (leftAfterLastWrite && read.runningTaskName === held.taskName && read.runningCounts) {
|
|
22
|
+
return { good: read.runningCounts.good, scrap: read.runningCounts.scrap };
|
|
23
|
+
}
|
|
24
|
+
return held.task;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=task-counts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"task-counts.js","sourceRoot":"","sources":["../../client/station/task-counts.ts"],"names":[],"mappings":"AAYA,MAAM,CAAC,MAAM,cAAc,GAAe,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,CAAA;AAE/D,sEAAsE;AACtE,MAAM,UAAU,WAAW,CAAC,IAAgB,EAAE,IAAY,EAAE,KAAa;IACvE,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,GAAG,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,GAAG,KAAK,EAAE,CAAA;AAC9D,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,UAAU,gBAAgB,CAC9B,IAAqE,EACrE,IAA6C,EAC7C,kBAA2B;IAE3B,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC;QACnB,OAAO,cAAc,CAAA;IACvB,CAAC;IAED,IAAI,kBAAkB,IAAI,IAAI,CAAC,eAAe,KAAK,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,aAAa,EAAE,CAAC;QACvF,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,aAAa,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,aAAa,CAAC,KAAK,EAAE,CAAA;IAC3E,CAAC;IAED,OAAO,IAAI,CAAC,IAAI,CAAA;AAClB,CAAC","sourcesContent":["/**\n * Counts for **one task**, kept apart from the window total.\n *\n * The station sends counts cumulative per task: the task's report takes the number as it is. The window\n * total (`today`) sums every task at this equipment, so sending it made the second task of a shift\n * record the first task's output again, and the window then counted it twice.\n */\nexport interface TaskCounts {\n good: number\n scrap: number\n}\n\nexport const NO_TASK_COUNTS: TaskCounts = { good: 0, scrap: 0 }\n\n/** After the operator adds `good` and `scrap` to the running task. */\nexport function countsAfter(task: TaskCounts, good: number, scrap: number): TaskCounts {\n return { good: task.good + good, scrap: task.scrap + scrap }\n}\n\n/**\n * The task counts to hold after a read.\n *\n * - The read left after this screen last changed the counts, and its open task is the one this screen\n * started: take what the server recorded.\n * - The read left before the last change: keep what the screen has. That read comes back behind, and\n * taking it would make the next count send an older total. Which read is newer is decided by order,\n * not by which number is larger, because a count can legitimately go down.\n * - This screen started a task the read does not show yet: keep what the screen has.\n * - No task on this screen: nothing is being counted.\n */\nexport function taskCountsOnRead(\n read: { runningTaskName?: string; runningCounts?: TaskCounts | null },\n held: { taskName?: string; task: TaskCounts },\n leftAfterLastWrite: boolean\n): TaskCounts {\n if (!held.taskName) {\n return NO_TASK_COUNTS\n }\n\n if (leftAfterLastWrite && read.runningTaskName === held.taskName && read.runningCounts) {\n return { good: read.runningCounts.good, scrap: read.runningCounts.scrap }\n }\n\n return held.task\n}\n"]}
|