@danidoble/webserial 4.2.4 → 4.2.6
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/LICENSE +21 -0
- package/dist/arduino.cjs +1 -1
- package/dist/arduino.js +36 -42
- package/dist/boardroid.cjs +1 -1
- package/dist/boardroid.js +350 -384
- package/dist/jofemar.cjs +1 -1
- package/dist/jofemar.js +688 -560
- package/dist/{kernel-BFXQSiNz.js → kernel-Bquzoyqh.js} +119 -116
- package/dist/kernel-DSUxKxea.cjs +4 -0
- package/dist/kernel.cjs +1 -1
- package/dist/kernel.js +1 -1
- package/dist/locker.cjs +1 -1
- package/dist/locker.js +85 -123
- package/dist/pinpad.cjs +1 -1
- package/dist/pinpad.js +1 -1
- package/dist/pinpax.cjs +3 -20
- package/dist/pinpax.js +76 -109
- package/dist/relay-BsUsBpOv.cjs +3 -0
- package/dist/relay-Dop4mFk-.js +1341 -0
- package/dist/relay.cjs +1 -1
- package/dist/relay.js +32 -45
- package/dist/webserial.cjs +1 -1
- package/dist/webserial.js +2 -2
- package/package.json +32 -32
- package/dist/kernel-C0epz_jB.cjs +0 -4
package/dist/jofemar.js
CHANGED
|
@@ -1,25 +1,26 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
1
|
+
var se = Object.defineProperty;
|
|
2
|
+
var O = (p) => {
|
|
3
3
|
throw TypeError(p);
|
|
4
4
|
};
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
import { K as
|
|
10
|
-
|
|
11
|
-
|
|
5
|
+
var de = (p, h, t) => h in p ? se(p, h, { enumerable: !0, configurable: !0, writable: !0, value: t }) : p[h] = t;
|
|
6
|
+
var M = (p, h, t) => de(p, typeof h != "symbol" ? h + "" : h, t), pe = (p, h, t) => h.has(p) || O("Cannot " + t);
|
|
7
|
+
var I = (p, h, t) => h.has(p) ? O("Cannot add the same private member more than once") : h instanceof WeakSet ? h.add(p) : h.set(p, t);
|
|
8
|
+
var i = (p, h, t) => (pe(p, h, "access private method"), t);
|
|
9
|
+
import { K as ue, _ as P, w, g as Q } from "./kernel-Bquzoyqh.js";
|
|
10
|
+
import { o as a } from "./relay-Dop4mFk-.js";
|
|
11
|
+
var n, S, g, A, B, W, F, q, R, $, N, j, L, V, J, U, K, H, z, G, Y, Z, X, ee, te, ne, ie, re, ae, u, s, b, d, _, oe, ce, he, C, E, D;
|
|
12
|
+
class ve extends ue {
|
|
12
13
|
constructor({
|
|
13
|
-
filters:
|
|
14
|
-
config_port:
|
|
14
|
+
filters: t = null,
|
|
15
|
+
config_port: e = null,
|
|
15
16
|
no_device: r = 1,
|
|
16
|
-
device_listen_on_port:
|
|
17
|
-
type:
|
|
18
|
-
support_cart:
|
|
17
|
+
device_listen_on_port: o = 1,
|
|
18
|
+
type: c = "esplus",
|
|
19
|
+
support_cart: l = !0
|
|
19
20
|
} = {}) {
|
|
20
|
-
super({ filters:
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
super({ filters: t, config_port: e, no_device: r, device_listen_on_port: o });
|
|
22
|
+
I(this, n);
|
|
23
|
+
M(this, "__device", {
|
|
23
24
|
type: "esplus",
|
|
24
25
|
support_cart: !1,
|
|
25
26
|
withdraw: {
|
|
@@ -44,65 +45,51 @@ class Tt extends kt {
|
|
|
44
45
|
}
|
|
45
46
|
}
|
|
46
47
|
});
|
|
47
|
-
if (this.__internal__.device.type = "jofemar",
|
|
48
|
+
if (this.__internal__.device.type = "jofemar", P.getCustom(this.typeDevice, r))
|
|
48
49
|
throw new Error(`Device ${this.typeDevice} ${r} already exists`);
|
|
49
50
|
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.listenOnChannel).toString(16), this.__internal__.device.door_open = !1, this.__internal__.dispense.elevator = {
|
|
50
51
|
locking_time: 60,
|
|
51
52
|
locking_interval: 0,
|
|
52
53
|
need_reset: !1
|
|
53
|
-
}, this.deviceType =
|
|
54
|
+
}, this.deviceType = c, this.supportCart = l, i(this, n, S).call(this), P.add(this), i(this, n, g).call(this);
|
|
54
55
|
}
|
|
55
|
-
set startChannelVerification(
|
|
56
|
-
const
|
|
57
|
-
if (isNaN(
|
|
58
|
-
if (
|
|
59
|
-
this.__device.channels.verification.start =
|
|
56
|
+
set startChannelVerification(t) {
|
|
57
|
+
const e = parseInt(t);
|
|
58
|
+
if (isNaN(e)) throw new Error("Invalid start channel verification, must be a number");
|
|
59
|
+
if (e < 1 || e > 126) throw new Error("Invalid start channel verification, valid range is 1 to 126");
|
|
60
|
+
this.__device.channels.verification.start = e;
|
|
60
61
|
}
|
|
61
|
-
set endChannelVerification(
|
|
62
|
-
const
|
|
63
|
-
if (isNaN(
|
|
64
|
-
if (
|
|
65
|
-
this.__device.channels.verification.end =
|
|
62
|
+
set endChannelVerification(t) {
|
|
63
|
+
const e = parseInt(t);
|
|
64
|
+
if (isNaN(e)) throw new Error("Invalid end channel verification, must be a number");
|
|
65
|
+
if (e < 1 || e > 126) throw new Error("Invalid end channel verification, valid range is 1 to 126");
|
|
66
|
+
this.__device.channels.verification.end = e;
|
|
66
67
|
}
|
|
67
|
-
set listenOnChannel(
|
|
68
|
-
if (
|
|
69
|
-
this.__internal__.device.listen_on_port =
|
|
68
|
+
set listenOnChannel(t) {
|
|
69
|
+
if (t = parseInt(t), isNaN(t) || t < 1 || t > 31) throw new Error("Invalid port number, valid range is 1 to 31");
|
|
70
|
+
this.__internal__.device.listen_on_port = t, this.__internal__.serial.bytes_connection = this.serialSetConnectionConstant(t), this.__internal__.device.hex_number = (128 + t).toString(16);
|
|
70
71
|
}
|
|
71
72
|
/**
|
|
72
73
|
* @deperecated
|
|
73
74
|
* @param {string|number} channel
|
|
74
75
|
*/
|
|
75
|
-
set listenOnPort(
|
|
76
|
-
this.listenOnChannel =
|
|
77
|
-
}
|
|
78
|
-
set deviceType(
|
|
79
|
-
if (typeof
|
|
80
|
-
this.__device.type =
|
|
81
|
-
}
|
|
82
|
-
set supportCart(
|
|
83
|
-
if (typeof
|
|
84
|
-
this.__device.support_cart =
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
return e.push("03"), this.add0x(e);
|
|
91
|
-
}
|
|
92
|
-
calcCheckSums(e) {
|
|
93
|
-
e = this.add0x([this.decToHex(parseInt(e).toString())]);
|
|
94
|
-
let t = [];
|
|
95
|
-
return t.push((e & 255 | 240).toString(16).toUpperCase()), t.push((e & 255 | 15).toString(16).toUpperCase()), t;
|
|
96
|
-
}
|
|
97
|
-
serialSetConnectionConstant(e = 1) {
|
|
98
|
-
let t = ["02", "30", "30", (128 + e).toString(16), "53", "FF", "FF"], r = [];
|
|
99
|
-
return t.forEach((a) => {
|
|
100
|
-
r.push(this.hexMaker(a));
|
|
101
|
-
}), this.serialJofemarMakeBytes(r);
|
|
102
|
-
}
|
|
103
|
-
serialMessage(e) {
|
|
76
|
+
set listenOnPort(t) {
|
|
77
|
+
this.listenOnChannel = t;
|
|
78
|
+
}
|
|
79
|
+
set deviceType(t) {
|
|
80
|
+
if (typeof t != "string") throw new Error("Invalid device type, must be a string");
|
|
81
|
+
this.__device.type = t;
|
|
82
|
+
}
|
|
83
|
+
set supportCart(t) {
|
|
84
|
+
if (typeof t != "boolean") throw new Error("Invalid support cart, must be a boolean");
|
|
85
|
+
this.__device.support_cart = t;
|
|
86
|
+
}
|
|
87
|
+
serialSetConnectionConstant(t = 1) {
|
|
88
|
+
return a.connection({ channel: t });
|
|
89
|
+
}
|
|
90
|
+
serialMessage(t) {
|
|
104
91
|
let r = {
|
|
105
|
-
code:
|
|
92
|
+
code: t,
|
|
106
93
|
name: null,
|
|
107
94
|
description: null,
|
|
108
95
|
request: "unknown",
|
|
@@ -114,15 +101,15 @@ class Tt extends kt {
|
|
|
114
101
|
}
|
|
115
102
|
}
|
|
116
103
|
};
|
|
117
|
-
switch (
|
|
104
|
+
switch (t[0]) {
|
|
118
105
|
case "02":
|
|
119
|
-
r =
|
|
106
|
+
r = i(this, n, ae).call(this, t, r, 128);
|
|
120
107
|
break;
|
|
121
108
|
case "06":
|
|
122
|
-
r =
|
|
109
|
+
r = i(this, n, oe).call(this, t, r);
|
|
123
110
|
break;
|
|
124
111
|
case "15":
|
|
125
|
-
r.name = "Checksum error", r.description = "The calculated checksum does not match the received checksum", r.no_code = 38,
|
|
112
|
+
r.name = "Checksum error", r.description = "The calculated checksum does not match the received checksum", r.no_code = 38, i(this, n, s).call(this);
|
|
126
113
|
break;
|
|
127
114
|
default:
|
|
128
115
|
r.name = "unknown", r.description = "The message received is unknown", r.no_code = 404;
|
|
@@ -139,128 +126,171 @@ class Tt extends kt {
|
|
|
139
126
|
* @param {boolean} cart
|
|
140
127
|
* @return {Promise<unknown>}
|
|
141
128
|
*/
|
|
142
|
-
async dispense({ selection:
|
|
143
|
-
|
|
144
|
-
const { channel: r, tray: a } = n(this, i, dt).call(this, e);
|
|
129
|
+
async dispense({ selection: t = 1, cart: e = !1 } = {}) {
|
|
130
|
+
const r = a.dispense({ selection: t, cart: e, machineChannel: this.listenOnChannel }), o = r[5], c = r[6];
|
|
145
131
|
this.__internal__.dispense.backup_dispense = {
|
|
146
|
-
selection:
|
|
147
|
-
cart:
|
|
148
|
-
channel:
|
|
149
|
-
tray:
|
|
132
|
+
selection: t,
|
|
133
|
+
cart: e,
|
|
134
|
+
channel: c,
|
|
135
|
+
tray: o
|
|
150
136
|
};
|
|
151
|
-
let
|
|
152
|
-
t && (c[4] = "4D"), c = n(this, i, E).call(this, c);
|
|
153
|
-
let s;
|
|
137
|
+
let l;
|
|
154
138
|
do
|
|
155
|
-
|
|
156
|
-
while (["elevator-locked", "no-response"].includes(
|
|
157
|
-
return this.__internal__.dispense.backup_dispense = {},
|
|
139
|
+
l = await this.internalDispense(r), i(this, n, ce).call(this), l.error === "elevator-locked" ? await i(this, n, A).call(this) : l.error === "no-response" && await w(1e3);
|
|
140
|
+
while (["elevator-locked", "no-response"].includes(l.error));
|
|
141
|
+
return this.__internal__.dispense.backup_dispense = {}, l;
|
|
158
142
|
}
|
|
159
143
|
internalClearSensing() {
|
|
160
|
-
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((
|
|
144
|
+
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"));
|
|
161
145
|
}
|
|
162
146
|
async endDispense() {
|
|
163
|
-
|
|
164
|
-
return
|
|
147
|
+
const t = a.endCartDispense({ machineChannel: this.listenOnChannel });
|
|
148
|
+
return await this.internalDispense(t);
|
|
165
149
|
}
|
|
166
150
|
async collect() {
|
|
167
|
-
|
|
168
|
-
return await n(this, i, u).call(this, e, "collect");
|
|
151
|
+
return await this.appendToQueue(a.collect({ machineChannel: this.listenOnChannel }), "collect");
|
|
169
152
|
}
|
|
170
153
|
async resetSoldOutErrors() {
|
|
171
|
-
return await
|
|
154
|
+
return await i(this, n, C).call(this, "soldOut");
|
|
172
155
|
}
|
|
173
156
|
async resetWaitingProductRemovedError() {
|
|
174
|
-
return await
|
|
157
|
+
return await i(this, n, C).call(this, "waiting");
|
|
175
158
|
}
|
|
176
159
|
async resetMachineErrors() {
|
|
177
|
-
return this.__internal__.serial.queue.length === 0 ? (
|
|
178
|
-
const
|
|
179
|
-
this.__internal__.serial.queue.length > 0 || (clearInterval(
|
|
160
|
+
return this.__internal__.serial.queue.length === 0 ? (i(this, n, E).call(this), await i(this, n, C).call(this, "machine")) : new Promise((t) => {
|
|
161
|
+
const e = setInterval(async () => {
|
|
162
|
+
this.__internal__.serial.queue.length > 0 || (clearInterval(e), await i(this, n, C).call(this, "machine"), i(this, n, E).call(this), t(!0));
|
|
180
163
|
}, 100);
|
|
181
164
|
});
|
|
182
165
|
}
|
|
183
166
|
async resetAllErrors() {
|
|
184
|
-
return await this.resetSoldOutErrors(), await
|
|
167
|
+
return await this.resetSoldOutErrors(), await w(100), await this.resetWaitingProductRemovedError(), await w(100), await this.resetMachineErrors();
|
|
185
168
|
}
|
|
186
169
|
async status() {
|
|
187
|
-
|
|
188
|
-
return await n(this, i, u).call(this, e, "status");
|
|
170
|
+
return await this.appendToQueue(a.status({ machineChannel: this.listenOnChannel }), "status");
|
|
189
171
|
}
|
|
190
172
|
async lightsOn() {
|
|
191
|
-
return await
|
|
173
|
+
return await i(this, n, D).call(this, "on");
|
|
192
174
|
}
|
|
193
175
|
async lightsOff() {
|
|
194
|
-
return await
|
|
195
|
-
}
|
|
196
|
-
async program(
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
return await this.
|
|
176
|
+
return await i(this, n, D).call(this, "off");
|
|
177
|
+
}
|
|
178
|
+
async program(t, e) {
|
|
179
|
+
return await this.appendToQueue(
|
|
180
|
+
a.program({
|
|
181
|
+
machineChannel: this.listenOnChannel,
|
|
182
|
+
param1: t,
|
|
183
|
+
param2: e
|
|
184
|
+
}),
|
|
185
|
+
"program"
|
|
186
|
+
);
|
|
187
|
+
}
|
|
188
|
+
async programDisplayLanguage({ language: t = "spanish" } = {}) {
|
|
189
|
+
return await this.appendToQueue(
|
|
190
|
+
a.programDisplayLanguage({
|
|
191
|
+
machineChannel: this.listenOnChannel,
|
|
192
|
+
language: t
|
|
193
|
+
}),
|
|
194
|
+
"program"
|
|
195
|
+
);
|
|
196
|
+
}
|
|
197
|
+
async programBeeper({ enable: t = !0 } = {}) {
|
|
198
|
+
return await this.appendToQueue(
|
|
199
|
+
a.programBeeper({
|
|
200
|
+
machineChannel: this.listenOnChannel,
|
|
201
|
+
enable: t
|
|
202
|
+
}),
|
|
203
|
+
"program"
|
|
204
|
+
);
|
|
208
205
|
}
|
|
209
206
|
async programDisableWorkingTemperature() {
|
|
210
207
|
if (this.__device.type === "iceplus") throw new Error("IcePlus does not support disable working temperature");
|
|
211
|
-
return await this.
|
|
208
|
+
return await this.appendToQueue(
|
|
209
|
+
a.programDisableWorkingTemperature({
|
|
210
|
+
machineChannel: this.listenOnChannel
|
|
211
|
+
}),
|
|
212
|
+
"program"
|
|
213
|
+
);
|
|
212
214
|
}
|
|
213
215
|
async programDisableThermometer() {
|
|
214
|
-
return await this.
|
|
216
|
+
return await this.appendToQueue(
|
|
217
|
+
a.programDisableThermometer({
|
|
218
|
+
machineChannel: this.listenOnChannel
|
|
219
|
+
}),
|
|
220
|
+
"program"
|
|
221
|
+
);
|
|
215
222
|
}
|
|
216
223
|
/**
|
|
217
224
|
* Program the machine to work with a specific temperature
|
|
218
225
|
* @param {number|string} degrees
|
|
219
226
|
* @return {Promise<void>}
|
|
220
227
|
*/
|
|
221
|
-
async programWorkingTemperature({ degrees:
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
+
async programWorkingTemperature({ degrees: t = 0.5 } = {}) {
|
|
229
|
+
return await this.appendToQueue(
|
|
230
|
+
a.programWorkingTemperature({
|
|
231
|
+
machineChannel: this.listenOnChannel,
|
|
232
|
+
degrees: t,
|
|
233
|
+
machineType: this.__device.type
|
|
234
|
+
}),
|
|
235
|
+
"program"
|
|
236
|
+
);
|
|
228
237
|
}
|
|
229
238
|
/**
|
|
230
239
|
* @param {number|string} tray
|
|
231
240
|
* @return {Promise<void>}
|
|
232
241
|
*/
|
|
233
|
-
async programIsolationTray({ tray:
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
242
|
+
async programIsolationTray({ tray: t = 0 } = {}) {
|
|
243
|
+
return await this.appendToQueue(
|
|
244
|
+
a.programIsolationTray({
|
|
245
|
+
machineChannel: this.listenOnChannel,
|
|
246
|
+
tray: t
|
|
247
|
+
}),
|
|
248
|
+
"program"
|
|
249
|
+
);
|
|
237
250
|
}
|
|
238
251
|
/**
|
|
239
252
|
* @param {number|string} seconds
|
|
240
253
|
* @return {Promise<*>}
|
|
241
254
|
*/
|
|
242
|
-
async programTimeToStandbyAfterCollect({ seconds:
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
255
|
+
async programTimeToStandbyAfterCollect({ seconds: t = 15 } = {}) {
|
|
256
|
+
return await this.appendToQueue(
|
|
257
|
+
a.programTimeToStandbyAfterCollect({
|
|
258
|
+
machineChannel: this.listenOnChannel,
|
|
259
|
+
seconds: t
|
|
260
|
+
}),
|
|
261
|
+
"program"
|
|
262
|
+
);
|
|
246
263
|
}
|
|
247
264
|
/**
|
|
248
265
|
* @param {number|string} seconds
|
|
249
266
|
* @return {Promise<*>}
|
|
250
267
|
*/
|
|
251
|
-
async programTimeToStandbyWithoutCollect({ minutes:
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
268
|
+
async programTimeToStandbyWithoutCollect({ minutes: t = 1 } = {}) {
|
|
269
|
+
return await this.appendToQueue(
|
|
270
|
+
a.programTimeToStandbyWithoutCollect({
|
|
271
|
+
machineChannel: this.listenOnChannel,
|
|
272
|
+
minutes: t
|
|
273
|
+
}),
|
|
274
|
+
"program"
|
|
275
|
+
);
|
|
276
|
+
}
|
|
277
|
+
async programElevatorSpeed({ speed: t = "high" } = {}) {
|
|
278
|
+
return await this.appendToQueue(
|
|
279
|
+
a.programElevatorSpeed({
|
|
280
|
+
machineChannel: this.listenOnChannel,
|
|
281
|
+
speed: t
|
|
282
|
+
}),
|
|
283
|
+
"program"
|
|
284
|
+
);
|
|
285
|
+
}
|
|
286
|
+
async programTemperatureExpiration({ enable: t = !1 } = {}) {
|
|
287
|
+
return await this.appendToQueue(
|
|
288
|
+
a.programTemperatureExpiration({
|
|
289
|
+
machineChannel: this.listenOnChannel,
|
|
290
|
+
enable: t
|
|
291
|
+
}),
|
|
292
|
+
"program"
|
|
293
|
+
);
|
|
264
294
|
}
|
|
265
295
|
async programEnableTemperatureExpiration() {
|
|
266
296
|
return await this.programTemperatureExpiration({ enable: !0 });
|
|
@@ -272,239 +302,356 @@ class Tt extends kt {
|
|
|
272
302
|
* @param {number|string} address
|
|
273
303
|
* @return {Promise<*>}
|
|
274
304
|
*/
|
|
275
|
-
async programMachineAddress({ address:
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
305
|
+
async programMachineAddress({ address: t = 1 } = {}) {
|
|
306
|
+
return await this.appendToQueue(
|
|
307
|
+
a.programMachineAddress({
|
|
308
|
+
machineChannel: this.listenOnChannel,
|
|
309
|
+
address: t
|
|
310
|
+
}),
|
|
311
|
+
"program"
|
|
312
|
+
);
|
|
279
313
|
}
|
|
280
314
|
/**
|
|
281
315
|
* @param {number|string} degrees
|
|
282
316
|
* @return {Promise<*>}
|
|
283
317
|
*/
|
|
284
|
-
async programTemperatureBeforeExpiration({ degrees:
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
318
|
+
async programTemperatureBeforeExpiration({ degrees: t = 0.5 } = {}) {
|
|
319
|
+
return await this.appendToQueue(
|
|
320
|
+
a.programTemperatureBeforeExpiration({
|
|
321
|
+
machineChannel: this.listenOnChannel,
|
|
322
|
+
degrees: t
|
|
323
|
+
}),
|
|
324
|
+
"program"
|
|
325
|
+
);
|
|
289
326
|
}
|
|
290
327
|
/**
|
|
291
328
|
* @param {number|string} minutes
|
|
292
329
|
* @return {Promise<*>}
|
|
293
330
|
*/
|
|
294
|
-
async programTimeBeforeExpirationByTemperature({ minutes:
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
331
|
+
async programTimeBeforeExpirationByTemperature({ minutes: t = 1 } = {}) {
|
|
332
|
+
return await this.appendToQueue(
|
|
333
|
+
a.programTimeBeforeExpirationByTemperature({
|
|
334
|
+
machineChannel: this.listenOnChannel,
|
|
335
|
+
minutes: t
|
|
336
|
+
}),
|
|
337
|
+
"program"
|
|
338
|
+
);
|
|
339
|
+
}
|
|
340
|
+
async programTemperatureScale({ scale: t = "celsius" } = {}) {
|
|
341
|
+
return await this.appendToQueue(
|
|
342
|
+
a.programTemperatureScale({
|
|
343
|
+
machineChannel: this.listenOnChannel,
|
|
344
|
+
scale: t
|
|
345
|
+
}),
|
|
346
|
+
"program"
|
|
347
|
+
);
|
|
303
348
|
}
|
|
304
349
|
/**
|
|
305
350
|
* @param {number|string} selection
|
|
306
351
|
* @param {number|string} voltage
|
|
307
352
|
* @return {Promise<void>}
|
|
308
353
|
*/
|
|
309
|
-
async programVoltageEngine({ selection:
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
354
|
+
async programVoltageEngine({ selection: t = 1, voltage: e = 5 } = {}) {
|
|
355
|
+
return await this.appendToQueue(
|
|
356
|
+
a.programVoltageEngine({
|
|
357
|
+
machineChannel: this.listenOnChannel,
|
|
358
|
+
selection: t,
|
|
359
|
+
voltage: e
|
|
360
|
+
}),
|
|
361
|
+
"voltage-engine"
|
|
362
|
+
);
|
|
316
363
|
}
|
|
317
364
|
/**
|
|
318
365
|
* @param {number|string} selection
|
|
319
366
|
* @param {boolean} enable
|
|
320
367
|
* @return {Promise<void>}
|
|
321
368
|
*/
|
|
322
|
-
async programPushOverProducts({ selection:
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
369
|
+
async programPushOverProducts({ selection: t = 1, enable: e = !0 } = {}) {
|
|
370
|
+
return await this.appendToQueue(
|
|
371
|
+
a.programPushOverProducts({
|
|
372
|
+
machineChannel: this.listenOnChannel,
|
|
373
|
+
selection: t,
|
|
374
|
+
enable: e
|
|
375
|
+
}),
|
|
376
|
+
"push-over-products"
|
|
377
|
+
);
|
|
327
378
|
}
|
|
328
379
|
/**
|
|
329
380
|
* @param {number|string} selection
|
|
330
381
|
* @param {number|string} seconds
|
|
331
382
|
* @return {Promise<void>}
|
|
332
383
|
*/
|
|
333
|
-
async programChannelRunningAfterDispense({ selection:
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
}
|
|
343
|
-
async checkData(
|
|
344
|
-
|
|
345
|
-
|
|
384
|
+
async programChannelRunningAfterDispense({ selection: t = 1, seconds: e = 0 } = {}) {
|
|
385
|
+
return await this.appendToQueue(
|
|
386
|
+
a.programChannelRunningAfterDispense({
|
|
387
|
+
machineChannel: this.listenOnChannel,
|
|
388
|
+
selection: t,
|
|
389
|
+
seconds: e
|
|
390
|
+
}),
|
|
391
|
+
"channel-running-after-dispense"
|
|
392
|
+
);
|
|
393
|
+
}
|
|
394
|
+
async checkData(t, e = "FF") {
|
|
395
|
+
return await this.appendToQueue(
|
|
396
|
+
a.checkData({
|
|
397
|
+
machineChannel: this.listenOnChannel,
|
|
398
|
+
type: t,
|
|
399
|
+
aux: e
|
|
400
|
+
}),
|
|
401
|
+
"check-data"
|
|
402
|
+
);
|
|
346
403
|
}
|
|
347
404
|
async getDisplayLanguage() {
|
|
348
|
-
return await this.
|
|
405
|
+
return await this.appendToQueue(
|
|
406
|
+
a.getDisplayLanguage({ machineChannel: this.listenOnChannel }),
|
|
407
|
+
"check-data"
|
|
408
|
+
);
|
|
349
409
|
}
|
|
350
410
|
async getBeeper() {
|
|
351
|
-
return await this.
|
|
411
|
+
return await this.appendToQueue(a.getBeeper({ machineChannel: this.listenOnChannel }), "check-data");
|
|
352
412
|
}
|
|
353
413
|
async getWorkingTemperature() {
|
|
354
|
-
return await this.
|
|
414
|
+
return await this.appendToQueue(
|
|
415
|
+
a.getWorkingTemperature({ machineChannel: this.listenOnChannel }),
|
|
416
|
+
"check-data"
|
|
417
|
+
);
|
|
355
418
|
}
|
|
356
419
|
async getIsolationTray() {
|
|
357
|
-
return await this.
|
|
420
|
+
return await this.appendToQueue(
|
|
421
|
+
a.getIsolationTray({ machineChannel: this.listenOnChannel }),
|
|
422
|
+
"check-data"
|
|
423
|
+
);
|
|
358
424
|
}
|
|
359
425
|
async getProgramVersion() {
|
|
360
|
-
return await this.
|
|
426
|
+
return await this.appendToQueue(
|
|
427
|
+
a.getProgramVersion({ machineChannel: this.listenOnChannel }),
|
|
428
|
+
"check-data"
|
|
429
|
+
);
|
|
361
430
|
}
|
|
362
431
|
async getFaults() {
|
|
363
|
-
return await this.
|
|
432
|
+
return await this.appendToQueue(a.getFaults({ machineChannel: this.listenOnChannel }), "check-data");
|
|
364
433
|
}
|
|
365
434
|
async getMachineId() {
|
|
366
|
-
return await this.
|
|
435
|
+
return await this.appendToQueue(
|
|
436
|
+
a.getMachineId({ machineChannel: this.listenOnChannel }),
|
|
437
|
+
"check-data"
|
|
438
|
+
);
|
|
367
439
|
}
|
|
368
440
|
async getCurrentTemperature() {
|
|
369
|
-
return await this.
|
|
441
|
+
return await this.appendToQueue(
|
|
442
|
+
a.getCurrentTemperature({ machineChannel: this.listenOnChannel }),
|
|
443
|
+
"check-data"
|
|
444
|
+
);
|
|
370
445
|
}
|
|
371
446
|
async getTimeToStandbyAfterCollect() {
|
|
372
|
-
return await this.
|
|
447
|
+
return await this.appendToQueue(
|
|
448
|
+
a.getTimeToStandbyAfterCollect({ machineChannel: this.listenOnChannel }),
|
|
449
|
+
"check-data"
|
|
450
|
+
);
|
|
373
451
|
}
|
|
374
452
|
async getTimeToStandbyWithoutCollect() {
|
|
375
|
-
return await this.
|
|
453
|
+
return await this.appendToQueue(
|
|
454
|
+
a.getTimeToStandbyWithoutCollect({ machineChannel: this.listenOnChannel }),
|
|
455
|
+
"check-data"
|
|
456
|
+
);
|
|
376
457
|
}
|
|
377
458
|
async getElevatorSpeed() {
|
|
378
|
-
return await this.
|
|
459
|
+
return await this.appendToQueue(
|
|
460
|
+
a.getElevatorSpeed({ machineChannel: this.listenOnChannel }),
|
|
461
|
+
"check-data"
|
|
462
|
+
);
|
|
379
463
|
}
|
|
380
464
|
async getTemperatureExpiration() {
|
|
381
|
-
return await this.
|
|
465
|
+
return await this.appendToQueue(
|
|
466
|
+
a.getTemperatureExpiration({ machineChannel: this.listenOnChannel }),
|
|
467
|
+
"check-data"
|
|
468
|
+
);
|
|
382
469
|
}
|
|
383
470
|
async getTemperatureBeforeExpiration() {
|
|
384
|
-
return await this.
|
|
471
|
+
return await this.appendToQueue(
|
|
472
|
+
a.getTemperatureBeforeExpiration({ machineChannel: this.listenOnChannel }),
|
|
473
|
+
"check-data"
|
|
474
|
+
);
|
|
385
475
|
}
|
|
386
476
|
async getTimeBeforeExpirationByTemperature() {
|
|
387
|
-
return await this.
|
|
477
|
+
return await this.appendToQueue(
|
|
478
|
+
a.getTimeBeforeExpirationByTemperature({ machineChannel: this.listenOnChannel }),
|
|
479
|
+
"check-data"
|
|
480
|
+
);
|
|
388
481
|
}
|
|
389
482
|
async getTemperatureScale() {
|
|
390
|
-
return await this.
|
|
483
|
+
return await this.appendToQueue(
|
|
484
|
+
a.getTemperatureScale({ machineChannel: this.listenOnChannel }),
|
|
485
|
+
"check-data"
|
|
486
|
+
);
|
|
391
487
|
}
|
|
392
488
|
async getClockRegisters() {
|
|
393
|
-
return await this.
|
|
489
|
+
return await this.appendToQueue(
|
|
490
|
+
a.getClockRegisters({ machineChannel: this.listenOnChannel }),
|
|
491
|
+
"check-data"
|
|
492
|
+
);
|
|
394
493
|
}
|
|
395
494
|
async getMachineActivity() {
|
|
396
|
-
return await this.
|
|
495
|
+
return await this.appendToQueue(
|
|
496
|
+
a.getMachineActivity({ machineChannel: this.listenOnChannel }),
|
|
497
|
+
"check-data"
|
|
498
|
+
);
|
|
397
499
|
}
|
|
398
500
|
/**
|
|
399
501
|
* @param {number|string} selection
|
|
400
502
|
* @return {Promise<*>}
|
|
401
503
|
*/
|
|
402
|
-
async getVoltageEngine({ selection:
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
504
|
+
async getVoltageEngine({ selection: t = 1 } = {}) {
|
|
505
|
+
return await this.appendToQueue(
|
|
506
|
+
a.getVoltageEngine({
|
|
507
|
+
machineChannel: this.listenOnChannel,
|
|
508
|
+
selection: t
|
|
509
|
+
}),
|
|
510
|
+
"check-data"
|
|
511
|
+
);
|
|
407
512
|
}
|
|
408
513
|
/**
|
|
409
514
|
* @param {number|string} selection
|
|
410
515
|
* @return {Promise<*>}
|
|
411
516
|
*/
|
|
412
|
-
async getChannelPresence({ selection:
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
517
|
+
async getChannelPresence({ selection: t = 1 } = {}) {
|
|
518
|
+
return await this.appendToQueue(
|
|
519
|
+
a.getChannelPresence({
|
|
520
|
+
machineChannel: this.listenOnChannel,
|
|
521
|
+
selection: t
|
|
522
|
+
}),
|
|
523
|
+
"check-data"
|
|
524
|
+
);
|
|
417
525
|
}
|
|
418
526
|
/**
|
|
419
527
|
* @param {number|string} selection
|
|
420
528
|
* @return {Promise<*>}
|
|
421
529
|
*/
|
|
422
|
-
async getPushOverProducts({ selection:
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
530
|
+
async getPushOverProducts({ selection: t = 1 } = {}) {
|
|
531
|
+
return await this.appendToQueue(
|
|
532
|
+
a.getPushOverProducts({
|
|
533
|
+
machineChannel: this.listenOnChannel,
|
|
534
|
+
selection: t
|
|
535
|
+
}),
|
|
536
|
+
"check-data"
|
|
537
|
+
);
|
|
427
538
|
}
|
|
428
539
|
/**
|
|
429
540
|
* @param {number|string} selection
|
|
430
541
|
* @return {Promise<*>}
|
|
431
542
|
*/
|
|
432
|
-
async getChannelRunningAfterDispense({ selection:
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
543
|
+
async getChannelRunningAfterDispense({ selection: t = 1 } = {}) {
|
|
544
|
+
return await this.appendToQueue(
|
|
545
|
+
a.getChannelRunningAfterDispense({
|
|
546
|
+
machineChannel: this.listenOnChannel,
|
|
547
|
+
selection: t
|
|
548
|
+
}),
|
|
549
|
+
"check-data"
|
|
550
|
+
);
|
|
551
|
+
}
|
|
552
|
+
async setDisplayStandbyMessage({ message: t = "" } = {}) {
|
|
553
|
+
return await this.appendToQueue(
|
|
554
|
+
a.setDisplayStandbyMessage({
|
|
555
|
+
machineChannel: this.listenOnChannel,
|
|
556
|
+
message: t
|
|
557
|
+
}),
|
|
558
|
+
"display"
|
|
559
|
+
);
|
|
442
560
|
}
|
|
443
561
|
/**
|
|
444
562
|
* @param {string} message
|
|
445
563
|
* @param {number|string} seconds
|
|
446
564
|
* @return {Promise<void>}
|
|
447
565
|
*/
|
|
448
|
-
async setDisplayMessageTemporarily({ message:
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
566
|
+
async setDisplayMessageTemporarily({ message: t = "", seconds: e = 1 }) {
|
|
567
|
+
return this.appendToQueue(
|
|
568
|
+
a.setDisplayMessageTemporarily({
|
|
569
|
+
machineChannel: this.listenOnChannel,
|
|
570
|
+
message: t,
|
|
571
|
+
seconds: e
|
|
572
|
+
}),
|
|
573
|
+
"display"
|
|
574
|
+
);
|
|
452
575
|
}
|
|
453
576
|
/**
|
|
454
577
|
* @param {string} message
|
|
455
578
|
* @return {Promise<void>}
|
|
456
579
|
*/
|
|
457
|
-
async setDisplayMessageUnlimited({ message:
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
580
|
+
async setDisplayMessageUnlimited({ message: t = "" }) {
|
|
581
|
+
return await this.appendToQueue(
|
|
582
|
+
a.setDisplayMessageUnlimited({
|
|
583
|
+
machineChannel: this.listenOnChannel,
|
|
584
|
+
message: t
|
|
585
|
+
}),
|
|
586
|
+
"display"
|
|
587
|
+
);
|
|
588
|
+
}
|
|
589
|
+
async programClock({ date: t = /* @__PURE__ */ new Date() } = {}) {
|
|
590
|
+
return await this.appendToQueue(
|
|
591
|
+
a.programClock({
|
|
592
|
+
machineChannel: this.listenOnChannel,
|
|
593
|
+
date: t
|
|
594
|
+
}),
|
|
595
|
+
"clock"
|
|
596
|
+
);
|
|
466
597
|
}
|
|
467
598
|
/**
|
|
468
599
|
* @param {null|string} event
|
|
469
600
|
* @param {boolean} enable
|
|
470
601
|
* @return {Promise<void>}
|
|
471
602
|
*/
|
|
472
|
-
async eventsConfig({ event:
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
}
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
603
|
+
async eventsConfig({ event: t = null, enable: e = !0 } = {}) {
|
|
604
|
+
return await this.appendToQueue(
|
|
605
|
+
a.eventsConfig({
|
|
606
|
+
machineChannel: this.listenOnChannel,
|
|
607
|
+
event: t,
|
|
608
|
+
enable: e
|
|
609
|
+
}),
|
|
610
|
+
"events-config"
|
|
611
|
+
);
|
|
612
|
+
}
|
|
613
|
+
async eventEnable({ event: t = null } = {}) {
|
|
614
|
+
return await this.appendToQueue(
|
|
615
|
+
a.eventEnable({
|
|
616
|
+
machineChannel: this.listenOnChannel,
|
|
617
|
+
event: t
|
|
618
|
+
}),
|
|
619
|
+
"events-config"
|
|
620
|
+
);
|
|
621
|
+
}
|
|
622
|
+
async eventDisable({ event: t = null } = {}) {
|
|
623
|
+
return await this.appendToQueue(
|
|
624
|
+
a.eventEnable({
|
|
625
|
+
machineChannel: this.listenOnChannel,
|
|
626
|
+
event: t
|
|
627
|
+
}),
|
|
628
|
+
"events-config"
|
|
629
|
+
);
|
|
630
|
+
}
|
|
631
|
+
async sendCustomCode({ code: t = [] } = {}) {
|
|
632
|
+
return await this.appendToQueue(
|
|
633
|
+
a.sendCustomCode({
|
|
634
|
+
machineChannel: this.listenOnChannel,
|
|
635
|
+
code: t
|
|
636
|
+
}),
|
|
637
|
+
"custom"
|
|
638
|
+
);
|
|
492
639
|
}
|
|
493
640
|
async assignChannels() {
|
|
494
|
-
const
|
|
495
|
-
if (
|
|
641
|
+
const t = this.__device.channels.verification.start, e = this.__device.channels.verification.end;
|
|
642
|
+
if (t > e) throw new Error("Invalid range, start must be less than end");
|
|
496
643
|
this.__device.channels.verification.clear(), this.__device.channels.verification.running = !0;
|
|
497
|
-
for (let r =
|
|
644
|
+
for (let r = t; r <= e; r++)
|
|
498
645
|
this.__device.channels.verification.current = r, await this.getChannelPresence({ selection: r });
|
|
499
646
|
return new Promise((r) => {
|
|
500
|
-
let
|
|
501
|
-
this.__device.channels.verification.channels.length ===
|
|
647
|
+
let o = setInterval(() => {
|
|
648
|
+
this.__device.channels.verification.channels.length === e - t + 1 && (clearInterval(o), this.dispatch("channels", { channels: this.__device.channels.verification.channels }), this.__device.channels.verification.clear(), r(!0));
|
|
502
649
|
}, 500);
|
|
503
650
|
});
|
|
504
651
|
}
|
|
505
652
|
}
|
|
506
|
-
|
|
507
|
-
const
|
|
653
|
+
n = new WeakSet(), S = function() {
|
|
654
|
+
const t = [
|
|
508
655
|
"dispensing:withdrawal",
|
|
509
656
|
"command-executed",
|
|
510
657
|
"keyboard:pressed",
|
|
@@ -537,38 +684,29 @@ i = new WeakSet(), $ = function() {
|
|
|
537
684
|
"channel:status",
|
|
538
685
|
"machine:status"
|
|
539
686
|
];
|
|
540
|
-
for (const
|
|
541
|
-
this.serialRegisterAvailableListener(
|
|
542
|
-
}, W = function() {
|
|
543
|
-
this.on("internal:dispense:running", n(this, i, ut).bind(this));
|
|
687
|
+
for (const e of t)
|
|
688
|
+
this.serialRegisterAvailableListener(e);
|
|
544
689
|
}, g = function() {
|
|
545
|
-
|
|
546
|
-
},
|
|
547
|
-
return e[3] = this.__internal__.device.hex_number, this.appendToQueue(n(this, i, E).call(this, e), t);
|
|
548
|
-
}, E = function(e) {
|
|
549
|
-
let t = this.hexToDec(this.sumHex(e)), r = this.calcCheckSums(t.toString());
|
|
550
|
-
for (let a = 0; a < 2; a++)
|
|
551
|
-
e.push(this.hexMaker(r[a]));
|
|
552
|
-
return e.push("03"), e;
|
|
553
|
-
}, q = async function() {
|
|
690
|
+
this.on("internal:dispense:running", i(this, n, he).bind(this));
|
|
691
|
+
}, A = async function() {
|
|
554
692
|
if (this.__internal__.dispense.elevator.locking_interval) return;
|
|
555
|
-
this.__internal__.dispense.elevator.need_reset && (this.__internal__.dispense.elevator.need_reset = !1, await this.resetWaitingProductRemovedError(), await
|
|
556
|
-
const
|
|
557
|
-
return this.__internal__.dispense.status = "elevator-locked", this.__internal__.dispense.elevator.locking_time = 60, new Promise((
|
|
558
|
-
|
|
559
|
-
|
|
693
|
+
this.__internal__.dispense.elevator.need_reset && (this.__internal__.dispense.elevator.need_reset = !1, await this.resetWaitingProductRemovedError(), await w(500));
|
|
694
|
+
const t = this;
|
|
695
|
+
return this.__internal__.dispense.status = "elevator-locked", this.__internal__.dispense.elevator.locking_time = 60, new Promise((e) => {
|
|
696
|
+
t.__internal__.dispense.elevator.locking_interval = setInterval(() => {
|
|
697
|
+
t.dispatch("dispensing:withdrawal", {
|
|
560
698
|
elevator: !0,
|
|
561
|
-
seconds:
|
|
699
|
+
seconds: t.__internal__.dispense.elevator.locking_time,
|
|
562
700
|
description: "Please recall products from the elevator"
|
|
563
|
-
}),
|
|
701
|
+
}), t.__internal__.dispense.elevator.locking_time -= 1, t.__internal__.dispense.elevator.locking_time <= 0 && (clearInterval(t.__internal__.dispense.elevator.locking_interval), t.__internal__.dispense.elevator.locking_interval = 0, e(!0));
|
|
564
702
|
}, 1e3);
|
|
565
703
|
});
|
|
566
|
-
},
|
|
567
|
-
return
|
|
568
|
-
},
|
|
569
|
-
|
|
570
|
-
hex:
|
|
571
|
-
dec: this.hexToDec(
|
|
704
|
+
}, B = function(t, e) {
|
|
705
|
+
return e.name = "ok", e.description = "The last command was executed successfully", e.no_code = 1, this.dispatch("command-executed", e), e;
|
|
706
|
+
}, W = function(t, e) {
|
|
707
|
+
e.additional = {
|
|
708
|
+
hex: t,
|
|
709
|
+
dec: this.hexToDec(t),
|
|
572
710
|
ascii: null
|
|
573
711
|
};
|
|
574
712
|
const r = {
|
|
@@ -589,26 +727,26 @@ i = new WeakSet(), $ = function() {
|
|
|
589
727
|
43: "C",
|
|
590
728
|
44: "D"
|
|
591
729
|
};
|
|
592
|
-
return
|
|
593
|
-
},
|
|
594
|
-
return
|
|
595
|
-
},
|
|
596
|
-
|
|
597
|
-
let r =
|
|
598
|
-
return r && this.listenOnChannel > 1 && (r = this.hexToDec(r) - this.listenOnChannel + 1, r = this.decToHex(r)), r && (r === "FD" ? (
|
|
730
|
+
return e.additional.ascii = r[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;
|
|
731
|
+
}, F = function(t, e) {
|
|
732
|
+
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.__internal__.device.door_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.__internal__.device.door_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;
|
|
733
|
+
}, q = function(t, e) {
|
|
734
|
+
e.no_code = 404;
|
|
735
|
+
let r = t[5] ?? null;
|
|
736
|
+
return r && this.listenOnChannel > 1 && (r = this.hexToDec(r) - this.listenOnChannel + 1, r = this.decToHex(r)), r && (r === "FD" ? (e.no_code = 4, e.name = "channel disconnected", e.description = "The channel is disconnected", e.additional = { active: !1 }) : r === "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({
|
|
599
737
|
selection: this.__device.channels.verification.current,
|
|
600
|
-
active:
|
|
601
|
-
}),
|
|
602
|
-
},
|
|
603
|
-
|
|
604
|
-
const r =
|
|
605
|
-
return
|
|
606
|
-
},
|
|
607
|
-
|
|
608
|
-
const r =
|
|
738
|
+
active: e.additional.active
|
|
739
|
+
}), e.additional.selection = this.__device.channels.verification.current), this.dispatch("channel:status", e.additional)), e;
|
|
740
|
+
}, R = function(t, e) {
|
|
741
|
+
e.no_code = 39, e.name = "Program version";
|
|
742
|
+
const r = t.slice(4, 12), o = r.map((c) => String.fromCharCode(this.hexToDec(c))).join("");
|
|
743
|
+
return e.additional = { version: o, hex: r }, e.description = `The program version is ${o}`, this.dispatch("program:version", e.additional), e;
|
|
744
|
+
}, $ = function(t, e) {
|
|
745
|
+
e.no_code = 39, e.name = "Machine faults", e.description = "No faults detected", e.additional = { no_faults: 0, faults: [] };
|
|
746
|
+
const r = t.slice(4, -3);
|
|
609
747
|
if (r.length > 1 && r[0] !== "30") {
|
|
610
|
-
|
|
611
|
-
const
|
|
748
|
+
e.description = "Machine has faults";
|
|
749
|
+
const o = {
|
|
612
750
|
31: "Busy",
|
|
613
751
|
32: "Invalid tray",
|
|
614
752
|
33: "Invalid channel",
|
|
@@ -642,65 +780,65 @@ i = new WeakSet(), $ = function() {
|
|
|
642
780
|
63: "Product is expired",
|
|
643
781
|
64: "Product detector didn't change during its verification test"
|
|
644
782
|
};
|
|
645
|
-
for (const
|
|
646
|
-
|
|
647
|
-
}
|
|
648
|
-
return this.dispatch("machine:faults",
|
|
649
|
-
},
|
|
650
|
-
|
|
651
|
-
const r =
|
|
652
|
-
2e3 + parseInt(
|
|
653
|
-
parseInt(
|
|
654
|
-
parseInt(
|
|
655
|
-
parseInt(
|
|
656
|
-
parseInt(
|
|
783
|
+
for (const c of r)
|
|
784
|
+
o[c] && (e.additional.faults.push(o[c]), e.additional.no_faults++);
|
|
785
|
+
}
|
|
786
|
+
return this.dispatch("machine:faults", e.additional), e;
|
|
787
|
+
}, N = function(t, e) {
|
|
788
|
+
e.no_code = 40, e.name = "Clock registers", e.description = "Clock registers";
|
|
789
|
+
const r = t.slice(4, -3), o = r.map((x) => String.fromCharCode(this.hexToDec(x))).join(""), [c, l] = o.split(" "), [f, y] = c.split(":"), [v, T, k] = l.split("-"), m = new Date(
|
|
790
|
+
2e3 + parseInt(k),
|
|
791
|
+
parseInt(T) - 1,
|
|
792
|
+
parseInt(v),
|
|
793
|
+
parseInt(f),
|
|
794
|
+
parseInt(y)
|
|
657
795
|
);
|
|
658
|
-
return
|
|
659
|
-
day:
|
|
660
|
-
month:
|
|
661
|
-
year:
|
|
662
|
-
hours:
|
|
663
|
-
minutes:
|
|
664
|
-
formatted:
|
|
665
|
-
date:
|
|
796
|
+
return e.additional = {
|
|
797
|
+
day: v,
|
|
798
|
+
month: T,
|
|
799
|
+
year: k,
|
|
800
|
+
hours: f,
|
|
801
|
+
minutes: y,
|
|
802
|
+
formatted: o,
|
|
803
|
+
date: m,
|
|
666
804
|
hex: r
|
|
667
|
-
}, this.dispatch("clock:registers",
|
|
668
|
-
},
|
|
669
|
-
|
|
670
|
-
const r = String.fromCharCode(this.hexToDec(
|
|
805
|
+
}, this.dispatch("clock:registers", e.additional), e;
|
|
806
|
+
}, j = function(t, e) {
|
|
807
|
+
e.no_code = 41, e.name = "Machine activity", e.description = "Events from read machine activity";
|
|
808
|
+
const r = String.fromCharCode(this.hexToDec(t[4]));
|
|
671
809
|
if (r !== "0") {
|
|
672
|
-
const
|
|
673
|
-
if (r === "T" &&
|
|
674
|
-
const
|
|
675
|
-
|
|
810
|
+
const o = t.slice(5, -3);
|
|
811
|
+
if (r === "T" && o.length === 4) {
|
|
812
|
+
const c = String.fromCharCode(this.hexToDec(o[0])), l = String.fromCharCode(this.hexToDec(o[1])), f = String.fromCharCode(this.hexToDec(o[3]));
|
|
813
|
+
e.additional = {
|
|
676
814
|
ascii: r,
|
|
677
815
|
type: "DU.d",
|
|
678
|
-
dozens:
|
|
679
|
-
units:
|
|
680
|
-
decimals:
|
|
681
|
-
time: parseFloat(`${
|
|
816
|
+
dozens: c,
|
|
817
|
+
units: l,
|
|
818
|
+
decimals: f,
|
|
819
|
+
time: parseFloat(`${c}${l}.${f}`),
|
|
682
820
|
meaning: "Extraction time (in seconds)"
|
|
683
821
|
};
|
|
684
|
-
} else if (["B", "D", "E", "F", "G"].includes(r) &&
|
|
685
|
-
const
|
|
822
|
+
} else if (["B", "D", "E", "F", "G"].includes(r) && o.length === 3) {
|
|
823
|
+
const c = String.fromCharCode(this.hexToDec(o[0])), l = String.fromCharCode(this.hexToDec(o[1])), f = String.fromCharCode(this.hexToDec(o[2])), y = parseInt(`${c}${l}${f}`), v = {
|
|
686
824
|
B: "Error on going to tray channel",
|
|
687
825
|
D: "Error on product detector",
|
|
688
826
|
E: "Extraction of channel ok",
|
|
689
827
|
F: "Error on engine intensity detection",
|
|
690
828
|
G: "Error on product exit door"
|
|
691
829
|
};
|
|
692
|
-
|
|
830
|
+
e.additional = {
|
|
693
831
|
type: "HDU",
|
|
694
|
-
hundreds:
|
|
695
|
-
dozens:
|
|
696
|
-
decimals:
|
|
697
|
-
channel:
|
|
698
|
-
selection:
|
|
832
|
+
hundreds: c,
|
|
833
|
+
dozens: l,
|
|
834
|
+
decimals: f,
|
|
835
|
+
channel: y,
|
|
836
|
+
selection: y - 109,
|
|
699
837
|
ascii: r,
|
|
700
|
-
meaning:
|
|
838
|
+
meaning: v[r] ?? "Unknown"
|
|
701
839
|
};
|
|
702
|
-
} else if (
|
|
703
|
-
const
|
|
840
|
+
} else if (o.length === 13) {
|
|
841
|
+
const c = o.map((le) => String.fromCharCode(this.hexToDec(le))).join(""), l = parseInt(c.slice(0, 2)), f = parseInt(c.slice(2, 4)), y = parseInt(c.slice(4, 6)), v = parseInt(c.slice(7, 9)), T = parseInt(c.slice(9, 11)) - 1, k = 2e3 + parseInt(c.slice(11, 13)), m = new Date(k, T, v, l, f, y), x = {
|
|
704
842
|
A: "Attempt to close product exit door",
|
|
705
843
|
C: "Closing of exterior door",
|
|
706
844
|
H: "Error on opening of product exit door",
|
|
@@ -718,390 +856,380 @@ i = new WeakSet(), $ = function() {
|
|
|
718
856
|
e: "New attempt to extract from channel due no product detection when elevator arrived to product exit position",
|
|
719
857
|
o: "Opening of inner door"
|
|
720
858
|
};
|
|
721
|
-
|
|
859
|
+
e.additional = {
|
|
722
860
|
type: "hhmmssWddMMAA",
|
|
723
|
-
date:
|
|
724
|
-
hex:
|
|
725
|
-
formatted:
|
|
861
|
+
date: m,
|
|
862
|
+
hex: o,
|
|
863
|
+
formatted: m.toLocaleString(),
|
|
726
864
|
ascii: r,
|
|
727
|
-
meaning:
|
|
865
|
+
meaning: x[r] ?? "Unknown"
|
|
728
866
|
};
|
|
729
867
|
}
|
|
730
868
|
}
|
|
731
|
-
return this.dispatch("machine:activity",
|
|
732
|
-
},
|
|
869
|
+
return this.dispatch("machine:activity", e.additional), e;
|
|
870
|
+
}, L = function(t, e) {
|
|
733
871
|
const r = {
|
|
734
872
|
30: "Spanish",
|
|
735
873
|
31: "English",
|
|
736
874
|
32: "French"
|
|
737
875
|
};
|
|
738
|
-
return
|
|
739
|
-
hex:
|
|
740
|
-
language: r[
|
|
741
|
-
}, this.dispatch("check:language",
|
|
742
|
-
},
|
|
743
|
-
return
|
|
744
|
-
hex:
|
|
745
|
-
beeper:
|
|
746
|
-
}, this.dispatch("check:beeper",
|
|
747
|
-
},
|
|
748
|
-
|
|
749
|
-
const r = this.hexToDec(
|
|
750
|
-
return
|
|
751
|
-
hex:
|
|
876
|
+
return e.no_code = 42, e.name = "Language", e.description = `The language is ${r[t] ?? "unknown"}`, e.additional = {
|
|
877
|
+
hex: t,
|
|
878
|
+
language: r[t] ?? "unknown"
|
|
879
|
+
}, this.dispatch("check:language", e.additional), e;
|
|
880
|
+
}, V = function(t, e) {
|
|
881
|
+
return e.no_code = 43, e.name = "Beeper", e.description = `The beeper is ${t === "30" ? "on" : "off"}`, e.additional = {
|
|
882
|
+
hex: t,
|
|
883
|
+
beeper: t === "30"
|
|
884
|
+
}, this.dispatch("check:beeper", e.additional), e;
|
|
885
|
+
}, J = function(t, e) {
|
|
886
|
+
e.no_code = 44, e.name = "Isolation tray", e.description = "Isolation tray";
|
|
887
|
+
const r = this.hexToDec(t) - 139;
|
|
888
|
+
return e.additional = {
|
|
889
|
+
hex: t,
|
|
752
890
|
tray: r
|
|
753
|
-
}, this.dispatch("check:isolation-tray",
|
|
754
|
-
},
|
|
755
|
-
|
|
756
|
-
const r = (this.hexToDec(
|
|
757
|
-
return
|
|
758
|
-
hex:
|
|
891
|
+
}, this.dispatch("check:isolation-tray", e.additional), e;
|
|
892
|
+
}, U = function(t, e) {
|
|
893
|
+
e.no_code = 45, e.name = "Engine voltage", e.description = "Engine voltage";
|
|
894
|
+
const r = (this.hexToDec(t) - 128) / 2 + 5;
|
|
895
|
+
return e.additional = {
|
|
896
|
+
hex: t,
|
|
759
897
|
voltage: r
|
|
760
|
-
}, this.dispatch("check:engine-voltage",
|
|
761
|
-
},
|
|
762
|
-
|
|
763
|
-
const r =
|
|
764
|
-
return
|
|
765
|
-
hex:
|
|
898
|
+
}, this.dispatch("check:engine-voltage", e.additional), e;
|
|
899
|
+
}, K = function(t, e) {
|
|
900
|
+
e.no_code = 46, e.name = "Push over", e.description = "Push over";
|
|
901
|
+
const r = t === "30";
|
|
902
|
+
return e.additional = {
|
|
903
|
+
hex: t,
|
|
766
904
|
push: r
|
|
767
|
-
}, this.dispatch("check:push-over",
|
|
768
|
-
},
|
|
769
|
-
|
|
770
|
-
const r = (this.hexToDec(
|
|
771
|
-
return
|
|
772
|
-
hex:
|
|
905
|
+
}, this.dispatch("check:push-over", e.additional), e;
|
|
906
|
+
}, H = function(t, e) {
|
|
907
|
+
e.no_code = 47, e.name = "Extractor after dispense", e.description = "Extractor after dispense";
|
|
908
|
+
const r = (this.hexToDec(t) - 128) / 10;
|
|
909
|
+
return e.additional = {
|
|
910
|
+
hex: t,
|
|
773
911
|
seconds: r
|
|
774
|
-
}, this.dispatch("check:extractor-after-dispense",
|
|
775
|
-
},
|
|
776
|
-
|
|
777
|
-
const r = this.hexToDec(
|
|
778
|
-
return
|
|
779
|
-
hex:
|
|
912
|
+
}, this.dispatch("check:extractor-after-dispense", e.additional), e;
|
|
913
|
+
}, z = function(t, e) {
|
|
914
|
+
e.no_code = 48, e.name = "Standby after collect", e.description = "Time to standby after collect product";
|
|
915
|
+
const r = this.hexToDec(t) - 128;
|
|
916
|
+
return e.additional = {
|
|
917
|
+
hex: t,
|
|
780
918
|
seconds: r
|
|
781
|
-
}, this.dispatch("check:standby-after-collect",
|
|
782
|
-
},
|
|
783
|
-
|
|
784
|
-
const r = this.hexToDec(
|
|
785
|
-
return
|
|
786
|
-
hex:
|
|
919
|
+
}, this.dispatch("check:standby-after-collect", e.additional), e;
|
|
920
|
+
}, G = function(t, e) {
|
|
921
|
+
e.no_code = 49, e.name = "Standby without collect", e.description = "Time to standby when product delivery is not collected";
|
|
922
|
+
const r = this.hexToDec(t) - 128;
|
|
923
|
+
return e.additional = {
|
|
924
|
+
hex: t,
|
|
787
925
|
minutes: r
|
|
788
|
-
}, this.dispatch("check:standby-without-collect",
|
|
789
|
-
},
|
|
790
|
-
|
|
791
|
-
const r =
|
|
792
|
-
return
|
|
793
|
-
hex:
|
|
926
|
+
}, this.dispatch("check:standby-without-collect", e.additional), e;
|
|
927
|
+
}, Y = function(t, e) {
|
|
928
|
+
e.no_code = 50, e.name = "Elevator speed", e.description = "Elevator speed";
|
|
929
|
+
const r = t === "30" ? "low" : "high";
|
|
930
|
+
return e.additional = {
|
|
931
|
+
hex: t,
|
|
794
932
|
speed: r
|
|
795
|
-
}, this.dispatch("check:elevator-speed",
|
|
796
|
-
},
|
|
797
|
-
|
|
798
|
-
const r =
|
|
799
|
-
return
|
|
800
|
-
hex:
|
|
933
|
+
}, this.dispatch("check:elevator-speed", e.additional), e;
|
|
934
|
+
}, Z = function(t, e) {
|
|
935
|
+
e.no_code = 51, e.name = "Temperature expiration", e.description = "Temperature expiration";
|
|
936
|
+
const r = t === "31";
|
|
937
|
+
return e.additional = {
|
|
938
|
+
hex: t,
|
|
801
939
|
enabled: r
|
|
802
|
-
}, this.dispatch("check:expiration-by-temperature",
|
|
803
|
-
},
|
|
804
|
-
|
|
805
|
-
const r = (this.hexToDec(
|
|
806
|
-
return
|
|
807
|
-
hex:
|
|
940
|
+
}, this.dispatch("check:expiration-by-temperature", e.additional), e;
|
|
941
|
+
}, X = function(t, e) {
|
|
942
|
+
e.no_code = 52, e.name = "Temperature before expiration", e.description = "Temperature before expiration";
|
|
943
|
+
const r = (this.hexToDec(t) - 128) / 2;
|
|
944
|
+
return e.additional = {
|
|
945
|
+
hex: t,
|
|
808
946
|
temperature: r
|
|
809
|
-
}, this.dispatch("check:temperature-before-expiration",
|
|
810
|
-
},
|
|
811
|
-
|
|
812
|
-
const r = this.hexToDec(
|
|
813
|
-
return
|
|
814
|
-
hex:
|
|
947
|
+
}, this.dispatch("check:temperature-before-expiration", e.additional), e;
|
|
948
|
+
}, ee = function(t, e) {
|
|
949
|
+
e.no_code = 53, e.name = "Time before expiration", e.description = "Time before expiration";
|
|
950
|
+
const r = this.hexToDec(t) - 128;
|
|
951
|
+
return e.additional = {
|
|
952
|
+
hex: t,
|
|
815
953
|
minutes: r
|
|
816
|
-
}, this.dispatch("check:expiration-after",
|
|
817
|
-
},
|
|
818
|
-
|
|
819
|
-
const r =
|
|
820
|
-
return
|
|
821
|
-
hex:
|
|
954
|
+
}, this.dispatch("check:expiration-after", e.additional), e;
|
|
955
|
+
}, te = function(t, e) {
|
|
956
|
+
e.no_code = 54, e.name = "Temperature scale", e.description = "Temperature scale";
|
|
957
|
+
const r = t === "43" ? "Celsius" : "Fahrenheit";
|
|
958
|
+
return e.additional = {
|
|
959
|
+
hex: t,
|
|
822
960
|
scale: r
|
|
823
|
-
}, this.dispatch("check:temperature-scale",
|
|
824
|
-
},
|
|
825
|
-
return
|
|
826
|
-
},
|
|
827
|
-
return
|
|
828
|
-
hex:
|
|
961
|
+
}, this.dispatch("check:temperature-scale", e.additional), e;
|
|
962
|
+
}, ne = function(t, e) {
|
|
963
|
+
return e.no_code = 54, e.name = "Machine ID", e.description = "Machine ID", e.additional = { hex: t[4], full_hex: t }, this.dispatch("check:machine-id", e.additional), e;
|
|
964
|
+
}, ie = function(t, e) {
|
|
965
|
+
return e.no_code = 7, e.name = "working temperature", e.description = `The working temperature is ${t}`, e.additional = {
|
|
966
|
+
hex: t,
|
|
829
967
|
temperature: {
|
|
830
|
-
traditional: (this.hexToDec(
|
|
831
|
-
ice_plus: (this.hexToDec(
|
|
968
|
+
traditional: (this.hexToDec(t) - this.hexToDec("80")) / 2,
|
|
969
|
+
ice_plus: (this.hexToDec(t) - this.hexToDec("80")) / 2 - 25.5
|
|
832
970
|
}
|
|
833
|
-
}, this.dispatch("temperature:working",
|
|
834
|
-
},
|
|
835
|
-
return
|
|
971
|
+
}, this.dispatch("temperature:working", e.additional), e;
|
|
972
|
+
}, re = function(t, e) {
|
|
973
|
+
return e.no_code = 8, e.name = "current temperature", e.additional = {
|
|
836
974
|
sign: null,
|
|
837
975
|
tens: null,
|
|
838
976
|
units: null,
|
|
839
977
|
decimals: null,
|
|
840
978
|
type_degrees: null,
|
|
841
979
|
formatted: null,
|
|
842
|
-
decimal_point:
|
|
843
|
-
degrees:
|
|
980
|
+
decimal_point: t[7] === "2e" ? "." : null,
|
|
981
|
+
degrees: t[9] === "7f" ? "°" : null,
|
|
844
982
|
error: null
|
|
845
|
-
},
|
|
846
|
-
},
|
|
847
|
-
if (
|
|
848
|
-
|
|
983
|
+
}, t[4] === "2b" ? e.additional.sign = t[4] = "+" : ["2e", "2d"].includes(t[4]) ? e.additional.sign = t[4] = "-" : t[4] === "20" && (e.additional.error = "Error in thermometer"), this.hexToDec(t[5]) >= 48 && this.hexToDec(t[5]) <= 57 ? e.additional.tens = this.hexToDec(t[5]) - 48 : t[5] === "2a" && (e.additional.error = "Error in thermometer"), this.hexToDec(t[6]) >= 48 && this.hexToDec(t[6]) <= 57 ? e.additional.units = this.hexToDec(t[6]) - 48 : t[6] === "2a" && (e.additional.error = "Error in thermometer"), this.hexToDec(t[8]) >= 48 && this.hexToDec(t[8]) <= 57 ? e.additional.decimals = this.hexToDec(t[8]) - 48 : t[8] === "2a" && (e.additional.error = "Error in thermometer"), t[10] === "43" ? e.additional.type_degrees = "C" : t[10] === "46" && (e.additional.type_degrees = "F"), e.additional.error === "Error in thermometer" ? (e.additional.formatted = "Error in thermometer", e.description = "The current temperature cannot be read because there is an error in the thermometer") : (e.additional.formatted = (e.additional.sign ?? "") + (e.additional.tens ?? "") + (e.additional.units ?? "") + (e.additional.decimal_point ?? "") + (e.additional.decimals ?? "") + (e.additional.degrees ?? "") + (e.additional.type_degrees ?? ""), e.description = `The current temperature is ${e.additional.formatted}`), this.dispatch("temperature:current", e.additional), e;
|
|
984
|
+
}, ae = function(t, e, r = 128) {
|
|
985
|
+
if (t[1] && (e.additional.machine.hex = t[1], e.additional.machine.dec = this.hexToDec(t[1]) - r), !(t[1] && t[2]))
|
|
986
|
+
e = i(this, n, B).call(this, t, e);
|
|
849
987
|
else
|
|
850
|
-
switch (
|
|
988
|
+
switch (t[2]) {
|
|
851
989
|
case "54":
|
|
852
|
-
|
|
990
|
+
e.request = "--automatic", e = i(this, n, W).call(this, t[3], e);
|
|
853
991
|
break;
|
|
854
992
|
case "50":
|
|
855
|
-
|
|
993
|
+
e.request = "--automatic", e = i(this, n, F).call(this, t[3], e);
|
|
856
994
|
break;
|
|
857
995
|
case "43":
|
|
858
|
-
switch (
|
|
996
|
+
switch (e.request = "check-data", t[3]) {
|
|
859
997
|
case "41":
|
|
860
|
-
|
|
998
|
+
e = i(this, n, j).call(this, t, e);
|
|
861
999
|
break;
|
|
862
1000
|
case "43":
|
|
863
|
-
|
|
1001
|
+
e.request = "channel-status", e = i(this, n, q).call(this, t, e);
|
|
864
1002
|
break;
|
|
865
1003
|
case "50":
|
|
866
|
-
|
|
1004
|
+
e = i(this, n, R).call(this, t, e);
|
|
867
1005
|
break;
|
|
868
1006
|
case "53":
|
|
869
|
-
|
|
1007
|
+
e = i(this, n, $).call(this, t, e);
|
|
870
1008
|
break;
|
|
871
1009
|
case "54":
|
|
872
|
-
|
|
1010
|
+
e.request = "working-temperature", e = i(this, n, ie).call(this, t[4], e);
|
|
873
1011
|
break;
|
|
874
1012
|
case "72":
|
|
875
|
-
|
|
1013
|
+
e = i(this, n, N).call(this, t, e);
|
|
876
1014
|
break;
|
|
877
1015
|
case "74":
|
|
878
|
-
|
|
1016
|
+
e.request = "current-temperature", e = i(this, n, re).call(this, t, e);
|
|
879
1017
|
break;
|
|
880
1018
|
case "49":
|
|
881
|
-
|
|
1019
|
+
e = i(this, n, L).call(this, t[4], e);
|
|
882
1020
|
break;
|
|
883
1021
|
case "5a":
|
|
884
|
-
|
|
1022
|
+
e = i(this, n, V).call(this, t[4], e);
|
|
885
1023
|
break;
|
|
886
1024
|
case "42":
|
|
887
|
-
|
|
1025
|
+
e = i(this, n, J).call(this, t[4], e);
|
|
888
1026
|
break;
|
|
889
1027
|
case "47":
|
|
890
|
-
|
|
1028
|
+
e = i(this, n, U).call(this, t[4], e);
|
|
891
1029
|
break;
|
|
892
1030
|
case "4e":
|
|
893
|
-
|
|
1031
|
+
e = i(this, n, ne).call(this, t, e);
|
|
894
1032
|
break;
|
|
895
1033
|
case "4f":
|
|
896
|
-
|
|
1034
|
+
e = i(this, n, K).call(this, t[4], e);
|
|
897
1035
|
break;
|
|
898
1036
|
case "45":
|
|
899
|
-
|
|
1037
|
+
e = i(this, n, H).call(this, t[4], e);
|
|
900
1038
|
break;
|
|
901
1039
|
case "46":
|
|
902
|
-
|
|
1040
|
+
e = i(this, n, z).call(this, t[4], e);
|
|
903
1041
|
break;
|
|
904
1042
|
case "48":
|
|
905
|
-
|
|
1043
|
+
e = i(this, n, G).call(this, t[4], e);
|
|
906
1044
|
break;
|
|
907
1045
|
case "76":
|
|
908
|
-
|
|
1046
|
+
e = i(this, n, Y).call(this, t[4], e);
|
|
909
1047
|
break;
|
|
910
1048
|
case "63":
|
|
911
|
-
|
|
1049
|
+
e = i(this, n, Z).call(this, t[4], e);
|
|
912
1050
|
break;
|
|
913
1051
|
case "65":
|
|
914
|
-
|
|
1052
|
+
e = i(this, n, X).call(this, t[4], e);
|
|
915
1053
|
break;
|
|
916
1054
|
case "66":
|
|
917
|
-
|
|
1055
|
+
e = i(this, n, ee).call(this, t[4], e);
|
|
918
1056
|
break;
|
|
919
1057
|
case "67":
|
|
920
|
-
|
|
1058
|
+
e = i(this, n, te).call(this, t[4], e);
|
|
921
1059
|
break;
|
|
922
1060
|
}
|
|
923
1061
|
break;
|
|
924
1062
|
}
|
|
925
|
-
return
|
|
926
|
-
},
|
|
1063
|
+
return e;
|
|
1064
|
+
}, u = function() {
|
|
927
1065
|
this.__internal__.dispense.dispensing && (this.__internal__.dispense.status = !0);
|
|
928
|
-
},
|
|
1066
|
+
}, s = function() {
|
|
929
1067
|
this.__internal__.dispense.dispensing && (this.__internal__.dispense.status = !1);
|
|
930
|
-
},
|
|
1068
|
+
}, b = function() {
|
|
931
1069
|
this.__internal__.dispense.dispensing && (this.__internal__.dispense.status = "elevator-locked");
|
|
932
1070
|
}, /**
|
|
933
1071
|
* Dispatch a warning message
|
|
934
1072
|
* @param {null|string} type
|
|
935
1073
|
* @param {string} severity
|
|
936
1074
|
*/
|
|
937
|
-
d = function({ type:
|
|
938
|
-
this.dispatch("jofemar:warning", { type:
|
|
1075
|
+
d = function({ type: t = null, severity: e = "low" } = {}) {
|
|
1076
|
+
this.dispatch("jofemar:warning", { type: t, severity: e });
|
|
939
1077
|
}, /**
|
|
940
1078
|
* Dispatch an error message
|
|
941
1079
|
* @param {null|string} type
|
|
942
1080
|
* @param {string} severity
|
|
943
1081
|
*/
|
|
944
|
-
|
|
945
|
-
this.dispatch("jofemar:error", { type:
|
|
946
|
-
},
|
|
947
|
-
if (
|
|
948
|
-
switch (
|
|
1082
|
+
_ = function({ type: t = null, severity: e = "high" } = {}) {
|
|
1083
|
+
this.dispatch("jofemar:error", { type: t, severity: e });
|
|
1084
|
+
}, oe = function(t, e) {
|
|
1085
|
+
if (e.request = "status", t[1] && !t[2]) {
|
|
1086
|
+
switch (t[1]) {
|
|
949
1087
|
case "30":
|
|
950
|
-
|
|
1088
|
+
e.name = "Machine ready", e.description = "The machine is ready for instructions", e.no_code = 9, i(this, n, u).call(this);
|
|
951
1089
|
break;
|
|
952
1090
|
case "31":
|
|
953
|
-
|
|
1091
|
+
e.name = "Machine busy", e.description = "The machine is busy right now", e.no_code = 10;
|
|
954
1092
|
break;
|
|
955
1093
|
case "32":
|
|
956
|
-
|
|
1094
|
+
e.name = "Invalid tray", e.description = "The tray requested is invalid", e.no_code = 11, i(this, n, s).call(this), i(this, n, d).call(this, { type: "invalid-tray" });
|
|
957
1095
|
break;
|
|
958
1096
|
case "33":
|
|
959
|
-
|
|
1097
|
+
e.name = "Invalid channel", e.description = "The channel requested is invalid", e.no_code = 12, i(this, n, s).call(this), i(this, n, d).call(this, { type: "invalid-channel" });
|
|
960
1098
|
break;
|
|
961
1099
|
case "34":
|
|
962
|
-
|
|
1100
|
+
e.name = "Empty channel", e.description = "The channel requested is empty", e.no_code = 13, i(this, n, s).call(this), i(this, n, d).call(this, { type: "empty-channel" });
|
|
963
1101
|
break;
|
|
964
1102
|
case "35":
|
|
965
|
-
|
|
1103
|
+
e.name = "Jam", e.description = "Jam in elevator engine", e.no_code = 14, i(this, n, s).call(this), i(this, n, _).call(this, { type: "jam" });
|
|
966
1104
|
break;
|
|
967
1105
|
case "36":
|
|
968
|
-
|
|
1106
|
+
e.name = "Malfunction", e.description = "Malfunction in the elevator belt or product detector", e.no_code = 15, i(this, n, s).call(this), i(this, n, _).call(this, { type: "malfunction" });
|
|
969
1107
|
break;
|
|
970
1108
|
case "37":
|
|
971
|
-
|
|
1109
|
+
e.name = "Photo transistors", e.description = "Failure in one of the photo transistors in the cabinet", e.no_code = 16, i(this, n, s).call(this), i(this, n, _).call(this, { type: "photo-transistors" });
|
|
972
1110
|
break;
|
|
973
1111
|
case "38":
|
|
974
|
-
|
|
1112
|
+
e.name = "Without channels", e.description = "No channels detected", e.no_code = 17, i(this, n, s).call(this), i(this, n, _).call(this, { type: "without-channels" });
|
|
975
1113
|
break;
|
|
976
1114
|
case "39":
|
|
977
|
-
|
|
1115
|
+
e.name = "Product detector fault", e.description = "Product detector fault", e.no_code = 18, i(this, n, b).call(this), i(this, n, d).call(this, { type: "fault-product-detector" });
|
|
978
1116
|
break;
|
|
979
1117
|
case "41":
|
|
980
|
-
|
|
1118
|
+
e.name = "Fault in 485 BUS", e.description = "Machine display is disconnected", e.no_code = 19, i(this, n, u).call(this), i(this, n, d).call(this, { type: "display-disconnected" });
|
|
981
1119
|
break;
|
|
982
1120
|
case "42":
|
|
983
|
-
|
|
1121
|
+
e.name = "Product under elevator", e.description = "Product alarm under elevator", e.no_code = 20, i(this, n, s).call(this), i(this, n, d).call(this, { type: "product-under-elevator" });
|
|
984
1122
|
break;
|
|
985
1123
|
case "43":
|
|
986
|
-
|
|
1124
|
+
e.name = "Error when elevator approaching to a position", e.description = "Error when elevator approaching to a position", e.no_code = 21, i(this, n, u).call(this), i(this, n, d).call(this, { type: "error-approaching-position", severity: "high" });
|
|
987
1125
|
break;
|
|
988
1126
|
case "44":
|
|
989
|
-
|
|
1127
|
+
e.name = "Fault in keyboard", e.description = "Fault in keyboard", e.no_code = 22, i(this, n, s).call(this), i(this, n, _).call(this, { type: "fault-keyboard" });
|
|
990
1128
|
break;
|
|
991
1129
|
case "45":
|
|
992
|
-
|
|
1130
|
+
e.name = "Eeprom writing error", e.description = "Eeprom writing error", e.no_code = 23, i(this, n, s).call(this), i(this, n, _).call(this, { type: "eeprom-writing-error", severity: "critical" });
|
|
993
1131
|
break;
|
|
994
1132
|
case "46":
|
|
995
|
-
|
|
1133
|
+
e.name = "Fault communicating with temperature control", e.description = "Fault communicating with temperature control", e.no_code = 24, i(this, n, u).call(this), i(this, n, d).call(this, { type: "fault-temperature-control" });
|
|
996
1134
|
break;
|
|
997
1135
|
case "47":
|
|
998
|
-
|
|
1136
|
+
e.name = "Thermometer disconnected", e.description = "The thermometer is disconnected", e.no_code = 25, i(this, n, u).call(this), i(this, n, d).call(this, { type: "thermometer-disconnected" });
|
|
999
1137
|
break;
|
|
1000
1138
|
case "48":
|
|
1001
|
-
|
|
1139
|
+
e.name = "Thermometer programming lost", e.description = "Thermometer programming lost", e.no_code = 26, i(this, n, u).call(this), i(this, n, d).call(this, { type: "thermometer-programming-lost" });
|
|
1002
1140
|
break;
|
|
1003
1141
|
case "49":
|
|
1004
|
-
|
|
1142
|
+
e.name = "Thermometer faulty", e.description = "Thermometer faulty", e.no_code = 27, i(this, n, u).call(this), i(this, n, d).call(this, { type: "thermometer-faulty" });
|
|
1005
1143
|
break;
|
|
1006
1144
|
case "4a":
|
|
1007
|
-
|
|
1145
|
+
e.name = "Channels power consumption detector faulty", e.description = "Channels power consumption detector faulty", e.no_code = 28, i(this, n, s).call(this), i(this, n, _).call(this, { type: "channels-power-consumption-detector-faulty", severity: "critical" });
|
|
1008
1146
|
break;
|
|
1009
1147
|
case "4b":
|
|
1010
|
-
|
|
1148
|
+
e.name = "Elevator does not find channel or tray", e.description = "Elevator does not find channel or tray", e.no_code = 29, i(this, n, s).call(this), i(this, n, d).call(this, { type: "elevator-not-find-channel-tray" });
|
|
1011
1149
|
break;
|
|
1012
1150
|
case "4c":
|
|
1013
|
-
|
|
1151
|
+
e.name = "Elevator does not find delivery product position", e.description = "Elevator does not find delivery product position", e.no_code = 30, i(this, n, s).call(this), i(this, n, _).call(this, { type: "elevator-not-find-delivery-position" });
|
|
1014
1152
|
break;
|
|
1015
1153
|
case "4d":
|
|
1016
|
-
|
|
1154
|
+
e.name = "Interior of elevator blocked", e.description = "Interior of elevator blocked", e.no_code = 31, i(this, n, b).call(this), this.__internal__.dispense.elevator.need_reset || (this.__internal__.dispense.elevator.need_reset = !0), i(this, n, _).call(this, { type: "interior-elevator-blocked", severity: "low" });
|
|
1017
1155
|
break;
|
|
1018
1156
|
case "4e":
|
|
1019
|
-
|
|
1157
|
+
e.name = "Error in tester of product detector", e.description = "Error in tester of product detector", e.no_code = 32, i(this, n, s).call(this), i(this, n, _).call(this, { type: "error-tester-product-detector" });
|
|
1020
1158
|
break;
|
|
1021
1159
|
case "4f":
|
|
1022
|
-
|
|
1160
|
+
e.name = "Waiting for product to be removed", e.description = "Waiting for product to be removed", e.no_code = 33, i(this, n, b).call(this);
|
|
1023
1161
|
break;
|
|
1024
1162
|
case "50":
|
|
1025
|
-
|
|
1163
|
+
e.name = "Product expired by temperature reasons", e.description = "Product expired by temperature reasons", e.no_code = 34, i(this, n, u).call(this), i(this, n, d).call(this, { type: "product-expired-temperature" });
|
|
1026
1164
|
break;
|
|
1027
1165
|
case "51":
|
|
1028
|
-
|
|
1166
|
+
e.name = "Automatic door faulty", e.description = "Automatic door faulty", e.no_code = 35, i(this, n, u).call(this), i(this, n, d).call(this, { type: "automatic-door-faulty" });
|
|
1029
1167
|
break;
|
|
1030
1168
|
case "59":
|
|
1031
1169
|
case "5a":
|
|
1032
1170
|
case "61":
|
|
1033
1171
|
case "62":
|
|
1034
1172
|
case "63":
|
|
1035
|
-
switch (
|
|
1173
|
+
switch (e.name = "Product is expired", e.description = "Product is expired", e.additional = { nsf_alarm: 1 }, t[1]) {
|
|
1036
1174
|
case "5a":
|
|
1037
|
-
|
|
1175
|
+
e.additional.nsf_alarm = 2;
|
|
1038
1176
|
break;
|
|
1039
1177
|
case "61":
|
|
1040
|
-
|
|
1178
|
+
e.additional.nsf_alarm = 3;
|
|
1041
1179
|
break;
|
|
1042
1180
|
case "62":
|
|
1043
|
-
|
|
1181
|
+
e.additional.nsf_alarm = 4;
|
|
1044
1182
|
break;
|
|
1045
1183
|
case "63":
|
|
1046
|
-
|
|
1184
|
+
e.additional.nsf_alarm = 5;
|
|
1047
1185
|
break;
|
|
1048
1186
|
}
|
|
1049
|
-
|
|
1187
|
+
e.no_code = 36, i(this, n, u).call(this), i(this, n, d).call(this, { type: "product-expired" });
|
|
1050
1188
|
break;
|
|
1051
1189
|
case "64":
|
|
1052
|
-
|
|
1190
|
+
e.name = "Product detector didn't change during its verification test", e.description = "Product detector didn't change during its verification test", e.no_code = 37, i(this, n, u).call(this), i(this, n, d).call(this, { type: "automatic-door-faulty" });
|
|
1053
1191
|
break;
|
|
1054
1192
|
}
|
|
1055
|
-
this.dispatch("machine:status",
|
|
1193
|
+
this.dispatch("machine:status", e);
|
|
1056
1194
|
} else
|
|
1057
|
-
|
|
1058
|
-
return
|
|
1059
|
-
},
|
|
1060
|
-
if (e = parseInt(e) + 109, e = e.toString(), e.length !== 3)
|
|
1061
|
-
throw new Error("Invalid selection");
|
|
1062
|
-
const t = (parseInt(e.substring(0, 2)) + 128).toString(16).padStart(2, "0");
|
|
1063
|
-
return { channel: (parseInt(e.substring(2, 3)) + 128).toString(16).padStart(2, "0"), tray: t };
|
|
1064
|
-
}, pt = function() {
|
|
1195
|
+
e.name = "executed", e.description = "The last command was executed successfully", e.no_code = 8, !t[1] && this.__internal__.dispense.dispensing && i(this, n, s).call(this);
|
|
1196
|
+
return e;
|
|
1197
|
+
}, ce = function() {
|
|
1065
1198
|
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;
|
|
1066
|
-
},
|
|
1199
|
+
}, he = function() {
|
|
1067
1200
|
this.__internal__.dispense.timeout && clearTimeout(this.__internal__.dispense.timeout), this.__internal__.dispense.interval && clearInterval(this.__internal__.dispense.interval);
|
|
1068
|
-
const
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1201
|
+
const t = this;
|
|
1202
|
+
t.__internal__.dispense.timeout = setTimeout(() => {
|
|
1203
|
+
t.__internal__.dispense.interval = setInterval(() => {
|
|
1204
|
+
t.status().then(() => {
|
|
1072
1205
|
});
|
|
1073
|
-
},
|
|
1074
|
-
},
|
|
1075
|
-
},
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1206
|
+
}, t.__internal__.dispense.interval_time);
|
|
1207
|
+
}, t.__internal__.dispense.timeout_time);
|
|
1208
|
+
}, C = async function(t) {
|
|
1209
|
+
return await this.appendToQueue(
|
|
1210
|
+
a.reset({
|
|
1211
|
+
machineChannel: this.listenOnChannel,
|
|
1212
|
+
type: t
|
|
1213
|
+
}),
|
|
1214
|
+
"reset"
|
|
1215
|
+
);
|
|
1216
|
+
}, E = function() {
|
|
1217
|
+
const t = this.__device.type === "iceplus" ? Q(40) : Q(25), e = /* @__PURE__ */ new Date(), r = 1e3 * t + e.getTime(), o = new Date(r);
|
|
1080
1218
|
this.dispatch("reset:errors", {
|
|
1081
1219
|
description: "Resetting machine errors",
|
|
1082
|
-
duration:
|
|
1083
|
-
started_at:
|
|
1084
|
-
finished_at:
|
|
1220
|
+
duration: t,
|
|
1221
|
+
started_at: e,
|
|
1222
|
+
finished_at: o
|
|
1085
1223
|
});
|
|
1086
|
-
},
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
const t = [];
|
|
1095
|
-
for (let r = 0; r < 32; r++)
|
|
1096
|
-
t.push(e.charCodeAt(r).toString(16));
|
|
1097
|
-
return t;
|
|
1098
|
-
}, _t = function(e) {
|
|
1099
|
-
if (!(e instanceof Date)) throw new Error("Invalid date, must be an instance of Date");
|
|
1100
|
-
const t = e.getHours().toString().padStart(2, "0"), r = e.getMinutes().toString().padStart(2, "0"), a = e.getDate().toString().padStart(2, "0"), o = (e.getMonth() + 1).toString().padStart(2, "0"), c = e.getFullYear().toString().substring(2, 4), s = `${t}:${r} ${a}-${o}-${c}`, v = [];
|
|
1101
|
-
for (let y = 0; y < 14; y++)
|
|
1102
|
-
v.push(s.charCodeAt(y).toString(16));
|
|
1103
|
-
return v;
|
|
1224
|
+
}, D = async function(t) {
|
|
1225
|
+
return await this.appendToQueue(
|
|
1226
|
+
a.lights({
|
|
1227
|
+
machineChannel: this.listenOnChannel,
|
|
1228
|
+
type: t
|
|
1229
|
+
}),
|
|
1230
|
+
"lights"
|
|
1231
|
+
);
|
|
1104
1232
|
};
|
|
1105
1233
|
export {
|
|
1106
|
-
|
|
1234
|
+
ve as Jofemar
|
|
1107
1235
|
};
|