scandit-capacitor-datacapture-barcode 6.25.2 → 6.26.0-beta.2
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/ScanditCapacitorDatacaptureBarcode.podspec +1 -1
- package/android/build.gradle +1 -1
- package/android/src/main/java/com/scandit/capacitor/datacapture/barcode/ScanditBarcodeNative.kt +1 -1
- package/dist/barcode.js +1899 -1813
- package/dist/barcode.js.map +1 -1
- package/dist/dts/ts/BarcodeCountView.d.ts +7 -1
- package/dist/dts/ts/Capacitor/SparkScanViewProxy.d.ts +1 -0
- package/dist/dts/ts/SparkScanView.d.ts +26 -0
- package/dist/index.js +60 -2
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/dist/barcode.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { nameForSerialization, serializationDefault, NoViewfinder, NoneLocationSelection, DefaultSerializeable, ignoreFromSerialization, FactoryMaker, Quadrilateral, CameraController,
|
|
1
|
+
import { nameForSerialization, serializationDefault, NoViewfinder, NoneLocationSelection, DefaultSerializeable, ignoreFromSerialization, FactoryMaker, Feedback, Quadrilateral, CameraController, Brush, AimerViewfinder, Anchor, PointWithUnit, BaseController, CameraSettings, Color } from 'scandit-capacitor-datacapture-core/dist/core';
|
|
2
2
|
|
|
3
3
|
var Symbology;
|
|
4
4
|
(function (Symbology) {
|
|
@@ -308,7 +308,7 @@ function parseBarcodeCaptureDefaults(jsonDefaults) {
|
|
|
308
308
|
.fromJSON(jsonDefaults.RecommendedCameraSettings),
|
|
309
309
|
BarcodeCaptureSettings: {
|
|
310
310
|
codeDuplicateFilter: jsonDefaults.BarcodeCaptureSettings.codeDuplicateFilter,
|
|
311
|
-
|
|
311
|
+
batterySaving: jsonDefaults.BarcodeCaptureSettings.batterySaving,
|
|
312
312
|
scanIntention: jsonDefaults.BarcodeCaptureSettings.scanIntention,
|
|
313
313
|
},
|
|
314
314
|
BarcodeCaptureOverlay: {
|
|
@@ -416,1165 +416,1336 @@ function parseBarcodeSelectionDefaults(jsonDefaults) {
|
|
|
416
416
|
return barcodeSelectionDefaults;
|
|
417
417
|
}
|
|
418
418
|
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
strapModeButtonAccessibilityLabel: jsonDefaults.strapModeButtonAccessibilityLabel,
|
|
439
|
-
colorSchemeOnButtonText: jsonDefaults.colorSchemeOnButtonText,
|
|
440
|
-
colorSchemeOffButtonText: jsonDefaults.colorSchemeOffButtonText,
|
|
441
|
-
colorSchemeButtonContentDescription: jsonDefaults.colorSchemeButtonContentDescription,
|
|
442
|
-
colorSchemeButtonAccessibilityHint: jsonDefaults.colorSchemeButtonAccessibilityHint,
|
|
443
|
-
colorSchemeButtonAccessibilityLabel: jsonDefaults.colorSchemeButtonAccessibilityLabel,
|
|
444
|
-
};
|
|
445
|
-
return barcodeCountToolbarSettingsDefault;
|
|
446
|
-
}
|
|
447
|
-
function parseBarcodeCountDefaults(jsonDefaults) {
|
|
448
|
-
const viewJsonDefaults = jsonDefaults.BarcodeCountView;
|
|
449
|
-
const toolbarJsonDefaults = viewJsonDefaults.toolbarSettings;
|
|
450
|
-
const barcodeCountDefaults = {
|
|
451
|
-
RecommendedCameraSettings: CameraSettings
|
|
452
|
-
.fromJSON(jsonDefaults.RecommendedCameraSettings),
|
|
453
|
-
Feedback: {
|
|
454
|
-
success: Feedback.fromJSON(JSON.parse(jsonDefaults.BarcodeCountFeedback).success),
|
|
455
|
-
failure: Feedback.fromJSON(JSON.parse(jsonDefaults.BarcodeCountFeedback).failure)
|
|
456
|
-
},
|
|
457
|
-
BarcodeCountSettings: {
|
|
458
|
-
expectOnlyUniqueBarcodes: jsonDefaults.BarcodeCountSettings.expectOnlyUniqueBarcodes,
|
|
459
|
-
disableModeWhenCaptureListCompleted: jsonDefaults.BarcodeCountSettings.disableModeWhenCaptureListCompleted,
|
|
460
|
-
barcodeFilterSettings: viewJsonDefaults.filterSettings,
|
|
461
|
-
mappingEnabled: jsonDefaults.BarcodeCountSettings.mappingEnabled
|
|
462
|
-
},
|
|
463
|
-
BarcodeCountView: {
|
|
464
|
-
style: viewJsonDefaults.style,
|
|
465
|
-
shouldDisableModeOnExitButtonTapped: viewJsonDefaults.shouldDisableModeOnExitButtonTapped,
|
|
466
|
-
shouldShowUserGuidanceView: viewJsonDefaults.shouldShowUserGuidanceView,
|
|
467
|
-
shouldShowListButton: viewJsonDefaults.shouldShowListButton,
|
|
468
|
-
shouldShowExitButton: viewJsonDefaults.shouldShowExitButton,
|
|
469
|
-
shouldShowShutterButton: viewJsonDefaults.shouldShowShutterButton,
|
|
470
|
-
shouldShowHints: viewJsonDefaults.shouldShowHints,
|
|
471
|
-
shouldShowClearHighlightsButton: viewJsonDefaults.shouldShowClearHighlightsButton,
|
|
472
|
-
shouldShowSingleScanButton: viewJsonDefaults.shouldShowSingleScanButton,
|
|
473
|
-
shouldShowFloatingShutterButton: viewJsonDefaults.shouldShowFloatingShutterButton,
|
|
474
|
-
shouldShowToolbar: viewJsonDefaults.shouldShowToolbar,
|
|
475
|
-
defaultNotInListBrush: viewJsonDefaults.defaultNotInListBrush,
|
|
476
|
-
defaultRecognizedBrush: viewJsonDefaults.defaultRecognizedBrush,
|
|
477
|
-
defaultUnrecognizedBrush: viewJsonDefaults.defaultUnrecognizedBrush,
|
|
478
|
-
shouldShowScanAreaGuides: viewJsonDefaults.shouldShowScanAreaGuides,
|
|
479
|
-
clearHighlightsButtonText: viewJsonDefaults.clearHighlightsButtonText,
|
|
480
|
-
exitButtonText: viewJsonDefaults.exitButtonText,
|
|
481
|
-
textForUnrecognizedBarcodesDetectedHint: viewJsonDefaults.textForUnrecognizedBarcodesDetectedHint,
|
|
482
|
-
textForTapShutterToScanHint: viewJsonDefaults.textForTapShutterToScanHint,
|
|
483
|
-
textForScanningHint: viewJsonDefaults.textForScanningHint,
|
|
484
|
-
textForMoveCloserAndRescanHint: viewJsonDefaults.textForMoveCloserAndRescanHint,
|
|
485
|
-
textForMoveFurtherAndRescanHint: viewJsonDefaults.textForMoveFurtherAndRescanHint,
|
|
486
|
-
shouldShowListProgressBar: viewJsonDefaults.shouldShowListProgressBar,
|
|
487
|
-
toolbarSettings: parseBarcodeCountToolbarDefaults(toolbarJsonDefaults),
|
|
488
|
-
listButtonAccessibilityHint: viewJsonDefaults.listButtonAccessibilityHint || null,
|
|
489
|
-
listButtonAccessibilityLabel: viewJsonDefaults.listButtonAccessibilityLabel || null,
|
|
490
|
-
listButtonContentDescription: viewJsonDefaults.listButtonContentDescription || null,
|
|
491
|
-
exitButtonAccessibilityHint: viewJsonDefaults.exitButtonAccessibilityHint || null,
|
|
492
|
-
exitButtonAccessibilityLabel: viewJsonDefaults.exitButtonAccessibilityLabel || null,
|
|
493
|
-
exitButtonContentDescription: viewJsonDefaults.exitButtonContentDescription || null,
|
|
494
|
-
shutterButtonAccessibilityHint: viewJsonDefaults.shutterButtonAccessibilityHint || null,
|
|
495
|
-
shutterButtonAccessibilityLabel: viewJsonDefaults.shutterButtonAccessibilityLabel || null,
|
|
496
|
-
shutterButtonContentDescription: viewJsonDefaults.shutterButtonContentDescription || null,
|
|
497
|
-
floatingShutterButtonAccessibilityHint: viewJsonDefaults.floatingShutterButtonAccessibilityHint || null,
|
|
498
|
-
floatingShutterButtonAccessibilityLabel: viewJsonDefaults.floatingShutterButtonAccessibilityLabel || null,
|
|
499
|
-
floatingShutterButtonContentDescription: viewJsonDefaults.floatingShutterButtonContentDescription || null,
|
|
500
|
-
clearHighlightsButtonAccessibilityHint: viewJsonDefaults.clearHighlightsButtonAccessibilityHint || null,
|
|
501
|
-
clearHighlightsButtonAccessibilityLabel: viewJsonDefaults.clearHighlightsButtonAccessibilityLabel || null,
|
|
502
|
-
clearHighlightsButtonContentDescription: viewJsonDefaults.clearHighlightsButtonContentDescription || null,
|
|
503
|
-
singleScanButtonAccessibilityHint: viewJsonDefaults.singleScanButtonAccessibilityHint || null,
|
|
504
|
-
singleScanButtonAccessibilityLabel: viewJsonDefaults.singleScanButtonAccessibilityLabel || null,
|
|
505
|
-
singleScanButtonContentDescription: viewJsonDefaults.singleScanButtonContentDescription || null,
|
|
506
|
-
}
|
|
507
|
-
};
|
|
508
|
-
return barcodeCountDefaults;
|
|
419
|
+
class BarcodeCountFeedback extends DefaultSerializeable {
|
|
420
|
+
static get default() {
|
|
421
|
+
return new BarcodeCountFeedback(BarcodeCountFeedback.barcodeCountDefaults.Feedback.success, BarcodeCountFeedback.barcodeCountDefaults.Feedback.failure);
|
|
422
|
+
}
|
|
423
|
+
static fromJSON(json) {
|
|
424
|
+
const success = Feedback.fromJSON(json.success);
|
|
425
|
+
const failure = Feedback.fromJSON(json.failure);
|
|
426
|
+
return new BarcodeCountFeedback(success, failure);
|
|
427
|
+
}
|
|
428
|
+
static get barcodeCountDefaults() {
|
|
429
|
+
return getBarcodeCountDefaults();
|
|
430
|
+
}
|
|
431
|
+
constructor(success, error) {
|
|
432
|
+
super();
|
|
433
|
+
this.success = BarcodeCountFeedback.barcodeCountDefaults.Feedback.success;
|
|
434
|
+
this.failure = BarcodeCountFeedback.barcodeCountDefaults.Feedback.success;
|
|
435
|
+
this.success = success;
|
|
436
|
+
this.failure = error;
|
|
437
|
+
}
|
|
509
438
|
}
|
|
439
|
+
__decorate([
|
|
440
|
+
ignoreFromSerialization
|
|
441
|
+
], BarcodeCountFeedback, "barcodeCountDefaults", null);
|
|
510
442
|
|
|
511
|
-
|
|
512
|
-
|
|
443
|
+
class BarcodeCountCaptureListSession extends DefaultSerializeable {
|
|
444
|
+
get correctBarcodes() {
|
|
445
|
+
return this._correctBarcodes;
|
|
446
|
+
}
|
|
447
|
+
get wrongBarcodes() {
|
|
448
|
+
return this._wrongBarcodes;
|
|
449
|
+
}
|
|
450
|
+
get missingBarcodes() {
|
|
451
|
+
return this._missingBarcodes;
|
|
452
|
+
}
|
|
453
|
+
get additionalBarcodes() {
|
|
454
|
+
return this._additionalBarcodes;
|
|
455
|
+
}
|
|
456
|
+
static fromJSON(json) {
|
|
457
|
+
const correctBarcodes = json.correctBarcodes;
|
|
458
|
+
const wrongBarcodes = json.wrongBarcodes;
|
|
459
|
+
const missingBarcodes = json.missingBarcodes;
|
|
460
|
+
const additionalBarcodes = json.additionalBarcodes;
|
|
461
|
+
return new BarcodeCountCaptureListSession(correctBarcodes, wrongBarcodes, missingBarcodes, additionalBarcodes);
|
|
462
|
+
}
|
|
463
|
+
constructor(correctBarcodes, wrongBarcodes, missingBarcodes, additionalBarcodes) {
|
|
464
|
+
super();
|
|
465
|
+
this._correctBarcodes = correctBarcodes;
|
|
466
|
+
this._wrongBarcodes = wrongBarcodes;
|
|
467
|
+
this._missingBarcodes = missingBarcodes;
|
|
468
|
+
this._additionalBarcodes = additionalBarcodes;
|
|
469
|
+
}
|
|
513
470
|
}
|
|
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
|
-
return barcodeTrackingDefaults;
|
|
471
|
+
__decorate([
|
|
472
|
+
nameForSerialization('correctBarcodes')
|
|
473
|
+
], BarcodeCountCaptureListSession.prototype, "_correctBarcodes", void 0);
|
|
474
|
+
__decorate([
|
|
475
|
+
nameForSerialization('wrongBarcodes')
|
|
476
|
+
], BarcodeCountCaptureListSession.prototype, "_wrongBarcodes", void 0);
|
|
477
|
+
__decorate([
|
|
478
|
+
nameForSerialization('missingBarcodes')
|
|
479
|
+
], BarcodeCountCaptureListSession.prototype, "_missingBarcodes", void 0);
|
|
480
|
+
__decorate([
|
|
481
|
+
nameForSerialization('additionalBarcodes')
|
|
482
|
+
], BarcodeCountCaptureListSession.prototype, "_additionalBarcodes", void 0);
|
|
483
|
+
|
|
484
|
+
class EncodingRange {
|
|
485
|
+
get ianaName() { return this._ianaName; }
|
|
486
|
+
get startIndex() { return this._startIndex; }
|
|
487
|
+
get endIndex() { return this._endIndex; }
|
|
488
|
+
static fromJSON(json) {
|
|
489
|
+
const encodingRange = new EncodingRange();
|
|
490
|
+
encodingRange._ianaName = json.ianaName;
|
|
491
|
+
encodingRange._startIndex = json.startIndex;
|
|
492
|
+
encodingRange._endIndex = json.endIndex;
|
|
493
|
+
return encodingRange;
|
|
494
|
+
}
|
|
539
495
|
}
|
|
540
496
|
|
|
541
|
-
|
|
542
|
-
return
|
|
497
|
+
class StructuredAppendData {
|
|
498
|
+
get isComplete() { return this._isComplete; }
|
|
499
|
+
get barcodeSetId() { return this._barcodeSetId; }
|
|
500
|
+
get scannedSegmentCount() { return this._scannedSegmentCount; }
|
|
501
|
+
get totalSegmentCount() { return this._totalSegmentCount; }
|
|
502
|
+
get encodingRanges() { return this._encodingRanges; }
|
|
503
|
+
get completeData() { return this._completeData; }
|
|
504
|
+
get rawCompleteData() { return this._rawCompleteData; }
|
|
505
|
+
static fromJSON(json) {
|
|
506
|
+
const structuredAppendData = new StructuredAppendData();
|
|
507
|
+
if (!json)
|
|
508
|
+
return null;
|
|
509
|
+
structuredAppendData._isComplete = json.complete;
|
|
510
|
+
structuredAppendData._barcodeSetId = json.barcodeSetId;
|
|
511
|
+
structuredAppendData._scannedSegmentCount = json.scannedSegmentCount;
|
|
512
|
+
structuredAppendData._totalSegmentCount = json.totalSegmentCount;
|
|
513
|
+
structuredAppendData._encodingRanges =
|
|
514
|
+
json.completeDataEncodings.map(EncodingRange.fromJSON);
|
|
515
|
+
structuredAppendData._completeData = json.completeDataUtf8String;
|
|
516
|
+
structuredAppendData._rawCompleteData = json.completeDataRaw;
|
|
517
|
+
return structuredAppendData;
|
|
518
|
+
}
|
|
543
519
|
}
|
|
544
520
|
|
|
545
|
-
|
|
546
|
-
return
|
|
521
|
+
class Barcode extends DefaultSerializeable {
|
|
522
|
+
get symbology() { return this._symbology; }
|
|
523
|
+
get data() { return this._data; }
|
|
524
|
+
get rawData() { return this._rawData; }
|
|
525
|
+
get compositeData() { return this._compositeData; }
|
|
526
|
+
get compositeRawData() { return this._compositeRawData; }
|
|
527
|
+
get addOnData() { return this._addOnData; }
|
|
528
|
+
get encodingRanges() { return this._encodingRanges; }
|
|
529
|
+
get location() { return this._location; }
|
|
530
|
+
get isGS1DataCarrier() { return this._isGS1DataCarrier; }
|
|
531
|
+
get compositeFlag() { return this._compositeFlag; }
|
|
532
|
+
get isColorInverted() { return this._isColorInverted; }
|
|
533
|
+
get symbolCount() { return this._symbolCount; }
|
|
534
|
+
get frameID() { return this._frameID; }
|
|
535
|
+
get isStructuredAppend() { return this._structuredAppendData !== null; }
|
|
536
|
+
get structuredAppendData() { return this._structuredAppendData; }
|
|
537
|
+
get selectionIdentifier() { return this.data + this.symbology; }
|
|
538
|
+
static fromJSON(json) {
|
|
539
|
+
const barcode = new Barcode();
|
|
540
|
+
barcode._symbology = json.symbology;
|
|
541
|
+
barcode._data = json.data;
|
|
542
|
+
barcode._rawData = json.rawData;
|
|
543
|
+
barcode._compositeData = json.compositeData;
|
|
544
|
+
barcode._compositeRawData = json.compositeRawData;
|
|
545
|
+
barcode._addOnData = json.addOnData === undefined ? null : json.addOnData;
|
|
546
|
+
barcode._isGS1DataCarrier = json.isGS1DataCarrier;
|
|
547
|
+
barcode._compositeFlag = json.compositeFlag;
|
|
548
|
+
barcode._isColorInverted = json.isColorInverted;
|
|
549
|
+
barcode._symbolCount = json.symbolCount;
|
|
550
|
+
barcode._frameID = json.frameId;
|
|
551
|
+
barcode._encodingRanges = json.encodingRanges.map(EncodingRange.fromJSON);
|
|
552
|
+
barcode._location = Quadrilateral.fromJSON(json.location);
|
|
553
|
+
barcode._structuredAppendData =
|
|
554
|
+
StructuredAppendData.fromJSON(json.structuredAppendData);
|
|
555
|
+
return barcode;
|
|
556
|
+
}
|
|
547
557
|
}
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
558
|
+
__decorate([
|
|
559
|
+
nameForSerialization('symbology')
|
|
560
|
+
], Barcode.prototype, "_symbology", void 0);
|
|
561
|
+
__decorate([
|
|
562
|
+
nameForSerialization('data')
|
|
563
|
+
], Barcode.prototype, "_data", void 0);
|
|
564
|
+
__decorate([
|
|
565
|
+
nameForSerialization('rawData')
|
|
566
|
+
], Barcode.prototype, "_rawData", void 0);
|
|
567
|
+
__decorate([
|
|
568
|
+
nameForSerialization('compositeData')
|
|
569
|
+
], Barcode.prototype, "_compositeData", void 0);
|
|
570
|
+
__decorate([
|
|
571
|
+
nameForSerialization('compositeRawData')
|
|
572
|
+
], Barcode.prototype, "_compositeRawData", void 0);
|
|
573
|
+
__decorate([
|
|
574
|
+
nameForSerialization('addOnData')
|
|
575
|
+
], Barcode.prototype, "_addOnData", void 0);
|
|
576
|
+
__decorate([
|
|
577
|
+
nameForSerialization('encodingRanges')
|
|
578
|
+
], Barcode.prototype, "_encodingRanges", void 0);
|
|
579
|
+
__decorate([
|
|
580
|
+
nameForSerialization('location')
|
|
581
|
+
], Barcode.prototype, "_location", void 0);
|
|
582
|
+
__decorate([
|
|
583
|
+
nameForSerialization('isGS1DataCarrier')
|
|
584
|
+
], Barcode.prototype, "_isGS1DataCarrier", void 0);
|
|
585
|
+
__decorate([
|
|
586
|
+
nameForSerialization('compositeFlag')
|
|
587
|
+
], Barcode.prototype, "_compositeFlag", void 0);
|
|
588
|
+
__decorate([
|
|
589
|
+
nameForSerialization('isColorInverted')
|
|
590
|
+
], Barcode.prototype, "_isColorInverted", void 0);
|
|
591
|
+
__decorate([
|
|
592
|
+
nameForSerialization('symbolCount')
|
|
593
|
+
], Barcode.prototype, "_symbolCount", void 0);
|
|
594
|
+
__decorate([
|
|
595
|
+
nameForSerialization('frameID')
|
|
596
|
+
], Barcode.prototype, "_frameID", void 0);
|
|
597
|
+
__decorate([
|
|
598
|
+
nameForSerialization('structuredAppendData')
|
|
599
|
+
], Barcode.prototype, "_structuredAppendData", void 0);
|
|
600
|
+
|
|
601
|
+
class TrackedBarcode {
|
|
602
|
+
constructor() {
|
|
603
|
+
/**
|
|
604
|
+
* @deprecated
|
|
605
|
+
*/
|
|
606
|
+
this._deltaTime = 0;
|
|
607
|
+
/**
|
|
608
|
+
* @deprecated
|
|
609
|
+
*/
|
|
610
|
+
this._predictedLocation = undefined;
|
|
611
|
+
}
|
|
612
|
+
get barcode() { return this._barcode; }
|
|
613
|
+
get location() { return this._location; }
|
|
614
|
+
get identifier() { return this._identifier; }
|
|
615
|
+
get sessionFrameSequenceID() {
|
|
616
|
+
return this._sessionFrameSequenceID;
|
|
617
|
+
}
|
|
618
|
+
/**
|
|
619
|
+
* @deprecated
|
|
620
|
+
*/
|
|
621
|
+
get deltaTime() {
|
|
622
|
+
return this._deltaTime;
|
|
623
|
+
}
|
|
624
|
+
/**
|
|
625
|
+
* @deprecated
|
|
626
|
+
*/
|
|
627
|
+
get predictedLocation() {
|
|
628
|
+
return this._predictedLocation;
|
|
629
|
+
}
|
|
630
|
+
get shouldAnimateFromPreviousToNextState() {
|
|
631
|
+
// tslint:disable-next-line:no-console
|
|
632
|
+
console.warn('shouldAnimateFromPreviousToNextState is deprecated and returns "false" when accessed');
|
|
633
|
+
return false;
|
|
634
|
+
}
|
|
635
|
+
static fromJSON(json, sessionFrameSequenceID) {
|
|
636
|
+
const trackedBarcode = new TrackedBarcode();
|
|
637
|
+
// The serialization returns the identifier as a string, not a number, which it originally is.
|
|
638
|
+
// This is because the identifier needs to be used as a key in a dictionary, which in JSON can only be a string.
|
|
639
|
+
// We can assume that it is a number in the string that we can safely parse.
|
|
640
|
+
trackedBarcode._identifier = parseInt(json.identifier, 10);
|
|
641
|
+
trackedBarcode._barcode = Barcode.fromJSON(json.barcode);
|
|
642
|
+
trackedBarcode._location = Quadrilateral.fromJSON(json.location);
|
|
643
|
+
trackedBarcode._sessionFrameSequenceID = sessionFrameSequenceID ? sessionFrameSequenceID : null;
|
|
644
|
+
trackedBarcode._deltaTime = json.deltaTime;
|
|
645
|
+
trackedBarcode._predictedLocation = trackedBarcode._location;
|
|
646
|
+
return trackedBarcode;
|
|
647
|
+
}
|
|
554
648
|
}
|
|
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
|
-
return settings;
|
|
587
|
-
}, {}),
|
|
588
|
-
};
|
|
589
|
-
return barcodePickDefaults;
|
|
649
|
+
|
|
650
|
+
var BatterySavingMode;
|
|
651
|
+
(function (BatterySavingMode) {
|
|
652
|
+
BatterySavingMode["On"] = "on";
|
|
653
|
+
BatterySavingMode["Off"] = "off";
|
|
654
|
+
BatterySavingMode["Auto"] = "auto";
|
|
655
|
+
})(BatterySavingMode || (BatterySavingMode = {}));
|
|
656
|
+
|
|
657
|
+
var CompositeFlag;
|
|
658
|
+
(function (CompositeFlag) {
|
|
659
|
+
CompositeFlag["None"] = "none";
|
|
660
|
+
CompositeFlag["Unknown"] = "unknown";
|
|
661
|
+
CompositeFlag["Linked"] = "linked";
|
|
662
|
+
CompositeFlag["GS1TypeA"] = "gs1TypeA";
|
|
663
|
+
CompositeFlag["GS1TypeB"] = "gs1TypeB";
|
|
664
|
+
CompositeFlag["GS1TypeC"] = "gs1TypeC";
|
|
665
|
+
})(CompositeFlag || (CompositeFlag = {}));
|
|
666
|
+
|
|
667
|
+
class LocalizedOnlyBarcode {
|
|
668
|
+
get location() {
|
|
669
|
+
return this._location;
|
|
670
|
+
}
|
|
671
|
+
get frameID() {
|
|
672
|
+
return this._frameID;
|
|
673
|
+
}
|
|
674
|
+
static fromJSON(json) {
|
|
675
|
+
const localizedBarcode = new LocalizedOnlyBarcode();
|
|
676
|
+
localizedBarcode._location = Quadrilateral.fromJSON(json.location);
|
|
677
|
+
localizedBarcode._frameID = json.frameId;
|
|
678
|
+
return localizedBarcode;
|
|
679
|
+
}
|
|
590
680
|
}
|
|
591
681
|
|
|
592
|
-
|
|
593
|
-
|
|
682
|
+
class TargetBarcode extends DefaultSerializeable {
|
|
683
|
+
get data() {
|
|
684
|
+
return this._data;
|
|
685
|
+
}
|
|
686
|
+
get quantity() {
|
|
687
|
+
return this._quantity;
|
|
688
|
+
}
|
|
689
|
+
static create(data, quantity) {
|
|
690
|
+
return new TargetBarcode(data, quantity);
|
|
691
|
+
}
|
|
692
|
+
static fromJSON(json) {
|
|
693
|
+
const data = json.data;
|
|
694
|
+
const quantity = json.quantity;
|
|
695
|
+
return TargetBarcode.create(data, quantity);
|
|
696
|
+
}
|
|
697
|
+
constructor(data, quantity) {
|
|
698
|
+
super();
|
|
699
|
+
this._data = data;
|
|
700
|
+
this._quantity = quantity;
|
|
701
|
+
}
|
|
594
702
|
}
|
|
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
|
-
textForTapShutterToResumeSearchHint: (_h = jsonDefaults.textForTapShutterToResumeSearchHint) !== null && _h !== void 0 ? _h : null,
|
|
621
|
-
torchControlPosition: jsonDefaults.torchControlPosition,
|
|
703
|
+
__decorate([
|
|
704
|
+
nameForSerialization('data')
|
|
705
|
+
], TargetBarcode.prototype, "_data", void 0);
|
|
706
|
+
__decorate([
|
|
707
|
+
nameForSerialization('quantity')
|
|
708
|
+
], TargetBarcode.prototype, "_quantity", void 0);
|
|
709
|
+
|
|
710
|
+
class BarcodeSpatialGrid extends DefaultSerializeable {
|
|
711
|
+
static fromJSON(json) {
|
|
712
|
+
const spatialGrid = new BarcodeSpatialGrid();
|
|
713
|
+
spatialGrid._rows = json.rows;
|
|
714
|
+
spatialGrid._columns = json.columns;
|
|
715
|
+
spatialGrid._grid = json.grid;
|
|
716
|
+
return spatialGrid;
|
|
717
|
+
}
|
|
718
|
+
get rows() {
|
|
719
|
+
return this._rows;
|
|
720
|
+
}
|
|
721
|
+
get columns() {
|
|
722
|
+
return this._columns;
|
|
723
|
+
}
|
|
724
|
+
barcodeAt(row, column) {
|
|
725
|
+
const barcodeJSON = this._grid[row][column];
|
|
726
|
+
if (barcodeJSON) {
|
|
727
|
+
return Barcode.fromJSON(barcodeJSON);
|
|
622
728
|
}
|
|
623
|
-
|
|
729
|
+
return null;
|
|
730
|
+
}
|
|
731
|
+
row(index) {
|
|
732
|
+
const barcodesJSON = this._grid[index];
|
|
733
|
+
if (barcodesJSON) {
|
|
734
|
+
return (barcodesJSON.map(Barcode.fromJSON));
|
|
735
|
+
}
|
|
736
|
+
return [];
|
|
737
|
+
}
|
|
738
|
+
column(index) {
|
|
739
|
+
const barcodesJSON = this._grid.map(barcodes => barcodes[index]);
|
|
740
|
+
if (barcodesJSON) {
|
|
741
|
+
return (barcodesJSON.map(Barcode.fromJSON));
|
|
742
|
+
}
|
|
743
|
+
return [];
|
|
744
|
+
}
|
|
624
745
|
}
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
746
|
+
__decorate([
|
|
747
|
+
nameForSerialization('rows')
|
|
748
|
+
], BarcodeSpatialGrid.prototype, "_rows", void 0);
|
|
749
|
+
__decorate([
|
|
750
|
+
nameForSerialization('columns')
|
|
751
|
+
], BarcodeSpatialGrid.prototype, "_columns", void 0);
|
|
752
|
+
__decorate([
|
|
753
|
+
nameForSerialization('grid')
|
|
754
|
+
], BarcodeSpatialGrid.prototype, "_grid", void 0);
|
|
755
|
+
|
|
756
|
+
class BarcodeCountSessionController {
|
|
757
|
+
get _proxy() {
|
|
758
|
+
return FactoryMaker.getInstance('BarcodeCountSessionProxy');
|
|
759
|
+
}
|
|
760
|
+
resetSession() {
|
|
761
|
+
return this._proxy.resetSession();
|
|
762
|
+
}
|
|
763
|
+
getSpatialMap() {
|
|
764
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
765
|
+
const barcodeSpatialGridJSON = yield this._proxy.getSpatialMap();
|
|
766
|
+
if (barcodeSpatialGridJSON) {
|
|
767
|
+
const payload = JSON.parse(barcodeSpatialGridJSON);
|
|
768
|
+
return BarcodeSpatialGrid.fromJSON(payload);
|
|
640
769
|
}
|
|
641
|
-
})
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
scanIntention: jsonDefaults.SparkScanSettings.scanIntention,
|
|
650
|
-
},
|
|
651
|
-
SparkScanView: {
|
|
652
|
-
shouldShowScanAreaGuides: jsonDefaults.SparkScanView.shouldShowScanAreaGuides,
|
|
653
|
-
brush: new Brush(Color.fromJSON(jsonDefaults.SparkScanView.brush.fillColor), Color.fromJSON(jsonDefaults.SparkScanView.brush.strokeColor), jsonDefaults.SparkScanView.brush.strokeWidth),
|
|
654
|
-
torchButtonVisible: jsonDefaults.SparkScanView.torchButtonVisible,
|
|
655
|
-
scanningBehaviorButtonVisible: jsonDefaults.SparkScanView.scanningBehaviorButtonVisible,
|
|
656
|
-
handModeButtonVisible: jsonDefaults.SparkScanView.handModeButtonVisible,
|
|
657
|
-
barcodeCountButtonVisible: jsonDefaults.SparkScanView.barcodeCountButtonVisible,
|
|
658
|
-
fastFindButtonVisible: jsonDefaults.SparkScanView.fastFindButtonVisible,
|
|
659
|
-
targetModeButtonVisible: jsonDefaults.SparkScanView.targetModeButtonVisible,
|
|
660
|
-
soundModeButtonVisible: jsonDefaults.SparkScanView.soundModeButtonVisible,
|
|
661
|
-
hapticModeButtonVisible: jsonDefaults.SparkScanView.hapticModeButtonVisible,
|
|
662
|
-
previewSizeControlVisible: jsonDefaults.SparkScanView.previewSizeControlVisible,
|
|
663
|
-
stopCapturingText: jsonDefaults.SparkScanView.stopCapturingText || null,
|
|
664
|
-
startCapturingText: jsonDefaults.SparkScanView.stopCapturingText || null,
|
|
665
|
-
resumeCapturingText: jsonDefaults.SparkScanView.resumeCapturingText || null,
|
|
666
|
-
scanningCapturingText: jsonDefaults.SparkScanView.scanningCapturingText || null,
|
|
667
|
-
targetModeHintText: jsonDefaults.SparkScanView.scanningCapturingText || null,
|
|
668
|
-
shouldShowTargetModeHint: jsonDefaults.SparkScanView.shouldShowTargetModeHint,
|
|
669
|
-
captureButtonBackgroundColor: jsonDefaults.SparkScanView.captureButtonBackgroundColor ? Color
|
|
670
|
-
.fromJSON(jsonDefaults.SparkScanView.captureButtonBackgroundColor) : null,
|
|
671
|
-
captureButtonActiveBackgroundColor: jsonDefaults.SparkScanView.captureButtonActiveBackgroundColor ? Color
|
|
672
|
-
.fromJSON(jsonDefaults.SparkScanView.captureButtonActiveBackgroundColor) : null,
|
|
673
|
-
captureButtonTintColor: jsonDefaults.SparkScanView.captureButtonTintColor ? Color
|
|
674
|
-
.fromJSON(jsonDefaults.SparkScanView.captureButtonTintColor) : null,
|
|
675
|
-
toolbarBackgroundColor: jsonDefaults.SparkScanView.toolbarBackgroundColor ? Color
|
|
676
|
-
.fromJSON(jsonDefaults.SparkScanView.toolbarBackgroundColor) : null,
|
|
677
|
-
toolbarIconActiveTintColor: jsonDefaults.SparkScanView.toolbarIconActiveTintColor ? Color
|
|
678
|
-
.fromJSON(jsonDefaults.SparkScanView.toolbarIconActiveTintColor) : null,
|
|
679
|
-
toolbarIconInactiveTintColor: jsonDefaults.SparkScanView.toolbarIconInactiveTintColor ? Color
|
|
680
|
-
.fromJSON(jsonDefaults.SparkScanView.toolbarIconInactiveTintColor) : null,
|
|
681
|
-
cameraSwitchButtonVisible: jsonDefaults.SparkScanView.cameraSwitchButtonVisible,
|
|
682
|
-
SparkScanViewSettings: {
|
|
683
|
-
triggerButtonCollapseTimeout: sparkScanViewSettingsDefaults.triggerButtonCollapseTimeout,
|
|
684
|
-
continuousCaptureTimeout: sparkScanViewSettingsDefaults.continuousCaptureTimeout,
|
|
685
|
-
defaultScanningMode: (fromJSON) => {
|
|
686
|
-
return fromJSON(JSON.parse(sparkScanViewSettingsDefaults.defaultScanningMode));
|
|
687
|
-
},
|
|
688
|
-
defaultTorchState: sparkScanViewSettingsDefaults.defaultTorchState,
|
|
689
|
-
soundEnabled: sparkScanViewSettingsDefaults.soundEnabled,
|
|
690
|
-
hapticEnabled: sparkScanViewSettingsDefaults.hapticEnabled,
|
|
691
|
-
defaultHandMode: sparkScanViewSettingsDefaults.defaultHandMode,
|
|
692
|
-
holdToScanEnabled: sparkScanViewSettingsDefaults.holdToScanEnabled,
|
|
693
|
-
hardwareTriggerEnabled: sparkScanViewSettingsDefaults.hardwareTriggerEnabled,
|
|
694
|
-
hardwareTriggerKeyCode: sparkScanViewSettingsDefaults.hardwareTriggerKeyCode,
|
|
695
|
-
visualFeedbackEnabled: sparkScanViewSettingsDefaults.visualFeedbackEnabled ? sparkScanViewSettingsDefaults.visualFeedbackEnabled : false,
|
|
696
|
-
toastSettings: {
|
|
697
|
-
toastEnabled: toastSettingsDefaults.toastEnabled,
|
|
698
|
-
toastBackgroundColor: toastSettingsDefaults.toastBackgroundColor ? Color
|
|
699
|
-
.fromJSON(toastSettingsDefaults.toastBackgroundColor) : null,
|
|
700
|
-
toastTextColor: toastSettingsDefaults.toastTextColor ? Color
|
|
701
|
-
.fromJSON(toastSettingsDefaults.toastTextColor) : null,
|
|
702
|
-
targetModeEnabledMessage: toastSettingsDefaults.targetModeEnabledMessage,
|
|
703
|
-
targetModeDisabledMessage: toastSettingsDefaults.targetModeEnabledMessage,
|
|
704
|
-
continuousModeEnabledMessage: toastSettingsDefaults.targetModeEnabledMessage,
|
|
705
|
-
continuousModeDisabledMessage: toastSettingsDefaults.targetModeEnabledMessage,
|
|
706
|
-
cameraTimeoutMessage: toastSettingsDefaults.targetModeEnabledMessage,
|
|
707
|
-
worldFacingCameraEnabledMessage: toastSettingsDefaults.targetModeEnabledMessage,
|
|
708
|
-
userFacingCameraEnabledMessage: toastSettingsDefaults.targetModeEnabledMessage,
|
|
709
|
-
scanPausedMessage: toastSettingsDefaults.targetModeEnabledMessage,
|
|
710
|
-
zoomedInMessage: toastSettingsDefaults.targetModeEnabledMessage,
|
|
711
|
-
zoomedOutMessage: toastSettingsDefaults.targetModeEnabledMessage,
|
|
712
|
-
torchEnabledMessage: toastSettingsDefaults.targetModeEnabledMessage,
|
|
713
|
-
torchDisabledMessage: toastSettingsDefaults.targetModeEnabledMessage,
|
|
714
|
-
},
|
|
715
|
-
targetZoomFactorOut: sparkScanViewSettingsDefaults.targetZoomFactorOut,
|
|
716
|
-
targetZoomFactorIn: sparkScanViewSettingsDefaults.targetZoomFactorIn,
|
|
717
|
-
zoomFactorOut: sparkScanViewSettingsDefaults.zoomFactorOut,
|
|
718
|
-
zoomFactorIn: sparkScanViewSettingsDefaults.zoomFactorIn,
|
|
719
|
-
inactiveStateTimeout: sparkScanViewSettingsDefaults.inactiveStateTimeout,
|
|
720
|
-
defaultCameraPosition: sparkScanViewSettingsDefaults.defaultCameraPosition,
|
|
770
|
+
});
|
|
771
|
+
}
|
|
772
|
+
getSpatialMapWithHints(expectedNumberOfRows, expectedNumberOfColumns) {
|
|
773
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
774
|
+
const barcodeSpatialGridJSON = yield this._proxy.getSpatialMapWithHints(expectedNumberOfRows, expectedNumberOfColumns);
|
|
775
|
+
if (barcodeSpatialGridJSON) {
|
|
776
|
+
const payload = JSON.parse(barcodeSpatialGridJSON);
|
|
777
|
+
return BarcodeSpatialGrid.fromJSON(payload);
|
|
721
778
|
}
|
|
722
|
-
}
|
|
723
|
-
};
|
|
724
|
-
return sparkScanDefaults;
|
|
725
|
-
}
|
|
726
|
-
|
|
727
|
-
function loadBarcodeDefaults(jsonDefaults) {
|
|
728
|
-
const barcodeDefaults = parseBarcodeDefaults(jsonDefaults);
|
|
729
|
-
FactoryMaker.bindInstanceIfNotExists('BarcodeDefaults', barcodeDefaults);
|
|
730
|
-
}
|
|
731
|
-
function loadBarcodeCaptureDefaults(jsonDefaults) {
|
|
732
|
-
const defaults = parseBarcodeCaptureDefaults(jsonDefaults);
|
|
733
|
-
FactoryMaker.bindInstanceIfNotExists('BarcodeCaptureDefaults', defaults);
|
|
734
|
-
}
|
|
735
|
-
function loadBarcodeCountDefaults(jsonDefaults) {
|
|
736
|
-
const defaults = parseBarcodeCountDefaults(jsonDefaults);
|
|
737
|
-
FactoryMaker.bindInstanceIfNotExists('BarcodeCountDefaults', defaults);
|
|
738
|
-
}
|
|
739
|
-
function loadBarcodePickDefaults(jsonDefaults) {
|
|
740
|
-
const defaults = parseBarcodePickDefaults(jsonDefaults);
|
|
741
|
-
FactoryMaker.bindInstanceIfNotExists('BarcodePickDefaults', defaults);
|
|
742
|
-
}
|
|
743
|
-
function loadBarcodeSelectionDefaults(jsonDefaults) {
|
|
744
|
-
const defaults = parseBarcodeSelectionDefaults(jsonDefaults);
|
|
745
|
-
FactoryMaker.bindInstanceIfNotExists('BarcodeSelectionDefaults', defaults);
|
|
746
|
-
}
|
|
747
|
-
function loadBarcodeTrackingDefaults(jsonDefaults) {
|
|
748
|
-
const defaults = parseBarcodeTrackingDefaults(jsonDefaults);
|
|
749
|
-
FactoryMaker.bindInstanceIfNotExists('BarcodeTrackingDefaults', defaults);
|
|
750
|
-
}
|
|
751
|
-
function loadSparkScanDefaults(jsonDefaults) {
|
|
752
|
-
const defaults = parseSparkScanDefaults(jsonDefaults);
|
|
753
|
-
FactoryMaker.bindInstanceIfNotExists('SparkScanDefaults', defaults);
|
|
754
|
-
}
|
|
755
|
-
function loadBarcodeFindDefaults(jsonDefaults) {
|
|
756
|
-
const defaults = parseBarcodeFindDefaults(jsonDefaults);
|
|
757
|
-
FactoryMaker.bindInstanceIfNotExists('BarcodeFindDefaults', defaults);
|
|
758
|
-
}
|
|
759
|
-
|
|
760
|
-
class EncodingRange {
|
|
761
|
-
get ianaName() { return this._ianaName; }
|
|
762
|
-
get startIndex() { return this._startIndex; }
|
|
763
|
-
get endIndex() { return this._endIndex; }
|
|
764
|
-
static fromJSON(json) {
|
|
765
|
-
const encodingRange = new EncodingRange();
|
|
766
|
-
encodingRange._ianaName = json.ianaName;
|
|
767
|
-
encodingRange._startIndex = json.startIndex;
|
|
768
|
-
encodingRange._endIndex = json.endIndex;
|
|
769
|
-
return encodingRange;
|
|
779
|
+
});
|
|
770
780
|
}
|
|
771
781
|
}
|
|
772
782
|
|
|
773
|
-
class
|
|
774
|
-
get isComplete() { return this._isComplete; }
|
|
775
|
-
get barcodeSetId() { return this._barcodeSetId; }
|
|
776
|
-
get scannedSegmentCount() { return this._scannedSegmentCount; }
|
|
777
|
-
get totalSegmentCount() { return this._totalSegmentCount; }
|
|
778
|
-
get encodingRanges() { return this._encodingRanges; }
|
|
779
|
-
get completeData() { return this._completeData; }
|
|
780
|
-
get rawCompleteData() { return this._rawCompleteData; }
|
|
783
|
+
class BarcodeCountSession extends DefaultSerializeable {
|
|
781
784
|
static fromJSON(json) {
|
|
782
|
-
const
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
structuredAppendData._rawCompleteData = json.completeDataRaw;
|
|
793
|
-
return structuredAppendData;
|
|
785
|
+
const session = new BarcodeCountSession();
|
|
786
|
+
session._frameSequenceID = json.frameSequenceId;
|
|
787
|
+
session._additionalBarcodes = json.additionalBarcodes;
|
|
788
|
+
session._recognizedBarcodes = {};
|
|
789
|
+
Object.entries(json.recognizedBarcodes)
|
|
790
|
+
.forEach(([key, value]) => {
|
|
791
|
+
const trackedBarcode = TrackedBarcode.fromJSON(value, session._frameSequenceID);
|
|
792
|
+
session._recognizedBarcodes[parseInt(key, 10)] = trackedBarcode;
|
|
793
|
+
});
|
|
794
|
+
return session;
|
|
794
795
|
}
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
get
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
get
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
get
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
barcode._isGS1DataCarrier = json.isGS1DataCarrier;
|
|
823
|
-
barcode._compositeFlag = json.compositeFlag;
|
|
824
|
-
barcode._isColorInverted = json.isColorInverted;
|
|
825
|
-
barcode._symbolCount = json.symbolCount;
|
|
826
|
-
barcode._frameID = json.frameId;
|
|
827
|
-
barcode._encodingRanges = json.encodingRanges.map(EncodingRange.fromJSON);
|
|
828
|
-
barcode._location = Quadrilateral.fromJSON(json.location);
|
|
829
|
-
barcode._structuredAppendData =
|
|
830
|
-
StructuredAppendData.fromJSON(json.structuredAppendData);
|
|
831
|
-
return barcode;
|
|
796
|
+
constructor() {
|
|
797
|
+
super();
|
|
798
|
+
this.sessionController = new BarcodeCountSessionController();
|
|
799
|
+
}
|
|
800
|
+
get recognizedBarcodes() {
|
|
801
|
+
return this._recognizedBarcodes;
|
|
802
|
+
}
|
|
803
|
+
get additionalBarcodes() {
|
|
804
|
+
return this._additionalBarcodes;
|
|
805
|
+
}
|
|
806
|
+
get frameSequenceID() {
|
|
807
|
+
return this._frameSequenceID;
|
|
808
|
+
}
|
|
809
|
+
reset() {
|
|
810
|
+
return this.sessionController.resetSession();
|
|
811
|
+
}
|
|
812
|
+
getSpatialMap() {
|
|
813
|
+
var _a;
|
|
814
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
815
|
+
return (_a = yield this.sessionController.getSpatialMap()) !== null && _a !== void 0 ? _a : null;
|
|
816
|
+
});
|
|
817
|
+
}
|
|
818
|
+
getSpatialMapWithHints(expectedNumberOfRows, expectedNumberOfColumns) {
|
|
819
|
+
var _a;
|
|
820
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
821
|
+
return (_a = yield this.sessionController.getSpatialMapWithHints(expectedNumberOfRows, expectedNumberOfColumns)) !== null && _a !== void 0 ? _a : null;
|
|
822
|
+
});
|
|
832
823
|
}
|
|
833
824
|
}
|
|
834
825
|
__decorate([
|
|
835
|
-
nameForSerialization('
|
|
836
|
-
],
|
|
826
|
+
nameForSerialization('recognizedBarcodes')
|
|
827
|
+
], BarcodeCountSession.prototype, "_recognizedBarcodes", void 0);
|
|
837
828
|
__decorate([
|
|
838
|
-
nameForSerialization('
|
|
839
|
-
],
|
|
829
|
+
nameForSerialization('additionalBarcodes')
|
|
830
|
+
], BarcodeCountSession.prototype, "_additionalBarcodes", void 0);
|
|
840
831
|
__decorate([
|
|
841
|
-
nameForSerialization('
|
|
842
|
-
],
|
|
843
|
-
__decorate([
|
|
844
|
-
nameForSerialization('compositeData')
|
|
845
|
-
], Barcode.prototype, "_compositeData", void 0);
|
|
846
|
-
__decorate([
|
|
847
|
-
nameForSerialization('compositeRawData')
|
|
848
|
-
], Barcode.prototype, "_compositeRawData", void 0);
|
|
849
|
-
__decorate([
|
|
850
|
-
nameForSerialization('addOnData')
|
|
851
|
-
], Barcode.prototype, "_addOnData", void 0);
|
|
852
|
-
__decorate([
|
|
853
|
-
nameForSerialization('encodingRanges')
|
|
854
|
-
], Barcode.prototype, "_encodingRanges", void 0);
|
|
855
|
-
__decorate([
|
|
856
|
-
nameForSerialization('location')
|
|
857
|
-
], Barcode.prototype, "_location", void 0);
|
|
858
|
-
__decorate([
|
|
859
|
-
nameForSerialization('isGS1DataCarrier')
|
|
860
|
-
], Barcode.prototype, "_isGS1DataCarrier", void 0);
|
|
861
|
-
__decorate([
|
|
862
|
-
nameForSerialization('compositeFlag')
|
|
863
|
-
], Barcode.prototype, "_compositeFlag", void 0);
|
|
864
|
-
__decorate([
|
|
865
|
-
nameForSerialization('isColorInverted')
|
|
866
|
-
], Barcode.prototype, "_isColorInverted", void 0);
|
|
867
|
-
__decorate([
|
|
868
|
-
nameForSerialization('symbolCount')
|
|
869
|
-
], Barcode.prototype, "_symbolCount", void 0);
|
|
870
|
-
__decorate([
|
|
871
|
-
nameForSerialization('frameID')
|
|
872
|
-
], Barcode.prototype, "_frameID", void 0);
|
|
832
|
+
nameForSerialization('frameSequenceID')
|
|
833
|
+
], BarcodeCountSession.prototype, "_frameSequenceID", void 0);
|
|
873
834
|
__decorate([
|
|
874
|
-
|
|
875
|
-
],
|
|
876
|
-
|
|
877
|
-
var BatterySavingMode;
|
|
878
|
-
(function (BatterySavingMode) {
|
|
879
|
-
BatterySavingMode["On"] = "on";
|
|
880
|
-
BatterySavingMode["Off"] = "off";
|
|
881
|
-
BatterySavingMode["Auto"] = "auto";
|
|
882
|
-
})(BatterySavingMode || (BatterySavingMode = {}));
|
|
883
|
-
|
|
884
|
-
var CompositeFlag;
|
|
885
|
-
(function (CompositeFlag) {
|
|
886
|
-
CompositeFlag["None"] = "none";
|
|
887
|
-
CompositeFlag["Unknown"] = "unknown";
|
|
888
|
-
CompositeFlag["Linked"] = "linked";
|
|
889
|
-
CompositeFlag["GS1TypeA"] = "gs1TypeA";
|
|
890
|
-
CompositeFlag["GS1TypeB"] = "gs1TypeB";
|
|
891
|
-
CompositeFlag["GS1TypeC"] = "gs1TypeC";
|
|
892
|
-
})(CompositeFlag || (CompositeFlag = {}));
|
|
835
|
+
ignoreFromSerialization
|
|
836
|
+
], BarcodeCountSession.prototype, "sessionController", void 0);
|
|
893
837
|
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
838
|
+
var BarcodeCountListenerEvents;
|
|
839
|
+
(function (BarcodeCountListenerEvents) {
|
|
840
|
+
BarcodeCountListenerEvents["inCallback"] = "BarcodeCountCaptureListListener.inCallback";
|
|
841
|
+
BarcodeCountListenerEvents["didListSessionUpdate"] = "BarcodeCountCaptureListListener.didUpdateSession";
|
|
842
|
+
BarcodeCountListenerEvents["didScan"] = "BarcodeCountListener.onScan";
|
|
843
|
+
})(BarcodeCountListenerEvents || (BarcodeCountListenerEvents = {}));
|
|
844
|
+
class BarcodeCountListenerController {
|
|
845
|
+
get _proxy() {
|
|
846
|
+
return FactoryMaker.getInstance('BarcodeCountListenerProxy');
|
|
900
847
|
}
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
localizedBarcode._location = Quadrilateral.fromJSON(json.location);
|
|
904
|
-
localizedBarcode._frameID = json.frameId;
|
|
905
|
-
return localizedBarcode;
|
|
848
|
+
constructor() {
|
|
849
|
+
this.eventEmitter = FactoryMaker.getInstance('EventEmitter');
|
|
906
850
|
}
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
return
|
|
851
|
+
static forBarcodeCount(barcodeCount) {
|
|
852
|
+
const controller = new BarcodeCountListenerController();
|
|
853
|
+
controller.barcodeCount = barcodeCount;
|
|
854
|
+
controller._proxy.isModeEnabled = () => barcodeCount.isEnabled;
|
|
855
|
+
return controller;
|
|
912
856
|
}
|
|
913
|
-
|
|
914
|
-
|
|
857
|
+
update() {
|
|
858
|
+
const barcodeCount = this.barcodeCount.toJSON();
|
|
859
|
+
const json = JSON.stringify(barcodeCount);
|
|
860
|
+
return this._proxy.updateMode(json);
|
|
915
861
|
}
|
|
916
|
-
|
|
917
|
-
return
|
|
862
|
+
reset() {
|
|
863
|
+
return this._proxy.resetBarcodeCount();
|
|
918
864
|
}
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
const quantity = json.quantity;
|
|
922
|
-
return TargetBarcode.create(data, quantity);
|
|
865
|
+
setModeEnabledState(enabled) {
|
|
866
|
+
this._proxy.setModeEnabledState(enabled);
|
|
923
867
|
}
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
this.
|
|
927
|
-
this.
|
|
868
|
+
subscribeListener() {
|
|
869
|
+
this._proxy.registerBarcodeCountListener();
|
|
870
|
+
this._proxy.subscribeDidScan();
|
|
871
|
+
this._proxy.subscribeDidListSessionUpdate();
|
|
872
|
+
this.eventEmitter.on(BarcodeCountListenerEvents.didScan, (body) => {
|
|
873
|
+
const payload = JSON.parse(body);
|
|
874
|
+
const session = BarcodeCountSession.fromJSON(JSON.parse(payload.session));
|
|
875
|
+
this.notifyListenersOfDidScanSession(session);
|
|
876
|
+
this._proxy.finishOnScan();
|
|
877
|
+
});
|
|
878
|
+
this.eventEmitter.on(BarcodeCountListenerEvents.didListSessionUpdate, (body) => {
|
|
879
|
+
const payload = JSON.parse(body);
|
|
880
|
+
const session = BarcodeCountCaptureListSession
|
|
881
|
+
.fromJSON(JSON.parse(payload.session));
|
|
882
|
+
this.notifyListenersOfDidListSessionUpdate(session);
|
|
883
|
+
});
|
|
928
884
|
}
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
__decorate([
|
|
934
|
-
nameForSerialization('quantity')
|
|
935
|
-
], TargetBarcode.prototype, "_quantity", void 0);
|
|
936
|
-
|
|
937
|
-
class TrackedBarcode {
|
|
938
|
-
constructor() {
|
|
939
|
-
/**
|
|
940
|
-
* @deprecated
|
|
941
|
-
*/
|
|
942
|
-
this._deltaTime = 0;
|
|
943
|
-
/**
|
|
944
|
-
* @deprecated
|
|
945
|
-
*/
|
|
946
|
-
this._predictedLocation = undefined;
|
|
885
|
+
unsubscribeListener() {
|
|
886
|
+
this._proxy.unregisterBarcodeCountListener();
|
|
887
|
+
this.eventEmitter.removeAllListeners(BarcodeCountListenerEvents.didScan);
|
|
888
|
+
this.eventEmitter.removeAllListeners(BarcodeCountListenerEvents.didListSessionUpdate);
|
|
947
889
|
}
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
get identifier() { return this._identifier; }
|
|
951
|
-
get sessionFrameSequenceID() {
|
|
952
|
-
return this._sessionFrameSequenceID;
|
|
890
|
+
startScanningPhase() {
|
|
891
|
+
this._proxy.startScanningPhase();
|
|
953
892
|
}
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
*/
|
|
957
|
-
get deltaTime() {
|
|
958
|
-
return this._deltaTime;
|
|
893
|
+
endScanningPhase() {
|
|
894
|
+
this._proxy.endScanningPhase();
|
|
959
895
|
}
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
get predictedLocation() {
|
|
964
|
-
return this._predictedLocation;
|
|
896
|
+
setBarcodeCountCaptureList(barcodeCountCaptureList) {
|
|
897
|
+
this._barcodeCountCaptureList = barcodeCountCaptureList;
|
|
898
|
+
this._proxy.setBarcodeCountCaptureList(JSON.stringify(barcodeCountCaptureList.targetBarcodes));
|
|
965
899
|
}
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
900
|
+
notifyListenersOfDidScanSession(session) {
|
|
901
|
+
const mode = this.barcodeCount;
|
|
902
|
+
mode.isInListenerCallback = true;
|
|
903
|
+
mode.listeners.forEach(listener => {
|
|
904
|
+
if (listener.didScan) {
|
|
905
|
+
listener.didScan(this.barcodeCount, session, CameraController.getLastFrame);
|
|
906
|
+
}
|
|
907
|
+
});
|
|
908
|
+
mode.isInListenerCallback = false;
|
|
970
909
|
}
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
trackedBarcode._deltaTime = json.deltaTime;
|
|
981
|
-
trackedBarcode._predictedLocation = trackedBarcode._location;
|
|
982
|
-
return trackedBarcode;
|
|
910
|
+
notifyListenersOfDidListSessionUpdate(session) {
|
|
911
|
+
var _a;
|
|
912
|
+
const mode = this.barcodeCount;
|
|
913
|
+
const barcodeCountCaptureListListener = (_a = this._barcodeCountCaptureList) === null || _a === void 0 ? void 0 : _a.listener;
|
|
914
|
+
mode.isInListenerCallback = true;
|
|
915
|
+
if (barcodeCountCaptureListListener && (barcodeCountCaptureListListener === null || barcodeCountCaptureListListener === void 0 ? void 0 : barcodeCountCaptureListListener.didUpdateSession)) {
|
|
916
|
+
barcodeCountCaptureListListener === null || barcodeCountCaptureListListener === void 0 ? void 0 : barcodeCountCaptureListListener.didUpdateSession(this._barcodeCountCaptureList, session);
|
|
917
|
+
}
|
|
918
|
+
mode.isInListenerCallback = false;
|
|
983
919
|
}
|
|
984
920
|
}
|
|
985
921
|
|
|
986
|
-
class
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
spatialGrid._rows = json.rows;
|
|
990
|
-
spatialGrid._columns = json.columns;
|
|
991
|
-
spatialGrid._grid = json.grid;
|
|
992
|
-
return spatialGrid;
|
|
922
|
+
class BarcodeCount extends DefaultSerializeable {
|
|
923
|
+
get isEnabled() {
|
|
924
|
+
return this._isEnabled;
|
|
993
925
|
}
|
|
994
|
-
|
|
995
|
-
|
|
926
|
+
set isEnabled(isEnabled) {
|
|
927
|
+
this._isEnabled = isEnabled;
|
|
928
|
+
this.listenerController.setModeEnabledState(isEnabled);
|
|
996
929
|
}
|
|
997
|
-
get
|
|
998
|
-
return this.
|
|
930
|
+
get context() {
|
|
931
|
+
return this._context;
|
|
999
932
|
}
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
if (barcodeJSON) {
|
|
1003
|
-
return Barcode.fromJSON(barcodeJSON);
|
|
1004
|
-
}
|
|
1005
|
-
return null;
|
|
933
|
+
get feedback() {
|
|
934
|
+
return this._feedback;
|
|
1006
935
|
}
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
return (barcodesJSON.map(Barcode.fromJSON));
|
|
1011
|
-
}
|
|
1012
|
-
return [];
|
|
936
|
+
set feedback(feedback) {
|
|
937
|
+
this._feedback = feedback;
|
|
938
|
+
this.didChange();
|
|
1013
939
|
}
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
if (barcodesJSON) {
|
|
1017
|
-
return (barcodesJSON.map(Barcode.fromJSON));
|
|
1018
|
-
}
|
|
1019
|
-
return [];
|
|
1020
|
-
}
|
|
1021
|
-
}
|
|
1022
|
-
__decorate([
|
|
1023
|
-
nameForSerialization('rows')
|
|
1024
|
-
], BarcodeSpatialGrid.prototype, "_rows", void 0);
|
|
1025
|
-
__decorate([
|
|
1026
|
-
nameForSerialization('columns')
|
|
1027
|
-
], BarcodeSpatialGrid.prototype, "_columns", void 0);
|
|
1028
|
-
__decorate([
|
|
1029
|
-
nameForSerialization('grid')
|
|
1030
|
-
], BarcodeSpatialGrid.prototype, "_grid", void 0);
|
|
1031
|
-
|
|
1032
|
-
class BarcodeCaptureSession {
|
|
1033
|
-
get newlyRecognizedBarcodes() {
|
|
1034
|
-
return this._newlyRecognizedBarcodes;
|
|
1035
|
-
}
|
|
1036
|
-
get newlyLocalizedBarcodes() {
|
|
1037
|
-
return this._newlyLocalizedBarcodes;
|
|
1038
|
-
}
|
|
1039
|
-
get frameSequenceID() {
|
|
1040
|
-
return this._frameSequenceID;
|
|
1041
|
-
}
|
|
1042
|
-
static fromJSON(json) {
|
|
1043
|
-
const session = new BarcodeCaptureSession();
|
|
1044
|
-
session._newlyRecognizedBarcodes = json.newlyRecognizedBarcodes
|
|
1045
|
-
.map(Barcode.fromJSON);
|
|
1046
|
-
session._newlyLocalizedBarcodes = json.newlyLocalizedBarcodes
|
|
1047
|
-
.map(LocalizedOnlyBarcode.fromJSON);
|
|
1048
|
-
session._frameSequenceID = json.frameSequenceId;
|
|
1049
|
-
return session;
|
|
1050
|
-
}
|
|
1051
|
-
reset() {
|
|
1052
|
-
return this.controller.reset();
|
|
1053
|
-
}
|
|
1054
|
-
}
|
|
1055
|
-
|
|
1056
|
-
var BarcodeCaptureListenerEvents;
|
|
1057
|
-
(function (BarcodeCaptureListenerEvents) {
|
|
1058
|
-
BarcodeCaptureListenerEvents["inCallback"] = "BarcodeCaptureListener.inCallback";
|
|
1059
|
-
BarcodeCaptureListenerEvents["didUpdateSession"] = "BarcodeCaptureListener.didUpdateSession";
|
|
1060
|
-
BarcodeCaptureListenerEvents["didScan"] = "BarcodeCaptureListener.didScan";
|
|
1061
|
-
})(BarcodeCaptureListenerEvents || (BarcodeCaptureListenerEvents = {}));
|
|
1062
|
-
class BarcodeCaptureListenerController {
|
|
1063
|
-
get _proxy() {
|
|
1064
|
-
return FactoryMaker.getInstance('BarcodeCaptureListenerProxy');
|
|
1065
|
-
}
|
|
1066
|
-
static forBarcodeCapture(barcodeCapture) {
|
|
1067
|
-
const controller = new BarcodeCaptureListenerController();
|
|
1068
|
-
controller.barcodeCapture = barcodeCapture;
|
|
1069
|
-
controller._proxy.isModeEnabled = () => barcodeCapture.isEnabled;
|
|
1070
|
-
return controller;
|
|
1071
|
-
}
|
|
1072
|
-
constructor() {
|
|
1073
|
-
this.eventEmitter = FactoryMaker.getInstance('EventEmitter');
|
|
1074
|
-
}
|
|
1075
|
-
reset() {
|
|
1076
|
-
return this._proxy.resetSession();
|
|
1077
|
-
}
|
|
1078
|
-
setModeEnabledState(enabled) {
|
|
1079
|
-
this._proxy.setModeEnabledState(enabled);
|
|
1080
|
-
}
|
|
1081
|
-
updateBarcodeCaptureMode() {
|
|
1082
|
-
return this._proxy.updateBarcodeCaptureMode(JSON.stringify(this.barcodeCapture.toJSON()));
|
|
1083
|
-
}
|
|
1084
|
-
applyBarcodeCaptureModeSettings(newSettings) {
|
|
1085
|
-
return this._proxy.applyBarcodeCaptureModeSettings(JSON.stringify(newSettings.toJSON()));
|
|
1086
|
-
}
|
|
1087
|
-
updateBarcodeCaptureOverlay(overlay) {
|
|
1088
|
-
return this._proxy.updateBarcodeCaptureOverlay(JSON.stringify(overlay.toJSON()));
|
|
1089
|
-
}
|
|
1090
|
-
subscribeListener() {
|
|
1091
|
-
var _a, _b, _c, _d;
|
|
1092
|
-
this._proxy.registerListenerForEvents();
|
|
1093
|
-
(_b = (_a = this._proxy).subscribeDidUpdateSessionListener) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
1094
|
-
(_d = (_c = this._proxy).subscribeDidScanListener) === null || _d === void 0 ? void 0 : _d.call(_c);
|
|
1095
|
-
this.eventEmitter.on(BarcodeCaptureListenerEvents.inCallback, (value) => {
|
|
1096
|
-
this.barcodeCapture.isInListenerCallback = value;
|
|
1097
|
-
});
|
|
1098
|
-
this.eventEmitter.on(BarcodeCaptureListenerEvents.didUpdateSession, (body) => {
|
|
1099
|
-
const payload = JSON.parse(body);
|
|
1100
|
-
const session = BarcodeCaptureSession.fromJSON(JSON.parse(payload.session));
|
|
1101
|
-
this.notifyListenersOfDidUpdateSession(session);
|
|
1102
|
-
this._proxy.finishDidUpdateSessionCallback(this.barcodeCapture.isEnabled);
|
|
1103
|
-
});
|
|
1104
|
-
this.eventEmitter.on(BarcodeCaptureListenerEvents.didScan, (body) => {
|
|
1105
|
-
const payload = JSON.parse(body);
|
|
1106
|
-
const session = BarcodeCaptureSession.fromJSON(JSON.parse(payload.session));
|
|
1107
|
-
this.notifyListenersOfDidScan(session);
|
|
1108
|
-
this._proxy.finishDidScanCallback(this.barcodeCapture.isEnabled);
|
|
1109
|
-
});
|
|
1110
|
-
}
|
|
1111
|
-
unsubscribeListener() {
|
|
1112
|
-
this._proxy.unregisterListenerForEvents();
|
|
1113
|
-
this.eventEmitter.removeAllListeners(BarcodeCaptureListenerEvents.inCallback);
|
|
1114
|
-
this.eventEmitter.removeAllListeners(BarcodeCaptureListenerEvents.didUpdateSession);
|
|
1115
|
-
this.eventEmitter.removeAllListeners(BarcodeCaptureListenerEvents.didScan);
|
|
1116
|
-
}
|
|
1117
|
-
notifyListenersOfDidUpdateSession(session) {
|
|
1118
|
-
const mode = this.barcodeCapture;
|
|
1119
|
-
mode.isInListenerCallback = true;
|
|
1120
|
-
mode.listeners.forEach(listener => {
|
|
1121
|
-
if (listener.didUpdateSession) {
|
|
1122
|
-
listener.didUpdateSession(this.barcodeCapture, session, CameraController.getLastFrame);
|
|
1123
|
-
}
|
|
1124
|
-
});
|
|
1125
|
-
mode.isInListenerCallback = false;
|
|
1126
|
-
}
|
|
1127
|
-
notifyListenersOfDidScan(session) {
|
|
1128
|
-
const mode = this.barcodeCapture;
|
|
1129
|
-
mode.isInListenerCallback = true;
|
|
1130
|
-
mode.listeners.forEach(listener => {
|
|
1131
|
-
if (listener.didScan) {
|
|
1132
|
-
listener.didScan(this.barcodeCapture, session, CameraController.getLastFrame);
|
|
1133
|
-
}
|
|
1134
|
-
});
|
|
1135
|
-
mode.isInListenerCallback = false;
|
|
1136
|
-
}
|
|
1137
|
-
}
|
|
1138
|
-
|
|
1139
|
-
class BarcodeCapture extends DefaultSerializeable {
|
|
1140
|
-
get isEnabled() {
|
|
1141
|
-
return this._isEnabled;
|
|
1142
|
-
}
|
|
1143
|
-
set isEnabled(isEnabled) {
|
|
1144
|
-
this._isEnabled = isEnabled;
|
|
1145
|
-
this.controller.setModeEnabledState(isEnabled);
|
|
1146
|
-
}
|
|
1147
|
-
get context() {
|
|
1148
|
-
return this._context;
|
|
1149
|
-
}
|
|
1150
|
-
get feedback() {
|
|
1151
|
-
return this._feedback;
|
|
1152
|
-
}
|
|
1153
|
-
set feedback(feedback) {
|
|
1154
|
-
this._feedback = feedback;
|
|
1155
|
-
this.controller.updateBarcodeCaptureMode();
|
|
1156
|
-
}
|
|
1157
|
-
static get recommendedCameraSettings() {
|
|
1158
|
-
return BarcodeCapture.barcodeCaptureDefaults.RecommendedCameraSettings;
|
|
1159
|
-
}
|
|
1160
|
-
get _context() {
|
|
1161
|
-
return this.privateContext;
|
|
940
|
+
get _context() {
|
|
941
|
+
return this.privateContext;
|
|
1162
942
|
}
|
|
1163
943
|
set _context(newContext) {
|
|
1164
|
-
if (newContext == null) {
|
|
1165
|
-
this.controller.unsubscribeListener();
|
|
1166
|
-
}
|
|
1167
|
-
else if (this.privateContext == null) {
|
|
1168
|
-
this.controller.subscribeListener();
|
|
1169
|
-
}
|
|
1170
944
|
this.privateContext = newContext;
|
|
1171
945
|
}
|
|
1172
|
-
static get barcodeCaptureDefaults() {
|
|
1173
|
-
return getBarcodeCaptureDefaults();
|
|
1174
|
-
}
|
|
1175
946
|
static forContext(context, settings) {
|
|
1176
|
-
const
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
return
|
|
947
|
+
const barcodeCount = new BarcodeCount();
|
|
948
|
+
barcodeCount.settings = settings;
|
|
949
|
+
return barcodeCount;
|
|
950
|
+
}
|
|
951
|
+
static get barcodeCountDefaults() {
|
|
952
|
+
return getBarcodeCountDefaults();
|
|
1182
953
|
}
|
|
1183
954
|
constructor() {
|
|
1184
955
|
super();
|
|
1185
|
-
this.type = '
|
|
956
|
+
this.type = 'barcodeCount';
|
|
957
|
+
this._feedback = BarcodeCountFeedback.default;
|
|
1186
958
|
this._isEnabled = true;
|
|
1187
|
-
this.privateContext = null;
|
|
1188
959
|
this.listeners = [];
|
|
960
|
+
this._additionalBarcodes = [];
|
|
1189
961
|
this.isInListenerCallback = false;
|
|
1190
|
-
this.
|
|
962
|
+
this.privateContext = null;
|
|
963
|
+
this.listenerController = BarcodeCountListenerController.forBarcodeCount(this);
|
|
1191
964
|
}
|
|
1192
965
|
applySettings(settings) {
|
|
1193
966
|
this.settings = settings;
|
|
1194
|
-
return this.
|
|
967
|
+
return this.didChange();
|
|
1195
968
|
}
|
|
1196
969
|
addListener(listener) {
|
|
970
|
+
this.checkAndSubscribeListeners();
|
|
1197
971
|
if (this.listeners.includes(listener)) {
|
|
1198
972
|
return;
|
|
1199
973
|
}
|
|
1200
974
|
this.listeners.push(listener);
|
|
1201
975
|
}
|
|
976
|
+
checkAndSubscribeListeners() {
|
|
977
|
+
if (this.listeners.length === 0) {
|
|
978
|
+
this.listenerController.subscribeListener();
|
|
979
|
+
}
|
|
980
|
+
}
|
|
1202
981
|
removeListener(listener) {
|
|
1203
982
|
if (!this.listeners.includes(listener)) {
|
|
1204
983
|
return;
|
|
1205
984
|
}
|
|
1206
|
-
this.listeners.splice(this.listeners.indexOf(listener)
|
|
985
|
+
this.listeners.splice(this.listeners.indexOf(listener));
|
|
986
|
+
this.checkAndUnsubscribeListeners();
|
|
987
|
+
}
|
|
988
|
+
checkAndUnsubscribeListeners() {
|
|
989
|
+
if (this.listeners.length === 0) {
|
|
990
|
+
this.listenerController.unsubscribeListener();
|
|
991
|
+
}
|
|
992
|
+
}
|
|
993
|
+
reset() {
|
|
994
|
+
return this.listenerController.reset();
|
|
995
|
+
}
|
|
996
|
+
startScanningPhase() {
|
|
997
|
+
this.listenerController.startScanningPhase();
|
|
998
|
+
}
|
|
999
|
+
endScanningPhase() {
|
|
1000
|
+
this.listenerController.endScanningPhase();
|
|
1001
|
+
}
|
|
1002
|
+
setBarcodeCountCaptureList(barcodeCountCaptureList) {
|
|
1003
|
+
this.listenerController.setBarcodeCountCaptureList(barcodeCountCaptureList);
|
|
1004
|
+
}
|
|
1005
|
+
setAdditionalBarcodes(barcodes) {
|
|
1006
|
+
this._additionalBarcodes = barcodes;
|
|
1007
|
+
return this.didChange();
|
|
1008
|
+
}
|
|
1009
|
+
clearAdditionalBarcodes() {
|
|
1010
|
+
this._additionalBarcodes = [];
|
|
1011
|
+
return this.didChange();
|
|
1012
|
+
}
|
|
1013
|
+
static get recommendedCameraSettings() {
|
|
1014
|
+
return BarcodeCount.barcodeCountDefaults.RecommendedCameraSettings;
|
|
1015
|
+
}
|
|
1016
|
+
didChange() {
|
|
1017
|
+
return this.listenerController.update();
|
|
1018
|
+
}
|
|
1019
|
+
unsubscribeNativeListeners() {
|
|
1020
|
+
this.listenerController.unsubscribeListener();
|
|
1207
1021
|
}
|
|
1208
1022
|
}
|
|
1209
|
-
__decorate([
|
|
1210
|
-
ignoreFromSerialization
|
|
1211
|
-
], BarcodeCapture.prototype, "_isEnabled", void 0);
|
|
1212
1023
|
__decorate([
|
|
1213
1024
|
nameForSerialization('feedback')
|
|
1214
|
-
],
|
|
1025
|
+
], BarcodeCount.prototype, "_feedback", void 0);
|
|
1215
1026
|
__decorate([
|
|
1216
1027
|
ignoreFromSerialization
|
|
1217
|
-
],
|
|
1028
|
+
], BarcodeCount.prototype, "_isEnabled", void 0);
|
|
1218
1029
|
__decorate([
|
|
1219
1030
|
ignoreFromSerialization
|
|
1220
|
-
],
|
|
1031
|
+
], BarcodeCount.prototype, "listeners", void 0);
|
|
1032
|
+
__decorate([
|
|
1033
|
+
nameForSerialization('additionalBarcodes')
|
|
1034
|
+
], BarcodeCount.prototype, "_additionalBarcodes", void 0);
|
|
1221
1035
|
__decorate([
|
|
1222
1036
|
ignoreFromSerialization
|
|
1223
|
-
],
|
|
1037
|
+
], BarcodeCount.prototype, "isInListenerCallback", void 0);
|
|
1224
1038
|
__decorate([
|
|
1225
1039
|
ignoreFromSerialization
|
|
1226
|
-
],
|
|
1040
|
+
], BarcodeCount.prototype, "privateContext", void 0);
|
|
1227
1041
|
__decorate([
|
|
1228
1042
|
ignoreFromSerialization
|
|
1229
|
-
],
|
|
1043
|
+
], BarcodeCount.prototype, "listenerController", void 0);
|
|
1044
|
+
__decorate([
|
|
1045
|
+
ignoreFromSerialization
|
|
1046
|
+
], BarcodeCount, "barcodeCountDefaults", null);
|
|
1230
1047
|
|
|
1231
|
-
class
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
this.success = Feedback.defaultFeedback;
|
|
1048
|
+
class BarcodeCountCaptureList {
|
|
1049
|
+
static create(listener, targetBarcodes) {
|
|
1050
|
+
return new BarcodeCountCaptureList(listener, targetBarcodes);
|
|
1235
1051
|
}
|
|
1236
|
-
|
|
1237
|
-
|
|
1052
|
+
constructor(listener, targetBarcodes) {
|
|
1053
|
+
this.listener = listener;
|
|
1054
|
+
this.targetBarcodes = targetBarcodes;
|
|
1238
1055
|
}
|
|
1239
1056
|
}
|
|
1240
1057
|
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1058
|
+
var BarcodeCountViewStyle;
|
|
1059
|
+
(function (BarcodeCountViewStyle) {
|
|
1060
|
+
BarcodeCountViewStyle["Icon"] = "icon";
|
|
1061
|
+
BarcodeCountViewStyle["Dot"] = "dot";
|
|
1062
|
+
})(BarcodeCountViewStyle || (BarcodeCountViewStyle = {}));
|
|
1063
|
+
|
|
1064
|
+
var BarcodeFilterHighlightType;
|
|
1065
|
+
(function (BarcodeFilterHighlightType) {
|
|
1066
|
+
BarcodeFilterHighlightType["Brush"] = "brush";
|
|
1067
|
+
})(BarcodeFilterHighlightType || (BarcodeFilterHighlightType = {}));
|
|
1068
|
+
|
|
1069
|
+
class BarcodeCountSettings extends DefaultSerializeable {
|
|
1070
|
+
static get barcodeCountDefaults() {
|
|
1071
|
+
return getBarcodeCountDefaults();
|
|
1244
1072
|
}
|
|
1245
|
-
static get
|
|
1246
|
-
|
|
1247
|
-
console.warn('defaultBrush is deprecated and will be removed in a future release. ' +
|
|
1248
|
-
'Use .brush to get the default for your selected style');
|
|
1249
|
-
return new Brush(BarcodeCaptureOverlay.barcodeCaptureDefaults.BarcodeCaptureOverlay.styles[BarcodeCaptureOverlay.barcodeCaptureDefaults.BarcodeCaptureOverlay.defaultStyle].DefaultBrush.fillColor, BarcodeCaptureOverlay.barcodeCaptureDefaults.BarcodeCaptureOverlay.styles[BarcodeCaptureOverlay.barcodeCaptureDefaults.BarcodeCaptureOverlay.defaultStyle].DefaultBrush.strokeColor, BarcodeCaptureOverlay.barcodeCaptureDefaults.BarcodeCaptureOverlay.styles[BarcodeCaptureOverlay.barcodeCaptureDefaults.BarcodeCaptureOverlay.defaultStyle].DefaultBrush.strokeWidth);
|
|
1073
|
+
static get barcodeDefaults() {
|
|
1074
|
+
return getBarcodeDefaults();
|
|
1250
1075
|
}
|
|
1251
|
-
|
|
1252
|
-
|
|
1076
|
+
constructor() {
|
|
1077
|
+
super();
|
|
1078
|
+
this.symbologies = {};
|
|
1079
|
+
this.properties = {};
|
|
1080
|
+
this._filterSettings = BarcodeCountSettings.barcodeCountDefaults.BarcodeCountSettings.barcodeFilterSettings;
|
|
1081
|
+
this._expectsOnlyUniqueBarcodes = BarcodeCountSettings.barcodeCountDefaults.BarcodeCountSettings.expectOnlyUniqueBarcodes;
|
|
1082
|
+
this._mappingEnabled = BarcodeCountSettings.barcodeCountDefaults.BarcodeCountSettings.mappingEnabled;
|
|
1253
1083
|
}
|
|
1254
|
-
|
|
1255
|
-
this.
|
|
1256
|
-
this.barcodeCapture.controller.updateBarcodeCaptureOverlay(this);
|
|
1084
|
+
get expectsOnlyUniqueBarcodes() {
|
|
1085
|
+
return this._expectsOnlyUniqueBarcodes;
|
|
1257
1086
|
}
|
|
1258
|
-
|
|
1259
|
-
|
|
1087
|
+
set expectsOnlyUniqueBarcodes(expectsOnlyUniqueBarcodes) {
|
|
1088
|
+
this._expectsOnlyUniqueBarcodes = expectsOnlyUniqueBarcodes;
|
|
1260
1089
|
}
|
|
1261
|
-
|
|
1262
|
-
this.
|
|
1263
|
-
if (newViewfinder) {
|
|
1264
|
-
this.eventEmitter.on('viewfinder.update', this.handleViewFinderUpdate);
|
|
1265
|
-
}
|
|
1266
|
-
else {
|
|
1267
|
-
this.eventEmitter.off('viewfinder.update');
|
|
1268
|
-
}
|
|
1269
|
-
this.barcodeCapture.controller.updateBarcodeCaptureOverlay(this);
|
|
1090
|
+
get mappingEnabled() {
|
|
1091
|
+
return this._mappingEnabled;
|
|
1270
1092
|
}
|
|
1271
|
-
|
|
1272
|
-
|
|
1093
|
+
set mappingEnabled(mappingEnabled) {
|
|
1094
|
+
this._mappingEnabled = mappingEnabled;
|
|
1273
1095
|
}
|
|
1274
|
-
|
|
1275
|
-
this.
|
|
1276
|
-
this.barcodeCapture.controller.updateBarcodeCaptureOverlay(this);
|
|
1096
|
+
get filterSettings() {
|
|
1097
|
+
return this._filterSettings;
|
|
1277
1098
|
}
|
|
1278
|
-
get
|
|
1279
|
-
return this.
|
|
1099
|
+
get enabledSymbologies() {
|
|
1100
|
+
return Object.keys(this.symbologies)
|
|
1101
|
+
.filter(symbology => this.symbologies[symbology].isEnabled);
|
|
1280
1102
|
}
|
|
1281
|
-
|
|
1282
|
-
|
|
1103
|
+
settingsForSymbology(symbology) {
|
|
1104
|
+
if (!this.symbologies[symbology]) {
|
|
1105
|
+
const symbologySettings = BarcodeCountSettings.barcodeDefaults.SymbologySettings[symbology];
|
|
1106
|
+
symbologySettings._symbology = symbology;
|
|
1107
|
+
this.symbologies[symbology] = symbologySettings;
|
|
1108
|
+
}
|
|
1109
|
+
return this.symbologies[symbology];
|
|
1283
1110
|
}
|
|
1284
|
-
|
|
1285
|
-
|
|
1111
|
+
enableSymbologies(symbologies) {
|
|
1112
|
+
symbologies.forEach(symbology => this.enableSymbology(symbology, true));
|
|
1286
1113
|
}
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
overlay.barcodeCapture = barcodeCapture;
|
|
1290
|
-
overlay._style = style;
|
|
1291
|
-
const barcodeCaptureOverlayDefaults = BarcodeCaptureOverlay.barcodeCaptureDefaults.BarcodeCaptureOverlay;
|
|
1292
|
-
const styles = barcodeCaptureOverlayDefaults.styles ? barcodeCaptureOverlayDefaults.styles : barcodeCaptureOverlayDefaults.Brushes;
|
|
1293
|
-
overlay._brush = new Brush(styles[style].DefaultBrush.fillColor, styles[style].DefaultBrush.strokeColor, styles[style].DefaultBrush.strokeWidth);
|
|
1294
|
-
if (view) {
|
|
1295
|
-
view.addOverlay(overlay);
|
|
1296
|
-
}
|
|
1297
|
-
return overlay;
|
|
1114
|
+
enableSymbology(symbology, enabled) {
|
|
1115
|
+
this.settingsForSymbology(symbology).isEnabled = enabled;
|
|
1298
1116
|
}
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
this.type = 'barcodeCapture';
|
|
1302
|
-
this._shouldShowScanAreaGuides = false;
|
|
1303
|
-
this._viewfinder = null;
|
|
1304
|
-
this._brush = BarcodeCaptureOverlay.barcodeCaptureDefaults.BarcodeCaptureOverlay.DefaultBrush;
|
|
1305
|
-
this.eventEmitter = FactoryMaker.getInstance('EventEmitter');
|
|
1306
|
-
this.handleViewFinderUpdate = this.handleViewFinderUpdate.bind(this);
|
|
1117
|
+
setProperty(name, value) {
|
|
1118
|
+
this.properties[name] = value;
|
|
1307
1119
|
}
|
|
1308
|
-
|
|
1309
|
-
this.
|
|
1120
|
+
getProperty(name) {
|
|
1121
|
+
return this.properties[name];
|
|
1310
1122
|
}
|
|
1311
1123
|
}
|
|
1312
1124
|
__decorate([
|
|
1313
|
-
|
|
1314
|
-
],
|
|
1315
|
-
__decorate([
|
|
1316
|
-
ignoreFromSerialization
|
|
1317
|
-
], BarcodeCaptureOverlay.prototype, "view", void 0);
|
|
1318
|
-
__decorate([
|
|
1319
|
-
nameForSerialization('shouldShowScanAreaGuides')
|
|
1320
|
-
], BarcodeCaptureOverlay.prototype, "_shouldShowScanAreaGuides", void 0);
|
|
1125
|
+
nameForSerialization('filterSettings')
|
|
1126
|
+
], BarcodeCountSettings.prototype, "_filterSettings", void 0);
|
|
1321
1127
|
__decorate([
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
], BarcodeCaptureOverlay.prototype, "_viewfinder", void 0);
|
|
1128
|
+
nameForSerialization('expectsOnlyUniqueBarcodes')
|
|
1129
|
+
], BarcodeCountSettings.prototype, "_expectsOnlyUniqueBarcodes", void 0);
|
|
1325
1130
|
__decorate([
|
|
1326
|
-
nameForSerialization('
|
|
1327
|
-
],
|
|
1131
|
+
nameForSerialization('mappingEnabled')
|
|
1132
|
+
], BarcodeCountSettings.prototype, "_mappingEnabled", void 0);
|
|
1328
1133
|
__decorate([
|
|
1329
1134
|
ignoreFromSerialization
|
|
1330
|
-
],
|
|
1135
|
+
], BarcodeCountSettings, "barcodeCountDefaults", null);
|
|
1331
1136
|
__decorate([
|
|
1332
|
-
|
|
1333
|
-
],
|
|
1137
|
+
ignoreFromSerialization
|
|
1138
|
+
], BarcodeCountSettings, "barcodeDefaults", null);
|
|
1139
|
+
|
|
1140
|
+
class BarcodeCountToolbarSettings extends DefaultSerializeable {
|
|
1141
|
+
constructor() {
|
|
1142
|
+
super(...arguments);
|
|
1143
|
+
this.audioOnButtonText = BarcodeCountToolbarSettings.barcodeCountDefaults.BarcodeCountView.toolbarSettings.audioOnButtonText;
|
|
1144
|
+
this.audioOffButtonText = BarcodeCountToolbarSettings.barcodeCountDefaults.BarcodeCountView.toolbarSettings.audioOffButtonText;
|
|
1145
|
+
this.audioButtonContentDescription = BarcodeCountToolbarSettings.barcodeCountDefaults.BarcodeCountView.toolbarSettings.audioButtonContentDescription;
|
|
1146
|
+
this.audioButtonAccessibilityHint = BarcodeCountToolbarSettings.barcodeCountDefaults.BarcodeCountView.toolbarSettings.audioButtonAccessibilityHint;
|
|
1147
|
+
this.audioButtonAccessibilityLabel = BarcodeCountToolbarSettings.barcodeCountDefaults.BarcodeCountView.toolbarSettings.audioButtonAccessibilityLabel;
|
|
1148
|
+
this.vibrationOnButtonText = BarcodeCountToolbarSettings.barcodeCountDefaults.BarcodeCountView.toolbarSettings.vibrationOnButtonText;
|
|
1149
|
+
this.vibrationOffButtonText = BarcodeCountToolbarSettings.barcodeCountDefaults.BarcodeCountView.toolbarSettings.vibrationOffButtonText;
|
|
1150
|
+
this.vibrationButtonContentDescription = BarcodeCountToolbarSettings.barcodeCountDefaults.BarcodeCountView.toolbarSettings.vibrationButtonContentDescription;
|
|
1151
|
+
this.vibrationButtonAccessibilityHint = BarcodeCountToolbarSettings.barcodeCountDefaults.BarcodeCountView.toolbarSettings.vibrationButtonAccessibilityHint;
|
|
1152
|
+
this.vibrationButtonAccessibilityLabel = BarcodeCountToolbarSettings.barcodeCountDefaults.BarcodeCountView.toolbarSettings.vibrationButtonAccessibilityLabel;
|
|
1153
|
+
this.strapModeOnButtonText = BarcodeCountToolbarSettings.barcodeCountDefaults.BarcodeCountView.toolbarSettings.strapModeOnButtonText;
|
|
1154
|
+
this.strapModeOffButtonText = BarcodeCountToolbarSettings.barcodeCountDefaults.BarcodeCountView.toolbarSettings.strapModeOffButtonText;
|
|
1155
|
+
this.strapModeButtonContentDescription = BarcodeCountToolbarSettings.barcodeCountDefaults.BarcodeCountView.toolbarSettings.strapModeButtonContentDescription;
|
|
1156
|
+
this.strapModeButtonAccessibilityHint = BarcodeCountToolbarSettings.barcodeCountDefaults.BarcodeCountView.toolbarSettings.strapModeButtonAccessibilityHint;
|
|
1157
|
+
this.strapModeButtonAccessibilityLabel = BarcodeCountToolbarSettings.barcodeCountDefaults.BarcodeCountView.toolbarSettings.strapModeButtonAccessibilityLabel;
|
|
1158
|
+
this.colorSchemeOnButtonText = BarcodeCountToolbarSettings.barcodeCountDefaults.BarcodeCountView.toolbarSettings.colorSchemeOnButtonText;
|
|
1159
|
+
this.colorSchemeOffButtonText = BarcodeCountToolbarSettings.barcodeCountDefaults.BarcodeCountView.toolbarSettings.colorSchemeOffButtonText;
|
|
1160
|
+
this.colorSchemeButtonContentDescription = BarcodeCountToolbarSettings.barcodeCountDefaults.BarcodeCountView.toolbarSettings.colorSchemeButtonContentDescription;
|
|
1161
|
+
this.colorSchemeButtonAccessibilityHint = BarcodeCountToolbarSettings.barcodeCountDefaults.BarcodeCountView.toolbarSettings.colorSchemeButtonAccessibilityHint;
|
|
1162
|
+
this.colorSchemeButtonAccessibilityLabel = BarcodeCountToolbarSettings.barcodeCountDefaults.BarcodeCountView.toolbarSettings.colorSchemeButtonAccessibilityLabel;
|
|
1163
|
+
}
|
|
1164
|
+
static get barcodeCountDefaults() {
|
|
1165
|
+
return getBarcodeCountDefaults();
|
|
1166
|
+
}
|
|
1167
|
+
}
|
|
1334
1168
|
__decorate([
|
|
1335
1169
|
ignoreFromSerialization
|
|
1336
|
-
],
|
|
1170
|
+
], BarcodeCountToolbarSettings, "barcodeCountDefaults", null);
|
|
1337
1171
|
|
|
1338
|
-
var
|
|
1339
|
-
(function (
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1172
|
+
var BarcodeCountViewEvents;
|
|
1173
|
+
(function (BarcodeCountViewEvents) {
|
|
1174
|
+
BarcodeCountViewEvents["singleScanButtonTapped"] = "BarcodeCountViewUiListener.onSingleScanButtonTapped";
|
|
1175
|
+
BarcodeCountViewEvents["listButtonTapped"] = "BarcodeCountViewUiListener.onListButtonTapped";
|
|
1176
|
+
BarcodeCountViewEvents["exitButtonTapped"] = "BarcodeCountViewUiListener.onExitButtonTapped";
|
|
1177
|
+
BarcodeCountViewEvents["brushForRecognizedBarcode"] = "BarcodeCountViewListener.brushForRecognizedBarcode";
|
|
1178
|
+
BarcodeCountViewEvents["brushForRecognizedBarcodeNotInList"] = "BarcodeCountViewListener.brushForRecognizedBarcodeNotInList";
|
|
1179
|
+
BarcodeCountViewEvents["brushForUnrecognizedBarcode"] = "BarcodeCountViewListener.brushForUnrecognizedBarcode";
|
|
1180
|
+
BarcodeCountViewEvents["filteredBarcodeTapped"] = "BarcodeCountViewListener.didTapFilteredBarcode";
|
|
1181
|
+
BarcodeCountViewEvents["recognizedBarcodeNotInListTapped"] = "BarcodeCountViewListener.didTapRecognizedBarcodeNotInList";
|
|
1182
|
+
BarcodeCountViewEvents["recognizedBarcodeTapped"] = "BarcodeCountViewListener.didTapRecognizedBarcode";
|
|
1183
|
+
BarcodeCountViewEvents["unrecognizedBarcodeTapped"] = "BarcodeCountViewListener.didTapUnrecognizedBarcode";
|
|
1184
|
+
BarcodeCountViewEvents["captureListCompleted"] = "BarcodeCountViewListener.didCompleteCaptureList";
|
|
1185
|
+
})(BarcodeCountViewEvents || (BarcodeCountViewEvents = {}));
|
|
1343
1186
|
|
|
1344
|
-
class
|
|
1345
|
-
|
|
1346
|
-
return
|
|
1347
|
-
.filter(symbology => this.symbologies[symbology].isEnabled);
|
|
1348
|
-
}
|
|
1349
|
-
get compositeTypeDescriptions() {
|
|
1350
|
-
return BarcodeCaptureSettings.barcodeDefaults.CompositeTypeDescriptions.reduce((descriptions, description) => {
|
|
1351
|
-
descriptions[description.types[0]] = description;
|
|
1352
|
-
return descriptions;
|
|
1353
|
-
}, {});
|
|
1187
|
+
class BarcodeFilterHighlightSettingsBrush extends DefaultSerializeable {
|
|
1188
|
+
static create(brush) {
|
|
1189
|
+
return new BarcodeFilterHighlightSettingsBrush(brush);
|
|
1354
1190
|
}
|
|
1355
|
-
|
|
1356
|
-
|
|
1191
|
+
constructor(brush) {
|
|
1192
|
+
super();
|
|
1193
|
+
this._brush = null;
|
|
1194
|
+
this._highlightType = BarcodeFilterHighlightType.Brush;
|
|
1195
|
+
this._brush = brush;
|
|
1357
1196
|
}
|
|
1358
|
-
|
|
1359
|
-
return
|
|
1197
|
+
get highlightType() {
|
|
1198
|
+
return this._highlightType;
|
|
1360
1199
|
}
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
this.locationSelection = null;
|
|
1364
|
-
this.enabledCompositeTypes = [];
|
|
1365
|
-
this.properties = {};
|
|
1366
|
-
this.symbologies = {};
|
|
1367
|
-
this._codeDuplicateFilter = BarcodeCaptureSettings.barcodeCaptureDefaults.BarcodeCaptureSettings.codeDuplicateFilter;
|
|
1368
|
-
this._arucoDictionary = null;
|
|
1369
|
-
this.batterySavingMode = BarcodeCaptureSettings.barcodeCaptureDefaults.BarcodeCaptureSettings.batterySavingMode;
|
|
1370
|
-
this.scanIntention = BarcodeCaptureSettings.barcodeCaptureDefaults.BarcodeCaptureSettings.scanIntention;
|
|
1200
|
+
get brush() {
|
|
1201
|
+
return this._brush;
|
|
1371
1202
|
}
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1203
|
+
}
|
|
1204
|
+
__decorate([
|
|
1205
|
+
nameForSerialization('highlightType')
|
|
1206
|
+
], BarcodeFilterHighlightSettingsBrush.prototype, "_highlightType", void 0);
|
|
1207
|
+
__decorate([
|
|
1208
|
+
nameForSerialization('brush')
|
|
1209
|
+
], BarcodeFilterHighlightSettingsBrush.prototype, "_brush", void 0);
|
|
1210
|
+
|
|
1211
|
+
class BarcodeFilterSettings extends DefaultSerializeable {
|
|
1212
|
+
get excludeEan13() {
|
|
1213
|
+
return this._excludeEan13;
|
|
1379
1214
|
}
|
|
1380
|
-
|
|
1381
|
-
this.
|
|
1215
|
+
set excludeEan13(value) {
|
|
1216
|
+
this._excludeEan13 = value;
|
|
1382
1217
|
}
|
|
1383
|
-
|
|
1384
|
-
return this.
|
|
1218
|
+
get excludeUpca() {
|
|
1219
|
+
return this._excludeUpca;
|
|
1385
1220
|
}
|
|
1386
|
-
|
|
1387
|
-
|
|
1221
|
+
set excludeUpca(value) {
|
|
1222
|
+
this._excludeUpca = value;
|
|
1388
1223
|
}
|
|
1389
|
-
|
|
1390
|
-
this.
|
|
1224
|
+
get excludedCodesRegex() {
|
|
1225
|
+
return this._excludedCodesRegex;
|
|
1391
1226
|
}
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
this.enableSymbologies(this.compositeTypeDescriptions[compositeType].symbologies);
|
|
1395
|
-
});
|
|
1227
|
+
set excludedCodesRegex(value) {
|
|
1228
|
+
this._excludedCodesRegex = value;
|
|
1396
1229
|
}
|
|
1397
|
-
|
|
1398
|
-
this.
|
|
1230
|
+
get excludedSymbologies() {
|
|
1231
|
+
return this._excludedSymbologies;
|
|
1399
1232
|
}
|
|
1400
|
-
|
|
1401
|
-
|
|
1233
|
+
set excludedSymbologies(values) {
|
|
1234
|
+
this._excludedSymbologies = values;
|
|
1402
1235
|
}
|
|
1403
|
-
|
|
1404
|
-
|
|
1236
|
+
static fromJSON(json) {
|
|
1237
|
+
const excludeEan13 = json.excludeEan13;
|
|
1238
|
+
const excludeUpca = json.excludeUpca;
|
|
1239
|
+
const excludedCodesRegex = json.excludedCodesRegex;
|
|
1240
|
+
const excludedSymbologies = json.excludedSymbologies;
|
|
1241
|
+
const excludedSymbolCounts = json.excludedSymbolCounts;
|
|
1242
|
+
return new BarcodeFilterSettings(excludeEan13, excludeUpca, excludedCodesRegex, excludedSymbolCounts, excludedSymbologies);
|
|
1405
1243
|
}
|
|
1244
|
+
constructor(excludeEan13, excludeUpca, excludedCodesRegex, excludedSymbolCounts, excludedSymbologies) {
|
|
1245
|
+
super();
|
|
1246
|
+
this._excludeEan13 = false;
|
|
1247
|
+
this._excludeUpca = false;
|
|
1248
|
+
this._excludedCodesRegex = '';
|
|
1249
|
+
this._excludedSymbolCounts = {};
|
|
1250
|
+
this._excludedSymbologies = [];
|
|
1251
|
+
this.excludeEan13 = excludeEan13;
|
|
1252
|
+
this.excludeUpca = excludeUpca;
|
|
1253
|
+
this.excludedCodesRegex = excludedCodesRegex;
|
|
1254
|
+
this._excludedSymbolCounts = excludedSymbolCounts;
|
|
1255
|
+
this.excludedSymbologies = excludedSymbologies;
|
|
1256
|
+
}
|
|
1257
|
+
getExcludedSymbolCountsForSymbology(symbology) {
|
|
1258
|
+
return this._excludedSymbolCounts[symbology] || [];
|
|
1259
|
+
}
|
|
1260
|
+
setExcludedSymbolCounts(excludedSymbolCounts, symbology) {
|
|
1261
|
+
this._excludedSymbolCounts[symbology] = excludedSymbolCounts;
|
|
1262
|
+
}
|
|
1263
|
+
}
|
|
1264
|
+
__decorate([
|
|
1265
|
+
nameForSerialization('excludeEan13')
|
|
1266
|
+
], BarcodeFilterSettings.prototype, "_excludeEan13", void 0);
|
|
1267
|
+
__decorate([
|
|
1268
|
+
nameForSerialization('excludeUpca')
|
|
1269
|
+
], BarcodeFilterSettings.prototype, "_excludeUpca", void 0);
|
|
1270
|
+
__decorate([
|
|
1271
|
+
nameForSerialization('excludedCodesRegex')
|
|
1272
|
+
], BarcodeFilterSettings.prototype, "_excludedCodesRegex", void 0);
|
|
1273
|
+
__decorate([
|
|
1274
|
+
nameForSerialization('excludedSymbolCounts')
|
|
1275
|
+
], BarcodeFilterSettings.prototype, "_excludedSymbolCounts", void 0);
|
|
1276
|
+
__decorate([
|
|
1277
|
+
nameForSerialization('excludedSymbologies')
|
|
1278
|
+
], BarcodeFilterSettings.prototype, "_excludedSymbologies", void 0);
|
|
1279
|
+
|
|
1280
|
+
function getBarcodeCountDefaults() {
|
|
1281
|
+
return FactoryMaker.getInstance('BarcodeCountDefaults');
|
|
1282
|
+
}
|
|
1283
|
+
function parseBarcodeCountToolbarDefaults(jsonDefaults) {
|
|
1284
|
+
const barcodeCountToolbarSettingsDefault = {
|
|
1285
|
+
audioOnButtonText: jsonDefaults.audioOnButtonText,
|
|
1286
|
+
audioOffButtonText: jsonDefaults.audioOffButtonText,
|
|
1287
|
+
audioButtonContentDescription: jsonDefaults.audioButtonContentDescription,
|
|
1288
|
+
audioButtonAccessibilityHint: jsonDefaults.audioButtonAccessibilityHint,
|
|
1289
|
+
audioButtonAccessibilityLabel: jsonDefaults.audioButtonAccessibilityLabel,
|
|
1290
|
+
vibrationOnButtonText: jsonDefaults.vibrationOnButtonText,
|
|
1291
|
+
vibrationOffButtonText: jsonDefaults.vibrationOffButtonText,
|
|
1292
|
+
vibrationButtonContentDescription: jsonDefaults.vibrationButtonContentDescription,
|
|
1293
|
+
vibrationButtonAccessibilityHint: jsonDefaults.vibrationButtonAccessibilityHint,
|
|
1294
|
+
vibrationButtonAccessibilityLabel: jsonDefaults.vibrationButtonAccessibilityLabel,
|
|
1295
|
+
strapModeOnButtonText: jsonDefaults.strapModeOnButtonText,
|
|
1296
|
+
strapModeOffButtonText: jsonDefaults.strapModeOffButtonText,
|
|
1297
|
+
strapModeButtonContentDescription: jsonDefaults.strapModeButtonContentDescription,
|
|
1298
|
+
strapModeButtonAccessibilityHint: jsonDefaults.strapModeButtonAccessibilityHint,
|
|
1299
|
+
strapModeButtonAccessibilityLabel: jsonDefaults.strapModeButtonAccessibilityLabel,
|
|
1300
|
+
colorSchemeOnButtonText: jsonDefaults.colorSchemeOnButtonText,
|
|
1301
|
+
colorSchemeOffButtonText: jsonDefaults.colorSchemeOffButtonText,
|
|
1302
|
+
colorSchemeButtonContentDescription: jsonDefaults.colorSchemeButtonContentDescription,
|
|
1303
|
+
colorSchemeButtonAccessibilityHint: jsonDefaults.colorSchemeButtonAccessibilityHint,
|
|
1304
|
+
colorSchemeButtonAccessibilityLabel: jsonDefaults.colorSchemeButtonAccessibilityLabel,
|
|
1305
|
+
};
|
|
1306
|
+
return barcodeCountToolbarSettingsDefault;
|
|
1307
|
+
}
|
|
1308
|
+
function parseBarcodeCountDefaults(jsonDefaults) {
|
|
1309
|
+
const viewJsonDefaults = jsonDefaults.BarcodeCountView;
|
|
1310
|
+
const toolbarJsonDefaults = viewJsonDefaults.toolbarSettings;
|
|
1311
|
+
const barcodeCountDefaults = {
|
|
1312
|
+
RecommendedCameraSettings: CameraSettings
|
|
1313
|
+
.fromJSON(jsonDefaults.RecommendedCameraSettings),
|
|
1314
|
+
Feedback: {
|
|
1315
|
+
success: Feedback.fromJSON(JSON.parse(jsonDefaults.BarcodeCountFeedback).success),
|
|
1316
|
+
failure: Feedback.fromJSON(JSON.parse(jsonDefaults.BarcodeCountFeedback).failure)
|
|
1317
|
+
},
|
|
1318
|
+
BarcodeCountSettings: {
|
|
1319
|
+
expectOnlyUniqueBarcodes: jsonDefaults.BarcodeCountSettings.expectOnlyUniqueBarcodes,
|
|
1320
|
+
disableModeWhenCaptureListCompleted: jsonDefaults.BarcodeCountSettings.disableModeWhenCaptureListCompleted,
|
|
1321
|
+
barcodeFilterSettings: BarcodeFilterSettings
|
|
1322
|
+
.fromJSON(jsonDefaults.BarcodeCountSettings.BarcodeFilterSettings),
|
|
1323
|
+
mappingEnabled: jsonDefaults.BarcodeCountSettings.mappingEnabled
|
|
1324
|
+
},
|
|
1325
|
+
BarcodeCountView: {
|
|
1326
|
+
style: viewJsonDefaults.style,
|
|
1327
|
+
shouldDisableModeOnExitButtonTapped: viewJsonDefaults.shouldDisableModeOnExitButtonTapped,
|
|
1328
|
+
shouldShowUserGuidanceView: viewJsonDefaults.shouldShowUserGuidanceView,
|
|
1329
|
+
shouldShowListButton: viewJsonDefaults.shouldShowListButton,
|
|
1330
|
+
shouldShowExitButton: viewJsonDefaults.shouldShowExitButton,
|
|
1331
|
+
shouldShowShutterButton: viewJsonDefaults.shouldShowShutterButton,
|
|
1332
|
+
shouldShowHints: viewJsonDefaults.shouldShowHints,
|
|
1333
|
+
shouldShowClearHighlightsButton: viewJsonDefaults.shouldShowClearHighlightsButton,
|
|
1334
|
+
shouldShowSingleScanButton: viewJsonDefaults.shouldShowSingleScanButton,
|
|
1335
|
+
shouldShowFloatingShutterButton: viewJsonDefaults.shouldShowFloatingShutterButton,
|
|
1336
|
+
shouldShowToolbar: viewJsonDefaults.shouldShowToolbar,
|
|
1337
|
+
defaultNotInListBrush: viewJsonDefaults.defaultNotInListBrush,
|
|
1338
|
+
defaultRecognizedBrush: viewJsonDefaults.defaultRecognizedBrush,
|
|
1339
|
+
defaultUnrecognizedBrush: viewJsonDefaults.defaultUnrecognizedBrush,
|
|
1340
|
+
shouldShowScanAreaGuides: viewJsonDefaults.shouldShowScanAreaGuides,
|
|
1341
|
+
clearHighlightsButtonText: viewJsonDefaults.clearHighlightsButtonText,
|
|
1342
|
+
exitButtonText: viewJsonDefaults.exitButtonText,
|
|
1343
|
+
textForUnrecognizedBarcodesDetectedHint: viewJsonDefaults.textForUnrecognizedBarcodesDetectedHint,
|
|
1344
|
+
textForTapShutterToScanHint: viewJsonDefaults.textForTapShutterToScanHint,
|
|
1345
|
+
textForScanningHint: viewJsonDefaults.textForScanningHint,
|
|
1346
|
+
textForMoveCloserAndRescanHint: viewJsonDefaults.textForMoveCloserAndRescanHint,
|
|
1347
|
+
textForMoveFurtherAndRescanHint: viewJsonDefaults.textForMoveFurtherAndRescanHint,
|
|
1348
|
+
shouldShowListProgressBar: viewJsonDefaults.shouldShowListProgressBar,
|
|
1349
|
+
toolbarSettings: parseBarcodeCountToolbarDefaults(toolbarJsonDefaults),
|
|
1350
|
+
listButtonAccessibilityHint: viewJsonDefaults.listButtonAccessibilityHint || null,
|
|
1351
|
+
listButtonAccessibilityLabel: viewJsonDefaults.listButtonAccessibilityLabel || null,
|
|
1352
|
+
listButtonContentDescription: viewJsonDefaults.listButtonContentDescription || null,
|
|
1353
|
+
exitButtonAccessibilityHint: viewJsonDefaults.exitButtonAccessibilityHint || null,
|
|
1354
|
+
exitButtonAccessibilityLabel: viewJsonDefaults.exitButtonAccessibilityLabel || null,
|
|
1355
|
+
exitButtonContentDescription: viewJsonDefaults.exitButtonContentDescription || null,
|
|
1356
|
+
shutterButtonAccessibilityHint: viewJsonDefaults.shutterButtonAccessibilityHint || null,
|
|
1357
|
+
shutterButtonAccessibilityLabel: viewJsonDefaults.shutterButtonAccessibilityLabel || null,
|
|
1358
|
+
shutterButtonContentDescription: viewJsonDefaults.shutterButtonContentDescription || null,
|
|
1359
|
+
floatingShutterButtonAccessibilityHint: viewJsonDefaults.floatingShutterButtonAccessibilityHint || null,
|
|
1360
|
+
floatingShutterButtonAccessibilityLabel: viewJsonDefaults.floatingShutterButtonAccessibilityLabel || null,
|
|
1361
|
+
floatingShutterButtonContentDescription: viewJsonDefaults.floatingShutterButtonContentDescription || null,
|
|
1362
|
+
clearHighlightsButtonAccessibilityHint: viewJsonDefaults.clearHighlightsButtonAccessibilityHint || null,
|
|
1363
|
+
clearHighlightsButtonAccessibilityLabel: viewJsonDefaults.clearHighlightsButtonAccessibilityLabel || null,
|
|
1364
|
+
clearHighlightsButtonContentDescription: viewJsonDefaults.clearHighlightsButtonContentDescription || null,
|
|
1365
|
+
singleScanButtonAccessibilityHint: viewJsonDefaults.singleScanButtonAccessibilityHint || null,
|
|
1366
|
+
singleScanButtonAccessibilityLabel: viewJsonDefaults.singleScanButtonAccessibilityLabel || null,
|
|
1367
|
+
singleScanButtonContentDescription: viewJsonDefaults.singleScanButtonContentDescription || null,
|
|
1368
|
+
shouldShowTorchControl: viewJsonDefaults.shouldShowTorchControl,
|
|
1369
|
+
torchControlPosition: viewJsonDefaults.torchControlPosition,
|
|
1370
|
+
}
|
|
1371
|
+
};
|
|
1372
|
+
return barcodeCountDefaults;
|
|
1373
|
+
}
|
|
1374
|
+
|
|
1375
|
+
function getBarcodeTrackingDefaults() {
|
|
1376
|
+
return FactoryMaker.getInstance('BarcodeTrackingDefaults');
|
|
1377
|
+
}
|
|
1378
|
+
function parseBarcodeTrackingDefaults(jsonDefaults) {
|
|
1379
|
+
const barcodeTrackingDefaults = {
|
|
1380
|
+
RecommendedCameraSettings: CameraSettings
|
|
1381
|
+
.fromJSON(jsonDefaults.RecommendedCameraSettings),
|
|
1382
|
+
BarcodeTrackingBasicOverlay: {
|
|
1383
|
+
defaultStyle: jsonDefaults.BarcodeTrackingBasicOverlay.defaultStyle,
|
|
1384
|
+
styles: Object
|
|
1385
|
+
.keys(jsonDefaults.BarcodeTrackingBasicOverlay.Brushes)
|
|
1386
|
+
.reduce((previousValue, currentValue) => {
|
|
1387
|
+
return Object.assign(Object.assign({}, previousValue), { [currentValue]: {
|
|
1388
|
+
DefaultBrush: {
|
|
1389
|
+
fillColor: Color
|
|
1390
|
+
.fromJSON(jsonDefaults.BarcodeTrackingBasicOverlay.
|
|
1391
|
+
Brushes[currentValue].fillColor),
|
|
1392
|
+
strokeColor: Color
|
|
1393
|
+
.fromJSON(jsonDefaults.BarcodeTrackingBasicOverlay.
|
|
1394
|
+
Brushes[currentValue].strokeColor),
|
|
1395
|
+
strokeWidth: jsonDefaults.BarcodeTrackingBasicOverlay.
|
|
1396
|
+
Brushes[currentValue].strokeWidth,
|
|
1397
|
+
},
|
|
1398
|
+
} });
|
|
1399
|
+
}, {}),
|
|
1400
|
+
}
|
|
1401
|
+
};
|
|
1402
|
+
return barcodeTrackingDefaults;
|
|
1403
|
+
}
|
|
1404
|
+
|
|
1405
|
+
function getSparkScanDefaults() {
|
|
1406
|
+
return FactoryMaker.getInstance('SparkScanDefaults');
|
|
1407
|
+
}
|
|
1408
|
+
|
|
1409
|
+
function getBarcodePickDefaults() {
|
|
1410
|
+
return FactoryMaker.getInstance('BarcodePickDefaults');
|
|
1411
|
+
}
|
|
1412
|
+
function parseBarcodePickViewHighlightStyle(jsonStyles) {
|
|
1413
|
+
const styles = {};
|
|
1414
|
+
Object.entries(jsonStyles).forEach(([key, value]) => {
|
|
1415
|
+
styles[key] = JSON.parse(value);
|
|
1416
|
+
});
|
|
1417
|
+
return styles;
|
|
1418
|
+
}
|
|
1419
|
+
function parseBarcodePickDefaults(jsonDefaults) {
|
|
1420
|
+
const barcodePickDefaults = {
|
|
1421
|
+
RecommendedCameraSettings: CameraSettings
|
|
1422
|
+
.fromJSON(jsonDefaults.RecommendedCameraSettings),
|
|
1423
|
+
BarcodePickSettings: {
|
|
1424
|
+
arucoDictionary: jsonDefaults.BarcodePickSettings.arucoDictionary,
|
|
1425
|
+
cachingEnabled: jsonDefaults.BarcodePickSettings.cachingEnabled,
|
|
1426
|
+
hapticsEnabled: jsonDefaults.BarcodePickSettings.hapticsEnabled,
|
|
1427
|
+
soundEnabled: jsonDefaults.BarcodePickSettings.soundEnabled,
|
|
1428
|
+
},
|
|
1429
|
+
ViewSettings: {
|
|
1430
|
+
highlightStyle: JSON.parse(jsonDefaults.ViewSettings.HighlightStyle),
|
|
1431
|
+
initialGuidelineText: jsonDefaults.ViewSettings.initialGuidelineText,
|
|
1432
|
+
moveCloserGuidelineText: jsonDefaults.ViewSettings.moveCloserGuidelineText,
|
|
1433
|
+
loadingDialogText: jsonDefaults.ViewSettings.loadingDialogText,
|
|
1434
|
+
showLoadingDialog: jsonDefaults.ViewSettings.showLoadingDialog,
|
|
1435
|
+
onFirstItemPickCompletedHintText: jsonDefaults.ViewSettings.onFirstItemPickCompletedHintText,
|
|
1436
|
+
onFirstItemToPickFoundHintText: jsonDefaults.ViewSettings.onFirstItemToPickFoundHintText,
|
|
1437
|
+
onFirstItemUnpickCompletedHintText: jsonDefaults.ViewSettings.onFirstItemUnpickCompletedHintText,
|
|
1438
|
+
onFirstUnmarkedItemPickCompletedHintText: jsonDefaults.ViewSettings.onFirstUnmarkedItemPickCompletedHintText,
|
|
1439
|
+
showGuidelines: jsonDefaults.ViewSettings.showGuidelines,
|
|
1440
|
+
showHints: jsonDefaults.ViewSettings.showHints,
|
|
1441
|
+
showFinishButton: jsonDefaults.ViewSettings.showFinishButton,
|
|
1442
|
+
showPauseButton: jsonDefaults.ViewSettings.showPauseButton,
|
|
1443
|
+
showZoomButton: jsonDefaults.ViewSettings.showZoomButton,
|
|
1444
|
+
},
|
|
1445
|
+
BarcodePickViewHighlightStyle: parseBarcodePickViewHighlightStyle(jsonDefaults.BarcodePickViewHighlightStyle),
|
|
1446
|
+
SymbologySettings: Object.keys(jsonDefaults.SymbologySettings)
|
|
1447
|
+
.reduce((settings, identifier) => {
|
|
1448
|
+
settings[identifier] = SymbologySettings
|
|
1449
|
+
.fromJSON(identifier, JSON.parse(jsonDefaults.SymbologySettings[identifier]));
|
|
1450
|
+
return settings;
|
|
1451
|
+
}, {}),
|
|
1452
|
+
};
|
|
1453
|
+
return barcodePickDefaults;
|
|
1454
|
+
}
|
|
1455
|
+
|
|
1456
|
+
function getBarcodeFindDefaults() {
|
|
1457
|
+
return FactoryMaker.getInstance('BarcodeFindDefaults');
|
|
1458
|
+
}
|
|
1459
|
+
function parseBarcodeFindDefaults(jsonDefaults) {
|
|
1460
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
1461
|
+
return {
|
|
1462
|
+
RecommendedCameraSettings: CameraSettings
|
|
1463
|
+
.fromJSON(jsonDefaults.RecommendedCameraSettings),
|
|
1464
|
+
Feedback: {
|
|
1465
|
+
found: Feedback.fromJSON(JSON.parse(jsonDefaults.BarcodeFindFeedback).found),
|
|
1466
|
+
itemListUpdated: Feedback
|
|
1467
|
+
.fromJSON(JSON.parse(jsonDefaults.BarcodeFindFeedback).itemListUpdated),
|
|
1468
|
+
},
|
|
1469
|
+
BarcodeFindView: {
|
|
1470
|
+
shouldShowCarousel: jsonDefaults.shouldShowCarousel,
|
|
1471
|
+
shouldShowFinishButton: jsonDefaults.shouldShowFinishButton,
|
|
1472
|
+
shouldShowHints: jsonDefaults.shouldShowHints,
|
|
1473
|
+
shouldShowPauseButton: jsonDefaults.shouldShowPauseButton,
|
|
1474
|
+
shouldShowProgressBar: jsonDefaults.shouldShowProgressBar,
|
|
1475
|
+
shouldShowUserGuidanceView: jsonDefaults.shouldShowUserGuidanceView,
|
|
1476
|
+
shouldShowTorchControl: jsonDefaults.shouldShowTorchControl,
|
|
1477
|
+
textForAllItemsFoundSuccessfullyHint: (_a = jsonDefaults.textForAllItemsFoundSuccessfullyHint) !== null && _a !== void 0 ? _a : null,
|
|
1478
|
+
textForItemListUpdatedHint: (_b = jsonDefaults.textForItemListUpdatedHint) !== null && _b !== void 0 ? _b : null,
|
|
1479
|
+
textForItemListUpdatedWhenPausedHint: (_c = jsonDefaults.textForItemListUpdatedWhenPausedHint) !== null && _c !== void 0 ? _c : null,
|
|
1480
|
+
textForCollapseCardsButton: (_d = jsonDefaults.textForCollapseCardsButton) !== null && _d !== void 0 ? _d : null,
|
|
1481
|
+
textForMoveCloserToBarcodesHint: (_e = jsonDefaults.textForMoveCloserToBarcodesHint) !== null && _e !== void 0 ? _e : null,
|
|
1482
|
+
textForPointAtBarcodesToSearchHint: (_f = jsonDefaults.textForPointAtBarcodesToSearchHint) !== null && _f !== void 0 ? _f : null,
|
|
1483
|
+
textForTapShutterToPauseScreenHint: (_g = jsonDefaults.textForTapShutterToPauseScreenHint) !== null && _g !== void 0 ? _g : null,
|
|
1484
|
+
textForTapShutterToResumeSearchHint: (_h = jsonDefaults.textForTapShutterToResumeSearchHint) !== null && _h !== void 0 ? _h : null,
|
|
1485
|
+
torchControlPosition: jsonDefaults.torchControlPosition,
|
|
1486
|
+
}
|
|
1487
|
+
};
|
|
1488
|
+
}
|
|
1489
|
+
|
|
1490
|
+
function parseSparkScanDefaults(jsonDefaults) {
|
|
1491
|
+
const sparkScanViewSettingsDefaults = JSON.parse(jsonDefaults.SparkScanView.SparkScanViewSettings);
|
|
1492
|
+
const toastSettingsDefaults = JSON.parse(sparkScanViewSettingsDefaults.toastSettings);
|
|
1493
|
+
const sparkScanDefaults = {
|
|
1494
|
+
Feedback: ({
|
|
1495
|
+
success: {
|
|
1496
|
+
visualFeedbackColor: Color.fromJSON(JSON.parse(jsonDefaults.Feedback.success).barcodeFeedback.visualFeedbackColor),
|
|
1497
|
+
brush: new Brush(Color.fromJSON(JSON.parse(jsonDefaults.Feedback.success).barcodeFeedback.brush.fill.color), Color.fromJSON(JSON.parse(jsonDefaults.Feedback.success).barcodeFeedback.brush.stroke.color), JSON.parse(JSON.parse(jsonDefaults.Feedback.success).barcodeFeedback.brush.stroke.width)),
|
|
1498
|
+
feedbackDefault: Feedback.fromJSON(JSON.parse(jsonDefaults.Feedback.success).barcodeFeedback.feedback),
|
|
1499
|
+
},
|
|
1500
|
+
error: {
|
|
1501
|
+
visualFeedbackColor: JSON.parse(jsonDefaults.Feedback.error).barcodeFeedback.visualFeedbackColor,
|
|
1502
|
+
brush: new Brush(Color.fromJSON(JSON.parse(jsonDefaults.Feedback.error).barcodeFeedback.brush.fill.color), Color.fromJSON(JSON.parse(jsonDefaults.Feedback.error).barcodeFeedback.brush.stroke.color), JSON.parse(JSON.parse(jsonDefaults.Feedback.error).barcodeFeedback.brush.stroke.width)),
|
|
1503
|
+
feedbackDefault: Feedback.fromJSON(JSON.parse(jsonDefaults.Feedback.error).barcodeFeedback.feedback),
|
|
1504
|
+
}
|
|
1505
|
+
}),
|
|
1506
|
+
SparkScanSettings: {
|
|
1507
|
+
batterySaving: jsonDefaults.SparkScanSettings.batterySaving,
|
|
1508
|
+
codeDuplicateFilter: jsonDefaults.SparkScanSettings.codeDuplicateFilter,
|
|
1509
|
+
locationSelection: (fromJSON) => {
|
|
1510
|
+
return fromJSON(JSON.parse(jsonDefaults.SparkScanSettings.locationSelection));
|
|
1511
|
+
},
|
|
1512
|
+
singleBarcodeAutoDetection: jsonDefaults.SparkScanSettings.singleBarcodeAutoDetection,
|
|
1513
|
+
scanIntention: jsonDefaults.SparkScanSettings.scanIntention,
|
|
1514
|
+
},
|
|
1515
|
+
SparkScanView: {
|
|
1516
|
+
shouldShowScanAreaGuides: jsonDefaults.SparkScanView.shouldShowScanAreaGuides,
|
|
1517
|
+
brush: new Brush(Color.fromJSON(jsonDefaults.SparkScanView.brush.fillColor), Color.fromJSON(jsonDefaults.SparkScanView.brush.strokeColor), jsonDefaults.SparkScanView.brush.strokeWidth),
|
|
1518
|
+
torchButtonVisible: jsonDefaults.SparkScanView.torchButtonVisible,
|
|
1519
|
+
scanningBehaviorButtonVisible: jsonDefaults.SparkScanView.scanningBehaviorButtonVisible,
|
|
1520
|
+
handModeButtonVisible: jsonDefaults.SparkScanView.handModeButtonVisible,
|
|
1521
|
+
barcodeCountButtonVisible: jsonDefaults.SparkScanView.barcodeCountButtonVisible,
|
|
1522
|
+
barcodeFindButtonVisible: jsonDefaults.SparkScanView.barcodeFindButtonVisible,
|
|
1523
|
+
targetModeButtonVisible: jsonDefaults.SparkScanView.targetModeButtonVisible,
|
|
1524
|
+
soundModeButtonVisible: false, // Deprecated, will be removed in the next version
|
|
1525
|
+
hapticModeButtonVisible: false, // Deprecated, will be removed in the next version
|
|
1526
|
+
previewSizeControlVisible: jsonDefaults.SparkScanView.previewSizeControlVisible,
|
|
1527
|
+
stopCapturingText: jsonDefaults.SparkScanView.stopCapturingText || null,
|
|
1528
|
+
startCapturingText: jsonDefaults.SparkScanView.stopCapturingText || null,
|
|
1529
|
+
resumeCapturingText: jsonDefaults.SparkScanView.resumeCapturingText || null,
|
|
1530
|
+
scanningCapturingText: jsonDefaults.SparkScanView.scanningCapturingText || null,
|
|
1531
|
+
targetModeHintText: jsonDefaults.SparkScanView.scanningCapturingText || null,
|
|
1532
|
+
shouldShowTargetModeHint: jsonDefaults.SparkScanView.shouldShowTargetModeHint,
|
|
1533
|
+
captureButtonBackgroundColor: jsonDefaults.SparkScanView.captureButtonBackgroundColor ? Color
|
|
1534
|
+
.fromJSON(jsonDefaults.SparkScanView.captureButtonBackgroundColor) : null,
|
|
1535
|
+
captureButtonActiveBackgroundColor: jsonDefaults.SparkScanView.captureButtonActiveBackgroundColor ? Color
|
|
1536
|
+
.fromJSON(jsonDefaults.SparkScanView.captureButtonActiveBackgroundColor) : null,
|
|
1537
|
+
captureButtonTintColor: jsonDefaults.SparkScanView.captureButtonTintColor ? Color
|
|
1538
|
+
.fromJSON(jsonDefaults.SparkScanView.captureButtonTintColor) : null,
|
|
1539
|
+
toolbarBackgroundColor: jsonDefaults.SparkScanView.toolbarBackgroundColor ? Color
|
|
1540
|
+
.fromJSON(jsonDefaults.SparkScanView.toolbarBackgroundColor) : null,
|
|
1541
|
+
toolbarIconActiveTintColor: jsonDefaults.SparkScanView.toolbarIconActiveTintColor ? Color
|
|
1542
|
+
.fromJSON(jsonDefaults.SparkScanView.toolbarIconActiveTintColor) : null,
|
|
1543
|
+
toolbarIconInactiveTintColor: jsonDefaults.SparkScanView.toolbarIconInactiveTintColor ? Color
|
|
1544
|
+
.fromJSON(jsonDefaults.SparkScanView.toolbarIconInactiveTintColor) : null,
|
|
1545
|
+
cameraSwitchButtonVisible: jsonDefaults.SparkScanView.cameraSwitchButtonVisible,
|
|
1546
|
+
SparkScanViewSettings: {
|
|
1547
|
+
triggerButtonCollapseTimeout: sparkScanViewSettingsDefaults.triggerButtonCollapseTimeout,
|
|
1548
|
+
continuousCaptureTimeout: sparkScanViewSettingsDefaults.continuousCaptureTimeout,
|
|
1549
|
+
defaultScanningMode: (fromJSON) => {
|
|
1550
|
+
return fromJSON(JSON.parse(sparkScanViewSettingsDefaults.defaultScanningMode));
|
|
1551
|
+
},
|
|
1552
|
+
defaultTorchState: sparkScanViewSettingsDefaults.defaultTorchState,
|
|
1553
|
+
soundEnabled: sparkScanViewSettingsDefaults.soundEnabled,
|
|
1554
|
+
hapticEnabled: sparkScanViewSettingsDefaults.hapticEnabled,
|
|
1555
|
+
defaultHandMode: sparkScanViewSettingsDefaults.defaultHandMode,
|
|
1556
|
+
holdToScanEnabled: sparkScanViewSettingsDefaults.holdToScanEnabled,
|
|
1557
|
+
hardwareTriggerEnabled: sparkScanViewSettingsDefaults.hardwareTriggerEnabled,
|
|
1558
|
+
hardwareTriggerKeyCode: sparkScanViewSettingsDefaults.hardwareTriggerKeyCode,
|
|
1559
|
+
visualFeedbackEnabled: sparkScanViewSettingsDefaults.visualFeedbackEnabled ? sparkScanViewSettingsDefaults.visualFeedbackEnabled : false,
|
|
1560
|
+
toastSettings: {
|
|
1561
|
+
toastEnabled: toastSettingsDefaults.toastEnabled,
|
|
1562
|
+
toastBackgroundColor: toastSettingsDefaults.toastBackgroundColor ? Color
|
|
1563
|
+
.fromJSON(toastSettingsDefaults.toastBackgroundColor) : null,
|
|
1564
|
+
toastTextColor: toastSettingsDefaults.toastTextColor ? Color
|
|
1565
|
+
.fromJSON(toastSettingsDefaults.toastTextColor) : null,
|
|
1566
|
+
targetModeEnabledMessage: toastSettingsDefaults.targetModeEnabledMessage,
|
|
1567
|
+
targetModeDisabledMessage: toastSettingsDefaults.targetModeDisabledMessage,
|
|
1568
|
+
continuousModeEnabledMessage: toastSettingsDefaults.continuousModeEnabledMessage,
|
|
1569
|
+
continuousModeDisabledMessage: toastSettingsDefaults.continuousModeDisabledMessage,
|
|
1570
|
+
cameraTimeoutMessage: toastSettingsDefaults.cameraTimeoutMessage,
|
|
1571
|
+
worldFacingCameraEnabledMessage: toastSettingsDefaults.worldFacingCameraEnabledMessage,
|
|
1572
|
+
userFacingCameraEnabledMessage: toastSettingsDefaults.userFacingCameraEnabledMessage,
|
|
1573
|
+
scanPausedMessage: toastSettingsDefaults.scanPausedMessage,
|
|
1574
|
+
zoomedInMessage: toastSettingsDefaults.zoomedInMessage,
|
|
1575
|
+
zoomedOutMessage: toastSettingsDefaults.zoomedOutMessage,
|
|
1576
|
+
torchEnabledMessage: toastSettingsDefaults.torchEnabledMessage,
|
|
1577
|
+
torchDisabledMessage: toastSettingsDefaults.torchDisabledMessage,
|
|
1578
|
+
},
|
|
1579
|
+
targetZoomFactorOut: sparkScanViewSettingsDefaults.targetZoomFactorOut,
|
|
1580
|
+
targetZoomFactorIn: sparkScanViewSettingsDefaults.targetZoomFactorIn,
|
|
1581
|
+
zoomFactorOut: sparkScanViewSettingsDefaults.zoomFactorOut,
|
|
1582
|
+
zoomFactorIn: sparkScanViewSettingsDefaults.zoomFactorIn,
|
|
1583
|
+
inactiveStateTimeout: sparkScanViewSettingsDefaults.inactiveStateTimeout,
|
|
1584
|
+
defaultCameraPosition: sparkScanViewSettingsDefaults.defaultCameraPosition,
|
|
1585
|
+
}
|
|
1586
|
+
},
|
|
1587
|
+
};
|
|
1588
|
+
return sparkScanDefaults;
|
|
1406
1589
|
}
|
|
1407
|
-
__decorate([
|
|
1408
|
-
serializationDefault(NoneLocationSelection)
|
|
1409
|
-
], BarcodeCaptureSettings.prototype, "locationSelection", void 0);
|
|
1410
|
-
__decorate([
|
|
1411
|
-
nameForSerialization('codeDuplicateFilter')
|
|
1412
|
-
], BarcodeCaptureSettings.prototype, "_codeDuplicateFilter", void 0);
|
|
1413
|
-
__decorate([
|
|
1414
|
-
nameForSerialization('arucoDictionary')
|
|
1415
|
-
], BarcodeCaptureSettings.prototype, "_arucoDictionary", void 0);
|
|
1416
|
-
__decorate([
|
|
1417
|
-
ignoreFromSerialization
|
|
1418
|
-
], BarcodeCaptureSettings, "barcodeDefaults", null);
|
|
1419
|
-
__decorate([
|
|
1420
|
-
ignoreFromSerialization
|
|
1421
|
-
], BarcodeCaptureSettings, "barcodeCaptureDefaults", null);
|
|
1422
1590
|
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1591
|
+
function loadBarcodeDefaults(jsonDefaults) {
|
|
1592
|
+
const barcodeDefaults = parseBarcodeDefaults(jsonDefaults);
|
|
1593
|
+
FactoryMaker.bindInstanceIfNotExists('BarcodeDefaults', barcodeDefaults);
|
|
1594
|
+
}
|
|
1595
|
+
function loadBarcodeCaptureDefaults(jsonDefaults) {
|
|
1596
|
+
const defaults = parseBarcodeCaptureDefaults(jsonDefaults);
|
|
1597
|
+
FactoryMaker.bindInstanceIfNotExists('BarcodeCaptureDefaults', defaults);
|
|
1598
|
+
}
|
|
1599
|
+
function loadBarcodeCountDefaults(jsonDefaults) {
|
|
1600
|
+
const defaults = parseBarcodeCountDefaults(jsonDefaults);
|
|
1601
|
+
FactoryMaker.bindInstanceIfNotExists('BarcodeCountDefaults', defaults);
|
|
1602
|
+
}
|
|
1603
|
+
function loadBarcodePickDefaults(jsonDefaults) {
|
|
1604
|
+
const defaults = parseBarcodePickDefaults(jsonDefaults);
|
|
1605
|
+
FactoryMaker.bindInstanceIfNotExists('BarcodePickDefaults', defaults);
|
|
1606
|
+
}
|
|
1607
|
+
function loadBarcodeSelectionDefaults(jsonDefaults) {
|
|
1608
|
+
const defaults = parseBarcodeSelectionDefaults(jsonDefaults);
|
|
1609
|
+
FactoryMaker.bindInstanceIfNotExists('BarcodeSelectionDefaults', defaults);
|
|
1610
|
+
}
|
|
1611
|
+
function loadBarcodeTrackingDefaults(jsonDefaults) {
|
|
1612
|
+
const defaults = parseBarcodeTrackingDefaults(jsonDefaults);
|
|
1613
|
+
FactoryMaker.bindInstanceIfNotExists('BarcodeTrackingDefaults', defaults);
|
|
1614
|
+
}
|
|
1615
|
+
function loadSparkScanDefaults(jsonDefaults) {
|
|
1616
|
+
const defaults = parseSparkScanDefaults(jsonDefaults);
|
|
1617
|
+
FactoryMaker.bindInstanceIfNotExists('SparkScanDefaults', defaults);
|
|
1618
|
+
}
|
|
1619
|
+
function loadBarcodeFindDefaults(jsonDefaults) {
|
|
1620
|
+
const defaults = parseBarcodeFindDefaults(jsonDefaults);
|
|
1621
|
+
FactoryMaker.bindInstanceIfNotExists('BarcodeFindDefaults', defaults);
|
|
1622
|
+
}
|
|
1623
|
+
|
|
1624
|
+
class BarcodeCaptureSession {
|
|
1625
|
+
/**
|
|
1626
|
+
* @deprecated Prefer use of the property `newlyRecognizedBarcode` instead.
|
|
1627
|
+
*/
|
|
1628
|
+
get newlyRecognizedBarcodes() {
|
|
1629
|
+
// tslint:disable-next-line:no-console
|
|
1630
|
+
console.warn('The newlyRecognizedBarcodes has been deprecated. Prefer use of the property `newlyRecognizedBarcode` instead.');
|
|
1631
|
+
return this._newlyRecognizedBarcodes;
|
|
1426
1632
|
}
|
|
1427
|
-
get
|
|
1428
|
-
return this.
|
|
1633
|
+
get newlyRecognizedBarcode() {
|
|
1634
|
+
return this._newlyRecognizedBarcode;
|
|
1429
1635
|
}
|
|
1430
|
-
get
|
|
1431
|
-
return this.
|
|
1636
|
+
get newlyLocalizedBarcodes() {
|
|
1637
|
+
return this._newlyLocalizedBarcodes;
|
|
1432
1638
|
}
|
|
1433
1639
|
get frameSequenceID() {
|
|
1434
1640
|
return this._frameSequenceID;
|
|
1435
1641
|
}
|
|
1436
1642
|
static fromJSON(json) {
|
|
1437
|
-
const session = new
|
|
1438
|
-
session.
|
|
1439
|
-
.
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
session._newlyUnselectedBarcodes = json.newlyUnselectedBarcodes
|
|
1643
|
+
const session = new BarcodeCaptureSession();
|
|
1644
|
+
session._newlyRecognizedBarcode = json.newlyRecognizedBarcode != null ?
|
|
1645
|
+
Barcode.fromJSON(json.newlyRecognizedBarcode) :
|
|
1646
|
+
null;
|
|
1647
|
+
session._newlyRecognizedBarcodes = json.newlyRecognizedBarcodes
|
|
1443
1648
|
.map(Barcode.fromJSON);
|
|
1649
|
+
session._newlyLocalizedBarcodes = json.newlyLocalizedBarcodes
|
|
1650
|
+
.map(LocalizedOnlyBarcode.fromJSON);
|
|
1444
1651
|
session._frameSequenceID = json.frameSequenceId;
|
|
1445
1652
|
return session;
|
|
1446
1653
|
}
|
|
1447
|
-
getCount(barcode) {
|
|
1448
|
-
return this.listenerController.getCount(barcode);
|
|
1449
|
-
}
|
|
1450
1654
|
reset() {
|
|
1451
|
-
return this.
|
|
1655
|
+
return this.controller.reset();
|
|
1452
1656
|
}
|
|
1453
1657
|
}
|
|
1454
1658
|
|
|
1455
|
-
var
|
|
1456
|
-
(function (
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
})(
|
|
1461
|
-
class
|
|
1659
|
+
var BarcodeCaptureListenerEvents;
|
|
1660
|
+
(function (BarcodeCaptureListenerEvents) {
|
|
1661
|
+
BarcodeCaptureListenerEvents["inCallback"] = "BarcodeCaptureListener.inCallback";
|
|
1662
|
+
BarcodeCaptureListenerEvents["didUpdateSession"] = "BarcodeCaptureListener.didUpdateSession";
|
|
1663
|
+
BarcodeCaptureListenerEvents["didScan"] = "BarcodeCaptureListener.didScan";
|
|
1664
|
+
})(BarcodeCaptureListenerEvents || (BarcodeCaptureListenerEvents = {}));
|
|
1665
|
+
class BarcodeCaptureListenerController {
|
|
1462
1666
|
get _proxy() {
|
|
1463
|
-
return FactoryMaker.getInstance('
|
|
1667
|
+
return FactoryMaker.getInstance('BarcodeCaptureListenerProxy');
|
|
1464
1668
|
}
|
|
1465
|
-
static
|
|
1466
|
-
const controller = new
|
|
1467
|
-
controller.
|
|
1468
|
-
controller._proxy.isModeEnabled = () =>
|
|
1669
|
+
static forBarcodeCapture(barcodeCapture) {
|
|
1670
|
+
const controller = new BarcodeCaptureListenerController();
|
|
1671
|
+
controller.barcodeCapture = barcodeCapture;
|
|
1672
|
+
controller._proxy.isModeEnabled = () => barcodeCapture.isEnabled;
|
|
1469
1673
|
return controller;
|
|
1470
1674
|
}
|
|
1471
1675
|
constructor() {
|
|
1472
1676
|
this.eventEmitter = FactoryMaker.getInstance('EventEmitter');
|
|
1473
1677
|
}
|
|
1474
|
-
getCount(barcode) {
|
|
1475
|
-
return this._proxy.getCount(barcode.selectionIdentifier);
|
|
1476
|
-
}
|
|
1477
1678
|
reset() {
|
|
1478
1679
|
return this._proxy.resetSession();
|
|
1479
1680
|
}
|
|
1681
|
+
setModeEnabledState(enabled) {
|
|
1682
|
+
this._proxy.setModeEnabledState(enabled);
|
|
1683
|
+
}
|
|
1684
|
+
updateBarcodeCaptureMode() {
|
|
1685
|
+
return this._proxy.updateBarcodeCaptureMode(JSON.stringify(this.barcodeCapture.toJSON()));
|
|
1686
|
+
}
|
|
1687
|
+
applyBarcodeCaptureModeSettings(newSettings) {
|
|
1688
|
+
return this._proxy.applyBarcodeCaptureModeSettings(JSON.stringify(newSettings.toJSON()));
|
|
1689
|
+
}
|
|
1690
|
+
updateBarcodeCaptureOverlay(overlay) {
|
|
1691
|
+
return this._proxy.updateBarcodeCaptureOverlay(JSON.stringify(overlay.toJSON()));
|
|
1692
|
+
}
|
|
1480
1693
|
subscribeListener() {
|
|
1481
1694
|
var _a, _b, _c, _d;
|
|
1482
1695
|
this._proxy.registerListenerForEvents();
|
|
1483
|
-
(_b = (_a = this._proxy).
|
|
1484
|
-
(_d = (_c = this._proxy).
|
|
1485
|
-
this.eventEmitter.on(
|
|
1486
|
-
|
|
1487
|
-
const session = BarcodeSelectionSession.fromJSON(JSON.parse(payload.session));
|
|
1488
|
-
session.listenerController = this;
|
|
1489
|
-
this.notifyListenersOfDidUpdateSelection(session);
|
|
1490
|
-
this._proxy.finishDidUpdateSelectionCallback(this.barcodeSelection.isEnabled);
|
|
1696
|
+
(_b = (_a = this._proxy).subscribeDidUpdateSessionListener) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
1697
|
+
(_d = (_c = this._proxy).subscribeDidScanListener) === null || _d === void 0 ? void 0 : _d.call(_c);
|
|
1698
|
+
this.eventEmitter.on(BarcodeCaptureListenerEvents.inCallback, (value) => {
|
|
1699
|
+
this.barcodeCapture.isInListenerCallback = value;
|
|
1491
1700
|
});
|
|
1492
|
-
this.eventEmitter.on(
|
|
1701
|
+
this.eventEmitter.on(BarcodeCaptureListenerEvents.didUpdateSession, (body) => {
|
|
1493
1702
|
const payload = JSON.parse(body);
|
|
1494
|
-
const session =
|
|
1495
|
-
session.listenerController = this;
|
|
1703
|
+
const session = BarcodeCaptureSession.fromJSON(JSON.parse(payload.session));
|
|
1496
1704
|
this.notifyListenersOfDidUpdateSession(session);
|
|
1497
|
-
this._proxy.finishDidUpdateSessionCallback(this.
|
|
1705
|
+
this._proxy.finishDidUpdateSessionCallback(this.barcodeCapture.isEnabled);
|
|
1706
|
+
});
|
|
1707
|
+
this.eventEmitter.on(BarcodeCaptureListenerEvents.didScan, (body) => {
|
|
1708
|
+
const payload = JSON.parse(body);
|
|
1709
|
+
const session = BarcodeCaptureSession.fromJSON(JSON.parse(payload.session));
|
|
1710
|
+
this.notifyListenersOfDidScan(session);
|
|
1711
|
+
this._proxy.finishDidScanCallback(this.barcodeCapture.isEnabled);
|
|
1498
1712
|
});
|
|
1499
1713
|
}
|
|
1500
1714
|
unsubscribeListener() {
|
|
1501
1715
|
this._proxy.unregisterListenerForEvents();
|
|
1502
|
-
this.eventEmitter.removeAllListeners(
|
|
1503
|
-
this.eventEmitter.removeAllListeners(
|
|
1716
|
+
this.eventEmitter.removeAllListeners(BarcodeCaptureListenerEvents.inCallback);
|
|
1717
|
+
this.eventEmitter.removeAllListeners(BarcodeCaptureListenerEvents.didUpdateSession);
|
|
1718
|
+
this.eventEmitter.removeAllListeners(BarcodeCaptureListenerEvents.didScan);
|
|
1504
1719
|
}
|
|
1505
|
-
|
|
1506
|
-
const mode = this.
|
|
1720
|
+
notifyListenersOfDidUpdateSession(session) {
|
|
1721
|
+
const mode = this.barcodeCapture;
|
|
1507
1722
|
mode.isInListenerCallback = true;
|
|
1508
1723
|
mode.listeners.forEach(listener => {
|
|
1509
|
-
if (listener.
|
|
1510
|
-
listener.
|
|
1724
|
+
if (listener.didUpdateSession) {
|
|
1725
|
+
listener.didUpdateSession(this.barcodeCapture, session, CameraController.getLastFrame);
|
|
1511
1726
|
}
|
|
1512
1727
|
});
|
|
1513
1728
|
mode.isInListenerCallback = false;
|
|
1514
1729
|
}
|
|
1515
|
-
|
|
1516
|
-
const mode = this.
|
|
1730
|
+
notifyListenersOfDidScan(session) {
|
|
1731
|
+
const mode = this.barcodeCapture;
|
|
1517
1732
|
mode.isInListenerCallback = true;
|
|
1518
1733
|
mode.listeners.forEach(listener => {
|
|
1519
|
-
if (listener.
|
|
1520
|
-
listener.
|
|
1734
|
+
if (listener.didScan) {
|
|
1735
|
+
listener.didScan(this.barcodeCapture, session, CameraController.getLastFrame);
|
|
1521
1736
|
}
|
|
1522
1737
|
});
|
|
1523
1738
|
mode.isInListenerCallback = false;
|
|
1524
1739
|
}
|
|
1525
1740
|
}
|
|
1526
1741
|
|
|
1527
|
-
class
|
|
1528
|
-
get _proxy() {
|
|
1529
|
-
return FactoryMaker.getInstance('BarcodeSelectionProxy');
|
|
1530
|
-
}
|
|
1531
|
-
unfreezeCamera() {
|
|
1532
|
-
return this._proxy.unfreezeCamera();
|
|
1533
|
-
}
|
|
1534
|
-
reset() {
|
|
1535
|
-
return this._proxy.resetMode();
|
|
1536
|
-
}
|
|
1537
|
-
selectAimedBarcode() {
|
|
1538
|
-
return this._proxy.selectAimedBarcode();
|
|
1539
|
-
}
|
|
1540
|
-
unselectBarcodes(barcodes) {
|
|
1541
|
-
const barcodesJson = this.convertBarcodesToJson(barcodes);
|
|
1542
|
-
return this._proxy.unselectBarcodes(JSON.stringify({ barcodes: barcodesJson }));
|
|
1543
|
-
}
|
|
1544
|
-
setSelectBarcodeEnabled(barcode, enabled) {
|
|
1545
|
-
const barcodesJson = this.convertBarcodesToJson([barcode]);
|
|
1546
|
-
return this._proxy.setSelectBarcodeEnabled(JSON.stringify(barcodesJson[0]), enabled);
|
|
1547
|
-
}
|
|
1548
|
-
increaseCountForBarcodes(barcodes) {
|
|
1549
|
-
const barcodesJson = this.convertBarcodesToJson(barcodes);
|
|
1550
|
-
return this._proxy.increaseCountForBarcodes(JSON.stringify({ barcodes: barcodesJson }));
|
|
1551
|
-
}
|
|
1552
|
-
setModeEnabledState(enabled) {
|
|
1553
|
-
this._proxy.setModeEnabledState(enabled);
|
|
1554
|
-
}
|
|
1555
|
-
updateBarcodeSelectionMode(barcodeSelection) {
|
|
1556
|
-
return this._proxy.updateBarcodeSelectionMode(JSON.stringify(barcodeSelection.toJSON()));
|
|
1557
|
-
}
|
|
1558
|
-
applyBarcodeSelectionModeSettings(newSettings) {
|
|
1559
|
-
return this._proxy.applyBarcodeSelectionModeSettings(JSON.stringify(newSettings.toJSON()));
|
|
1560
|
-
}
|
|
1561
|
-
convertBarcodesToJson(barcodes) {
|
|
1562
|
-
return barcodes.flat().map((barcode) => ({
|
|
1563
|
-
data: barcode.data,
|
|
1564
|
-
rawData: barcode.rawData,
|
|
1565
|
-
symbology: barcode.symbology,
|
|
1566
|
-
symbolCount: barcode.symbolCount
|
|
1567
|
-
}));
|
|
1568
|
-
}
|
|
1569
|
-
}
|
|
1570
|
-
|
|
1571
|
-
class BarcodeSelection extends DefaultSerializeable {
|
|
1742
|
+
class BarcodeCapture extends DefaultSerializeable {
|
|
1572
1743
|
get isEnabled() {
|
|
1573
1744
|
return this._isEnabled;
|
|
1574
1745
|
}
|
|
1575
1746
|
set isEnabled(isEnabled) {
|
|
1576
1747
|
this._isEnabled = isEnabled;
|
|
1577
|
-
this.
|
|
1748
|
+
this.controller.setModeEnabledState(isEnabled);
|
|
1578
1749
|
}
|
|
1579
1750
|
get context() {
|
|
1580
1751
|
return this._context;
|
|
@@ -1583,61 +1754,49 @@ class BarcodeSelection extends DefaultSerializeable {
|
|
|
1583
1754
|
return this._feedback;
|
|
1584
1755
|
}
|
|
1585
1756
|
set feedback(feedback) {
|
|
1586
|
-
this._feedback = feedback;
|
|
1587
|
-
this.
|
|
1588
|
-
}
|
|
1589
|
-
get pointOfInterest() {
|
|
1590
|
-
return this._pointOfInterest;
|
|
1591
|
-
}
|
|
1592
|
-
set pointOfInterest(pointOfInterest) {
|
|
1593
|
-
this._pointOfInterest = pointOfInterest;
|
|
1594
|
-
this.modeController.updateBarcodeSelectionMode(this);
|
|
1757
|
+
this._feedback = feedback;
|
|
1758
|
+
this.controller.updateBarcodeCaptureMode();
|
|
1595
1759
|
}
|
|
1596
1760
|
static get recommendedCameraSettings() {
|
|
1597
|
-
return
|
|
1761
|
+
return BarcodeCapture.barcodeCaptureDefaults.RecommendedCameraSettings;
|
|
1598
1762
|
}
|
|
1599
1763
|
get _context() {
|
|
1600
1764
|
return this.privateContext;
|
|
1601
1765
|
}
|
|
1602
1766
|
set _context(newContext) {
|
|
1603
1767
|
if (newContext == null) {
|
|
1604
|
-
this.
|
|
1768
|
+
this.controller.unsubscribeListener();
|
|
1605
1769
|
}
|
|
1606
1770
|
else if (this.privateContext == null) {
|
|
1607
|
-
this.
|
|
1771
|
+
this.controller.subscribeListener();
|
|
1608
1772
|
}
|
|
1609
1773
|
this.privateContext = newContext;
|
|
1610
1774
|
}
|
|
1611
|
-
static get
|
|
1612
|
-
return
|
|
1775
|
+
static get barcodeCaptureDefaults() {
|
|
1776
|
+
return getBarcodeCaptureDefaults();
|
|
1613
1777
|
}
|
|
1614
1778
|
static forContext(context, settings) {
|
|
1615
|
-
const
|
|
1616
|
-
|
|
1779
|
+
const barcodeCapture = new BarcodeCapture();
|
|
1780
|
+
barcodeCapture.settings = settings;
|
|
1617
1781
|
if (context) {
|
|
1618
|
-
context.addMode(
|
|
1782
|
+
context.addMode(barcodeCapture);
|
|
1619
1783
|
}
|
|
1620
|
-
return
|
|
1784
|
+
return barcodeCapture;
|
|
1621
1785
|
}
|
|
1622
1786
|
constructor() {
|
|
1623
1787
|
super();
|
|
1624
|
-
this.type = '
|
|
1788
|
+
this.type = 'barcodeCapture';
|
|
1625
1789
|
this._isEnabled = true;
|
|
1626
|
-
this._pointOfInterest = null;
|
|
1627
1790
|
this.privateContext = null;
|
|
1628
1791
|
this.listeners = [];
|
|
1629
|
-
this.modeController = new BarcodeSelectionController();
|
|
1630
1792
|
this.isInListenerCallback = false;
|
|
1631
|
-
this.
|
|
1793
|
+
this.controller = BarcodeCaptureListenerController.forBarcodeCapture(this);
|
|
1632
1794
|
}
|
|
1633
1795
|
applySettings(settings) {
|
|
1634
1796
|
this.settings = settings;
|
|
1635
|
-
return this.
|
|
1797
|
+
return this.controller.applyBarcodeCaptureModeSettings(settings);
|
|
1636
1798
|
}
|
|
1637
1799
|
addListener(listener) {
|
|
1638
|
-
if (listener == undefined) {
|
|
1639
|
-
return;
|
|
1640
|
-
}
|
|
1641
1800
|
if (this.listeners.includes(listener)) {
|
|
1642
1801
|
return;
|
|
1643
1802
|
}
|
|
@@ -1649,1040 +1808,908 @@ class BarcodeSelection extends DefaultSerializeable {
|
|
|
1649
1808
|
}
|
|
1650
1809
|
this.listeners.splice(this.listeners.indexOf(listener), 1);
|
|
1651
1810
|
}
|
|
1652
|
-
reset() {
|
|
1653
|
-
return this.modeController.reset();
|
|
1654
|
-
}
|
|
1655
|
-
unfreezeCamera() {
|
|
1656
|
-
return this.modeController.unfreezeCamera();
|
|
1657
|
-
}
|
|
1658
|
-
selectAimedBarcode() {
|
|
1659
|
-
return this.modeController.selectAimedBarcode();
|
|
1660
|
-
}
|
|
1661
|
-
unselectBarcodes(barcodes) {
|
|
1662
|
-
return this.modeController.unselectBarcodes(barcodes);
|
|
1663
|
-
}
|
|
1664
|
-
setSelectBarcodeEnabled(barcode, enabled) {
|
|
1665
|
-
return this.modeController.setSelectBarcodeEnabled(barcode, enabled);
|
|
1666
|
-
}
|
|
1667
|
-
increaseCountForBarcodes(barcodes) {
|
|
1668
|
-
return this.modeController.increaseCountForBarcodes(barcodes);
|
|
1669
|
-
}
|
|
1670
1811
|
}
|
|
1671
1812
|
__decorate([
|
|
1672
1813
|
ignoreFromSerialization
|
|
1673
|
-
],
|
|
1814
|
+
], BarcodeCapture.prototype, "_isEnabled", void 0);
|
|
1674
1815
|
__decorate([
|
|
1675
1816
|
nameForSerialization('feedback')
|
|
1676
|
-
],
|
|
1677
|
-
__decorate([
|
|
1678
|
-
nameForSerialization('pointOfInterest')
|
|
1679
|
-
], BarcodeSelection.prototype, "_pointOfInterest", void 0);
|
|
1680
|
-
__decorate([
|
|
1681
|
-
ignoreFromSerialization
|
|
1682
|
-
], BarcodeSelection.prototype, "privateContext", void 0);
|
|
1817
|
+
], BarcodeCapture.prototype, "_feedback", void 0);
|
|
1683
1818
|
__decorate([
|
|
1684
1819
|
ignoreFromSerialization
|
|
1685
|
-
],
|
|
1820
|
+
], BarcodeCapture.prototype, "privateContext", void 0);
|
|
1686
1821
|
__decorate([
|
|
1687
1822
|
ignoreFromSerialization
|
|
1688
|
-
],
|
|
1823
|
+
], BarcodeCapture.prototype, "listeners", void 0);
|
|
1689
1824
|
__decorate([
|
|
1690
1825
|
ignoreFromSerialization
|
|
1691
|
-
],
|
|
1826
|
+
], BarcodeCapture.prototype, "controller", void 0);
|
|
1692
1827
|
__decorate([
|
|
1693
1828
|
ignoreFromSerialization
|
|
1694
|
-
],
|
|
1829
|
+
], BarcodeCapture.prototype, "isInListenerCallback", void 0);
|
|
1695
1830
|
__decorate([
|
|
1696
1831
|
ignoreFromSerialization
|
|
1697
|
-
],
|
|
1698
|
-
|
|
1699
|
-
var BarcodeSelectionBasicOverlayStyle;
|
|
1700
|
-
(function (BarcodeSelectionBasicOverlayStyle) {
|
|
1701
|
-
BarcodeSelectionBasicOverlayStyle["Frame"] = "frame";
|
|
1702
|
-
BarcodeSelectionBasicOverlayStyle["Dot"] = "dot";
|
|
1703
|
-
})(BarcodeSelectionBasicOverlayStyle || (BarcodeSelectionBasicOverlayStyle = {}));
|
|
1704
|
-
|
|
1705
|
-
var BarcodeSelectionFreezeBehavior;
|
|
1706
|
-
(function (BarcodeSelectionFreezeBehavior) {
|
|
1707
|
-
BarcodeSelectionFreezeBehavior["Manual"] = "manual";
|
|
1708
|
-
BarcodeSelectionFreezeBehavior["ManualAndAutomatic"] = "manualAndAutomatic";
|
|
1709
|
-
})(BarcodeSelectionFreezeBehavior || (BarcodeSelectionFreezeBehavior = {}));
|
|
1710
|
-
|
|
1711
|
-
var BarcodeSelectionStrategyType;
|
|
1712
|
-
(function (BarcodeSelectionStrategyType) {
|
|
1713
|
-
BarcodeSelectionStrategyType["Auto"] = "autoSelectionStrategy";
|
|
1714
|
-
BarcodeSelectionStrategyType["Manual"] = "manualSelectionStrategy";
|
|
1715
|
-
})(BarcodeSelectionStrategyType || (BarcodeSelectionStrategyType = {}));
|
|
1716
|
-
|
|
1717
|
-
var BarcodeSelectionTapBehavior;
|
|
1718
|
-
(function (BarcodeSelectionTapBehavior) {
|
|
1719
|
-
BarcodeSelectionTapBehavior["ToggleSelection"] = "toggleSelection";
|
|
1720
|
-
BarcodeSelectionTapBehavior["RepeatSelection"] = "repeatSelection";
|
|
1721
|
-
})(BarcodeSelectionTapBehavior || (BarcodeSelectionTapBehavior = {}));
|
|
1722
|
-
|
|
1723
|
-
var BarcodeSelectionTypeName;
|
|
1724
|
-
(function (BarcodeSelectionTypeName) {
|
|
1725
|
-
BarcodeSelectionTypeName["Aimer"] = "aimerSelection";
|
|
1726
|
-
BarcodeSelectionTypeName["Tap"] = "tapSelection";
|
|
1727
|
-
})(BarcodeSelectionTypeName || (BarcodeSelectionTypeName = {}));
|
|
1832
|
+
], BarcodeCapture, "barcodeCaptureDefaults", null);
|
|
1728
1833
|
|
|
1729
|
-
class
|
|
1834
|
+
class BarcodeCaptureFeedback extends DefaultSerializeable {
|
|
1730
1835
|
constructor() {
|
|
1731
1836
|
super(...arguments);
|
|
1732
|
-
this.
|
|
1733
|
-
}
|
|
1734
|
-
static get barcodeSelectionDefaults() {
|
|
1735
|
-
return getBarcodeSelectionDefaults();
|
|
1837
|
+
this.success = Feedback.defaultFeedback;
|
|
1736
1838
|
}
|
|
1737
1839
|
static get default() {
|
|
1738
|
-
return new
|
|
1739
|
-
}
|
|
1740
|
-
}
|
|
1741
|
-
__decorate([
|
|
1742
|
-
ignoreFromSerialization
|
|
1743
|
-
], BarcodeSelectionFeedback, "barcodeSelectionDefaults", null);
|
|
1744
|
-
|
|
1745
|
-
var BarcodeSelectionBrushProviderEvents;
|
|
1746
|
-
(function (BarcodeSelectionBrushProviderEvents) {
|
|
1747
|
-
BarcodeSelectionBrushProviderEvents["inCallback"] = "BarcodeSelectionAimedBrushProvider.inCallback";
|
|
1748
|
-
BarcodeSelectionBrushProviderEvents["brushForAimedBarcode"] = "BarcodeSelectionAimedBrushProvider.brushForBarcode";
|
|
1749
|
-
BarcodeSelectionBrushProviderEvents["brushForTrackedBarcode"] = "BarcodeSelectionTrackedBrushProvider.brushForBarcode";
|
|
1750
|
-
})(BarcodeSelectionBrushProviderEvents || (BarcodeSelectionBrushProviderEvents = {}));
|
|
1751
|
-
class BarcodeSelectionOverlayController {
|
|
1752
|
-
get _proxy() {
|
|
1753
|
-
return FactoryMaker.getInstance('BarcodeSelectionOverlayProxy');
|
|
1754
|
-
}
|
|
1755
|
-
constructor() {
|
|
1756
|
-
this.eventEmitter = FactoryMaker.getInstance('EventEmitter');
|
|
1757
|
-
}
|
|
1758
|
-
setTextForAimToSelectAutoHint(text) {
|
|
1759
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
1760
|
-
return yield this._proxy.setTextForAimToSelectAutoHint(text);
|
|
1761
|
-
});
|
|
1762
|
-
}
|
|
1763
|
-
setAimedBarcodeBrushProvider(brushProvider) {
|
|
1764
|
-
if (!brushProvider) {
|
|
1765
|
-
this.eventEmitter.removeAllListeners(BarcodeSelectionBrushProviderEvents.brushForAimedBarcode);
|
|
1766
|
-
return this._proxy.removeAimedBarcodeBrushProvider();
|
|
1767
|
-
}
|
|
1768
|
-
const subscriptionResult = this._proxy.setAimedBarcodeBrushProvider();
|
|
1769
|
-
this._proxy.subscribeBrushForAimedBarcode();
|
|
1770
|
-
this.eventEmitter.on(BarcodeSelectionBrushProviderEvents.brushForAimedBarcode, (body) => {
|
|
1771
|
-
const payload = JSON.parse(body);
|
|
1772
|
-
const barcode = Barcode
|
|
1773
|
-
.fromJSON(JSON.parse(payload.barcode));
|
|
1774
|
-
let brush = null;
|
|
1775
|
-
if (brushProvider.brushForBarcode) {
|
|
1776
|
-
brush = brushProvider.brushForBarcode(barcode);
|
|
1777
|
-
}
|
|
1778
|
-
this._proxy.finishBrushForAimedBarcodeCallback(brush ? JSON.stringify(brush.toJSON()) : null, barcode.selectionIdentifier);
|
|
1779
|
-
});
|
|
1780
|
-
return subscriptionResult;
|
|
1781
|
-
}
|
|
1782
|
-
setTrackedBarcodeBrushProvider(brushProvider) {
|
|
1783
|
-
if (!brushProvider) {
|
|
1784
|
-
this.eventEmitter.removeAllListeners(BarcodeSelectionBrushProviderEvents.brushForTrackedBarcode);
|
|
1785
|
-
return this._proxy.removeTrackedBarcodeBrushProvider();
|
|
1786
|
-
}
|
|
1787
|
-
const subscriptionResult = this._proxy.setTrackedBarcodeBrushProvider();
|
|
1788
|
-
this._proxy.subscribeBrushForTrackedBarcode();
|
|
1789
|
-
this.eventEmitter.on(BarcodeSelectionBrushProviderEvents.brushForTrackedBarcode, (body) => {
|
|
1790
|
-
const payload = JSON.parse(body);
|
|
1791
|
-
const barcode = Barcode
|
|
1792
|
-
.fromJSON(JSON.parse(payload.barcode));
|
|
1793
|
-
let brush = null;
|
|
1794
|
-
if (brushProvider.brushForBarcode) {
|
|
1795
|
-
brush = brushProvider.brushForBarcode(barcode);
|
|
1796
|
-
}
|
|
1797
|
-
this._proxy.finishBrushForTrackedBarcodeCallback(brush ? JSON.stringify(brush.toJSON()) : null, barcode.selectionIdentifier);
|
|
1798
|
-
});
|
|
1799
|
-
return subscriptionResult;
|
|
1800
|
-
}
|
|
1801
|
-
updateBarcodeSelectionBasicOverlay(overlay) {
|
|
1802
|
-
return this._proxy.updateBarcodeSelectionBasicOverlay(JSON.stringify(overlay.toJSON()));
|
|
1803
|
-
}
|
|
1804
|
-
// TODO: We need to unsubscribe from the providers when the overlay is removed. Need spec.
|
|
1805
|
-
// https://scandit.atlassian.net/browse/SDC-16608
|
|
1806
|
-
unsubscribeProviders() {
|
|
1807
|
-
this.eventEmitter.removeAllListeners(BarcodeSelectionBrushProviderEvents.brushForAimedBarcode);
|
|
1808
|
-
this.eventEmitter.removeAllListeners(BarcodeSelectionBrushProviderEvents.brushForTrackedBarcode);
|
|
1809
|
-
this._proxy.removeAimedBarcodeBrushProvider();
|
|
1810
|
-
this._proxy.removeTrackedBarcodeBrushProvider();
|
|
1840
|
+
return new BarcodeCaptureFeedback();
|
|
1811
1841
|
}
|
|
1812
1842
|
}
|
|
1813
1843
|
|
|
1814
|
-
class
|
|
1815
|
-
get
|
|
1816
|
-
return
|
|
1817
|
-
}
|
|
1818
|
-
set trackedBrush(newBrush) {
|
|
1819
|
-
this._trackedBrush = newBrush;
|
|
1820
|
-
this.overlayController.updateBarcodeSelectionBasicOverlay(this);
|
|
1821
|
-
}
|
|
1822
|
-
get aimedBrush() {
|
|
1823
|
-
return this._aimedBrush;
|
|
1844
|
+
class BarcodeCaptureOverlay extends DefaultSerializeable {
|
|
1845
|
+
static get barcodeCaptureDefaults() {
|
|
1846
|
+
return getBarcodeCaptureDefaults();
|
|
1824
1847
|
}
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1848
|
+
static get defaultBrush() {
|
|
1849
|
+
// tslint:disable-next-line:no-console
|
|
1850
|
+
console.warn('defaultBrush is deprecated and will be removed in a future release. ' +
|
|
1851
|
+
'Use .brush to get the default for your selected style');
|
|
1852
|
+
return new Brush(BarcodeCaptureOverlay.barcodeCaptureDefaults.BarcodeCaptureOverlay.styles[BarcodeCaptureOverlay.barcodeCaptureDefaults.BarcodeCaptureOverlay.defaultStyle].DefaultBrush.fillColor, BarcodeCaptureOverlay.barcodeCaptureDefaults.BarcodeCaptureOverlay.styles[BarcodeCaptureOverlay.barcodeCaptureDefaults.BarcodeCaptureOverlay.defaultStyle].DefaultBrush.strokeColor, BarcodeCaptureOverlay.barcodeCaptureDefaults.BarcodeCaptureOverlay.styles[BarcodeCaptureOverlay.barcodeCaptureDefaults.BarcodeCaptureOverlay.defaultStyle].DefaultBrush.strokeWidth);
|
|
1828
1853
|
}
|
|
1829
|
-
get
|
|
1830
|
-
return this.
|
|
1854
|
+
get brush() {
|
|
1855
|
+
return this._brush;
|
|
1831
1856
|
}
|
|
1832
|
-
set
|
|
1833
|
-
this.
|
|
1834
|
-
this.
|
|
1857
|
+
set brush(newBrush) {
|
|
1858
|
+
this._brush = newBrush;
|
|
1859
|
+
this.barcodeCapture.controller.updateBarcodeCaptureOverlay(this);
|
|
1835
1860
|
}
|
|
1836
|
-
get
|
|
1837
|
-
return this.
|
|
1861
|
+
get viewfinder() {
|
|
1862
|
+
return this._viewfinder;
|
|
1838
1863
|
}
|
|
1839
|
-
set
|
|
1840
|
-
this.
|
|
1841
|
-
|
|
1864
|
+
set viewfinder(newViewfinder) {
|
|
1865
|
+
this._viewfinder = newViewfinder;
|
|
1866
|
+
if (newViewfinder) {
|
|
1867
|
+
this.eventEmitter.on('viewfinder.update', this.handleViewFinderUpdate);
|
|
1868
|
+
}
|
|
1869
|
+
else {
|
|
1870
|
+
this.eventEmitter.off('viewfinder.update');
|
|
1871
|
+
}
|
|
1872
|
+
this.barcodeCapture.controller.updateBarcodeCaptureOverlay(this);
|
|
1842
1873
|
}
|
|
1843
1874
|
get shouldShowScanAreaGuides() {
|
|
1844
1875
|
return this._shouldShowScanAreaGuides;
|
|
1845
1876
|
}
|
|
1846
1877
|
set shouldShowScanAreaGuides(shouldShow) {
|
|
1847
1878
|
this._shouldShowScanAreaGuides = shouldShow;
|
|
1848
|
-
this.
|
|
1849
|
-
}
|
|
1850
|
-
get shouldShowHints() {
|
|
1851
|
-
return this._shouldShowHints;
|
|
1852
|
-
}
|
|
1853
|
-
set shouldShowHints(shouldShow) {
|
|
1854
|
-
this._shouldShowHints = shouldShow;
|
|
1855
|
-
this.overlayController.updateBarcodeSelectionBasicOverlay(this);
|
|
1856
|
-
}
|
|
1857
|
-
get viewfinder() {
|
|
1858
|
-
return this._viewfinder;
|
|
1879
|
+
this.barcodeCapture.controller.updateBarcodeCaptureOverlay(this);
|
|
1859
1880
|
}
|
|
1860
1881
|
get style() {
|
|
1861
1882
|
return this._style;
|
|
1862
1883
|
}
|
|
1863
|
-
static
|
|
1864
|
-
return
|
|
1884
|
+
static withBarcodeCapture(barcodeCapture) {
|
|
1885
|
+
return BarcodeCaptureOverlay.withBarcodeCaptureForView(barcodeCapture, null);
|
|
1865
1886
|
}
|
|
1866
|
-
static
|
|
1867
|
-
return this.
|
|
1887
|
+
static withBarcodeCaptureForView(barcodeCapture, view) {
|
|
1888
|
+
return this.withBarcodeCaptureForViewWithStyle(barcodeCapture, view, BarcodeCaptureOverlay.barcodeCaptureDefaults.BarcodeCaptureOverlay.defaultStyle);
|
|
1868
1889
|
}
|
|
1869
|
-
static
|
|
1870
|
-
const overlay = new
|
|
1871
|
-
overlay.
|
|
1872
|
-
overlay._style = style;
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
overlay.
|
|
1876
|
-
overlay._selectingBrush = new Brush(BarcodeSelectionBasicOverlay.barcodeSelectionDefaults.BarcodeSelectionBasicOverlay.styles[style].DefaultSelectingBrush.fillColor, BarcodeSelectionBasicOverlay.barcodeSelectionDefaults.BarcodeSelectionBasicOverlay.styles[style].DefaultSelectingBrush.strokeColor, BarcodeSelectionBasicOverlay.barcodeSelectionDefaults.BarcodeSelectionBasicOverlay.styles[style].DefaultSelectingBrush.strokeWidth);
|
|
1890
|
+
static withBarcodeCaptureForViewWithStyle(barcodeCapture, view, style) {
|
|
1891
|
+
const overlay = new BarcodeCaptureOverlay();
|
|
1892
|
+
overlay.barcodeCapture = barcodeCapture;
|
|
1893
|
+
overlay._style = style;
|
|
1894
|
+
const barcodeCaptureOverlayDefaults = BarcodeCaptureOverlay.barcodeCaptureDefaults.BarcodeCaptureOverlay;
|
|
1895
|
+
const styles = barcodeCaptureOverlayDefaults.styles ? barcodeCaptureOverlayDefaults.styles : barcodeCaptureOverlayDefaults.Brushes;
|
|
1896
|
+
overlay._brush = new Brush(styles[style].DefaultBrush.fillColor, styles[style].DefaultBrush.strokeColor, styles[style].DefaultBrush.strokeWidth);
|
|
1877
1897
|
if (view) {
|
|
1878
1898
|
view.addOverlay(overlay);
|
|
1879
1899
|
}
|
|
1880
1900
|
return overlay;
|
|
1881
1901
|
}
|
|
1882
|
-
static get barcodeSelectionDefaults() {
|
|
1883
|
-
return getBarcodeSelectionDefaults();
|
|
1884
|
-
}
|
|
1885
1902
|
constructor() {
|
|
1886
1903
|
super();
|
|
1887
|
-
this.type = '
|
|
1888
|
-
this.overlayController = new BarcodeSelectionOverlayController();
|
|
1904
|
+
this.type = 'barcodeCapture';
|
|
1889
1905
|
this._shouldShowScanAreaGuides = false;
|
|
1890
|
-
this.
|
|
1891
|
-
this.
|
|
1892
|
-
this.
|
|
1893
|
-
this.
|
|
1894
|
-
this._selectedBrush = new Brush(BarcodeSelectionBasicOverlay.barcodeSelectionDefaults.BarcodeSelectionBasicOverlay.styles[BarcodeSelectionBasicOverlay.barcodeSelectionDefaults.BarcodeSelectionBasicOverlay.defaultStyle].DefaultSelectedBrush.fillColor, BarcodeSelectionBasicOverlay.barcodeSelectionDefaults.BarcodeSelectionBasicOverlay.styles[BarcodeSelectionBasicOverlay.barcodeSelectionDefaults.BarcodeSelectionBasicOverlay.defaultStyle].DefaultSelectedBrush.strokeColor, BarcodeSelectionBasicOverlay.barcodeSelectionDefaults.BarcodeSelectionBasicOverlay.styles[BarcodeSelectionBasicOverlay.barcodeSelectionDefaults.BarcodeSelectionBasicOverlay.defaultStyle].DefaultSelectedBrush.strokeWidth);
|
|
1895
|
-
this._selectingBrush = new Brush(BarcodeSelectionBasicOverlay.barcodeSelectionDefaults.BarcodeSelectionBasicOverlay.styles[BarcodeSelectionBasicOverlay.barcodeSelectionDefaults.BarcodeSelectionBasicOverlay.defaultStyle].DefaultSelectingBrush.fillColor, BarcodeSelectionBasicOverlay.barcodeSelectionDefaults.BarcodeSelectionBasicOverlay.styles[BarcodeSelectionBasicOverlay.barcodeSelectionDefaults.BarcodeSelectionBasicOverlay.defaultStyle].DefaultSelectingBrush.strokeColor, BarcodeSelectionBasicOverlay.barcodeSelectionDefaults.BarcodeSelectionBasicOverlay.styles[BarcodeSelectionBasicOverlay.barcodeSelectionDefaults.BarcodeSelectionBasicOverlay.defaultStyle].DefaultSelectingBrush.strokeWidth);
|
|
1896
|
-
}
|
|
1897
|
-
setTextForAimToSelectAutoHint(text) {
|
|
1898
|
-
return this.overlayController.setTextForAimToSelectAutoHint(text);
|
|
1899
|
-
}
|
|
1900
|
-
setAimedBarcodeBrushProvider(brushProvider) {
|
|
1901
|
-
return this.overlayController.setAimedBarcodeBrushProvider(brushProvider);
|
|
1906
|
+
this._viewfinder = null;
|
|
1907
|
+
this._brush = BarcodeCaptureOverlay.barcodeCaptureDefaults.BarcodeCaptureOverlay.DefaultBrush;
|
|
1908
|
+
this.eventEmitter = FactoryMaker.getInstance('EventEmitter');
|
|
1909
|
+
this.handleViewFinderUpdate = this.handleViewFinderUpdate.bind(this);
|
|
1902
1910
|
}
|
|
1903
|
-
|
|
1904
|
-
|
|
1911
|
+
handleViewFinderUpdate() {
|
|
1912
|
+
this.barcodeCapture.controller.updateBarcodeCaptureOverlay(this);
|
|
1905
1913
|
}
|
|
1906
1914
|
}
|
|
1907
1915
|
__decorate([
|
|
1908
1916
|
ignoreFromSerialization
|
|
1909
|
-
],
|
|
1910
|
-
__decorate([
|
|
1911
|
-
ignoreFromSerialization
|
|
1912
|
-
], BarcodeSelectionBasicOverlay.prototype, "overlayController", void 0);
|
|
1917
|
+
], BarcodeCaptureOverlay.prototype, "barcodeCapture", void 0);
|
|
1913
1918
|
__decorate([
|
|
1914
1919
|
ignoreFromSerialization
|
|
1915
|
-
],
|
|
1920
|
+
], BarcodeCaptureOverlay.prototype, "view", void 0);
|
|
1916
1921
|
__decorate([
|
|
1917
1922
|
nameForSerialization('shouldShowScanAreaGuides')
|
|
1918
|
-
],
|
|
1919
|
-
__decorate([
|
|
1920
|
-
nameForSerialization('shouldShowHints')
|
|
1921
|
-
], BarcodeSelectionBasicOverlay.prototype, "_shouldShowHints", void 0);
|
|
1923
|
+
], BarcodeCaptureOverlay.prototype, "_shouldShowScanAreaGuides", void 0);
|
|
1922
1924
|
__decorate([
|
|
1925
|
+
serializationDefault(NoViewfinder),
|
|
1923
1926
|
nameForSerialization('viewfinder')
|
|
1924
|
-
],
|
|
1927
|
+
], BarcodeCaptureOverlay.prototype, "_viewfinder", void 0);
|
|
1925
1928
|
__decorate([
|
|
1926
1929
|
nameForSerialization('style')
|
|
1927
|
-
],
|
|
1928
|
-
__decorate([
|
|
1929
|
-
nameForSerialization('trackedBrush')
|
|
1930
|
-
], BarcodeSelectionBasicOverlay.prototype, "_trackedBrush", void 0);
|
|
1931
|
-
__decorate([
|
|
1932
|
-
nameForSerialization('aimedBrush')
|
|
1933
|
-
], BarcodeSelectionBasicOverlay.prototype, "_aimedBrush", void 0);
|
|
1930
|
+
], BarcodeCaptureOverlay.prototype, "_style", void 0);
|
|
1934
1931
|
__decorate([
|
|
1935
|
-
|
|
1936
|
-
],
|
|
1932
|
+
ignoreFromSerialization
|
|
1933
|
+
], BarcodeCaptureOverlay.prototype, "eventEmitter", void 0);
|
|
1937
1934
|
__decorate([
|
|
1938
|
-
nameForSerialization('
|
|
1939
|
-
],
|
|
1935
|
+
nameForSerialization('brush')
|
|
1936
|
+
], BarcodeCaptureOverlay.prototype, "_brush", void 0);
|
|
1940
1937
|
__decorate([
|
|
1941
1938
|
ignoreFromSerialization
|
|
1942
|
-
],
|
|
1939
|
+
], BarcodeCaptureOverlay, "barcodeCaptureDefaults", null);
|
|
1943
1940
|
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1941
|
+
var BarcodeCaptureOverlayStyle;
|
|
1942
|
+
(function (BarcodeCaptureOverlayStyle) {
|
|
1943
|
+
BarcodeCaptureOverlayStyle["Frame"] = "frame";
|
|
1944
|
+
/**
|
|
1945
|
+
* @deprecated The legacy is deprecated.
|
|
1946
|
+
*/
|
|
1947
|
+
BarcodeCaptureOverlayStyle["Legacy"] = "legacy";
|
|
1948
|
+
})(BarcodeCaptureOverlayStyle || (BarcodeCaptureOverlayStyle = {}));
|
|
1949
|
+
|
|
1950
|
+
class BarcodeCaptureSettings extends DefaultSerializeable {
|
|
1951
|
+
get enabledSymbologies() {
|
|
1952
|
+
return Object.keys(this.symbologies)
|
|
1953
|
+
.filter(symbology => this.symbologies[symbology].isEnabled);
|
|
1948
1954
|
}
|
|
1949
|
-
|
|
1950
|
-
return
|
|
1955
|
+
get compositeTypeDescriptions() {
|
|
1956
|
+
return BarcodeCaptureSettings.barcodeDefaults.CompositeTypeDescriptions.reduce((descriptions, description) => {
|
|
1957
|
+
descriptions[description.types[0]] = description;
|
|
1958
|
+
return descriptions;
|
|
1959
|
+
}, {});
|
|
1951
1960
|
}
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
constructor() {
|
|
1955
|
-
super(...arguments);
|
|
1956
|
-
this.type = BarcodeSelectionStrategyType.Manual;
|
|
1961
|
+
static get barcodeDefaults() {
|
|
1962
|
+
return getBarcodeDefaults();
|
|
1957
1963
|
}
|
|
1958
|
-
static get
|
|
1959
|
-
return
|
|
1964
|
+
static get barcodeCaptureDefaults() {
|
|
1965
|
+
return getBarcodeCaptureDefaults();
|
|
1960
1966
|
}
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1967
|
+
constructor() {
|
|
1968
|
+
super();
|
|
1969
|
+
this.locationSelection = null;
|
|
1970
|
+
this.enabledCompositeTypes = [];
|
|
1971
|
+
this.properties = {};
|
|
1972
|
+
this.symbologies = {};
|
|
1973
|
+
this._codeDuplicateFilter = BarcodeCaptureSettings.barcodeCaptureDefaults.BarcodeCaptureSettings.codeDuplicateFilter;
|
|
1974
|
+
this._arucoDictionary = null;
|
|
1975
|
+
/**
|
|
1976
|
+
* @deprecated replaced with batterySaving
|
|
1977
|
+
*/
|
|
1978
|
+
this.batterySavingMode = BarcodeCaptureSettings.barcodeCaptureDefaults.BarcodeCaptureSettings.batterySaving;
|
|
1979
|
+
this.batterySaving = BarcodeCaptureSettings.barcodeCaptureDefaults.BarcodeCaptureSettings.batterySaving;
|
|
1980
|
+
this.scanIntention = BarcodeCaptureSettings.barcodeCaptureDefaults.BarcodeCaptureSettings.scanIntention;
|
|
1981
|
+
}
|
|
1982
|
+
settingsForSymbology(symbology) {
|
|
1983
|
+
if (!this.symbologies[symbology]) {
|
|
1984
|
+
const symbologySettings = BarcodeCaptureSettings.barcodeDefaults.SymbologySettings[symbology];
|
|
1985
|
+
symbologySettings._symbology = symbology;
|
|
1986
|
+
this.symbologies[symbology] = symbologySettings;
|
|
1971
1987
|
}
|
|
1988
|
+
return this.symbologies[symbology];
|
|
1972
1989
|
}
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
class BarcodeSelectionTapSelection extends DefaultSerializeable {
|
|
1976
|
-
constructor() {
|
|
1977
|
-
super(...arguments);
|
|
1978
|
-
this.type = BarcodeSelectionTypeName.Tap;
|
|
1979
|
-
this.freezeBehavior = BarcodeSelectionTapSelection.barcodeSelectionDefaults.BarcodeSelectionTapSelection.defaultFreezeBehavior;
|
|
1980
|
-
this.tapBehavior = BarcodeSelectionTapSelection.barcodeSelectionDefaults.BarcodeSelectionTapSelection.defaultTapBehavior;
|
|
1990
|
+
setProperty(name, value) {
|
|
1991
|
+
this.properties[name] = value;
|
|
1981
1992
|
}
|
|
1982
|
-
|
|
1983
|
-
return
|
|
1993
|
+
getProperty(name) {
|
|
1994
|
+
return this.properties[name];
|
|
1984
1995
|
}
|
|
1985
|
-
|
|
1986
|
-
|
|
1996
|
+
enableSymbologies(symbologies) {
|
|
1997
|
+
symbologies.forEach(symbology => this.enableSymbology(symbology, true));
|
|
1987
1998
|
}
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1999
|
+
enableSymbology(symbology, enabled) {
|
|
2000
|
+
this.settingsForSymbology(symbology).isEnabled = enabled;
|
|
2001
|
+
}
|
|
2002
|
+
enableSymbologiesForCompositeTypes(compositeTypes) {
|
|
2003
|
+
compositeTypes.forEach(compositeType => {
|
|
2004
|
+
this.enableSymbologies(this.compositeTypeDescriptions[compositeType].symbologies);
|
|
2005
|
+
});
|
|
2006
|
+
}
|
|
2007
|
+
setArucoDictionary(dictionary) {
|
|
2008
|
+
this._arucoDictionary = dictionary;
|
|
2009
|
+
}
|
|
2010
|
+
get codeDuplicateFilter() {
|
|
2011
|
+
return this._codeDuplicateFilter;
|
|
2012
|
+
}
|
|
2013
|
+
set codeDuplicateFilter(value) {
|
|
2014
|
+
this._codeDuplicateFilter = value;
|
|
1993
2015
|
}
|
|
1994
2016
|
}
|
|
2017
|
+
__decorate([
|
|
2018
|
+
serializationDefault(NoneLocationSelection)
|
|
2019
|
+
], BarcodeCaptureSettings.prototype, "locationSelection", void 0);
|
|
2020
|
+
__decorate([
|
|
2021
|
+
nameForSerialization('codeDuplicateFilter')
|
|
2022
|
+
], BarcodeCaptureSettings.prototype, "_codeDuplicateFilter", void 0);
|
|
2023
|
+
__decorate([
|
|
2024
|
+
nameForSerialization('arucoDictionary')
|
|
2025
|
+
], BarcodeCaptureSettings.prototype, "_arucoDictionary", void 0);
|
|
1995
2026
|
__decorate([
|
|
1996
2027
|
ignoreFromSerialization
|
|
1997
|
-
],
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2028
|
+
], BarcodeCaptureSettings, "barcodeDefaults", null);
|
|
2029
|
+
__decorate([
|
|
2030
|
+
ignoreFromSerialization
|
|
2031
|
+
], BarcodeCaptureSettings, "barcodeCaptureDefaults", null);
|
|
2032
|
+
|
|
2033
|
+
class BarcodeSelectionSession {
|
|
2034
|
+
get selectedBarcodes() {
|
|
2035
|
+
return this._selectedBarcodes;
|
|
2001
2036
|
}
|
|
2002
|
-
|
|
2003
|
-
return
|
|
2037
|
+
get newlySelectedBarcodes() {
|
|
2038
|
+
return this._newlySelectedBarcodes;
|
|
2039
|
+
}
|
|
2040
|
+
get newlyUnselectedBarcodes() {
|
|
2041
|
+
return this._newlyUnselectedBarcodes;
|
|
2042
|
+
}
|
|
2043
|
+
get frameSequenceID() {
|
|
2044
|
+
return this._frameSequenceID;
|
|
2045
|
+
}
|
|
2046
|
+
static fromJSON(json) {
|
|
2047
|
+
const session = new BarcodeSelectionSession();
|
|
2048
|
+
session._selectedBarcodes = json.selectedBarcodes
|
|
2049
|
+
.map(Barcode.fromJSON);
|
|
2050
|
+
session._newlySelectedBarcodes = json.newlySelectedBarcodes
|
|
2051
|
+
.map(Barcode.fromJSON);
|
|
2052
|
+
session._newlyUnselectedBarcodes = json.newlyUnselectedBarcodes
|
|
2053
|
+
.map(Barcode.fromJSON);
|
|
2054
|
+
session._frameSequenceID = json.frameSequenceId;
|
|
2055
|
+
return session;
|
|
2056
|
+
}
|
|
2057
|
+
getCount(barcode) {
|
|
2058
|
+
return this.listenerController.getCount(barcode);
|
|
2059
|
+
}
|
|
2060
|
+
reset() {
|
|
2061
|
+
return this.listenerController.reset();
|
|
2062
|
+
}
|
|
2063
|
+
}
|
|
2064
|
+
|
|
2065
|
+
var BarcodeSelectionListenerEvents;
|
|
2066
|
+
(function (BarcodeSelectionListenerEvents) {
|
|
2067
|
+
BarcodeSelectionListenerEvents["inCallback"] = "BarcodeSelectionListener.inCallback";
|
|
2068
|
+
BarcodeSelectionListenerEvents["didUpdateSelection"] = "BarcodeSelectionListener.didUpdateSelection";
|
|
2069
|
+
BarcodeSelectionListenerEvents["didUpdateSession"] = "BarcodeSelectionListener.didUpdateSession";
|
|
2070
|
+
})(BarcodeSelectionListenerEvents || (BarcodeSelectionListenerEvents = {}));
|
|
2071
|
+
class BarcodeSelectionListenerController {
|
|
2072
|
+
get _proxy() {
|
|
2073
|
+
return FactoryMaker.getInstance('BarcodeSelectionListenerProxy');
|
|
2074
|
+
}
|
|
2075
|
+
static forBarcodeSelection(barcodeSelection) {
|
|
2076
|
+
const controller = new BarcodeSelectionListenerController();
|
|
2077
|
+
controller.barcodeSelection = barcodeSelection;
|
|
2078
|
+
controller._proxy.isModeEnabled = () => barcodeSelection.isEnabled;
|
|
2079
|
+
return controller;
|
|
2004
2080
|
}
|
|
2005
2081
|
constructor() {
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2082
|
+
this.eventEmitter = FactoryMaker.getInstance('EventEmitter');
|
|
2083
|
+
}
|
|
2084
|
+
getCount(barcode) {
|
|
2085
|
+
return this._proxy.getCount(barcode.selectionIdentifier);
|
|
2086
|
+
}
|
|
2087
|
+
reset() {
|
|
2088
|
+
return this._proxy.resetSession();
|
|
2089
|
+
}
|
|
2090
|
+
subscribeListener() {
|
|
2091
|
+
var _a, _b, _c, _d;
|
|
2092
|
+
this._proxy.registerListenerForEvents();
|
|
2093
|
+
(_b = (_a = this._proxy).subscribeDidUpdateSelectionListener) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
2094
|
+
(_d = (_c = this._proxy).subscribeDidUpdateSession) === null || _d === void 0 ? void 0 : _d.call(_c);
|
|
2095
|
+
this.eventEmitter.on(BarcodeSelectionListenerEvents.didUpdateSelection, (body) => {
|
|
2096
|
+
const payload = JSON.parse(body);
|
|
2097
|
+
const session = BarcodeSelectionSession.fromJSON(JSON.parse(payload.session));
|
|
2098
|
+
session.listenerController = this;
|
|
2099
|
+
this.notifyListenersOfDidUpdateSelection(session);
|
|
2100
|
+
this._proxy.finishDidUpdateSelectionCallback(this.barcodeSelection.isEnabled);
|
|
2101
|
+
});
|
|
2102
|
+
this.eventEmitter.on(BarcodeSelectionListenerEvents.didUpdateSession, (body) => {
|
|
2103
|
+
const payload = JSON.parse(body);
|
|
2104
|
+
const session = BarcodeSelectionSession.fromJSON(JSON.parse(payload.session));
|
|
2105
|
+
session.listenerController = this;
|
|
2106
|
+
this.notifyListenersOfDidUpdateSession(session);
|
|
2107
|
+
this._proxy.finishDidUpdateSessionCallback(this.barcodeSelection.isEnabled);
|
|
2108
|
+
});
|
|
2010
2109
|
}
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
class PrivateBarcodeSelectionType {
|
|
2016
|
-
static fromJSON(json) {
|
|
2017
|
-
switch (json.type) {
|
|
2018
|
-
case BarcodeSelectionTypeName.Aimer:
|
|
2019
|
-
return PrivateBarcodeSelectionAimerSelection.fromJSON(json);
|
|
2020
|
-
case BarcodeSelectionTypeName.Tap:
|
|
2021
|
-
return PrivateBarcodeSelectionTapSelection.fromJSON(json);
|
|
2022
|
-
default:
|
|
2023
|
-
throw new Error('Unknown selection strategy type: ' + json.type);
|
|
2024
|
-
}
|
|
2110
|
+
unsubscribeListener() {
|
|
2111
|
+
this._proxy.unregisterListenerForEvents();
|
|
2112
|
+
this.eventEmitter.removeAllListeners(BarcodeSelectionListenerEvents.didUpdateSelection);
|
|
2113
|
+
this.eventEmitter.removeAllListeners(BarcodeSelectionListenerEvents.didUpdateSession);
|
|
2025
2114
|
}
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2115
|
+
notifyListenersOfDidUpdateSelection(session) {
|
|
2116
|
+
const mode = this.barcodeSelection;
|
|
2117
|
+
mode.isInListenerCallback = true;
|
|
2118
|
+
mode.listeners.forEach(listener => {
|
|
2119
|
+
if (listener.didUpdateSelection) {
|
|
2120
|
+
listener.didUpdateSelection(this.barcodeSelection, session, CameraController.getLastFrame);
|
|
2121
|
+
}
|
|
2122
|
+
});
|
|
2123
|
+
mode.isInListenerCallback = false;
|
|
2032
2124
|
}
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2125
|
+
notifyListenersOfDidUpdateSession(session) {
|
|
2126
|
+
const mode = this.barcodeSelection;
|
|
2127
|
+
mode.isInListenerCallback = true;
|
|
2128
|
+
mode.listeners.forEach(listener => {
|
|
2129
|
+
if (listener.didUpdateSession) {
|
|
2130
|
+
listener.didUpdateSession(this.barcodeSelection, session, CameraController.getLastFrame);
|
|
2131
|
+
}
|
|
2132
|
+
});
|
|
2133
|
+
mode.isInListenerCallback = false;
|
|
2040
2134
|
}
|
|
2041
2135
|
}
|
|
2042
2136
|
|
|
2043
|
-
class
|
|
2044
|
-
|
|
2045
|
-
return
|
|
2046
|
-
}
|
|
2047
|
-
static get barcodeDefaults() {
|
|
2048
|
-
return getBarcodeDefaults();
|
|
2049
|
-
}
|
|
2050
|
-
get enabledSymbologies() {
|
|
2051
|
-
return Object.keys(this.symbologies)
|
|
2052
|
-
.filter(symbology => this.symbologies[symbology].isEnabled);
|
|
2137
|
+
class BarcodeSelectionController {
|
|
2138
|
+
get _proxy() {
|
|
2139
|
+
return FactoryMaker.getInstance('BarcodeSelectionProxy');
|
|
2053
2140
|
}
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
this.codeDuplicateFilter = BarcodeSelectionSettings.barcodeSelectionDefaults.BarcodeSelectionSettings.codeDuplicateFilter;
|
|
2057
|
-
this.singleBarcodeAutoDetection = BarcodeSelectionSettings.barcodeSelectionDefaults.BarcodeSelectionSettings.singleBarcodeAutoDetection;
|
|
2058
|
-
this.selectionType = BarcodeSelectionSettings.barcodeSelectionDefaults.BarcodeSelectionSettings.selectionType(PrivateBarcodeSelectionType.fromJSON);
|
|
2059
|
-
this.properties = {};
|
|
2060
|
-
this.symbologies = {};
|
|
2141
|
+
unfreezeCamera() {
|
|
2142
|
+
return this._proxy.unfreezeCamera();
|
|
2061
2143
|
}
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
const symbologySettings = BarcodeSelectionSettings.barcodeDefaults.SymbologySettings[symbology];
|
|
2065
|
-
symbologySettings._symbology = symbology;
|
|
2066
|
-
this.symbologies[symbology] = symbologySettings;
|
|
2067
|
-
}
|
|
2068
|
-
return this.symbologies[symbology];
|
|
2144
|
+
reset() {
|
|
2145
|
+
return this._proxy.resetMode();
|
|
2069
2146
|
}
|
|
2070
|
-
|
|
2071
|
-
this.
|
|
2147
|
+
selectAimedBarcode() {
|
|
2148
|
+
return this._proxy.selectAimedBarcode();
|
|
2072
2149
|
}
|
|
2073
|
-
|
|
2074
|
-
|
|
2150
|
+
unselectBarcodes(barcodes) {
|
|
2151
|
+
const barcodesJson = this.convertBarcodesToJson(barcodes);
|
|
2152
|
+
return this._proxy.unselectBarcodes(JSON.stringify({ barcodes: barcodesJson }));
|
|
2075
2153
|
}
|
|
2076
|
-
|
|
2077
|
-
|
|
2154
|
+
setSelectBarcodeEnabled(barcode, enabled) {
|
|
2155
|
+
const barcodesJson = this.convertBarcodesToJson([barcode]);
|
|
2156
|
+
return this._proxy.setSelectBarcodeEnabled(JSON.stringify(barcodesJson[0]), enabled);
|
|
2078
2157
|
}
|
|
2079
|
-
|
|
2080
|
-
this.
|
|
2158
|
+
increaseCountForBarcodes(barcodes) {
|
|
2159
|
+
const barcodesJson = this.convertBarcodesToJson(barcodes);
|
|
2160
|
+
return this._proxy.increaseCountForBarcodes(JSON.stringify({ barcodes: barcodesJson }));
|
|
2081
2161
|
}
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
ignoreFromSerialization
|
|
2085
|
-
], BarcodeSelectionSettings, "barcodeSelectionDefaults", null);
|
|
2086
|
-
__decorate([
|
|
2087
|
-
ignoreFromSerialization
|
|
2088
|
-
], BarcodeSelectionSettings, "barcodeDefaults", null);
|
|
2089
|
-
|
|
2090
|
-
class BarcodeCountFeedback extends DefaultSerializeable {
|
|
2091
|
-
static get default() {
|
|
2092
|
-
return new BarcodeCountFeedback(BarcodeCountFeedback.barcodeCountDefaults.Feedback.success, BarcodeCountFeedback.barcodeCountDefaults.Feedback.failure);
|
|
2162
|
+
setModeEnabledState(enabled) {
|
|
2163
|
+
this._proxy.setModeEnabledState(enabled);
|
|
2093
2164
|
}
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
const failure = Feedback.fromJSON(json.failure);
|
|
2097
|
-
return new BarcodeCountFeedback(success, failure);
|
|
2165
|
+
updateBarcodeSelectionMode(barcodeSelection) {
|
|
2166
|
+
return this._proxy.updateBarcodeSelectionMode(JSON.stringify(barcodeSelection.toJSON()));
|
|
2098
2167
|
}
|
|
2099
|
-
|
|
2100
|
-
return
|
|
2168
|
+
applyBarcodeSelectionModeSettings(newSettings) {
|
|
2169
|
+
return this._proxy.applyBarcodeSelectionModeSettings(JSON.stringify(newSettings.toJSON()));
|
|
2101
2170
|
}
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2171
|
+
convertBarcodesToJson(barcodes) {
|
|
2172
|
+
return barcodes.flat().map((barcode) => ({
|
|
2173
|
+
data: barcode.data,
|
|
2174
|
+
rawData: barcode.rawData,
|
|
2175
|
+
symbology: barcode.symbology,
|
|
2176
|
+
symbolCount: barcode.symbolCount
|
|
2177
|
+
}));
|
|
2108
2178
|
}
|
|
2109
2179
|
}
|
|
2110
|
-
__decorate([
|
|
2111
|
-
ignoreFromSerialization
|
|
2112
|
-
], BarcodeCountFeedback, "barcodeCountDefaults", null);
|
|
2113
2180
|
|
|
2114
|
-
class
|
|
2115
|
-
get
|
|
2116
|
-
return this.
|
|
2181
|
+
class BarcodeSelection extends DefaultSerializeable {
|
|
2182
|
+
get isEnabled() {
|
|
2183
|
+
return this._isEnabled;
|
|
2117
2184
|
}
|
|
2118
|
-
|
|
2119
|
-
|
|
2185
|
+
set isEnabled(isEnabled) {
|
|
2186
|
+
this._isEnabled = isEnabled;
|
|
2187
|
+
this.modeController.setModeEnabledState(isEnabled);
|
|
2120
2188
|
}
|
|
2121
|
-
get
|
|
2122
|
-
return this.
|
|
2189
|
+
get context() {
|
|
2190
|
+
return this._context;
|
|
2123
2191
|
}
|
|
2124
|
-
get
|
|
2125
|
-
return this.
|
|
2192
|
+
get feedback() {
|
|
2193
|
+
return this._feedback;
|
|
2126
2194
|
}
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
const missingBarcodes = json.missingBarcodes;
|
|
2131
|
-
const additionalBarcodes = json.additionalBarcodes;
|
|
2132
|
-
return new BarcodeCountCaptureListSession(correctBarcodes, wrongBarcodes, missingBarcodes, additionalBarcodes);
|
|
2195
|
+
set feedback(feedback) {
|
|
2196
|
+
this._feedback = feedback;
|
|
2197
|
+
this.modeController.updateBarcodeSelectionMode(this);
|
|
2133
2198
|
}
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
this._correctBarcodes = correctBarcodes;
|
|
2137
|
-
this._wrongBarcodes = wrongBarcodes;
|
|
2138
|
-
this._missingBarcodes = missingBarcodes;
|
|
2139
|
-
this._additionalBarcodes = additionalBarcodes;
|
|
2199
|
+
get pointOfInterest() {
|
|
2200
|
+
return this._pointOfInterest;
|
|
2140
2201
|
}
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
], BarcodeCountCaptureListSession.prototype, "_correctBarcodes", void 0);
|
|
2145
|
-
__decorate([
|
|
2146
|
-
nameForSerialization('wrongBarcodes')
|
|
2147
|
-
], BarcodeCountCaptureListSession.prototype, "_wrongBarcodes", void 0);
|
|
2148
|
-
__decorate([
|
|
2149
|
-
nameForSerialization('missingBarcodes')
|
|
2150
|
-
], BarcodeCountCaptureListSession.prototype, "_missingBarcodes", void 0);
|
|
2151
|
-
__decorate([
|
|
2152
|
-
nameForSerialization('additionalBarcodes')
|
|
2153
|
-
], BarcodeCountCaptureListSession.prototype, "_additionalBarcodes", void 0);
|
|
2154
|
-
|
|
2155
|
-
class BarcodeCountSessionController {
|
|
2156
|
-
get _proxy() {
|
|
2157
|
-
return FactoryMaker.getInstance('BarcodeCountSessionProxy');
|
|
2202
|
+
set pointOfInterest(pointOfInterest) {
|
|
2203
|
+
this._pointOfInterest = pointOfInterest;
|
|
2204
|
+
this.modeController.updateBarcodeSelectionMode(this);
|
|
2158
2205
|
}
|
|
2159
|
-
|
|
2160
|
-
return
|
|
2206
|
+
static get recommendedCameraSettings() {
|
|
2207
|
+
return BarcodeSelection.barcodeSelectionDefaults.RecommendedCameraSettings;
|
|
2161
2208
|
}
|
|
2162
|
-
|
|
2163
|
-
return
|
|
2164
|
-
const barcodeSpatialGridJSON = yield this._proxy.getSpatialMap();
|
|
2165
|
-
if (barcodeSpatialGridJSON) {
|
|
2166
|
-
const payload = JSON.parse(barcodeSpatialGridJSON);
|
|
2167
|
-
return BarcodeSpatialGrid.fromJSON(payload);
|
|
2168
|
-
}
|
|
2169
|
-
});
|
|
2209
|
+
get _context() {
|
|
2210
|
+
return this.privateContext;
|
|
2170
2211
|
}
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2212
|
+
set _context(newContext) {
|
|
2213
|
+
if (newContext == null) {
|
|
2214
|
+
this.listenerController.unsubscribeListener();
|
|
2215
|
+
}
|
|
2216
|
+
else if (this.privateContext == null) {
|
|
2217
|
+
this.listenerController.subscribeListener();
|
|
2218
|
+
}
|
|
2219
|
+
this.privateContext = newContext;
|
|
2179
2220
|
}
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
static
|
|
2184
|
-
const
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
const trackedBarcode = TrackedBarcode.fromJSON(value, session._frameSequenceID);
|
|
2191
|
-
session._recognizedBarcodes[parseInt(key, 10)] = trackedBarcode;
|
|
2192
|
-
});
|
|
2193
|
-
return session;
|
|
2221
|
+
static get barcodeSelectionDefaults() {
|
|
2222
|
+
return getBarcodeSelectionDefaults();
|
|
2223
|
+
}
|
|
2224
|
+
static forContext(context, settings) {
|
|
2225
|
+
const barcodeSelection = new BarcodeSelection();
|
|
2226
|
+
barcodeSelection.settings = settings;
|
|
2227
|
+
if (context) {
|
|
2228
|
+
context.addMode(barcodeSelection);
|
|
2229
|
+
}
|
|
2230
|
+
return barcodeSelection;
|
|
2194
2231
|
}
|
|
2195
2232
|
constructor() {
|
|
2196
2233
|
super();
|
|
2197
|
-
this.
|
|
2234
|
+
this.type = 'barcodeSelection';
|
|
2235
|
+
this._isEnabled = true;
|
|
2236
|
+
this._pointOfInterest = null;
|
|
2237
|
+
this.privateContext = null;
|
|
2238
|
+
this.listeners = [];
|
|
2239
|
+
this.modeController = new BarcodeSelectionController();
|
|
2240
|
+
this.isInListenerCallback = false;
|
|
2241
|
+
this.listenerController = BarcodeSelectionListenerController.forBarcodeSelection(this);
|
|
2198
2242
|
}
|
|
2199
|
-
|
|
2200
|
-
|
|
2243
|
+
applySettings(settings) {
|
|
2244
|
+
this.settings = settings;
|
|
2245
|
+
return this.modeController.applyBarcodeSelectionModeSettings(settings);
|
|
2201
2246
|
}
|
|
2202
|
-
|
|
2203
|
-
|
|
2247
|
+
addListener(listener) {
|
|
2248
|
+
if (listener == undefined) {
|
|
2249
|
+
return;
|
|
2250
|
+
}
|
|
2251
|
+
if (this.listeners.includes(listener)) {
|
|
2252
|
+
return;
|
|
2253
|
+
}
|
|
2254
|
+
this.listeners.push(listener);
|
|
2204
2255
|
}
|
|
2205
|
-
|
|
2206
|
-
|
|
2256
|
+
removeListener(listener) {
|
|
2257
|
+
if (!this.listeners.includes(listener)) {
|
|
2258
|
+
return;
|
|
2259
|
+
}
|
|
2260
|
+
this.listeners.splice(this.listeners.indexOf(listener), 1);
|
|
2207
2261
|
}
|
|
2208
2262
|
reset() {
|
|
2209
|
-
return this.
|
|
2263
|
+
return this.modeController.reset();
|
|
2210
2264
|
}
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
2214
|
-
return (_a = yield this.sessionController.getSpatialMap()) !== null && _a !== void 0 ? _a : null;
|
|
2215
|
-
});
|
|
2265
|
+
unfreezeCamera() {
|
|
2266
|
+
return this.modeController.unfreezeCamera();
|
|
2216
2267
|
}
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
|
|
2268
|
+
selectAimedBarcode() {
|
|
2269
|
+
return this.modeController.selectAimedBarcode();
|
|
2270
|
+
}
|
|
2271
|
+
unselectBarcodes(barcodes) {
|
|
2272
|
+
return this.modeController.unselectBarcodes(barcodes);
|
|
2273
|
+
}
|
|
2274
|
+
setSelectBarcodeEnabled(barcode, enabled) {
|
|
2275
|
+
return this.modeController.setSelectBarcodeEnabled(barcode, enabled);
|
|
2276
|
+
}
|
|
2277
|
+
increaseCountForBarcodes(barcodes) {
|
|
2278
|
+
return this.modeController.increaseCountForBarcodes(barcodes);
|
|
2222
2279
|
}
|
|
2223
2280
|
}
|
|
2224
2281
|
__decorate([
|
|
2225
|
-
|
|
2226
|
-
],
|
|
2282
|
+
ignoreFromSerialization
|
|
2283
|
+
], BarcodeSelection.prototype, "_isEnabled", void 0);
|
|
2227
2284
|
__decorate([
|
|
2228
|
-
nameForSerialization('
|
|
2229
|
-
],
|
|
2285
|
+
nameForSerialization('feedback')
|
|
2286
|
+
], BarcodeSelection.prototype, "_feedback", void 0);
|
|
2230
2287
|
__decorate([
|
|
2231
|
-
nameForSerialization('
|
|
2232
|
-
],
|
|
2288
|
+
nameForSerialization('pointOfInterest')
|
|
2289
|
+
], BarcodeSelection.prototype, "_pointOfInterest", void 0);
|
|
2233
2290
|
__decorate([
|
|
2234
2291
|
ignoreFromSerialization
|
|
2235
|
-
],
|
|
2292
|
+
], BarcodeSelection.prototype, "privateContext", void 0);
|
|
2293
|
+
__decorate([
|
|
2294
|
+
ignoreFromSerialization
|
|
2295
|
+
], BarcodeSelection.prototype, "listeners", void 0);
|
|
2296
|
+
__decorate([
|
|
2297
|
+
ignoreFromSerialization
|
|
2298
|
+
], BarcodeSelection.prototype, "listenerController", void 0);
|
|
2299
|
+
__decorate([
|
|
2300
|
+
ignoreFromSerialization
|
|
2301
|
+
], BarcodeSelection.prototype, "modeController", void 0);
|
|
2302
|
+
__decorate([
|
|
2303
|
+
ignoreFromSerialization
|
|
2304
|
+
], BarcodeSelection.prototype, "isInListenerCallback", void 0);
|
|
2305
|
+
__decorate([
|
|
2306
|
+
ignoreFromSerialization
|
|
2307
|
+
], BarcodeSelection, "barcodeSelectionDefaults", null);
|
|
2236
2308
|
|
|
2237
|
-
var
|
|
2238
|
-
(function (
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
|
|
2309
|
+
var BarcodeSelectionBasicOverlayStyle;
|
|
2310
|
+
(function (BarcodeSelectionBasicOverlayStyle) {
|
|
2311
|
+
BarcodeSelectionBasicOverlayStyle["Frame"] = "frame";
|
|
2312
|
+
BarcodeSelectionBasicOverlayStyle["Dot"] = "dot";
|
|
2313
|
+
})(BarcodeSelectionBasicOverlayStyle || (BarcodeSelectionBasicOverlayStyle = {}));
|
|
2314
|
+
|
|
2315
|
+
var BarcodeSelectionFreezeBehavior;
|
|
2316
|
+
(function (BarcodeSelectionFreezeBehavior) {
|
|
2317
|
+
BarcodeSelectionFreezeBehavior["Manual"] = "manual";
|
|
2318
|
+
BarcodeSelectionFreezeBehavior["ManualAndAutomatic"] = "manualAndAutomatic";
|
|
2319
|
+
})(BarcodeSelectionFreezeBehavior || (BarcodeSelectionFreezeBehavior = {}));
|
|
2320
|
+
|
|
2321
|
+
var BarcodeSelectionStrategyType;
|
|
2322
|
+
(function (BarcodeSelectionStrategyType) {
|
|
2323
|
+
BarcodeSelectionStrategyType["Auto"] = "autoSelectionStrategy";
|
|
2324
|
+
BarcodeSelectionStrategyType["Manual"] = "manualSelectionStrategy";
|
|
2325
|
+
})(BarcodeSelectionStrategyType || (BarcodeSelectionStrategyType = {}));
|
|
2326
|
+
|
|
2327
|
+
var BarcodeSelectionTapBehavior;
|
|
2328
|
+
(function (BarcodeSelectionTapBehavior) {
|
|
2329
|
+
BarcodeSelectionTapBehavior["ToggleSelection"] = "toggleSelection";
|
|
2330
|
+
BarcodeSelectionTapBehavior["RepeatSelection"] = "repeatSelection";
|
|
2331
|
+
})(BarcodeSelectionTapBehavior || (BarcodeSelectionTapBehavior = {}));
|
|
2332
|
+
|
|
2333
|
+
var BarcodeSelectionTypeName;
|
|
2334
|
+
(function (BarcodeSelectionTypeName) {
|
|
2335
|
+
BarcodeSelectionTypeName["Aimer"] = "aimerSelection";
|
|
2336
|
+
BarcodeSelectionTypeName["Tap"] = "tapSelection";
|
|
2337
|
+
})(BarcodeSelectionTypeName || (BarcodeSelectionTypeName = {}));
|
|
2338
|
+
|
|
2339
|
+
class BarcodeSelectionFeedback extends DefaultSerializeable {
|
|
2247
2340
|
constructor() {
|
|
2248
|
-
|
|
2341
|
+
super(...arguments);
|
|
2342
|
+
this.selection = BarcodeSelectionFeedback.barcodeSelectionDefaults.Feedback.selection;
|
|
2249
2343
|
}
|
|
2250
|
-
static
|
|
2251
|
-
|
|
2252
|
-
controller.barcodeCount = barcodeCount;
|
|
2253
|
-
controller._proxy.isModeEnabled = () => barcodeCount.isEnabled;
|
|
2254
|
-
return controller;
|
|
2344
|
+
static get barcodeSelectionDefaults() {
|
|
2345
|
+
return getBarcodeSelectionDefaults();
|
|
2255
2346
|
}
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
const json = JSON.stringify(barcodeCount);
|
|
2259
|
-
return this._proxy.updateMode(json);
|
|
2347
|
+
static get default() {
|
|
2348
|
+
return new BarcodeSelectionFeedback();
|
|
2260
2349
|
}
|
|
2261
|
-
|
|
2262
|
-
|
|
2350
|
+
}
|
|
2351
|
+
__decorate([
|
|
2352
|
+
ignoreFromSerialization
|
|
2353
|
+
], BarcodeSelectionFeedback, "barcodeSelectionDefaults", null);
|
|
2354
|
+
|
|
2355
|
+
var BarcodeSelectionBrushProviderEvents;
|
|
2356
|
+
(function (BarcodeSelectionBrushProviderEvents) {
|
|
2357
|
+
BarcodeSelectionBrushProviderEvents["inCallback"] = "BarcodeSelectionAimedBrushProvider.inCallback";
|
|
2358
|
+
BarcodeSelectionBrushProviderEvents["brushForAimedBarcode"] = "BarcodeSelectionAimedBrushProvider.brushForBarcode";
|
|
2359
|
+
BarcodeSelectionBrushProviderEvents["brushForTrackedBarcode"] = "BarcodeSelectionTrackedBrushProvider.brushForBarcode";
|
|
2360
|
+
})(BarcodeSelectionBrushProviderEvents || (BarcodeSelectionBrushProviderEvents = {}));
|
|
2361
|
+
class BarcodeSelectionOverlayController {
|
|
2362
|
+
get _proxy() {
|
|
2363
|
+
return FactoryMaker.getInstance('BarcodeSelectionOverlayProxy');
|
|
2263
2364
|
}
|
|
2264
|
-
|
|
2265
|
-
this.
|
|
2365
|
+
constructor() {
|
|
2366
|
+
this.eventEmitter = FactoryMaker.getInstance('EventEmitter');
|
|
2266
2367
|
}
|
|
2267
|
-
|
|
2268
|
-
this
|
|
2269
|
-
|
|
2270
|
-
this._proxy.subscribeDidListSessionUpdate();
|
|
2271
|
-
this.eventEmitter.on(BarcodeCountListenerEvents.didScan, (body) => {
|
|
2272
|
-
const payload = JSON.parse(body);
|
|
2273
|
-
const session = BarcodeCountSession.fromJSON(JSON.parse(payload.session));
|
|
2274
|
-
this.notifyListenersOfDidScanSession(session);
|
|
2275
|
-
this._proxy.finishOnScan();
|
|
2276
|
-
});
|
|
2277
|
-
this.eventEmitter.on(BarcodeCountListenerEvents.didListSessionUpdate, (body) => {
|
|
2278
|
-
const payload = JSON.parse(body);
|
|
2279
|
-
const session = BarcodeCountCaptureListSession
|
|
2280
|
-
.fromJSON(JSON.parse(payload.session));
|
|
2281
|
-
this.notifyListenersOfDidListSessionUpdate(session);
|
|
2368
|
+
setTextForAimToSelectAutoHint(text) {
|
|
2369
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2370
|
+
return yield this._proxy.setTextForAimToSelectAutoHint(text);
|
|
2282
2371
|
});
|
|
2283
2372
|
}
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
this._proxy.
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
}
|
|
2299
|
-
notifyListenersOfDidScanSession(session) {
|
|
2300
|
-
const mode = this.barcodeCount;
|
|
2301
|
-
mode.isInListenerCallback = true;
|
|
2302
|
-
mode.listeners.forEach(listener => {
|
|
2303
|
-
if (listener.didScan) {
|
|
2304
|
-
listener.didScan(this.barcodeCount, session, CameraController.getLastFrame);
|
|
2373
|
+
setAimedBarcodeBrushProvider(brushProvider) {
|
|
2374
|
+
if (!brushProvider) {
|
|
2375
|
+
this.eventEmitter.removeAllListeners(BarcodeSelectionBrushProviderEvents.brushForAimedBarcode);
|
|
2376
|
+
return this._proxy.removeAimedBarcodeBrushProvider();
|
|
2377
|
+
}
|
|
2378
|
+
const subscriptionResult = this._proxy.setAimedBarcodeBrushProvider();
|
|
2379
|
+
this._proxy.subscribeBrushForAimedBarcode();
|
|
2380
|
+
this.eventEmitter.on(BarcodeSelectionBrushProviderEvents.brushForAimedBarcode, (body) => {
|
|
2381
|
+
const payload = JSON.parse(body);
|
|
2382
|
+
const barcode = Barcode
|
|
2383
|
+
.fromJSON(JSON.parse(payload.barcode));
|
|
2384
|
+
let brush = null;
|
|
2385
|
+
if (brushProvider.brushForBarcode) {
|
|
2386
|
+
brush = brushProvider.brushForBarcode(barcode);
|
|
2305
2387
|
}
|
|
2388
|
+
this._proxy.finishBrushForAimedBarcodeCallback(brush ? JSON.stringify(brush.toJSON()) : null, barcode.selectionIdentifier);
|
|
2306
2389
|
});
|
|
2307
|
-
|
|
2390
|
+
return subscriptionResult;
|
|
2308
2391
|
}
|
|
2309
|
-
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
|
|
2313
|
-
mode.isInListenerCallback = true;
|
|
2314
|
-
if (barcodeCountCaptureListListener && (barcodeCountCaptureListListener === null || barcodeCountCaptureListListener === void 0 ? void 0 : barcodeCountCaptureListListener.didUpdateSession)) {
|
|
2315
|
-
barcodeCountCaptureListListener === null || barcodeCountCaptureListListener === void 0 ? void 0 : barcodeCountCaptureListListener.didUpdateSession(this._barcodeCountCaptureList, session);
|
|
2392
|
+
setTrackedBarcodeBrushProvider(brushProvider) {
|
|
2393
|
+
if (!brushProvider) {
|
|
2394
|
+
this.eventEmitter.removeAllListeners(BarcodeSelectionBrushProviderEvents.brushForTrackedBarcode);
|
|
2395
|
+
return this._proxy.removeTrackedBarcodeBrushProvider();
|
|
2316
2396
|
}
|
|
2317
|
-
|
|
2397
|
+
const subscriptionResult = this._proxy.setTrackedBarcodeBrushProvider();
|
|
2398
|
+
this._proxy.subscribeBrushForTrackedBarcode();
|
|
2399
|
+
this.eventEmitter.on(BarcodeSelectionBrushProviderEvents.brushForTrackedBarcode, (body) => {
|
|
2400
|
+
const payload = JSON.parse(body);
|
|
2401
|
+
const barcode = Barcode
|
|
2402
|
+
.fromJSON(JSON.parse(payload.barcode));
|
|
2403
|
+
let brush = null;
|
|
2404
|
+
if (brushProvider.brushForBarcode) {
|
|
2405
|
+
brush = brushProvider.brushForBarcode(barcode);
|
|
2406
|
+
}
|
|
2407
|
+
this._proxy.finishBrushForTrackedBarcodeCallback(brush ? JSON.stringify(brush.toJSON()) : null, barcode.selectionIdentifier);
|
|
2408
|
+
});
|
|
2409
|
+
return subscriptionResult;
|
|
2318
2410
|
}
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
class BarcodeCount extends DefaultSerializeable {
|
|
2322
|
-
get isEnabled() {
|
|
2323
|
-
return this._isEnabled;
|
|
2411
|
+
updateBarcodeSelectionBasicOverlay(overlay) {
|
|
2412
|
+
return this._proxy.updateBarcodeSelectionBasicOverlay(JSON.stringify(overlay.toJSON()));
|
|
2324
2413
|
}
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
|
|
2414
|
+
// TODO: We need to unsubscribe from the providers when the overlay is removed. Need spec.
|
|
2415
|
+
// https://scandit.atlassian.net/browse/SDC-16608
|
|
2416
|
+
unsubscribeProviders() {
|
|
2417
|
+
this.eventEmitter.removeAllListeners(BarcodeSelectionBrushProviderEvents.brushForAimedBarcode);
|
|
2418
|
+
this.eventEmitter.removeAllListeners(BarcodeSelectionBrushProviderEvents.brushForTrackedBarcode);
|
|
2419
|
+
this._proxy.removeAimedBarcodeBrushProvider();
|
|
2420
|
+
this._proxy.removeTrackedBarcodeBrushProvider();
|
|
2328
2421
|
}
|
|
2329
|
-
|
|
2330
|
-
|
|
2422
|
+
}
|
|
2423
|
+
|
|
2424
|
+
class BarcodeSelectionBasicOverlay extends DefaultSerializeable {
|
|
2425
|
+
get trackedBrush() {
|
|
2426
|
+
return this._trackedBrush;
|
|
2331
2427
|
}
|
|
2332
|
-
|
|
2333
|
-
|
|
2428
|
+
set trackedBrush(newBrush) {
|
|
2429
|
+
this._trackedBrush = newBrush;
|
|
2430
|
+
this.overlayController.updateBarcodeSelectionBasicOverlay(this);
|
|
2334
2431
|
}
|
|
2335
|
-
|
|
2336
|
-
this.
|
|
2337
|
-
this.didChange();
|
|
2432
|
+
get aimedBrush() {
|
|
2433
|
+
return this._aimedBrush;
|
|
2338
2434
|
}
|
|
2339
|
-
|
|
2340
|
-
|
|
2435
|
+
set aimedBrush(newBrush) {
|
|
2436
|
+
this._aimedBrush = newBrush;
|
|
2437
|
+
this.overlayController.updateBarcodeSelectionBasicOverlay(this);
|
|
2341
2438
|
}
|
|
2342
|
-
|
|
2343
|
-
this.
|
|
2439
|
+
get selectedBrush() {
|
|
2440
|
+
return this._selectedBrush;
|
|
2344
2441
|
}
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
return barcodeCount;
|
|
2442
|
+
set selectedBrush(newBrush) {
|
|
2443
|
+
this._selectedBrush = newBrush;
|
|
2444
|
+
this.overlayController.updateBarcodeSelectionBasicOverlay(this);
|
|
2349
2445
|
}
|
|
2350
|
-
|
|
2351
|
-
return
|
|
2446
|
+
get selectingBrush() {
|
|
2447
|
+
return this._selectingBrush;
|
|
2352
2448
|
}
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
this.
|
|
2356
|
-
this._feedback = BarcodeCountFeedback.default;
|
|
2357
|
-
this._isEnabled = true;
|
|
2358
|
-
this.listeners = [];
|
|
2359
|
-
this._additionalBarcodes = [];
|
|
2360
|
-
this.isInListenerCallback = false;
|
|
2361
|
-
this.privateContext = null;
|
|
2362
|
-
this.listenerController = BarcodeCountListenerController.forBarcodeCount(this);
|
|
2449
|
+
set selectingBrush(newBrush) {
|
|
2450
|
+
this._selectingBrush = newBrush;
|
|
2451
|
+
this.overlayController.updateBarcodeSelectionBasicOverlay(this);
|
|
2363
2452
|
}
|
|
2364
|
-
|
|
2365
|
-
this.
|
|
2366
|
-
return this.didChange();
|
|
2453
|
+
get shouldShowScanAreaGuides() {
|
|
2454
|
+
return this._shouldShowScanAreaGuides;
|
|
2367
2455
|
}
|
|
2368
|
-
|
|
2369
|
-
this.
|
|
2370
|
-
|
|
2371
|
-
return;
|
|
2372
|
-
}
|
|
2373
|
-
this.listeners.push(listener);
|
|
2456
|
+
set shouldShowScanAreaGuides(shouldShow) {
|
|
2457
|
+
this._shouldShowScanAreaGuides = shouldShow;
|
|
2458
|
+
this.overlayController.updateBarcodeSelectionBasicOverlay(this);
|
|
2374
2459
|
}
|
|
2375
|
-
|
|
2376
|
-
|
|
2377
|
-
this.listenerController.subscribeListener();
|
|
2378
|
-
}
|
|
2460
|
+
get shouldShowHints() {
|
|
2461
|
+
return this._shouldShowHints;
|
|
2379
2462
|
}
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
}
|
|
2384
|
-
this.listeners.splice(this.listeners.indexOf(listener));
|
|
2385
|
-
this.checkAndUnsubscribeListeners();
|
|
2463
|
+
set shouldShowHints(shouldShow) {
|
|
2464
|
+
this._shouldShowHints = shouldShow;
|
|
2465
|
+
this.overlayController.updateBarcodeSelectionBasicOverlay(this);
|
|
2386
2466
|
}
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
this.listenerController.unsubscribeListener();
|
|
2390
|
-
}
|
|
2467
|
+
get viewfinder() {
|
|
2468
|
+
return this._viewfinder;
|
|
2391
2469
|
}
|
|
2392
|
-
|
|
2393
|
-
return this.
|
|
2470
|
+
get style() {
|
|
2471
|
+
return this._style;
|
|
2394
2472
|
}
|
|
2395
|
-
|
|
2396
|
-
|
|
2473
|
+
static withBarcodeSelection(barcodeSelection) {
|
|
2474
|
+
return BarcodeSelectionBasicOverlay.withBarcodeSelectionForView(barcodeSelection, null);
|
|
2397
2475
|
}
|
|
2398
|
-
|
|
2399
|
-
this.
|
|
2476
|
+
static withBarcodeSelectionForView(barcodeSelection, view) {
|
|
2477
|
+
return this.withBarcodeSelectionForViewWithStyle(barcodeSelection, view, BarcodeSelectionBasicOverlay.barcodeSelectionDefaults.BarcodeSelectionBasicOverlay.defaultStyle);
|
|
2400
2478
|
}
|
|
2401
|
-
|
|
2402
|
-
|
|
2479
|
+
static withBarcodeSelectionForViewWithStyle(barcodeSelection, view, style) {
|
|
2480
|
+
const overlay = new BarcodeSelectionBasicOverlay();
|
|
2481
|
+
overlay.barcodeSelection = barcodeSelection;
|
|
2482
|
+
overlay._style = style;
|
|
2483
|
+
overlay._trackedBrush = new Brush(BarcodeSelectionBasicOverlay.barcodeSelectionDefaults.BarcodeSelectionBasicOverlay.styles[style].DefaultTrackedBrush.fillColor, BarcodeSelectionBasicOverlay.barcodeSelectionDefaults.BarcodeSelectionBasicOverlay.styles[style].DefaultTrackedBrush.strokeColor, BarcodeSelectionBasicOverlay.barcodeSelectionDefaults.BarcodeSelectionBasicOverlay.styles[style].DefaultTrackedBrush.strokeWidth);
|
|
2484
|
+
overlay._aimedBrush = new Brush(BarcodeSelectionBasicOverlay.barcodeSelectionDefaults.BarcodeSelectionBasicOverlay.styles[style].DefaultAimedBrush.fillColor, BarcodeSelectionBasicOverlay.barcodeSelectionDefaults.BarcodeSelectionBasicOverlay.styles[style].DefaultAimedBrush.strokeColor, BarcodeSelectionBasicOverlay.barcodeSelectionDefaults.BarcodeSelectionBasicOverlay.styles[style].DefaultAimedBrush.strokeWidth);
|
|
2485
|
+
overlay._selectedBrush = new Brush(BarcodeSelectionBasicOverlay.barcodeSelectionDefaults.BarcodeSelectionBasicOverlay.styles[style].DefaultSelectedBrush.fillColor, BarcodeSelectionBasicOverlay.barcodeSelectionDefaults.BarcodeSelectionBasicOverlay.styles[style].DefaultSelectedBrush.strokeColor, BarcodeSelectionBasicOverlay.barcodeSelectionDefaults.BarcodeSelectionBasicOverlay.styles[style].DefaultSelectedBrush.strokeWidth);
|
|
2486
|
+
overlay._selectingBrush = new Brush(BarcodeSelectionBasicOverlay.barcodeSelectionDefaults.BarcodeSelectionBasicOverlay.styles[style].DefaultSelectingBrush.fillColor, BarcodeSelectionBasicOverlay.barcodeSelectionDefaults.BarcodeSelectionBasicOverlay.styles[style].DefaultSelectingBrush.strokeColor, BarcodeSelectionBasicOverlay.barcodeSelectionDefaults.BarcodeSelectionBasicOverlay.styles[style].DefaultSelectingBrush.strokeWidth);
|
|
2487
|
+
if (view) {
|
|
2488
|
+
view.addOverlay(overlay);
|
|
2489
|
+
}
|
|
2490
|
+
return overlay;
|
|
2403
2491
|
}
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
return this.didChange();
|
|
2492
|
+
static get barcodeSelectionDefaults() {
|
|
2493
|
+
return getBarcodeSelectionDefaults();
|
|
2407
2494
|
}
|
|
2408
|
-
|
|
2409
|
-
|
|
2410
|
-
|
|
2495
|
+
constructor() {
|
|
2496
|
+
super();
|
|
2497
|
+
this.type = 'barcodeSelectionBasic';
|
|
2498
|
+
this.overlayController = new BarcodeSelectionOverlayController();
|
|
2499
|
+
this._shouldShowScanAreaGuides = false;
|
|
2500
|
+
this._shouldShowHints = true;
|
|
2501
|
+
this._viewfinder = new AimerViewfinder();
|
|
2502
|
+
this._trackedBrush = new Brush(BarcodeSelectionBasicOverlay.barcodeSelectionDefaults.BarcodeSelectionBasicOverlay.styles[BarcodeSelectionBasicOverlay.barcodeSelectionDefaults.BarcodeSelectionBasicOverlay.defaultStyle].DefaultTrackedBrush.fillColor, BarcodeSelectionBasicOverlay.barcodeSelectionDefaults.BarcodeSelectionBasicOverlay.styles[BarcodeSelectionBasicOverlay.barcodeSelectionDefaults.BarcodeSelectionBasicOverlay.defaultStyle].DefaultTrackedBrush.strokeColor, BarcodeSelectionBasicOverlay.barcodeSelectionDefaults.BarcodeSelectionBasicOverlay.styles[BarcodeSelectionBasicOverlay.barcodeSelectionDefaults.BarcodeSelectionBasicOverlay.defaultStyle].DefaultTrackedBrush.strokeWidth);
|
|
2503
|
+
this._aimedBrush = new Brush(BarcodeSelectionBasicOverlay.barcodeSelectionDefaults.BarcodeSelectionBasicOverlay.styles[BarcodeSelectionBasicOverlay.barcodeSelectionDefaults.BarcodeSelectionBasicOverlay.defaultStyle].DefaultAimedBrush.fillColor, BarcodeSelectionBasicOverlay.barcodeSelectionDefaults.BarcodeSelectionBasicOverlay.styles[BarcodeSelectionBasicOverlay.barcodeSelectionDefaults.BarcodeSelectionBasicOverlay.defaultStyle].DefaultAimedBrush.strokeColor, BarcodeSelectionBasicOverlay.barcodeSelectionDefaults.BarcodeSelectionBasicOverlay.styles[BarcodeSelectionBasicOverlay.barcodeSelectionDefaults.BarcodeSelectionBasicOverlay.defaultStyle].DefaultAimedBrush.strokeWidth);
|
|
2504
|
+
this._selectedBrush = new Brush(BarcodeSelectionBasicOverlay.barcodeSelectionDefaults.BarcodeSelectionBasicOverlay.styles[BarcodeSelectionBasicOverlay.barcodeSelectionDefaults.BarcodeSelectionBasicOverlay.defaultStyle].DefaultSelectedBrush.fillColor, BarcodeSelectionBasicOverlay.barcodeSelectionDefaults.BarcodeSelectionBasicOverlay.styles[BarcodeSelectionBasicOverlay.barcodeSelectionDefaults.BarcodeSelectionBasicOverlay.defaultStyle].DefaultSelectedBrush.strokeColor, BarcodeSelectionBasicOverlay.barcodeSelectionDefaults.BarcodeSelectionBasicOverlay.styles[BarcodeSelectionBasicOverlay.barcodeSelectionDefaults.BarcodeSelectionBasicOverlay.defaultStyle].DefaultSelectedBrush.strokeWidth);
|
|
2505
|
+
this._selectingBrush = new Brush(BarcodeSelectionBasicOverlay.barcodeSelectionDefaults.BarcodeSelectionBasicOverlay.styles[BarcodeSelectionBasicOverlay.barcodeSelectionDefaults.BarcodeSelectionBasicOverlay.defaultStyle].DefaultSelectingBrush.fillColor, BarcodeSelectionBasicOverlay.barcodeSelectionDefaults.BarcodeSelectionBasicOverlay.styles[BarcodeSelectionBasicOverlay.barcodeSelectionDefaults.BarcodeSelectionBasicOverlay.defaultStyle].DefaultSelectingBrush.strokeColor, BarcodeSelectionBasicOverlay.barcodeSelectionDefaults.BarcodeSelectionBasicOverlay.styles[BarcodeSelectionBasicOverlay.barcodeSelectionDefaults.BarcodeSelectionBasicOverlay.defaultStyle].DefaultSelectingBrush.strokeWidth);
|
|
2411
2506
|
}
|
|
2412
|
-
|
|
2413
|
-
return
|
|
2507
|
+
setTextForAimToSelectAutoHint(text) {
|
|
2508
|
+
return this.overlayController.setTextForAimToSelectAutoHint(text);
|
|
2414
2509
|
}
|
|
2415
|
-
|
|
2416
|
-
return this.
|
|
2510
|
+
setAimedBarcodeBrushProvider(brushProvider) {
|
|
2511
|
+
return this.overlayController.setAimedBarcodeBrushProvider(brushProvider);
|
|
2417
2512
|
}
|
|
2418
|
-
|
|
2419
|
-
this.
|
|
2513
|
+
setTrackedBarcodeBrushProvider(brushProvider) {
|
|
2514
|
+
return this.overlayController.setTrackedBarcodeBrushProvider(brushProvider);
|
|
2420
2515
|
}
|
|
2421
2516
|
}
|
|
2422
2517
|
__decorate([
|
|
2423
|
-
|
|
2424
|
-
],
|
|
2518
|
+
ignoreFromSerialization
|
|
2519
|
+
], BarcodeSelectionBasicOverlay.prototype, "barcodeSelection", void 0);
|
|
2425
2520
|
__decorate([
|
|
2426
2521
|
ignoreFromSerialization
|
|
2427
|
-
],
|
|
2522
|
+
], BarcodeSelectionBasicOverlay.prototype, "overlayController", void 0);
|
|
2428
2523
|
__decorate([
|
|
2429
2524
|
ignoreFromSerialization
|
|
2430
|
-
],
|
|
2525
|
+
], BarcodeSelectionBasicOverlay.prototype, "view", void 0);
|
|
2431
2526
|
__decorate([
|
|
2432
|
-
nameForSerialization('
|
|
2433
|
-
],
|
|
2527
|
+
nameForSerialization('shouldShowScanAreaGuides')
|
|
2528
|
+
], BarcodeSelectionBasicOverlay.prototype, "_shouldShowScanAreaGuides", void 0);
|
|
2434
2529
|
__decorate([
|
|
2435
|
-
|
|
2436
|
-
],
|
|
2530
|
+
nameForSerialization('shouldShowHints')
|
|
2531
|
+
], BarcodeSelectionBasicOverlay.prototype, "_shouldShowHints", void 0);
|
|
2437
2532
|
__decorate([
|
|
2438
|
-
|
|
2439
|
-
],
|
|
2533
|
+
nameForSerialization('viewfinder')
|
|
2534
|
+
], BarcodeSelectionBasicOverlay.prototype, "_viewfinder", void 0);
|
|
2440
2535
|
__decorate([
|
|
2441
|
-
|
|
2442
|
-
],
|
|
2536
|
+
nameForSerialization('style')
|
|
2537
|
+
], BarcodeSelectionBasicOverlay.prototype, "_style", void 0);
|
|
2538
|
+
__decorate([
|
|
2539
|
+
nameForSerialization('trackedBrush')
|
|
2540
|
+
], BarcodeSelectionBasicOverlay.prototype, "_trackedBrush", void 0);
|
|
2541
|
+
__decorate([
|
|
2542
|
+
nameForSerialization('aimedBrush')
|
|
2543
|
+
], BarcodeSelectionBasicOverlay.prototype, "_aimedBrush", void 0);
|
|
2544
|
+
__decorate([
|
|
2545
|
+
nameForSerialization('selectedBrush')
|
|
2546
|
+
], BarcodeSelectionBasicOverlay.prototype, "_selectedBrush", void 0);
|
|
2547
|
+
__decorate([
|
|
2548
|
+
nameForSerialization('selectingBrush')
|
|
2549
|
+
], BarcodeSelectionBasicOverlay.prototype, "_selectingBrush", void 0);
|
|
2443
2550
|
__decorate([
|
|
2444
2551
|
ignoreFromSerialization
|
|
2445
|
-
],
|
|
2552
|
+
], BarcodeSelectionBasicOverlay, "barcodeSelectionDefaults", null);
|
|
2446
2553
|
|
|
2447
|
-
class
|
|
2448
|
-
|
|
2449
|
-
|
|
2554
|
+
class BarcodeSelectionAutoSelectionStrategy extends DefaultSerializeable {
|
|
2555
|
+
constructor() {
|
|
2556
|
+
super(...arguments);
|
|
2557
|
+
this.type = BarcodeSelectionStrategyType.Auto;
|
|
2450
2558
|
}
|
|
2451
|
-
|
|
2452
|
-
|
|
2453
|
-
|
|
2559
|
+
static get autoSelectionStrategy() {
|
|
2560
|
+
return new BarcodeSelectionAutoSelectionStrategy();
|
|
2561
|
+
}
|
|
2562
|
+
}
|
|
2563
|
+
class BarcodeSelectionManualSelectionStrategy extends DefaultSerializeable {
|
|
2564
|
+
constructor() {
|
|
2565
|
+
super(...arguments);
|
|
2566
|
+
this.type = BarcodeSelectionStrategyType.Manual;
|
|
2567
|
+
}
|
|
2568
|
+
static get manualSelectionStrategy() {
|
|
2569
|
+
return new BarcodeSelectionManualSelectionStrategy();
|
|
2570
|
+
}
|
|
2571
|
+
}
|
|
2572
|
+
class PrivateBarcodeSelectionStrategy {
|
|
2573
|
+
static fromJSON(json) {
|
|
2574
|
+
switch (json.type) {
|
|
2575
|
+
case BarcodeSelectionStrategyType.Auto:
|
|
2576
|
+
return BarcodeSelectionAutoSelectionStrategy.autoSelectionStrategy;
|
|
2577
|
+
case BarcodeSelectionStrategyType.Manual:
|
|
2578
|
+
return BarcodeSelectionManualSelectionStrategy.manualSelectionStrategy;
|
|
2579
|
+
default:
|
|
2580
|
+
throw new Error('Unknown selection strategy type: ' + json.type);
|
|
2581
|
+
}
|
|
2454
2582
|
}
|
|
2455
2583
|
}
|
|
2456
2584
|
|
|
2457
|
-
|
|
2458
|
-
(
|
|
2459
|
-
|
|
2460
|
-
|
|
2461
|
-
|
|
2462
|
-
|
|
2463
|
-
|
|
2464
|
-
|
|
2465
|
-
|
|
2466
|
-
}
|
|
2467
|
-
|
|
2468
|
-
|
|
2469
|
-
|
|
2470
|
-
|
|
2585
|
+
class BarcodeSelectionTapSelection extends DefaultSerializeable {
|
|
2586
|
+
constructor() {
|
|
2587
|
+
super(...arguments);
|
|
2588
|
+
this.type = BarcodeSelectionTypeName.Tap;
|
|
2589
|
+
this.freezeBehavior = BarcodeSelectionTapSelection.barcodeSelectionDefaults.BarcodeSelectionTapSelection.defaultFreezeBehavior;
|
|
2590
|
+
this.tapBehavior = BarcodeSelectionTapSelection.barcodeSelectionDefaults.BarcodeSelectionTapSelection.defaultTapBehavior;
|
|
2591
|
+
}
|
|
2592
|
+
static get tapSelection() {
|
|
2593
|
+
return new BarcodeSelectionTapSelection();
|
|
2594
|
+
}
|
|
2595
|
+
static get barcodeSelectionDefaults() {
|
|
2596
|
+
return getBarcodeSelectionDefaults();
|
|
2597
|
+
}
|
|
2598
|
+
static withFreezeBehaviorAndTapBehavior(freezeBehavior, tapBehavior) {
|
|
2599
|
+
const selection = this.tapSelection;
|
|
2600
|
+
selection.freezeBehavior = freezeBehavior;
|
|
2601
|
+
selection.tapBehavior = tapBehavior;
|
|
2602
|
+
return selection;
|
|
2603
|
+
}
|
|
2604
|
+
}
|
|
2605
|
+
__decorate([
|
|
2606
|
+
ignoreFromSerialization
|
|
2607
|
+
], BarcodeSelectionTapSelection, "barcodeSelectionDefaults", null);
|
|
2608
|
+
class BarcodeSelectionAimerSelection extends DefaultSerializeable {
|
|
2609
|
+
static get aimerSelection() {
|
|
2610
|
+
return new BarcodeSelectionAimerSelection();
|
|
2471
2611
|
}
|
|
2472
|
-
static get
|
|
2473
|
-
return
|
|
2612
|
+
static get barcodeSelectionDefaults() {
|
|
2613
|
+
return getBarcodeSelectionDefaults();
|
|
2474
2614
|
}
|
|
2475
2615
|
constructor() {
|
|
2476
2616
|
super();
|
|
2477
|
-
this.
|
|
2478
|
-
this.
|
|
2479
|
-
|
|
2480
|
-
this._expectsOnlyUniqueBarcodes = BarcodeCountSettings.barcodeCountDefaults.BarcodeCountSettings.expectOnlyUniqueBarcodes;
|
|
2481
|
-
this._mappingEnabled = BarcodeCountSettings.barcodeCountDefaults.BarcodeCountSettings.mappingEnabled;
|
|
2617
|
+
this.type = BarcodeSelectionTypeName.Aimer;
|
|
2618
|
+
this.selectionStrategy = BarcodeSelectionAimerSelection.barcodeSelectionDefaults.BarcodeSelectionAimerSelection
|
|
2619
|
+
.defaultSelectionStrategy(PrivateBarcodeSelectionStrategy.fromJSON);
|
|
2482
2620
|
}
|
|
2483
|
-
|
|
2484
|
-
|
|
2621
|
+
}
|
|
2622
|
+
__decorate([
|
|
2623
|
+
ignoreFromSerialization
|
|
2624
|
+
], BarcodeSelectionAimerSelection, "barcodeSelectionDefaults", null);
|
|
2625
|
+
class PrivateBarcodeSelectionType {
|
|
2626
|
+
static fromJSON(json) {
|
|
2627
|
+
switch (json.type) {
|
|
2628
|
+
case BarcodeSelectionTypeName.Aimer:
|
|
2629
|
+
return PrivateBarcodeSelectionAimerSelection.fromJSON(json);
|
|
2630
|
+
case BarcodeSelectionTypeName.Tap:
|
|
2631
|
+
return PrivateBarcodeSelectionTapSelection.fromJSON(json);
|
|
2632
|
+
default:
|
|
2633
|
+
throw new Error('Unknown selection strategy type: ' + json.type);
|
|
2634
|
+
}
|
|
2485
2635
|
}
|
|
2486
|
-
|
|
2487
|
-
|
|
2636
|
+
}
|
|
2637
|
+
class PrivateBarcodeSelectionAimerSelection {
|
|
2638
|
+
static fromJSON(json) {
|
|
2639
|
+
const selection = BarcodeSelectionAimerSelection.aimerSelection;
|
|
2640
|
+
selection.selectionStrategy = PrivateBarcodeSelectionStrategy.fromJSON(json.selectionStrategy);
|
|
2641
|
+
return selection;
|
|
2488
2642
|
}
|
|
2489
|
-
|
|
2490
|
-
|
|
2643
|
+
}
|
|
2644
|
+
class PrivateBarcodeSelectionTapSelection {
|
|
2645
|
+
static fromJSON(json) {
|
|
2646
|
+
const selection = BarcodeSelectionTapSelection.tapSelection;
|
|
2647
|
+
selection.freezeBehavior = json.freezeBehavior;
|
|
2648
|
+
selection.tapBehavior = json.tapBehavior;
|
|
2649
|
+
return selection;
|
|
2491
2650
|
}
|
|
2492
|
-
|
|
2493
|
-
|
|
2651
|
+
}
|
|
2652
|
+
|
|
2653
|
+
class BarcodeSelectionSettings extends DefaultSerializeable {
|
|
2654
|
+
static get barcodeSelectionDefaults() {
|
|
2655
|
+
return getBarcodeSelectionDefaults();
|
|
2494
2656
|
}
|
|
2495
|
-
get
|
|
2496
|
-
return
|
|
2657
|
+
static get barcodeDefaults() {
|
|
2658
|
+
return getBarcodeDefaults();
|
|
2497
2659
|
}
|
|
2498
2660
|
get enabledSymbologies() {
|
|
2499
2661
|
return Object.keys(this.symbologies)
|
|
2500
2662
|
.filter(symbology => this.symbologies[symbology].isEnabled);
|
|
2501
2663
|
}
|
|
2664
|
+
constructor() {
|
|
2665
|
+
super();
|
|
2666
|
+
this.codeDuplicateFilter = BarcodeSelectionSettings.barcodeSelectionDefaults.BarcodeSelectionSettings.codeDuplicateFilter;
|
|
2667
|
+
this.singleBarcodeAutoDetection = BarcodeSelectionSettings.barcodeSelectionDefaults.BarcodeSelectionSettings.singleBarcodeAutoDetection;
|
|
2668
|
+
this.selectionType = BarcodeSelectionSettings.barcodeSelectionDefaults.BarcodeSelectionSettings.selectionType(PrivateBarcodeSelectionType.fromJSON);
|
|
2669
|
+
this.properties = {};
|
|
2670
|
+
this.symbologies = {};
|
|
2671
|
+
}
|
|
2502
2672
|
settingsForSymbology(symbology) {
|
|
2503
2673
|
if (!this.symbologies[symbology]) {
|
|
2504
|
-
const symbologySettings =
|
|
2674
|
+
const symbologySettings = BarcodeSelectionSettings.barcodeDefaults.SymbologySettings[symbology];
|
|
2505
2675
|
symbologySettings._symbology = symbology;
|
|
2506
2676
|
this.symbologies[symbology] = symbologySettings;
|
|
2507
2677
|
}
|
|
2508
2678
|
return this.symbologies[symbology];
|
|
2509
2679
|
}
|
|
2510
|
-
enableSymbologies(symbologies) {
|
|
2511
|
-
symbologies.forEach(symbology => this.enableSymbology(symbology, true));
|
|
2512
|
-
}
|
|
2513
|
-
enableSymbology(symbology, enabled) {
|
|
2514
|
-
this.settingsForSymbology(symbology).isEnabled = enabled;
|
|
2515
|
-
}
|
|
2516
2680
|
setProperty(name, value) {
|
|
2517
2681
|
this.properties[name] = value;
|
|
2518
2682
|
}
|
|
2519
2683
|
getProperty(name) {
|
|
2520
2684
|
return this.properties[name];
|
|
2521
2685
|
}
|
|
2522
|
-
|
|
2523
|
-
|
|
2524
|
-
nameForSerialization('filterSettings')
|
|
2525
|
-
], BarcodeCountSettings.prototype, "_filterSettings", void 0);
|
|
2526
|
-
__decorate([
|
|
2527
|
-
nameForSerialization('expectsOnlyUniqueBarcodes')
|
|
2528
|
-
], BarcodeCountSettings.prototype, "_expectsOnlyUniqueBarcodes", void 0);
|
|
2529
|
-
__decorate([
|
|
2530
|
-
nameForSerialization('mappingEnabled')
|
|
2531
|
-
], BarcodeCountSettings.prototype, "_mappingEnabled", void 0);
|
|
2532
|
-
__decorate([
|
|
2533
|
-
ignoreFromSerialization
|
|
2534
|
-
], BarcodeCountSettings, "barcodeCountDefaults", null);
|
|
2535
|
-
__decorate([
|
|
2536
|
-
ignoreFromSerialization
|
|
2537
|
-
], BarcodeCountSettings, "barcodeDefaults", null);
|
|
2538
|
-
|
|
2539
|
-
class BarcodeCountToolbarSettings extends DefaultSerializeable {
|
|
2540
|
-
constructor() {
|
|
2541
|
-
super(...arguments);
|
|
2542
|
-
this.audioOnButtonText = BarcodeCountToolbarSettings.barcodeCountDefaults.BarcodeCountView.toolbarSettings.audioOnButtonText;
|
|
2543
|
-
this.audioOffButtonText = BarcodeCountToolbarSettings.barcodeCountDefaults.BarcodeCountView.toolbarSettings.audioOffButtonText;
|
|
2544
|
-
this.audioButtonContentDescription = BarcodeCountToolbarSettings.barcodeCountDefaults.BarcodeCountView.toolbarSettings.audioButtonContentDescription;
|
|
2545
|
-
this.audioButtonAccessibilityHint = BarcodeCountToolbarSettings.barcodeCountDefaults.BarcodeCountView.toolbarSettings.audioButtonAccessibilityHint;
|
|
2546
|
-
this.audioButtonAccessibilityLabel = BarcodeCountToolbarSettings.barcodeCountDefaults.BarcodeCountView.toolbarSettings.audioButtonAccessibilityLabel;
|
|
2547
|
-
this.vibrationOnButtonText = BarcodeCountToolbarSettings.barcodeCountDefaults.BarcodeCountView.toolbarSettings.vibrationOnButtonText;
|
|
2548
|
-
this.vibrationOffButtonText = BarcodeCountToolbarSettings.barcodeCountDefaults.BarcodeCountView.toolbarSettings.vibrationOffButtonText;
|
|
2549
|
-
this.vibrationButtonContentDescription = BarcodeCountToolbarSettings.barcodeCountDefaults.BarcodeCountView.toolbarSettings.vibrationButtonContentDescription;
|
|
2550
|
-
this.vibrationButtonAccessibilityHint = BarcodeCountToolbarSettings.barcodeCountDefaults.BarcodeCountView.toolbarSettings.vibrationButtonAccessibilityHint;
|
|
2551
|
-
this.vibrationButtonAccessibilityLabel = BarcodeCountToolbarSettings.barcodeCountDefaults.BarcodeCountView.toolbarSettings.vibrationButtonAccessibilityLabel;
|
|
2552
|
-
this.strapModeOnButtonText = BarcodeCountToolbarSettings.barcodeCountDefaults.BarcodeCountView.toolbarSettings.strapModeOnButtonText;
|
|
2553
|
-
this.strapModeOffButtonText = BarcodeCountToolbarSettings.barcodeCountDefaults.BarcodeCountView.toolbarSettings.strapModeOffButtonText;
|
|
2554
|
-
this.strapModeButtonContentDescription = BarcodeCountToolbarSettings.barcodeCountDefaults.BarcodeCountView.toolbarSettings.strapModeButtonContentDescription;
|
|
2555
|
-
this.strapModeButtonAccessibilityHint = BarcodeCountToolbarSettings.barcodeCountDefaults.BarcodeCountView.toolbarSettings.strapModeButtonAccessibilityHint;
|
|
2556
|
-
this.strapModeButtonAccessibilityLabel = BarcodeCountToolbarSettings.barcodeCountDefaults.BarcodeCountView.toolbarSettings.strapModeButtonAccessibilityLabel;
|
|
2557
|
-
this.colorSchemeOnButtonText = BarcodeCountToolbarSettings.barcodeCountDefaults.BarcodeCountView.toolbarSettings.colorSchemeOnButtonText;
|
|
2558
|
-
this.colorSchemeOffButtonText = BarcodeCountToolbarSettings.barcodeCountDefaults.BarcodeCountView.toolbarSettings.colorSchemeOffButtonText;
|
|
2559
|
-
this.colorSchemeButtonContentDescription = BarcodeCountToolbarSettings.barcodeCountDefaults.BarcodeCountView.toolbarSettings.colorSchemeButtonContentDescription;
|
|
2560
|
-
this.colorSchemeButtonAccessibilityHint = BarcodeCountToolbarSettings.barcodeCountDefaults.BarcodeCountView.toolbarSettings.colorSchemeButtonAccessibilityHint;
|
|
2561
|
-
this.colorSchemeButtonAccessibilityLabel = BarcodeCountToolbarSettings.barcodeCountDefaults.BarcodeCountView.toolbarSettings.colorSchemeButtonAccessibilityLabel;
|
|
2686
|
+
enableSymbologies(symbologies) {
|
|
2687
|
+
symbologies.forEach(symbology => this.enableSymbology(symbology, true));
|
|
2562
2688
|
}
|
|
2563
|
-
|
|
2564
|
-
|
|
2689
|
+
enableSymbology(symbology, enabled) {
|
|
2690
|
+
this.settingsForSymbology(symbology).isEnabled = enabled;
|
|
2565
2691
|
}
|
|
2566
2692
|
}
|
|
2567
2693
|
__decorate([
|
|
2568
2694
|
ignoreFromSerialization
|
|
2569
|
-
],
|
|
2570
|
-
|
|
2571
|
-
var BarcodeCountViewEvents;
|
|
2572
|
-
(function (BarcodeCountViewEvents) {
|
|
2573
|
-
BarcodeCountViewEvents["singleScanButtonTapped"] = "BarcodeCountViewUiListener.onSingleScanButtonTapped";
|
|
2574
|
-
BarcodeCountViewEvents["listButtonTapped"] = "BarcodeCountViewUiListener.onListButtonTapped";
|
|
2575
|
-
BarcodeCountViewEvents["exitButtonTapped"] = "BarcodeCountViewUiListener.onExitButtonTapped";
|
|
2576
|
-
BarcodeCountViewEvents["brushForRecognizedBarcode"] = "BarcodeCountViewListener.brushForRecognizedBarcode";
|
|
2577
|
-
BarcodeCountViewEvents["brushForRecognizedBarcodeNotInList"] = "BarcodeCountViewListener.brushForRecognizedBarcodeNotInList";
|
|
2578
|
-
BarcodeCountViewEvents["brushForUnrecognizedBarcode"] = "BarcodeCountViewListener.brushForUnrecognizedBarcode";
|
|
2579
|
-
BarcodeCountViewEvents["filteredBarcodeTapped"] = "BarcodeCountViewListener.didTapFilteredBarcode";
|
|
2580
|
-
BarcodeCountViewEvents["recognizedBarcodeNotInListTapped"] = "BarcodeCountViewListener.didTapRecognizedBarcodeNotInList";
|
|
2581
|
-
BarcodeCountViewEvents["recognizedBarcodeTapped"] = "BarcodeCountViewListener.didTapRecognizedBarcode";
|
|
2582
|
-
BarcodeCountViewEvents["unrecognizedBarcodeTapped"] = "BarcodeCountViewListener.didTapUnrecognizedBarcode";
|
|
2583
|
-
BarcodeCountViewEvents["captureListCompleted"] = "BarcodeCountViewListener.didCompleteCaptureList";
|
|
2584
|
-
})(BarcodeCountViewEvents || (BarcodeCountViewEvents = {}));
|
|
2585
|
-
|
|
2586
|
-
class BarcodeFilterHighlightSettingsBrush extends DefaultSerializeable {
|
|
2587
|
-
static create(brush) {
|
|
2588
|
-
return new BarcodeFilterHighlightSettingsBrush(brush);
|
|
2589
|
-
}
|
|
2590
|
-
constructor(brush) {
|
|
2591
|
-
super();
|
|
2592
|
-
this._brush = null;
|
|
2593
|
-
this._highlightType = BarcodeFilterHighlightType.Brush;
|
|
2594
|
-
this._brush = brush;
|
|
2595
|
-
}
|
|
2596
|
-
get highlightType() {
|
|
2597
|
-
return this._highlightType;
|
|
2598
|
-
}
|
|
2599
|
-
get brush() {
|
|
2600
|
-
return this._brush;
|
|
2601
|
-
}
|
|
2602
|
-
}
|
|
2603
|
-
__decorate([
|
|
2604
|
-
nameForSerialization('highlightType')
|
|
2605
|
-
], BarcodeFilterHighlightSettingsBrush.prototype, "_highlightType", void 0);
|
|
2606
|
-
__decorate([
|
|
2607
|
-
nameForSerialization('brush')
|
|
2608
|
-
], BarcodeFilterHighlightSettingsBrush.prototype, "_brush", void 0);
|
|
2609
|
-
|
|
2610
|
-
class BarcodeFilterSettings extends DefaultSerializeable {
|
|
2611
|
-
get excludeEan13() {
|
|
2612
|
-
return this._excludeEan13;
|
|
2613
|
-
}
|
|
2614
|
-
set excludeEan13(value) {
|
|
2615
|
-
this._excludeEan13 = value;
|
|
2616
|
-
}
|
|
2617
|
-
get excludeUpca() {
|
|
2618
|
-
return this._excludeUpca;
|
|
2619
|
-
}
|
|
2620
|
-
set excludeUpca(value) {
|
|
2621
|
-
this._excludeUpca = value;
|
|
2622
|
-
}
|
|
2623
|
-
get excludedCodesRegex() {
|
|
2624
|
-
return this._excludedCodesRegex;
|
|
2625
|
-
}
|
|
2626
|
-
set excludedCodesRegex(value) {
|
|
2627
|
-
this._excludedCodesRegex = value;
|
|
2628
|
-
}
|
|
2629
|
-
get excludedSymbologies() {
|
|
2630
|
-
return this._excludedSymbologies;
|
|
2631
|
-
}
|
|
2632
|
-
set excludedSymbologies(values) {
|
|
2633
|
-
this._excludedSymbologies = values;
|
|
2634
|
-
}
|
|
2635
|
-
static fromJSON(json) {
|
|
2636
|
-
const excludeEan13 = json.excludeEan13;
|
|
2637
|
-
const excludeUpca = json.excludeUpca;
|
|
2638
|
-
const excludedCodesRegex = json.excludedCodesRegex;
|
|
2639
|
-
const excludedSymbologies = json.excludedSymbologies;
|
|
2640
|
-
const excludedSymbolCounts = json.excludedSymbolCounts;
|
|
2641
|
-
return new BarcodeFilterSettings(excludeEan13, excludeUpca, excludedCodesRegex, excludedSymbolCounts, excludedSymbologies);
|
|
2642
|
-
}
|
|
2643
|
-
constructor(excludeEan13, excludeUpca, excludedCodesRegex, excludedSymbolCounts, excludedSymbologies) {
|
|
2644
|
-
super();
|
|
2645
|
-
this._excludeEan13 = false;
|
|
2646
|
-
this._excludeUpca = false;
|
|
2647
|
-
this._excludedCodesRegex = '';
|
|
2648
|
-
this._excludedSymbolCounts = {};
|
|
2649
|
-
this._excludedSymbologies = [];
|
|
2650
|
-
this.excludeEan13 = excludeEan13;
|
|
2651
|
-
this.excludeUpca = excludeUpca;
|
|
2652
|
-
this.excludedCodesRegex = excludedCodesRegex;
|
|
2653
|
-
this._excludedSymbolCounts = excludedSymbolCounts;
|
|
2654
|
-
this.excludedSymbologies = excludedSymbologies;
|
|
2655
|
-
}
|
|
2656
|
-
getExcludedSymbolCountsForSymbology(symbology) {
|
|
2657
|
-
return this._excludedSymbolCounts[symbology] || [];
|
|
2658
|
-
}
|
|
2659
|
-
setExcludedSymbolCounts(excludedSymbolCounts, symbology) {
|
|
2660
|
-
this._excludedSymbolCounts[symbology] = excludedSymbolCounts;
|
|
2661
|
-
}
|
|
2662
|
-
}
|
|
2663
|
-
__decorate([
|
|
2664
|
-
nameForSerialization('excludeEan13')
|
|
2665
|
-
], BarcodeFilterSettings.prototype, "_excludeEan13", void 0);
|
|
2666
|
-
__decorate([
|
|
2667
|
-
nameForSerialization('excludeUpca')
|
|
2668
|
-
], BarcodeFilterSettings.prototype, "_excludeUpca", void 0);
|
|
2669
|
-
__decorate([
|
|
2670
|
-
nameForSerialization('excludedCodesRegex')
|
|
2671
|
-
], BarcodeFilterSettings.prototype, "_excludedCodesRegex", void 0);
|
|
2672
|
-
__decorate([
|
|
2673
|
-
nameForSerialization('excludedSymbolCounts')
|
|
2674
|
-
], BarcodeFilterSettings.prototype, "_excludedSymbolCounts", void 0);
|
|
2695
|
+
], BarcodeSelectionSettings, "barcodeSelectionDefaults", null);
|
|
2675
2696
|
__decorate([
|
|
2676
|
-
|
|
2677
|
-
],
|
|
2697
|
+
ignoreFromSerialization
|
|
2698
|
+
], BarcodeSelectionSettings, "barcodeDefaults", null);
|
|
2678
2699
|
|
|
2679
2700
|
var BarcodeTrackingBasicOverlayStyle;
|
|
2680
2701
|
(function (BarcodeTrackingBasicOverlayStyle) {
|
|
2681
2702
|
BarcodeTrackingBasicOverlayStyle["Frame"] = "frame";
|
|
2682
2703
|
BarcodeTrackingBasicOverlayStyle["Dot"] = "dot";
|
|
2704
|
+
/**
|
|
2705
|
+
* @deprecated The legacy style of the BarcodeTrackingBasicOverlay is deprecated.
|
|
2706
|
+
*/
|
|
2683
2707
|
BarcodeTrackingBasicOverlayStyle["Legacy"] = "legacy";
|
|
2684
2708
|
})(BarcodeTrackingBasicOverlayStyle || (BarcodeTrackingBasicOverlayStyle = {}));
|
|
2685
2709
|
|
|
2710
|
+
/**
|
|
2711
|
+
* @deprecated Setting a scenario is no longer recommended, use the BarcodeTrackingSettings empty constructor instead.
|
|
2712
|
+
*/
|
|
2686
2713
|
var BarcodeTrackingScenario;
|
|
2687
2714
|
(function (BarcodeTrackingScenario) {
|
|
2688
2715
|
BarcodeTrackingScenario["A"] = "A";
|
|
@@ -3138,7 +3165,11 @@ class BarcodeTrackingSettings extends DefaultSerializeable {
|
|
|
3138
3165
|
return Object.keys(this.symbologies)
|
|
3139
3166
|
.filter(symbology => this.symbologies[symbology].isEnabled);
|
|
3140
3167
|
}
|
|
3168
|
+
/**
|
|
3169
|
+
* @deprecated Setting a scenario is no longer recommended, use the BarcodeTrackingSettings empty constructor instead.
|
|
3170
|
+
*/
|
|
3141
3171
|
static forScenario(scenario) {
|
|
3172
|
+
console.warn('Setting a scenario is no longer recommended, use the BarcodeTrackingSettings empty constructor instead.');
|
|
3142
3173
|
const settings = new BarcodeTrackingSettings();
|
|
3143
3174
|
settings.scenario = scenario;
|
|
3144
3175
|
return settings;
|
|
@@ -3268,11 +3299,22 @@ __decorate([
|
|
|
3268
3299
|
class SparkScanSession {
|
|
3269
3300
|
static fromJSON(json) {
|
|
3270
3301
|
const session = new SparkScanSession();
|
|
3302
|
+
session._newlyRecognizedBarcode = json.newlyRecognizedBarcode != null ?
|
|
3303
|
+
Barcode.fromJSON(json.newlyRecognizedBarcode) :
|
|
3304
|
+
null;
|
|
3271
3305
|
session._newlyRecognizedBarcodes = json.newlyRecognizedBarcodes.map(Barcode.fromJSON);
|
|
3272
3306
|
session._frameSequenceID = json.frameSequenceId;
|
|
3273
3307
|
return session;
|
|
3274
3308
|
}
|
|
3309
|
+
get newlyRecognizedBarcode() {
|
|
3310
|
+
return this._newlyRecognizedBarcode;
|
|
3311
|
+
}
|
|
3312
|
+
/**
|
|
3313
|
+
* @deprecated Prefer use of the property `newlyRecognizedBarcode` instead.
|
|
3314
|
+
*/
|
|
3275
3315
|
get newlyRecognizedBarcodes() {
|
|
3316
|
+
// tslint:disable-next-line:no-console
|
|
3317
|
+
console.warn('The newlyRecognizedBarcodes has been deprecated. Prefer use of the property `newlyRecognizedBarcode` instead.');
|
|
3276
3318
|
return this._newlyRecognizedBarcodes;
|
|
3277
3319
|
}
|
|
3278
3320
|
get frameSequenceID() {
|
|
@@ -3893,6 +3935,7 @@ __decorate([
|
|
|
3893
3935
|
var SparkScanViewEvents;
|
|
3894
3936
|
(function (SparkScanViewEvents) {
|
|
3895
3937
|
SparkScanViewEvents["fastFindButtonTapped"] = "SparkScanViewUiListener.fastFindButtonTapped";
|
|
3938
|
+
SparkScanViewEvents["barcodeFindButtonTapped"] = "SparkScanViewUiListener.barcodeFindButtonTapped";
|
|
3896
3939
|
SparkScanViewEvents["barcodeCountButtonTapped"] = "SparkScanViewUiListener.barcodeCountButtonTapped";
|
|
3897
3940
|
})(SparkScanViewEvents || (SparkScanViewEvents = {}));
|
|
3898
3941
|
var SparkScanFeedbackDelegateEvents;
|
|
@@ -3941,6 +3984,10 @@ class SparkScanViewController extends BaseController {
|
|
|
3941
3984
|
var _a, _b;
|
|
3942
3985
|
(_b = (_a = this.view.uiListener) === null || _a === void 0 ? void 0 : _a.didTapFastFindButton) === null || _b === void 0 ? void 0 : _b.call(_a, this.view);
|
|
3943
3986
|
});
|
|
3987
|
+
this.eventEmitter.on(SparkScanViewEvents.barcodeFindButtonTapped, () => {
|
|
3988
|
+
var _a, _b;
|
|
3989
|
+
(_b = (_a = this.view.uiListener) === null || _a === void 0 ? void 0 : _a.didTapBarcodeFindButton) === null || _b === void 0 ? void 0 : _b.call(_a, this.view);
|
|
3990
|
+
});
|
|
3944
3991
|
}
|
|
3945
3992
|
unsubscribeListeners() {
|
|
3946
3993
|
this._proxy.unregisterSparkScanViewListenerEvents();
|
|
@@ -4024,7 +4071,8 @@ class BaseSparkScanView {
|
|
|
4024
4071
|
this._scanningBehaviorButtonVisible = BaseSparkScanView.sparkScanDefaults.SparkScanView.scanningBehaviorButtonVisible;
|
|
4025
4072
|
this._handModeButtonVisible = BaseSparkScanView.sparkScanDefaults.SparkScanView.handModeButtonVisible;
|
|
4026
4073
|
this._barcodeCountButtonVisible = BaseSparkScanView.sparkScanDefaults.SparkScanView.barcodeCountButtonVisible;
|
|
4027
|
-
this._fastFindButtonVisible =
|
|
4074
|
+
this._fastFindButtonVisible = false;
|
|
4075
|
+
this._barcodeFindButtonVisible = BaseSparkScanView.sparkScanDefaults.SparkScanView.barcodeFindButtonVisible;
|
|
4028
4076
|
this._targetModeButtonVisible = BaseSparkScanView.sparkScanDefaults.SparkScanView.targetModeButtonVisible;
|
|
4029
4077
|
this._soundModeButtonVisible = BaseSparkScanView.sparkScanDefaults.SparkScanView.soundModeButtonVisible;
|
|
4030
4078
|
this._hapticModeButtonVisible = BaseSparkScanView.sparkScanDefaults.SparkScanView.hapticModeButtonVisible;
|
|
@@ -4059,10 +4107,18 @@ class BaseSparkScanView {
|
|
|
4059
4107
|
this._previewSizeControlVisible = newValue;
|
|
4060
4108
|
this.update();
|
|
4061
4109
|
}
|
|
4110
|
+
/**
|
|
4111
|
+
* @deprecated This property is deprecated as it's no longer needed.
|
|
4112
|
+
*/
|
|
4062
4113
|
get shouldShowScanAreaGuides() {
|
|
4114
|
+
console.warn('This property is deprecated as it\'s no longer needed.');
|
|
4063
4115
|
return this._shouldShowScanAreaGuides;
|
|
4064
4116
|
}
|
|
4117
|
+
/**
|
|
4118
|
+
* @deprecated This property is deprecated as it's no longer needed.
|
|
4119
|
+
*/
|
|
4065
4120
|
set shouldShowScanAreaGuides(newValue) {
|
|
4121
|
+
console.warn('This property is deprecated as it\'s no longer needed.');
|
|
4066
4122
|
this._shouldShowScanAreaGuides = newValue;
|
|
4067
4123
|
this.update();
|
|
4068
4124
|
}
|
|
@@ -4094,11 +4150,25 @@ class BaseSparkScanView {
|
|
|
4094
4150
|
this._barcodeCountButtonVisible = newValue;
|
|
4095
4151
|
this.update();
|
|
4096
4152
|
}
|
|
4153
|
+
/**
|
|
4154
|
+
* @deprecated This method was renamed. Use onBarcodeFindButtonTappedIn instead.
|
|
4155
|
+
*/
|
|
4097
4156
|
get fastFindButtonVisible() {
|
|
4157
|
+
console.warn('This property was renamed. Use the property `barcodeFindButtonVisible` instead.');
|
|
4098
4158
|
return this._fastFindButtonVisible;
|
|
4099
4159
|
}
|
|
4160
|
+
/**
|
|
4161
|
+
* @deprecated This method was renamed. Use onBarcodeFindButtonTappedIn instead.
|
|
4162
|
+
*/
|
|
4100
4163
|
set fastFindButtonVisible(newValue) {
|
|
4101
|
-
|
|
4164
|
+
// NOOP
|
|
4165
|
+
console.warn('This property was renamed. Use the property `barcodeFindButtonVisible` instead.');
|
|
4166
|
+
}
|
|
4167
|
+
get barcodeFindButtonVisible() {
|
|
4168
|
+
return this._barcodeFindButtonVisible;
|
|
4169
|
+
}
|
|
4170
|
+
set barcodeFindButtonVisible(newValue) {
|
|
4171
|
+
this._barcodeFindButtonVisible = newValue;
|
|
4102
4172
|
this.update();
|
|
4103
4173
|
}
|
|
4104
4174
|
get targetModeButtonVisible() {
|
|
@@ -4108,17 +4178,33 @@ class BaseSparkScanView {
|
|
|
4108
4178
|
this._targetModeButtonVisible = newValue;
|
|
4109
4179
|
this.update();
|
|
4110
4180
|
}
|
|
4181
|
+
/**
|
|
4182
|
+
* @deprecated This property is deprecated as sound mode button will be removed in the future.
|
|
4183
|
+
*/
|
|
4111
4184
|
get soundModeButtonVisible() {
|
|
4185
|
+
console.warn('This property is deprecated as sound mode button will be removed in the future.');
|
|
4112
4186
|
return this._soundModeButtonVisible;
|
|
4113
4187
|
}
|
|
4188
|
+
/**
|
|
4189
|
+
* @deprecated This property is deprecated as sound mode button will be removed in the future.
|
|
4190
|
+
*/
|
|
4114
4191
|
set soundModeButtonVisible(newValue) {
|
|
4192
|
+
console.warn('This property is deprecated as sound mode button will be removed in the future.');
|
|
4115
4193
|
this._soundModeButtonVisible = newValue;
|
|
4116
4194
|
this.update();
|
|
4117
4195
|
}
|
|
4196
|
+
/**
|
|
4197
|
+
* @deprecated This property is deprecated as haptic mode button will be removed in the future.
|
|
4198
|
+
*/
|
|
4118
4199
|
get hapticModeButtonVisible() {
|
|
4200
|
+
console.warn('This property is deprecated as haptic mode button will be removed in the future.');
|
|
4119
4201
|
return this._hapticModeButtonVisible;
|
|
4120
4202
|
}
|
|
4203
|
+
/**
|
|
4204
|
+
* @deprecated This property is deprecated as haptic mode button will be removed in the future.
|
|
4205
|
+
*/
|
|
4121
4206
|
set hapticModeButtonVisible(newValue) {
|
|
4207
|
+
console.warn('This property is deprecated as haptic mode button will be removed in the future.');
|
|
4122
4208
|
this._hapticModeButtonVisible = newValue;
|
|
4123
4209
|
this.update();
|
|
4124
4210
|
}
|
|
@@ -4279,7 +4365,7 @@ class BaseSparkScanView {
|
|
|
4279
4365
|
scanningBehaviorButtonVisible: this.scanningBehaviorButtonVisible,
|
|
4280
4366
|
handModeButtonVisible: this.handModeButtonVisible,
|
|
4281
4367
|
barcodeCountButtonVisible: this.barcodeCountButtonVisible,
|
|
4282
|
-
|
|
4368
|
+
barcodeFindButtonVisible: this.barcodeFindButtonVisible,
|
|
4283
4369
|
targetModeButtonVisible: this.targetModeButtonVisible,
|
|
4284
4370
|
soundModeButtonVisible: this.soundModeButtonVisible,
|
|
4285
4371
|
hapticModeButtonVisible: this.hapticModeButtonVisible,
|