@danidoble/webserial 4.0.2 → 4.0.4
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/dist/webserial.js +476 -466
- package/dist/webserial.umd.cjs +3 -3
- package/package.json +1 -1
package/dist/webserial.js
CHANGED
|
@@ -38,9 +38,9 @@ class Pe extends EventTarget {
|
|
|
38
38
|
this.dispatchEvent(n);
|
|
39
39
|
}
|
|
40
40
|
dispatchAsync(t, e = null, n = 100) {
|
|
41
|
-
const
|
|
41
|
+
const s = this;
|
|
42
42
|
setTimeout(() => {
|
|
43
|
-
|
|
43
|
+
s.dispatch(t, e);
|
|
44
44
|
}, n);
|
|
45
45
|
}
|
|
46
46
|
on(t, e) {
|
|
@@ -73,18 +73,18 @@ function Ne() {
|
|
|
73
73
|
function we(f = 1) {
|
|
74
74
|
return f * 1e3;
|
|
75
75
|
}
|
|
76
|
-
var
|
|
77
|
-
const
|
|
76
|
+
var R, H, o, Ae, Be, _, ke, C, m, ne, p, ve, Y;
|
|
77
|
+
const a = class a {
|
|
78
78
|
static status(r = null) {
|
|
79
79
|
var e, n;
|
|
80
|
-
if (!i(e =
|
|
80
|
+
if (!i(e = a, o, _).call(e, r)) return !1;
|
|
81
81
|
let t = [];
|
|
82
|
-
switch (y(
|
|
82
|
+
switch (y(a, R)) {
|
|
83
83
|
case "locker":
|
|
84
84
|
t = ["0", "8"];
|
|
85
85
|
break;
|
|
86
86
|
case "boardroid":
|
|
87
|
-
t = ["2", (5 + y(
|
|
87
|
+
t = ["2", (5 + y(a, H)).toString(16).toUpperCase()];
|
|
88
88
|
break;
|
|
89
89
|
case "jofemar":
|
|
90
90
|
t = ["6"];
|
|
@@ -92,13 +92,13 @@ const s = class s {
|
|
|
92
92
|
default:
|
|
93
93
|
return !1;
|
|
94
94
|
}
|
|
95
|
-
i(n =
|
|
95
|
+
i(n = a, o, p).call(n, t);
|
|
96
96
|
}
|
|
97
97
|
static dispensed(r = null) {
|
|
98
98
|
var e, n;
|
|
99
|
-
if (!i(e =
|
|
99
|
+
if (!i(e = a, o, _).call(e, r)) return !1;
|
|
100
100
|
let t = [];
|
|
101
|
-
switch (y(
|
|
101
|
+
switch (y(a, R)) {
|
|
102
102
|
case "locker":
|
|
103
103
|
t = ["0", "7", "4", "4", "4"];
|
|
104
104
|
break;
|
|
@@ -111,13 +111,13 @@ const s = class s {
|
|
|
111
111
|
default:
|
|
112
112
|
return !1;
|
|
113
113
|
}
|
|
114
|
-
i(n =
|
|
114
|
+
i(n = a, o, p).call(n, t);
|
|
115
115
|
}
|
|
116
116
|
static notDispensed(r = null) {
|
|
117
117
|
var e, n;
|
|
118
|
-
if (!i(e =
|
|
118
|
+
if (!i(e = a, o, _).call(e, r)) return !1;
|
|
119
119
|
let t = [];
|
|
120
|
-
switch (y(
|
|
120
|
+
switch (y(a, R)) {
|
|
121
121
|
case "locker":
|
|
122
122
|
t = ["0", "7", "5", "5", "5"];
|
|
123
123
|
break;
|
|
@@ -130,30 +130,30 @@ const s = class s {
|
|
|
130
130
|
default:
|
|
131
131
|
return !1;
|
|
132
132
|
}
|
|
133
|
-
i(n =
|
|
133
|
+
i(n = a, o, p).call(n, t);
|
|
134
134
|
}
|
|
135
135
|
static gateInactive(r = null) {
|
|
136
136
|
var t;
|
|
137
|
-
if (!i(t =
|
|
137
|
+
if (!i(t = a, o, _).call(t, r) || !i(this, o, ke).call(this)) return !1;
|
|
138
138
|
i(this, o, p).call(this, ["0", "7", "5", "5", "5"]);
|
|
139
139
|
}
|
|
140
140
|
static gateConfigured(r = null) {
|
|
141
141
|
var t;
|
|
142
|
-
if (!i(t =
|
|
142
|
+
if (!i(t = a, o, _).call(t, r) || !i(this, o, ke).call(this)) return !1;
|
|
143
143
|
i(this, o, p).call(this, ["0", "6"]);
|
|
144
144
|
}
|
|
145
145
|
static keyPressed(r = null) {
|
|
146
|
-
var
|
|
147
|
-
if (!i(
|
|
148
|
-
const t = ["30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "2A", "23", "41", "42", "43", "44"], e = (128 + y(
|
|
149
|
-
i(u =
|
|
146
|
+
var s, c, u;
|
|
147
|
+
if (!i(s = a, o, _).call(s, r) || !i(c = a, o, m).call(c)) return !1;
|
|
148
|
+
const t = ["30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "2A", "23", "41", "42", "43", "44"], e = (128 + y(a, H)).toString(16), n = Math.floor(Math.random() * 15);
|
|
149
|
+
i(u = a, o, p).call(u, ["2", e, "54", t[n]]);
|
|
150
150
|
}
|
|
151
151
|
static doorOpened(r = null) {
|
|
152
|
-
var n,
|
|
153
|
-
if (!i(n =
|
|
152
|
+
var n, s;
|
|
153
|
+
if (!i(n = a, o, _).call(n, r) || !i(this, o, ne).call(this)) return !1;
|
|
154
154
|
let t = [];
|
|
155
|
-
const e = (128 + y(
|
|
156
|
-
switch (y(
|
|
155
|
+
const e = (128 + y(a, H)).toString(16);
|
|
156
|
+
switch (y(a, R)) {
|
|
157
157
|
case "boardroid":
|
|
158
158
|
t = ["2", "D8", "dc"];
|
|
159
159
|
break;
|
|
@@ -161,14 +161,14 @@ const s = class s {
|
|
|
161
161
|
t = ["2", e, "50", "4F"];
|
|
162
162
|
break;
|
|
163
163
|
}
|
|
164
|
-
i(
|
|
164
|
+
i(s = a, o, p).call(s, t);
|
|
165
165
|
}
|
|
166
166
|
static doorClosed(r = null) {
|
|
167
|
-
var n,
|
|
168
|
-
if (!i(n =
|
|
167
|
+
var n, s;
|
|
168
|
+
if (!i(n = a, o, _).call(n, r) || !i(this, o, ne).call(this)) return !1;
|
|
169
169
|
let t = [];
|
|
170
|
-
const e = (128 + y(
|
|
171
|
-
switch (y(
|
|
170
|
+
const e = (128 + y(a, H)).toString(16);
|
|
171
|
+
switch (y(a, R)) {
|
|
172
172
|
case "boardroid":
|
|
173
173
|
t = ["2", "D8", "db"];
|
|
174
174
|
break;
|
|
@@ -176,38 +176,38 @@ const s = class s {
|
|
|
176
176
|
t = ["2", e, "50", "43"];
|
|
177
177
|
break;
|
|
178
178
|
}
|
|
179
|
-
i(
|
|
179
|
+
i(s = a, o, p).call(s, t);
|
|
180
180
|
}
|
|
181
181
|
static channelDisconnected(r = null) {
|
|
182
|
-
var e, n,
|
|
183
|
-
if (!i(e =
|
|
184
|
-
const t = (128 + y(
|
|
185
|
-
i(
|
|
182
|
+
var e, n, s;
|
|
183
|
+
if (!i(e = a, o, _).call(e, r) || !i(n = a, o, m).call(n)) return !1;
|
|
184
|
+
const t = (128 + y(a, H)).toString(16);
|
|
185
|
+
i(s = a, o, p).call(s, ["2", t, "43", "43", "43", "FD"]);
|
|
186
186
|
}
|
|
187
187
|
static channelConnected(r = null) {
|
|
188
|
-
var e, n,
|
|
189
|
-
if (!i(e =
|
|
190
|
-
const t = (128 + y(
|
|
191
|
-
i(
|
|
188
|
+
var e, n, s;
|
|
189
|
+
if (!i(e = a, o, _).call(e, r) || !i(n = a, o, m).call(n)) return !1;
|
|
190
|
+
const t = (128 + y(a, H)).toString(16);
|
|
191
|
+
i(s = a, o, p).call(s, ["2", t, "43", "43", "43", "FC"]);
|
|
192
192
|
}
|
|
193
193
|
static channelEmpty(r = null) {
|
|
194
|
-
var e, n,
|
|
195
|
-
if (!i(e =
|
|
196
|
-
const t = (128 + y(
|
|
197
|
-
i(
|
|
194
|
+
var e, n, s;
|
|
195
|
+
if (!i(e = a, o, _).call(e, r) || !i(n = a, o, m).call(n)) return !1;
|
|
196
|
+
const t = (128 + y(a, H)).toString(16);
|
|
197
|
+
i(s = a, o, p).call(s, ["2", t, "43", "43", "43", "FF"]);
|
|
198
198
|
}
|
|
199
199
|
static workingTemperature(r = null) {
|
|
200
|
-
var e, n,
|
|
201
|
-
if (!i(e =
|
|
202
|
-
const t = (128 + y(
|
|
203
|
-
i(
|
|
200
|
+
var e, n, s;
|
|
201
|
+
if (!i(e = a, o, _).call(e, r) || !i(n = a, o, m).call(n)) return !1;
|
|
202
|
+
const t = (128 + y(a, H)).toString(16);
|
|
203
|
+
i(s = a, o, p).call(s, ["2", t, "43", "54", "16"]);
|
|
204
204
|
}
|
|
205
205
|
static currentTemperature(r = null) {
|
|
206
|
-
var n,
|
|
207
|
-
if (!i(n =
|
|
206
|
+
var n, s, c;
|
|
207
|
+
if (!i(n = a, o, _).call(n, r) || !i(s = a, o, ne).call(s)) return !1;
|
|
208
208
|
let t = [];
|
|
209
|
-
const e = (128 + y(
|
|
210
|
-
switch (y(
|
|
209
|
+
const e = (128 + y(a, H)).toString(16);
|
|
210
|
+
switch (y(a, R)) {
|
|
211
211
|
case "boardroid":
|
|
212
212
|
t = ["2", "D9", "44", "30"];
|
|
213
213
|
break;
|
|
@@ -215,218 +215,218 @@ const s = class s {
|
|
|
215
215
|
t = ["2", e, "43", "74", "2B", "30", "39", "2E", "31", "7F", "43"];
|
|
216
216
|
break;
|
|
217
217
|
}
|
|
218
|
-
i(c =
|
|
218
|
+
i(c = a, o, p).call(c, t);
|
|
219
219
|
}
|
|
220
220
|
static ready(r = null) {
|
|
221
221
|
var t, e, n;
|
|
222
|
-
if (!i(t =
|
|
223
|
-
i(n =
|
|
222
|
+
if (!i(t = a, o, _).call(t, r) || !i(e = a, o, m).call(e)) return !1;
|
|
223
|
+
i(n = a, o, p).call(n, ["6", "30"]);
|
|
224
224
|
}
|
|
225
225
|
static busy(r = null) {
|
|
226
226
|
var t, e, n;
|
|
227
|
-
if (!i(t =
|
|
228
|
-
i(n =
|
|
227
|
+
if (!i(t = a, o, _).call(t, r) || !i(e = a, o, m).call(e)) return !1;
|
|
228
|
+
i(n = a, o, p).call(n, ["6", "31"]);
|
|
229
229
|
}
|
|
230
230
|
static invalidTray(r = null) {
|
|
231
231
|
var t, e, n;
|
|
232
|
-
if (!i(t =
|
|
233
|
-
i(n =
|
|
232
|
+
if (!i(t = a, o, _).call(t, r) || !i(e = a, o, m).call(e)) return !1;
|
|
233
|
+
i(n = a, o, p).call(n, ["6", "32"]);
|
|
234
234
|
}
|
|
235
235
|
static invalidChannel(r = null) {
|
|
236
236
|
var t, e, n;
|
|
237
|
-
if (!i(t =
|
|
238
|
-
i(n =
|
|
237
|
+
if (!i(t = a, o, _).call(t, r) || !i(e = a, o, m).call(e)) return !1;
|
|
238
|
+
i(n = a, o, p).call(n, ["6", "33"]);
|
|
239
239
|
}
|
|
240
240
|
static emptyChannel(r = null) {
|
|
241
241
|
var t, e, n;
|
|
242
|
-
if (!i(t =
|
|
243
|
-
i(n =
|
|
242
|
+
if (!i(t = a, o, _).call(t, r) || !i(e = a, o, m).call(e)) return !1;
|
|
243
|
+
i(n = a, o, p).call(n, ["6", "34"]);
|
|
244
244
|
}
|
|
245
245
|
static elevatorJam(r = null) {
|
|
246
246
|
var t, e, n;
|
|
247
|
-
if (!i(t =
|
|
248
|
-
i(n =
|
|
247
|
+
if (!i(t = a, o, _).call(t, r) || !i(e = a, o, m).call(e)) return !1;
|
|
248
|
+
i(n = a, o, p).call(n, ["6", "35"]);
|
|
249
249
|
}
|
|
250
250
|
static elevatorMalfunction(r = null) {
|
|
251
251
|
var t, e, n;
|
|
252
|
-
if (!i(t =
|
|
253
|
-
i(n =
|
|
252
|
+
if (!i(t = a, o, _).call(t, r) || !i(e = a, o, m).call(e)) return !1;
|
|
253
|
+
i(n = a, o, p).call(n, ["6", "36"]);
|
|
254
254
|
}
|
|
255
255
|
static phototransistorFailure(r = null) {
|
|
256
256
|
var t, e, n;
|
|
257
|
-
if (!i(t =
|
|
258
|
-
i(n =
|
|
257
|
+
if (!i(t = a, o, _).call(t, r) || !i(e = a, o, m).call(e)) return !1;
|
|
258
|
+
i(n = a, o, p).call(n, ["6", "37"]);
|
|
259
259
|
}
|
|
260
260
|
static allChannelsEmpty(r = null) {
|
|
261
261
|
var t, e, n;
|
|
262
|
-
if (!i(t =
|
|
263
|
-
i(n =
|
|
262
|
+
if (!i(t = a, o, _).call(t, r) || !i(e = a, o, m).call(e)) return !1;
|
|
263
|
+
i(n = a, o, p).call(n, ["6", "38"]);
|
|
264
264
|
}
|
|
265
265
|
static productDetectorFailure(r = null) {
|
|
266
266
|
var t, e, n;
|
|
267
|
-
if (!i(t =
|
|
268
|
-
i(n =
|
|
267
|
+
if (!i(t = a, o, _).call(t, r) || !i(e = a, o, m).call(e)) return !1;
|
|
268
|
+
i(n = a, o, p).call(n, ["6", "39"]);
|
|
269
269
|
}
|
|
270
270
|
static displayDisconnected(r = null) {
|
|
271
271
|
var t, e, n;
|
|
272
|
-
if (!i(t =
|
|
273
|
-
i(n =
|
|
272
|
+
if (!i(t = a, o, _).call(t, r) || !i(e = a, o, m).call(e)) return !1;
|
|
273
|
+
i(n = a, o, p).call(n, ["6", "41"]);
|
|
274
274
|
}
|
|
275
275
|
static productUnderElevator(r = null) {
|
|
276
276
|
var t, e, n;
|
|
277
|
-
if (!i(t =
|
|
278
|
-
i(n =
|
|
277
|
+
if (!i(t = a, o, _).call(t, r) || !i(e = a, o, m).call(e)) return !1;
|
|
278
|
+
i(n = a, o, p).call(n, ["6", "42"]);
|
|
279
279
|
}
|
|
280
280
|
static elevatorSettingAlarm(r = null) {
|
|
281
281
|
var t, e, n;
|
|
282
|
-
if (!i(t =
|
|
283
|
-
i(n =
|
|
282
|
+
if (!i(t = a, o, _).call(t, r) || !i(e = a, o, m).call(e)) return !1;
|
|
283
|
+
i(n = a, o, p).call(n, ["6", "43"]);
|
|
284
284
|
}
|
|
285
285
|
static buttonPanelFailure(r = null) {
|
|
286
286
|
var t, e, n;
|
|
287
|
-
if (!i(t =
|
|
288
|
-
i(n =
|
|
287
|
+
if (!i(t = a, o, _).call(t, r) || !i(e = a, o, m).call(e)) return !1;
|
|
288
|
+
i(n = a, o, p).call(n, ["6", "44"]);
|
|
289
289
|
}
|
|
290
290
|
static errorWritingEeprom(r = null) {
|
|
291
291
|
var t, e, n;
|
|
292
|
-
if (!i(t =
|
|
293
|
-
i(n =
|
|
292
|
+
if (!i(t = a, o, _).call(t, r) || !i(e = a, o, m).call(e)) return !1;
|
|
293
|
+
i(n = a, o, p).call(n, ["6", "45"]);
|
|
294
294
|
}
|
|
295
295
|
static errorControlTemperature(r = null) {
|
|
296
296
|
var t, e, n;
|
|
297
|
-
if (!i(t =
|
|
298
|
-
i(n =
|
|
297
|
+
if (!i(t = a, o, _).call(t, r) || !i(e = a, o, m).call(e)) return !1;
|
|
298
|
+
i(n = a, o, p).call(n, ["6", "46"]);
|
|
299
299
|
}
|
|
300
300
|
static thermometerDisconnected(r = null) {
|
|
301
301
|
var t, e, n;
|
|
302
|
-
if (!i(t =
|
|
303
|
-
i(n =
|
|
302
|
+
if (!i(t = a, o, _).call(t, r) || !i(e = a, o, m).call(e)) return !1;
|
|
303
|
+
i(n = a, o, p).call(n, ["6", "47"]);
|
|
304
304
|
}
|
|
305
305
|
static thermometerMisconfigured(r = null) {
|
|
306
306
|
var t, e, n;
|
|
307
|
-
if (!i(t =
|
|
308
|
-
i(n =
|
|
307
|
+
if (!i(t = a, o, _).call(t, r) || !i(e = a, o, m).call(e)) return !1;
|
|
308
|
+
i(n = a, o, p).call(n, ["6", "48"]);
|
|
309
309
|
}
|
|
310
310
|
static thermometerFailure(r = null) {
|
|
311
311
|
var t, e, n;
|
|
312
|
-
if (!i(t =
|
|
313
|
-
i(n =
|
|
312
|
+
if (!i(t = a, o, _).call(t, r) || !i(e = a, o, m).call(e)) return !1;
|
|
313
|
+
i(n = a, o, p).call(n, ["6", "49"]);
|
|
314
314
|
}
|
|
315
315
|
static errorExtractorConsumption(r = null) {
|
|
316
316
|
var t, e, n;
|
|
317
|
-
if (!i(t =
|
|
318
|
-
i(n =
|
|
317
|
+
if (!i(t = a, o, _).call(t, r) || !i(e = a, o, m).call(e)) return !1;
|
|
318
|
+
i(n = a, o, p).call(n, ["6", "4A"]);
|
|
319
319
|
}
|
|
320
320
|
static channelSearchError(r = null) {
|
|
321
321
|
var t, e, n;
|
|
322
|
-
if (!i(t =
|
|
323
|
-
i(n =
|
|
322
|
+
if (!i(t = a, o, _).call(t, r) || !i(e = a, o, m).call(e)) return !1;
|
|
323
|
+
i(n = a, o, p).call(n, ["6", "4B"]);
|
|
324
324
|
}
|
|
325
325
|
static productExitMouthSearchError(r = null) {
|
|
326
326
|
var t, e, n;
|
|
327
|
-
if (!i(t =
|
|
328
|
-
i(n =
|
|
327
|
+
if (!i(t = a, o, _).call(t, r) || !i(e = a, o, m).call(e)) return !1;
|
|
328
|
+
i(n = a, o, p).call(n, ["6", "4C"]);
|
|
329
329
|
}
|
|
330
330
|
static elevatorInteriorLocked(r = null) {
|
|
331
331
|
var t, e, n;
|
|
332
|
-
if (!i(t =
|
|
333
|
-
i(n =
|
|
332
|
+
if (!i(t = a, o, _).call(t, r) || !i(e = a, o, m).call(e)) return !1;
|
|
333
|
+
i(n = a, o, p).call(n, ["6", "4D"]);
|
|
334
334
|
}
|
|
335
335
|
static productDetectorVerifierError(r = null) {
|
|
336
336
|
var t, e, n;
|
|
337
|
-
if (!i(t =
|
|
338
|
-
i(n =
|
|
337
|
+
if (!i(t = a, o, _).call(t, r) || !i(e = a, o, m).call(e)) return !1;
|
|
338
|
+
i(n = a, o, p).call(n, ["6", "4E"]);
|
|
339
339
|
}
|
|
340
340
|
static waitingForProductRecall(r = null) {
|
|
341
341
|
var t, e, n;
|
|
342
|
-
if (!i(t =
|
|
343
|
-
i(n =
|
|
342
|
+
if (!i(t = a, o, _).call(t, r) || !i(e = a, o, m).call(e)) return !1;
|
|
343
|
+
i(n = a, o, p).call(n, ["6", "4F"]);
|
|
344
344
|
}
|
|
345
345
|
static productExpiredByTemperature(r = null) {
|
|
346
346
|
var t, e, n;
|
|
347
|
-
if (!i(t =
|
|
348
|
-
i(n =
|
|
347
|
+
if (!i(t = a, o, _).call(t, r) || !i(e = a, o, m).call(e)) return !1;
|
|
348
|
+
i(n = a, o, p).call(n, ["6", "50"]);
|
|
349
349
|
}
|
|
350
350
|
static faultyAutomaticDoor(r = null) {
|
|
351
351
|
var t, e, n;
|
|
352
|
-
if (!i(t =
|
|
353
|
-
i(n =
|
|
352
|
+
if (!i(t = a, o, _).call(t, r) || !i(e = a, o, m).call(e)) return !1;
|
|
353
|
+
i(n = a, o, p).call(n, ["6", "51"]);
|
|
354
354
|
}
|
|
355
355
|
static rejectLever(r = null) {
|
|
356
356
|
var t, e, n;
|
|
357
|
-
if (!i(t =
|
|
358
|
-
i(n =
|
|
357
|
+
if (!i(t = a, o, _).call(t, r) || !i(e = a, o, C).call(e)) return !1;
|
|
358
|
+
i(n = a, o, p).call(n, ["2", "A0", "1"]);
|
|
359
359
|
}
|
|
360
360
|
static resetCoinPurse(r = null) {
|
|
361
361
|
var t, e, n;
|
|
362
|
-
if (!i(t =
|
|
363
|
-
i(n =
|
|
362
|
+
if (!i(t = a, o, _).call(t, r) || !i(e = a, o, C).call(e)) return !1;
|
|
363
|
+
i(n = a, o, p).call(n, ["2", "A0", "2"]);
|
|
364
364
|
}
|
|
365
365
|
static coinInsertedBox(r = null, t = null) {
|
|
366
|
-
var
|
|
367
|
-
if (!i(
|
|
368
|
-
const e = ["40", "41", "42", "43", "44", "45"], n = i(u =
|
|
369
|
-
i(
|
|
366
|
+
var s, c, u, d;
|
|
367
|
+
if (!i(s = a, o, _).call(s, r) || !i(c = a, o, C).call(c)) return !1;
|
|
368
|
+
const e = ["40", "41", "42", "43", "44", "45"], n = i(u = a, o, ve).call(u, e, t);
|
|
369
|
+
i(d = a, o, p).call(d, ["2", "A0", n]);
|
|
370
370
|
}
|
|
371
371
|
static coinInsertedTube(r = null, t = null) {
|
|
372
|
-
var
|
|
373
|
-
if (!i(
|
|
374
|
-
const e = ["50", "51", "52", "53", "54", "55"], n = i(u =
|
|
375
|
-
i(
|
|
372
|
+
var s, c, u, d;
|
|
373
|
+
if (!i(s = a, o, _).call(s, r) || !i(c = a, o, C).call(c)) return !1;
|
|
374
|
+
const e = ["50", "51", "52", "53", "54", "55"], n = i(u = a, o, ve).call(u, e, t);
|
|
375
|
+
i(d = a, o, p).call(d, ["2", "A0", n]);
|
|
376
376
|
}
|
|
377
377
|
static banknoteInsertedStacker(r = null, t = null) {
|
|
378
|
-
var
|
|
379
|
-
if (!i(
|
|
380
|
-
const e = ["80", "81", "82", "83", "84"], n = i(u =
|
|
381
|
-
i(
|
|
378
|
+
var s, c, u, d;
|
|
379
|
+
if (!i(s = a, o, _).call(s, r) || !i(c = a, o, C).call(c)) return !1;
|
|
380
|
+
const e = ["80", "81", "82", "83", "84"], n = i(u = a, o, Y).call(u, e, t);
|
|
381
|
+
i(d = a, o, p).call(d, ["2", "B0", n]);
|
|
382
382
|
}
|
|
383
383
|
static banknoteInsertedEscrow(r = null, t = null) {
|
|
384
|
-
var
|
|
385
|
-
if (!i(
|
|
386
|
-
const e = ["90", "91", "92", "93", "94"], n = i(u =
|
|
387
|
-
i(
|
|
384
|
+
var s, c, u, d;
|
|
385
|
+
if (!i(s = a, o, _).call(s, r) || !i(c = a, o, C).call(c)) return !1;
|
|
386
|
+
const e = ["90", "91", "92", "93", "94"], n = i(u = a, o, Y).call(u, e, t);
|
|
387
|
+
i(d = a, o, p).call(d, ["2", "B0", n]);
|
|
388
388
|
}
|
|
389
389
|
static banknoteEjected(r = null, t = null) {
|
|
390
|
-
var
|
|
391
|
-
if (!i(
|
|
392
|
-
const e = ["A0", "A1", "A2", "A3", "A4"], n = i(u =
|
|
393
|
-
i(
|
|
390
|
+
var s, c, u, d;
|
|
391
|
+
if (!i(s = a, o, _).call(s, r) || !i(c = a, o, C).call(c)) return !1;
|
|
392
|
+
const e = ["A0", "A1", "A2", "A3", "A4"], n = i(u = a, o, Y).call(u, e, t);
|
|
393
|
+
i(d = a, o, p).call(d, ["2", "B0", n]);
|
|
394
394
|
}
|
|
395
395
|
static banknoteInsertedRecycler(r = null, t = null) {
|
|
396
|
-
var
|
|
397
|
-
if (!i(
|
|
398
|
-
const e = ["B0", "B1", "B2", "B3", "B4"], n = i(u =
|
|
399
|
-
i(
|
|
396
|
+
var s, c, u, d;
|
|
397
|
+
if (!i(s = a, o, _).call(s, r) || !i(c = a, o, C).call(c)) return !1;
|
|
398
|
+
const e = ["B0", "B1", "B2", "B3", "B4"], n = i(u = a, o, Y).call(u, e, t);
|
|
399
|
+
i(d = a, o, p).call(d, ["2", "B0", n]);
|
|
400
400
|
}
|
|
401
401
|
static banknoteTaken(r = null) {
|
|
402
402
|
var t, e, n;
|
|
403
|
-
if (!i(t =
|
|
404
|
-
i(n =
|
|
403
|
+
if (!i(t = a, o, _).call(t, r) || !i(e = a, o, C).call(e)) return !1;
|
|
404
|
+
i(n = a, o, p).call(n, ["2", "B0", "2a"]);
|
|
405
405
|
}
|
|
406
406
|
static coinPurseEnabled(r = null) {
|
|
407
407
|
var t, e, n;
|
|
408
|
-
if (!i(t =
|
|
409
|
-
i(n =
|
|
408
|
+
if (!i(t = a, o, _).call(t, r) || !i(e = a, o, C).call(e)) return !1;
|
|
409
|
+
i(n = a, o, p).call(n, ["2", "D0", "1"]);
|
|
410
410
|
}
|
|
411
411
|
static coinPurseDisabled(r = null) {
|
|
412
412
|
var t, e, n;
|
|
413
|
-
if (!i(t =
|
|
414
|
-
i(n =
|
|
413
|
+
if (!i(t = a, o, _).call(t, r) || !i(e = a, o, C).call(e)) return !1;
|
|
414
|
+
i(n = a, o, p).call(n, ["2", "D0", "0"]);
|
|
415
415
|
}
|
|
416
416
|
static billPurseDisabled(r = null) {
|
|
417
417
|
var t, e, n;
|
|
418
|
-
if (!i(t =
|
|
419
|
-
i(n =
|
|
418
|
+
if (!i(t = a, o, _).call(t, r) || !i(e = a, o, C).call(e)) return !1;
|
|
419
|
+
i(n = a, o, p).call(n, ["2", "D1", "0", "0"]);
|
|
420
420
|
}
|
|
421
421
|
static billPurseEnabled(r = null) {
|
|
422
422
|
var t, e, n;
|
|
423
|
-
if (!i(t =
|
|
424
|
-
i(n =
|
|
423
|
+
if (!i(t = a, o, _).call(t, r) || !i(e = a, o, C).call(e)) return !1;
|
|
424
|
+
i(n = a, o, p).call(n, ["2", "D1", "1", "1"]);
|
|
425
425
|
}
|
|
426
426
|
static readTubes(r = null) {
|
|
427
427
|
var b, g, T;
|
|
428
|
-
if (!i(b =
|
|
429
|
-
const t = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "1a", "1b", "1c", "1d", "1e", "1f"], [e, n,
|
|
428
|
+
if (!i(b = a, o, _).call(b, r) || !i(g = a, o, C).call(g)) return !1;
|
|
429
|
+
const t = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "1a", "1b", "1c", "1d", "1e", "1f"], [e, n, s, c, u, d] = [
|
|
430
430
|
t[Math.floor(Math.random() * 30)],
|
|
431
431
|
t[Math.floor(Math.random() * 30)],
|
|
432
432
|
t[Math.floor(Math.random() * 30)],
|
|
@@ -434,54 +434,54 @@ const s = class s {
|
|
|
434
434
|
t[Math.floor(Math.random() * 30)],
|
|
435
435
|
t[Math.floor(Math.random() * 30)]
|
|
436
436
|
];
|
|
437
|
-
i(T =
|
|
437
|
+
i(T = a, o, p).call(T, ["2", "D2", e, n, s, c, u, d]);
|
|
438
438
|
}
|
|
439
439
|
static readBillPurse(r = null, t = null) {
|
|
440
|
-
var n,
|
|
441
|
-
if (!i(n =
|
|
440
|
+
var n, s, c, u;
|
|
441
|
+
if (!i(n = a, o, _).call(n, r) || !i(s = a, o, C).call(s)) return !1;
|
|
442
442
|
let e = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "1a", "1b", "1c"];
|
|
443
443
|
if (r._recycler.ict) {
|
|
444
|
-
const
|
|
444
|
+
const d = e[Math.floor(Math.random() * 31)];
|
|
445
445
|
let b = "0", g = "0", T = "0", I = "0", U = "0";
|
|
446
446
|
if (t !== null && !isNaN(parseInt(t)))
|
|
447
447
|
switch (t.toString()) {
|
|
448
448
|
case "20":
|
|
449
|
-
b =
|
|
449
|
+
b = d;
|
|
450
450
|
break;
|
|
451
451
|
case "50":
|
|
452
|
-
g =
|
|
452
|
+
g = d;
|
|
453
453
|
break;
|
|
454
454
|
case "100":
|
|
455
|
-
T =
|
|
455
|
+
T = d;
|
|
456
456
|
break;
|
|
457
457
|
case "200":
|
|
458
|
-
I =
|
|
458
|
+
I = d;
|
|
459
459
|
break;
|
|
460
460
|
case "500":
|
|
461
|
-
U =
|
|
461
|
+
U = d;
|
|
462
462
|
break;
|
|
463
463
|
}
|
|
464
464
|
else
|
|
465
465
|
switch (r._recycler.bill) {
|
|
466
466
|
case 0:
|
|
467
|
-
b =
|
|
467
|
+
b = d;
|
|
468
468
|
break;
|
|
469
469
|
case 1:
|
|
470
|
-
g =
|
|
470
|
+
g = d;
|
|
471
471
|
break;
|
|
472
472
|
case 2:
|
|
473
|
-
T =
|
|
473
|
+
T = d;
|
|
474
474
|
break;
|
|
475
475
|
case 3:
|
|
476
|
-
I =
|
|
476
|
+
I = d;
|
|
477
477
|
break;
|
|
478
478
|
case 4:
|
|
479
|
-
U =
|
|
479
|
+
U = d;
|
|
480
480
|
break;
|
|
481
481
|
}
|
|
482
|
-
i(c =
|
|
482
|
+
i(c = a, o, p).call(c, ["2", "D3", b, g, T, I, U, "0"]);
|
|
483
483
|
} else {
|
|
484
|
-
const [
|
|
484
|
+
const [d, b, g, T, I, U] = [
|
|
485
485
|
e[Math.floor(Math.random() * 30)],
|
|
486
486
|
e[Math.floor(Math.random() * 30)],
|
|
487
487
|
e[Math.floor(Math.random() * 30)],
|
|
@@ -489,29 +489,29 @@ const s = class s {
|
|
|
489
489
|
e[Math.floor(Math.random())],
|
|
490
490
|
e[Math.floor(Math.random())]
|
|
491
491
|
];
|
|
492
|
-
i(u =
|
|
492
|
+
i(u = a, o, p).call(u, ["2", "D3", d, b, g, T, I, U]);
|
|
493
493
|
}
|
|
494
494
|
}
|
|
495
495
|
static banknoteAccepted(r = null) {
|
|
496
496
|
var t, e, n;
|
|
497
|
-
if (!i(t =
|
|
498
|
-
i(n =
|
|
497
|
+
if (!i(t = a, o, _).call(t, r) || !i(e = a, o, C).call(e)) return !1;
|
|
498
|
+
i(n = a, o, p).call(n, ["2", "D4", "1"]);
|
|
499
499
|
}
|
|
500
500
|
static banknoteRejected(r = null) {
|
|
501
501
|
var t, e, n;
|
|
502
|
-
if (!i(t =
|
|
503
|
-
i(n =
|
|
502
|
+
if (!i(t = a, o, _).call(t, r) || !i(e = a, o, C).call(e)) return !1;
|
|
503
|
+
i(n = a, o, p).call(n, ["2", "D4", "0"]);
|
|
504
504
|
}
|
|
505
505
|
static banknotesDispensed(r = null) {
|
|
506
|
-
var e, n,
|
|
507
|
-
if (!i(e =
|
|
506
|
+
var e, n, s, c;
|
|
507
|
+
if (!i(e = a, o, _).call(e, r) || !i(n = a, o, C).call(n)) return !1;
|
|
508
508
|
let t = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "1a", "1b", "1c"];
|
|
509
509
|
if (r._recycler.ict) {
|
|
510
510
|
const u = t[Math.floor(Math.random() * 30)];
|
|
511
|
-
let
|
|
511
|
+
let d = "0", b = "0", g = "0", T = "0", I = "0";
|
|
512
512
|
switch (r._recycler.bill) {
|
|
513
513
|
case 0:
|
|
514
|
-
|
|
514
|
+
d = u;
|
|
515
515
|
break;
|
|
516
516
|
case 1:
|
|
517
517
|
b = u;
|
|
@@ -526,9 +526,9 @@ const s = class s {
|
|
|
526
526
|
I = u;
|
|
527
527
|
break;
|
|
528
528
|
}
|
|
529
|
-
i(
|
|
529
|
+
i(s = a, o, p).call(s, ["2", "D5", d, b, g, T, I, "0"]);
|
|
530
530
|
} else {
|
|
531
|
-
const [u,
|
|
531
|
+
const [u, d, b, g, T, I] = [
|
|
532
532
|
t[Math.floor(Math.random() * 30)],
|
|
533
533
|
t[Math.floor(Math.random() * 30)],
|
|
534
534
|
t[Math.floor(Math.random() * 30)],
|
|
@@ -536,108 +536,108 @@ const s = class s {
|
|
|
536
536
|
t[Math.floor(Math.random())],
|
|
537
537
|
t[Math.floor(Math.random())]
|
|
538
538
|
];
|
|
539
|
-
i(c =
|
|
539
|
+
i(c = a, o, p).call(c, ["2", "D5", u, d, b, g, T, I]);
|
|
540
540
|
}
|
|
541
541
|
}
|
|
542
542
|
static coinsDispensed(r = null) {
|
|
543
543
|
var t, e, n;
|
|
544
|
-
if (!i(t =
|
|
545
|
-
i(n =
|
|
544
|
+
if (!i(t = a, o, _).call(t, r) || !i(e = a, o, C).call(e)) return !1;
|
|
545
|
+
i(n = a, o, p).call(n, ["2", "D6"]);
|
|
546
546
|
}
|
|
547
547
|
static relayOn(r = null) {
|
|
548
548
|
var t, e, n;
|
|
549
|
-
if (!i(t =
|
|
550
|
-
i(n =
|
|
549
|
+
if (!i(t = a, o, _).call(t, r) || !i(e = a, o, C).call(e)) return !1;
|
|
550
|
+
i(n = a, o, p).call(n, ["2", "DA", "1"]);
|
|
551
551
|
}
|
|
552
552
|
static relayOff(r = null) {
|
|
553
553
|
var t, e, n;
|
|
554
|
-
if (!i(t =
|
|
555
|
-
i(n =
|
|
554
|
+
if (!i(t = a, o, _).call(t, r) || !i(e = a, o, C).call(e)) return !1;
|
|
555
|
+
i(n = a, o, p).call(n, ["2", "DA", "0"]);
|
|
556
556
|
}
|
|
557
557
|
static nayaxEnabled(r = null) {
|
|
558
558
|
var t, e, n;
|
|
559
|
-
if (!i(t =
|
|
560
|
-
i(n =
|
|
559
|
+
if (!i(t = a, o, _).call(t, r) || !i(e = a, o, C).call(e)) return !1;
|
|
560
|
+
i(n = a, o, p).call(n, ["2", "DD", "1"]);
|
|
561
561
|
}
|
|
562
562
|
static nayaxDisabled(r = null) {
|
|
563
563
|
var t, e, n;
|
|
564
|
-
if (!i(t =
|
|
565
|
-
i(n =
|
|
564
|
+
if (!i(t = a, o, _).call(t, r) || !i(e = a, o, C).call(e)) return !1;
|
|
565
|
+
i(n = a, o, p).call(n, ["2", "DD", "0"]);
|
|
566
566
|
}
|
|
567
567
|
static nayaxPreCreditAuthorized(r = null) {
|
|
568
568
|
var t, e, n;
|
|
569
|
-
if (!i(t =
|
|
570
|
-
i(n =
|
|
569
|
+
if (!i(t = a, o, _).call(t, r) || !i(e = a, o, C).call(e)) return !1;
|
|
570
|
+
i(n = a, o, p).call(n, ["2", "DD", "3"]);
|
|
571
571
|
}
|
|
572
572
|
static nayaxCancelRequest(r = null) {
|
|
573
573
|
var t, e, n;
|
|
574
|
-
if (!i(t =
|
|
575
|
-
i(n =
|
|
574
|
+
if (!i(t = a, o, _).call(t, r) || !i(e = a, o, C).call(e)) return !1;
|
|
575
|
+
i(n = a, o, p).call(n, ["2", "DD", "4"]);
|
|
576
576
|
}
|
|
577
577
|
static nayaxSellApproved(r = null) {
|
|
578
578
|
var t, e, n;
|
|
579
|
-
if (!i(t =
|
|
580
|
-
i(n =
|
|
579
|
+
if (!i(t = a, o, _).call(t, r) || !i(e = a, o, C).call(e)) return !1;
|
|
580
|
+
i(n = a, o, p).call(n, ["2", "DD", "5"]);
|
|
581
581
|
}
|
|
582
582
|
static nayaxSellDenied(r = null) {
|
|
583
583
|
var t, e, n;
|
|
584
|
-
if (!i(t =
|
|
585
|
-
i(n =
|
|
584
|
+
if (!i(t = a, o, _).call(t, r) || !i(e = a, o, C).call(e)) return !1;
|
|
585
|
+
i(n = a, o, p).call(n, ["2", "DD", "6"]);
|
|
586
586
|
}
|
|
587
587
|
static nayaxEndSession(r = null) {
|
|
588
588
|
var t, e, n;
|
|
589
|
-
if (!i(t =
|
|
590
|
-
i(n =
|
|
589
|
+
if (!i(t = a, o, _).call(t, r) || !i(e = a, o, C).call(e)) return !1;
|
|
590
|
+
i(n = a, o, p).call(n, ["2", "DD", "7"]);
|
|
591
591
|
}
|
|
592
592
|
static nayaxCancelled(r = null) {
|
|
593
593
|
var t, e, n;
|
|
594
|
-
if (!i(t =
|
|
595
|
-
i(n =
|
|
594
|
+
if (!i(t = a, o, _).call(t, r) || !i(e = a, o, C).call(e)) return !1;
|
|
595
|
+
i(n = a, o, p).call(n, ["2", "DD", "8"]);
|
|
596
596
|
}
|
|
597
597
|
static nayaxDispensed(r = null) {
|
|
598
598
|
var t, e, n;
|
|
599
|
-
if (!i(t =
|
|
600
|
-
i(n =
|
|
599
|
+
if (!i(t = a, o, _).call(t, r) || !i(e = a, o, C).call(e)) return !1;
|
|
600
|
+
i(n = a, o, p).call(n, ["2", "DD", "A", "0"]);
|
|
601
601
|
}
|
|
602
602
|
static nayaxNotDispensed(r = null) {
|
|
603
603
|
var t, e, n;
|
|
604
|
-
if (!i(t =
|
|
605
|
-
i(n =
|
|
604
|
+
if (!i(t = a, o, _).call(t, r) || !i(e = a, o, C).call(e)) return !1;
|
|
605
|
+
i(n = a, o, p).call(n, ["2", "DD", "A", "1"]);
|
|
606
606
|
}
|
|
607
607
|
static fullTray(r = null) {
|
|
608
608
|
var t, e, n;
|
|
609
|
-
if (!i(t =
|
|
610
|
-
i(n =
|
|
609
|
+
if (!i(t = a, o, _).call(t, r) || !i(e = a, o, m).call(e)) return !1;
|
|
610
|
+
i(n = a, o, p).call(n, ["6", "4F"]);
|
|
611
611
|
}
|
|
612
612
|
static setConnection(r = null) {
|
|
613
613
|
var t;
|
|
614
|
-
if (!i(t =
|
|
614
|
+
if (!i(t = a, o, _).call(t, r)) return !1;
|
|
615
615
|
r.__internal__.serial.connected = !0;
|
|
616
616
|
}
|
|
617
617
|
};
|
|
618
|
-
|
|
619
|
-
if (
|
|
620
|
-
return
|
|
618
|
+
R = new WeakMap(), H = new WeakMap(), o = new WeakSet(), Ae = function() {
|
|
619
|
+
if (a.enable === !1) throw new Error("Emulator is disabled");
|
|
620
|
+
return a.enable;
|
|
621
621
|
}, Be = function(r) {
|
|
622
622
|
if (typeof r != "object" || !(r instanceof G)) throw new Error(`Type ${r.typeDevice} is not supported`);
|
|
623
|
-
return
|
|
623
|
+
return a.instance = r, x(a, R, r.typeDevice), x(a, H, r.deviceNumber), !0;
|
|
624
624
|
}, _ = function(r = null) {
|
|
625
625
|
var t, e;
|
|
626
|
-
return !i(t =
|
|
626
|
+
return !i(t = a, o, Ae).call(t) || r === null && a.instance === null ? !1 : (a.instance === null && i(e = a, o, Be).call(e, r), !0);
|
|
627
627
|
}, ke = function() {
|
|
628
|
-
if (y(
|
|
628
|
+
if (y(a, R) !== "locker") throw new Error("This function is only available for Locker devices");
|
|
629
629
|
return !0;
|
|
630
630
|
}, C = function() {
|
|
631
|
-
if (y(
|
|
631
|
+
if (y(a, R) !== "boardroid") throw new Error("This function is only available for Boardroid devices");
|
|
632
632
|
return !0;
|
|
633
633
|
}, m = function() {
|
|
634
|
-
if (y(
|
|
634
|
+
if (y(a, R) !== "jofemar") throw new Error("This function is only available for Jofemar devices");
|
|
635
635
|
return !0;
|
|
636
636
|
}, ne = function() {
|
|
637
|
-
if (y(
|
|
637
|
+
if (y(a, R) === "locker") throw new Error("This function is not available for Locker devices");
|
|
638
638
|
return !0;
|
|
639
639
|
}, p = function(r) {
|
|
640
|
-
|
|
640
|
+
a.instance.__emulate({ code: r });
|
|
641
641
|
}, ve = function(r, t = null) {
|
|
642
642
|
let e = r[Math.floor(Math.random() * 5)];
|
|
643
643
|
if (t !== null && !isNaN(parseFloat(t)))
|
|
@@ -680,8 +680,8 @@ q = new WeakMap(), H = new WeakMap(), o = new WeakSet(), Ae = function() {
|
|
|
680
680
|
break;
|
|
681
681
|
}
|
|
682
682
|
return e;
|
|
683
|
-
}, S(
|
|
684
|
-
let pe =
|
|
683
|
+
}, S(a, o), A(a, "enable", !1), A(a, "instance", null), S(a, R, null), S(a, H, 1);
|
|
684
|
+
let pe = a;
|
|
685
685
|
const k = class k extends Pe {
|
|
686
686
|
static typeError(r) {
|
|
687
687
|
const t = new Error();
|
|
@@ -748,7 +748,7 @@ A(k, "instance", null), A(k, "devices", {
|
|
|
748
748
|
});
|
|
749
749
|
let D = k;
|
|
750
750
|
D.instance || (D.instance = new D());
|
|
751
|
-
var w,
|
|
751
|
+
var w, qe, me, $, Re, He, Le, Oe, Ue, je, We, $e, Qe, Ve, Je, ze;
|
|
752
752
|
class G extends Pe {
|
|
753
753
|
/**
|
|
754
754
|
*
|
|
@@ -761,7 +761,7 @@ class G extends Pe {
|
|
|
761
761
|
filters: t = null,
|
|
762
762
|
config_port: e = null,
|
|
763
763
|
no_device: n = 1,
|
|
764
|
-
device_listen_on_port:
|
|
764
|
+
device_listen_on_port: s = 1
|
|
765
765
|
} = {}) {
|
|
766
766
|
super();
|
|
767
767
|
S(this, w);
|
|
@@ -804,6 +804,7 @@ class G extends Pe {
|
|
|
804
804
|
time: {
|
|
805
805
|
response_connection: 500,
|
|
806
806
|
response_general: 2e3,
|
|
807
|
+
response_engines: 2e3,
|
|
807
808
|
sense: 100
|
|
808
809
|
},
|
|
809
810
|
timeout: {
|
|
@@ -814,6 +815,7 @@ class G extends Pe {
|
|
|
814
815
|
waiting_sense: 0
|
|
815
816
|
},
|
|
816
817
|
dispense: {
|
|
818
|
+
must_response: !1,
|
|
817
819
|
dispensing: !1,
|
|
818
820
|
status: null,
|
|
819
821
|
counter: 0,
|
|
@@ -822,7 +824,7 @@ class G extends Pe {
|
|
|
822
824
|
backup_dispense: {}
|
|
823
825
|
}
|
|
824
826
|
});
|
|
825
|
-
t && (this.serialFilters = t), e && (this.serialConfigPort = e), n && i(this, w, Je).call(this, n),
|
|
827
|
+
t && (this.serialFilters = t), e && (this.serialConfigPort = e), n && i(this, w, Je).call(this, n), s && (typeof s == "number" || typeof s == "string") && (this.listenOnPort = s), i(this, w, We).call(this), i(this, w, $e).call(this);
|
|
826
828
|
}
|
|
827
829
|
set listenOnPort(t) {
|
|
828
830
|
if (t = parseInt(t), isNaN(t) || t < 1 || t > 255) throw new Error("Invalid port number");
|
|
@@ -884,7 +886,7 @@ class G extends Pe {
|
|
|
884
886
|
async serialDisconnect() {
|
|
885
887
|
try {
|
|
886
888
|
const t = this.__internal__.serial.reader, e = this.__internal__.serial.output_stream;
|
|
887
|
-
t && (await t.cancel().catch((
|
|
889
|
+
t && (await t.cancel().catch((s) => this.serialErrors(s)), await this.__internal__.serial.input_done), e && (await e.getWriter().close(), await this.__internal__.serial.output_done), this.__internal__.serial.connected && this.__internal__.serial && await this.__internal__.serial.port.close();
|
|
888
890
|
} catch (t) {
|
|
889
891
|
this.serialErrors(t);
|
|
890
892
|
} finally {
|
|
@@ -946,20 +948,20 @@ class G extends Pe {
|
|
|
946
948
|
async serialConnect() {
|
|
947
949
|
try {
|
|
948
950
|
this.dispatch("serial:connecting", {});
|
|
949
|
-
const t = await i(this, w,
|
|
951
|
+
const t = await i(this, w, Re).call(this);
|
|
950
952
|
if (t.length > 0)
|
|
951
953
|
await this.serialPortsSaved(t);
|
|
952
954
|
else {
|
|
953
|
-
const
|
|
954
|
-
this.__internal__.serial.port = await navigator.serial.requestPort({ filters:
|
|
955
|
+
const s = this.serialFilters;
|
|
956
|
+
this.__internal__.serial.port = await navigator.serial.requestPort({ filters: s });
|
|
955
957
|
}
|
|
956
958
|
const e = this.__internal__.serial.port;
|
|
957
959
|
await e.open(this.serialConfigPort);
|
|
958
960
|
const n = this;
|
|
959
|
-
e.onconnect = (
|
|
960
|
-
n.dispatch("serial:connected",
|
|
961
|
-
}, e.ondisconnect = async (
|
|
962
|
-
await n.disconnect(
|
|
961
|
+
e.onconnect = (s) => {
|
|
962
|
+
n.dispatch("serial:connected", s.detail), D.instance.dispatch("change"), n.__internal__.serial.queue.length > 0 && n.dispatch("internal:queue", {});
|
|
963
|
+
}, e.ondisconnect = async (s) => {
|
|
964
|
+
await n.disconnect(s.detail ?? null);
|
|
963
965
|
}, await W(this.__internal__.serial.delay_first_connection), this.__internal__.timeout.until_response = setTimeout(async () => {
|
|
964
966
|
await n.timeout(n.__internal__.serial.bytes_connection, "connection:start");
|
|
965
967
|
}, this.__internal__.time.response_connection), await i(this, w, me).call(this, this.__internal__.serial.bytes_connection), this.dispatch("serial:sent", {
|
|
@@ -984,8 +986,8 @@ class G extends Pe {
|
|
|
984
986
|
}
|
|
985
987
|
add0x(t) {
|
|
986
988
|
let e = [];
|
|
987
|
-
return t.forEach((n,
|
|
988
|
-
e[
|
|
989
|
+
return t.forEach((n, s) => {
|
|
990
|
+
e[s] = "0x" + n;
|
|
989
991
|
}), e;
|
|
990
992
|
}
|
|
991
993
|
bytesToHex(t) {
|
|
@@ -1046,6 +1048,8 @@ class G extends Pe {
|
|
|
1046
1048
|
}), null);
|
|
1047
1049
|
}
|
|
1048
1050
|
async internalDispenseStatus() {
|
|
1051
|
+
if (this.__internal__.dispense.must_response && (await W(this.__internal__.time.response_engines + 10), this.__internal__.dispense.status === "no-response"))
|
|
1052
|
+
return this.internalClearSensing(), this.__internal__.dispense.status = !1, this.dispatch("not-dispensed", { reason: "no-response" }), { status: !1, error: "no-response" };
|
|
1049
1053
|
this.__internal__.dispense.status = null, this.__internal__.dispense.dispensing = !0, this.dispatch("internal:dispense:running", {});
|
|
1050
1054
|
const t = this;
|
|
1051
1055
|
return new Promise((e) => {
|
|
@@ -1078,8 +1082,8 @@ class G extends Pe {
|
|
|
1078
1082
|
const n = setInterval(async () => {
|
|
1079
1083
|
if (this.__internal__.serial.queue.length > 0) return;
|
|
1080
1084
|
clearInterval(n), await this.appendToQueue(t, "dispense");
|
|
1081
|
-
const
|
|
1082
|
-
e(
|
|
1085
|
+
const s = await this.internalDispenseStatus();
|
|
1086
|
+
e(s);
|
|
1083
1087
|
}, 100);
|
|
1084
1088
|
});
|
|
1085
1089
|
}
|
|
@@ -1113,7 +1117,7 @@ class G extends Pe {
|
|
|
1113
1117
|
await this.appendToQueue(t, "custom");
|
|
1114
1118
|
}
|
|
1115
1119
|
}
|
|
1116
|
-
w = new WeakSet(),
|
|
1120
|
+
w = new WeakSet(), qe = function(t) {
|
|
1117
1121
|
return !!(t.readable && t.writable);
|
|
1118
1122
|
}, me = async function(t) {
|
|
1119
1123
|
const e = this.__internal__.serial.port;
|
|
@@ -1122,8 +1126,8 @@ w = new WeakSet(), Re = function(t) {
|
|
|
1122
1126
|
return;
|
|
1123
1127
|
throw new Error("The port is closed.");
|
|
1124
1128
|
}
|
|
1125
|
-
const n = new Uint8Array(t),
|
|
1126
|
-
await
|
|
1129
|
+
const n = new Uint8Array(t), s = e.writable.getWriter();
|
|
1130
|
+
await s.write(n), s.releaseLock();
|
|
1127
1131
|
}, // #bytesToLowerCase(code = []) {
|
|
1128
1132
|
// return code.map((item) => item.toString().toLowerCase());
|
|
1129
1133
|
// }
|
|
@@ -1131,18 +1135,18 @@ $ = function(t = [], e = null) {
|
|
|
1131
1135
|
if (t && t.length > 0) {
|
|
1132
1136
|
this.__internal__.serial.connected || (this.dispatch("serial:connected"), D.instance.dispatch("change")), this.__internal__.serial.connected = !0, this.__internal__.interval.reconnection && (clearInterval(this.__internal__.interval.reconnection), this.__internal__.interval.reconnection = 0), this.__internal__.timeout.until_response && (clearTimeout(this.__internal__.timeout.until_response), this.__internal__.timeout.until_response = 0);
|
|
1133
1137
|
const n = [];
|
|
1134
|
-
for (const
|
|
1135
|
-
n.push(t[
|
|
1138
|
+
for (const s in t)
|
|
1139
|
+
n.push(t[s].toString().padStart(2, "0").toLowerCase());
|
|
1136
1140
|
this.serialMessage(n);
|
|
1137
1141
|
} else
|
|
1138
1142
|
this.serialCorruptMessage(t, e);
|
|
1139
1143
|
this.__internal__.serial.queue.length !== 0 && this.dispatch("internal:queue", {});
|
|
1140
|
-
},
|
|
1144
|
+
}, Re = async function() {
|
|
1141
1145
|
const t = this.serialFilters, e = await navigator.serial.getPorts({ filters: t });
|
|
1142
|
-
return t.length === 0 ? e : e.filter((
|
|
1143
|
-
const c =
|
|
1146
|
+
return t.length === 0 ? e : e.filter((s) => {
|
|
1147
|
+
const c = s.getInfo();
|
|
1144
1148
|
return t.some((u) => c.usbProductId === u.usbProductId && c.usbVendorId === u.usbVendorId);
|
|
1145
|
-
}).filter((
|
|
1149
|
+
}).filter((s) => !i(this, w, qe).call(this, s));
|
|
1146
1150
|
}, He = function(t) {
|
|
1147
1151
|
if (t) {
|
|
1148
1152
|
const e = this.__internal__.serial.response.buffer;
|
|
@@ -1168,8 +1172,8 @@ $ = function(t = [], e = null) {
|
|
|
1168
1172
|
t[n] = this.__internal__.serial.response.buffer[n];
|
|
1169
1173
|
if (t.length === this.__internal__.serial.response.length) {
|
|
1170
1174
|
const n = [];
|
|
1171
|
-
for (const
|
|
1172
|
-
n.push(t[
|
|
1175
|
+
for (const s in t)
|
|
1176
|
+
n.push(t[s].toString(16));
|
|
1173
1177
|
await i(this, w, $).call(this, n), this.__internal__.serial.response.buffer = new Uint8Array(0);
|
|
1174
1178
|
return;
|
|
1175
1179
|
}
|
|
@@ -1180,8 +1184,8 @@ $ = function(t = [], e = null) {
|
|
|
1180
1184
|
t[n - this.__internal__.serial.response.length] = this.__internal__.serial.response.buffer[n];
|
|
1181
1185
|
if (t.length === this.__internal__.serial.response.length) {
|
|
1182
1186
|
const n = [];
|
|
1183
|
-
for (const
|
|
1184
|
-
n.push(t[
|
|
1187
|
+
for (const s in t)
|
|
1188
|
+
n.push(t[s].toString(16));
|
|
1185
1189
|
await i(this, w, $).call(this, n), this.__internal__.serial.response.buffer = new Uint8Array(0);
|
|
1186
1190
|
}
|
|
1187
1191
|
}
|
|
@@ -1194,12 +1198,12 @@ $ = function(t = [], e = null) {
|
|
|
1194
1198
|
try {
|
|
1195
1199
|
let n = !0;
|
|
1196
1200
|
for (; n; ) {
|
|
1197
|
-
const { value:
|
|
1201
|
+
const { value: s, done: c } = await e.read();
|
|
1198
1202
|
if (c) {
|
|
1199
1203
|
e.releaseLock(), this.__internal__.serial.keep_reading = !1, n = !1;
|
|
1200
1204
|
break;
|
|
1201
1205
|
}
|
|
1202
|
-
i(this, w, He).call(this,
|
|
1206
|
+
i(this, w, He).call(this, s), this.__internal__.serial.response.length === null ? await i(this, w, Le).call(this) : await i(this, w, Oe).call(this);
|
|
1203
1207
|
}
|
|
1204
1208
|
} catch (n) {
|
|
1205
1209
|
this.serialErrors(n);
|
|
@@ -1232,8 +1236,10 @@ $ = function(t = [], e = null) {
|
|
|
1232
1236
|
this.serialRegisterAvailableListener(e);
|
|
1233
1237
|
});
|
|
1234
1238
|
}, $e = function() {
|
|
1239
|
+
const t = this;
|
|
1235
1240
|
this.on("internal:queue", async () => {
|
|
1236
|
-
|
|
1241
|
+
var e;
|
|
1242
|
+
await i(e = t, w, Ve).call(e);
|
|
1237
1243
|
}), i(this, w, Qe).call(this);
|
|
1238
1244
|
}, Qe = function() {
|
|
1239
1245
|
const t = this;
|
|
@@ -1249,7 +1255,7 @@ $ = function(t = [], e = null) {
|
|
|
1249
1255
|
if (this.__internal__.timeout.until_response || this.__internal__.serial.queue.length === 0) return;
|
|
1250
1256
|
const t = this.__internal__.serial.queue[0];
|
|
1251
1257
|
let e = this.__internal__.time.response_general;
|
|
1252
|
-
t.action === "
|
|
1258
|
+
t.action === "connect" ? e = this.__internal__.time.response_connection : t.action === "dispense" && (e = this.__internal__.time.response_engines), this.__internal__.timeout.until_response = setTimeout(async () => {
|
|
1253
1259
|
await this.timeout(t.bytes, t.action);
|
|
1254
1260
|
}, e), await i(this, w, me).call(this, t.bytes), this.dispatch("serial:sent", {
|
|
1255
1261
|
action: t.action,
|
|
@@ -1300,8 +1306,8 @@ class gn extends G {
|
|
|
1300
1306
|
}
|
|
1301
1307
|
serialRelaySumHex(t) {
|
|
1302
1308
|
let e = 0;
|
|
1303
|
-
return t.forEach((n,
|
|
1304
|
-
|
|
1309
|
+
return t.forEach((n, s) => {
|
|
1310
|
+
s !== 3 && (e += parseInt(n, 16));
|
|
1305
1311
|
}), e.toString(16).toUpperCase();
|
|
1306
1312
|
}
|
|
1307
1313
|
serialSetConnectionConstant(t = 1) {
|
|
@@ -1324,15 +1330,15 @@ class gn extends G {
|
|
|
1324
1330
|
X = new WeakMap(), _e = new WeakSet(), Ge = function() {
|
|
1325
1331
|
D.add(this);
|
|
1326
1332
|
};
|
|
1327
|
-
var N, E, j, v, Ye, Ke, Ze, ge, K, Q, ie, re,
|
|
1333
|
+
var N, E, j, v, Ye, Ke, Ze, ge, K, Q, ie, re, se;
|
|
1328
1334
|
class Cn extends G {
|
|
1329
1335
|
constructor({
|
|
1330
1336
|
filters: t = null,
|
|
1331
1337
|
config_port: e = null,
|
|
1332
1338
|
no_device: n = 1,
|
|
1333
|
-
device_listen_on_port:
|
|
1339
|
+
device_listen_on_port: s = 3
|
|
1334
1340
|
} = {}) {
|
|
1335
|
-
super({ filters: t, config_port: e, no_device: n, device_listen_on_port:
|
|
1341
|
+
super({ filters: t, config_port: e, no_device: n, device_listen_on_port: s });
|
|
1336
1342
|
S(this, v);
|
|
1337
1343
|
S(this, N, !1);
|
|
1338
1344
|
S(this, E, 0);
|
|
@@ -1383,27 +1389,27 @@ class Cn extends G {
|
|
|
1383
1389
|
let n = null;
|
|
1384
1390
|
try {
|
|
1385
1391
|
n = new Uint8Array(t.length + 8), n.set(t, 2), n[0] = 2, n[1] = t.length + 4, n[n.length - 2] = 3;
|
|
1386
|
-
let
|
|
1387
|
-
for (let
|
|
1388
|
-
|
|
1389
|
-
n[t.length + 2] =
|
|
1392
|
+
let s = 0;
|
|
1393
|
+
for (let d = 1; d < t.length; d++)
|
|
1394
|
+
s += t[d], s *= parseInt(Math.pow(2, d - 1).toString());
|
|
1395
|
+
n[t.length + 2] = s % 256, n[t.length + 3] = e * 3 % 256, n[t.length + 4] = e * 8 % 256;
|
|
1390
1396
|
let c = 0;
|
|
1391
|
-
for (let
|
|
1392
|
-
c += n[
|
|
1397
|
+
for (let d = 3; d < t.length + 5; d++)
|
|
1398
|
+
c += n[d];
|
|
1393
1399
|
n[t.length + 5] = c % 256;
|
|
1394
1400
|
let u = 0;
|
|
1395
|
-
for (let
|
|
1396
|
-
u ^= n[
|
|
1401
|
+
for (let d = 0; d < n.length - 1; d++)
|
|
1402
|
+
u ^= n[d];
|
|
1397
1403
|
n[n.length - 1] = u;
|
|
1398
|
-
} catch (
|
|
1399
|
-
this.serialErrors(`Error generating command: ${
|
|
1404
|
+
} catch (s) {
|
|
1405
|
+
this.serialErrors(`Error generating command: ${s.message}`), n = null;
|
|
1400
1406
|
}
|
|
1401
1407
|
return n;
|
|
1402
1408
|
}
|
|
1403
1409
|
serialLockerHexCmd(t) {
|
|
1404
1410
|
const e = this.serialLockerCmdMaker(t), n = [];
|
|
1405
|
-
for (let
|
|
1406
|
-
n.push(this.decToHex(e[
|
|
1411
|
+
for (let s = 0; s < e.length; s++)
|
|
1412
|
+
n.push(this.decToHex(e[s]));
|
|
1407
1413
|
return n;
|
|
1408
1414
|
}
|
|
1409
1415
|
serialLockerGetConnectionCmd(t = 3) {
|
|
@@ -1425,13 +1431,13 @@ class Cn extends G {
|
|
|
1425
1431
|
}
|
|
1426
1432
|
async enable({ cell: t = 1 } = {}) {
|
|
1427
1433
|
t = i(this, v, K).call(this, t);
|
|
1428
|
-
const [e, n] = this.parseCellToColumnRow(t),
|
|
1429
|
-
await this.appendToQueue(
|
|
1434
|
+
const [e, n] = this.parseCellToColumnRow(t), s = i(this, v, ge).call(this, { enable: !0, column: e, row: n });
|
|
1435
|
+
await this.appendToQueue(s, "activate");
|
|
1430
1436
|
}
|
|
1431
1437
|
async disable({ cell: t = 1 } = {}) {
|
|
1432
1438
|
t = i(this, v, K).call(this, t);
|
|
1433
|
-
const [e, n] = this.parseCellToColumnRow(t),
|
|
1434
|
-
await this.appendToQueue(
|
|
1439
|
+
const [e, n] = this.parseCellToColumnRow(t), s = i(this, v, ge).call(this, { enable: !1, column: e, row: n });
|
|
1440
|
+
await this.appendToQueue(s, "disable");
|
|
1435
1441
|
}
|
|
1436
1442
|
async openAll() {
|
|
1437
1443
|
if (this.isDispensing) throw new Error("Another dispensing process is running");
|
|
@@ -1450,10 +1456,10 @@ class Cn extends G {
|
|
|
1450
1456
|
x(this, E, 90), i(this, v, re).call(this), i(this, v, Q).call(this);
|
|
1451
1457
|
}
|
|
1452
1458
|
async disableAll() {
|
|
1453
|
-
i(this, v, Q).call(this), x(this, N, !0), i(this, v,
|
|
1459
|
+
i(this, v, Q).call(this), x(this, N, !0), i(this, v, se).call(this);
|
|
1454
1460
|
for (let t = 1; t <= 90; t++)
|
|
1455
|
-
await this.enable(t), x(this, E, t), i(this, v,
|
|
1456
|
-
x(this, E, 90), i(this, v,
|
|
1461
|
+
await this.enable(t), x(this, E, t), i(this, v, se).call(this);
|
|
1462
|
+
x(this, E, 90), i(this, v, se).call(this), i(this, v, Q).call(this);
|
|
1457
1463
|
}
|
|
1458
1464
|
}
|
|
1459
1465
|
N = new WeakMap(), E = new WeakMap(), j = new WeakMap(), v = new WeakSet(), Ye = function() {
|
|
@@ -1471,8 +1477,8 @@ N = new WeakMap(), E = new WeakMap(), j = new WeakMap(), v = new WeakSet(), Ye =
|
|
|
1471
1477
|
}, ge = function({ enable: t = !0, column: e = 0, row: n = 10 } = {}) {
|
|
1472
1478
|
if (e < 0 || e > 8) throw new Error("Invalid column number");
|
|
1473
1479
|
if (n < 0 || n > 10) throw new Error("Invalid row number");
|
|
1474
|
-
let
|
|
1475
|
-
return t || (
|
|
1480
|
+
let s = 1;
|
|
1481
|
+
return t || (s = 0), this.serialLockerHexCmd(new Uint8Array([48, this.__internal__.device.listen_on_port, e, n, s]));
|
|
1476
1482
|
}, // #serialLockerGetOpenCmd(cell = 1) {
|
|
1477
1483
|
// cell = this.#validateCell(cell);
|
|
1478
1484
|
// const time = this.__internal__.device.milliseconds;
|
|
@@ -1491,20 +1497,20 @@ K = function(t) {
|
|
|
1491
1497
|
x(this, j, Math.round(y(this, E) * 100 / 90)), this.dispatch("percentage:open", { percentage: y(this, j), dispensed: t });
|
|
1492
1498
|
}, re = function() {
|
|
1493
1499
|
x(this, j, Math.round(y(this, E) * 100 / 90)), this.dispatch("percentage:enable", { percentage: y(this, j) });
|
|
1494
|
-
},
|
|
1500
|
+
}, se = function() {
|
|
1495
1501
|
x(this, j, Math.round(y(this, E) * 100 / 90)), this.dispatch("percentage:disable", { percentage: y(this, j) });
|
|
1496
1502
|
};
|
|
1497
|
-
var l, Xe, et, tt, B,
|
|
1503
|
+
var l, Xe, et, tt, B, ae, nt, it, rt, st, at, ot, lt, ct, ht, dt, ut, pt, _t, ft, bt, yt, wt, kt, vt, mt, gt, Ct, xt, Tt, Dt, Et, L, F, oe, P, O, It, St, Mt, Ft, Z, Ce, xe, le, ce, Pt;
|
|
1498
1504
|
class xn extends G {
|
|
1499
1505
|
constructor({
|
|
1500
1506
|
filters: t = null,
|
|
1501
1507
|
config_port: e = null,
|
|
1502
1508
|
no_device: n = 1,
|
|
1503
|
-
device_listen_on_port:
|
|
1509
|
+
device_listen_on_port: s = 1,
|
|
1504
1510
|
type: c = "esplus",
|
|
1505
1511
|
support_cart: u = !0
|
|
1506
1512
|
} = {}) {
|
|
1507
|
-
super({ filters: t, config_port: e, no_device: n, device_listen_on_port:
|
|
1513
|
+
super({ filters: t, config_port: e, no_device: n, device_listen_on_port: s });
|
|
1508
1514
|
S(this, l);
|
|
1509
1515
|
A(this, "__device", {
|
|
1510
1516
|
type: "esplus",
|
|
@@ -1532,7 +1538,7 @@ class xn extends G {
|
|
|
1532
1538
|
}
|
|
1533
1539
|
});
|
|
1534
1540
|
if (this.__internal__.device.type = "jofemar", D.getCustom(this.typeDevice, n)) throw new Error(`Device ${this.typeDevice} ${n} already exists`);
|
|
1535
|
-
this.__internal__.time.response_general = 800, this.__internal__.dispense.limit_counter = 40, this.__internal__.dispense.timeout = 0, this.__internal__.dispense.timeout_time = 4e3, this.__internal__.dispense.interval = 0, this.__internal__.dispense.interval_time = 1e3, this.__internal__.device.hex_number = (128 + this.listenOnPort).toString(16), this.__internal__.dispense.elevator = {
|
|
1541
|
+
this.__internal__.dispense.must_response = !0, this.__internal__.time.response_general = 800, this.__internal__.time.response_engines = 800, this.__internal__.dispense.limit_counter = 40, this.__internal__.dispense.timeout = 0, this.__internal__.dispense.timeout_time = 4e3, this.__internal__.dispense.interval = 0, this.__internal__.dispense.interval_time = 1e3, this.__internal__.device.hex_number = (128 + this.listenOnPort).toString(16), this.__internal__.dispense.elevator = {
|
|
1536
1542
|
locking_time: 60,
|
|
1537
1543
|
locking_interval: 0,
|
|
1538
1544
|
need_reset: !1
|
|
@@ -1567,8 +1573,8 @@ class xn extends G {
|
|
|
1567
1573
|
}
|
|
1568
1574
|
serialJofemarMakeBytes(t) {
|
|
1569
1575
|
let e = this.hexToDec(this.sumHex(t)), n = this.calcCheckSums(e.toString());
|
|
1570
|
-
for (let
|
|
1571
|
-
t.push(this.hexMaker(n[
|
|
1576
|
+
for (let s = 0; s < 2; s++)
|
|
1577
|
+
t.push(this.hexMaker(n[s]));
|
|
1572
1578
|
return t.push("03"), this.add0x(t);
|
|
1573
1579
|
}
|
|
1574
1580
|
calcCheckSums(t) {
|
|
@@ -1578,8 +1584,8 @@ class xn extends G {
|
|
|
1578
1584
|
}
|
|
1579
1585
|
serialSetConnectionConstant(t = 1) {
|
|
1580
1586
|
let e = ["02", "30", "30", (128 + t).toString(16), "53", "FF", "FF"], n = [];
|
|
1581
|
-
return e.forEach((
|
|
1582
|
-
n.push(this.hexMaker(
|
|
1587
|
+
return e.forEach((s) => {
|
|
1588
|
+
n.push(this.hexMaker(s));
|
|
1583
1589
|
}), this.serialJofemarMakeBytes(n);
|
|
1584
1590
|
}
|
|
1585
1591
|
serialMessage(t) {
|
|
@@ -1626,24 +1632,27 @@ class xn extends G {
|
|
|
1626
1632
|
cart: e = !1
|
|
1627
1633
|
} = {}) {
|
|
1628
1634
|
if (t = parseInt(t), isNaN(t) || t < 1 || t > 130) throw new Error("Invalid selection");
|
|
1629
|
-
const { channel: n, tray:
|
|
1635
|
+
const { channel: n, tray: s } = i(this, l, St).call(this, t);
|
|
1630
1636
|
this.__internal__.dispense.backup_dispense = {
|
|
1631
1637
|
selection: t,
|
|
1632
1638
|
cart: e,
|
|
1633
1639
|
channel: n,
|
|
1634
|
-
tray:
|
|
1640
|
+
tray: s
|
|
1635
1641
|
};
|
|
1636
|
-
let u = ["02", "30", "30", this.__internal__.device.hex_number, "56",
|
|
1637
|
-
e && (u[4] = "4D"), u = i(this, l,
|
|
1638
|
-
let
|
|
1642
|
+
let u = ["02", "30", "30", this.__internal__.device.hex_number, "56", s, n];
|
|
1643
|
+
e && (u[4] = "4D"), u = i(this, l, ae).call(this, u);
|
|
1644
|
+
let d;
|
|
1639
1645
|
do
|
|
1640
|
-
|
|
1641
|
-
while (["elevator-locked", "no-response"].includes(
|
|
1642
|
-
return this.__internal__.dispense.backup_dispense = {},
|
|
1646
|
+
d = await this.internalDispense(u), i(this, l, Mt).call(this), d.error === "elevator-locked" ? await i(this, l, nt).call(this) : d.error === "no-response" && await W(1e3);
|
|
1647
|
+
while (["elevator-locked", "no-response"].includes(d.error));
|
|
1648
|
+
return this.__internal__.dispense.backup_dispense = {}, d;
|
|
1649
|
+
}
|
|
1650
|
+
internalClearSensing() {
|
|
1651
|
+
super.internalClearSensing(), this.__internal__.dispense.timeout && clearTimeout(this.__internal__.dispense.timeout), this.__internal__.dispense.interval && clearInterval(this.__internal__.dispense.interval), this.__internal__.serial.queue.length > 0 && (this.__internal__.serial.queue = this.__internal__.serial.queue.filter((t) => t.type !== "status"));
|
|
1643
1652
|
}
|
|
1644
1653
|
async endDispense() {
|
|
1645
1654
|
let e = ["02", "30", "30", this.__internal__.device.hex_number, "4D", "80", "80"];
|
|
1646
|
-
return e = i(this, l,
|
|
1655
|
+
return e = i(this, l, ae).call(this, e), await this.internalDispense(e);
|
|
1647
1656
|
}
|
|
1648
1657
|
async collect() {
|
|
1649
1658
|
const t = ["02", "30", "30", "81", "4E", "FF", "FF"];
|
|
@@ -1704,8 +1713,8 @@ class xn extends G {
|
|
|
1704
1713
|
t = parseFloat(t);
|
|
1705
1714
|
const e = this.__device.type === "iceplus" ? 6.5 : 32, n = this.__device.type === "iceplus" ? -25 : 0.5;
|
|
1706
1715
|
if (isNaN(t) || t < n || t > e || t % 0.5 !== 0) throw new Error("Invalid degrees, must be a multiple of 0.5 and between 0.5 and 32");
|
|
1707
|
-
let
|
|
1708
|
-
return this.__device.type === "iceplus" && (
|
|
1716
|
+
let s = t * 2 + 128;
|
|
1717
|
+
return this.__device.type === "iceplus" && (s += 51), s = Math.ceil(s), await this.program("54", s.toString(16));
|
|
1709
1718
|
}
|
|
1710
1719
|
/**
|
|
1711
1720
|
* @param {number|string} tray
|
|
@@ -1812,7 +1821,7 @@ class xn extends G {
|
|
|
1812
1821
|
if (isNaN(e) || e < 0 || e > 10 || e % 0.1 !== 0) throw new Error("Invalid seconds, valid range is 0.0 to 10.0 with a step of 0.1");
|
|
1813
1822
|
const n = 109 + t;
|
|
1814
1823
|
e = e.toFixed(1);
|
|
1815
|
-
const
|
|
1824
|
+
const s = 128 + e * 10, c = ["02", "30", "30", "81", "45", n, s];
|
|
1816
1825
|
return await i(this, l, B).call(this, c, "channel-running-after-dispense");
|
|
1817
1826
|
}
|
|
1818
1827
|
async checkData(t, e = "FF") {
|
|
@@ -1918,8 +1927,8 @@ class xn extends G {
|
|
|
1918
1927
|
*/
|
|
1919
1928
|
async setDisplayMessageTemporarily({ message: t = "", seconds: e = 1 }) {
|
|
1920
1929
|
if (t = t.substring(0, 32), e = parseInt(e), isNaN(e) || e < 1 || e > 125) throw new Error("Invalid seconds, valid range is 1 to 125");
|
|
1921
|
-
const n = i(this, l, ce).call(this, t),
|
|
1922
|
-
return await i(this, l, le).call(this,
|
|
1930
|
+
const n = i(this, l, ce).call(this, t), s = (128 + e).toString(16);
|
|
1931
|
+
return await i(this, l, le).call(this, s, n);
|
|
1923
1932
|
}
|
|
1924
1933
|
/**
|
|
1925
1934
|
* @param {string} message
|
|
@@ -1942,8 +1951,8 @@ class xn extends G {
|
|
|
1942
1951
|
*/
|
|
1943
1952
|
async eventsConfig({ event: t = null, enable: e = !0 } = {}) {
|
|
1944
1953
|
if (t === null) throw new Error("Invalid event");
|
|
1945
|
-
const
|
|
1946
|
-
return await i(this, l, B).call(this,
|
|
1954
|
+
const s = ["02", "30", "30", "81", "41", t, e ? "31" : "30"];
|
|
1955
|
+
return await i(this, l, B).call(this, s, "events-config");
|
|
1947
1956
|
}
|
|
1948
1957
|
async eventEnable({ event: t = null } = {}) {
|
|
1949
1958
|
if (t === null) throw new Error("Invalid event");
|
|
@@ -1968,8 +1977,8 @@ class xn extends G {
|
|
|
1968
1977
|
for (let n = t; n <= e; n++)
|
|
1969
1978
|
this.__device.channels.verification.current = n, await this.getChannelPresence({ selection: n });
|
|
1970
1979
|
return new Promise((n) => {
|
|
1971
|
-
let
|
|
1972
|
-
this.__device.channels.verification.channels.length === e - t + 1 && (clearInterval(
|
|
1980
|
+
let s = setInterval(() => {
|
|
1981
|
+
this.__device.channels.verification.channels.length === e - t + 1 && (clearInterval(s), this.dispatch("channels", { channels: this.__device.channels.verification.channels }), this.__device.channels.verification.clear(), n(!0));
|
|
1973
1982
|
}, 500);
|
|
1974
1983
|
});
|
|
1975
1984
|
}
|
|
@@ -2011,15 +2020,15 @@ l = new WeakSet(), Xe = function() {
|
|
|
2011
2020
|
for (const e of t)
|
|
2012
2021
|
this.serialRegisterAvailableListener(e);
|
|
2013
2022
|
}, et = function() {
|
|
2014
|
-
this.on("internal:dispense:running",
|
|
2023
|
+
this.on("internal:dispense:running", i(this, l, Ft).bind(this));
|
|
2015
2024
|
}, tt = function() {
|
|
2016
2025
|
D.add(this);
|
|
2017
2026
|
}, B = function(t, e) {
|
|
2018
|
-
return t[3] = this.__internal__.device.hex_number, this.appendToQueue(i(this, l,
|
|
2019
|
-
},
|
|
2027
|
+
return t[3] = this.__internal__.device.hex_number, this.appendToQueue(i(this, l, ae).call(this, t), e);
|
|
2028
|
+
}, ae = function(t) {
|
|
2020
2029
|
let e = this.hexToDec(this.sumHex(t)), n = this.calcCheckSums(e.toString());
|
|
2021
|
-
for (let
|
|
2022
|
-
t.push(this.hexMaker(n[
|
|
2030
|
+
for (let s = 0; s < 2; s++)
|
|
2031
|
+
t.push(this.hexMaker(n[s]));
|
|
2023
2032
|
return t.push("03"), t;
|
|
2024
2033
|
}, nt = async function() {
|
|
2025
2034
|
if (this.__internal__.dispense.elevator.locking_interval) return;
|
|
@@ -2061,9 +2070,9 @@ l = new WeakSet(), Xe = function() {
|
|
|
2061
2070
|
44: "D"
|
|
2062
2071
|
};
|
|
2063
2072
|
return e.additional.ascii = n[t] ?? null, e.name = "Key pressed", e.description = `The key ${e.additional.ascii} was pressed`, e.no_code = 2, this.dispatch("keyboard:pressed", e.additional), e;
|
|
2064
|
-
}, at = function(t, e) {
|
|
2065
|
-
return e.additional = { open: !1 }, e.no_code = 3, t === "4f" ? (e.name = "door open", e.description = "The door was opened", e.additional.open = !0, this.dispatch("door:event", e.additional)) : t === "43" ? (e.name = "door close", e.description = "The door was closed", e.additional.open = !1, this.dispatch("door:event", e.additional)) : (e.name = "door event", e.description = "The door event received is unknown", this.dispatch("door:event", { open: e.additional.open, message: e })), e;
|
|
2066
2073
|
}, st = function(t, e) {
|
|
2074
|
+
return e.additional = { open: !1 }, e.no_code = 3, t === "4f" ? (e.name = "door open", e.description = "The door was opened", e.additional.open = !0, this.dispatch("door:event", e.additional)) : t === "43" ? (e.name = "door close", e.description = "The door was closed", e.additional.open = !1, this.dispatch("door:event", e.additional)) : (e.name = "door event", e.description = "The door event received is unknown", this.dispatch("door:event", { open: e.additional.open, message: e })), e;
|
|
2075
|
+
}, at = function(t, e) {
|
|
2067
2076
|
e.no_code = 404;
|
|
2068
2077
|
let n = t[5] ?? null;
|
|
2069
2078
|
return n && this.listenOnPort > 1 && (n = this.hexToDec(n) - this.listenOnPort + 1, n = this.decToHex(n)), n && (n === "FD" ? (e.no_code = 4, e.name = "channel disconnected", e.description = "The channel is disconnected", e.additional = { active: !1 }) : n === "FC" ? (e.no_code = 5, e.name = "channel connected", e.description = "The channel is connected", e.additional = { active: !0 }) : (e.no_code = 6, e.name = "channel sold out", e.description = "The channel is empty", e.additional = { active: !0 }), this.__device.channels.verification.running && (this.__device.channels.verification.channels.push({
|
|
@@ -2072,14 +2081,14 @@ l = new WeakSet(), Xe = function() {
|
|
|
2072
2081
|
}), e.additional.selection = this.__device.channels.verification.current), this.dispatch("channel:status", e.additional)), e;
|
|
2073
2082
|
}, ot = function(t, e) {
|
|
2074
2083
|
e.no_code = 39, e.name = "Program version";
|
|
2075
|
-
const n = t.slice(4, 12),
|
|
2076
|
-
return e.additional = { version:
|
|
2084
|
+
const n = t.slice(4, 12), s = n.map((c) => String.fromCharCode(this.hexToDec(c))).join("");
|
|
2085
|
+
return e.additional = { version: s, hex: n }, e.description = `The program version is ${s}`, this.dispatch("program:version", e.additional), e;
|
|
2077
2086
|
}, lt = function(t, e) {
|
|
2078
2087
|
e.no_code = 39, e.name = "Machine faults", e.description = "No faults detected", e.additional = { no_faults: 0, faults: [] };
|
|
2079
2088
|
const n = t.slice(4, -3);
|
|
2080
2089
|
if (n.length > 1 && n[0] !== "30") {
|
|
2081
2090
|
e.description = "Machine has faults";
|
|
2082
|
-
const
|
|
2091
|
+
const s = {
|
|
2083
2092
|
31: "Busy",
|
|
2084
2093
|
32: "Invalid tray",
|
|
2085
2094
|
33: "Invalid channel",
|
|
@@ -2114,40 +2123,40 @@ l = new WeakSet(), Xe = function() {
|
|
|
2114
2123
|
64: "Product detector didn't change during its verification test"
|
|
2115
2124
|
};
|
|
2116
2125
|
for (const c of n)
|
|
2117
|
-
|
|
2126
|
+
s[c] && (e.additional.faults.push(s[c]), e.additional.no_faults++);
|
|
2118
2127
|
}
|
|
2119
2128
|
return this.dispatch("machine:faults", e.additional), e;
|
|
2120
2129
|
}, ct = function(t, e) {
|
|
2121
2130
|
e.no_code = 40, e.name = "Clock registers", e.description = "Clock registers";
|
|
2122
|
-
const n = t.slice(4, -3),
|
|
2131
|
+
const n = t.slice(4, -3), s = n.map((fe) => String.fromCharCode(this.hexToDec(fe))).join(""), [c, u] = s.split(" "), [d, b] = c.split(":"), [g, T, I] = u.split("-"), U = new Date(2e3 + parseInt(I), parseInt(T) - 1, parseInt(g), parseInt(d), parseInt(b));
|
|
2123
2132
|
return e.additional = {
|
|
2124
2133
|
day: g,
|
|
2125
2134
|
month: T,
|
|
2126
2135
|
year: I,
|
|
2127
|
-
hours:
|
|
2136
|
+
hours: d,
|
|
2128
2137
|
minutes: b,
|
|
2129
|
-
formatted:
|
|
2138
|
+
formatted: s,
|
|
2130
2139
|
date: U,
|
|
2131
2140
|
hex: n
|
|
2132
2141
|
}, this.dispatch("clock:registers", e.additional), e;
|
|
2133
|
-
},
|
|
2142
|
+
}, ht = function(t, e) {
|
|
2134
2143
|
e.no_code = 41, e.name = "Machine activity", e.description = "Events from read machine activity";
|
|
2135
2144
|
const n = String.fromCharCode(this.hexToDec(t[4]));
|
|
2136
2145
|
if (n !== "0") {
|
|
2137
|
-
const
|
|
2138
|
-
if (n === "T" &&
|
|
2139
|
-
const c = String.fromCharCode(this.hexToDec(
|
|
2146
|
+
const s = t.slice(5, -3);
|
|
2147
|
+
if (n === "T" && s.length === 4) {
|
|
2148
|
+
const c = String.fromCharCode(this.hexToDec(s[0])), u = String.fromCharCode(this.hexToDec(s[1])), d = String.fromCharCode(this.hexToDec(s[3]));
|
|
2140
2149
|
e.additional = {
|
|
2141
2150
|
ascii: n,
|
|
2142
2151
|
type: "DU.d",
|
|
2143
2152
|
dozens: c,
|
|
2144
2153
|
units: u,
|
|
2145
|
-
decimals:
|
|
2146
|
-
time: parseFloat(`${c}${u}.${
|
|
2154
|
+
decimals: d,
|
|
2155
|
+
time: parseFloat(`${c}${u}.${d}`),
|
|
2147
2156
|
meaning: "Extraction time (in seconds)"
|
|
2148
2157
|
};
|
|
2149
|
-
} else if (["B", "D", "E", "F", "G"].includes(n) &&
|
|
2150
|
-
const c = String.fromCharCode(this.hexToDec(
|
|
2158
|
+
} else if (["B", "D", "E", "F", "G"].includes(n) && s.length === 3) {
|
|
2159
|
+
const c = String.fromCharCode(this.hexToDec(s[0])), u = String.fromCharCode(this.hexToDec(s[1])), d = String.fromCharCode(this.hexToDec(s[2])), b = parseInt(`${c}${u}${d}`), g = {
|
|
2151
2160
|
B: "Error on going to tray channel",
|
|
2152
2161
|
D: "Error on product detector",
|
|
2153
2162
|
E: "Extraction of channel ok",
|
|
@@ -2158,14 +2167,14 @@ l = new WeakSet(), Xe = function() {
|
|
|
2158
2167
|
type: "HDU",
|
|
2159
2168
|
hundreds: c,
|
|
2160
2169
|
dozens: u,
|
|
2161
|
-
decimals:
|
|
2170
|
+
decimals: d,
|
|
2162
2171
|
channel: b,
|
|
2163
2172
|
selection: b - 109,
|
|
2164
2173
|
ascii: n,
|
|
2165
2174
|
meaning: g[n] ?? "Unknown"
|
|
2166
2175
|
};
|
|
2167
|
-
} else if (
|
|
2168
|
-
const c =
|
|
2176
|
+
} else if (s.length === 13) {
|
|
2177
|
+
const c = s.map((un) => String.fromCharCode(this.hexToDec(un))).join(""), u = parseInt(c.slice(0, 2)), d = parseInt(c.slice(2, 4)), b = parseInt(c.slice(4, 6)), g = parseInt(c.slice(7, 9)), T = parseInt(c.slice(9, 11)) - 1, I = 2e3 + parseInt(c.slice(11, 13)), U = new Date(I, T, g, u, d, b), fe = {
|
|
2169
2178
|
A: "Attempt to close product exit door",
|
|
2170
2179
|
C: "Closing of exterior door",
|
|
2171
2180
|
H: "Error on opening of product exit door",
|
|
@@ -2186,7 +2195,7 @@ l = new WeakSet(), Xe = function() {
|
|
|
2186
2195
|
e.additional = {
|
|
2187
2196
|
type: "hhmmssWddMMAA",
|
|
2188
2197
|
date: U,
|
|
2189
|
-
hex:
|
|
2198
|
+
hex: s,
|
|
2190
2199
|
formatted: U.toLocaleString(),
|
|
2191
2200
|
ascii: n,
|
|
2192
2201
|
meaning: fe[n] ?? "Unknown"
|
|
@@ -2194,7 +2203,7 @@ l = new WeakSet(), Xe = function() {
|
|
|
2194
2203
|
}
|
|
2195
2204
|
}
|
|
2196
2205
|
return this.dispatch("machine:activity", e.additional), e;
|
|
2197
|
-
},
|
|
2206
|
+
}, dt = function(t, e) {
|
|
2198
2207
|
const n = {
|
|
2199
2208
|
30: "Spanish",
|
|
2200
2209
|
31: "English",
|
|
@@ -2316,15 +2325,15 @@ l = new WeakSet(), Xe = function() {
|
|
|
2316
2325
|
e.request = "--automatic", e = i(this, l, rt).call(this, t[3], e);
|
|
2317
2326
|
break;
|
|
2318
2327
|
case "50":
|
|
2319
|
-
e.request = "--automatic", e = i(this, l,
|
|
2328
|
+
e.request = "--automatic", e = i(this, l, st).call(this, t[3], e);
|
|
2320
2329
|
break;
|
|
2321
2330
|
case "43":
|
|
2322
2331
|
switch (e.request = "check-data", t[3]) {
|
|
2323
2332
|
case "41":
|
|
2324
|
-
e = i(this, l,
|
|
2333
|
+
e = i(this, l, ht).call(this, t, e);
|
|
2325
2334
|
break;
|
|
2326
2335
|
case "43":
|
|
2327
|
-
e.request = "channel-status", e = i(this, l,
|
|
2336
|
+
e.request = "channel-status", e = i(this, l, at).call(this, t, e);
|
|
2328
2337
|
break;
|
|
2329
2338
|
case "50":
|
|
2330
2339
|
e = i(this, l, ot).call(this, t, e);
|
|
@@ -2342,7 +2351,7 @@ l = new WeakSet(), Xe = function() {
|
|
|
2342
2351
|
e.request = "current-temperature", e = i(this, l, Dt).call(this, t, e);
|
|
2343
2352
|
break;
|
|
2344
2353
|
case "49":
|
|
2345
|
-
e = i(this, l,
|
|
2354
|
+
e = i(this, l, dt).call(this, t[4], e);
|
|
2346
2355
|
break;
|
|
2347
2356
|
case "5a":
|
|
2348
2357
|
e = i(this, l, ut).call(this, t[4], e);
|
|
@@ -2528,6 +2537,7 @@ O = function({ type: t = null, severity: e = "high" } = {}) {
|
|
|
2528
2537
|
}, Mt = function() {
|
|
2529
2538
|
this.__internal__.dispense.timeout && clearTimeout(this.__internal__.dispense.timeout), this.__internal__.dispense.interval && clearInterval(this.__internal__.dispense.interval), this.__internal__.dispense.timeout = 0, this.__internal__.dispense.interval = 0;
|
|
2530
2539
|
}, Ft = function() {
|
|
2540
|
+
this.__internal__.dispense.timeout && clearTimeout(this.__internal__.dispense.timeout), this.__internal__.dispense.interval && clearInterval(this.__internal__.dispense.interval);
|
|
2531
2541
|
const t = this;
|
|
2532
2542
|
t.__internal__.dispense.timeout = setTimeout(() => {
|
|
2533
2543
|
t.__internal__.dispense.interval = setInterval(() => {
|
|
@@ -2539,12 +2549,12 @@ O = function({ type: t = null, severity: e = "high" } = {}) {
|
|
|
2539
2549
|
const e = ["02", "30", "30", "81", "52", t, "FF"];
|
|
2540
2550
|
return await i(this, l, B).call(this, e, "reset");
|
|
2541
2551
|
}, Ce = function() {
|
|
2542
|
-
const t = this.__device.type === "iceplus" ? we(40) : we(25), e = /* @__PURE__ */ new Date(), n = 1e3 * t + e.getTime(),
|
|
2552
|
+
const t = this.__device.type === "iceplus" ? we(40) : we(25), e = /* @__PURE__ */ new Date(), n = 1e3 * t + e.getTime(), s = new Date(n);
|
|
2543
2553
|
this.dispatch("reset:errors", {
|
|
2544
2554
|
description: "Resetting machine errors",
|
|
2545
2555
|
duration: t,
|
|
2546
2556
|
started_at: e,
|
|
2547
|
-
finished_at:
|
|
2557
|
+
finished_at: s
|
|
2548
2558
|
});
|
|
2549
2559
|
}, xe = async function(t) {
|
|
2550
2560
|
const e = ["02", "30", "30", "81", "4C", t, "FF"];
|
|
@@ -2560,12 +2570,12 @@ O = function({ type: t = null, severity: e = "high" } = {}) {
|
|
|
2560
2570
|
return e;
|
|
2561
2571
|
}, Pt = function(t) {
|
|
2562
2572
|
if (!(t instanceof Date)) throw new Error("Invalid date, must be an instance of Date");
|
|
2563
|
-
const e = t.getHours().toString().padStart(2, "0"), n = t.getMinutes().toString().padStart(2, "0"),
|
|
2573
|
+
const e = t.getHours().toString().padStart(2, "0"), n = t.getMinutes().toString().padStart(2, "0"), s = t.getDate().toString().padStart(2, "0"), c = (t.getMonth() + 1).toString().padStart(2, "0"), u = t.getFullYear().toString().substring(2, 4), d = `${e}:${n} ${s}-${c}-${u}`, b = [];
|
|
2564
2574
|
for (let g = 0; g < 14; g++)
|
|
2565
|
-
b.push(
|
|
2575
|
+
b.push(d.charCodeAt(g).toString(16));
|
|
2566
2576
|
return b;
|
|
2567
2577
|
};
|
|
2568
|
-
var ee, V, J,
|
|
2578
|
+
var ee, V, J, h, Nt, At, he, Bt, qt, Rt, Ht, Lt, Ot, Ut, jt, Te, Wt, $t, Qt, Vt, Jt, zt, Gt, Yt, Kt, Zt, Xt, en, tn, nn, q, de, rn, sn, an, on, De, ue, ln, cn, Ee, Ie, Se;
|
|
2569
2579
|
class Tn extends G {
|
|
2570
2580
|
constructor({
|
|
2571
2581
|
filters: t = null,
|
|
@@ -2573,7 +2583,7 @@ class Tn extends G {
|
|
|
2573
2583
|
no_device: n = 1
|
|
2574
2584
|
} = {}) {
|
|
2575
2585
|
super({ filters: t, config_port: e, no_device: n });
|
|
2576
|
-
S(this,
|
|
2586
|
+
S(this, h);
|
|
2577
2587
|
A(this, "__coin_purse", {
|
|
2578
2588
|
available: !0
|
|
2579
2589
|
});
|
|
@@ -2624,12 +2634,12 @@ class Tn extends G {
|
|
|
2624
2634
|
S(this, V, 0);
|
|
2625
2635
|
S(this, J, 0);
|
|
2626
2636
|
if (this.__internal__.device.type = "boardroid", D.getCustom(this.typeDevice, n)) throw new Error(`Device ${this.typeDevice} ${n} already exists`);
|
|
2627
|
-
this.__internal__.serial.config_port.baudRate = 115200, this.__internal__.serial.response.length = 14, this.__internal__.time.response_connection = 600, this.__internal__.time.response_general = 4e3, this.__internal__.dispense.limit_counter = 15, this.__internal__.dispense.custom_limit_counter = null, this.__internal__.dispense.backup_dispense = {
|
|
2637
|
+
this.__internal__.serial.config_port.baudRate = 115200, this.__internal__.serial.response.length = 14, this.__internal__.time.response_connection = 600, this.__internal__.time.response_general = 4e3, this.__internal__.time.response_engines = 15e3, this.__internal__.dispense.limit_counter = 15, this.__internal__.dispense.custom_limit_counter = null, this.__internal__.dispense.backup_dispense = {
|
|
2628
2638
|
channel: 1,
|
|
2629
2639
|
second_channel: null,
|
|
2630
2640
|
sensor: !0,
|
|
2631
2641
|
seconds: null
|
|
2632
|
-
}, i(this,
|
|
2642
|
+
}, i(this, h, Nt).call(this), i(this, h, At).call(this);
|
|
2633
2643
|
}
|
|
2634
2644
|
get totalInTubes() {
|
|
2635
2645
|
return this.coins.tubes.g50 * 0.5 + this.coins.tubes.c50 * 0.5 + this.coins.tubes.p1 + this.coins.tubes.p2 * 2 + this.coins.tubes.p5 * 5 + this.coins.tubes.p10 * 10;
|
|
@@ -2674,8 +2684,8 @@ class Tn extends G {
|
|
|
2674
2684
|
}
|
|
2675
2685
|
serialBoardroidSumHex(t) {
|
|
2676
2686
|
let e = 0;
|
|
2677
|
-
return t.forEach((n,
|
|
2678
|
-
|
|
2687
|
+
return t.forEach((n, s) => {
|
|
2688
|
+
s !== 0 && s !== 11 && (e += parseInt(n, 16));
|
|
2679
2689
|
}), e.toString(16).toUpperCase();
|
|
2680
2690
|
}
|
|
2681
2691
|
serialMessage(t) {
|
|
@@ -2689,46 +2699,46 @@ class Tn extends G {
|
|
|
2689
2699
|
const n = (5 + this.deviceNumber).toString(16).padStart(2, "0").toLowerCase();
|
|
2690
2700
|
switch (t[1]) {
|
|
2691
2701
|
case n:
|
|
2692
|
-
e.request = "connect", e = i(this,
|
|
2702
|
+
e.request = "connect", e = i(this, h, qt).call(this, e);
|
|
2693
2703
|
break;
|
|
2694
2704
|
case "a0":
|
|
2695
|
-
e.request = "--automatic", e = i(this,
|
|
2705
|
+
e.request = "--automatic", e = i(this, h, Wt).call(this, t, e);
|
|
2696
2706
|
break;
|
|
2697
2707
|
case "b0":
|
|
2698
|
-
e.request = "--automatic", e = i(this,
|
|
2708
|
+
e.request = "--automatic", e = i(this, h, $t).call(this, t, e);
|
|
2699
2709
|
break;
|
|
2700
2710
|
case "d0":
|
|
2701
|
-
e.request = "coin-purse:config", e = i(this,
|
|
2711
|
+
e.request = "coin-purse:config", e = i(this, h, Qt).call(this, t[2], e);
|
|
2702
2712
|
break;
|
|
2703
2713
|
case "d1":
|
|
2704
|
-
e.request = "banknote-purse:config", e.additional = { scrow: null }, e = i(this,
|
|
2714
|
+
e.request = "banknote-purse:config", e.additional = { scrow: null }, e = i(this, h, Vt).call(this, t, e);
|
|
2705
2715
|
break;
|
|
2706
2716
|
case "d2":
|
|
2707
|
-
e.request = "coin-purse:read-tubes", e = i(this,
|
|
2717
|
+
e.request = "coin-purse:read-tubes", e = i(this, h, Jt).call(this, t, e);
|
|
2708
2718
|
break;
|
|
2709
2719
|
case "d3":
|
|
2710
|
-
e.request = "banknote-purse:read-recycler", e = i(this,
|
|
2720
|
+
e.request = "banknote-purse:read-recycler", e = i(this, h, zt).call(this, t, e);
|
|
2711
2721
|
break;
|
|
2712
2722
|
case "d4":
|
|
2713
|
-
e.request = "banknote-purse:banknote-scrow-status", e = i(this,
|
|
2723
|
+
e.request = "banknote-purse:banknote-scrow-status", e = i(this, h, Gt).call(this, t[2], e);
|
|
2714
2724
|
break;
|
|
2715
2725
|
case "d5":
|
|
2716
|
-
e.request = "banknote-purse:dispense", e = i(this,
|
|
2726
|
+
e.request = "banknote-purse:dispense", e = i(this, h, Yt).call(this, t, e);
|
|
2717
2727
|
break;
|
|
2718
2728
|
case "d6":
|
|
2719
|
-
e.request = "coin-purse:dispense", e = i(this,
|
|
2729
|
+
e.request = "coin-purse:dispense", e = i(this, h, Kt).call(this, t, e);
|
|
2720
2730
|
break;
|
|
2721
2731
|
case "d7":
|
|
2722
|
-
e.request = "dispense", e = i(this,
|
|
2732
|
+
e.request = "dispense", e = i(this, h, Zt).call(this, t[5], e);
|
|
2723
2733
|
break;
|
|
2724
2734
|
case "d8":
|
|
2725
|
-
e.request = "--automatic", e = i(this,
|
|
2735
|
+
e.request = "--automatic", e = i(this, h, Xt).call(this, t[13], e);
|
|
2726
2736
|
break;
|
|
2727
2737
|
case "d9":
|
|
2728
|
-
e.request = "status:temperature", e = i(this,
|
|
2738
|
+
e.request = "status:temperature", e = i(this, h, en).call(this, t, e);
|
|
2729
2739
|
break;
|
|
2730
2740
|
case "da":
|
|
2731
|
-
e.request = "status:relay", e = i(this,
|
|
2741
|
+
e.request = "status:relay", e = i(this, h, tn).call(this, t[2], e);
|
|
2732
2742
|
break;
|
|
2733
2743
|
case "db":
|
|
2734
2744
|
e.request = "banknote-purse:save-memory", e.no_code = 18, e.name = "Bill purse memory saved?", e.description = "The memory of bill purse was saved successfully?", this.dispatch("banknote-purse:save-memory", { message: e });
|
|
@@ -2737,7 +2747,7 @@ class Tn extends G {
|
|
|
2737
2747
|
e.request = "coin-purse:read-memory", e.no_code = 19, e.name = "Coin purse memory read?", e.description = "The memory of coin purse was read successfully?", this.dispatch("banknote-purse:read-memory", { message: e });
|
|
2738
2748
|
break;
|
|
2739
2749
|
case "dd":
|
|
2740
|
-
e.request = "card-reader", i(this,
|
|
2750
|
+
e.request = "card-reader", i(this, h, nn).call(this, t, e);
|
|
2741
2751
|
break;
|
|
2742
2752
|
default:
|
|
2743
2753
|
e.request = "--unknown", e.name = "Response unrecognized", e.description = "The response of application was received, but dont identify with any of current parameters", e.no_code = 400, this.dispatch("unknown", e);
|
|
@@ -2752,7 +2762,7 @@ class Tn extends G {
|
|
|
2752
2762
|
async coinPurseConfigure({ enable: t = !1, high: e = "FF", low: n = "FF" } = {}) {
|
|
2753
2763
|
if (!this.__coin_purse.available) throw new Error("Coin purse not available");
|
|
2754
2764
|
const c = ["F1", "C1", t ? "01" : "00", e, n, "00", "00", "00", "00", "00", "F2", "00"];
|
|
2755
|
-
await i(this,
|
|
2765
|
+
await i(this, h, q).call(this, c, "coin-purse:config");
|
|
2756
2766
|
}
|
|
2757
2767
|
async coinPurseEnable() {
|
|
2758
2768
|
await this.coinPurseConfigure({ enable: !0 });
|
|
@@ -2760,40 +2770,40 @@ class Tn extends G {
|
|
|
2760
2770
|
async coinPurseDisable() {
|
|
2761
2771
|
await this.coinPurseConfigure({ enable: !1 });
|
|
2762
2772
|
}
|
|
2763
|
-
async coinPurseDispense({ $_50c: t = 0, $_1: e = 0, $_2: n = 0, $_5:
|
|
2773
|
+
async coinPurseDispense({ $_50c: t = 0, $_1: e = 0, $_2: n = 0, $_5: s = 0, $_10: c = 0 } = {}) {
|
|
2764
2774
|
if (!this.__coin_purse.available) throw new Error("Coin purse not available");
|
|
2765
|
-
if ([t, e, n,
|
|
2775
|
+
if ([t, e, n, s, c].some((d) => isNaN(d) || typeof d == "string"))
|
|
2766
2776
|
throw new Error("One of the values is not a number");
|
|
2767
|
-
if (t < 1 && e < 1 && n < 1 &&
|
|
2768
|
-
[t, e, n,
|
|
2777
|
+
if (t < 1 && e < 1 && n < 1 && s < 1 && c < 1) throw new Error("No coins to dispense");
|
|
2778
|
+
[t, e, n, s, c] = [
|
|
2769
2779
|
this.decToHex(t),
|
|
2770
2780
|
this.decToHex(e),
|
|
2771
2781
|
this.decToHex(n),
|
|
2772
|
-
this.decToHex(
|
|
2782
|
+
this.decToHex(s),
|
|
2773
2783
|
this.decToHex(c)
|
|
2774
2784
|
];
|
|
2775
|
-
let u = ["F1", "C6", t, e, n,
|
|
2776
|
-
await i(this,
|
|
2785
|
+
let u = ["F1", "C6", t, e, n, s, c, "00", "00", "00", "F2", "00"];
|
|
2786
|
+
await i(this, h, q).call(this, u, "coin-purse:dispense");
|
|
2777
2787
|
}
|
|
2778
2788
|
async coinPurseReadTubes() {
|
|
2779
2789
|
const t = ["F1", "C2", "00", "00", "00", "00", "00", "00", "00", "00", "F2", "00"];
|
|
2780
|
-
await i(this,
|
|
2790
|
+
await i(this, h, q).call(this, t, "coin-purse:read-tubes");
|
|
2781
2791
|
}
|
|
2782
2792
|
async banknotePurseConfigure({ enable: t = !1, scrow: e = !1 } = {}) {
|
|
2783
2793
|
if (!this.__banknote_purse.available) throw new Error("Banknote purse not available");
|
|
2784
2794
|
let n;
|
|
2785
|
-
return i(this,
|
|
2795
|
+
return i(this, h, he).call(this) ? n = i(this, h, rn).call(this, { enable: t, scrow: e }) : n = i(this, h, sn).call(this, { enable: t, scrow: e }), await i(this, h, q).call(this, n, "banknote-purse:config");
|
|
2786
2796
|
}
|
|
2787
|
-
async banknotePurseDispense({ $_20: t = 0, $_50: e = 0, $_100: n = 0, $_200:
|
|
2797
|
+
async banknotePurseDispense({ $_20: t = 0, $_50: e = 0, $_100: n = 0, $_200: s = 0, $_500: c = 0, $_1000: u = 0 } = {}) {
|
|
2788
2798
|
if (!this.__banknote_purse.available) throw new Error("Banknote purse not available");
|
|
2789
2799
|
if (!this.__banknote_purse.isRecycler) throw new Error("Banknote purse is not recycler");
|
|
2790
|
-
let
|
|
2791
|
-
if (i(this,
|
|
2792
|
-
const b = [t, e, n,
|
|
2793
|
-
|
|
2800
|
+
let d;
|
|
2801
|
+
if (i(this, h, he).call(this)) {
|
|
2802
|
+
const b = [t, e, n, s, c];
|
|
2803
|
+
d = i(this, h, an).call(this, b[this.__banknote_purse.recycler.banknote]);
|
|
2794
2804
|
} else
|
|
2795
|
-
|
|
2796
|
-
await i(this,
|
|
2805
|
+
d = i(this, h, on).call(this, { $_20: t, $_50: e, $_100: n, $_200: s, $_500: c, $_1000: u });
|
|
2806
|
+
await i(this, h, q).call(this, d, "banknote-purse:dispense");
|
|
2797
2807
|
}
|
|
2798
2808
|
async banknotePurseEnable({ scrow: t = !1 }) {
|
|
2799
2809
|
return await this.banknotePurseConfigure({ enable: !0, scrow: t });
|
|
@@ -2804,24 +2814,24 @@ class Tn extends G {
|
|
|
2804
2814
|
async banknotePurseAcceptInScrow() {
|
|
2805
2815
|
if (!this.__banknote_purse.available) throw new Error("Banknote purse not available");
|
|
2806
2816
|
const t = ["F1", "C4", "01", "00", "00", "00", "00", "00", "00", "00", "F2", "00"];
|
|
2807
|
-
await i(this,
|
|
2817
|
+
await i(this, h, q).call(this, t, "banknote-purse:banknote-scrow-status");
|
|
2808
2818
|
}
|
|
2809
2819
|
async banknotePurseRejectInScrow() {
|
|
2810
2820
|
if (!this.__banknote_purse.available) throw new Error("Banknote purse not available");
|
|
2811
2821
|
const t = ["F1", "C4", "00", "00", "00", "00", "00", "00", "00", "00", "F2", "00"];
|
|
2812
|
-
await i(this,
|
|
2822
|
+
await i(this, h, q).call(this, t, "banknote-purse:banknote-scrow-status");
|
|
2813
2823
|
}
|
|
2814
2824
|
async banknotePurseSaveMemory({
|
|
2815
2825
|
channel: t = null,
|
|
2816
2826
|
$_20: e = null,
|
|
2817
2827
|
$_50: n = null,
|
|
2818
|
-
$_100:
|
|
2828
|
+
$_100: s = null,
|
|
2819
2829
|
$_200: c = null,
|
|
2820
2830
|
$_500: u = null,
|
|
2821
|
-
$_1000:
|
|
2831
|
+
$_1000: d = null
|
|
2822
2832
|
} = {}) {
|
|
2823
2833
|
if (!this.__banknote_purse.available) throw new Error("Banknote purse not available");
|
|
2824
|
-
if (t === null || e === null || n === null ||
|
|
2834
|
+
if (t === null || e === null || n === null || s === null || c === null || u === null || d === null)
|
|
2825
2835
|
throw new Error("One of the values is not defined");
|
|
2826
2836
|
const b = [
|
|
2827
2837
|
"F1",
|
|
@@ -2830,39 +2840,39 @@ class Tn extends G {
|
|
|
2830
2840
|
"00",
|
|
2831
2841
|
this.decToHex(e),
|
|
2832
2842
|
this.decToHex(n),
|
|
2833
|
-
this.decToHex(
|
|
2843
|
+
this.decToHex(s),
|
|
2834
2844
|
this.decToHex(c),
|
|
2835
2845
|
this.decToHex(u),
|
|
2836
|
-
this.decToHex(
|
|
2846
|
+
this.decToHex(d),
|
|
2837
2847
|
"F2",
|
|
2838
2848
|
"00"
|
|
2839
2849
|
];
|
|
2840
|
-
await i(this,
|
|
2850
|
+
await i(this, h, q).call(this, b, "banknote-purse:save-memory");
|
|
2841
2851
|
}
|
|
2842
2852
|
async banknotePurseReadRecycler() {
|
|
2843
2853
|
if (!this.__banknote_purse.available) throw new Error("Banknote purse not available");
|
|
2844
2854
|
if (!this.__banknote_purse.isRecycler) throw new Error("Banknote purse is not recycler");
|
|
2845
2855
|
const t = ["F1", "C3", "00", "00", "00", "00", "00", "00", "00", "00", "F2", "B5"];
|
|
2846
|
-
return await i(this,
|
|
2856
|
+
return await i(this, h, q).call(this, t, "banknote-purse:read-recycler");
|
|
2847
2857
|
}
|
|
2848
2858
|
async cardReaderDisable() {
|
|
2849
2859
|
if (!this.card_reader.available) throw new Error("Card reader not available");
|
|
2850
2860
|
const t = ["F1", "CD", "00", "00", "00", "00", "00", "00", "00", "00", "F2", "00"];
|
|
2851
|
-
return await i(this,
|
|
2861
|
+
return await i(this, h, q).call(this, t, "card-reader:disable");
|
|
2852
2862
|
}
|
|
2853
|
-
async cardReaderDispense({ channel: t = 1, second_channel: e = null, sensor: n = !0, seconds:
|
|
2863
|
+
async cardReaderDispense({ channel: t = 1, second_channel: e = null, sensor: n = !0, seconds: s = null, price: c = 0 } = {}) {
|
|
2854
2864
|
if (!this.card_reader.available) throw new Error("Card reader not available");
|
|
2855
2865
|
if (isNaN(this.card_reader.max_pre_credit) || this.card_reader.max_pre_credit === 0) throw new Error("Card reader pre-credit not configured");
|
|
2856
2866
|
if (isNaN(c) || c <= 0) throw new Error("Price must be greater than 0");
|
|
2857
2867
|
if (c > this.card_reader.max_pre_credit) throw new Error("Price is greater than pre-credit configured");
|
|
2858
|
-
if (!n && (
|
|
2859
|
-
const u = this.decToHex(c / 256),
|
|
2868
|
+
if (!n && (s === null || s <= 0 || s > 40)) throw new Error("Invalid time to dispense without sensor, must be between 0.1 and 40.0 seconds");
|
|
2869
|
+
const u = this.decToHex(c / 256), d = this.decToHex(c % 256), b = this.decToHex(t + 9);
|
|
2860
2870
|
let g = "00";
|
|
2861
2871
|
e && (g = this.decToHex(e + 9));
|
|
2862
2872
|
let T = "00";
|
|
2863
|
-
n || (T = this.decToHex(
|
|
2864
|
-
const I = ["F1", "CD", "01", b, g, T, u,
|
|
2865
|
-
await i(this,
|
|
2873
|
+
n || (T = this.decToHex(s * 10));
|
|
2874
|
+
const I = ["F1", "CD", "01", b, g, T, u, d, "00", "00", "F2", "00"];
|
|
2875
|
+
await i(this, h, q).call(this, I, "card-reader:dispense");
|
|
2866
2876
|
}
|
|
2867
2877
|
async paymentPursesDisable({ coin: t = !0, banknote: e = !0, cardReader: n = !1 } = {}) {
|
|
2868
2878
|
t && await this.coinPurseDisable(), e && await this.banknotePurseDisable(), n && await this.cardReaderDisable();
|
|
@@ -2872,7 +2882,7 @@ class Tn extends G {
|
|
|
2872
2882
|
}
|
|
2873
2883
|
async coolingRelayConfigure({ enable: t = !1 } = {}) {
|
|
2874
2884
|
const n = ["F1", "CC", t ? "01" : "00", "00", "00", "00", "00", "00", "00", "00", "F2", "00"];
|
|
2875
|
-
return await i(this,
|
|
2885
|
+
return await i(this, h, q).call(this, n, "status:relay");
|
|
2876
2886
|
}
|
|
2877
2887
|
async coolingRelayEnable() {
|
|
2878
2888
|
return await this.coolingRelayConfigure({ enable: !0 });
|
|
@@ -2882,7 +2892,7 @@ class Tn extends G {
|
|
|
2882
2892
|
}
|
|
2883
2893
|
async readTemperature() {
|
|
2884
2894
|
const t = ["F1", "CB", "00", "00", "00", "00", "00", "00", "00", "00", "F2", "00"];
|
|
2885
|
-
return await i(this,
|
|
2895
|
+
return await i(this, h, q).call(this, t, "status:temperature");
|
|
2886
2896
|
}
|
|
2887
2897
|
/**
|
|
2888
2898
|
* Dispense a product from the machine
|
|
@@ -2897,64 +2907,64 @@ class Tn extends G {
|
|
|
2897
2907
|
selection: t = 1,
|
|
2898
2908
|
second_selection: e = null,
|
|
2899
2909
|
sensor: n = !0,
|
|
2900
|
-
seconds:
|
|
2910
|
+
seconds: s = null,
|
|
2901
2911
|
retry: c = !0
|
|
2902
2912
|
} = {}) {
|
|
2903
2913
|
if (t = parseInt(t), isNaN(t) || t < 1 || t > 80) throw new Error("Invalid channel number");
|
|
2904
2914
|
if (e !== null && (e < 1 || e > 80 || e === t)) throw new Error("Invalid second channel number");
|
|
2905
|
-
if (!n && (
|
|
2915
|
+
if (!n && (s === null || s <= 0 || s > 40)) throw new Error("Invalid time to dispense without sensor, must be between 0.1 and 40.0 seconds");
|
|
2906
2916
|
c && (this.__internal__.dispense.backup_dispense = {
|
|
2907
2917
|
selection: t,
|
|
2908
2918
|
second_selection: e,
|
|
2909
2919
|
sensor: n,
|
|
2910
|
-
seconds:
|
|
2920
|
+
seconds: s
|
|
2911
2921
|
}), t += 9;
|
|
2912
2922
|
const u = this.decToHex(t);
|
|
2913
|
-
let
|
|
2914
|
-
e && (e += 9,
|
|
2923
|
+
let d = "00";
|
|
2924
|
+
e && (e += 9, d = this.decToHex(e));
|
|
2915
2925
|
let b = "00";
|
|
2916
|
-
n || (b = this.decToHex(Math.round(
|
|
2917
|
-
const g = i(this,
|
|
2926
|
+
n || (b = this.decToHex(Math.round(s * 6.2)), this.__internal__.dispense.custom_limit_counter = s);
|
|
2927
|
+
const g = i(this, h, de).call(this, ["F1", "C7", u, d, b, "00", "00", "00", "00", "00", "F2", "00"]);
|
|
2918
2928
|
let T = await this.internalDispense(g);
|
|
2919
2929
|
return !T.dispensed && c && (T = await this.internalDispense(g)), this.__internal__.dispense.custom_limit_counter = null, T;
|
|
2920
2930
|
}
|
|
2921
2931
|
async testEngines({ singleEngine: t = !1 } = {}) {
|
|
2922
2932
|
if (this.isDispensing) throw new Error("Another dispensing process is running");
|
|
2923
|
-
i(this,
|
|
2933
|
+
i(this, h, De).call(this), x(this, ee, !0);
|
|
2924
2934
|
const e = [];
|
|
2925
|
-
i(this,
|
|
2935
|
+
i(this, h, ue).call(this);
|
|
2926
2936
|
for (let n = 1; n <= 80; n++) {
|
|
2927
|
-
const
|
|
2937
|
+
const s = await this.dispense({
|
|
2928
2938
|
selection: n,
|
|
2929
2939
|
second_selection: t ? null : n + 1,
|
|
2930
2940
|
sensor: !1,
|
|
2931
2941
|
seconds: 0.4,
|
|
2932
2942
|
retry: !1
|
|
2933
2943
|
});
|
|
2934
|
-
e.push(
|
|
2944
|
+
e.push(s), x(this, V, n), i(this, h, ue).call(this), t || n++;
|
|
2935
2945
|
}
|
|
2936
|
-
x(this, V, 80), i(this,
|
|
2946
|
+
x(this, V, 80), i(this, h, ue).call(this, { dispensed: e }), i(this, h, De).call(this);
|
|
2937
2947
|
}
|
|
2938
2948
|
async sendCustomCode({ code: t = [] } = {}) {
|
|
2939
2949
|
if (t.length === 0) throw new Error("Invalid code");
|
|
2940
|
-
const e = i(this,
|
|
2950
|
+
const e = i(this, h, de).call(this, t);
|
|
2941
2951
|
await this.appendToQueue(e, "custom");
|
|
2942
2952
|
}
|
|
2943
2953
|
hasToReturnChange(t = 0) {
|
|
2944
2954
|
let e = t;
|
|
2945
|
-
return e <= 0 ? !0 : (e = i(this,
|
|
2955
|
+
return e <= 0 ? !0 : (e = i(this, h, Ee).call(this, e).pending, e = i(this, h, Ie).call(this, e).pending, !(e > 0));
|
|
2946
2956
|
}
|
|
2947
2957
|
async returnChange() {
|
|
2948
|
-
return await i(this,
|
|
2958
|
+
return await i(this, h, Se).call(this);
|
|
2949
2959
|
}
|
|
2950
2960
|
async returnInsertedMoney() {
|
|
2951
|
-
return this.__money_session.inserted <= 0 ? !1 : await i(this,
|
|
2961
|
+
return this.__money_session.inserted <= 0 ? !1 : await i(this, h, Se).call(this, this.__money_session.inserted);
|
|
2952
2962
|
}
|
|
2953
2963
|
async serialCorruptMessage(t, e) {
|
|
2954
2964
|
this.dispatch("corrupt:message", { data: t, message: e });
|
|
2955
2965
|
}
|
|
2956
2966
|
}
|
|
2957
|
-
ee = new WeakMap(), V = new WeakMap(), J = new WeakMap(),
|
|
2967
|
+
ee = new WeakMap(), V = new WeakMap(), J = new WeakMap(), h = new WeakSet(), Nt = function() {
|
|
2958
2968
|
const t = [
|
|
2959
2969
|
"banknote-purse:banknote-scrow-status",
|
|
2960
2970
|
"banknote-purse:config",
|
|
@@ -2981,13 +2991,13 @@ ee = new WeakMap(), V = new WeakMap(), J = new WeakMap(), d = new WeakSet(), Nt
|
|
|
2981
2991
|
this.serialRegisterAvailableListener(e);
|
|
2982
2992
|
}, At = function() {
|
|
2983
2993
|
D.add(this);
|
|
2984
|
-
},
|
|
2994
|
+
}, he = function() {
|
|
2985
2995
|
return this.__banknote_purse.isRecycler && this.__banknote_purse.recycler.ict;
|
|
2986
2996
|
}, Bt = function() {
|
|
2987
2997
|
return this.hasCoinPurse || this.hasRecycler;
|
|
2988
|
-
}, Rt = function(t) {
|
|
2989
|
-
return t.name = "Connection with the serial device completed.", t.description = "Your connection with the serial device was successfully completed.", t.no_code = 1, this.dispatch("run:default-load", {}), t;
|
|
2990
2998
|
}, qt = function(t) {
|
|
2999
|
+
return t.name = "Connection with the serial device completed.", t.description = "Your connection with the serial device was successfully completed.", t.no_code = 1, this.dispatch("run:default-load", {}), t;
|
|
3000
|
+
}, Rt = function(t) {
|
|
2991
3001
|
const e = {
|
|
2992
3002
|
g50: ["40", "50", "60", "70", "90"],
|
|
2993
3003
|
c50: ["41", "51", "61", "71", "91"],
|
|
@@ -3052,38 +3062,38 @@ ee = new WeakMap(), V = new WeakMap(), J = new WeakMap(), d = new WeakSet(), Nt
|
|
|
3052
3062
|
}, Te = function(t, e) {
|
|
3053
3063
|
if (!t) return;
|
|
3054
3064
|
let n = !0;
|
|
3055
|
-
if (i(this,
|
|
3065
|
+
if (i(this, h, Ht).call(this, t)) {
|
|
3056
3066
|
if (typeof this.coins.tubes[t] > "u") return;
|
|
3057
3067
|
e === "tube" ? this.coins.tubes[t] += 1 : e === "box" && (this.coins.box[t] += 1);
|
|
3058
|
-
let
|
|
3059
|
-
["g50", "c50"].includes(t) ?
|
|
3060
|
-
} else if (i(this,
|
|
3068
|
+
let s = 0;
|
|
3069
|
+
["g50", "c50"].includes(t) ? s = 0.5 : s += parseInt(t.slice(1)), this.coins.totals[t] += s, this.__money_session.inserted += s, this.coins.total += s;
|
|
3070
|
+
} else if (i(this, h, Ot).call(this, t)) {
|
|
3061
3071
|
if (typeof this.banknotes.tubes[t] > "u") return;
|
|
3062
3072
|
e === "recycler" ? this.banknotes.recycler[t] += 1 : e === "stacker" && (this.banknotes.stacker[t] += 1);
|
|
3063
|
-
let
|
|
3064
|
-
this.banknotes.totals[t] +=
|
|
3065
|
-
} else if (i(this,
|
|
3073
|
+
let s = parseInt(t.slice(1));
|
|
3074
|
+
this.banknotes.totals[t] += s, this.__money_session.inserted += s, this.banknotes.total += s;
|
|
3075
|
+
} else if (i(this, h, Ut).call(this, t) && e === "out") {
|
|
3066
3076
|
if (typeof this.banknotes.out[t] > "u") return;
|
|
3067
3077
|
this.banknotes.out[t] += 1;
|
|
3068
|
-
let
|
|
3069
|
-
this.__money_session.retired +=
|
|
3078
|
+
let s = parseInt(t.slice(1));
|
|
3079
|
+
this.__money_session.retired += s, this.banknotes.recycler[t] -= 1, this.banknotes.total -= s, n = !1, this.dispatch("session:money-dispensed", { type_money: t, retired: s, finish: !1, type: "banknotes" });
|
|
3070
3080
|
}
|
|
3071
3081
|
n && this.dispatch("session:money-request", {});
|
|
3072
3082
|
}, Wt = function(t, e) {
|
|
3073
3083
|
const n = parseInt(t[2], 16);
|
|
3074
|
-
return e.name = "Coin Inserted", e.no_code = 2, e.additional = { where: null, coin: null }, n === 1 ? (e.name = "Lever pressed", e.description = "Reject lever", e.no_code = 100, this.dispatch("coin-purse:reject-lever", {})) : n === 2 ? (e.name = "Reset coin purse", e.description = "The configuration of coin purse was reset", e.no_code = 101, this.dispatch("coin-purse:reset", {})) : n >= 64 && n <= 79 ? (e.name = "Coin inserted in profit box", e.additional.where = "box") : n >= 80 && n <= 95 ? (e.name = "Coin inserted in tube", e.additional.where = "tube") : n >= 96 && n <= 111 ? (e.name = "Unused coin", e.description = "Something come from coin changer but in MDB Docs is unused", e.additional.where = "unused") : n >= 112 && n <= 127 ? (e.name = "Coin rejected", e.additional.where = "rejected") : n >= 144 && n <= 159 ? (e.name = "Coin dispensed", e.additional.where = "out", e.description = `Undefined value: ¿${t[2]}?`) : (e.name = "Coin inserted", e.description = "Undefined status. Without information of this", e.no_code = 400), n === 1 || n === 2 || n >= 160 || n >= 128 && n <= 143 || ([e.description, e.additional.coin] = i(this,
|
|
3084
|
+
return e.name = "Coin Inserted", e.no_code = 2, e.additional = { where: null, coin: null }, n === 1 ? (e.name = "Lever pressed", e.description = "Reject lever", e.no_code = 100, this.dispatch("coin-purse:reject-lever", {})) : n === 2 ? (e.name = "Reset coin purse", e.description = "The configuration of coin purse was reset", e.no_code = 101, this.dispatch("coin-purse:reset", {})) : n >= 64 && n <= 79 ? (e.name = "Coin inserted in profit box", e.additional.where = "box") : n >= 80 && n <= 95 ? (e.name = "Coin inserted in tube", e.additional.where = "tube") : n >= 96 && n <= 111 ? (e.name = "Unused coin", e.description = "Something come from coin changer but in MDB Docs is unused", e.additional.where = "unused") : n >= 112 && n <= 127 ? (e.name = "Coin rejected", e.additional.where = "rejected") : n >= 144 && n <= 159 ? (e.name = "Coin dispensed", e.additional.where = "out", e.description = `Undefined value: ¿${t[2]}?`) : (e.name = "Coin inserted", e.description = "Undefined status. Without information of this", e.no_code = 400), n === 1 || n === 2 || n >= 160 || n >= 128 && n <= 143 || ([e.description, e.additional.coin] = i(this, h, Rt).call(this, t[2]), e.no_code = 38 + n, i(this, h, Te).call(this, e.additional.coin, e.additional.where), ["tube", "out"].includes(e.additional.where) && this.dispatch("coin-purse:tubes", this.coins.tubes), this.dispatch("coin-purse:coin-event", this.coins)), e;
|
|
3075
3085
|
}, $t = function(t, e) {
|
|
3076
3086
|
const n = parseInt(t[2], 16);
|
|
3077
|
-
return e.name = "Banknote Inserted", e.no_code = 2, e.additional = { where: null, banknote: null }, n === 42 ? (e.name = "Banknote dispensed", e.description = "Banknote dispensed by request.", e.additional.banknote = i(this,
|
|
3087
|
+
return e.name = "Banknote Inserted", e.no_code = 2, e.additional = { where: null, banknote: null }, n === 42 ? (e.name = "Banknote dispensed", e.description = "Banknote dispensed by request.", e.additional.banknote = i(this, h, jt).call(this), e.additional.where = "out", e.no_code = 200) : n >= 128 && n <= 143 ? (e.name = "Banknote inserted", e.additional.where = "stacker") : n >= 144 && n <= 159 ? (e.name = "Banknote inserted in pre stacker", e.additional.where = "tmp") : n >= 160 && n <= 175 ? (e.name = "Banknote rejected", e.additional.where = "nothing") : n >= 176 && n <= 191 && (e.name = "Banknote inserted", e.additional.where = "recycler"), n >= 128 && n <= 191 && ([e.description, e.additional.banknote] = i(this, h, Lt).call(this, t[2]), e.no_code = 74 + n), i(this, h, Te).call(this, e.additional.banknote, e.additional.where), this.dispatch("banknote-purse:event-banknote", this.banknotes), e;
|
|
3078
3088
|
}, Qt = function(t, e) {
|
|
3079
3089
|
const n = parseInt(t, 16);
|
|
3080
3090
|
return n === 1 ? (e.name = "Coin purse enabled", e.description = "Configuration complete, enabled", e.no_code = 3) : n === 0 ? (e.name = "Coin purse disabled", e.description = "Disabled by system request", e.no_code = 4) : (e.name = "Status unknown", e.description = "The response of coin purse doesn't identify successfully", e.no_code = 400), this.dispatch("coin-purse:config", { enabled: n === 1 }), e;
|
|
3081
3091
|
}, Vt = function(t, e) {
|
|
3082
|
-
const n = parseInt(t[2], 16),
|
|
3083
|
-
return n === 0 ? (e.name = "Bill purse disabled", e.description = "Configuration complete, disabled") : n === 1 && (e.name = "Bill purse enabled", e.description = "Configuration complete, enabled"),
|
|
3092
|
+
const n = parseInt(t[2], 16), s = parseInt(t[3], 16);
|
|
3093
|
+
return n === 0 ? (e.name = "Bill purse disabled", e.description = "Configuration complete, disabled") : n === 1 && (e.name = "Bill purse enabled", e.description = "Configuration complete, enabled"), s === 0 ? e.additional.scrow = "Scrow disabled, banknote received automatic" : s === 1 && (e.additional.scrow = "Scrow enabled, require manual action"), e.no_code = 5, this.dispatch("banknote-purse:config", { enabled: n === 1, scrow: s === 1 }), e;
|
|
3084
3094
|
}, Jt = function(t, e) {
|
|
3085
3095
|
e.no_code = 6;
|
|
3086
|
-
const [n,
|
|
3096
|
+
const [n, s, c, u, d, b] = [
|
|
3087
3097
|
parseInt(t[2], 16),
|
|
3088
3098
|
parseInt(t[3], 16),
|
|
3089
3099
|
parseInt(t[4], 16),
|
|
@@ -3092,11 +3102,11 @@ ee = new WeakMap(), V = new WeakMap(), J = new WeakMap(), d = new WeakSet(), Nt
|
|
|
3092
3102
|
parseInt(t[7], 16)
|
|
3093
3103
|
];
|
|
3094
3104
|
return e.additional = {
|
|
3095
|
-
coins: { g50: n, c50:
|
|
3096
|
-
}, this.coins.tubes.g50 = n, this.coins.tubes.c50 =
|
|
3105
|
+
coins: { g50: n, c50: s, p1: c, p2: u, p5: d, p10: b }
|
|
3106
|
+
}, this.coins.tubes.g50 = n, this.coins.tubes.c50 = s, this.coins.tubes.p1 = c, this.coins.tubes.p2 = u, this.coins.tubes.p5 = d, this.coins.tubes.p10 = b, this.coins.totals.g50 = (this.coins.box.g50 + n) * 0.5, this.coins.totals.c50 = (this.coins.box.c50 + s) * 0.5, this.coins.totals.p1 = this.coins.box.p1 + c, this.coins.totals.p2 = (this.coins.box.p2 + u) * 2, this.coins.totals.p5 = (this.coins.box.p5 + d) * 5, this.coins.totals.p10 = (this.coins.box.p10 + b) * 10, this.coins.total = this.coins.totals.g50 + this.coins.totals.c50 + this.coins.totals.p1 + this.coins.totals.p2 + this.coins.totals.p5 + this.coins.totals.p10, e.name = "Read tubes", e.description = "Quantity of coins approximated", this.dispatch("coin-purse:tubes", this.coins.tubes), e;
|
|
3097
3107
|
}, zt = function(t, e) {
|
|
3098
3108
|
e.no_code = 7;
|
|
3099
|
-
const [n,
|
|
3109
|
+
const [n, s, c, u, d, b] = [
|
|
3100
3110
|
parseInt(t[2], 16),
|
|
3101
3111
|
parseInt(t[3], 16),
|
|
3102
3112
|
parseInt(t[4], 16),
|
|
@@ -3105,22 +3115,22 @@ ee = new WeakMap(), V = new WeakMap(), J = new WeakMap(), d = new WeakSet(), Nt
|
|
|
3105
3115
|
parseInt(t[7], 16)
|
|
3106
3116
|
];
|
|
3107
3117
|
return e.additional = {
|
|
3108
|
-
banknotes: { b20: n, b50:
|
|
3109
|
-
}, this.banknotes.recycler.p20 = n, this.banknotes.recycler.p50 =
|
|
3118
|
+
banknotes: { b20: n, b50: s, b100: c, b200: u, b500: d, b1000: b }
|
|
3119
|
+
}, this.banknotes.recycler.p20 = n, this.banknotes.recycler.p50 = s, this.banknotes.recycler.p100 = c, this.banknotes.recycler.p200 = u, this.banknotes.recycler.p500 = d, this.banknotes.recycler.p1000 = b, this.banknotes.totals.p20 = (this.banknotes.stacker.p20 + n) * 20, this.banknotes.totals.p50 = (this.banknotes.stacker.p50 + s) * 50, this.banknotes.totals.p100 = (this.banknotes.stacker.p100 + c) * 100, this.banknotes.totals.p200 = (this.banknotes.stacker.p200 + u) * 200, this.banknotes.totals.p500 = (this.banknotes.stacker.p500 + d) * 500, this.banknotes.totals.p1000 = (this.banknotes.stacker.p1000 + b) * 1e3, this.banknotes.total = this.banknotes.totals.p20 + this.banknotes.totals.p50 + this.banknotes.totals.p100 + this.banknotes.totals.p200 + this.banknotes.totals.p500 + this.banknotes.totals.p1000, e.name = "Read recycler", e.description = "Quantity of banknotes approximated", this.dispatch("banknote-purse:recycler", this.banknotes.recycler), e;
|
|
3110
3120
|
}, Gt = function(t, e) {
|
|
3111
3121
|
const n = parseInt(t, 16);
|
|
3112
3122
|
return n === 1 ? e.name = "Banknote accepted" : n === 0 ? e.name = "Banknote rejected" : e.name = "Unknown status banknote", e.no_code = 8, this.dispatch("banknote-purse:banknote-scrow-status", { status: n === 1 }), e;
|
|
3113
3123
|
}, Yt = function(t, e) {
|
|
3114
|
-
const [n,
|
|
3124
|
+
const [n, s, c, u, d, b] = [
|
|
3115
3125
|
parseInt(t[2], 16),
|
|
3116
3126
|
parseInt(t[3], 16),
|
|
3117
3127
|
parseInt(t[4], 16),
|
|
3118
3128
|
parseInt(t[5], 16),
|
|
3119
3129
|
parseInt(t[6], 16),
|
|
3120
3130
|
parseInt(t[7], 16)
|
|
3121
|
-
], g = n * 20 +
|
|
3131
|
+
], g = n * 20 + s * 50 + c * 100 + u * 200 + d * 500 + b * 1e3;
|
|
3122
3132
|
return e.name = "Banknotes dispensed", e.description = g > 0 ? "Banknotes dispensed by request" : "No banknotes dispensed, recycler empty", e.no_code = 9, e.additional = {
|
|
3123
|
-
banknotes: { b20: n, b50:
|
|
3133
|
+
banknotes: { b20: n, b50: s, b100: c, b200: u, b500: d, b1000: b },
|
|
3124
3134
|
total_dispensed: g
|
|
3125
3135
|
}, this.dispatch("session:money-dispensed", {
|
|
3126
3136
|
type_money: null,
|
|
@@ -3143,16 +3153,16 @@ ee = new WeakMap(), V = new WeakMap(), J = new WeakMap(), d = new WeakSet(), Nt
|
|
|
3143
3153
|
let n = "closed";
|
|
3144
3154
|
return t === "db" ? (e.name = "Door closed", e.no_code = 13) : t === "dc" ? (e.name = "Door open", e.no_code = 14, n = "open") : (e.name = "Unknown status door", e.description = "The response of door doesn't identify successfully", e.no_code = 400, n = "unknown"), this.dispatch("event:door", { open: n === "open" }), e;
|
|
3145
3155
|
}, en = function(t, e) {
|
|
3146
|
-
const n = parseInt(t[2], 16) * 255,
|
|
3156
|
+
const n = parseInt(t[2], 16) * 255, s = parseInt(t[3], 16), c = (n + s) * 0.1;
|
|
3147
3157
|
return e.no_code = 15, e.name = "Temperature status", e.description = `Temperature: ${c}`, e.additional = {
|
|
3148
3158
|
high: n,
|
|
3149
|
-
low:
|
|
3159
|
+
low: s,
|
|
3150
3160
|
temperature: parseFloat(c.toString())
|
|
3151
3161
|
}, this.dispatch("status:temperature", e.additional), e;
|
|
3152
3162
|
}, tn = function(t, e) {
|
|
3153
3163
|
const n = parseInt(t, 16);
|
|
3154
|
-
let
|
|
3155
|
-
return n === 1 ? (e.name = "Relay on", e.description = "Relay on", e.no_code = 16,
|
|
3164
|
+
let s = "unknown";
|
|
3165
|
+
return n === 1 ? (e.name = "Relay on", e.description = "Relay on", e.no_code = 16, s = "on") : n === 0 ? (e.name = "Relay off", e.description = "Relay off", e.no_code = 17, s = "off") : (e.name = "Status unknown", e.description = "Status unknown", e.no_code = 400), this.dispatch("status:relay", { enabled: s === "on" }), e;
|
|
3156
3166
|
}, nn = function(t, e) {
|
|
3157
3167
|
const n = parseInt(t[2], 16);
|
|
3158
3168
|
if (e.no_code = 20 + n, e.name = "Status unknown", e.description = "The status of card reader does not identified correctly", e.no_code = 400, n === 0)
|
|
@@ -3172,36 +3182,36 @@ ee = new WeakMap(), V = new WeakMap(), J = new WeakMap(), d = new WeakSet(), Nt
|
|
|
3172
3182
|
else if (n === 8)
|
|
3173
3183
|
e.request += ":cancel", e.name = "Cancelled", e.description = "Cancellation complete";
|
|
3174
3184
|
else if (n === 10) {
|
|
3175
|
-
const
|
|
3176
|
-
|
|
3185
|
+
const s = parseInt(t[8], 16);
|
|
3186
|
+
s === 0 ? (e.no_code = 30, e.name = "product not dispensed", e.description = "The product requested wasn't delivered") : s === 1 && (e.no_code = 31, e.name = "product dispensed", e.description = "The product requested was delivered");
|
|
3177
3187
|
}
|
|
3178
3188
|
return this.dispatch("card-reader:event", e), e;
|
|
3179
|
-
},
|
|
3180
|
-
return this.appendToQueue(i(this,
|
|
3181
|
-
},
|
|
3189
|
+
}, q = function(t, e) {
|
|
3190
|
+
return this.appendToQueue(i(this, h, de).call(this, t), e);
|
|
3191
|
+
}, de = function(t) {
|
|
3182
3192
|
return t[11] = this.serialBoardroidSumHex(t), t.map((e, n) => {
|
|
3183
3193
|
t[n] = this.hexMaker(e);
|
|
3184
3194
|
}), t;
|
|
3185
3195
|
}, rn = function({ enable: t = !1, scrow: e = !1 } = {}) {
|
|
3186
|
-
const n = t ? "FF" : "00",
|
|
3187
|
-
return ["F1", "C0", n, n,
|
|
3188
|
-
},
|
|
3196
|
+
const n = t ? "FF" : "00", s = e ? "FF" : "00";
|
|
3197
|
+
return ["F1", "C0", n, n, s, s, "00", "00", "00", "00", "F2", "00"];
|
|
3198
|
+
}, sn = function({ enable: t = !1, scrow: e = !1 } = {}) {
|
|
3189
3199
|
return ["F1", "C0", t ? "01" : "00", e ? "01" : "00", "00", "00", "00", "00", "00", "00", "F2", "00"];
|
|
3190
|
-
},
|
|
3200
|
+
}, an = function(t = 1) {
|
|
3191
3201
|
if (t < 1) throw new Error("No banknotes to dispense");
|
|
3192
3202
|
return t = this.decToHex(t), ["F1", "C5", this.decToHex(this.__banknote_purse.recycler.banknote.toString()), t, "00", "00", "00", "00", "00", "00", "F2", "00"];
|
|
3193
|
-
}, on = function({ $_20: t = 0, $_50: e = 0, $_100: n = 0, $_200:
|
|
3194
|
-
if ([t, e, n,
|
|
3203
|
+
}, on = function({ $_20: t = 0, $_50: e = 0, $_100: n = 0, $_200: s = 0, $_500: c = 0, $_1000: u = 0 } = {}) {
|
|
3204
|
+
if ([t, e, n, s, c, u].some((d) => isNaN(d) || typeof d == "string"))
|
|
3195
3205
|
throw new Error("One of the values is not a number");
|
|
3196
|
-
if (t < 1 && e < 1 && n < 1 &&
|
|
3197
|
-
return [t, e, n,
|
|
3206
|
+
if (t < 1 && e < 1 && n < 1 && s < 1 && c < 1 && u < 1) throw new Error("No banknotes to dispense");
|
|
3207
|
+
return [t, e, n, s, c, u] = [
|
|
3198
3208
|
this.decToHex(t),
|
|
3199
3209
|
this.decToHex(e),
|
|
3200
3210
|
this.decToHex(n),
|
|
3201
|
-
this.decToHex(
|
|
3211
|
+
this.decToHex(s),
|
|
3202
3212
|
this.decToHex(c),
|
|
3203
3213
|
this.decToHex(u)
|
|
3204
|
-
], ["F1", "C5", t, e, n,
|
|
3214
|
+
], ["F1", "C5", t, e, n, s, c, u, "00", "00", "F2", "00"];
|
|
3205
3215
|
}, De = function() {
|
|
3206
3216
|
x(this, ee, !1), x(this, V, 0), x(this, J, 0);
|
|
3207
3217
|
}, /**
|
|
@@ -3212,12 +3222,12 @@ ee = new WeakMap(), V = new WeakMap(), J = new WeakMap(), d = new WeakSet(), Nt
|
|
|
3212
3222
|
ue = function({ dispensed: t = null, limit: e = 80 } = {}) {
|
|
3213
3223
|
x(this, J, Math.round(y(this, V) * 100 / e)), this.dispatch("percentage:test", { percentage: y(this, J), dispensed: t });
|
|
3214
3224
|
}, ln = function(t) {
|
|
3215
|
-
const e = ["20", "50", "100", "200", "500"], n = "$_" + e[this.__banknote_purse.recycler.banknote],
|
|
3225
|
+
const e = ["20", "50", "100", "200", "500"], n = "$_" + e[this.__banknote_purse.recycler.banknote], s = parseInt(e[this.__banknote_purse.recycler.banknote]), c = parseInt((t / s).toString()), u = {
|
|
3216
3226
|
banknotes: { $_20: 0, $_50: 0, $_100: 0, $_200: 0, $_500: 0, $_1000: 0 },
|
|
3217
3227
|
pending: t,
|
|
3218
3228
|
will_dispense: c > 0
|
|
3219
3229
|
};
|
|
3220
|
-
return this.totalInRecycler === 0 || c < 1 || t === 0 || (u.banknotes[n] = c, u.pending = t %
|
|
3230
|
+
return this.totalInRecycler === 0 || c < 1 || t === 0 || (u.banknotes[n] = c, u.pending = t % s), u;
|
|
3221
3231
|
}, cn = function(t) {
|
|
3222
3232
|
const e = {
|
|
3223
3233
|
banknotes: { $_20: 0, $_50: 0, $_100: 0, $_200: 0, $_500: 0, $_1000: 0 },
|
|
@@ -3226,7 +3236,7 @@ ue = function({ dispensed: t = null, limit: e = 80 } = {}) {
|
|
|
3226
3236
|
};
|
|
3227
3237
|
return this.totalInRecycler === 0 || t === 0 || (e.banknotes.$_1000 = parseInt((t / 1e3).toString()), e.pending = t % 1e3, e.banknotes.$_500 = parseInt((e.pending / 500).toString()), e.pending = e.pending % 500, e.banknotes.$_200 = parseInt((e.pending / 200).toString()), e.pending = e.pending % 200, e.banknotes.$_100 = parseInt((e.pending / 100).toString()), e.pending = e.pending % 100, e.banknotes.$_50 = parseInt((e.pending / 50).toString()), e.pending = e.pending % 50, e.banknotes.$_20 = parseInt((e.pending / 20).toString()), e.pending = e.pending % 20, e.will_dispense = e.banknotes.$_1000 > 0 || e.banknotes.$_500 > 0 || e.banknotes.$_200 > 0 || e.banknotes.$_100 > 0 || e.banknotes.$_50 > 0 || e.banknotes.$_20 > 0), e;
|
|
3228
3238
|
}, Ee = function(t) {
|
|
3229
|
-
return i(this,
|
|
3239
|
+
return i(this, h, he).call(this) ? i(this, h, ln).call(this, t) : i(this, h, cn).call(this, t);
|
|
3230
3240
|
}, Ie = function(t) {
|
|
3231
3241
|
const e = {
|
|
3232
3242
|
coins: { $_50c: 0, $_1: 0, $_2: 0, $_5: 0, $_10: 0 },
|
|
@@ -3235,15 +3245,15 @@ ue = function({ dispensed: t = null, limit: e = 80 } = {}) {
|
|
|
3235
3245
|
};
|
|
3236
3246
|
return t <= 0 || this.totalInTubes === 0 || (e.coins.$_10 = parseInt((t / 10).toString()), e.pending = t % 10, e.coins.$_5 = parseInt((e.pending / 5).toString()), e.pending = e.pending % 5, e.coins.$_2 = parseInt((e.pending / 2).toString()), e.pending = e.pending % 2, e.coins.$_1 = parseInt(e.pending), e.pending = e.pending % 1, e.coins.$_50c = parseInt((e.pending / 0.5).toString()), e.pending = e.pending % 0.5, e.will_dispense = e.coins.$_10 > 0 || e.coins.$_5 > 0 || e.coins.$_2 > 0 || e.coins.$_1 > 0 || e.coins.$_50c > 0), e;
|
|
3237
3247
|
}, Se = async function(t = null) {
|
|
3238
|
-
if (!i(this,
|
|
3248
|
+
if (!i(this, h, Bt).call(this)) throw new Error("Change not available");
|
|
3239
3249
|
let e = this.change, n = this.change;
|
|
3240
3250
|
if (t !== null && (e = t, n = t), n <= 0) return !1;
|
|
3241
|
-
const
|
|
3242
|
-
n =
|
|
3243
|
-
const c = i(this,
|
|
3244
|
-
return n = c.pending, n > 0 && this.dispatch("change:pending", { pending: n }), n === e ? !1 : (
|
|
3251
|
+
const s = i(this, h, Ee).call(this, n);
|
|
3252
|
+
n = s.pending;
|
|
3253
|
+
const c = i(this, h, Ie).call(this, n);
|
|
3254
|
+
return n = c.pending, n > 0 && this.dispatch("change:pending", { pending: n }), n === e ? !1 : (s.will_dispense && await this.banknotePurseDispense(s.banknotes), c.will_dispense && await this.coinPurseDispense(c.coins), !0);
|
|
3245
3255
|
};
|
|
3246
|
-
var z,
|
|
3256
|
+
var z, hn, dn;
|
|
3247
3257
|
class Dn extends G {
|
|
3248
3258
|
constructor({
|
|
3249
3259
|
filters: t = null,
|
|
@@ -3253,7 +3263,7 @@ class Dn extends G {
|
|
|
3253
3263
|
super({ filters: t, config_port: e, no_device: n });
|
|
3254
3264
|
S(this, z);
|
|
3255
3265
|
if (this.__internal__.device.type = "arduino", D.getCustom(this.typeDevice, n)) throw new Error(`Device ${this.typeDevice} ${n} already exists`);
|
|
3256
|
-
this.__internal__.time.response_connection = 2e3, this.__internal__.time.response_general = 2e3, this.__internal__.serial.delay_first_connection = 1e3, i(this, z,
|
|
3266
|
+
this.__internal__.time.response_connection = 2e3, this.__internal__.time.response_general = 2e3, this.__internal__.serial.delay_first_connection = 1e3, i(this, z, dn).call(this), i(this, z, hn).call(this);
|
|
3257
3267
|
}
|
|
3258
3268
|
serialMessage(t) {
|
|
3259
3269
|
const e = {
|
|
@@ -3263,8 +3273,8 @@ class Dn extends G {
|
|
|
3263
3273
|
description: null,
|
|
3264
3274
|
request: null,
|
|
3265
3275
|
no_code: 0
|
|
3266
|
-
}, n = t.map((c) => parseInt(c, 16)),
|
|
3267
|
-
switch (e.code =
|
|
3276
|
+
}, n = t.map((c) => parseInt(c, 16)), s = String.fromCharCode(...n).replace(/[\n\r]+/g, "");
|
|
3277
|
+
switch (e.code = s, s) {
|
|
3268
3278
|
case "connected":
|
|
3269
3279
|
e.name = "connected", e.description = "Connection established", e.request = "connect", e.no_code = 100;
|
|
3270
3280
|
break;
|
|
@@ -3288,7 +3298,7 @@ class Dn extends G {
|
|
|
3288
3298
|
t += `
|
|
3289
3299
|
`;
|
|
3290
3300
|
const n = e.encode(t);
|
|
3291
|
-
return Array.from(n).map((
|
|
3301
|
+
return Array.from(n).map((s) => s.toString(16));
|
|
3292
3302
|
}
|
|
3293
3303
|
// eslint-disable-next-line no-unused-vars
|
|
3294
3304
|
serialSetConnectionConstant(t = 1) {
|
|
@@ -3315,9 +3325,9 @@ class Dn extends G {
|
|
|
3315
3325
|
await this.sayCredits(), await this.sayAra(), await this.sayHi();
|
|
3316
3326
|
}
|
|
3317
3327
|
}
|
|
3318
|
-
z = new WeakSet(),
|
|
3328
|
+
z = new WeakSet(), hn = function() {
|
|
3319
3329
|
D.addCustom("arduino", this);
|
|
3320
|
-
},
|
|
3330
|
+
}, dn = function() {
|
|
3321
3331
|
};
|
|
3322
3332
|
/**
|
|
3323
3333
|
* @license Webserial
|