barkoder-nativescript 1.2.9 → 1.3.1
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/barkoder-nativescript.android.ts +1092 -813
- package/barkoder-nativescript.ios.ts +1140 -818
- package/package.json +1 -1
- package/platforms/android/barkoder.aar +0 -0
- package/platforms/ios/Barkoder.xcframework/ios-arm64/Barkoder.framework/Barkoder +0 -0
- package/platforms/ios/Barkoder.xcframework/ios-arm64/Barkoder.framework/Headers/iBarkoder.h +1 -0
- package/platforms/ios/Barkoder.xcframework/ios-arm64_x86_64-simulator/Barkoder.framework/Barkoder +0 -0
- package/platforms/ios/Barkoder.xcframework/ios-arm64_x86_64-simulator/Barkoder.framework/Headers/iBarkoder.h +1 -0
- package/platforms/ios/Barkoder.xcframework/ios-arm64_x86_64-simulator/Barkoder.framework/_CodeSignature/CodeResources +2 -2
- package/platforms/ios/BarkoderSDK.xcframework/Info.plist +5 -5
- package/platforms/ios/BarkoderSDK.xcframework/ios-arm64/BarkoderSDK.framework/BarkoderSDK +0 -0
- package/platforms/ios/BarkoderSDK.xcframework/ios-arm64/BarkoderSDK.framework/Headers/BarkoderSDK-Swift.h +46 -28
- package/platforms/ios/BarkoderSDK.xcframework/ios-arm64/BarkoderSDK.framework/Info.plist +0 -0
- package/platforms/ios/BarkoderSDK.xcframework/ios-arm64/BarkoderSDK.framework/Modules/BarkoderSDK.swiftmodule/arm64-apple-ios.abi.json +111 -44
- package/platforms/ios/BarkoderSDK.xcframework/ios-arm64/BarkoderSDK.framework/Modules/BarkoderSDK.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
- package/platforms/ios/BarkoderSDK.xcframework/ios-arm64_x86_64-simulator/BarkoderSDK.framework/BarkoderSDK +0 -0
- package/platforms/ios/BarkoderSDK.xcframework/ios-arm64_x86_64-simulator/BarkoderSDK.framework/Headers/BarkoderSDK-Swift.h +92 -56
- package/platforms/ios/BarkoderSDK.xcframework/ios-arm64_x86_64-simulator/BarkoderSDK.framework/Info.plist +0 -0
- package/platforms/ios/BarkoderSDK.xcframework/ios-arm64_x86_64-simulator/BarkoderSDK.framework/Modules/BarkoderSDK.swiftmodule/arm64-apple-ios-simulator.abi.json +111 -44
- package/platforms/ios/BarkoderSDK.xcframework/ios-arm64_x86_64-simulator/BarkoderSDK.framework/Modules/BarkoderSDK.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
- package/platforms/ios/BarkoderSDK.xcframework/ios-arm64_x86_64-simulator/BarkoderSDK.framework/Modules/BarkoderSDK.swiftmodule/x86_64-apple-ios-simulator.abi.json +111 -44
- package/platforms/ios/BarkoderSDK.xcframework/ios-arm64_x86_64-simulator/BarkoderSDK.framework/Modules/BarkoderSDK.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
- package/platforms/ios/BarkoderSDK.xcframework/ios-arm64_x86_64-simulator/BarkoderSDK.framework/_CodeSignature/CodeResources +22 -22
- package/README.md +0 -115
|
@@ -1,828 +1,1150 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { View} from
|
|
3
|
-
import { ios } from
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
1
|
+
import { BarkoderConstants } from "./barkoder-nativescript.common";
|
|
2
|
+
import { View } from "@nativescript/core";
|
|
3
|
+
import { ios } from "@nativescript/core/application";
|
|
4
|
+
|
|
5
|
+
export class BarkoderViewIOS extends View {
|
|
6
|
+
public bkdView: BarkoderView;
|
|
7
|
+
public licenseKeyProperty: any;
|
|
8
|
+
private _licenseKey: string;
|
|
9
|
+
|
|
10
|
+
constructor() {
|
|
11
|
+
super();
|
|
12
|
+
this.bkdView = BarkoderView.new();
|
|
13
|
+
this.nativeView = this.bkdView;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Initiates the barcode scanning process, allowing the application to detect and decode barcodes from the device's camera feed
|
|
18
|
+
*/
|
|
19
|
+
startScanning(callback: BarkoderConstants.BarkoderResultCallback): void {
|
|
20
|
+
const resultDelegate = new BarkoderViewWraper(callback);
|
|
21
|
+
ios.delegate = resultDelegate;
|
|
22
|
+
this.bkdView.startScanningError(resultDelegate);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Halts the barcode scanning process, stopping the camera from capturing and processing barcode information
|
|
27
|
+
*/
|
|
28
|
+
stopScanning(): void {
|
|
29
|
+
this.bkdView.stopScanning();
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Halts the barcode scanning process, stopping the camera from capturing and processing barcode information
|
|
34
|
+
*/
|
|
35
|
+
pauseScanning(): void {
|
|
36
|
+
this.bkdView.pauseScanning();
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Checks whether the device has a built-in flash (torch) that can be used for illumination during barcode scanning
|
|
41
|
+
*/
|
|
42
|
+
isFlashAvailable(
|
|
43
|
+
callback: BarkoderConstants.FlashAvailableCallback
|
|
44
|
+
): Promise<boolean> {
|
|
45
|
+
return new Promise((resolve, reject) => {
|
|
46
|
+
this.bkdView.isFlashAvailable((flashAvailable: boolean) => {
|
|
47
|
+
resolve(flashAvailable);
|
|
48
|
+
callback.onFlashAvailable(flashAvailable);
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Enables or disables the device's flash (torch) for illumination during barcode scanning
|
|
55
|
+
*/
|
|
56
|
+
setFlashEnabled(enabled: boolean): void {
|
|
57
|
+
this.bkdView.setFlash(enabled);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Retrieves the maximum available zoom factor for the device's camera
|
|
62
|
+
*/
|
|
63
|
+
getMaxZoomFactor(
|
|
64
|
+
callback: BarkoderConstants.MaxZoomAvailableCallback
|
|
65
|
+
): Promise<number> {
|
|
66
|
+
return new Promise((resolve, reject) => {
|
|
67
|
+
this.bkdView.getMaxZoomFactor((maxZoomFactor: number) => {
|
|
68
|
+
resolve(maxZoomFactor);
|
|
69
|
+
callback.onMaxZoomAvailable(maxZoomFactor);
|
|
70
|
+
});
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Sets the zoom factor for the device's camera, adjusting the level of zoom during barcode scanning
|
|
76
|
+
*/
|
|
77
|
+
setZoomFactor(zoomFactor: number): void {
|
|
78
|
+
this.bkdView.setZoomFactor(zoomFactor);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Retrieves the hexadecimal color code representing the line color used to indicate the location of detected barcodes
|
|
83
|
+
*/
|
|
84
|
+
getLocationLineColorHex(): any {
|
|
85
|
+
return this.bkdView.config.locationLineColor;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Sets the color of the lines used to indicate the location of detected barcodes on the camera feed
|
|
90
|
+
*/
|
|
91
|
+
setLocationLineColor(locationLineHexColor: string): void {
|
|
92
|
+
const uiColor = this.hexToUIColor(locationLineHexColor);
|
|
93
|
+
this.bkdView.config.locationLineColor = uiColor;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Sets the color of the lines outlining the Region of Interest (ROI) for barcode scanning on the camera feed
|
|
98
|
+
*/
|
|
99
|
+
setRoiLineColor(roiLineHexColor: string): void {
|
|
100
|
+
const uiColor = this.hexToUIColor(roiLineHexColor);
|
|
101
|
+
this.bkdView.config.roiLineColor = uiColor;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Sets the width of the lines outlining the Region of Interest (ROI) for barcode scanning on the camera feed
|
|
106
|
+
*/
|
|
107
|
+
setRoiLineWidth(roiLineWidth: number): void {
|
|
108
|
+
this.bkdView.config.roiLineWidth = roiLineWidth;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Sets the background color of the overlay within the Region of Interest (ROI) for barcode scanning on the camera feed
|
|
113
|
+
*/
|
|
114
|
+
setRoiOverlayBackgroundColor(roiLineHexColor: string): void {
|
|
115
|
+
const uiColor = this.hexToUIColor(roiLineHexColor);
|
|
116
|
+
this.bkdView.config.roiOverlayBackgroundColor = uiColor;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Enables or disables the automatic closing of the scanning session upon detecting a barcode result
|
|
121
|
+
*/
|
|
122
|
+
setCloseSessionOnResultEnabled(enabled: boolean): void {
|
|
123
|
+
this.bkdView.config.closeSessionOnResultEnabled = enabled;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Enables or disables the capturing and processing of image data when a barcode is successfully detected
|
|
128
|
+
*/
|
|
129
|
+
setImageResultEnabled(enabled: boolean): void {
|
|
130
|
+
this.bkdView.config.imageResultEnabled = enabled;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* Enables or disables the inclusion of barcode location information within the image data result
|
|
135
|
+
*/
|
|
136
|
+
setLocationInImageResultEnabled(enabled: boolean): void {
|
|
137
|
+
this.bkdView.config.locationInImageResultEnabled = enabled;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* Enables or disables the display of barcode location information on the camera preview
|
|
142
|
+
*/
|
|
143
|
+
setLocationInPreviewEnabled(enabled: boolean): void {
|
|
144
|
+
this.bkdView.config.locationInPreviewEnabled = enabled;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* Enables or disables the pinch-to-zoom feature for adjusting the zoom level during barcode scanning
|
|
149
|
+
*/
|
|
150
|
+
setPinchToZoomEnabled(enabled: boolean): void {
|
|
151
|
+
this.bkdView.config.pinchToZoomEnabled = enabled;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* Sets the visibility of the Region of Interest (ROI) on the camera preview
|
|
156
|
+
*/
|
|
157
|
+
setRegionOfInterestVisible(enabled: boolean): void {
|
|
158
|
+
this.bkdView.config.regionOfInterestVisible = enabled;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* Defines the Region of Interest (ROI) on the camera preview for barcode scanning, specifying an area where the application focuses on detecting barcodes
|
|
163
|
+
*/
|
|
164
|
+
setRegionOfInterest(
|
|
165
|
+
left: number,
|
|
166
|
+
top: number,
|
|
167
|
+
width: number,
|
|
168
|
+
height: number
|
|
169
|
+
): void {
|
|
170
|
+
const rect = {
|
|
171
|
+
origin: { x: left, y: top },
|
|
172
|
+
size: { width: width, height: height },
|
|
173
|
+
};
|
|
174
|
+
|
|
175
|
+
this.bkdView.config.setRegionOfInterestError(rect);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* Enables or disables the audible beep sound upon successfully decoding a barcode
|
|
180
|
+
*/
|
|
181
|
+
setBeepOnSuccessEnabled(enabled: boolean): void {
|
|
182
|
+
this.bkdView.config.beepOnSuccessEnabled = enabled;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* Enables or disables the device vibration upon successfully decoding a barcode.
|
|
187
|
+
*/
|
|
188
|
+
setVibrateOnSuccessEnabled(enabled: boolean): void {
|
|
189
|
+
this.bkdView.config.vibrateOnSuccessEnabled = enabled;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* Retrieves the character set used for encoding barcode data
|
|
194
|
+
*/
|
|
195
|
+
getEncodingCharacterSet(): any {
|
|
196
|
+
return this.bkdView.config.decoderConfig.encodingCharacterSet;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* Retrieves the current decoding speed setting for barcode scanning
|
|
201
|
+
*/
|
|
202
|
+
getDecodingSpeed(): any {
|
|
203
|
+
return this.bkdView.config.decoderConfig.decodingSpeed;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* Retrieves the formatting type used for presenting decoded barcode data.
|
|
208
|
+
*/
|
|
209
|
+
getFormattingType(): any {
|
|
210
|
+
return this.bkdView.config.decoderConfig.formatting;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
/**
|
|
214
|
+
* Sets the width of the lines indicating the location of detected barcodes on the camera feed
|
|
215
|
+
*/
|
|
216
|
+
setLocationLineWidth(width: number): void {
|
|
217
|
+
this.bkdView.config.locationLineWidth = width;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
* Retrieves the current width setting for the lines indicating the location of detected barcodes on the camera feed
|
|
222
|
+
*/
|
|
223
|
+
getLocationLineWidth(): any {
|
|
224
|
+
return this.bkdView.config.locationLineWidth;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
/**
|
|
228
|
+
* Retrieves the hexadecimal color code representing the line color of the Region of Interest (ROI) on the camera preview
|
|
229
|
+
*/
|
|
230
|
+
getRoiLineColorHex(): any {
|
|
231
|
+
return this.bkdView.config.roiLineColor;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
/**
|
|
235
|
+
* Retrieves the current width setting for the lines outlining the Region of Interest (ROI) on the camera preview
|
|
236
|
+
*/
|
|
237
|
+
getRoiLineWidth(): any {
|
|
238
|
+
return this.bkdView.config.roiLineWidth;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
/**
|
|
242
|
+
* Retrieves the hexadecimal color code representing the background color of the overlay within the Region of Interest (ROI) on the camera preview
|
|
243
|
+
*/
|
|
244
|
+
getRoiOverlayBackgroundColorHex(): any {
|
|
245
|
+
return this.bkdView.config.roiOverlayBackgroundColor;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
/**
|
|
249
|
+
* Enables or disables the automatic closing of the scanning session upon detecting a barcode result
|
|
250
|
+
*/
|
|
251
|
+
isCloseSessionOnResultEnabled(): any {
|
|
252
|
+
return this.bkdView.config.closeSessionOnResultEnabled;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
/**
|
|
256
|
+
* Enables or disables the capturing and processing of image data when a barcode is successfully detected
|
|
257
|
+
*/
|
|
258
|
+
isImageResultEnabled(): any {
|
|
259
|
+
return this.bkdView.config.imageResultEnabled;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
/**
|
|
263
|
+
* Enables or disables the inclusion of barcode location information within the image data result
|
|
264
|
+
*/
|
|
265
|
+
isLocationInImageResultEnabled(): any {
|
|
266
|
+
return this.bkdView.config.locationInImageResultEnabled;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
/**
|
|
270
|
+
* Retrieves the region of interest (ROI)
|
|
271
|
+
*/
|
|
272
|
+
getRegionOfInterest(): any {
|
|
273
|
+
return this.bkdView.config.getRegionOfInterest;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
/**
|
|
277
|
+
* Retrieves the threads limit
|
|
278
|
+
*/
|
|
279
|
+
getThreadsLimit(): any {
|
|
280
|
+
return this.bkdView.config.getThreadsLimit();
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
/**
|
|
284
|
+
* Sets the threads limit
|
|
285
|
+
*/
|
|
286
|
+
setThreadsLimit(threadsLimit: number): void {
|
|
287
|
+
this.bkdView.config.setThreadsLimitError(threadsLimit);
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
/**
|
|
291
|
+
* Checks if location in preview is enabled
|
|
292
|
+
*/
|
|
293
|
+
isLocationInPreviewEnabled(): any {
|
|
294
|
+
return this.bkdView.config.locationInPreviewEnabled;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
/**
|
|
298
|
+
* Checks if pinch to zoom is enabled
|
|
299
|
+
*/
|
|
300
|
+
isPinchToZoomEnabled(): any {
|
|
301
|
+
return this.bkdView.config.pinchToZoomEnabled;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
/**
|
|
305
|
+
* Checks if the region of interest (ROI) is visible
|
|
306
|
+
*/
|
|
307
|
+
isRegionOfInterestVisible(): any {
|
|
308
|
+
return this.bkdView.config.regionOfInterestVisible;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
/**
|
|
312
|
+
* Retrieves the value indicating whether a beep sound is played on successful barcode scanning
|
|
313
|
+
*/
|
|
314
|
+
isBeepOnSuccessEnabled(): any {
|
|
315
|
+
return this.bkdView.config.beepOnSuccessEnabled;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
/**
|
|
319
|
+
* Retrieves the value indicating whether vibration is enabled on successful barcode scanning
|
|
320
|
+
*/
|
|
321
|
+
isVibrateOnSuccessEnabled(): any {
|
|
322
|
+
return this.bkdView.config.vibrateOnSuccessEnabled;
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
/**
|
|
326
|
+
* Retrieves the version of the Barkoder library
|
|
327
|
+
*/
|
|
328
|
+
getVersion(): any {
|
|
329
|
+
return iBarkoder.GetVersion();
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
/**
|
|
333
|
+
* Retrieves the MSI checksum type
|
|
334
|
+
*/
|
|
335
|
+
getMsiCheckSumType(): any {
|
|
336
|
+
return this.bkdView.config.decoderConfig.msi.checksum;
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
/**
|
|
340
|
+
* Retrieves the checksum type for Code 39 barcodes
|
|
341
|
+
*/
|
|
342
|
+
getCode39CheckSumType(): any {
|
|
343
|
+
return this.bkdView.config.decoderConfig.code39.checksum;
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
/**
|
|
347
|
+
* Retrieves the Code11 checksum type
|
|
348
|
+
*/
|
|
349
|
+
getCode11CheckSumType(): any {
|
|
350
|
+
return this.bkdView.config.decoderConfig.code11.checksum;
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
/**
|
|
354
|
+
* Sets the resolution for barcode scanning
|
|
355
|
+
*/
|
|
356
|
+
setBarkoderResolution(
|
|
357
|
+
barkoderResolution: BarkoderConstants.BarkoderResolution
|
|
358
|
+
): void {
|
|
359
|
+
if (barkoderResolution === BarkoderConstants.BarkoderResolution.NORMAL) {
|
|
360
|
+
this.bkdView.config.barkoderResolution = 0;
|
|
361
|
+
} else if (
|
|
362
|
+
barkoderResolution === BarkoderConstants.BarkoderResolution.HIGH
|
|
363
|
+
) {
|
|
364
|
+
this.bkdView.config.barkoderResolution = 1;
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
/**
|
|
369
|
+
* Retrieves the resolution for barcode scanning
|
|
370
|
+
*/
|
|
371
|
+
getBarkoderResolution(): any {
|
|
372
|
+
return this.bkdView.config.barkoderResolution;
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
/**
|
|
376
|
+
* Sets the encoding character set for barcode scanning
|
|
377
|
+
*/
|
|
378
|
+
setEncodingCharacterSet(encodingCharacterSet: any): void {
|
|
379
|
+
this.bkdView.config.encodingCharacterSet = encodingCharacterSet;
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
/**
|
|
383
|
+
* Sets the decoding speed for barcode scanning
|
|
384
|
+
*/
|
|
385
|
+
setDecodingSpeed(decodingSpeed: BarkoderConstants.DecodingSpeed): void {
|
|
386
|
+
if (decodingSpeed == BarkoderConstants.DecodingSpeed.Fast) {
|
|
387
|
+
this.bkdView.config.decoderConfig.decodingSpeed = 0;
|
|
388
|
+
} else if (decodingSpeed == BarkoderConstants.DecodingSpeed.Normal) {
|
|
389
|
+
this.bkdView.config.decoderConfig.decodingSpeed = 1;
|
|
390
|
+
} else if (decodingSpeed == BarkoderConstants.DecodingSpeed.Slow) {
|
|
391
|
+
this.bkdView.config.decoderConfig.decodingSpeed = 2;
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
/**
|
|
396
|
+
* Sets the formatting type for barcode scanning
|
|
397
|
+
*/
|
|
398
|
+
setFormattingType(formattingType: BarkoderConstants.FormattingType): void {
|
|
399
|
+
switch (formattingType) {
|
|
400
|
+
case BarkoderConstants.FormattingType.Disabled:
|
|
401
|
+
this.bkdView.config.decoderConfig.formatting = 0;
|
|
402
|
+
break;
|
|
403
|
+
case BarkoderConstants.FormattingType.Automatic:
|
|
404
|
+
this.bkdView.config.decoderConfig.formatting = 1;
|
|
405
|
+
break;
|
|
406
|
+
case BarkoderConstants.FormattingType.GS1:
|
|
407
|
+
this.bkdView.config.decoderConfig.formatting = 2;
|
|
408
|
+
break;
|
|
409
|
+
case BarkoderConstants.FormattingType.AAMVA:
|
|
410
|
+
this.bkdView.config.decoderConfig.formatting = 3;
|
|
411
|
+
break;
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
/**
|
|
416
|
+
* Sets the MSI checksum type
|
|
417
|
+
*/
|
|
418
|
+
setMsiCheckSumType(msiCheckSumType: BarkoderConstants.MsiChecksumType) {
|
|
419
|
+
switch (msiCheckSumType) {
|
|
420
|
+
case BarkoderConstants.MsiChecksumType.Disabled:
|
|
421
|
+
this.bkdView.config.decoderConfig.msi.checksum = 0;
|
|
422
|
+
break;
|
|
423
|
+
case BarkoderConstants.MsiChecksumType.Mod10:
|
|
424
|
+
this.bkdView.config.decoderConfig.msi.checksum = 1;
|
|
425
|
+
break;
|
|
426
|
+
case BarkoderConstants.MsiChecksumType.Mod11:
|
|
427
|
+
this.bkdView.config.decoderConfig.msi.checksum = 2;
|
|
428
|
+
break;
|
|
429
|
+
case BarkoderConstants.MsiChecksumType.Mod1010:
|
|
430
|
+
this.bkdView.config.decoderConfig.msi.checksum = 3;
|
|
431
|
+
break;
|
|
432
|
+
case BarkoderConstants.MsiChecksumType.Mod1110:
|
|
433
|
+
this.bkdView.config.decoderConfig.msi.checksum = 4;
|
|
434
|
+
break;
|
|
435
|
+
case BarkoderConstants.MsiChecksumType.Mod11IBM:
|
|
436
|
+
this.bkdView.config.decoderConfig.msi.checksum = 5;
|
|
437
|
+
break;
|
|
438
|
+
case BarkoderConstants.MsiChecksumType.Mod1110IBM:
|
|
439
|
+
this.bkdView.config.decoderConfig.msi.checksum = 6;
|
|
440
|
+
break;
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
/**
|
|
445
|
+
* Sets the Code39 checksum type
|
|
446
|
+
*/
|
|
447
|
+
setCode39CheckSumType(
|
|
448
|
+
standardCheckSumType: BarkoderConstants.Code39ChecksumType
|
|
449
|
+
) {
|
|
450
|
+
switch (standardCheckSumType) {
|
|
451
|
+
case BarkoderConstants.Code39ChecksumType.Disabled:
|
|
452
|
+
this.bkdView.config.decoderConfig.code39.checksum = 0;
|
|
453
|
+
break;
|
|
454
|
+
case BarkoderConstants.Code39ChecksumType.Enabled:
|
|
455
|
+
this.bkdView.config.decoderConfig.code39.checksum = 1;
|
|
456
|
+
break;
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
/**
|
|
461
|
+
* Sets the Code11 checksum type
|
|
462
|
+
*/
|
|
463
|
+
setCode11CheckSumType(
|
|
464
|
+
code11CheckSumType: BarkoderConstants.Code11ChecksumType
|
|
465
|
+
) {
|
|
466
|
+
switch (code11CheckSumType) {
|
|
467
|
+
case BarkoderConstants.Code11ChecksumType.Disabled:
|
|
468
|
+
this.bkdView.config.decoderConfig.code11.checksum = 0;
|
|
469
|
+
break;
|
|
470
|
+
case BarkoderConstants.Code11ChecksumType.Single:
|
|
471
|
+
this.bkdView.config.decoderConfig.code11.checksum = 1;
|
|
472
|
+
break;
|
|
473
|
+
case BarkoderConstants.Code11ChecksumType.Double:
|
|
474
|
+
this.bkdView.config.decoderConfig.code11.checksum = 2;
|
|
475
|
+
break;
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
/**
|
|
480
|
+
* Checks if a specific barcode type is enabled
|
|
481
|
+
*/
|
|
482
|
+
isBarcodeTypeEnabled(decoder: BarkoderConstants.DecoderType): any {
|
|
483
|
+
switch (decoder) {
|
|
484
|
+
case BarkoderConstants.DecoderType.Aztec:
|
|
485
|
+
return this.bkdView.config.decoderConfig.aztec.enabled;
|
|
486
|
+
case BarkoderConstants.DecoderType.AztecCompact:
|
|
487
|
+
return this.bkdView.config.decoderConfig.aztecCompact.enabled;
|
|
488
|
+
case BarkoderConstants.DecoderType.QR:
|
|
489
|
+
return this.bkdView.config.decoderConfig.qr.enabled;
|
|
490
|
+
case BarkoderConstants.DecoderType.QRMicro:
|
|
491
|
+
return this.bkdView.config.decoderConfig.qrMicro.enabled;
|
|
492
|
+
case BarkoderConstants.DecoderType.Code128:
|
|
493
|
+
return this.bkdView.config.decoderConfig.code128.enabled;
|
|
494
|
+
case BarkoderConstants.DecoderType.Code93:
|
|
495
|
+
return this.bkdView.config.decoderConfig.code93.enabled;
|
|
496
|
+
case BarkoderConstants.DecoderType.Code39:
|
|
497
|
+
return this.bkdView.config.decoderConfig.code39.enabled;
|
|
498
|
+
case BarkoderConstants.DecoderType.Telepen:
|
|
499
|
+
return this.bkdView.config.decoderConfig.telepen.enabled;
|
|
500
|
+
case BarkoderConstants.DecoderType.Code11:
|
|
501
|
+
return this.bkdView.config.decoderConfig.code11.enabled;
|
|
502
|
+
case BarkoderConstants.DecoderType.Msi:
|
|
503
|
+
return this.bkdView.config.decoderConfig.msi.enabled;
|
|
504
|
+
case BarkoderConstants.DecoderType.UpcA:
|
|
505
|
+
return this.bkdView.config.decoderConfig.upcA.enabled;
|
|
506
|
+
case BarkoderConstants.DecoderType.UpcE:
|
|
507
|
+
return this.bkdView.config.decoderConfig.upcE.enabled;
|
|
508
|
+
case BarkoderConstants.DecoderType.UpcE1:
|
|
509
|
+
return this.bkdView.config.decoderConfig.upcE1.enabled;
|
|
510
|
+
case BarkoderConstants.DecoderType.Ean13:
|
|
511
|
+
return this.bkdView.config.decoderConfig.ean13.enabled;
|
|
512
|
+
case BarkoderConstants.DecoderType.Ean8:
|
|
513
|
+
return this.bkdView.config.decoderConfig.ean8.enabled;
|
|
514
|
+
case BarkoderConstants.DecoderType.PDF417:
|
|
515
|
+
return this.bkdView.config.decoderConfig.PDF417.enabled;
|
|
516
|
+
case BarkoderConstants.DecoderType.PDF417Micro:
|
|
517
|
+
return this.bkdView.config.decoderConfig.PDF417Micro.enabled;
|
|
518
|
+
case BarkoderConstants.DecoderType.Datamatrix:
|
|
519
|
+
return this.bkdView.config.decoderConfig.datamatrix.enabled;
|
|
520
|
+
case BarkoderConstants.DecoderType.Code25:
|
|
521
|
+
return this.bkdView.config.decoderConfig.code25.enabled;
|
|
522
|
+
case BarkoderConstants.DecoderType.Interleaved25:
|
|
523
|
+
return this.bkdView.config.decoderConfig.interleaved25.enabled;
|
|
524
|
+
case BarkoderConstants.DecoderType.ITF14:
|
|
525
|
+
return this.bkdView.config.decoderConfig.itf14.enabled;
|
|
526
|
+
case BarkoderConstants.DecoderType.IATA25:
|
|
527
|
+
return this.bkdView.config.decoderConfig.iata25.enabled;
|
|
528
|
+
case BarkoderConstants.DecoderType.Matrix25:
|
|
529
|
+
return this.bkdView.config.decoderConfig.matrix25.enabled;
|
|
530
|
+
case BarkoderConstants.DecoderType.Datalogic25:
|
|
531
|
+
return this.bkdView.config.decoderConfig.datalogic25.enabled;
|
|
532
|
+
case BarkoderConstants.DecoderType.COOP25:
|
|
533
|
+
return this.bkdView.config.decoderConfig.coop25.enabled;
|
|
534
|
+
case BarkoderConstants.DecoderType.Dotcode:
|
|
535
|
+
return this.bkdView.config.decoderConfig.dotcode.enabled;
|
|
536
|
+
}
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
/**
|
|
540
|
+
* Sets whether a specific barcode type is enabled
|
|
541
|
+
*/
|
|
542
|
+
setBarcodeTypeEnabled(decoders: BarkoderConstants.DecoderType[]): void {
|
|
543
|
+
this.bkdView.config.decoderConfig.aztec.enabled = false;
|
|
544
|
+
this.bkdView.config.decoderConfig.aztecCompact.enabled = false;
|
|
545
|
+
this.bkdView.config.decoderConfig.qr.enabled = false;
|
|
546
|
+
this.bkdView.config.decoderConfig.qrMicro.enabled = false;
|
|
547
|
+
this.bkdView.config.decoderConfig.code128.enabled = false;
|
|
548
|
+
this.bkdView.config.decoderConfig.code93.enabled = false;
|
|
549
|
+
this.bkdView.config.decoderConfig.code39.enabled = false;
|
|
550
|
+
this.bkdView.config.decoderConfig.telepen.enabled = false;
|
|
551
|
+
this.bkdView.config.decoderConfig.code11.enabled = false;
|
|
552
|
+
this.bkdView.config.decoderConfig.codabar.enabled = false;
|
|
553
|
+
this.bkdView.config.decoderConfig.msi.enabled = false;
|
|
554
|
+
this.bkdView.config.decoderConfig.upcA.enabled = false;
|
|
555
|
+
this.bkdView.config.decoderConfig.upcE.enabled = false;
|
|
556
|
+
this.bkdView.config.decoderConfig.upcE1.enabled = false;
|
|
557
|
+
this.bkdView.config.decoderConfig.ean13.enabled = true;
|
|
558
|
+
this.bkdView.config.decoderConfig.ean8.enabled = false;
|
|
559
|
+
this.bkdView.config.decoderConfig.PDF417.enabled = false;
|
|
560
|
+
this.bkdView.config.decoderConfig.PDF417Micro.enabled = false;
|
|
561
|
+
this.bkdView.config.decoderConfig.datamatrix.enabled = false;
|
|
562
|
+
this.bkdView.config.decoderConfig.code25.enabled = false;
|
|
563
|
+
this.bkdView.config.decoderConfig.interleaved25.enabled = false;
|
|
564
|
+
this.bkdView.config.decoderConfig.itf14.enabled = false;
|
|
565
|
+
this.bkdView.config.decoderConfig.iata25.enabled = false;
|
|
566
|
+
this.bkdView.config.decoderConfig.matrix25.enabled = false;
|
|
567
|
+
this.bkdView.config.decoderConfig.datalogic25.enabled = false;
|
|
568
|
+
this.bkdView.config.decoderConfig.coop25.enabled = false;
|
|
569
|
+
this.bkdView.config.decoderConfig.dotcode.enabled = false;
|
|
570
|
+
this.bkdView.config.decoderConfig.code32.enabled = false;
|
|
571
|
+
decoders.forEach((dt: BarkoderConstants.DecoderType) => {
|
|
572
|
+
switch (dt) {
|
|
573
|
+
case BarkoderConstants.DecoderType.Aztec:
|
|
574
|
+
this.bkdView.config.decoderConfig.aztec.enabled = true;
|
|
575
|
+
break;
|
|
576
|
+
case BarkoderConstants.DecoderType.AztecCompact:
|
|
577
|
+
this.bkdView.config.decoderConfig.aztecCompact.enabled = true;
|
|
578
|
+
break;
|
|
579
|
+
case BarkoderConstants.DecoderType.QR:
|
|
580
|
+
this.bkdView.config.decoderConfig.qr.enabled = true;
|
|
581
|
+
break;
|
|
582
|
+
case BarkoderConstants.DecoderType.QRMicro:
|
|
583
|
+
this.bkdView.config.decoderConfig.qrMicro.enabled = true;
|
|
584
|
+
break;
|
|
585
|
+
case BarkoderConstants.DecoderType.Code128:
|
|
586
|
+
this.bkdView.config.decoderConfig.code128.enabled = true;
|
|
587
|
+
break;
|
|
588
|
+
case BarkoderConstants.DecoderType.Code93:
|
|
589
|
+
this.bkdView.config.decoderConfig.code93.enabled = true;
|
|
590
|
+
break;
|
|
591
|
+
case BarkoderConstants.DecoderType.Code39:
|
|
592
|
+
this.bkdView.config.decoderConfig.code39.enabled = true;
|
|
593
|
+
break;
|
|
594
|
+
case BarkoderConstants.DecoderType.Telepen:
|
|
595
|
+
this.bkdView.config.decoderConfig.telepen.enabled = true;
|
|
596
|
+
break;
|
|
597
|
+
case BarkoderConstants.DecoderType.Code11:
|
|
598
|
+
this.bkdView.config.decoderConfig.code11.enabled = true;
|
|
599
|
+
break;
|
|
600
|
+
case BarkoderConstants.DecoderType.Msi:
|
|
601
|
+
this.bkdView.config.decoderConfig.msi.enabled = true;
|
|
602
|
+
break;
|
|
603
|
+
case BarkoderConstants.DecoderType.UpcA:
|
|
604
|
+
this.bkdView.config.decoderConfig.upcA.enabled = true;
|
|
605
|
+
break;
|
|
606
|
+
case BarkoderConstants.DecoderType.UpcE:
|
|
607
|
+
this.bkdView.config.decoderConfig.upcE.enabled = true;
|
|
608
|
+
break;
|
|
609
|
+
case BarkoderConstants.DecoderType.UpcE1:
|
|
610
|
+
this.bkdView.config.decoderConfig.upcE1.enabled = true;
|
|
611
|
+
break;
|
|
612
|
+
case BarkoderConstants.DecoderType.Ean13:
|
|
613
|
+
this.bkdView.config.decoderConfig.ean13.enabled = true;
|
|
614
|
+
break;
|
|
615
|
+
case BarkoderConstants.DecoderType.Ean8:
|
|
616
|
+
this.bkdView.config.decoderConfig.ean8.enabled = true;
|
|
617
|
+
break;
|
|
618
|
+
case BarkoderConstants.DecoderType.PDF417:
|
|
619
|
+
this.bkdView.config.decoderConfig.PDF417.enabled = true;
|
|
620
|
+
break;
|
|
621
|
+
case BarkoderConstants.DecoderType.PDF417Micro:
|
|
622
|
+
this.bkdView.config.decoderConfig.PDF417Micro.enabled = true;
|
|
623
|
+
break;
|
|
624
|
+
case BarkoderConstants.DecoderType.Datamatrix:
|
|
625
|
+
this.bkdView.config.decoderConfig.datamatrix.enabled = true;
|
|
626
|
+
break;
|
|
627
|
+
case BarkoderConstants.DecoderType.Code25:
|
|
628
|
+
this.bkdView.config.decoderConfig.code25.enabled = true;
|
|
629
|
+
break;
|
|
630
|
+
case BarkoderConstants.DecoderType.Interleaved25:
|
|
631
|
+
this.bkdView.config.decoderConfig.interleaved25.enabled = true;
|
|
632
|
+
break;
|
|
633
|
+
case BarkoderConstants.DecoderType.ITF14:
|
|
634
|
+
this.bkdView.config.decoderConfig.itf14.enabled = true;
|
|
635
|
+
break;
|
|
636
|
+
case BarkoderConstants.DecoderType.IATA25:
|
|
637
|
+
this.bkdView.config.decoderConfig.iata25.enabled = true;
|
|
638
|
+
break;
|
|
639
|
+
case BarkoderConstants.DecoderType.Matrix25:
|
|
640
|
+
this.bkdView.config.decoderConfig.matrix25.enabled = true;
|
|
641
|
+
break;
|
|
642
|
+
case BarkoderConstants.DecoderType.Datalogic25:
|
|
643
|
+
this.bkdView.config.decoderConfig.datalogic25.enabled = true;
|
|
644
|
+
break;
|
|
645
|
+
case BarkoderConstants.DecoderType.COOP25:
|
|
646
|
+
this.bkdView.config.decoderConfig.coop25.enabled = true;
|
|
647
|
+
break;
|
|
648
|
+
case BarkoderConstants.DecoderType.Dotcode:
|
|
649
|
+
this.bkdView.config.decoderConfig.dotcode.enabled = true;
|
|
650
|
+
break;
|
|
651
|
+
default:
|
|
652
|
+
break;
|
|
483
653
|
}
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
654
|
+
});
|
|
655
|
+
}
|
|
656
|
+
|
|
657
|
+
getBarcodeTypeMaximumLenght(decoder: BarkoderConstants.DecoderType): any {
|
|
658
|
+
switch (decoder) {
|
|
659
|
+
case BarkoderConstants.DecoderType.Aztec:
|
|
660
|
+
return this.bkdView.config.decoderConfig.aztec.maximumLength;
|
|
661
|
+
case BarkoderConstants.DecoderType.AztecCompact:
|
|
662
|
+
return this.bkdView.config.decoderConfig.aztecCompact.maximumLength;
|
|
663
|
+
case BarkoderConstants.DecoderType.QR:
|
|
664
|
+
return this.bkdView.config.decoderConfig.qr.maximumLength;
|
|
665
|
+
case BarkoderConstants.DecoderType.QRMicro:
|
|
666
|
+
return this.bkdView.config.decoderConfig.qrMicro.maximumLength;
|
|
667
|
+
case BarkoderConstants.DecoderType.Code128:
|
|
668
|
+
return this.bkdView.config.decoderConfig.code128.maximumLength;
|
|
669
|
+
case BarkoderConstants.DecoderType.Code93:
|
|
670
|
+
return this.bkdView.config.decoderConfig.code93.maximumLength;
|
|
671
|
+
case BarkoderConstants.DecoderType.Code39:
|
|
672
|
+
return this.bkdView.config.decoderConfig.code39.maximumLength;
|
|
673
|
+
case BarkoderConstants.DecoderType.Telepen:
|
|
674
|
+
return this.bkdView.config.decoderConfig.telepen.maximumLength;
|
|
675
|
+
case BarkoderConstants.DecoderType.Code11:
|
|
676
|
+
return this.bkdView.config.decoderConfig.code11.maximumLength;
|
|
677
|
+
case BarkoderConstants.DecoderType.Msi:
|
|
678
|
+
return this.bkdView.config.decoderConfig.msi.maximumLength;
|
|
679
|
+
case BarkoderConstants.DecoderType.UpcA:
|
|
680
|
+
return this.bkdView.config.decoderConfig.upcA.maximumLength;
|
|
681
|
+
case BarkoderConstants.DecoderType.UpcE:
|
|
682
|
+
return this.bkdView.config.decoderConfig.upcE.maximumLength;
|
|
683
|
+
case BarkoderConstants.DecoderType.UpcE1:
|
|
684
|
+
return this.bkdView.config.decoderConfig.upcE1.maximumLength;
|
|
685
|
+
case BarkoderConstants.DecoderType.Ean13:
|
|
686
|
+
return this.bkdView.config.decoderConfig.ean13.maximumLength;
|
|
687
|
+
case BarkoderConstants.DecoderType.Ean8:
|
|
688
|
+
return this.bkdView.config.decoderConfig.ean8.maximumLength;
|
|
689
|
+
case BarkoderConstants.DecoderType.PDF417:
|
|
690
|
+
return this.bkdView.config.decoderConfig.PDF417.maximumLength;
|
|
691
|
+
case BarkoderConstants.DecoderType.PDF417Micro:
|
|
692
|
+
return this.bkdView.config.decoderConfig.PDF417Micro.maximumLength;
|
|
693
|
+
case BarkoderConstants.DecoderType.Datamatrix:
|
|
694
|
+
return this.bkdView.config.decoderConfig.datamatrix.maximumLength;
|
|
695
|
+
case BarkoderConstants.DecoderType.Code25:
|
|
696
|
+
return this.bkdView.config.decoderConfig.code25.maximumLength;
|
|
697
|
+
case BarkoderConstants.DecoderType.Interleaved25:
|
|
698
|
+
return this.bkdView.config.decoderConfig.interleaved25.maximumLength;
|
|
699
|
+
case BarkoderConstants.DecoderType.ITF14:
|
|
700
|
+
return this.bkdView.config.decoderConfig.itf14.maximumLength;
|
|
701
|
+
case BarkoderConstants.DecoderType.IATA25:
|
|
702
|
+
return this.bkdView.config.decoderConfig.iata25.maximumLength;
|
|
703
|
+
case BarkoderConstants.DecoderType.Matrix25:
|
|
704
|
+
return this.bkdView.config.decoderConfig.matrix25.maximumLength;
|
|
705
|
+
case BarkoderConstants.DecoderType.Datalogic25:
|
|
706
|
+
return this.bkdView.config.decoderConfig.datalogic25.maximumLength;
|
|
707
|
+
case BarkoderConstants.DecoderType.COOP25:
|
|
708
|
+
return this.bkdView.config.decoderConfig.coop25.maximumLength;
|
|
709
|
+
case BarkoderConstants.DecoderType.Dotcode:
|
|
710
|
+
return this.bkdView.config.decoderConfig.dotcode.maximumLength;
|
|
711
|
+
}
|
|
712
|
+
}
|
|
713
|
+
|
|
714
|
+
getBarcodeTypeMinimumLenght(decoder: BarkoderConstants.DecoderType): any {
|
|
715
|
+
switch (decoder) {
|
|
716
|
+
case BarkoderConstants.DecoderType.Aztec:
|
|
717
|
+
return this.bkdView.config.decoderConfig.aztec.minimumLength;
|
|
718
|
+
case BarkoderConstants.DecoderType.AztecCompact:
|
|
719
|
+
return this.bkdView.config.decoderConfig.aztecCompact.minimumLength;
|
|
720
|
+
case BarkoderConstants.DecoderType.QR:
|
|
721
|
+
return this.bkdView.config.decoderConfig.qr.minimumLength;
|
|
722
|
+
case BarkoderConstants.DecoderType.QRMicro:
|
|
723
|
+
return this.bkdView.config.decoderConfig.qrMicro.minimumLength;
|
|
724
|
+
case BarkoderConstants.DecoderType.Code128:
|
|
725
|
+
return this.bkdView.config.decoderConfig.code128.minimumLength;
|
|
726
|
+
case BarkoderConstants.DecoderType.Code93:
|
|
727
|
+
return this.bkdView.config.decoderConfig.code93.minimumLength;
|
|
728
|
+
case BarkoderConstants.DecoderType.Code39:
|
|
729
|
+
return this.bkdView.config.decoderConfig.code39.minimumLength;
|
|
730
|
+
case BarkoderConstants.DecoderType.Telepen:
|
|
731
|
+
return this.bkdView.config.decoderConfig.telepen.minimumLength;
|
|
732
|
+
case BarkoderConstants.DecoderType.Code11:
|
|
733
|
+
return this.bkdView.config.decoderConfig.code11.minimumLength;
|
|
734
|
+
case BarkoderConstants.DecoderType.Msi:
|
|
735
|
+
return this.bkdView.config.decoderConfig.msi.minimumLength;
|
|
736
|
+
case BarkoderConstants.DecoderType.UpcA:
|
|
737
|
+
return this.bkdView.config.decoderConfig.upcA.minimumLength;
|
|
738
|
+
case BarkoderConstants.DecoderType.UpcE:
|
|
739
|
+
return this.bkdView.config.decoderConfig.upcE.minimumLength;
|
|
740
|
+
case BarkoderConstants.DecoderType.UpcE1:
|
|
741
|
+
return this.bkdView.config.decoderConfig.upcE1.minimumLength;
|
|
742
|
+
case BarkoderConstants.DecoderType.Ean13:
|
|
743
|
+
return this.bkdView.config.decoderConfig.ean13.minimumLength;
|
|
744
|
+
case BarkoderConstants.DecoderType.Ean8:
|
|
745
|
+
return this.bkdView.config.decoderConfig.ean8.minimumLength;
|
|
746
|
+
case BarkoderConstants.DecoderType.PDF417:
|
|
747
|
+
return this.bkdView.config.decoderConfig.PDF417.minimumLength;
|
|
748
|
+
case BarkoderConstants.DecoderType.PDF417Micro:
|
|
749
|
+
return this.bkdView.config.decoderConfig.PDF417Micro.minimumLength;
|
|
750
|
+
case BarkoderConstants.DecoderType.Datamatrix:
|
|
751
|
+
return this.bkdView.config.decoderConfig.datamatrix.minimumLength;
|
|
752
|
+
case BarkoderConstants.DecoderType.Code25:
|
|
753
|
+
return this.bkdView.config.decoderConfig.code25.minimumLength;
|
|
754
|
+
case BarkoderConstants.DecoderType.Interleaved25:
|
|
755
|
+
return this.bkdView.config.decoderConfig.interleaved25.minimumLength;
|
|
756
|
+
case BarkoderConstants.DecoderType.ITF14:
|
|
757
|
+
return this.bkdView.config.decoderConfig.itf14.minimumLength;
|
|
758
|
+
case BarkoderConstants.DecoderType.IATA25:
|
|
759
|
+
return this.bkdView.config.decoderConfig.iata25.minimumLength;
|
|
760
|
+
case BarkoderConstants.DecoderType.Matrix25:
|
|
761
|
+
return this.bkdView.config.decoderConfig.matrix25.minimumLength;
|
|
762
|
+
case BarkoderConstants.DecoderType.Datalogic25:
|
|
763
|
+
return this.bkdView.config.decoderConfig.datalogic25.minimumLength;
|
|
764
|
+
case BarkoderConstants.DecoderType.COOP25:
|
|
765
|
+
return this.bkdView.config.decoderConfig.coop25.minimumLength;
|
|
766
|
+
case BarkoderConstants.DecoderType.Dotcode:
|
|
767
|
+
return this.bkdView.config.decoderConfig.dotcode.minimumLength;
|
|
768
|
+
}
|
|
769
|
+
}
|
|
770
|
+
|
|
771
|
+
/**
|
|
772
|
+
* Sets the length range for the specified barcode type
|
|
773
|
+
*/
|
|
774
|
+
setBarcodeTypeLengthRange(
|
|
775
|
+
decoder: BarkoderConstants.DecoderType,
|
|
776
|
+
minimumLength: number,
|
|
777
|
+
maximumLength: number
|
|
778
|
+
) {
|
|
779
|
+
switch (decoder) {
|
|
780
|
+
case BarkoderConstants.DecoderType.Aztec:
|
|
781
|
+
this.bkdView.config.decoderConfig.aztec.setLengthRangeWithMinimumMaximum(
|
|
782
|
+
minimumLength,
|
|
783
|
+
maximumLength
|
|
784
|
+
);
|
|
785
|
+
break;
|
|
786
|
+
case BarkoderConstants.DecoderType.AztecCompact:
|
|
787
|
+
this.bkdView.config.decoderConfig.aztecCompact.setLengthRangeWithMinimumMaximum(
|
|
788
|
+
minimumLength,
|
|
789
|
+
maximumLength
|
|
790
|
+
);
|
|
791
|
+
break;
|
|
792
|
+
case BarkoderConstants.DecoderType.QR:
|
|
793
|
+
this.bkdView.config.decoderConfig.qr.setLengthRangeWithMinimumMaximum(
|
|
794
|
+
minimumLength,
|
|
795
|
+
maximumLength
|
|
796
|
+
);
|
|
797
|
+
break;
|
|
798
|
+
case BarkoderConstants.DecoderType.QRMicro:
|
|
799
|
+
this.bkdView.config.decoderConfig.qrMicro.setLengthRangeWithMinimumMaximum(
|
|
800
|
+
minimumLength,
|
|
801
|
+
maximumLength
|
|
802
|
+
);
|
|
803
|
+
break;
|
|
804
|
+
case BarkoderConstants.DecoderType.Code128:
|
|
805
|
+
this.bkdView.config.decoderConfig.code128.setLengthRangeWithMinimumMaximum(
|
|
806
|
+
minimumLength,
|
|
807
|
+
maximumLength
|
|
808
|
+
);
|
|
809
|
+
break;
|
|
810
|
+
case BarkoderConstants.DecoderType.Code93:
|
|
811
|
+
this.bkdView.config.decoderConfig.code93.setLengthRangeWithMinimumMaximum(
|
|
812
|
+
minimumLength,
|
|
813
|
+
maximumLength
|
|
814
|
+
);
|
|
815
|
+
break;
|
|
816
|
+
case BarkoderConstants.DecoderType.Code39:
|
|
817
|
+
this.bkdView.config.decoderConfig.code39.setLengthRangeWithMinimumMaximum(
|
|
818
|
+
minimumLength,
|
|
819
|
+
maximumLength
|
|
820
|
+
);
|
|
821
|
+
break;
|
|
822
|
+
case BarkoderConstants.DecoderType.Telepen:
|
|
823
|
+
this.bkdView.config.decoderConfig.telepen.setLengthRangeWithMinimumMaximum(
|
|
824
|
+
minimumLength,
|
|
825
|
+
maximumLength
|
|
826
|
+
);
|
|
827
|
+
break;
|
|
828
|
+
case BarkoderConstants.DecoderType.Code11:
|
|
829
|
+
this.bkdView.config.decoderConfig.code11.setLengthRangeWithMinimumMaximum(
|
|
830
|
+
minimumLength,
|
|
831
|
+
maximumLength
|
|
832
|
+
);
|
|
833
|
+
break;
|
|
834
|
+
case BarkoderConstants.DecoderType.Msi:
|
|
835
|
+
this.bkdView.config.decoderConfig.msi.setLengthRangeWithMinimumMaximum(
|
|
836
|
+
minimumLength,
|
|
837
|
+
maximumLength
|
|
838
|
+
);
|
|
839
|
+
break;
|
|
840
|
+
case BarkoderConstants.DecoderType.UpcA:
|
|
841
|
+
this.bkdView.config.decoderConfig.upcA.setLengthRangeWithMinimumMaximum(
|
|
842
|
+
minimumLength,
|
|
843
|
+
maximumLength
|
|
844
|
+
);
|
|
845
|
+
break;
|
|
846
|
+
case BarkoderConstants.DecoderType.UpcE:
|
|
847
|
+
this.bkdView.config.decoderConfig.upcE.setLengthRangeWithMinimumMaximum(
|
|
848
|
+
minimumLength,
|
|
849
|
+
maximumLength
|
|
850
|
+
);
|
|
851
|
+
break;
|
|
852
|
+
case BarkoderConstants.DecoderType.UpcE1:
|
|
853
|
+
this.bkdView.config.decoderConfig.upcE1.setLengthRangeWithMinimumMaximum(
|
|
854
|
+
minimumLength,
|
|
855
|
+
maximumLength
|
|
856
|
+
);
|
|
857
|
+
break;
|
|
858
|
+
case BarkoderConstants.DecoderType.Ean13:
|
|
859
|
+
this.bkdView.config.decoderConfig.ean13.setLengthRangeWithMinimumMaximum(
|
|
860
|
+
minimumLength,
|
|
861
|
+
maximumLength
|
|
862
|
+
);
|
|
863
|
+
break;
|
|
864
|
+
case BarkoderConstants.DecoderType.Ean8:
|
|
865
|
+
this.bkdView.config.decoderConfig.ean8.setLengthRangeWithMinimumMaximum(
|
|
866
|
+
minimumLength,
|
|
867
|
+
maximumLength
|
|
868
|
+
);
|
|
869
|
+
break;
|
|
870
|
+
case BarkoderConstants.DecoderType.PDF417:
|
|
871
|
+
this.bkdView.config.decoderConfig.PDF417.setLengthRangeWithMinimumMaximum(
|
|
872
|
+
minimumLength,
|
|
873
|
+
maximumLength
|
|
874
|
+
);
|
|
875
|
+
break;
|
|
876
|
+
case BarkoderConstants.DecoderType.PDF417Micro:
|
|
877
|
+
this.bkdView.config.decoderConfig.PDF417Micro.setLengthRangeWithMinimumMaximum(
|
|
878
|
+
minimumLength,
|
|
879
|
+
maximumLength
|
|
880
|
+
);
|
|
881
|
+
break;
|
|
882
|
+
case BarkoderConstants.DecoderType.Datamatrix:
|
|
883
|
+
this.bkdView.config.decoderConfig.datamatrix.setLengthRangeWithMinimumMaximum(
|
|
884
|
+
minimumLength,
|
|
885
|
+
maximumLength
|
|
886
|
+
);
|
|
887
|
+
break;
|
|
888
|
+
case BarkoderConstants.DecoderType.Code25:
|
|
889
|
+
this.bkdView.config.decoderConfig.code25.setLengthRangeWithMinimumMaximum(
|
|
890
|
+
minimumLength,
|
|
891
|
+
maximumLength
|
|
892
|
+
);
|
|
893
|
+
break;
|
|
894
|
+
case BarkoderConstants.DecoderType.Interleaved25:
|
|
895
|
+
this.bkdView.config.decoderConfig.interleaved25.setLengthRangeWithMinimumMaximum(
|
|
896
|
+
minimumLength,
|
|
897
|
+
maximumLength
|
|
898
|
+
);
|
|
899
|
+
break;
|
|
900
|
+
case BarkoderConstants.DecoderType.ITF14:
|
|
901
|
+
this.bkdView.config.decoderConfig.itf14.setLengthRangeWithMinimumMaximum(
|
|
902
|
+
minimumLength,
|
|
903
|
+
maximumLength
|
|
904
|
+
);
|
|
905
|
+
break;
|
|
906
|
+
case BarkoderConstants.DecoderType.IATA25:
|
|
907
|
+
this.bkdView.config.decoderConfig.iata25.setLengthRangeWithMinimumMaximum(
|
|
908
|
+
minimumLength,
|
|
909
|
+
maximumLength
|
|
910
|
+
);
|
|
911
|
+
break;
|
|
912
|
+
case BarkoderConstants.DecoderType.Matrix25:
|
|
913
|
+
this.bkdView.config.decoderConfig.matrix25.setLengthRangeWithMinimumMaximum(
|
|
914
|
+
minimumLength,
|
|
915
|
+
maximumLength
|
|
916
|
+
);
|
|
917
|
+
break;
|
|
918
|
+
case BarkoderConstants.DecoderType.Datalogic25:
|
|
919
|
+
this.bkdView.config.decoderConfig.datalogic25.setLengthRangeWithMinimumMaximum(
|
|
920
|
+
minimumLength,
|
|
921
|
+
maximumLength
|
|
922
|
+
);
|
|
923
|
+
break;
|
|
924
|
+
case BarkoderConstants.DecoderType.COOP25:
|
|
925
|
+
this.bkdView.config.decoderConfig.coop25.setLengthRangeWithMinimumMaximum(
|
|
926
|
+
minimumLength,
|
|
927
|
+
maximumLength
|
|
928
|
+
);
|
|
929
|
+
break;
|
|
930
|
+
case BarkoderConstants.DecoderType.Dotcode:
|
|
931
|
+
this.bkdView.config.decoderConfig.dotcode.setLengthRangeWithMinimumMaximum(
|
|
932
|
+
minimumLength,
|
|
933
|
+
maximumLength
|
|
934
|
+
);
|
|
935
|
+
break;
|
|
936
|
+
default:
|
|
937
|
+
break;
|
|
938
|
+
}
|
|
939
|
+
}
|
|
940
|
+
|
|
941
|
+
/**
|
|
942
|
+
* Sets the maximum number of results to be returned from barcode scanning
|
|
943
|
+
*/
|
|
944
|
+
setMaximumResultsCount(maximumResultsCount: number): void {
|
|
945
|
+
this.bkdView.config.decoderConfig.maximumResultsCount = maximumResultsCount;
|
|
946
|
+
}
|
|
947
|
+
|
|
948
|
+
/**
|
|
949
|
+
* Sets the delay in milliseconds for considering duplicate barcodes during scanning
|
|
950
|
+
*/
|
|
951
|
+
setDuplicatesDelayMs(duplicateDelayMs: number): void {
|
|
952
|
+
this.bkdView.config.decoderConfig.duplicatesDelayMs = duplicateDelayMs;
|
|
953
|
+
}
|
|
954
|
+
|
|
955
|
+
/**
|
|
956
|
+
* Sets the caching duration (in milliseconds) for multi-code results
|
|
957
|
+
*/
|
|
958
|
+
setMulticodeCachingDuration(multicodeCachingDuration: number): void {
|
|
959
|
+
this.bkdView.config.setMulticodeCachingDuration(multicodeCachingDuration);
|
|
960
|
+
}
|
|
961
|
+
|
|
962
|
+
/**
|
|
963
|
+
* Sets whether multi-code caching is enabled
|
|
964
|
+
*/
|
|
965
|
+
setMulticodeCachingEnabled(multiCodeCachingEnabled: boolean): void {
|
|
966
|
+
this.bkdView.config.setMulticodeCachingEnabled(multiCodeCachingEnabled);
|
|
967
|
+
}
|
|
968
|
+
|
|
969
|
+
/**
|
|
970
|
+
* Sets whether the Direct Part Marking (DPM) mode for Datamatrix barcodes is enabled.
|
|
971
|
+
*/
|
|
972
|
+
setDatamatrixDpmModeEnabled(dpmModeEnabled: boolean): void {
|
|
973
|
+
if (dpmModeEnabled) {
|
|
974
|
+
this.bkdView.config.decoderConfig.datamatrix.dpmMode = 1;
|
|
975
|
+
} else if (dpmModeEnabled == false) {
|
|
976
|
+
this.bkdView.config.decoderConfig.datamatrix.dpmMode = 0;
|
|
977
|
+
}
|
|
978
|
+
}
|
|
979
|
+
|
|
980
|
+
/**
|
|
981
|
+
* Retrieves the delay in milliseconds for considering duplicate barcodes during scanning
|
|
982
|
+
*/
|
|
983
|
+
getDuplicatesDelayMs(): any {
|
|
984
|
+
return this.bkdView.config.decoderConfig.duplicatesDelayMs;
|
|
985
|
+
}
|
|
986
|
+
|
|
987
|
+
/**
|
|
988
|
+
* Retrieves the maximum number of results to be returned from barcode scanning at once
|
|
989
|
+
*/
|
|
990
|
+
getMaximumResultsCount(): any {
|
|
991
|
+
return this.bkdView.config.decoderConfig.maximumResultsCount;
|
|
992
|
+
}
|
|
993
|
+
|
|
994
|
+
/**
|
|
995
|
+
* Sets whether the deblurring feature for UPC/EAN barcodes is enabled
|
|
996
|
+
*/
|
|
997
|
+
setUpcEanDeblurEnabled(enabled: boolean): void {
|
|
998
|
+
this.bkdView.config.decoderConfig.upcEanDeblur = enabled;
|
|
999
|
+
}
|
|
1000
|
+
|
|
1001
|
+
/**
|
|
1002
|
+
* Sets whether the detection of misshaped 1D barcodes is enabled
|
|
1003
|
+
*/
|
|
1004
|
+
setEnableMisshaped1DEnabled(enabled: boolean): void {
|
|
1005
|
+
this.bkdView.config.decoderConfig.enableMisshaped1D = enabled;
|
|
1006
|
+
}
|
|
1007
|
+
|
|
1008
|
+
/**
|
|
1009
|
+
* Sets whether to enable barcode thumbnail on result
|
|
1010
|
+
*/
|
|
1011
|
+
setBarcodeThumbnailOnResultEnabled(enabled: boolean): void {
|
|
1012
|
+
this.bkdView.config.barcodeThumbnailOnResult = enabled;
|
|
1013
|
+
}
|
|
1014
|
+
|
|
1015
|
+
/**
|
|
1016
|
+
* Retrieve whether to enable barcode thumbnail on result
|
|
1017
|
+
*/
|
|
1018
|
+
isBarcodeThumbnailOnResultEnabled(): any {
|
|
1019
|
+
return this.bkdView.config.barcodeThumbnailOnResult;
|
|
1020
|
+
}
|
|
1021
|
+
|
|
1022
|
+
/**
|
|
1023
|
+
* Sets the threshold between duplicate scans
|
|
1024
|
+
*/
|
|
1025
|
+
setThresholdBetweenDuplicatesScans(
|
|
1026
|
+
thresholdBetweenDuplicatesScans: number
|
|
1027
|
+
): void {
|
|
1028
|
+
this.bkdView.config.thresholdBetweenDuplicatesScans = thresholdBetweenDuplicatesScans;
|
|
1029
|
+
}
|
|
1030
|
+
|
|
1031
|
+
/**
|
|
1032
|
+
* Retrieves the threshold between duplicate scans
|
|
1033
|
+
*/
|
|
1034
|
+
getThresholdBetweenDuplicatesScans(): any {
|
|
1035
|
+
return this.bkdView.config.thresholdBetweenDuplicatesScans;
|
|
1036
|
+
}
|
|
1037
|
+
|
|
1038
|
+
/**
|
|
1039
|
+
* Retrieves whether multi-code caching is enabled
|
|
1040
|
+
*/
|
|
1041
|
+
getMulticodeCachingEnabled(): any {
|
|
1042
|
+
return this.bkdView.config.getMulticodeCachingEnabled();
|
|
1043
|
+
}
|
|
1044
|
+
|
|
1045
|
+
/**
|
|
1046
|
+
* Retrieves the caching duration (in milliseconds) for multi-code results
|
|
1047
|
+
*/
|
|
1048
|
+
getMulticodeCachingDuration(): any {
|
|
1049
|
+
return this.bkdView.config.getMulticodeCachingDuration();
|
|
1050
|
+
}
|
|
1051
|
+
|
|
1052
|
+
/**
|
|
1053
|
+
* Retrieves the value indicating whether deblurring is enabled for UPC/EAN barcodes
|
|
1054
|
+
*/
|
|
1055
|
+
isUpcEanDeblurEnabled(): any {
|
|
1056
|
+
return this.bkdView.config.decoderConfig.upcEanDeblur;
|
|
1057
|
+
}
|
|
1058
|
+
|
|
1059
|
+
/**
|
|
1060
|
+
* Checks if the detection of misshaped 1D barcodes is enabled
|
|
1061
|
+
*/
|
|
1062
|
+
isMisshaped1DEnabled(): any {
|
|
1063
|
+
return this.bkdView.config.decoderConfig.enableMisshaped1D;
|
|
1064
|
+
}
|
|
1065
|
+
|
|
1066
|
+
/**
|
|
1067
|
+
* Checks if VIN restrictions are enabled
|
|
1068
|
+
*/
|
|
1069
|
+
isVINRestrictionsEnabled(): any {
|
|
1070
|
+
return this.bkdView.config.decoderConfig.enableVINRestrictions;
|
|
1071
|
+
}
|
|
1072
|
+
|
|
1073
|
+
/**
|
|
1074
|
+
* Sets whether Vehicle Identification Number (VIN) restrictions are enabled
|
|
1075
|
+
*/
|
|
1076
|
+
setEnableVINRestrictions(vinRestrictionsEnabled: boolean): void {
|
|
1077
|
+
this.bkdView.config.decoderConfig.enableVINRestrictions = vinRestrictionsEnabled;
|
|
1078
|
+
}
|
|
1079
|
+
|
|
1080
|
+
setLicenseKey(licenseKey: string): void {
|
|
1081
|
+
const config = new BarkoderConfig({
|
|
1082
|
+
licenseKey: licenseKey,
|
|
1083
|
+
licenseCheckHandler: (result: LicenseCheckResult) => {},
|
|
1084
|
+
});
|
|
1085
|
+
|
|
1086
|
+
this.bkdView.config = config;
|
|
1087
|
+
}
|
|
1088
|
+
|
|
1089
|
+
/**
|
|
1090
|
+
* Configures the Barkoder functionality based on the provided configuration
|
|
1091
|
+
*/
|
|
1092
|
+
configureBarkoder(config: BarkoderConstants.BarkoderConfig): void {
|
|
1093
|
+
const nsString = NSString.stringWithString(config.toJsonString());
|
|
1094
|
+
const jsonData = nsString.dataUsingEncoding(NSUTF8StringEncoding);
|
|
1095
|
+
BarkoderHelper.applyConfigSettingsFromJsonJsonDataFinished(
|
|
1096
|
+
this.bkdView.config,
|
|
1097
|
+
jsonData,
|
|
1098
|
+
(resultConfig: BarkoderConfig, error: NSError) => {
|
|
1099
|
+
if (error) {
|
|
1100
|
+
console.error(
|
|
1101
|
+
"Error applying config settings:",
|
|
1102
|
+
error.localizedDescription
|
|
1103
|
+
);
|
|
1104
|
+
} else {
|
|
1105
|
+
console.log("Config settings applied successfully:", resultConfig);
|
|
682
1106
|
}
|
|
683
|
-
}
|
|
684
|
-
|
|
685
|
-
setMaximumResultsCount(maximumResultsCount : number): void {
|
|
686
|
-
this.bkdView.config.decoderConfig.maximumResultsCount = maximumResultsCount
|
|
687
|
-
}
|
|
688
|
-
setDuplicatesDelayMs(duplicateDelayMs : number) : void {
|
|
689
|
-
this.bkdView.config.decoderConfig.duplicatesDelayMs = duplicateDelayMs
|
|
690
|
-
}
|
|
691
|
-
|
|
692
|
-
setMulticodeCachingDuration(multicodeCachingDuration : number) : void {
|
|
693
|
-
this.bkdView.config.setMulticodeCachingDuration(multicodeCachingDuration)
|
|
694
|
-
}
|
|
695
|
-
|
|
696
|
-
setMulticodeCachingEnabled(multiCodeCachingEnabled : boolean) : void {
|
|
697
|
-
this.bkdView.config.setMulticodeCachingEnabled(multiCodeCachingEnabled)
|
|
698
|
-
}
|
|
699
|
-
|
|
700
|
-
setDatamatrixDpmModeEnabled(dpmModeEnabled : boolean) : void {
|
|
701
|
-
if(dpmModeEnabled) {
|
|
702
|
-
this.bkdView.config.decoderConfig.datamatrix.dpmMode = 1
|
|
703
|
-
} else if (dpmModeEnabled == false) {
|
|
704
|
-
this.bkdView.config.decoderConfig.datamatrix.dpmMode = 0
|
|
705
|
-
}
|
|
706
|
-
|
|
707
|
-
}
|
|
708
|
-
|
|
709
|
-
getDuplicatesDelayMs() : any {
|
|
710
|
-
return this.bkdView.config.decoderConfig.duplicatesDelayMs
|
|
711
|
-
}
|
|
712
|
-
|
|
713
|
-
getMaximumResultsCount() : any {
|
|
714
|
-
return this.bkdView.config.decoderConfig.maximumResultsCount
|
|
715
|
-
}
|
|
716
|
-
|
|
717
|
-
setUpcEanDeblurEnabled(enabled : boolean) : void {
|
|
718
|
-
this.bkdView.config.decoderConfig.upcEanDeblur = enabled
|
|
719
|
-
}
|
|
720
|
-
|
|
721
|
-
setEnableMisshaped1DEnabled(enabled : boolean) : void {
|
|
722
|
-
this.bkdView.config.decoderConfig.enableMisshaped1D = enabled
|
|
723
|
-
}
|
|
724
|
-
|
|
725
|
-
setBarcodeThumbnailOnResultEnabled(enabled : boolean) : void{
|
|
726
|
-
this.bkdView.config.barcodeThumbnailOnResult = enabled
|
|
727
|
-
}
|
|
728
|
-
|
|
729
|
-
isBarcodeThumbnailOnResultEnabled() : any{
|
|
730
|
-
return this.bkdView.config.barcodeThumbnailOnResult
|
|
731
|
-
}
|
|
732
|
-
|
|
733
|
-
setThresholdBetweenDuplicatesScans(thresholdBetweenDuplicatesScans : number) : void {
|
|
734
|
-
this.bkdView.config.thresholdBetweenDuplicatesScans = thresholdBetweenDuplicatesScans
|
|
735
|
-
}
|
|
736
|
-
|
|
737
|
-
getThresholdBetweenDuplicatesScans() : any {
|
|
738
|
-
return this.bkdView.config.thresholdBetweenDuplicatesScans
|
|
739
|
-
}
|
|
740
|
-
|
|
741
|
-
getMulticodeCachingEnabled() : any {
|
|
742
|
-
return this.bkdView.config.getMulticodeCachingEnabled()
|
|
743
|
-
}
|
|
744
|
-
|
|
745
|
-
getMulticodeCachingDuration() : any {
|
|
746
|
-
return this.bkdView.config.getMulticodeCachingDuration()
|
|
747
|
-
}
|
|
748
|
-
|
|
749
|
-
isUpcEanDeblurEnabled() : any {
|
|
750
|
-
return this.bkdView.config.decoderConfig.upcEanDeblur
|
|
751
|
-
}
|
|
752
|
-
|
|
753
|
-
isMisshaped1DEnabled() : any {
|
|
754
|
-
return this.bkdView.config.decoderConfig.enableMisshaped1D
|
|
755
|
-
}
|
|
756
|
-
|
|
757
|
-
isVINRestrictionsEnabled() : any {
|
|
758
|
-
return this.bkdView.config.decoderConfig.enableVINRestrictions
|
|
759
|
-
}
|
|
760
|
-
|
|
761
|
-
setEnableVINRestrictions(vinRestrictionsEnabled: boolean) : void {
|
|
762
|
-
this.bkdView.config.decoderConfig.enableVINRestrictions = vinRestrictionsEnabled
|
|
763
|
-
}
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
setLicenseKey(licenseKey : string): void {
|
|
767
|
-
const config = new BarkoderConfig({
|
|
768
|
-
licenseKey: licenseKey,
|
|
769
|
-
licenseCheckHandler: (result: LicenseCheckResult) => {
|
|
770
|
-
}
|
|
771
|
-
});
|
|
772
|
-
|
|
773
|
-
this.bkdView.config = config
|
|
774
|
-
}
|
|
775
|
-
|
|
776
|
-
configureBarkoder(config : BarkoderConstants.BarkoderConfig) : void {
|
|
777
|
-
console.log(`${config.toJsonString()}`)
|
|
778
|
-
const nsString = NSString.stringWithString(config.toJsonString());
|
|
779
|
-
const jsonData = nsString.dataUsingEncoding(NSUTF8StringEncoding);
|
|
780
|
-
BarkoderHelper.applyConfigSettingsFromJsonJsonDataFinished(this.bkdView.config, jsonData, (resultConfig: BarkoderConfig, error: NSError) => {
|
|
781
|
-
if (error) {
|
|
782
|
-
console.error('Error applying config settings:', error.localizedDescription);
|
|
783
|
-
} else {
|
|
784
|
-
console.log('Config settings applied successfully:', resultConfig);
|
|
785
|
-
}
|
|
786
|
-
});
|
|
787
1107
|
}
|
|
1108
|
+
);
|
|
1109
|
+
}
|
|
788
1110
|
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
1111
|
+
private hexToUIColor(hexColor: string): UIColor {
|
|
1112
|
+
hexColor = hexColor.replace("#", "");
|
|
1113
|
+
const red = parseInt(hexColor.substring(0, 2), 16) / 255.0;
|
|
1114
|
+
const green = parseInt(hexColor.substring(2, 4), 16) / 255.0;
|
|
1115
|
+
const blue = parseInt(hexColor.substring(4, 6), 16) / 255.0;
|
|
1116
|
+
return new UIColor({ red: red, green: green, blue: blue, alpha: 1 });
|
|
1117
|
+
}
|
|
796
1118
|
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
}
|
|
1119
|
+
private getPropertiesAndMethods(obj: any): void {
|
|
1120
|
+
const propertiesAndMethods: string[] = [];
|
|
1121
|
+
|
|
1122
|
+
for (let key in obj) {
|
|
1123
|
+
console.log(`Key: ${key}, Value: ${obj[key]}`);
|
|
803
1124
|
}
|
|
1125
|
+
}
|
|
804
1126
|
}
|
|
805
1127
|
|
|
806
1128
|
@NativeClass
|
|
807
|
-
export class BarkoderViewWraper extends UIResponder
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
1129
|
+
export class BarkoderViewWraper extends UIResponder
|
|
1130
|
+
implements BarkoderResultDelegate {
|
|
1131
|
+
public callback: any;
|
|
1132
|
+
static ObjCProtocols = [BarkoderResultDelegate];
|
|
1133
|
+
|
|
1134
|
+
constructor(callback: BarkoderConstants.BarkoderResultCallback) {
|
|
1135
|
+
super();
|
|
1136
|
+
this.callback = callback;
|
|
1137
|
+
}
|
|
1138
|
+
|
|
1139
|
+
scanningFinishedThumbnailsImage(
|
|
1140
|
+
decoderResults: NSArray<DecoderResult> | DecoderResult[],
|
|
1141
|
+
thumbnails: NSArray<UIImage> | UIImage[],
|
|
1142
|
+
image: UIImage
|
|
1143
|
+
): void {
|
|
1144
|
+
this.callback.scanningFinished(decoderResults, thumbnails, image);
|
|
1145
|
+
}
|
|
1146
|
+
|
|
1147
|
+
static new(): BarkoderViewWraper {
|
|
1148
|
+
return super.new.call(this);
|
|
1149
|
+
}
|
|
826
1150
|
}
|
|
827
|
-
|
|
828
|
-
|