@operato/scene-mpi 1.3.7
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/CHANGELOG.md +11 -0
- package/README.md +31 -0
- package/assets/favicon.ico +0 -0
- package/assets/images/spinner.png +0 -0
- package/dist/auto-clicker.d.ts +10 -0
- package/dist/auto-clicker.js +84 -0
- package/dist/auto-clicker.js.map +1 -0
- package/dist/boot-button.d.ts +20 -0
- package/dist/boot-button.js +90 -0
- package/dist/boot-button.js.map +1 -0
- package/dist/gateway-on-button.d.ts +7 -0
- package/dist/gateway-on-button.js +88 -0
- package/dist/gateway-on-button.js.map +1 -0
- package/dist/gateway-on-message.d.ts +3 -0
- package/dist/gateway-on-message.js +375 -0
- package/dist/gateway-on-message.js.map +1 -0
- package/dist/gateway.d.ts +58 -0
- package/dist/gateway.js +396 -0
- package/dist/gateway.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -0
- package/dist/indicator-on-message.d.ts +2 -0
- package/dist/indicator-on-message.js +5 -0
- package/dist/indicator-on-message.js.map +1 -0
- package/dist/indicator-user-action.d.ts +5 -0
- package/dist/indicator-user-action.js +263 -0
- package/dist/indicator-user-action.js.map +1 -0
- package/dist/indicator.d.ts +83 -0
- package/dist/indicator.js +544 -0
- package/dist/indicator.js.map +1 -0
- package/dist/reply-button.d.ts +20 -0
- package/dist/reply-button.js +67 -0
- package/dist/reply-button.js.map +1 -0
- package/dist/segment-display.d.ts +41 -0
- package/dist/segment-display.js +521 -0
- package/dist/segment-display.js.map +1 -0
- package/dist/seven-segment.d.ts +7 -0
- package/dist/seven-segment.js +137 -0
- package/dist/seven-segment.js.map +1 -0
- package/dist/templates/auto-clicker.d.ts +17 -0
- package/dist/templates/auto-clicker.js +19 -0
- package/dist/templates/auto-clicker.js.map +1 -0
- package/dist/templates/boot-button.d.ts +16 -0
- package/dist/templates/boot-button.js +18 -0
- package/dist/templates/boot-button.js.map +1 -0
- package/dist/templates/gateway.d.ts +16 -0
- package/dist/templates/gateway.js +18 -0
- package/dist/templates/gateway.js.map +1 -0
- package/dist/templates/index.d.ts +16 -0
- package/dist/templates/index.js +15 -0
- package/dist/templates/index.js.map +1 -0
- package/dist/templates/indicator.d.ts +16 -0
- package/dist/templates/indicator.js +18 -0
- package/dist/templates/indicator.js.map +1 -0
- package/dist/templates/reply-button.d.ts +16 -0
- package/dist/templates/reply-button.js +18 -0
- package/dist/templates/reply-button.js.map +1 -0
- package/dist/templates/seven-segment.d.ts +28 -0
- package/dist/templates/seven-segment.js +30 -0
- package/dist/templates/seven-segment.js.map +1 -0
- package/dist/uuid.d.ts +1 -0
- package/dist/uuid.js +21 -0
- package/dist/uuid.js.map +1 -0
- package/helps/scene/component/auto-clicker.ko.md +3 -0
- package/helps/scene/component/auto-clicker.md +3 -0
- package/helps/scene/component/auto-clicker.zh.md +3 -0
- package/helps/scene/component/boot-button.ko.md +3 -0
- package/helps/scene/component/boot-button.md +3 -0
- package/helps/scene/component/boot-button.zh.md +3 -0
- package/helps/scene/component/gateway.ko.md +3 -0
- package/helps/scene/component/gateway.md +3 -0
- package/helps/scene/component/gateway.zh.md +3 -0
- package/helps/scene/component/indicator.ko.md +3 -0
- package/helps/scene/component/indicator.md +3 -0
- package/helps/scene/component/indicator.zh.md +3 -0
- package/helps/scene/component/reply-button.ko.md +3 -0
- package/helps/scene/component/reply-button.md +3 -0
- package/helps/scene/component/reply-button.zh.md +3 -0
- package/helps/scene/component/seven-segment.ko.md +3 -0
- package/helps/scene/component/seven-segment.md +3 -0
- package/helps/scene/component/seven-segment.zh.md +3 -0
- package/icons/boot-button.png +0 -0
- package/icons/button-error.png +0 -0
- package/icons/button-start.png +0 -0
- package/icons/button-status.png +0 -0
- package/icons/button-stop.png +0 -0
- package/icons/gateway.png +0 -0
- package/icons/icon-boot-button.png +0 -0
- package/icons/icon-gateway.png +0 -0
- package/icons/icon-indicator.png +0 -0
- package/icons/icon-reply-button.png +0 -0
- package/icons/icon-seven-segment.png +0 -0
- package/icons/indicator.png +0 -0
- package/icons/no-image.png +0 -0
- package/icons/reply-button.png +0 -0
- package/package.json +61 -0
- package/src/auto-clicker.ts +97 -0
- package/src/boot-button.ts +112 -0
- package/src/gateway-on-button.ts +97 -0
- package/src/gateway-on-message.ts +405 -0
- package/src/gateway.ts +484 -0
- package/src/index.ts +6 -0
- package/src/indicator-on-message.ts +6 -0
- package/src/indicator-user-action.ts +292 -0
- package/src/indicator.ts +638 -0
- package/src/reply-button.ts +88 -0
- package/src/segment-display.ts +608 -0
- package/src/seven-segment.ts +162 -0
- package/src/templates/auto-clicker.ts +19 -0
- package/src/templates/boot-button.ts +18 -0
- package/src/templates/gateway.ts +18 -0
- package/src/templates/index.ts +15 -0
- package/src/templates/indicator.ts +18 -0
- package/src/templates/reply-button.ts +18 -0
- package/src/templates/seven-segment.ts +30 -0
- package/src/uuid.ts +20 -0
- package/things-scene.config.js +5 -0
- package/translations/en.json +26 -0
- package/translations/ja.json +26 -0
- package/translations/ko.json +26 -0
- package/translations/ms.json +23 -0
- package/translations/zh.json +23 -0
- package/tsconfig.json +22 -0
- package/tsconfig.tsbuildinfo +1 -0
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
import { consoleLogger } from './gateway-on-message';
|
|
2
|
+
const colors = {
|
|
3
|
+
R: '#f00',
|
|
4
|
+
G: '#0f0',
|
|
5
|
+
B: '#00f',
|
|
6
|
+
C: '#0ff',
|
|
7
|
+
M: '#f0f',
|
|
8
|
+
Y: '#ff0',
|
|
9
|
+
K: '#0000',
|
|
10
|
+
W: '#fff'
|
|
11
|
+
};
|
|
12
|
+
export function onMouseDownMButton(indicator) {
|
|
13
|
+
if (indicator.state.boot_flag != 'true' ||
|
|
14
|
+
!indicator.lit ||
|
|
15
|
+
indicator.readOnly ||
|
|
16
|
+
indicator.currentTask === indicator.tasks.FULL ||
|
|
17
|
+
indicator.currentTask === indicator.tasks.END ||
|
|
18
|
+
indicator.currentTask === indicator.tasks.INSPECT)
|
|
19
|
+
return;
|
|
20
|
+
// modify
|
|
21
|
+
consoleLogger('onMouseDownButton', 'M');
|
|
22
|
+
var displayData = {};
|
|
23
|
+
if (indicator.currentTask == 'modify') {
|
|
24
|
+
indicator.currentTask = indicator.tasks.PICK;
|
|
25
|
+
indicator.currentTask = indicator.store.action_type;
|
|
26
|
+
displayData.org_box_qty = indicator.store.org_box_qty;
|
|
27
|
+
displayData.org_ea_qty = indicator.store.org_ea_qty;
|
|
28
|
+
displayData.buttonColor = colors[indicator.store.color];
|
|
29
|
+
indicator.cookedData = displayData;
|
|
30
|
+
indicator.jobLightOn(displayData);
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
indicator.currentTask = indicator.tasks.MODIFY;
|
|
34
|
+
displayData.org_ea_qty = indicator.store.org_ea_qty;
|
|
35
|
+
displayData.org_box_qty = indicator.store.org_box_qty;
|
|
36
|
+
displayData.buttonColor = colors['M'];
|
|
37
|
+
indicator.cookedData = displayData;
|
|
38
|
+
indicator.jobLightOn(displayData);
|
|
39
|
+
}
|
|
40
|
+
// var boxQuan = indicator.store.org_box_qty
|
|
41
|
+
// ? indicator.store.org_box_qty
|
|
42
|
+
// : false;
|
|
43
|
+
// var eaQuan = indicator.store.org_ea_qty ? indicator.store.org_ea_qty : false;
|
|
44
|
+
// var isSame = true;
|
|
45
|
+
// var userAction = "modify";
|
|
46
|
+
// switch(indicator.currentTask) {
|
|
47
|
+
// case indicator.tasks.PICK: {
|
|
48
|
+
// var isQtyLessThenOne = (!indicator.store.org_box_qty && (indicator.store.org_ea_qty <= 1 || !indicator.store.org_ea_qty));
|
|
49
|
+
// if (isQtyLessThenOne) {
|
|
50
|
+
// userAction = 'ok';
|
|
51
|
+
// } else {
|
|
52
|
+
// do {
|
|
53
|
+
// if(boxQuan) boxQuan = Math.round(boxQuan * Math.random());
|
|
54
|
+
// if(eaQuan) eaQuan = Math.round(eaQuan * Math.random());
|
|
55
|
+
// isSame = (indicator.store.org_box_qty == boxQuan) && (indicator.store.org_ea_qty == eaQuan);
|
|
56
|
+
// } while(isSame);
|
|
57
|
+
// }
|
|
58
|
+
// } break;
|
|
59
|
+
// case indicator.tasks.STOCK: {
|
|
60
|
+
// if (boxQuan) boxQuan = Math.ceil(boxQuan * Math.random());
|
|
61
|
+
// if (eaQuan) eaQuan = Math.ceil(eaQuan * Math.random());
|
|
62
|
+
// } break;
|
|
63
|
+
// }
|
|
64
|
+
// boxQuan = Math.ceil(boxQuan / 2);
|
|
65
|
+
// eaQuan = Math.ceil(eaQuan / 2);
|
|
66
|
+
// isSame =
|
|
67
|
+
// boxQuan == indicator.store.org_box_qty &&
|
|
68
|
+
// eaQuan == indicator.store.org_ea_qty;
|
|
69
|
+
// isSame ? (userAction = "ok") : (userAction = "modify");
|
|
70
|
+
// indicator.gateway.passIndicatorsMessage(
|
|
71
|
+
// _makeMsgBody(
|
|
72
|
+
// indicator,
|
|
73
|
+
// "IND_ON_RES",
|
|
74
|
+
// indicator.store,
|
|
75
|
+
// userAction,
|
|
76
|
+
// boxQuan,
|
|
77
|
+
// eaQuan
|
|
78
|
+
// )
|
|
79
|
+
// );
|
|
80
|
+
// TODO 프로토콜 변경
|
|
81
|
+
}
|
|
82
|
+
export function onMouseDownFButton(indicator) {
|
|
83
|
+
if (indicator.state.boot_flag != 'true' ||
|
|
84
|
+
!indicator.lit ||
|
|
85
|
+
indicator.readOnly ||
|
|
86
|
+
indicator.currentTask == indicator.tasks.STOCK ||
|
|
87
|
+
indicator.currentTask === indicator.tasks.FULL)
|
|
88
|
+
return;
|
|
89
|
+
consoleLogger('onMouseDownButton', 'F');
|
|
90
|
+
if (indicator.currentTask == 'modify') {
|
|
91
|
+
var displayData = {};
|
|
92
|
+
// var orgEaQty = indicator.cookedData.res_ea_qty ? indicator.cookedData.res_ea_qty : 0;
|
|
93
|
+
displayData.org_ea_qty =
|
|
94
|
+
indicator.cookedData.org_ea_qty + 1 <= indicator.store.org_ea_qty ? indicator.cookedData.org_ea_qty + 1 : 0;
|
|
95
|
+
displayData.org_box_qty = indicator.store.org_box_qty;
|
|
96
|
+
displayData.buttonColor = colors['M'];
|
|
97
|
+
indicator.cookedData = displayData;
|
|
98
|
+
indicator.jobLightOn(displayData);
|
|
99
|
+
}
|
|
100
|
+
else {
|
|
101
|
+
// full box
|
|
102
|
+
if (indicator.state.reply_target == 'GraphQl') {
|
|
103
|
+
indicator.gateway.replyGraphQl.value = {
|
|
104
|
+
pubTopic: indicator.gateway.state.subTopic,
|
|
105
|
+
subTopic: indicator.gateway.state.pubTopic,
|
|
106
|
+
params: {
|
|
107
|
+
actionType: 'pick',
|
|
108
|
+
bizFlag: 'full',
|
|
109
|
+
action: 'IND_ON_RES',
|
|
110
|
+
bizType: 'DPS',
|
|
111
|
+
orgBoxQty: 0,
|
|
112
|
+
orgEaQty: 0,
|
|
113
|
+
id: indicator.store.id
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
else if ((indicator.state.reply_target = 'MQTT')) {
|
|
118
|
+
indicator.gateway.passIndicatorsMessage(_makeMsgBody(indicator, 'IND_ON_RES', indicator.store, 'full'));
|
|
119
|
+
}
|
|
120
|
+
// TODO ack 받으면 소등
|
|
121
|
+
// TODO 프로토콜 변경
|
|
122
|
+
indicator.displayMessage('-FULL-', indicator.store.color);
|
|
123
|
+
indicator.currentTask = indicator.tasks.FULL;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
export function onMouseDownCButton(indicator) {
|
|
127
|
+
if (indicator.state.boot_flag != 'true' ||
|
|
128
|
+
!indicator.lit ||
|
|
129
|
+
indicator.readOnly ||
|
|
130
|
+
indicator.currentTask == indicator.tasks.STOCK ||
|
|
131
|
+
indicator.currentTask === indicator.tasks.FULL ||
|
|
132
|
+
indicator.currentTask === indicator.tasks.END)
|
|
133
|
+
return;
|
|
134
|
+
consoleLogger('onMouseDownButton', 'C');
|
|
135
|
+
if (indicator.currentTask == 'modify') {
|
|
136
|
+
var displayData = {};
|
|
137
|
+
displayData.org_box_qty = indicator.store.org_box_qty;
|
|
138
|
+
displayData.org_ea_qty =
|
|
139
|
+
indicator.cookedData.org_ea_qty - 1 >= 0 ? indicator.cookedData.org_ea_qty - 1 : indicator.store.org_ea_qty;
|
|
140
|
+
displayData.buttonColor = colors['M'];
|
|
141
|
+
indicator.cookedData = displayData;
|
|
142
|
+
indicator.jobLightOn(displayData);
|
|
143
|
+
}
|
|
144
|
+
else {
|
|
145
|
+
// cancel
|
|
146
|
+
if (indicator.state.reply_target == 'GraphQl') {
|
|
147
|
+
indicator.gateway.replyGraphQl.value = {
|
|
148
|
+
pubTopic: indicator.gateway.state.subTopic,
|
|
149
|
+
subTopic: indicator.gateway.state.pubTopic,
|
|
150
|
+
params: {
|
|
151
|
+
actionType: 'pick',
|
|
152
|
+
bizFlag: 'cancel',
|
|
153
|
+
action: 'IND_ON_RES',
|
|
154
|
+
bizType: 'DPS',
|
|
155
|
+
orgBoxQty: indicator.store.org_box_qty ? indicator.store.org_box_qty : 0,
|
|
156
|
+
orgEaQty: 0,
|
|
157
|
+
resEaQty: 0,
|
|
158
|
+
id: indicator.store.id
|
|
159
|
+
}
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
else if ((indicator.state.reply_target = 'MQTT')) {
|
|
163
|
+
indicator.gateway.passIndicatorsMessage(_makeMsgBody(indicator, 'IND_ON_RES', indicator.store, 'cancel', 0, 0));
|
|
164
|
+
}
|
|
165
|
+
indicator.displayMessage('CAnCEL');
|
|
166
|
+
var displayData = {};
|
|
167
|
+
displayData.org_box_qty = indicator.store.org_box_qty ? indicator.store.org_box_qty : 0;
|
|
168
|
+
displayData.org_ea_qty = 0;
|
|
169
|
+
displayData.buttonColor = '';
|
|
170
|
+
indicator.cookedData = displayData;
|
|
171
|
+
indicator.jobLightOn(displayData);
|
|
172
|
+
// 일정 시간 후 소등
|
|
173
|
+
// setTimeout(() => {
|
|
174
|
+
// indicator.gateway.passIndicatorsMessage(
|
|
175
|
+
// _makeMsgBody(indicator, "IND_ON_RES", indicator.store, "cancel", 0, 0)
|
|
176
|
+
// );
|
|
177
|
+
// indicator.lightOff();
|
|
178
|
+
// }, indicator.getConf.cncl_delay * 100);
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
export function onMouseDownBigButton(indicator) {
|
|
182
|
+
// 작업자 버튼 터치
|
|
183
|
+
if (indicator.state.boot_flag != 'true' ||
|
|
184
|
+
!indicator.lit ||
|
|
185
|
+
indicator.readOnly ||
|
|
186
|
+
indicator.currentTask === indicator.tasks.END)
|
|
187
|
+
return;
|
|
188
|
+
consoleLogger('onMouseDownBigButton');
|
|
189
|
+
if (indicator.currentTask === indicator.tasks.FULL) {
|
|
190
|
+
indicator.jobLightOn(indicator.cookedData);
|
|
191
|
+
indicator.currentTask = indicator.tasks.DISPLAY;
|
|
192
|
+
return;
|
|
193
|
+
}
|
|
194
|
+
else if (indicator.currentTask === indicator.tasks.INSPECT) {
|
|
195
|
+
indicator.lightOff();
|
|
196
|
+
return;
|
|
197
|
+
}
|
|
198
|
+
else if (indicator.currentTask == 'modify') {
|
|
199
|
+
indicator.store.res_ea_qty = indicator.cookedData.org_ea_qty;
|
|
200
|
+
indicator.store.res_box_qty = indicator.cookedData.org_box_qty;
|
|
201
|
+
}
|
|
202
|
+
indicator.currentTask = indicator.tasks.END;
|
|
203
|
+
// 3.6 G/W에 정보 전송
|
|
204
|
+
// 3.7 MPS에 전달
|
|
205
|
+
if (indicator.state.reply_target == 'GraphQl') {
|
|
206
|
+
indicator.gateway.replyGraphQl.value = {
|
|
207
|
+
pubTopic: indicator.gateway.state.subTopic,
|
|
208
|
+
subTopic: indicator.gateway.state.pubTopic,
|
|
209
|
+
params: {
|
|
210
|
+
actionType: 'pick',
|
|
211
|
+
bizFlag: 'ok',
|
|
212
|
+
action: 'IND_ON_RES',
|
|
213
|
+
bizType: 'DPS',
|
|
214
|
+
id: indicator.store.id,
|
|
215
|
+
orgRelay: indicator.store.org_relay,
|
|
216
|
+
orgBoxQty: indicator.store.org_box_qty,
|
|
217
|
+
orgEaQty: indicator.store.org_ea_qty,
|
|
218
|
+
resBoxQty: indicator.store.org_box_qty,
|
|
219
|
+
resEaQty: indicator.store.org_ea_qty
|
|
220
|
+
}
|
|
221
|
+
};
|
|
222
|
+
}
|
|
223
|
+
else if ((indicator.state.reply_target = 'MQTT')) {
|
|
224
|
+
indicator.gateway.passIndicatorsMessage(_makeMsgBody(indicator, 'IND_ON_RES', indicator.store, 'ok', indicator.store.res_box_qty, indicator.store.res_ea_qty));
|
|
225
|
+
}
|
|
226
|
+
// TODO ack 받으면 소등
|
|
227
|
+
// 확정 누르면 오른쪽 세그먼트 숫자만 남기고 소등, display 시퀀스를 생략하기 위함
|
|
228
|
+
// TODO 프로토콜 변경
|
|
229
|
+
var displayData = {};
|
|
230
|
+
displayData.org_ea_qty = indicator.store.org_ea_qty;
|
|
231
|
+
displayData.org_box_qty = indicator.store.org_box_qty;
|
|
232
|
+
displayData.buttonColor = '';
|
|
233
|
+
indicator.cookedData = displayData;
|
|
234
|
+
indicator.jobLightOn(displayData);
|
|
235
|
+
}
|
|
236
|
+
var _makeMsgBody = function (indicator, action, store, biz, resBox, resEa) {
|
|
237
|
+
var { org_box_qty, org_ea_qty } = indicator.state;
|
|
238
|
+
var result;
|
|
239
|
+
result = {
|
|
240
|
+
action: action,
|
|
241
|
+
id: indicator.model.id,
|
|
242
|
+
biz_id: store ? store.biz_id : undefined,
|
|
243
|
+
biz_type: store.biz_type,
|
|
244
|
+
action_type: store.action_type,
|
|
245
|
+
ret_args: store.ret_args,
|
|
246
|
+
biz_flag: biz
|
|
247
|
+
};
|
|
248
|
+
if (store) {
|
|
249
|
+
if (store.org_relay || store.org_relay == 0) {
|
|
250
|
+
result.org_relay = parseInt(store.org_relay);
|
|
251
|
+
}
|
|
252
|
+
if (store.org_box_qty || store.org_box_qty == 0) {
|
|
253
|
+
result.org_box_qty = parseInt(store.org_box_qty);
|
|
254
|
+
result.res_box_qty = resBox >= 0 ? resBox : parseInt(store.org_box_qty);
|
|
255
|
+
}
|
|
256
|
+
if (store.org_ea_qty || store.org_ea_qty == 0) {
|
|
257
|
+
result.org_ea_qty = parseInt(store.org_ea_qty);
|
|
258
|
+
result.res_ea_qty = resEa >= 0 ? resEa : parseInt(store.org_ea_qty);
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
return result;
|
|
262
|
+
};
|
|
263
|
+
//# sourceMappingURL=indicator-user-action.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"indicator-user-action.js","sourceRoot":"","sources":["../src/indicator-user-action.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAGpD,MAAM,MAAM,GAAG;IACb,CAAC,EAAE,MAAM;IACT,CAAC,EAAE,MAAM;IACT,CAAC,EAAE,MAAM;IACT,CAAC,EAAE,MAAM;IACT,CAAC,EAAE,MAAM;IACT,CAAC,EAAE,MAAM;IACT,CAAC,EAAE,OAAO;IACV,CAAC,EAAE,MAAM;CACmB,CAAA;AAE9B,MAAM,UAAU,kBAAkB,CAAC,SAAoB;IACrD,IACE,SAAS,CAAC,KAAK,CAAC,SAAS,IAAI,MAAM;QACnC,CAAC,SAAS,CAAC,GAAG;QACd,SAAS,CAAC,QAAQ;QAClB,SAAS,CAAC,WAAW,KAAK,SAAS,CAAC,KAAK,CAAC,IAAI;QAC9C,SAAS,CAAC,WAAW,KAAK,SAAS,CAAC,KAAK,CAAC,GAAG;QAC7C,SAAS,CAAC,WAAW,KAAK,SAAS,CAAC,KAAK,CAAC,OAAO;QAEjD,OAAM;IACR,SAAS;IACT,aAAa,CAAC,mBAAmB,EAAE,GAAG,CAAC,CAAA;IACvC,IAAI,WAAW,GAAG,EAAS,CAAA;IAC3B,IAAI,SAAS,CAAC,WAAW,IAAI,QAAQ,EAAE,CAAC;QACtC,SAAS,CAAC,WAAW,GAAG,SAAS,CAAC,KAAK,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A;YAChD,MAAM,CAAC,WAAW,GAAG,MAAM,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,WAAW,CAAC,CAAA;QACzE,CAAC;QACD,IAAI,KAAK,CAAC,UAAU,IAAI,KAAK,CAAC,UAAU,IAAI,CAAC,EAAE,CAAC;YAC9C,MAAM,CAAC,UAAU,GAAG,QAAQ,CAAC,KAAK,CAAC,UAAU,CAAC,CAAA;YAC9C,MAAM,CAAC,UAAU,GAAG,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,UAAU,CAAC,CAAA;QACrE,CAAC;IACH,CAAC;IACD,OAAO,MAAM,CAAA;AACf,CAAC,CAAA","sourcesContent":["import { consoleLogger } from './gateway-on-message'\nimport Indicator from './indicator'\n\nconst colors = {\n R: '#f00',\n G: '#0f0',\n B: '#00f',\n C: '#0ff',\n M: '#f0f',\n Y: '#ff0',\n K: '#0000',\n W: '#fff'\n} as { [key: string]: string }\n\nexport function onMouseDownMButton(indicator: Indicator) {\n if (\n indicator.state.boot_flag != 'true' ||\n !indicator.lit ||\n indicator.readOnly ||\n indicator.currentTask === indicator.tasks.FULL ||\n indicator.currentTask === indicator.tasks.END ||\n indicator.currentTask === indicator.tasks.INSPECT\n )\n return\n // modify\n consoleLogger('onMouseDownButton', 'M')\n var displayData = {} as any\n if (indicator.currentTask == 'modify') {\n indicator.currentTask = indicator.tasks.PICK\n indicator.currentTask = indicator.store.action_type\n displayData.org_box_qty = indicator.store.org_box_qty\n displayData.org_ea_qty = indicator.store.org_ea_qty\n displayData.buttonColor = colors[indicator.store.color]\n indicator.cookedData = displayData\n indicator.jobLightOn(displayData)\n } else {\n indicator.currentTask = indicator.tasks.MODIFY\n displayData.org_ea_qty = indicator.store.org_ea_qty\n displayData.org_box_qty = indicator.store.org_box_qty\n displayData.buttonColor = colors['M']\n indicator.cookedData = displayData\n indicator.jobLightOn(displayData)\n }\n\n // var boxQuan = indicator.store.org_box_qty\n // ? indicator.store.org_box_qty\n // : false;\n // var eaQuan = indicator.store.org_ea_qty ? indicator.store.org_ea_qty : false;\n // var isSame = true;\n // var userAction = \"modify\";\n\n // switch(indicator.currentTask) {\n // case indicator.tasks.PICK: {\n // var isQtyLessThenOne = (!indicator.store.org_box_qty && (indicator.store.org_ea_qty <= 1 || !indicator.store.org_ea_qty));\n\n // if (isQtyLessThenOne) {\n // userAction = 'ok';\n // } else {\n // do {\n // if(boxQuan) boxQuan = Math.round(boxQuan * Math.random());\n // if(eaQuan) eaQuan = Math.round(eaQuan * Math.random());\n\n // isSame = (indicator.store.org_box_qty == boxQuan) && (indicator.store.org_ea_qty == eaQuan);\n // } while(isSame);\n // }\n // } break;\n // case indicator.tasks.STOCK: {\n // if (boxQuan) boxQuan = Math.ceil(boxQuan * Math.random());\n // if (eaQuan) eaQuan = Math.ceil(eaQuan * Math.random());\n // } break;\n // }\n\n // boxQuan = Math.ceil(boxQuan / 2);\n // eaQuan = Math.ceil(eaQuan / 2);\n\n // isSame =\n // boxQuan == indicator.store.org_box_qty &&\n // eaQuan == indicator.store.org_ea_qty;\n\n // isSame ? (userAction = \"ok\") : (userAction = \"modify\");\n\n // indicator.gateway.passIndicatorsMessage(\n // _makeMsgBody(\n // indicator,\n // \"IND_ON_RES\",\n // indicator.store,\n // userAction,\n // boxQuan,\n // eaQuan\n // )\n // );\n // TODO 프로토콜 변경\n}\n\nexport function onMouseDownFButton(indicator: Indicator) {\n if (\n indicator.state.boot_flag != 'true' ||\n !indicator.lit ||\n indicator.readOnly ||\n indicator.currentTask == indicator.tasks.STOCK ||\n indicator.currentTask === indicator.tasks.FULL\n )\n return\n consoleLogger('onMouseDownButton', 'F')\n\n if (indicator.currentTask == 'modify') {\n var displayData = {} as any\n // var orgEaQty = indicator.cookedData.res_ea_qty ? indicator.cookedData.res_ea_qty : 0;\n displayData.org_ea_qty =\n indicator.cookedData.org_ea_qty + 1 <= indicator.store.org_ea_qty ? indicator.cookedData.org_ea_qty + 1 : 0\n displayData.org_box_qty = indicator.store.org_box_qty\n displayData.buttonColor = colors['M']\n indicator.cookedData = displayData\n indicator.jobLightOn(displayData)\n } else {\n // full box\n if (indicator.state.reply_target == 'GraphQl') {\n indicator.gateway.replyGraphQl!.value = {\n pubTopic: indicator.gateway.state.subTopic,\n subTopic: indicator.gateway.state.pubTopic,\n params: {\n actionType: 'pick',\n bizFlag: 'full',\n action: 'IND_ON_RES',\n bizType: 'DPS',\n orgBoxQty: 0,\n orgEaQty: 0,\n id: indicator.store.id\n }\n }\n } else if ((indicator.state.reply_target = 'MQTT')) {\n indicator.gateway.passIndicatorsMessage(_makeMsgBody(indicator, 'IND_ON_RES', indicator.store, 'full'))\n }\n // TODO ack 받으면 소등\n // TODO 프로토콜 변경\n indicator.displayMessage('-FULL-', indicator.store.color)\n indicator.currentTask = indicator.tasks.FULL\n }\n}\n\nexport function onMouseDownCButton(indicator: Indicator) {\n if (\n indicator.state.boot_flag != 'true' ||\n !indicator.lit ||\n indicator.readOnly ||\n indicator.currentTask == indicator.tasks.STOCK ||\n indicator.currentTask === indicator.tasks.FULL ||\n indicator.currentTask === indicator.tasks.END\n )\n return\n consoleLogger('onMouseDownButton', 'C')\n if (indicator.currentTask == 'modify') {\n var displayData = {} as any\n displayData.org_box_qty = indicator.store.org_box_qty\n displayData.org_ea_qty =\n indicator.cookedData.org_ea_qty - 1 >= 0 ? indicator.cookedData.org_ea_qty - 1 : indicator.store.org_ea_qty\n displayData.buttonColor = colors['M']\n indicator.cookedData = displayData\n indicator.jobLightOn(displayData)\n } else {\n // cancel\n if (indicator.state.reply_target == 'GraphQl') {\n indicator.gateway.replyGraphQl!.value = {\n pubTopic: indicator.gateway.state.subTopic,\n subTopic: indicator.gateway.state.pubTopic,\n params: {\n actionType: 'pick',\n bizFlag: 'cancel',\n action: 'IND_ON_RES',\n bizType: 'DPS',\n orgBoxQty: indicator.store.org_box_qty ? indicator.store.org_box_qty : 0,\n orgEaQty: 0,\n resEaQty: 0,\n id: indicator.store.id\n }\n }\n } else if ((indicator.state.reply_target = 'MQTT')) {\n indicator.gateway.passIndicatorsMessage(_makeMsgBody(indicator, 'IND_ON_RES', indicator.store, 'cancel', 0, 0))\n }\n indicator.displayMessage('CAnCEL')\n var displayData = {} as any\n displayData.org_box_qty = indicator.store.org_box_qty ? indicator.store.org_box_qty : 0\n displayData.org_ea_qty = 0\n displayData.buttonColor = ''\n indicator.cookedData = displayData\n indicator.jobLightOn(displayData)\n\n // 일정 시간 후 소등\n // setTimeout(() => {\n // indicator.gateway.passIndicatorsMessage(\n // _makeMsgBody(indicator, \"IND_ON_RES\", indicator.store, \"cancel\", 0, 0)\n // );\n // indicator.lightOff();\n // }, indicator.getConf.cncl_delay * 100);\n }\n}\n\nexport function onMouseDownBigButton(indicator: Indicator) {\n // 작업자 버튼 터치\n if (\n indicator.state.boot_flag != 'true' ||\n !indicator.lit ||\n indicator.readOnly ||\n indicator.currentTask === indicator.tasks.END\n )\n return\n consoleLogger('onMouseDownBigButton')\n if (indicator.currentTask === indicator.tasks.FULL) {\n indicator.jobLightOn(indicator.cookedData)\n indicator.currentTask = indicator.tasks.DISPLAY\n return\n } else if (indicator.currentTask === indicator.tasks.INSPECT) {\n indicator.lightOff()\n return\n } else if (indicator.currentTask == 'modify') {\n indicator.store.res_ea_qty = indicator.cookedData.org_ea_qty\n indicator.store.res_box_qty = indicator.cookedData.org_box_qty\n }\n indicator.currentTask = indicator.tasks.END\n // 3.6 G/W에 정보 전송\n // 3.7 MPS에 전달\n\n if (indicator.state.reply_target == 'GraphQl') {\n indicator.gateway.replyGraphQl!.value = {\n pubTopic: indicator.gateway.state.subTopic,\n subTopic: indicator.gateway.state.pubTopic,\n params: {\n actionType: 'pick',\n bizFlag: 'ok',\n action: 'IND_ON_RES',\n bizType: 'DPS',\n id: indicator.store.id,\n orgRelay: indicator.store.org_relay,\n orgBoxQty: indicator.store.org_box_qty,\n orgEaQty: indicator.store.org_ea_qty,\n resBoxQty: indicator.store.org_box_qty,\n resEaQty: indicator.store.org_ea_qty\n }\n }\n } else if ((indicator.state.reply_target = 'MQTT')) {\n indicator.gateway.passIndicatorsMessage(\n _makeMsgBody(\n indicator,\n 'IND_ON_RES',\n indicator.store,\n 'ok',\n indicator.store.res_box_qty,\n indicator.store.res_ea_qty\n )\n )\n }\n\n // TODO ack 받으면 소등\n\n // 확정 누르면 오른쪽 세그먼트 숫자만 남기고 소등, display 시퀀스를 생략하기 위함\n // TODO 프로토콜 변경\n var displayData = {} as any\n displayData.org_ea_qty = indicator.store.org_ea_qty\n displayData.org_box_qty = indicator.store.org_box_qty\n displayData.buttonColor = ''\n indicator.cookedData = displayData\n indicator.jobLightOn(displayData)\n}\n\nvar _makeMsgBody = function (indicator: Indicator, action: any, store: any, biz: any, resBox?: any, resEa?: any) {\n var { org_box_qty, org_ea_qty } = indicator.state\n\n var result\n result = {\n action: action,\n id: indicator.model.id,\n biz_id: store ? store.biz_id : undefined,\n biz_type: store.biz_type,\n action_type: store.action_type,\n ret_args: store.ret_args,\n biz_flag: biz\n } as any\n if (store) {\n if (store.org_relay || store.org_relay == 0) {\n result.org_relay = parseInt(store.org_relay)\n }\n if (store.org_box_qty || store.org_box_qty == 0) {\n result.org_box_qty = parseInt(store.org_box_qty)\n result.res_box_qty = resBox >= 0 ? resBox : parseInt(store.org_box_qty)\n }\n if (store.org_ea_qty || store.org_ea_qty == 0) {\n result.org_ea_qty = parseInt(store.org_ea_qty)\n result.res_ea_qty = resEa >= 0 ? resEa : parseInt(store.org_ea_qty)\n }\n }\n return result\n}\n"]}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { Component, ComponentNature, Shape } from '@hatiolab/things-scene';
|
|
2
|
+
import SegmentDisplay from './segment-display';
|
|
3
|
+
import Gateway from './gateway';
|
|
4
|
+
declare const Indicator_base: typeof Shape;
|
|
5
|
+
export default class Indicator extends Indicator_base {
|
|
6
|
+
lit: boolean;
|
|
7
|
+
ledLit: boolean;
|
|
8
|
+
store: any;
|
|
9
|
+
conf: any;
|
|
10
|
+
currentTask: string;
|
|
11
|
+
cookedData: any;
|
|
12
|
+
readOnly?: boolean;
|
|
13
|
+
version?: any;
|
|
14
|
+
static _image: HTMLImageElement;
|
|
15
|
+
static get image(): HTMLImageElement;
|
|
16
|
+
get colors(): {
|
|
17
|
+
[key: string]: string;
|
|
18
|
+
};
|
|
19
|
+
get btnModes(): {
|
|
20
|
+
BLINK: string;
|
|
21
|
+
ALWAYS: string;
|
|
22
|
+
};
|
|
23
|
+
get tasks(): {
|
|
24
|
+
[key: string]: string;
|
|
25
|
+
};
|
|
26
|
+
get alignmentOptions(): {
|
|
27
|
+
LEFT: string;
|
|
28
|
+
RIGHT: string;
|
|
29
|
+
};
|
|
30
|
+
get segmentRoles(): {
|
|
31
|
+
RELAY_SEQ: {
|
|
32
|
+
INITIAL: string;
|
|
33
|
+
KEY: string;
|
|
34
|
+
};
|
|
35
|
+
BOXES: {
|
|
36
|
+
INITIAL: string;
|
|
37
|
+
KEY: string;
|
|
38
|
+
};
|
|
39
|
+
PCS: {
|
|
40
|
+
INITIAL: string;
|
|
41
|
+
KEY: string;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
get getConf(): any;
|
|
45
|
+
set setConf(conf: any);
|
|
46
|
+
get gateway(): Gateway;
|
|
47
|
+
get ledRect(): Component;
|
|
48
|
+
dispose(): void;
|
|
49
|
+
/**
|
|
50
|
+
*
|
|
51
|
+
* @param {array} args
|
|
52
|
+
*/
|
|
53
|
+
setSegmentsState(args: any[]): void;
|
|
54
|
+
/**
|
|
55
|
+
*
|
|
56
|
+
* @param {object} data
|
|
57
|
+
*/
|
|
58
|
+
jobLightOn(data: any, lit?: boolean): void;
|
|
59
|
+
/**
|
|
60
|
+
*
|
|
61
|
+
* @param {object} data
|
|
62
|
+
*/
|
|
63
|
+
lightOn(data: any, lit?: boolean): void;
|
|
64
|
+
lightOff(): void;
|
|
65
|
+
/**
|
|
66
|
+
*
|
|
67
|
+
* @param {string} msg
|
|
68
|
+
* @param {string} color
|
|
69
|
+
*/
|
|
70
|
+
displayMessage(msg: string, color?: string, lit?: boolean): void;
|
|
71
|
+
rectButtonContains(x: number, y: number, WRATE: number, HRATE: number): boolean;
|
|
72
|
+
mfcButtonContains(x: number, y: number, WRATE: number, HRATE: number): "M" | "F" | "C" | undefined;
|
|
73
|
+
onmousedown(e: MouseEvent, hint: any): void;
|
|
74
|
+
get displays(): SegmentDisplay[];
|
|
75
|
+
_drawRectButton(context: CanvasRenderingContext2D, WRATE: number, HRATE: number, color: string): void;
|
|
76
|
+
_drawMFCButton(context: CanvasRenderingContext2D, WRATE: number, HRATE: number): void;
|
|
77
|
+
render(context: CanvasRenderingContext2D): void;
|
|
78
|
+
onchangeData(after: any, before: any): void;
|
|
79
|
+
get hasTextProperty(): boolean;
|
|
80
|
+
get nature(): ComponentNature;
|
|
81
|
+
onButton(): void;
|
|
82
|
+
}
|
|
83
|
+
export {};
|