barkoder-nativescript
Advanced tools
Comparing version 1.3.0 to 1.3.1
@@ -1,7 +0,10 @@ | ||
import { BarkoderConstants } from './barkoder-nativescript.common'; | ||
import { BarkoderConstants } from "./barkoder-nativescript.common"; | ||
import * as application from "@nativescript/core/application"; | ||
import { View } from '@nativescript/core'; | ||
import { BarkoderView } from './barkoder-nativescript.common'; | ||
import { View } from "@nativescript/core"; | ||
import { BarkoderView } from "./barkoder-nativescript.common"; | ||
const androidSupport = global.androidx && global.androidx.appcompat ? global.androidx.core.app : android.support.v4.app; | ||
const androidSupport = | ||
global.androidx && global.androidx.appcompat | ||
? global.androidx.core.app | ||
: android.support.v4.app; | ||
declare const com, global: any; | ||
@@ -12,830 +15,1106 @@ | ||
export class BarkoderViewAndroid extends View { | ||
public bkdView : any | ||
public bkd : any | ||
public bkdConfig : any | ||
public bkdHelper : any | ||
constructor() { | ||
super(); | ||
this.bkdConfig = com.barkoder.BarkoderConfig | ||
this.bkd = new com.barkoder.Barkoder() | ||
this.bkdView = new com.barkoder.BarkoderView(context, true) | ||
this.bkdView.config = new com.barkoder.BarkoderConfig(context, "asdad", null); | ||
this.bkdHelper = new com.barkoder.BarkoderHelper() | ||
// console.log(this._licenseKey) | ||
this.nativeView = this.bkdView | ||
} | ||
public bkdView: any; | ||
public bkd: any; | ||
public bkdConfig: any; | ||
public bkdHelper: any; | ||
startScanning(BarkoderResultCallback: BarkoderConstants.BarkoderResultCallback): void { | ||
const resultCallback = new com.barkoder.interfaces.BarkoderResultCallback({ | ||
scanningFinished: (results: any[], thumbnails: any[], resultImage: any) => { | ||
BarkoderResultCallback.scanningFinished(results, thumbnails, resultImage); | ||
} | ||
}); | ||
this.bkdView.startScanning(resultCallback); | ||
} | ||
constructor() { | ||
super(); | ||
this.bkdConfig = com.barkoder.BarkoderConfig; | ||
this.bkd = new com.barkoder.Barkoder(); | ||
this.bkdView = new com.barkoder.BarkoderView(context, true); | ||
this.bkdView.config = new com.barkoder.BarkoderConfig( | ||
context, | ||
"LICENSE_KEY", | ||
null | ||
); | ||
this.bkdHelper = new com.barkoder.BarkoderHelper(); | ||
this.nativeView = this.bkdView; | ||
} | ||
stopScanning(): void { | ||
this.bkdView.stopScanning() | ||
} | ||
/** | ||
* Initiates the barcode scanning process, allowing the application to detect and decode barcodes from the device's camera feed | ||
*/ | ||
startScanning( | ||
BarkoderResultCallback: BarkoderConstants.BarkoderResultCallback | ||
): void { | ||
const resultCallback = new com.barkoder.interfaces.BarkoderResultCallback({ | ||
scanningFinished: ( | ||
results: any[], | ||
thumbnails: any[], | ||
resultImage: any | ||
) => { | ||
BarkoderResultCallback.scanningFinished( | ||
results, | ||
thumbnails, | ||
resultImage | ||
); | ||
}, | ||
}); | ||
this.bkdView.startScanning(resultCallback); | ||
} | ||
pauseScanning() : void { | ||
this.bkdView.pauseScanning() | ||
} | ||
/** | ||
* Halts the barcode scanning process, stopping the camera from capturing and processing barcode information | ||
*/ | ||
stopScanning(): void { | ||
this.bkdView.stopScanning(); | ||
} | ||
isFlashAvailable(callback : BarkoderConstants.FlashAvailableCallback) { | ||
const isFlashAvailableCallback = new com.barkoder.interfaces.FlashAvailableCallback({ | ||
onFlashAvailable: (isFlashAvailable: any) => { | ||
callback.onFlashAvailable(isFlashAvailable) | ||
} | ||
}); | ||
this.bkdView.isFlashAvailable(isFlashAvailableCallback) | ||
} | ||
pauseScanning(): void { | ||
this.bkdView.pauseScanning(); | ||
} | ||
setFlashEnabled(enabled : boolean) : void { | ||
this.bkdView.setFlashEnabled(enabled) | ||
} | ||
/** | ||
* Checks whether the device has a built-in flash (torch) that can be used for illumination during barcode scanning | ||
*/ | ||
isFlashAvailable(callback: BarkoderConstants.FlashAvailableCallback) { | ||
const isFlashAvailableCallback = new com.barkoder.interfaces.FlashAvailableCallback( | ||
{ | ||
onFlashAvailable: (isFlashAvailable: any) => { | ||
callback.onFlashAvailable(isFlashAvailable); | ||
}, | ||
} | ||
); | ||
this.bkdView.isFlashAvailable(isFlashAvailableCallback); | ||
} | ||
getMaxZoomFactor(callback : BarkoderConstants.MaxZoomAvailableCallback) { | ||
const MaxZoomCallback = new com.barkoder.interfaces.MaxZoomAvailableCallback({ | ||
onMaxZoomAvailable: (maxZoomFacttor: any) => { | ||
callback.onMaxZoomAvailable(maxZoomFacttor) | ||
} | ||
}); | ||
this.bkdView.getMaxZoomFactor(MaxZoomCallback) | ||
} | ||
/** | ||
* Enables or disables the device's flash (torch) for illumination during barcode scanning | ||
* @param enabled | ||
*/ | ||
setFlashEnabled(enabled: boolean): void { | ||
this.bkdView.setFlashEnabled(enabled); | ||
} | ||
setZoomFactor(zoomFactor : number) : void { | ||
this.bkdView.setZoomFactor(zoomFactor) | ||
} | ||
/** | ||
* Retrieves the maximum available zoom factor for the device's camera | ||
*/ | ||
getMaxZoomFactor(callback: BarkoderConstants.MaxZoomAvailableCallback) { | ||
const MaxZoomCallback = new com.barkoder.interfaces.MaxZoomAvailableCallback( | ||
{ | ||
onMaxZoomAvailable: (maxZoomFacttor: any) => { | ||
callback.onMaxZoomAvailable(maxZoomFacttor); | ||
}, | ||
} | ||
); | ||
this.bkdView.getMaxZoomFactor(MaxZoomCallback); | ||
} | ||
getLocationLineColorHex() : any { | ||
return this.bkdView.config.getLocationLineColor() | ||
} | ||
/** | ||
* Sets the zoom factor for the device's camera, adjusting the level of zoom during barcode scanning | ||
* @param zoomFactor | ||
*/ | ||
setZoomFactor(zoomFactor: number): void { | ||
this.bkdView.setZoomFactor(zoomFactor); | ||
} | ||
setLocationLineColor(locationLineColor : string) : void { | ||
const locationColor = this.hexToAndroidColor(locationLineColor) | ||
this.bkdView.config.setLocationLineColor(locationColor) | ||
} | ||
setRoiLineColor(roiLineColor: string) : void { | ||
const roiLineColorHex = this.hexToAndroidColor(roiLineColor) | ||
this.bkdView.config.setRoiLineColor(roiLineColorHex) | ||
} | ||
/** | ||
* Retrieves the hexadecimal color code representing the line color used to indicate the location of detected barcodes | ||
*/ | ||
getLocationLineColorHex(): any { | ||
return this.bkdView.config.getLocationLineColor(); | ||
} | ||
setRoiLineWidth(roiLineWidth : number) : void { | ||
this.bkdView.config.setRoiLineWidth(roiLineWidth) | ||
} | ||
/** | ||
* Sets the color of the lines used to indicate the location of detected barcodes on the camera feed | ||
*/ | ||
setLocationLineColor(locationLineColor: string): void { | ||
const locationColor = this.hexToAndroidColor(locationLineColor); | ||
this.bkdView.config.setLocationLineColor(locationColor); | ||
} | ||
setRoiOverlayBackgroundColor(roiOverlayBackgroundColor) : void { | ||
const roiOberlayBackgroundColor = this.hexToAndroidColor(roiOverlayBackgroundColor) | ||
this.bkdView.config.setRoiOverlayBackgroundColor(roiOberlayBackgroundColor) | ||
} | ||
/** | ||
* Sets the color of the lines outlining the Region of Interest (ROI) for barcode scanning on the camera feed | ||
*/ | ||
setRoiLineColor(roiLineColor: string): void { | ||
const roiLineColorHex = this.hexToAndroidColor(roiLineColor); | ||
this.bkdView.config.setRoiLineColor(roiLineColorHex); | ||
} | ||
setCloseSessionOnResultEnabled(enabled : boolean) : void { | ||
this.bkdView.config.setCloseSessionOnResultEnabled(enabled) | ||
} | ||
setImageResultEnabled(enabled : boolean): void { | ||
this.bkdView.config.setImageResultEnabled(enabled); | ||
} | ||
/** | ||
* Sets the width of the lines outlining the Region of Interest (ROI) for barcode scanning on the camera feed | ||
*/ | ||
setRoiLineWidth(roiLineWidth: number): void { | ||
this.bkdView.config.setRoiLineWidth(roiLineWidth); | ||
} | ||
setLocationInImageResultEnabled(enabled : boolean) : void { | ||
this.bkdView.config.setLocationInImageResultEnabled(enabled) | ||
} | ||
/** | ||
* Sets the background color of the overlay within the Region of Interest (ROI) for barcode scanning on the camera feed | ||
*/ | ||
setRoiOverlayBackgroundColor(roiOverlayBackgroundColor): void { | ||
const roiOberlayBackgroundColor = this.hexToAndroidColor( | ||
roiOverlayBackgroundColor | ||
); | ||
this.bkdView.config.setRoiOverlayBackgroundColor(roiOberlayBackgroundColor); | ||
} | ||
setLocationInPreviewEnabled(enabled : boolean) : void { | ||
this.bkdView.config.setLocationInPreviewEnabled(enabled) | ||
} | ||
/** | ||
* Enables or disables the automatic closing of the scanning session upon detecting a barcode result | ||
*/ | ||
setCloseSessionOnResultEnabled(enabled: boolean): void { | ||
this.bkdView.config.setCloseSessionOnResultEnabled(enabled); | ||
} | ||
setPinchToZoomEnabled(enabled : boolean) : void { | ||
this.bkdView.config.setPinchToZoomEnabled(enabled) | ||
} | ||
/** | ||
* Enables or disables the capturing and processing of image data when a barcode is successfully detected | ||
*/ | ||
setImageResultEnabled(enabled: boolean): void { | ||
this.bkdView.config.setImageResultEnabled(enabled); | ||
} | ||
setRegionOfInterestVisible(enabled : boolean) : void { | ||
this.bkdView.config.setRegionOfInterestVisible(enabled) | ||
} | ||
setRegionOfInterest( | ||
left : number, top : number, width : number, height : number | ||
) : void { | ||
this.bkdView.config.setRegionOfInterest( | ||
left, top, width, height | ||
); | ||
} | ||
setBeepOnSuccessEnabled(enabled : boolean) : void { | ||
this.bkdView.config.setBeepOnSuccessEnabled(enabled) | ||
} | ||
/** | ||
* Enables or disables the inclusion of barcode location information within the image data result | ||
*/ | ||
setLocationInImageResultEnabled(enabled: boolean): void { | ||
this.bkdView.config.setLocationInImageResultEnabled(enabled); | ||
} | ||
setVibrateOnSuccessEnabled(enabled: boolean) : void { | ||
this.bkdView.config.setVibrateOnSuccessEnabled(enabled) | ||
} | ||
/** | ||
* Enables or disables the display of barcode location information on the camera preview | ||
*/ | ||
setLocationInPreviewEnabled(enabled: boolean): void { | ||
this.bkdView.config.setLocationInPreviewEnabled(enabled); | ||
} | ||
getEncodingCharacterSet() : any { | ||
return this.bkdView.config.getDecoderConfig().encodingCharacterSet | ||
} | ||
getDecodingSpeed(): any { | ||
return this.bkdView.config.getDecoderConfig().decodingSpeed | ||
} | ||
/** | ||
* Enables or disables the pinch-to-zoom feature for adjusting the zoom level during barcode scanning | ||
*/ | ||
setPinchToZoomEnabled(enabled: boolean): void { | ||
this.bkdView.config.setPinchToZoomEnabled(enabled); | ||
} | ||
getFormattingType() : any { | ||
return this.bkdView.config.getDecoderConfig().formattingType | ||
} | ||
/** | ||
* Sets the visibility of the Region of Interest (ROI) on the camera preview | ||
*/ | ||
setRegionOfInterestVisible(enabled: boolean): void { | ||
this.bkdView.config.setRegionOfInterestVisible(enabled); | ||
} | ||
setLocationLineWidth(width : number) : void { | ||
const roundedValue = Math.round(width * 100) / 100; | ||
this.bkdView.config.setLocationLineWidth(roundedValue); | ||
} | ||
/** | ||
* Defines the Region of Interest (ROI) on the camera preview for barcode scanning, specifying an area where the application focuses on detecting barcodes | ||
*/ | ||
setRegionOfInterest( | ||
left: number, | ||
top: number, | ||
width: number, | ||
height: number | ||
): void { | ||
this.bkdView.config.setRegionOfInterest(left, top, width, height); | ||
} | ||
getLocationLineWidth(): any { | ||
return this.bkdView.config.getLocationLineWidth(); | ||
} | ||
/** | ||
* Enables or disables the audible beep sound upon successfully decoding a barcode | ||
*/ | ||
setBeepOnSuccessEnabled(enabled: boolean): void { | ||
this.bkdView.config.setBeepOnSuccessEnabled(enabled); | ||
} | ||
getRoiLineWidth() : any { | ||
return this.bkdView.config.getRoiLineWidth() | ||
} | ||
/** | ||
* Enables or disables the device vibration upon successfully decoding a barcode. | ||
*/ | ||
setVibrateOnSuccessEnabled(enabled: boolean): void { | ||
this.bkdView.config.setVibrateOnSuccessEnabled(enabled); | ||
} | ||
getRoiOverlayBackgroundColorHex() : any { | ||
return this.bkdView.config.getRoiOverlayBackgroundColor() | ||
} | ||
/** | ||
* Retrieves the character set used for encoding barcode data | ||
*/ | ||
getEncodingCharacterSet(): any { | ||
return this.bkdView.config.getDecoderConfig().encodingCharacterSet; | ||
} | ||
isCloseSessionOnResultEnabled() : any { | ||
return this.bkdView.config.isCloseSessionOnResultEnabled() | ||
} | ||
/** | ||
* Retrieves the current decoding speed setting for barcode scanning | ||
*/ | ||
getDecodingSpeed(): any { | ||
return this.bkdView.config.getDecoderConfig().decodingSpeed; | ||
} | ||
isImageResultEnabled() : any { | ||
return this.bkdView.config.isImageResultEnabled() | ||
} | ||
/** | ||
* Retrieves the formatting type used for presenting decoded barcode data | ||
*/ | ||
getFormattingType(): any { | ||
return this.bkdView.config.getDecoderConfig().formattingType; | ||
} | ||
isLocationInImageResultEnabled() : any { | ||
return this.bkdView.config.isLocationInImageResultEnabled() | ||
} | ||
getRegionOfInterest() : any { | ||
return this.bkdView.config.getRegionOfInterest() | ||
} | ||
getThreadsLimit() : any { | ||
return this.bkdConfig.GetThreadsLimit() | ||
} | ||
setThreadsLimit(threadsLimit : number) : void { | ||
this.bkdConfig.SetThreadsLimit(threadsLimit) | ||
} | ||
isLocationInPreviewEnabled() : Promise <any> { | ||
return this.bkdView.config.isLocationInPreviewEnabled() | ||
} | ||
/** | ||
* Sets the width of the lines indicating the location of detected barcodes on the camera feed | ||
*/ | ||
setLocationLineWidth(width: number): void { | ||
const roundedValue = Math.round(width * 100) / 100; | ||
this.bkdView.config.setLocationLineWidth(roundedValue); | ||
} | ||
isPinchToZoomEnabled() : Promise <any> { | ||
return this.bkdView.config.isPinchToZoomEnabled() | ||
} | ||
/** | ||
* Retrieves the current width setting for the lines indicating the location of detected barcodes on the camera feed | ||
*/ | ||
getLocationLineWidth(): any { | ||
return this.bkdView.config.getLocationLineWidth(); | ||
} | ||
isRegionOfInterestVisible() : Promise <any> { | ||
return this.bkdView.config.isRegionOfInterestVisible() | ||
} | ||
/** | ||
* Retrieves the current width setting for the lines outlining the Region of Interest (ROI) on the camera preview | ||
*/ | ||
getRoiLineWidth(): any { | ||
return this.bkdView.config.getRoiLineWidth(); | ||
} | ||
isBeepOnSuccessEnabled() : Promise <any> { | ||
return this.bkdView.config.isBeepOnSuccessEnabled() | ||
} | ||
isVibrateOnSuccessEnabled() : Promise <any> { | ||
return this.bkdView.config.isVibrateOnSuccessEnabled() | ||
} | ||
getVersion() : any { | ||
return com.barkoder.Barkoder.GetVersion() | ||
} | ||
/** | ||
* Retrieves the hexadecimal color code representing the background color of the overlay within the Region of Interest (ROI) on the camera preview | ||
*/ | ||
getRoiOverlayBackgroundColorHex(): any { | ||
return this.bkdView.config.getRoiOverlayBackgroundColor(); | ||
} | ||
getMsiCheckSumType() : any { | ||
return this.bkdView.config.getDecoderConfig().Msi.checksumType | ||
} | ||
/** | ||
* Enables or disables the automatic closing of the scanning session upon detecting a barcode result | ||
*/ | ||
isCloseSessionOnResultEnabled(): any { | ||
return this.bkdView.config.isCloseSessionOnResultEnabled(); | ||
} | ||
getCode39CheckSumType() : any { | ||
return this.bkdView.config.getDecoderConfig().Code39.checksumType | ||
} | ||
/** | ||
* Enables or disables the capturing and processing of image data when a barcode is successfully detected | ||
*/ | ||
isImageResultEnabled(): any { | ||
return this.bkdView.config.isImageResultEnabled(); | ||
} | ||
getCode11CheckSumType() : any { | ||
return this.bkdView.config.getDecoderConfig().Code11.checksumType | ||
} | ||
/** | ||
* Enables or disables the inclusion of barcode location information within the image data result | ||
*/ | ||
isLocationInImageResultEnabled(): any { | ||
return this.bkdView.config.isLocationInImageResultEnabled(); | ||
} | ||
setBarkoderResolution(barkoderResolution : BarkoderConstants.BarkoderResolution) : void { | ||
if(barkoderResolution == BarkoderConstants.BarkoderResolution.NORMAL) { | ||
this.bkdView.config.setBarkoderResolution(com.barkoder.enums.BarkoderResolution.Normal); | ||
; | ||
} else if (barkoderResolution == BarkoderConstants.BarkoderResolution.HIGH) { | ||
this.bkdView.config.setBarkoderResolution(com.barkoder.enums.BarkoderResolution.HIGH); | ||
} | ||
} | ||
/** | ||
* Retrieves the region of interest (ROI) | ||
*/ | ||
getRegionOfInterest(): any { | ||
return this.bkdView.config.getRegionOfInterest(); | ||
} | ||
getBarkoderResolution() : any { | ||
return this.bkdView.config.getBarkoderResolution() | ||
} | ||
/** | ||
* Retrieves the threads limit | ||
*/ | ||
getThreadsLimit(): any { | ||
return this.bkdConfig.GetThreadsLimit(); | ||
} | ||
setEncodingCharacterSet(encodingCharSet : any) : void { | ||
this.bkdView.config.getDecoderConfig().encodingCharacterSet = encodingCharSet | ||
/** | ||
* Sets the threads limit | ||
*/ | ||
setThreadsLimit(threadsLimit: number): void { | ||
this.bkdConfig.SetThreadsLimit(threadsLimit); | ||
} | ||
/** | ||
* Checks if location in preview is enabled | ||
*/ | ||
isLocationInPreviewEnabled(): Promise<any> { | ||
return this.bkdView.config.isLocationInPreviewEnabled(); | ||
} | ||
/** | ||
* Checks if pinch to zoom is enabled | ||
*/ | ||
isPinchToZoomEnabled(): Promise<any> { | ||
return this.bkdView.config.isPinchToZoomEnabled(); | ||
} | ||
/** | ||
* Checks if the region of interest (ROI) is visible | ||
*/ | ||
isRegionOfInterestVisible(): Promise<any> { | ||
return this.bkdView.config.isRegionOfInterestVisible(); | ||
} | ||
/** | ||
* Retrieves the value indicating whether a beep sound is played on successful barcode scanning | ||
*/ | ||
isBeepOnSuccessEnabled(): Promise<any> { | ||
return this.bkdView.config.isBeepOnSuccessEnabled(); | ||
} | ||
/** | ||
* Retrieves the value indicating whether vibration is enabled on successful barcode scanning | ||
*/ | ||
isVibrateOnSuccessEnabled(): Promise<any> { | ||
return this.bkdView.config.isVibrateOnSuccessEnabled(); | ||
} | ||
/** | ||
* Retrieves the version of the Barkoder library | ||
*/ | ||
getVersion(): any { | ||
return com.barkoder.Barkoder.GetVersion(); | ||
} | ||
/** | ||
* Retrieves the MSI checksum type | ||
*/ | ||
getMsiCheckSumType(): any { | ||
return this.bkdView.config.getDecoderConfig().Msi.checksumType; | ||
} | ||
/** | ||
* Retrieves the checksum type for Code 39 barcodes | ||
*/ | ||
getCode39CheckSumType(): any { | ||
return this.bkdView.config.getDecoderConfig().Code39.checksumType; | ||
} | ||
/** | ||
* Retrieves the Code11 checksum type | ||
*/ | ||
getCode11CheckSumType(): any { | ||
return this.bkdView.config.getDecoderConfig().Code11.checksumType; | ||
} | ||
/** | ||
* Sets the resolution for barcode scanning | ||
*/ | ||
setBarkoderResolution( | ||
barkoderResolution: BarkoderConstants.BarkoderResolution | ||
): void { | ||
if (barkoderResolution == BarkoderConstants.BarkoderResolution.NORMAL) { | ||
this.bkdView.config.setBarkoderResolution( | ||
com.barkoder.enums.BarkoderResolution.Normal | ||
); | ||
} else if ( | ||
barkoderResolution == BarkoderConstants.BarkoderResolution.HIGH | ||
) { | ||
this.bkdView.config.setBarkoderResolution( | ||
com.barkoder.enums.BarkoderResolution.HIGH | ||
); | ||
} | ||
} | ||
setDecodingSpeed(decodingSpeed: BarkoderConstants.DecodingSpeed): void { | ||
if(decodingSpeed == BarkoderConstants.DecodingSpeed.Slow) { | ||
this.bkdView.config.getDecoderConfig().decodingSpeed = | ||
com.barkoder.Barkoder.DecodingSpeed.Slow; | ||
} else if (decodingSpeed == BarkoderConstants.DecodingSpeed.Fast){ | ||
this.bkdView.config.getDecoderConfig().decodingSpeed = | ||
com.barkoder.Barkoder.DecodingSpeed.Fast; | ||
} else if(decodingSpeed == BarkoderConstants.DecodingSpeed.Normal){ | ||
this.bkdView.config.getDecoderConfig().decodingSpeed = | ||
com.barkoder.Barkoder.DecodingSpeed.Normal; | ||
} else { | ||
console.log("Not avilbilable Decoding Speed") | ||
} | ||
/** | ||
* Retrieves the resolution for barcode scanning | ||
*/ | ||
getBarkoderResolution(): any { | ||
return this.bkdView.config.getBarkoderResolution(); | ||
} | ||
/** | ||
* Sets the encoding character set for barcode scanning | ||
*/ | ||
setEncodingCharacterSet(encodingCharSet: any): void { | ||
this.bkdView.config.getDecoderConfig().encodingCharacterSet = encodingCharSet; | ||
} | ||
/** | ||
* Sets the decoding speed for barcode scanning | ||
*/ | ||
setDecodingSpeed(decodingSpeed: BarkoderConstants.DecodingSpeed): void { | ||
if (decodingSpeed == BarkoderConstants.DecodingSpeed.Slow) { | ||
this.bkdView.config.getDecoderConfig().decodingSpeed = | ||
com.barkoder.Barkoder.DecodingSpeed.Slow; | ||
} else if (decodingSpeed == BarkoderConstants.DecodingSpeed.Fast) { | ||
this.bkdView.config.getDecoderConfig().decodingSpeed = | ||
com.barkoder.Barkoder.DecodingSpeed.Fast; | ||
} else if (decodingSpeed == BarkoderConstants.DecodingSpeed.Normal) { | ||
this.bkdView.config.getDecoderConfig().decodingSpeed = | ||
com.barkoder.Barkoder.DecodingSpeed.Normal; | ||
} else { | ||
console.log("Not avilbilable Decoding Speed"); | ||
} | ||
} | ||
setFormattingType(formattingType: BarkoderConstants.FormattingType) { | ||
switch (formattingType) { | ||
case BarkoderConstants.FormattingType.Disabled: | ||
this.bkdView.config.getDecoderConfig().formattingType | ||
= com.barkoder.Barkoder.FormattingType.Disabled | ||
break; | ||
case BarkoderConstants.FormattingType.Automatic: | ||
this.bkdView.config.getDecoderConfig().formattingType | ||
= com.barkoder.Barkoder.FormattingType.Automatic | ||
break; | ||
case BarkoderConstants.FormattingType.GS1: | ||
this.bkdView.config.getDecoderConfig().formattingType | ||
= com.barkoder.Barkoder.FormattingType.GS1 | ||
break; | ||
case BarkoderConstants.FormattingType.AAMVA: | ||
this.bkdView.config.getDecoderConfig().formattingType | ||
= com.barkoder.Barkoder.FormattingType.AAMVA | ||
break; | ||
} | ||
/** | ||
* Sets the formatting type for barcode scanning | ||
*/ | ||
setFormattingType(formattingType: BarkoderConstants.FormattingType) { | ||
switch (formattingType) { | ||
case BarkoderConstants.FormattingType.Disabled: | ||
this.bkdView.config.getDecoderConfig().formattingType = | ||
com.barkoder.Barkoder.FormattingType.Disabled; | ||
break; | ||
case BarkoderConstants.FormattingType.Automatic: | ||
this.bkdView.config.getDecoderConfig().formattingType = | ||
com.barkoder.Barkoder.FormattingType.Automatic; | ||
break; | ||
case BarkoderConstants.FormattingType.GS1: | ||
this.bkdView.config.getDecoderConfig().formattingType = | ||
com.barkoder.Barkoder.FormattingType.GS1; | ||
break; | ||
case BarkoderConstants.FormattingType.AAMVA: | ||
this.bkdView.config.getDecoderConfig().formattingType = | ||
com.barkoder.Barkoder.FormattingType.AAMVA; | ||
break; | ||
} | ||
} | ||
setMsiCheckSumType(msiCheckSumType : BarkoderConstants.MsiChecksumType) { | ||
switch (msiCheckSumType) { | ||
case BarkoderConstants.MsiChecksumType.Disabled: | ||
this.bkdView.config.getDecoderConfig().Msi.checksumType = com.barkoder.Barkoder.MsiChecksumType.Disabled | ||
break; | ||
case BarkoderConstants.MsiChecksumType.Mod10: | ||
this.bkdView.config.getDecoderConfig().Msi.checksumType = com.barkoder.Barkoder.MsiChecksumType.Mod10 | ||
break; | ||
case BarkoderConstants.MsiChecksumType.Mod11: | ||
this.bkdView.config.getDecoderConfig().Msi.checksumType = com.barkoder.Barkoder.MsiChecksumType.Mod11 | ||
break; | ||
case BarkoderConstants.MsiChecksumType.Mod1010: | ||
this.bkdView.config.getDecoderConfig().Msi.checksumType = com.barkoder.Barkoder.MsiChecksumType.Mod1010 | ||
break; | ||
case BarkoderConstants.MsiChecksumType.Mod1110: | ||
this.bkdView.config.getDecoderConfig().Msi.checksumType = com.barkoder.Barkoder.MsiChecksumType.Mod1110 | ||
break; | ||
case BarkoderConstants.MsiChecksumType.Mod11IBM: | ||
this.bkdView.config.getDecoderConfig().Msi.checksumType = com.barkoder.Barkoder.MsiChecksumType.Mod11IBM | ||
break; | ||
case BarkoderConstants.MsiChecksumType.Mod1110IBM: | ||
this.bkdView.config.getDecoderConfig().Msi.checksumType = com.barkoder.Barkoder.MsiChecksumType.Mod1110IBM | ||
break; | ||
} | ||
/** | ||
* Sets the MSI checksum type | ||
*/ | ||
setMsiCheckSumType(msiCheckSumType: BarkoderConstants.MsiChecksumType) { | ||
switch (msiCheckSumType) { | ||
case BarkoderConstants.MsiChecksumType.Disabled: | ||
this.bkdView.config.getDecoderConfig().Msi.checksumType = | ||
com.barkoder.Barkoder.MsiChecksumType.Disabled; | ||
break; | ||
case BarkoderConstants.MsiChecksumType.Mod10: | ||
this.bkdView.config.getDecoderConfig().Msi.checksumType = | ||
com.barkoder.Barkoder.MsiChecksumType.Mod10; | ||
break; | ||
case BarkoderConstants.MsiChecksumType.Mod11: | ||
this.bkdView.config.getDecoderConfig().Msi.checksumType = | ||
com.barkoder.Barkoder.MsiChecksumType.Mod11; | ||
break; | ||
case BarkoderConstants.MsiChecksumType.Mod1010: | ||
this.bkdView.config.getDecoderConfig().Msi.checksumType = | ||
com.barkoder.Barkoder.MsiChecksumType.Mod1010; | ||
break; | ||
case BarkoderConstants.MsiChecksumType.Mod1110: | ||
this.bkdView.config.getDecoderConfig().Msi.checksumType = | ||
com.barkoder.Barkoder.MsiChecksumType.Mod1110; | ||
break; | ||
case BarkoderConstants.MsiChecksumType.Mod11IBM: | ||
this.bkdView.config.getDecoderConfig().Msi.checksumType = | ||
com.barkoder.Barkoder.MsiChecksumType.Mod11IBM; | ||
break; | ||
case BarkoderConstants.MsiChecksumType.Mod1110IBM: | ||
this.bkdView.config.getDecoderConfig().Msi.checksumType = | ||
com.barkoder.Barkoder.MsiChecksumType.Mod1110IBM; | ||
break; | ||
} | ||
} | ||
setCode39CheckSumType(code39ChecksumType : BarkoderConstants.Code39ChecksumType) { | ||
switch(code39ChecksumType) { | ||
case BarkoderConstants.Code39ChecksumType.Disabled: | ||
this.bkdView.config.getDecoderConfig().Code39.checksumType = com.barkoder.Barkoder.Code39ChecksumType.Disabled | ||
break; | ||
case BarkoderConstants.Code39ChecksumType.Enabled: | ||
this.bkdView.config.getDecoderConfig().Code39.checksumType = com.barkoder.Barkoder.Code39ChecksumType.Enabled | ||
break; | ||
} | ||
/** | ||
* Sets the Code39 checksum type | ||
*/ | ||
setCode39CheckSumType( | ||
code39ChecksumType: BarkoderConstants.Code39ChecksumType | ||
) { | ||
switch (code39ChecksumType) { | ||
case BarkoderConstants.Code39ChecksumType.Disabled: | ||
this.bkdView.config.getDecoderConfig().Code39.checksumType = | ||
com.barkoder.Barkoder.Code39ChecksumType.Disabled; | ||
break; | ||
case BarkoderConstants.Code39ChecksumType.Enabled: | ||
this.bkdView.config.getDecoderConfig().Code39.checksumType = | ||
com.barkoder.Barkoder.Code39ChecksumType.Enabled; | ||
break; | ||
} | ||
} | ||
setCode11CheckSumType(code11CheckSumType : BarkoderConstants.Code11ChecksumType) { | ||
switch(code11CheckSumType) { | ||
case BarkoderConstants.Code11ChecksumType.Disabled: | ||
this.bkdView.config.getDecoderConfig().Code11.checksumType = com.barkoder.Barkoder.Code11ChecksumType.Disabled | ||
break; | ||
case BarkoderConstants.Code11ChecksumType.Single: | ||
this.bkdView.config.getDecoderConfig().Code11.checksumType = com.barkoder.Barkoder.Code11ChecksumType.Single | ||
break; | ||
case BarkoderConstants.Code11ChecksumType.Double: | ||
this.bkdView.config.getDecoderConfig().Code11.checksumType = com.barkoder.Barkoder.Code11ChecksumType.Double | ||
break; | ||
} | ||
/** | ||
* Sets the Code11 checksum type | ||
*/ | ||
setCode11CheckSumType( | ||
code11CheckSumType: BarkoderConstants.Code11ChecksumType | ||
) { | ||
switch (code11CheckSumType) { | ||
case BarkoderConstants.Code11ChecksumType.Disabled: | ||
this.bkdView.config.getDecoderConfig().Code11.checksumType = | ||
com.barkoder.Barkoder.Code11ChecksumType.Disabled; | ||
break; | ||
case BarkoderConstants.Code11ChecksumType.Single: | ||
this.bkdView.config.getDecoderConfig().Code11.checksumType = | ||
com.barkoder.Barkoder.Code11ChecksumType.Single; | ||
break; | ||
case BarkoderConstants.Code11ChecksumType.Double: | ||
this.bkdView.config.getDecoderConfig().Code11.checksumType = | ||
com.barkoder.Barkoder.Code11ChecksumType.Double; | ||
break; | ||
} | ||
} | ||
isBarcodeTypeEnabled(decoder: BarkoderConstants.DecoderType) : boolean { | ||
switch (decoder) { | ||
case BarkoderConstants.DecoderType.Aztec: | ||
return this.bkdView.config.getDecoderConfig().Aztec.enabled; | ||
case BarkoderConstants.DecoderType.AztecCompact: | ||
return this.bkdView.config.getDecoderConfig().AztecCompact.enabled; | ||
case BarkoderConstants.DecoderType.QR: | ||
return this.bkdView.config.getDecoderConfig().QR.enabled; | ||
case BarkoderConstants.DecoderType.QRMicro: | ||
return this.bkdView.config.getDecoderConfig().QRMicro.enabled; | ||
case BarkoderConstants.DecoderType.Code128: | ||
return this.bkdView.config.getDecoderConfig().Code128.enabled; | ||
case BarkoderConstants.DecoderType.Code93: | ||
return this.bkdView.config.getDecoderConfig().Code93.enabled; | ||
case BarkoderConstants.DecoderType.Code39: | ||
return this.bkdView.config.getDecoderConfig().Code39.enabled; | ||
case BarkoderConstants.DecoderType.Telepen: | ||
return this.bkdView.config.getDecoderConfig().Telepen.enabled; | ||
case BarkoderConstants.DecoderType.Code11: | ||
return this.bkdView.config.getDecoderConfig().Code11.enabled; | ||
case BarkoderConstants.DecoderType.Msi: | ||
return this.bkdView.config.getDecoderConfig().Msi.enabled; | ||
case BarkoderConstants.DecoderType.UpcA: | ||
return this.bkdView.config.getDecoderConfig().UpcA.enabled; | ||
case BarkoderConstants.DecoderType.UpcE: | ||
return this.bkdView.config.getDecoderConfig().UpcE.enabled; | ||
case BarkoderConstants.DecoderType.UpcE1: | ||
return this.bkdView.config.getDecoderConfig().UpcE1.enabled; | ||
case BarkoderConstants.DecoderType.Ean13: | ||
return this.bkdView.config.getDecoderConfig().Ean13.enabled; | ||
case BarkoderConstants.DecoderType.Ean8: | ||
return this.bkdView.config.getDecoderConfig().Ean8.enabled; | ||
case BarkoderConstants.DecoderType.PDF417: | ||
return this.bkdView.config.getDecoderConfig().PDF417.enabled; | ||
case BarkoderConstants.DecoderType.PDF417Micro: | ||
return this.bkdView.config.getDecoderConfig().PDF417Micro.enabled; | ||
case BarkoderConstants.DecoderType.Datamatrix: | ||
return this.bkdView.config.getDecoderConfig().Datamatrix.enabled; | ||
case BarkoderConstants.DecoderType.Code25: | ||
return this.bkdView.config.getDecoderConfig().Code25.enabled; | ||
case BarkoderConstants.DecoderType.Interleaved25: | ||
return this.bkdView.config.getDecoderConfig().Interleaved25.enabled; | ||
case BarkoderConstants.DecoderType.ITF14: | ||
return this.bkdView.config.getDecoderConfig().ITF14.enabled; | ||
case BarkoderConstants.DecoderType.IATA25: | ||
return this.bkdView.config.getDecoderConfig().IATA25.enabled; | ||
case BarkoderConstants.DecoderType.Matrix25: | ||
return this.bkdView.config.getDecoderConfig().Matrix25.enabled; | ||
case BarkoderConstants.DecoderType.Datalogic25: | ||
return this.bkdView.config.getDecoderConfig().Datalogic25.enabled; | ||
case BarkoderConstants.DecoderType.COOP25: | ||
return this.bkdView.config.getDecoderConfig().COOP25.enabled; | ||
case BarkoderConstants.DecoderType.Dotcode: | ||
return this.bkdView.config.getDecoderConfig().Dotcode.enabled; | ||
} | ||
/** | ||
* Checks if a specific barcode type is enabled | ||
*/ | ||
isBarcodeTypeEnabled(decoder: BarkoderConstants.DecoderType): boolean { | ||
switch (decoder) { | ||
case BarkoderConstants.DecoderType.Aztec: | ||
return this.bkdView.config.getDecoderConfig().Aztec.enabled; | ||
case BarkoderConstants.DecoderType.AztecCompact: | ||
return this.bkdView.config.getDecoderConfig().AztecCompact.enabled; | ||
case BarkoderConstants.DecoderType.QR: | ||
return this.bkdView.config.getDecoderConfig().QR.enabled; | ||
case BarkoderConstants.DecoderType.QRMicro: | ||
return this.bkdView.config.getDecoderConfig().QRMicro.enabled; | ||
case BarkoderConstants.DecoderType.Code128: | ||
return this.bkdView.config.getDecoderConfig().Code128.enabled; | ||
case BarkoderConstants.DecoderType.Code93: | ||
return this.bkdView.config.getDecoderConfig().Code93.enabled; | ||
case BarkoderConstants.DecoderType.Code39: | ||
return this.bkdView.config.getDecoderConfig().Code39.enabled; | ||
case BarkoderConstants.DecoderType.Telepen: | ||
return this.bkdView.config.getDecoderConfig().Telepen.enabled; | ||
case BarkoderConstants.DecoderType.Code11: | ||
return this.bkdView.config.getDecoderConfig().Code11.enabled; | ||
case BarkoderConstants.DecoderType.Msi: | ||
return this.bkdView.config.getDecoderConfig().Msi.enabled; | ||
case BarkoderConstants.DecoderType.UpcA: | ||
return this.bkdView.config.getDecoderConfig().UpcA.enabled; | ||
case BarkoderConstants.DecoderType.UpcE: | ||
return this.bkdView.config.getDecoderConfig().UpcE.enabled; | ||
case BarkoderConstants.DecoderType.UpcE1: | ||
return this.bkdView.config.getDecoderConfig().UpcE1.enabled; | ||
case BarkoderConstants.DecoderType.Ean13: | ||
return this.bkdView.config.getDecoderConfig().Ean13.enabled; | ||
case BarkoderConstants.DecoderType.Ean8: | ||
return this.bkdView.config.getDecoderConfig().Ean8.enabled; | ||
case BarkoderConstants.DecoderType.PDF417: | ||
return this.bkdView.config.getDecoderConfig().PDF417.enabled; | ||
case BarkoderConstants.DecoderType.PDF417Micro: | ||
return this.bkdView.config.getDecoderConfig().PDF417Micro.enabled; | ||
case BarkoderConstants.DecoderType.Datamatrix: | ||
return this.bkdView.config.getDecoderConfig().Datamatrix.enabled; | ||
case BarkoderConstants.DecoderType.Code25: | ||
return this.bkdView.config.getDecoderConfig().Code25.enabled; | ||
case BarkoderConstants.DecoderType.Interleaved25: | ||
return this.bkdView.config.getDecoderConfig().Interleaved25.enabled; | ||
case BarkoderConstants.DecoderType.ITF14: | ||
return this.bkdView.config.getDecoderConfig().ITF14.enabled; | ||
case BarkoderConstants.DecoderType.IATA25: | ||
return this.bkdView.config.getDecoderConfig().IATA25.enabled; | ||
case BarkoderConstants.DecoderType.Matrix25: | ||
return this.bkdView.config.getDecoderConfig().Matrix25.enabled; | ||
case BarkoderConstants.DecoderType.Datalogic25: | ||
return this.bkdView.config.getDecoderConfig().Datalogic25.enabled; | ||
case BarkoderConstants.DecoderType.COOP25: | ||
return this.bkdView.config.getDecoderConfig().COOP25.enabled; | ||
case BarkoderConstants.DecoderType.Dotcode: | ||
return this.bkdView.config.getDecoderConfig().Dotcode.enabled; | ||
} | ||
} | ||
setBarcodeTypeEnabled(decoders: BarkoderConstants.DecoderType[]): void { | ||
this.bkdView.config.getDecoderConfig().Aztec.enabled = false; | ||
this.bkdView.config.getDecoderConfig().AztecCompact.enabled = false; | ||
this.bkdView.config.getDecoderConfig().QR.enabled = false; | ||
this.bkdView.config.getDecoderConfig().QRMicro.enabled = false; | ||
this.bkdView.config.getDecoderConfig().Code128.enabled = false; | ||
this.bkdView.config.getDecoderConfig().Code93.enabled = false; | ||
this.bkdView.config.getDecoderConfig().Code39.enabled = false; | ||
this.bkdView.config.getDecoderConfig().Telepen.enabled = false; | ||
this.bkdView.config.getDecoderConfig().Code11.enabled = false; | ||
this.bkdView.config.getDecoderConfig().Codabar.enabled = false; | ||
this.bkdView.config.getDecoderConfig().Msi.enabled = false; | ||
this.bkdView.config.getDecoderConfig().UpcA.enabled = false; | ||
this.bkdView.config.getDecoderConfig().UpcE.enabled = false; | ||
this.bkdView.config.getDecoderConfig().UpcE1.enabled = false; | ||
this.bkdView.config.getDecoderConfig().Ean13.enabled = false; | ||
this.bkdView.config.getDecoderConfig().Ean8.enabled = false; | ||
this.bkdView.config.getDecoderConfig().PDF417.enabled = false; | ||
this.bkdView.config.getDecoderConfig().PDF417Micro.enabled = false; | ||
this.bkdView.config.getDecoderConfig().Datamatrix.enabled = false; | ||
this.bkdView.config.getDecoderConfig().Code25.enabled = false; | ||
this.bkdView.config.getDecoderConfig().Interleaved25.enabled = false; | ||
this.bkdView.config.getDecoderConfig().ITF14.enabled = false; | ||
this.bkdView.config.getDecoderConfig().IATA25.enabled = false; | ||
this.bkdView.config.getDecoderConfig().Matrix25.enabled = false; | ||
this.bkdView.config.getDecoderConfig().Datalogic25.enabled = false; | ||
this.bkdView.config.getDecoderConfig().COOP25.enabled = false; | ||
this.bkdView.config.getDecoderConfig().Dotcode.enabled = false; | ||
decoders.forEach((dt: BarkoderConstants.DecoderType) => { | ||
switch (dt) { | ||
case BarkoderConstants.DecoderType.Aztec: | ||
this.bkdView.config.getDecoderConfig().Aztec.enabled = true; | ||
break; | ||
case BarkoderConstants.DecoderType.AztecCompact: | ||
this.bkdView.config.getDecoderConfig().AztecCompact.enabled = true; | ||
break; | ||
case BarkoderConstants.DecoderType.QR: | ||
this.bkdView.config.getDecoderConfig().QR.enabled = true; | ||
break; | ||
case BarkoderConstants.DecoderType.QRMicro: | ||
this.bkdView.config.getDecoderConfig().QRMicro.enabled = true; | ||
break; | ||
case BarkoderConstants.DecoderType.Code128: | ||
this.bkdView.config.getDecoderConfig().Code128.enabled = true; | ||
break; | ||
case BarkoderConstants.DecoderType.Code93: | ||
this.bkdView.config.getDecoderConfig().Code93.enabled = true; | ||
break; | ||
case BarkoderConstants.DecoderType.Code39: | ||
this.bkdView.config.getDecoderConfig().Code39.enabled = true; | ||
break; | ||
case BarkoderConstants.DecoderType.Telepen: | ||
this.bkdView.config.getDecoderConfig().Telepen.enabled = true; | ||
break; | ||
case BarkoderConstants.DecoderType.Code11: | ||
this.bkdView.config.getDecoderConfig().Code11.enabled = true; | ||
break; | ||
case BarkoderConstants.DecoderType.Msi: | ||
this.bkdView.config.getDecoderConfig().Msi.enabled = true; | ||
break; | ||
case BarkoderConstants.DecoderType.UpcA: | ||
this.bkdView.config.getDecoderConfig().UpcA.enabled = true; | ||
break; | ||
case BarkoderConstants.DecoderType.UpcE: | ||
this.bkdView.config.getDecoderConfig().UpcE.enabled = true; | ||
break; | ||
case BarkoderConstants.DecoderType.UpcE1: | ||
this.bkdView.config.getDecoderConfig().UpcE1.enabled = true; | ||
break; | ||
case BarkoderConstants.DecoderType.Ean13: | ||
this.bkdView.config.getDecoderConfig().Ean13.enabled = true; | ||
break; | ||
case BarkoderConstants.DecoderType.Ean8: | ||
this.bkdView.config.getDecoderConfig().Ean8.enabled = true; | ||
break; | ||
case BarkoderConstants.DecoderType.PDF417: | ||
this.bkdView.config.getDecoderConfig().PDF417.enabled = true; | ||
break; | ||
case BarkoderConstants.DecoderType.PDF417Micro: | ||
this.bkdView.config.getDecoderConfig().PDF417Micro.enabled = true; | ||
break; | ||
case BarkoderConstants.DecoderType.Datamatrix: | ||
this.bkdView.config.getDecoderConfig().Datamatrix.enabled = true; | ||
break; | ||
case BarkoderConstants.DecoderType.Code25: | ||
this.bkdView.config.getDecoderConfig().Code25.enabled = true; | ||
break; | ||
case BarkoderConstants.DecoderType.Interleaved25: | ||
this.bkdView.config.getDecoderConfig().Interleaved25.enabled = true; | ||
break; | ||
case BarkoderConstants.DecoderType.ITF14: | ||
this.bkdView.config.getDecoderConfig().ITF14.enabled = true; | ||
break; | ||
case BarkoderConstants.DecoderType.IATA25: | ||
this.bkdView.config.getDecoderConfig().IATA25.enabled = true; | ||
break; | ||
case BarkoderConstants.DecoderType.Matrix25: | ||
this.bkdView.config.getDecoderConfig().Matrix25.enabled = true; | ||
break; | ||
case BarkoderConstants.DecoderType.Datalogic25: | ||
this.bkdView.config.getDecoderConfig().Datalogic25.enabled = true; | ||
break; | ||
case BarkoderConstants.DecoderType.COOP25: | ||
this.bkdView.config.getDecoderConfig().COOP25.enabled = true; | ||
break; | ||
case BarkoderConstants.DecoderType.Dotcode: | ||
this.bkdView.config.getDecoderConfig().Dotcode.enabled = true; | ||
break; | ||
default: | ||
break; | ||
} | ||
}); | ||
/** | ||
* Sets whether a specific barcode type is enabled | ||
*/ | ||
setBarcodeTypeEnabled(decoders: BarkoderConstants.DecoderType[]): void { | ||
this.bkdView.config.getDecoderConfig().Aztec.enabled = false; | ||
this.bkdView.config.getDecoderConfig().AztecCompact.enabled = false; | ||
this.bkdView.config.getDecoderConfig().QR.enabled = false; | ||
this.bkdView.config.getDecoderConfig().QRMicro.enabled = false; | ||
this.bkdView.config.getDecoderConfig().Code128.enabled = false; | ||
this.bkdView.config.getDecoderConfig().Code93.enabled = false; | ||
this.bkdView.config.getDecoderConfig().Code39.enabled = false; | ||
this.bkdView.config.getDecoderConfig().Telepen.enabled = false; | ||
this.bkdView.config.getDecoderConfig().Code11.enabled = false; | ||
this.bkdView.config.getDecoderConfig().Codabar.enabled = false; | ||
this.bkdView.config.getDecoderConfig().Msi.enabled = false; | ||
this.bkdView.config.getDecoderConfig().UpcA.enabled = false; | ||
this.bkdView.config.getDecoderConfig().UpcE.enabled = false; | ||
this.bkdView.config.getDecoderConfig().UpcE1.enabled = false; | ||
this.bkdView.config.getDecoderConfig().Ean13.enabled = false; | ||
this.bkdView.config.getDecoderConfig().Ean8.enabled = false; | ||
this.bkdView.config.getDecoderConfig().PDF417.enabled = false; | ||
this.bkdView.config.getDecoderConfig().PDF417Micro.enabled = false; | ||
this.bkdView.config.getDecoderConfig().Datamatrix.enabled = false; | ||
this.bkdView.config.getDecoderConfig().Code25.enabled = false; | ||
this.bkdView.config.getDecoderConfig().Interleaved25.enabled = false; | ||
this.bkdView.config.getDecoderConfig().ITF14.enabled = false; | ||
this.bkdView.config.getDecoderConfig().IATA25.enabled = false; | ||
this.bkdView.config.getDecoderConfig().Matrix25.enabled = false; | ||
this.bkdView.config.getDecoderConfig().Datalogic25.enabled = false; | ||
this.bkdView.config.getDecoderConfig().COOP25.enabled = false; | ||
this.bkdView.config.getDecoderConfig().Dotcode.enabled = false; | ||
decoders.forEach((dt: BarkoderConstants.DecoderType) => { | ||
switch (dt) { | ||
case BarkoderConstants.DecoderType.Aztec: | ||
this.bkdView.config.getDecoderConfig().Aztec.enabled = true; | ||
break; | ||
case BarkoderConstants.DecoderType.AztecCompact: | ||
this.bkdView.config.getDecoderConfig().AztecCompact.enabled = true; | ||
break; | ||
case BarkoderConstants.DecoderType.QR: | ||
this.bkdView.config.getDecoderConfig().QR.enabled = true; | ||
break; | ||
case BarkoderConstants.DecoderType.QRMicro: | ||
this.bkdView.config.getDecoderConfig().QRMicro.enabled = true; | ||
break; | ||
case BarkoderConstants.DecoderType.Code128: | ||
this.bkdView.config.getDecoderConfig().Code128.enabled = true; | ||
break; | ||
case BarkoderConstants.DecoderType.Code93: | ||
this.bkdView.config.getDecoderConfig().Code93.enabled = true; | ||
break; | ||
case BarkoderConstants.DecoderType.Code39: | ||
this.bkdView.config.getDecoderConfig().Code39.enabled = true; | ||
break; | ||
case BarkoderConstants.DecoderType.Telepen: | ||
this.bkdView.config.getDecoderConfig().Telepen.enabled = true; | ||
break; | ||
case BarkoderConstants.DecoderType.Code11: | ||
this.bkdView.config.getDecoderConfig().Code11.enabled = true; | ||
break; | ||
case BarkoderConstants.DecoderType.Msi: | ||
this.bkdView.config.getDecoderConfig().Msi.enabled = true; | ||
break; | ||
case BarkoderConstants.DecoderType.UpcA: | ||
this.bkdView.config.getDecoderConfig().UpcA.enabled = true; | ||
break; | ||
case BarkoderConstants.DecoderType.UpcE: | ||
this.bkdView.config.getDecoderConfig().UpcE.enabled = true; | ||
break; | ||
case BarkoderConstants.DecoderType.UpcE1: | ||
this.bkdView.config.getDecoderConfig().UpcE1.enabled = true; | ||
break; | ||
case BarkoderConstants.DecoderType.Ean13: | ||
this.bkdView.config.getDecoderConfig().Ean13.enabled = true; | ||
break; | ||
case BarkoderConstants.DecoderType.Ean8: | ||
this.bkdView.config.getDecoderConfig().Ean8.enabled = true; | ||
break; | ||
case BarkoderConstants.DecoderType.PDF417: | ||
this.bkdView.config.getDecoderConfig().PDF417.enabled = true; | ||
break; | ||
case BarkoderConstants.DecoderType.PDF417Micro: | ||
this.bkdView.config.getDecoderConfig().PDF417Micro.enabled = true; | ||
break; | ||
case BarkoderConstants.DecoderType.Datamatrix: | ||
this.bkdView.config.getDecoderConfig().Datamatrix.enabled = true; | ||
break; | ||
case BarkoderConstants.DecoderType.Code25: | ||
this.bkdView.config.getDecoderConfig().Code25.enabled = true; | ||
break; | ||
case BarkoderConstants.DecoderType.Interleaved25: | ||
this.bkdView.config.getDecoderConfig().Interleaved25.enabled = true; | ||
break; | ||
case BarkoderConstants.DecoderType.ITF14: | ||
this.bkdView.config.getDecoderConfig().ITF14.enabled = true; | ||
break; | ||
case BarkoderConstants.DecoderType.IATA25: | ||
this.bkdView.config.getDecoderConfig().IATA25.enabled = true; | ||
break; | ||
case BarkoderConstants.DecoderType.Matrix25: | ||
this.bkdView.config.getDecoderConfig().Matrix25.enabled = true; | ||
break; | ||
case BarkoderConstants.DecoderType.Datalogic25: | ||
this.bkdView.config.getDecoderConfig().Datalogic25.enabled = true; | ||
break; | ||
case BarkoderConstants.DecoderType.COOP25: | ||
this.bkdView.config.getDecoderConfig().COOP25.enabled = true; | ||
break; | ||
case BarkoderConstants.DecoderType.Dotcode: | ||
this.bkdView.config.getDecoderConfig().Dotcode.enabled = true; | ||
break; | ||
default: | ||
break; | ||
} | ||
}); | ||
} | ||
setBarcodeTypeLengthRange(decoder: BarkoderConstants.DecoderType, minimumLength:number, maximumLength: number) { | ||
switch (decoder) { | ||
case BarkoderConstants.DecoderType.Aztec: | ||
this.bkdView.config.getDecoderConfig().Aztec.minimumLength = minimumLength | ||
this.bkdView.config.getDecoderConfig().Aztec.maximumLength = maximumLength | ||
break; | ||
case BarkoderConstants.DecoderType.AztecCompact: | ||
this.bkdView.config.getDecoderConfig().AztecCompact.minimumLength = minimumLength | ||
this.bkdView.config.getDecoderConfig().AztecCompact.maximumLength = maximumLength | ||
break; | ||
case BarkoderConstants.DecoderType.QR: | ||
this.bkdView.config.getDecoderConfig().QR.minimumLength = minimumLength | ||
this.bkdView.config.getDecoderConfig().QR.maximumLength = maximumLength | ||
break; | ||
case BarkoderConstants.DecoderType.QRMicro: | ||
this.bkdView.config.getDecoderConfig().QRMicro.minimumLength = minimumLength | ||
this.bkdView.config.getDecoderConfig().QRMicro.maximumLength = maximumLength | ||
break; | ||
case BarkoderConstants.DecoderType.Code128: | ||
this.bkdView.config.getDecoderConfig().Code128.minimumLength = minimumLength | ||
this.bkdView.config.getDecoderConfig().Code128.maximumLength = maximumLength | ||
break; | ||
case BarkoderConstants.DecoderType.Code93: | ||
this.bkdView.config.getDecoderConfig().Code93.minimumLength = minimumLength | ||
this.bkdView.config.getDecoderConfig().Code93.maximumLength = maximumLength | ||
break; | ||
case BarkoderConstants.DecoderType.Code39: | ||
this.bkdView.config.getDecoderConfig().Code39.minimumLength = minimumLength | ||
this.bkdView.config.getDecoderConfig().Code39.maximumLength = maximumLength | ||
break; | ||
case BarkoderConstants.DecoderType.Telepen: | ||
this.bkdView.config.getDecoderConfig().Telepen.minimumLength = minimumLength | ||
this.bkdView.config.getDecoderConfig().Telepen.maximumLength = maximumLength | ||
break; | ||
case BarkoderConstants.DecoderType.Code11: | ||
this.bkdView.config.getDecoderConfig().Code11.minimumLength = minimumLength | ||
this.bkdView.config.getDecoderConfig().Code11.maximumLength = maximumLength | ||
break; | ||
case BarkoderConstants.DecoderType.Msi: | ||
this.bkdView.config.getDecoderConfig().Msi.minimumLength = minimumLength | ||
this.bkdView.config.getDecoderConfig().Msi.maximumLength = maximumLength | ||
break; | ||
case BarkoderConstants.DecoderType.UpcA: | ||
this.bkdView.config.getDecoderConfig().UpcA.minimumLength = minimumLength | ||
this.bkdView.config.getDecoderConfig().UpcA.maximumLength = maximumLength | ||
break; | ||
case BarkoderConstants.DecoderType.UpcE: | ||
this.bkdView.config.getDecoderConfig().UpcE.minimumLength = minimumLength | ||
this.bkdView.config.getDecoderConfig().UpcE.maximumLength = maximumLength | ||
break; | ||
case BarkoderConstants.DecoderType.UpcE1: | ||
this.bkdView.config.getDecoderConfig().UpcE1.minimumLength = minimumLength | ||
this.bkdView.config.getDecoderConfig().UpcE1.maximumLength = maximumLength | ||
break; | ||
case BarkoderConstants.DecoderType.Ean13: | ||
this.bkdView.config.getDecoderConfig().Ean13.minimumLength = minimumLength | ||
this.bkdView.config.getDecoderConfig().Ean13.maximumLength = maximumLength | ||
break; | ||
case BarkoderConstants.DecoderType.Ean8: | ||
this.bkdView.config.getDecoderConfig().Ean8.minimumLength = minimumLength | ||
this.bkdView.config.getDecoderConfig().Ean8.maximumLength = maximumLength | ||
break; | ||
case BarkoderConstants.DecoderType.PDF417: | ||
this.bkdView.config.getDecoderConfig().PDF417.minimumLength = minimumLength | ||
this.bkdView.config.getDecoderConfig().PDF417.maximumLength = maximumLength | ||
break; | ||
case BarkoderConstants.DecoderType.PDF417Micro: | ||
this.bkdView.config.getDecoderConfig().PDF417Micro.minimumLength = minimumLength | ||
this.bkdView.config.getDecoderConfig().PDF417Micro.maximumLength = maximumLength | ||
break; | ||
case BarkoderConstants.DecoderType.Datamatrix: | ||
this.bkdView.config.getDecoderConfig().Datamatrix.minimumLength = minimumLength | ||
this.bkdView.config.getDecoderConfig().Datamatrix.maximumLength = maximumLength | ||
break; | ||
case BarkoderConstants.DecoderType.Code25: | ||
this.bkdView.config.getDecoderConfig().Code25.minimumLength = minimumLength | ||
this.bkdView.config.getDecoderConfig().Code25.maximumLength = maximumLength | ||
break; | ||
case BarkoderConstants.DecoderType.Interleaved25: | ||
this.bkdView.config.getDecoderConfig().Interleaved25.minimumLength = minimumLength | ||
this.bkdView.config.getDecoderConfig().Interleaved25.maximumLength = maximumLength | ||
break; | ||
case BarkoderConstants.DecoderType.ITF14: | ||
this.bkdView.config.getDecoderConfig().ITF14.minimumLength = minimumLength | ||
this.bkdView.config.getDecoderConfig().ITF14.maximumLength = maximumLength | ||
break; | ||
case BarkoderConstants.DecoderType.IATA25: | ||
this.bkdView.config.getDecoderConfig().IATA25.minimumLength = minimumLength | ||
this.bkdView.config.getDecoderConfig().IATA25.maximumLength = maximumLength | ||
break; | ||
case BarkoderConstants.DecoderType.Matrix25: | ||
this.bkdView.config.getDecoderConfig().Matrix25.minimumLength = minimumLength | ||
this.bkdView.config.getDecoderConfig().Matrix25.maximumLength = maximumLength | ||
break; | ||
case BarkoderConstants.DecoderType.Datalogic25: | ||
this.bkdView.config.getDecoderConfig().Datalogic25.minimumLength = minimumLength | ||
this.bkdView.config.getDecoderConfig().Datalogic25.maximumLength = maximumLength | ||
break; | ||
case BarkoderConstants.DecoderType.COOP25: | ||
this.bkdView.config.getDecoderConfig().COOP25.minimumLength = minimumLength | ||
this.bkdView.config.getDecoderConfig().COOP25.maximumLength = maximumLength | ||
break; | ||
case BarkoderConstants.DecoderType.Dotcode: | ||
this.bkdView.config.getDecoderConfig().Dotcode.minimumLength = minimumLength | ||
this.bkdView.config.getDecoderConfig().Dotcode.maximumLength = maximumLength | ||
break; | ||
default: | ||
break; | ||
} | ||
/** | ||
* Sets the length range for the specified barcode type | ||
*/ | ||
setBarcodeTypeLengthRange( | ||
decoder: BarkoderConstants.DecoderType, | ||
minimumLength: number, | ||
maximumLength: number | ||
) { | ||
switch (decoder) { | ||
case BarkoderConstants.DecoderType.Aztec: | ||
this.bkdView.config.getDecoderConfig().Aztec.minimumLength = minimumLength; | ||
this.bkdView.config.getDecoderConfig().Aztec.maximumLength = maximumLength; | ||
break; | ||
case BarkoderConstants.DecoderType.AztecCompact: | ||
this.bkdView.config.getDecoderConfig().AztecCompact.minimumLength = minimumLength; | ||
this.bkdView.config.getDecoderConfig().AztecCompact.maximumLength = maximumLength; | ||
break; | ||
case BarkoderConstants.DecoderType.QR: | ||
this.bkdView.config.getDecoderConfig().QR.minimumLength = minimumLength; | ||
this.bkdView.config.getDecoderConfig().QR.maximumLength = maximumLength; | ||
break; | ||
case BarkoderConstants.DecoderType.QRMicro: | ||
this.bkdView.config.getDecoderConfig().QRMicro.minimumLength = minimumLength; | ||
this.bkdView.config.getDecoderConfig().QRMicro.maximumLength = maximumLength; | ||
break; | ||
case BarkoderConstants.DecoderType.Code128: | ||
this.bkdView.config.getDecoderConfig().Code128.minimumLength = minimumLength; | ||
this.bkdView.config.getDecoderConfig().Code128.maximumLength = maximumLength; | ||
break; | ||
case BarkoderConstants.DecoderType.Code93: | ||
this.bkdView.config.getDecoderConfig().Code93.minimumLength = minimumLength; | ||
this.bkdView.config.getDecoderConfig().Code93.maximumLength = maximumLength; | ||
break; | ||
case BarkoderConstants.DecoderType.Code39: | ||
this.bkdView.config.getDecoderConfig().Code39.minimumLength = minimumLength; | ||
this.bkdView.config.getDecoderConfig().Code39.maximumLength = maximumLength; | ||
break; | ||
case BarkoderConstants.DecoderType.Telepen: | ||
this.bkdView.config.getDecoderConfig().Telepen.minimumLength = minimumLength; | ||
this.bkdView.config.getDecoderConfig().Telepen.maximumLength = maximumLength; | ||
break; | ||
case BarkoderConstants.DecoderType.Code11: | ||
this.bkdView.config.getDecoderConfig().Code11.minimumLength = minimumLength; | ||
this.bkdView.config.getDecoderConfig().Code11.maximumLength = maximumLength; | ||
break; | ||
case BarkoderConstants.DecoderType.Msi: | ||
this.bkdView.config.getDecoderConfig().Msi.minimumLength = minimumLength; | ||
this.bkdView.config.getDecoderConfig().Msi.maximumLength = maximumLength; | ||
break; | ||
case BarkoderConstants.DecoderType.UpcA: | ||
this.bkdView.config.getDecoderConfig().UpcA.minimumLength = minimumLength; | ||
this.bkdView.config.getDecoderConfig().UpcA.maximumLength = maximumLength; | ||
break; | ||
case BarkoderConstants.DecoderType.UpcE: | ||
this.bkdView.config.getDecoderConfig().UpcE.minimumLength = minimumLength; | ||
this.bkdView.config.getDecoderConfig().UpcE.maximumLength = maximumLength; | ||
break; | ||
case BarkoderConstants.DecoderType.UpcE1: | ||
this.bkdView.config.getDecoderConfig().UpcE1.minimumLength = minimumLength; | ||
this.bkdView.config.getDecoderConfig().UpcE1.maximumLength = maximumLength; | ||
break; | ||
case BarkoderConstants.DecoderType.Ean13: | ||
this.bkdView.config.getDecoderConfig().Ean13.minimumLength = minimumLength; | ||
this.bkdView.config.getDecoderConfig().Ean13.maximumLength = maximumLength; | ||
break; | ||
case BarkoderConstants.DecoderType.Ean8: | ||
this.bkdView.config.getDecoderConfig().Ean8.minimumLength = minimumLength; | ||
this.bkdView.config.getDecoderConfig().Ean8.maximumLength = maximumLength; | ||
break; | ||
case BarkoderConstants.DecoderType.PDF417: | ||
this.bkdView.config.getDecoderConfig().PDF417.minimumLength = minimumLength; | ||
this.bkdView.config.getDecoderConfig().PDF417.maximumLength = maximumLength; | ||
break; | ||
case BarkoderConstants.DecoderType.PDF417Micro: | ||
this.bkdView.config.getDecoderConfig().PDF417Micro.minimumLength = minimumLength; | ||
this.bkdView.config.getDecoderConfig().PDF417Micro.maximumLength = maximumLength; | ||
break; | ||
case BarkoderConstants.DecoderType.Datamatrix: | ||
this.bkdView.config.getDecoderConfig().Datamatrix.minimumLength = minimumLength; | ||
this.bkdView.config.getDecoderConfig().Datamatrix.maximumLength = maximumLength; | ||
break; | ||
case BarkoderConstants.DecoderType.Code25: | ||
this.bkdView.config.getDecoderConfig().Code25.minimumLength = minimumLength; | ||
this.bkdView.config.getDecoderConfig().Code25.maximumLength = maximumLength; | ||
break; | ||
case BarkoderConstants.DecoderType.Interleaved25: | ||
this.bkdView.config.getDecoderConfig().Interleaved25.minimumLength = minimumLength; | ||
this.bkdView.config.getDecoderConfig().Interleaved25.maximumLength = maximumLength; | ||
break; | ||
case BarkoderConstants.DecoderType.ITF14: | ||
this.bkdView.config.getDecoderConfig().ITF14.minimumLength = minimumLength; | ||
this.bkdView.config.getDecoderConfig().ITF14.maximumLength = maximumLength; | ||
break; | ||
case BarkoderConstants.DecoderType.IATA25: | ||
this.bkdView.config.getDecoderConfig().IATA25.minimumLength = minimumLength; | ||
this.bkdView.config.getDecoderConfig().IATA25.maximumLength = maximumLength; | ||
break; | ||
case BarkoderConstants.DecoderType.Matrix25: | ||
this.bkdView.config.getDecoderConfig().Matrix25.minimumLength = minimumLength; | ||
this.bkdView.config.getDecoderConfig().Matrix25.maximumLength = maximumLength; | ||
break; | ||
case BarkoderConstants.DecoderType.Datalogic25: | ||
this.bkdView.config.getDecoderConfig().Datalogic25.minimumLength = minimumLength; | ||
this.bkdView.config.getDecoderConfig().Datalogic25.maximumLength = maximumLength; | ||
break; | ||
case BarkoderConstants.DecoderType.COOP25: | ||
this.bkdView.config.getDecoderConfig().COOP25.minimumLength = minimumLength; | ||
this.bkdView.config.getDecoderConfig().COOP25.maximumLength = maximumLength; | ||
break; | ||
case BarkoderConstants.DecoderType.Dotcode: | ||
this.bkdView.config.getDecoderConfig().Dotcode.minimumLength = minimumLength; | ||
this.bkdView.config.getDecoderConfig().Dotcode.maximumLength = maximumLength; | ||
break; | ||
default: | ||
break; | ||
} | ||
} | ||
getBarcodeTypeMaximumLenght(decoder: BarkoderConstants.DecoderType) : any { | ||
switch (decoder) { | ||
case BarkoderConstants.DecoderType.Aztec: | ||
return this.bkdView.config.getDecoderConfig().Aztec.maximumLength | ||
case BarkoderConstants.DecoderType.AztecCompact: | ||
return this.bkdView.config.getDecoderConfig().AztecCompact.maximumLength | ||
case BarkoderConstants.DecoderType.QR: | ||
return this.bkdView.config.getDecoderConfig().QR.maximumLength | ||
case BarkoderConstants.DecoderType.QRMicro: | ||
return this.bkdView.config.getDecoderConfig().QRMicro.maximumLength | ||
case BarkoderConstants.DecoderType.Code128: | ||
return this.bkdView.config.getDecoderConfig().Code128.maximumLength | ||
case BarkoderConstants.DecoderType.Code93: | ||
return this.bkdView.config.getDecoderConfig().Code93.maximumLength | ||
case BarkoderConstants.DecoderType.Code39: | ||
return this.bkdView.config.getDecoderConfig().Code39.maximumLength | ||
case BarkoderConstants.DecoderType.Telepen: | ||
return this.bkdView.config.getDecoderConfig().Telepen.maximumLength | ||
case BarkoderConstants.DecoderType.Code11: | ||
return this.bkdView.config.getDecoderConfig().Code11.maximumLength | ||
case BarkoderConstants.DecoderType.Msi: | ||
return this.bkdView.config.getDecoderConfig().Msi.maximumLength | ||
case BarkoderConstants.DecoderType.UpcA: | ||
return this.bkdView.config.getDecoderConfig().UpcA.maximumLength | ||
case BarkoderConstants.DecoderType.UpcE: | ||
return this.bkdView.config.getDecoderConfig().UpcE.maximumLength | ||
case BarkoderConstants.DecoderType.UpcE1: | ||
return this.bkdView.config.getDecoderConfig().UpcE1.maximumLength | ||
case BarkoderConstants.DecoderType.Ean13: | ||
return this.bkdView.config.getDecoderConfig().Ean13.maximumLength | ||
case BarkoderConstants.DecoderType.Ean8: | ||
return this.bkdView.config.getDecoderConfig().Ean8.maximumLength | ||
case BarkoderConstants.DecoderType.PDF417: | ||
return this.bkdView.config.getDecoderConfig().PDF417.maximumLength | ||
case BarkoderConstants.DecoderType.PDF417Micro: | ||
return this.bkdView.config.getDecoderConfig().PDF417Micro.maximumLength | ||
case BarkoderConstants.DecoderType.Datamatrix: | ||
return this.bkdView.config.getDecoderConfig().Datamatrix.maximumLength | ||
case BarkoderConstants.DecoderType.Code25: | ||
return this.bkdView.config.getDecoderConfig().Code25.maximumLength | ||
case BarkoderConstants.DecoderType.Interleaved25: | ||
return this.bkdView.config.getDecoderConfig().Interleaved25.maximumLength | ||
case BarkoderConstants.DecoderType.ITF14: | ||
return this.bkdView.config.getDecoderConfig().ITF14.maximumLength | ||
case BarkoderConstants.DecoderType.IATA25: | ||
return this.bkdView.config.getDecoderConfig().IATA25.maximumLength | ||
case BarkoderConstants.DecoderType.Matrix25: | ||
return this.bkdView.config.getDecoderConfig().Matrix25.maximumLength | ||
case BarkoderConstants.DecoderType.Datalogic25: | ||
return this.bkdView.config.getDecoderConfig().Datalogic25.maximumLength | ||
case BarkoderConstants.DecoderType.COOP25: | ||
return this.bkdView.config.getDecoderConfig().COOP25.maximumLength | ||
case BarkoderConstants.DecoderType.Dotcode: | ||
return this.bkdView.config.getDecoderConfig().Dotcode.maximumLength | ||
} | ||
getBarcodeTypeMaximumLenght(decoder: BarkoderConstants.DecoderType): any { | ||
switch (decoder) { | ||
case BarkoderConstants.DecoderType.Aztec: | ||
return this.bkdView.config.getDecoderConfig().Aztec.maximumLength; | ||
case BarkoderConstants.DecoderType.AztecCompact: | ||
return this.bkdView.config.getDecoderConfig().AztecCompact | ||
.maximumLength; | ||
case BarkoderConstants.DecoderType.QR: | ||
return this.bkdView.config.getDecoderConfig().QR.maximumLength; | ||
case BarkoderConstants.DecoderType.QRMicro: | ||
return this.bkdView.config.getDecoderConfig().QRMicro.maximumLength; | ||
case BarkoderConstants.DecoderType.Code128: | ||
return this.bkdView.config.getDecoderConfig().Code128.maximumLength; | ||
case BarkoderConstants.DecoderType.Code93: | ||
return this.bkdView.config.getDecoderConfig().Code93.maximumLength; | ||
case BarkoderConstants.DecoderType.Code39: | ||
return this.bkdView.config.getDecoderConfig().Code39.maximumLength; | ||
case BarkoderConstants.DecoderType.Telepen: | ||
return this.bkdView.config.getDecoderConfig().Telepen.maximumLength; | ||
case BarkoderConstants.DecoderType.Code11: | ||
return this.bkdView.config.getDecoderConfig().Code11.maximumLength; | ||
case BarkoderConstants.DecoderType.Msi: | ||
return this.bkdView.config.getDecoderConfig().Msi.maximumLength; | ||
case BarkoderConstants.DecoderType.UpcA: | ||
return this.bkdView.config.getDecoderConfig().UpcA.maximumLength; | ||
case BarkoderConstants.DecoderType.UpcE: | ||
return this.bkdView.config.getDecoderConfig().UpcE.maximumLength; | ||
case BarkoderConstants.DecoderType.UpcE1: | ||
return this.bkdView.config.getDecoderConfig().UpcE1.maximumLength; | ||
case BarkoderConstants.DecoderType.Ean13: | ||
return this.bkdView.config.getDecoderConfig().Ean13.maximumLength; | ||
case BarkoderConstants.DecoderType.Ean8: | ||
return this.bkdView.config.getDecoderConfig().Ean8.maximumLength; | ||
case BarkoderConstants.DecoderType.PDF417: | ||
return this.bkdView.config.getDecoderConfig().PDF417.maximumLength; | ||
case BarkoderConstants.DecoderType.PDF417Micro: | ||
return this.bkdView.config.getDecoderConfig().PDF417Micro.maximumLength; | ||
case BarkoderConstants.DecoderType.Datamatrix: | ||
return this.bkdView.config.getDecoderConfig().Datamatrix.maximumLength; | ||
case BarkoderConstants.DecoderType.Code25: | ||
return this.bkdView.config.getDecoderConfig().Code25.maximumLength; | ||
case BarkoderConstants.DecoderType.Interleaved25: | ||
return this.bkdView.config.getDecoderConfig().Interleaved25 | ||
.maximumLength; | ||
case BarkoderConstants.DecoderType.ITF14: | ||
return this.bkdView.config.getDecoderConfig().ITF14.maximumLength; | ||
case BarkoderConstants.DecoderType.IATA25: | ||
return this.bkdView.config.getDecoderConfig().IATA25.maximumLength; | ||
case BarkoderConstants.DecoderType.Matrix25: | ||
return this.bkdView.config.getDecoderConfig().Matrix25.maximumLength; | ||
case BarkoderConstants.DecoderType.Datalogic25: | ||
return this.bkdView.config.getDecoderConfig().Datalogic25.maximumLength; | ||
case BarkoderConstants.DecoderType.COOP25: | ||
return this.bkdView.config.getDecoderConfig().COOP25.maximumLength; | ||
case BarkoderConstants.DecoderType.Dotcode: | ||
return this.bkdView.config.getDecoderConfig().Dotcode.maximumLength; | ||
} | ||
} | ||
getBarcodeTypeMinimumLenght(decoder: BarkoderConstants.DecoderType) : any { | ||
switch (decoder) { | ||
case BarkoderConstants.DecoderType.Aztec: | ||
return this.bkdView.config.getDecoderConfig().Aztec.minimumLength | ||
case BarkoderConstants.DecoderType.AztecCompact: | ||
return this.bkdView.config.getDecoderConfig().AztecCompact.minimumLength | ||
case BarkoderConstants.DecoderType.QR: | ||
return this.bkdView.config.getDecoderConfig().QR.minimumLength | ||
case BarkoderConstants.DecoderType.QRMicro: | ||
return this.bkdView.config.getDecoderConfig().QRMicro.minimumLength | ||
case BarkoderConstants.DecoderType.Code128: | ||
return this.bkdView.config.getDecoderConfig().Code128.minimumLength | ||
case BarkoderConstants.DecoderType.Code93: | ||
return this.bkdView.config.getDecoderConfig().Code93.minimumLength | ||
case BarkoderConstants.DecoderType.Code39: | ||
return this.bkdView.config.getDecoderConfig().Code39.minimumLength | ||
case BarkoderConstants.DecoderType.Telepen: | ||
return this.bkdView.config.getDecoderConfig().Telepen.minimumLength | ||
case BarkoderConstants.DecoderType.Code11: | ||
return this.bkdView.config.getDecoderConfig().Code11.minimumLength | ||
case BarkoderConstants.DecoderType.Msi: | ||
return this.bkdView.config.getDecoderConfig().Msi.minimumLength | ||
case BarkoderConstants.DecoderType.UpcA: | ||
return this.bkdView.config.getDecoderConfig().UpcA.minimumLength | ||
case BarkoderConstants.DecoderType.UpcE: | ||
return this.bkdView.config.getDecoderConfig().UpcE.minimumLength | ||
case BarkoderConstants.DecoderType.UpcE1: | ||
return this.bkdView.config.getDecoderConfig().UpcE1.minimumLength | ||
case BarkoderConstants.DecoderType.Ean13: | ||
return this.bkdView.config.getDecoderConfig().Ean13.minimumLength | ||
case BarkoderConstants.DecoderType.Ean8: | ||
return this.bkdView.config.getDecoderConfig().Ean8.minimumLength | ||
case BarkoderConstants.DecoderType.PDF417: | ||
return this.bkdView.config.getDecoderConfig().PDF417.minimumLength | ||
case BarkoderConstants.DecoderType.PDF417Micro: | ||
return this.bkdView.config.getDecoderConfig().PDF417Micro.minimumLength | ||
case BarkoderConstants.DecoderType.Datamatrix: | ||
return this.bkdView.config.getDecoderConfig().Datamatrix.minimumLength | ||
case BarkoderConstants.DecoderType.Code25: | ||
return this.bkdView.config.getDecoderConfig().Code25.minimumLength | ||
case BarkoderConstants.DecoderType.Interleaved25: | ||
return this.bkdView.config.getDecoderConfig().Interleaved25.minimumLength | ||
case BarkoderConstants.DecoderType.ITF14: | ||
return this.bkdView.config.getDecoderConfig().ITF14.minimumLength | ||
case BarkoderConstants.DecoderType.IATA25: | ||
return this.bkdView.config.getDecoderConfig().IATA25.minimumLength | ||
case BarkoderConstants.DecoderType.Matrix25: | ||
return this.bkdView.config.getDecoderConfig().Matrix25.minimumLength | ||
case BarkoderConstants.DecoderType.Datalogic25: | ||
return this.bkdView.config.getDecoderConfig().Datalogic25.minimumLength | ||
case BarkoderConstants.DecoderType.COOP25: | ||
return this.bkdView.config.getDecoderConfig().COOP25.minimumLength | ||
case BarkoderConstants.DecoderType.Dotcode: | ||
return this.bkdView.config.getDecoderConfig().Dotcode.minimumLength | ||
} | ||
getBarcodeTypeMinimumLenght(decoder: BarkoderConstants.DecoderType): any { | ||
switch (decoder) { | ||
case BarkoderConstants.DecoderType.Aztec: | ||
return this.bkdView.config.getDecoderConfig().Aztec.minimumLength; | ||
case BarkoderConstants.DecoderType.AztecCompact: | ||
return this.bkdView.config.getDecoderConfig().AztecCompact | ||
.minimumLength; | ||
case BarkoderConstants.DecoderType.QR: | ||
return this.bkdView.config.getDecoderConfig().QR.minimumLength; | ||
case BarkoderConstants.DecoderType.QRMicro: | ||
return this.bkdView.config.getDecoderConfig().QRMicro.minimumLength; | ||
case BarkoderConstants.DecoderType.Code128: | ||
return this.bkdView.config.getDecoderConfig().Code128.minimumLength; | ||
case BarkoderConstants.DecoderType.Code93: | ||
return this.bkdView.config.getDecoderConfig().Code93.minimumLength; | ||
case BarkoderConstants.DecoderType.Code39: | ||
return this.bkdView.config.getDecoderConfig().Code39.minimumLength; | ||
case BarkoderConstants.DecoderType.Telepen: | ||
return this.bkdView.config.getDecoderConfig().Telepen.minimumLength; | ||
case BarkoderConstants.DecoderType.Code11: | ||
return this.bkdView.config.getDecoderConfig().Code11.minimumLength; | ||
case BarkoderConstants.DecoderType.Msi: | ||
return this.bkdView.config.getDecoderConfig().Msi.minimumLength; | ||
case BarkoderConstants.DecoderType.UpcA: | ||
return this.bkdView.config.getDecoderConfig().UpcA.minimumLength; | ||
case BarkoderConstants.DecoderType.UpcE: | ||
return this.bkdView.config.getDecoderConfig().UpcE.minimumLength; | ||
case BarkoderConstants.DecoderType.UpcE1: | ||
return this.bkdView.config.getDecoderConfig().UpcE1.minimumLength; | ||
case BarkoderConstants.DecoderType.Ean13: | ||
return this.bkdView.config.getDecoderConfig().Ean13.minimumLength; | ||
case BarkoderConstants.DecoderType.Ean8: | ||
return this.bkdView.config.getDecoderConfig().Ean8.minimumLength; | ||
case BarkoderConstants.DecoderType.PDF417: | ||
return this.bkdView.config.getDecoderConfig().PDF417.minimumLength; | ||
case BarkoderConstants.DecoderType.PDF417Micro: | ||
return this.bkdView.config.getDecoderConfig().PDF417Micro.minimumLength; | ||
case BarkoderConstants.DecoderType.Datamatrix: | ||
return this.bkdView.config.getDecoderConfig().Datamatrix.minimumLength; | ||
case BarkoderConstants.DecoderType.Code25: | ||
return this.bkdView.config.getDecoderConfig().Code25.minimumLength; | ||
case BarkoderConstants.DecoderType.Interleaved25: | ||
return this.bkdView.config.getDecoderConfig().Interleaved25 | ||
.minimumLength; | ||
case BarkoderConstants.DecoderType.ITF14: | ||
return this.bkdView.config.getDecoderConfig().ITF14.minimumLength; | ||
case BarkoderConstants.DecoderType.IATA25: | ||
return this.bkdView.config.getDecoderConfig().IATA25.minimumLength; | ||
case BarkoderConstants.DecoderType.Matrix25: | ||
return this.bkdView.config.getDecoderConfig().Matrix25.minimumLength; | ||
case BarkoderConstants.DecoderType.Datalogic25: | ||
return this.bkdView.config.getDecoderConfig().Datalogic25.minimumLength; | ||
case BarkoderConstants.DecoderType.COOP25: | ||
return this.bkdView.config.getDecoderConfig().COOP25.minimumLength; | ||
case BarkoderConstants.DecoderType.Dotcode: | ||
return this.bkdView.config.getDecoderConfig().Dotcode.minimumLength; | ||
} | ||
} | ||
setMaximumResultsCount(maximumResultsCount : number): void { | ||
this.bkdView.config.getDecoderConfig().maximumResultsCount = maximumResultsCount | ||
} | ||
/** | ||
* Sets the maximum number of results to be returned from barcode scanning | ||
*/ | ||
setMaximumResultsCount(maximumResultsCount: number): void { | ||
this.bkdView.config.getDecoderConfig().maximumResultsCount = maximumResultsCount; | ||
} | ||
setDuplicatesDelayMs(duplicateDelayMs : number) : void { | ||
this.bkdView.config.getDecoderConfig().duplicatesDelayMs = duplicateDelayMs | ||
} | ||
/** | ||
* Sets the delay in milliseconds for considering duplicate barcodes during scanning | ||
*/ | ||
setDuplicatesDelayMs(duplicateDelayMs: number): void { | ||
this.bkdView.config.getDecoderConfig().duplicatesDelayMs = duplicateDelayMs; | ||
} | ||
setMulticodeCachingDuration(multicodeCachingDuration : number) : void { | ||
this.bkdConfig.SetMulticodeCachingDuration(multicodeCachingDuration) | ||
} | ||
/** | ||
* Sets the caching duration (in milliseconds) for multi-code results | ||
*/ | ||
setMulticodeCachingDuration(multicodeCachingDuration: number): void { | ||
this.bkdConfig.SetMulticodeCachingDuration(multicodeCachingDuration); | ||
} | ||
setMulticodeCachingEnabled(multiCodeCachingEnabled : boolean) : void { | ||
this.bkdConfig.SetMulticodeCachingEnabled(multiCodeCachingEnabled) | ||
} | ||
/** | ||
* Sets whether multi-code caching is enabled | ||
*/ | ||
setMulticodeCachingEnabled(multiCodeCachingEnabled: boolean): void { | ||
this.bkdConfig.SetMulticodeCachingEnabled(multiCodeCachingEnabled); | ||
} | ||
getMaximumResultsCount() : any { | ||
return this.bkdView.config.getDecoderConfig().maximumResultsCount | ||
} | ||
getDuplicatesDelayMs() : any { | ||
return this.bkdView.config.getDecoderConfig().duplicatesDelayMs | ||
} | ||
/** | ||
* Retrieves the maximum number of results to be returned from barcode scanning at once | ||
*/ | ||
getMaximumResultsCount(): any { | ||
return this.bkdView.config.getDecoderConfig().maximumResultsCount; | ||
} | ||
setDatamatrixDpmModeEnabled(dpmModeEnabled : boolean) : void { | ||
this.bkdView.config.getDecoderConfig().Datamatrix.dpmMode = dpmModeEnabled | ||
} | ||
/** | ||
* Retrieves the delay in milliseconds for considering duplicate barcodes during scanning | ||
*/ | ||
getDuplicatesDelayMs(): any { | ||
return this.bkdView.config.getDecoderConfig().duplicatesDelayMs; | ||
} | ||
setUpcEanDeblurEnabled(enabled : boolean) : void { | ||
this.bkdView.config.getDecoderConfig().upcEanDeblur = enabled | ||
} | ||
/** | ||
* Sets whether the Direct Part Marking (DPM) mode for Datamatrix barcodes is enabled. | ||
*/ | ||
setDatamatrixDpmModeEnabled(dpmModeEnabled: boolean): void { | ||
this.bkdView.config.getDecoderConfig().Datamatrix.dpmMode = dpmModeEnabled; | ||
} | ||
setEnableMisshaped1DEnabled(enabled : boolean) : void { | ||
this.bkdView.config.getDecoderConfig().enableMisshaped1D = enabled | ||
} | ||
/** | ||
* Sets whether the deblurring feature for UPC/EAN barcodes is enabled | ||
*/ | ||
setUpcEanDeblurEnabled(enabled: boolean): void { | ||
this.bkdView.config.getDecoderConfig().upcEanDeblur = enabled; | ||
} | ||
setBarcodeThumbnailOnResultEnabled(enabled : boolean) : void{ | ||
this.bkdView.config.setThumbnailOnResultEnabled(enabled) | ||
} | ||
isBarcodeThumbnailOnResultEnabled() : any{ | ||
return this.bkdView.config.getThumbnailOnResulEnabled() | ||
} | ||
/** | ||
* Sets whether the detection of misshaped 1D barcodes is enabled | ||
*/ | ||
setEnableMisshaped1DEnabled(enabled: boolean): void { | ||
this.bkdView.config.getDecoderConfig().enableMisshaped1D = enabled; | ||
} | ||
setThresholdBetweenDuplicatesScans(thresholdBetweenDuplicatesScans : number) : void { | ||
this.bkdView.config.setThresholdBetweenDuplicatesScans(thresholdBetweenDuplicatesScans) | ||
} | ||
/** | ||
* Sets whether to enable barcode thumbnail on result | ||
*/ | ||
setBarcodeThumbnailOnResultEnabled(enabled: boolean): void { | ||
this.bkdView.config.setThumbnailOnResultEnabled(enabled); | ||
} | ||
getThresholdBetweenDuplicatesScans() : Promise <any> { | ||
return this.bkdView.config.getThresholdBetweenDuplicatesScans() | ||
} | ||
/** | ||
* Retrieve whether to enable barcode thumbnail on result | ||
*/ | ||
isBarcodeThumbnailOnResultEnabled(): any { | ||
return this.bkdView.config.getThumbnailOnResulEnabled(); | ||
} | ||
getMulticodeCachingEnabled() : any { | ||
return this.bkdConfig.IsMulticodeCachingEnabled() | ||
} | ||
getMulticodeCachingDuration() : any { | ||
return this.bkdConfig.GetMulticodeCachingDuration() | ||
} | ||
isUpcEanDeblurEnabled() : any { | ||
return this.bkdView.config.getDecoderConfig().upcEanDeblur | ||
} | ||
isMisshaped1DEnabled() : any { | ||
return this.bkdView.config.getDecoderConfig().enableMisshaped1D | ||
} | ||
/** | ||
* Sets the threshold between duplicate scans | ||
*/ | ||
setThresholdBetweenDuplicatesScans( | ||
thresholdBetweenDuplicatesScans: number | ||
): void { | ||
this.bkdView.config.setThresholdBetweenDuplicatesScans( | ||
thresholdBetweenDuplicatesScans | ||
); | ||
} | ||
isVINRestrictionsEnabled() : any { | ||
return this.bkdView.config.getDecoderConfig().enableVINRestrictions | ||
} | ||
/** | ||
* Retrieves the threshold between duplicate scans | ||
*/ | ||
getThresholdBetweenDuplicatesScans(): Promise<any> { | ||
return this.bkdView.config.getThresholdBetweenDuplicatesScans(); | ||
} | ||
setEnableVINRestrictions(vinRestrictionsEnabled: boolean) : void { | ||
this.bkdView.config.getDecoderConfig().enableVINRestrictions = vinRestrictionsEnabled | ||
} | ||
/** | ||
* Retrieves whether multi-code caching is enabled | ||
*/ | ||
getMulticodeCachingEnabled(): any { | ||
return this.bkdConfig.IsMulticodeCachingEnabled(); | ||
} | ||
setLicenseKey(licenseKey: string): void { | ||
this.bkdView.config = new com.barkoder.BarkoderConfig(context, licenseKey, null); | ||
} | ||
configureBarkoder(config: BarkoderConstants.BarkoderConfig): void { | ||
const BarkoderHelper = com.barkoder.BarkoderHelper; | ||
const JSONObject = org.json.JSONObject; | ||
/** | ||
* Retrieves the caching duration (in milliseconds) for multi-code results | ||
*/ | ||
getMulticodeCachingDuration(): any { | ||
return this.bkdConfig.GetMulticodeCachingDuration(); | ||
} | ||
try { | ||
const jsonString = config.toJsonString(); | ||
/** | ||
* Retrieves the value indicating whether deblurring is enabled for UPC/EAN barcodes | ||
*/ | ||
isUpcEanDeblurEnabled(): any { | ||
return this.bkdView.config.getDecoderConfig().upcEanDeblur; | ||
} | ||
const javaJSONObject = new JSONObject(jsonString); | ||
/** | ||
* Checks if the detection of misshaped 1D barcodes is enabled | ||
*/ | ||
isMisshaped1DEnabled(): any { | ||
return this.bkdView.config.getDecoderConfig().enableMisshaped1D; | ||
} | ||
BarkoderHelper.applyJsonToConfig(this.bkdView.config, javaJSONObject); | ||
} catch (e) { | ||
console.error("Error applying JSON to BarkoderConfig:", e); | ||
} | ||
} | ||
/** | ||
* Checks if VIN restrictions are enabled | ||
*/ | ||
isVINRestrictionsEnabled(): any { | ||
return this.bkdView.config.getDecoderConfig().enableVINRestrictions; | ||
} | ||
private hexToAndroidColor(hexColor: string): number { | ||
hexColor = hexColor.replace("#", ""); | ||
const red = parseInt(hexColor.substring(0, 2), 16); | ||
const green = parseInt(hexColor.substring(2, 4), 16); | ||
const blue = parseInt(hexColor.substring(4, 6), 16); | ||
const androidColor = android.graphics.Color.rgb(red, green, blue); | ||
return androidColor; | ||
/** | ||
* Sets whether Vehicle Identification Number (VIN) restrictions are enabled | ||
*/ | ||
setEnableVINRestrictions(vinRestrictionsEnabled: boolean): void { | ||
this.bkdView.config.getDecoderConfig().enableVINRestrictions = vinRestrictionsEnabled; | ||
} | ||
setLicenseKey(licenseKey: string): void { | ||
this.bkdView.config = new com.barkoder.BarkoderConfig( | ||
context, | ||
licenseKey, | ||
null | ||
); | ||
} | ||
/** | ||
* Configures the Barkoder functionality based on the provided configuration | ||
*/ | ||
configureBarkoder(config: BarkoderConstants.BarkoderConfig): void { | ||
const BarkoderHelper = com.barkoder.BarkoderHelper; | ||
const JSONObject = org.json.JSONObject; | ||
try { | ||
const jsonString = config.toJsonString(); | ||
const javaJSONObject = new JSONObject(jsonString); | ||
BarkoderHelper.applyJsonToConfig(this.bkdView.config, javaJSONObject); | ||
} catch (e) { | ||
console.error("Error applying JSON to BarkoderConfig:", e); | ||
} | ||
} | ||
getPropertiesAndMethods(obj: any): void { | ||
const propertiesAndMethods: string[] = []; | ||
for (let key in obj) { | ||
console.log(`Key: ${key}, Value: ${obj[key]}`); | ||
} | ||
private hexToAndroidColor(hexColor: string): number { | ||
hexColor = hexColor.replace("#", ""); | ||
const red = parseInt(hexColor.substring(0, 2), 16); | ||
const green = parseInt(hexColor.substring(2, 4), 16); | ||
const blue = parseInt(hexColor.substring(4, 6), 16); | ||
const androidColor = android.graphics.Color.rgb(red, green, blue); | ||
return androidColor; | ||
} | ||
getPropertiesAndMethods(obj: any): void { | ||
const propertiesAndMethods: string[] = []; | ||
for (let key in obj) { | ||
console.log(`Key: ${key}, Value: ${obj[key]}`); | ||
} | ||
} | ||
} | ||
@@ -1,828 +0,1150 @@ | ||
import { BarkoderConstants } from './barkoder-nativescript.common'; | ||
import { View} from '@nativescript/core'; | ||
import { ios } from '@nativescript/core/application'; | ||
import { BarkoderConstants } from "./barkoder-nativescript.common"; | ||
import { View } from "@nativescript/core"; | ||
import { ios } from "@nativescript/core/application"; | ||
export class BarkoderViewIOS extends View { | ||
public bkdView: BarkoderView; | ||
public licenseKeyProperty: any; | ||
private _licenseKey: string; | ||
export class BarkoderViewIOS extends View{ | ||
public bkdView : BarkoderView; | ||
public licenseKeyProperty: any; | ||
private _licenseKey: string; | ||
constructor() { | ||
super(); | ||
this.bkdView = BarkoderView.new(); | ||
this.nativeView = this.bkdView; | ||
} | ||
constructor() { | ||
super(); | ||
this.bkdView = BarkoderView.new(); | ||
this.nativeView = this.bkdView; | ||
} | ||
/** | ||
* Initiates the barcode scanning process, allowing the application to detect and decode barcodes from the device's camera feed | ||
*/ | ||
startScanning(callback: BarkoderConstants.BarkoderResultCallback): void { | ||
const resultDelegate = new BarkoderViewWraper(callback); | ||
ios.delegate = resultDelegate; | ||
this.bkdView.startScanningError(resultDelegate); | ||
} | ||
startScanning(callback: BarkoderConstants.BarkoderResultCallback): void { | ||
const resultDelegate = new BarkoderViewWraper(callback); | ||
ios.delegate = resultDelegate | ||
this.bkdView.startScanningError(resultDelegate); | ||
} | ||
/** | ||
* Halts the barcode scanning process, stopping the camera from capturing and processing barcode information | ||
*/ | ||
stopScanning(): void { | ||
this.bkdView.stopScanning(); | ||
} | ||
stopScanning(): void { | ||
this.bkdView.stopScanning(); | ||
} | ||
/** | ||
* Halts the barcode scanning process, stopping the camera from capturing and processing barcode information | ||
*/ | ||
pauseScanning(): void { | ||
this.bkdView.pauseScanning(); | ||
} | ||
pauseScanning() : void { | ||
this.bkdView.pauseScanning(); | ||
} | ||
/** | ||
* Checks whether the device has a built-in flash (torch) that can be used for illumination during barcode scanning | ||
*/ | ||
isFlashAvailable( | ||
callback: BarkoderConstants.FlashAvailableCallback | ||
): Promise<boolean> { | ||
return new Promise((resolve, reject) => { | ||
this.bkdView.isFlashAvailable((flashAvailable: boolean) => { | ||
resolve(flashAvailable); | ||
callback.onFlashAvailable(flashAvailable); | ||
}); | ||
}); | ||
} | ||
isFlashAvailable(callback : BarkoderConstants.FlashAvailableCallback): Promise<boolean> { | ||
return new Promise((resolve, reject) => { | ||
this.bkdView.isFlashAvailable((flashAvailable: boolean) => { | ||
resolve(flashAvailable); | ||
callback.onFlashAvailable(flashAvailable) | ||
}); | ||
}); | ||
} | ||
/** | ||
* Enables or disables the device's flash (torch) for illumination during barcode scanning | ||
*/ | ||
setFlashEnabled(enabled: boolean): void { | ||
this.bkdView.setFlash(enabled); | ||
} | ||
setFlashEnabled(enabled : boolean) : void { | ||
this.bkdView.setFlash(enabled) | ||
} | ||
/** | ||
* Retrieves the maximum available zoom factor for the device's camera | ||
*/ | ||
getMaxZoomFactor( | ||
callback: BarkoderConstants.MaxZoomAvailableCallback | ||
): Promise<number> { | ||
return new Promise((resolve, reject) => { | ||
this.bkdView.getMaxZoomFactor((maxZoomFactor: number) => { | ||
resolve(maxZoomFactor); | ||
callback.onMaxZoomAvailable(maxZoomFactor); | ||
}); | ||
}); | ||
} | ||
getMaxZoomFactor(callback : BarkoderConstants.MaxZoomAvailableCallback): Promise<number> { | ||
return new Promise((resolve, reject) => { | ||
this.bkdView.getMaxZoomFactor((maxZoomFactor: number) => { | ||
resolve(maxZoomFactor); | ||
callback.onMaxZoomAvailable(maxZoomFactor) | ||
}); | ||
}); | ||
} | ||
/** | ||
* Sets the zoom factor for the device's camera, adjusting the level of zoom during barcode scanning | ||
*/ | ||
setZoomFactor(zoomFactor: number): void { | ||
this.bkdView.setZoomFactor(zoomFactor); | ||
} | ||
setZoomFactor(zoomFactor : number) : void { | ||
this.bkdView.setZoomFactor(zoomFactor) | ||
} | ||
/** | ||
* Retrieves the hexadecimal color code representing the line color used to indicate the location of detected barcodes | ||
*/ | ||
getLocationLineColorHex(): any { | ||
return this.bkdView.config.locationLineColor; | ||
} | ||
getLocationLineColorHex() : any { | ||
return this.bkdView.config.locationLineColor | ||
} | ||
/** | ||
* Sets the color of the lines used to indicate the location of detected barcodes on the camera feed | ||
*/ | ||
setLocationLineColor(locationLineHexColor: string): void { | ||
const uiColor = this.hexToUIColor(locationLineHexColor); | ||
this.bkdView.config.locationLineColor = uiColor; | ||
} | ||
setLocationLineColor(locationLineHexColor : string) : void { | ||
const uiColor = this.hexToUIColor(locationLineHexColor); | ||
this.bkdView.config.locationLineColor = uiColor | ||
} | ||
/** | ||
* Sets the color of the lines outlining the Region of Interest (ROI) for barcode scanning on the camera feed | ||
*/ | ||
setRoiLineColor(roiLineHexColor: string): void { | ||
const uiColor = this.hexToUIColor(roiLineHexColor); | ||
this.bkdView.config.roiLineColor = uiColor; | ||
} | ||
setRoiLineColor(roiLineHexColor: string): void { | ||
const uiColor = this.hexToUIColor(roiLineHexColor); | ||
this.bkdView.config.roiLineColor = uiColor; | ||
} | ||
/** | ||
* Sets the width of the lines outlining the Region of Interest (ROI) for barcode scanning on the camera feed | ||
*/ | ||
setRoiLineWidth(roiLineWidth: number): void { | ||
this.bkdView.config.roiLineWidth = roiLineWidth; | ||
} | ||
setRoiLineWidth(roiLineWidth : number) : void { | ||
this.bkdView.config.roiLineWidth = roiLineWidth; | ||
} | ||
/** | ||
* Sets the background color of the overlay within the Region of Interest (ROI) for barcode scanning on the camera feed | ||
*/ | ||
setRoiOverlayBackgroundColor(roiLineHexColor: string): void { | ||
const uiColor = this.hexToUIColor(roiLineHexColor); | ||
this.bkdView.config.roiOverlayBackgroundColor = uiColor; | ||
} | ||
setRoiOverlayBackgroundColor(roiLineHexColor: string) : void { | ||
const uiColor = this.hexToUIColor(roiLineHexColor); | ||
this.bkdView.config.roiOverlayBackgroundColor = uiColor; | ||
} | ||
/** | ||
* Enables or disables the automatic closing of the scanning session upon detecting a barcode result | ||
*/ | ||
setCloseSessionOnResultEnabled(enabled: boolean): void { | ||
this.bkdView.config.closeSessionOnResultEnabled = enabled; | ||
} | ||
setCloseSessionOnResultEnabled(enabled : boolean) : void { | ||
this.bkdView.config.closeSessionOnResultEnabled = enabled | ||
} | ||
/** | ||
* Enables or disables the capturing and processing of image data when a barcode is successfully detected | ||
*/ | ||
setImageResultEnabled(enabled: boolean): void { | ||
this.bkdView.config.imageResultEnabled = enabled; | ||
} | ||
setImageResultEnabled(enabled : boolean) : void { | ||
this.bkdView.config.imageResultEnabled = enabled | ||
} | ||
/** | ||
* Enables or disables the inclusion of barcode location information within the image data result | ||
*/ | ||
setLocationInImageResultEnabled(enabled: boolean): void { | ||
this.bkdView.config.locationInImageResultEnabled = enabled; | ||
} | ||
setLocationInImageResultEnabled(enabled : boolean) : void { | ||
this.bkdView.config.locationInImageResultEnabled = enabled | ||
} | ||
/** | ||
* Enables or disables the display of barcode location information on the camera preview | ||
*/ | ||
setLocationInPreviewEnabled(enabled: boolean): void { | ||
this.bkdView.config.locationInPreviewEnabled = enabled; | ||
} | ||
setLocationInPreviewEnabled(enabled : boolean) : void { | ||
this.bkdView.config.locationInPreviewEnabled = enabled | ||
} | ||
setPinchToZoomEnabled(enabled : boolean) : void { | ||
this.bkdView.config.pinchToZoomEnabled = enabled | ||
} | ||
/** | ||
* Enables or disables the pinch-to-zoom feature for adjusting the zoom level during barcode scanning | ||
*/ | ||
setPinchToZoomEnabled(enabled: boolean): void { | ||
this.bkdView.config.pinchToZoomEnabled = enabled; | ||
} | ||
setRegionOfInterestVisible(enabled : boolean) : void { | ||
this.bkdView.config.regionOfInterestVisible = enabled | ||
} | ||
/** | ||
* Sets the visibility of the Region of Interest (ROI) on the camera preview | ||
*/ | ||
setRegionOfInterestVisible(enabled: boolean): void { | ||
this.bkdView.config.regionOfInterestVisible = enabled; | ||
} | ||
setRegionOfInterest( | ||
left : number, top : number, width : number, height : number | ||
) : void { | ||
/** | ||
* Defines the Region of Interest (ROI) on the camera preview for barcode scanning, specifying an area where the application focuses on detecting barcodes | ||
*/ | ||
setRegionOfInterest( | ||
left: number, | ||
top: number, | ||
width: number, | ||
height: number | ||
): void { | ||
const rect = { | ||
origin: { x: left, y: top }, | ||
size: { width: width, height: height }, | ||
}; | ||
const rect = { | ||
origin: { x: left, y: top }, | ||
size: { width: width, height: height } | ||
}; | ||
this.bkdView.config.setRegionOfInterestError(rect); | ||
} | ||
this.bkdView.config.setRegionOfInterestError( | ||
rect | ||
); | ||
} | ||
/** | ||
* Enables or disables the audible beep sound upon successfully decoding a barcode | ||
*/ | ||
setBeepOnSuccessEnabled(enabled: boolean): void { | ||
this.bkdView.config.beepOnSuccessEnabled = enabled; | ||
} | ||
setBeepOnSuccessEnabled(enabled : boolean) : void { | ||
this.bkdView.config.beepOnSuccessEnabled = enabled | ||
} | ||
setVibrateOnSuccessEnabled(enabled : boolean) : void { | ||
this.bkdView.config.vibrateOnSuccessEnabled = enabled | ||
} | ||
/** | ||
* Enables or disables the device vibration upon successfully decoding a barcode. | ||
*/ | ||
setVibrateOnSuccessEnabled(enabled: boolean): void { | ||
this.bkdView.config.vibrateOnSuccessEnabled = enabled; | ||
} | ||
getEncodingCharacterSet() : any { | ||
return this.bkdView.config.decoderConfig.encodingCharacterSet | ||
} | ||
/** | ||
* Retrieves the character set used for encoding barcode data | ||
*/ | ||
getEncodingCharacterSet(): any { | ||
return this.bkdView.config.decoderConfig.encodingCharacterSet; | ||
} | ||
getDecodingSpeed() : any { | ||
return this.bkdView.config.decoderConfig.decodingSpeed | ||
} | ||
/** | ||
* Retrieves the current decoding speed setting for barcode scanning | ||
*/ | ||
getDecodingSpeed(): any { | ||
return this.bkdView.config.decoderConfig.decodingSpeed; | ||
} | ||
getFormattingType() : any { | ||
return this.bkdView.config.decoderConfig.formatting | ||
} | ||
/** | ||
* Retrieves the formatting type used for presenting decoded barcode data. | ||
*/ | ||
getFormattingType(): any { | ||
return this.bkdView.config.decoderConfig.formatting; | ||
} | ||
setLocationLineWidth(width : number) : void { | ||
this.bkdView.config.locationLineWidth = width | ||
} | ||
/** | ||
* Sets the width of the lines indicating the location of detected barcodes on the camera feed | ||
*/ | ||
setLocationLineWidth(width: number): void { | ||
this.bkdView.config.locationLineWidth = width; | ||
} | ||
getLocationLineWidth() : any { | ||
return this.bkdView.config.locationLineWidth | ||
} | ||
/** | ||
* Retrieves the current width setting for the lines indicating the location of detected barcodes on the camera feed | ||
*/ | ||
getLocationLineWidth(): any { | ||
return this.bkdView.config.locationLineWidth; | ||
} | ||
getRoiLineColorHex() : any { | ||
return this.bkdView.config.roiLineColor | ||
} | ||
/** | ||
* Retrieves the hexadecimal color code representing the line color of the Region of Interest (ROI) on the camera preview | ||
*/ | ||
getRoiLineColorHex(): any { | ||
return this.bkdView.config.roiLineColor; | ||
} | ||
getRoiLineWidth() : any { | ||
return this.bkdView.config.roiLineWidth | ||
} | ||
/** | ||
* Retrieves the current width setting for the lines outlining the Region of Interest (ROI) on the camera preview | ||
*/ | ||
getRoiLineWidth(): any { | ||
return this.bkdView.config.roiLineWidth; | ||
} | ||
getRoiOverlayBackgroundColorHex() : any { | ||
return this.bkdView.config.roiOverlayBackgroundColor | ||
} | ||
/** | ||
* Retrieves the hexadecimal color code representing the background color of the overlay within the Region of Interest (ROI) on the camera preview | ||
*/ | ||
getRoiOverlayBackgroundColorHex(): any { | ||
return this.bkdView.config.roiOverlayBackgroundColor; | ||
} | ||
isCloseSessionOnResultEnabled() : any { | ||
return this.bkdView.config.closeSessionOnResultEnabled | ||
} | ||
/** | ||
* Enables or disables the automatic closing of the scanning session upon detecting a barcode result | ||
*/ | ||
isCloseSessionOnResultEnabled(): any { | ||
return this.bkdView.config.closeSessionOnResultEnabled; | ||
} | ||
isImageResultEnabled() : any { | ||
return this.bkdView.config.imageResultEnabled | ||
} | ||
/** | ||
* Enables or disables the capturing and processing of image data when a barcode is successfully detected | ||
*/ | ||
isImageResultEnabled(): any { | ||
return this.bkdView.config.imageResultEnabled; | ||
} | ||
isLocationInImageResultEnabled() : any { | ||
return this.bkdView.config.locationInImageResultEnabled | ||
} | ||
/** | ||
* Enables or disables the inclusion of barcode location information within the image data result | ||
*/ | ||
isLocationInImageResultEnabled(): any { | ||
return this.bkdView.config.locationInImageResultEnabled; | ||
} | ||
getRegionOfInterest() : any { | ||
return this.bkdView.config.getRegionOfInterest | ||
} | ||
/** | ||
* Retrieves the region of interest (ROI) | ||
*/ | ||
getRegionOfInterest(): any { | ||
return this.bkdView.config.getRegionOfInterest; | ||
} | ||
getThreadsLimit() : any { | ||
return this.bkdView.config.getThreadsLimit() | ||
} | ||
/** | ||
* Retrieves the threads limit | ||
*/ | ||
getThreadsLimit(): any { | ||
return this.bkdView.config.getThreadsLimit(); | ||
} | ||
setThreadsLimit(threadsLimit : number) : void { | ||
this.bkdView.config.setThreadsLimitError(threadsLimit) | ||
} | ||
/** | ||
* Sets the threads limit | ||
*/ | ||
setThreadsLimit(threadsLimit: number): void { | ||
this.bkdView.config.setThreadsLimitError(threadsLimit); | ||
} | ||
isLocationInPreviewEnabled() : any { | ||
return this.bkdView.config.locationInPreviewEnabled | ||
} | ||
/** | ||
* Checks if location in preview is enabled | ||
*/ | ||
isLocationInPreviewEnabled(): any { | ||
return this.bkdView.config.locationInPreviewEnabled; | ||
} | ||
isPinchToZoomEnabled() : any { | ||
return this.bkdView.config.pinchToZoomEnabled | ||
} | ||
/** | ||
* Checks if pinch to zoom is enabled | ||
*/ | ||
isPinchToZoomEnabled(): any { | ||
return this.bkdView.config.pinchToZoomEnabled; | ||
} | ||
isRegionOfInterestVisible() : any { | ||
return this.bkdView.config.regionOfInterestVisible | ||
} | ||
/** | ||
* Checks if the region of interest (ROI) is visible | ||
*/ | ||
isRegionOfInterestVisible(): any { | ||
return this.bkdView.config.regionOfInterestVisible; | ||
} | ||
isBeepOnSuccessEnabled() : any { | ||
return this.bkdView.config.beepOnSuccessEnabled | ||
} | ||
/** | ||
* Retrieves the value indicating whether a beep sound is played on successful barcode scanning | ||
*/ | ||
isBeepOnSuccessEnabled(): any { | ||
return this.bkdView.config.beepOnSuccessEnabled; | ||
} | ||
isVibrateOnSuccessEnabled() : any { | ||
return this.bkdView.config.vibrateOnSuccessEnabled | ||
} | ||
/** | ||
* Retrieves the value indicating whether vibration is enabled on successful barcode scanning | ||
*/ | ||
isVibrateOnSuccessEnabled(): any { | ||
return this.bkdView.config.vibrateOnSuccessEnabled; | ||
} | ||
getVersion() : any { | ||
return iBarkoder.GetVersion() | ||
} | ||
/** | ||
* Retrieves the version of the Barkoder library | ||
*/ | ||
getVersion(): any { | ||
return iBarkoder.GetVersion(); | ||
} | ||
getMsiCheckSumType() : any { | ||
return this.bkdView.config.decoderConfig.msi.checksum | ||
} | ||
/** | ||
* Retrieves the MSI checksum type | ||
*/ | ||
getMsiCheckSumType(): any { | ||
return this.bkdView.config.decoderConfig.msi.checksum; | ||
} | ||
getCode39CheckSumType() : any { | ||
return this.bkdView.config.decoderConfig.code39.checksum | ||
} | ||
/** | ||
* Retrieves the checksum type for Code 39 barcodes | ||
*/ | ||
getCode39CheckSumType(): any { | ||
return this.bkdView.config.decoderConfig.code39.checksum; | ||
} | ||
getCode11CheckSumType() : any { | ||
return this.bkdView.config.decoderConfig.code11.checksum | ||
/** | ||
* Retrieves the Code11 checksum type | ||
*/ | ||
getCode11CheckSumType(): any { | ||
return this.bkdView.config.decoderConfig.code11.checksum; | ||
} | ||
/** | ||
* Sets the resolution for barcode scanning | ||
*/ | ||
setBarkoderResolution( | ||
barkoderResolution: BarkoderConstants.BarkoderResolution | ||
): void { | ||
if (barkoderResolution === BarkoderConstants.BarkoderResolution.NORMAL) { | ||
this.bkdView.config.barkoderResolution = 0; | ||
} else if ( | ||
barkoderResolution === BarkoderConstants.BarkoderResolution.HIGH | ||
) { | ||
this.bkdView.config.barkoderResolution = 1; | ||
} | ||
} | ||
setBarkoderResolution(barkoderResolution: BarkoderConstants.BarkoderResolution): void { | ||
if (barkoderResolution === BarkoderConstants.BarkoderResolution.NORMAL) { | ||
this.bkdView.config.barkoderResolution = 0; | ||
} else if (barkoderResolution === BarkoderConstants.BarkoderResolution.HIGH) { | ||
this.bkdView.config.barkoderResolution = 1; | ||
} | ||
} | ||
/** | ||
* Retrieves the resolution for barcode scanning | ||
*/ | ||
getBarkoderResolution(): any { | ||
return this.bkdView.config.barkoderResolution; | ||
} | ||
getBarkoderResolution() : any { | ||
return this.bkdView.config.barkoderResolution | ||
} | ||
/** | ||
* Sets the encoding character set for barcode scanning | ||
*/ | ||
setEncodingCharacterSet(encodingCharacterSet: any): void { | ||
this.bkdView.config.encodingCharacterSet = encodingCharacterSet; | ||
} | ||
setEncodingCharacterSet(encodingCharacterSet : any) : void { | ||
this.bkdView.config.encodingCharacterSet = encodingCharacterSet | ||
/** | ||
* Sets the decoding speed for barcode scanning | ||
*/ | ||
setDecodingSpeed(decodingSpeed: BarkoderConstants.DecodingSpeed): void { | ||
if (decodingSpeed == BarkoderConstants.DecodingSpeed.Fast) { | ||
this.bkdView.config.decoderConfig.decodingSpeed = 0; | ||
} else if (decodingSpeed == BarkoderConstants.DecodingSpeed.Normal) { | ||
this.bkdView.config.decoderConfig.decodingSpeed = 1; | ||
} else if (decodingSpeed == BarkoderConstants.DecodingSpeed.Slow) { | ||
this.bkdView.config.decoderConfig.decodingSpeed = 2; | ||
} | ||
} | ||
setDecodingSpeed(decodingSpeed : BarkoderConstants.DecodingSpeed) : void { | ||
if(decodingSpeed == BarkoderConstants.DecodingSpeed.Fast) { | ||
this.bkdView.config.decoderConfig.decodingSpeed = 0 | ||
} else if (decodingSpeed == BarkoderConstants.DecodingSpeed.Normal) { | ||
this.bkdView.config.decoderConfig.decodingSpeed = 1 | ||
} else if (decodingSpeed == BarkoderConstants.DecodingSpeed.Slow) { | ||
this.bkdView.config.decoderConfig.decodingSpeed = 2 | ||
} | ||
/** | ||
* Sets the formatting type for barcode scanning | ||
*/ | ||
setFormattingType(formattingType: BarkoderConstants.FormattingType): void { | ||
switch (formattingType) { | ||
case BarkoderConstants.FormattingType.Disabled: | ||
this.bkdView.config.decoderConfig.formatting = 0; | ||
break; | ||
case BarkoderConstants.FormattingType.Automatic: | ||
this.bkdView.config.decoderConfig.formatting = 1; | ||
break; | ||
case BarkoderConstants.FormattingType.GS1: | ||
this.bkdView.config.decoderConfig.formatting = 2; | ||
break; | ||
case BarkoderConstants.FormattingType.AAMVA: | ||
this.bkdView.config.decoderConfig.formatting = 3; | ||
break; | ||
} | ||
} | ||
setFormattingType(formattingType : BarkoderConstants.FormattingType) : void { | ||
switch (formattingType) { | ||
case BarkoderConstants.FormattingType.Disabled: | ||
this.bkdView.config.decoderConfig.formatting = 0 | ||
break; | ||
case BarkoderConstants.FormattingType.Automatic: | ||
this.bkdView.config.decoderConfig.formatting = 1 | ||
break; | ||
case BarkoderConstants.FormattingType.GS1: | ||
this.bkdView.config.decoderConfig.formatting = 2 | ||
break; | ||
case BarkoderConstants.FormattingType.AAMVA: | ||
this.bkdView.config.decoderConfig.formatting = 3 | ||
break; | ||
} | ||
/** | ||
* Sets the MSI checksum type | ||
*/ | ||
setMsiCheckSumType(msiCheckSumType: BarkoderConstants.MsiChecksumType) { | ||
switch (msiCheckSumType) { | ||
case BarkoderConstants.MsiChecksumType.Disabled: | ||
this.bkdView.config.decoderConfig.msi.checksum = 0; | ||
break; | ||
case BarkoderConstants.MsiChecksumType.Mod10: | ||
this.bkdView.config.decoderConfig.msi.checksum = 1; | ||
break; | ||
case BarkoderConstants.MsiChecksumType.Mod11: | ||
this.bkdView.config.decoderConfig.msi.checksum = 2; | ||
break; | ||
case BarkoderConstants.MsiChecksumType.Mod1010: | ||
this.bkdView.config.decoderConfig.msi.checksum = 3; | ||
break; | ||
case BarkoderConstants.MsiChecksumType.Mod1110: | ||
this.bkdView.config.decoderConfig.msi.checksum = 4; | ||
break; | ||
case BarkoderConstants.MsiChecksumType.Mod11IBM: | ||
this.bkdView.config.decoderConfig.msi.checksum = 5; | ||
break; | ||
case BarkoderConstants.MsiChecksumType.Mod1110IBM: | ||
this.bkdView.config.decoderConfig.msi.checksum = 6; | ||
break; | ||
} | ||
} | ||
setMsiCheckSumType(msiCheckSumType : BarkoderConstants.MsiChecksumType) { | ||
switch (msiCheckSumType) { | ||
case BarkoderConstants.MsiChecksumType.Disabled: | ||
this.bkdView.config.decoderConfig.msi.checksum = 0 | ||
break; | ||
case BarkoderConstants.MsiChecksumType.Mod10: | ||
this.bkdView.config.decoderConfig.msi.checksum = 1 | ||
break; | ||
case BarkoderConstants.MsiChecksumType.Mod11: | ||
this.bkdView.config.decoderConfig.msi.checksum = 2 | ||
break; | ||
case BarkoderConstants.MsiChecksumType.Mod1010: | ||
this.bkdView.config.decoderConfig.msi.checksum = 3 | ||
break; | ||
case BarkoderConstants.MsiChecksumType.Mod1110: | ||
this.bkdView.config.decoderConfig.msi.checksum = 4 | ||
break; | ||
case BarkoderConstants.MsiChecksumType.Mod11IBM: | ||
this.bkdView.config.decoderConfig.msi.checksum = 5 | ||
break; | ||
case BarkoderConstants.MsiChecksumType.Mod1110IBM: | ||
this.bkdView.config.decoderConfig.msi.checksum = 6 | ||
break; | ||
} | ||
/** | ||
* Sets the Code39 checksum type | ||
*/ | ||
setCode39CheckSumType( | ||
standardCheckSumType: BarkoderConstants.Code39ChecksumType | ||
) { | ||
switch (standardCheckSumType) { | ||
case BarkoderConstants.Code39ChecksumType.Disabled: | ||
this.bkdView.config.decoderConfig.code39.checksum = 0; | ||
break; | ||
case BarkoderConstants.Code39ChecksumType.Enabled: | ||
this.bkdView.config.decoderConfig.code39.checksum = 1; | ||
break; | ||
} | ||
} | ||
setCode39CheckSumType(standardCheckSumType : BarkoderConstants.Code39ChecksumType) { | ||
switch(standardCheckSumType) { | ||
case BarkoderConstants.Code39ChecksumType.Disabled: | ||
this.bkdView.config.decoderConfig.code39.checksum = 0 | ||
break; | ||
case BarkoderConstants.Code39ChecksumType.Enabled: | ||
this.bkdView.config.decoderConfig.code39.checksum = 1 | ||
break; | ||
} | ||
/** | ||
* Sets the Code11 checksum type | ||
*/ | ||
setCode11CheckSumType( | ||
code11CheckSumType: BarkoderConstants.Code11ChecksumType | ||
) { | ||
switch (code11CheckSumType) { | ||
case BarkoderConstants.Code11ChecksumType.Disabled: | ||
this.bkdView.config.decoderConfig.code11.checksum = 0; | ||
break; | ||
case BarkoderConstants.Code11ChecksumType.Single: | ||
this.bkdView.config.decoderConfig.code11.checksum = 1; | ||
break; | ||
case BarkoderConstants.Code11ChecksumType.Double: | ||
this.bkdView.config.decoderConfig.code11.checksum = 2; | ||
break; | ||
} | ||
} | ||
setCode11CheckSumType(code11CheckSumType : BarkoderConstants.Code11ChecksumType) { | ||
switch(code11CheckSumType) { | ||
case BarkoderConstants.Code11ChecksumType.Disabled: | ||
this.bkdView.config.decoderConfig.code11.checksum = 0 | ||
break; | ||
case BarkoderConstants.Code11ChecksumType.Single: | ||
this.bkdView.config.decoderConfig.code11.checksum = 1 | ||
break; | ||
case BarkoderConstants.Code11ChecksumType.Double: | ||
this.bkdView.config.decoderConfig.code11.checksum = 2 | ||
break; | ||
} | ||
/** | ||
* Checks if a specific barcode type is enabled | ||
*/ | ||
isBarcodeTypeEnabled(decoder: BarkoderConstants.DecoderType): any { | ||
switch (decoder) { | ||
case BarkoderConstants.DecoderType.Aztec: | ||
return this.bkdView.config.decoderConfig.aztec.enabled; | ||
case BarkoderConstants.DecoderType.AztecCompact: | ||
return this.bkdView.config.decoderConfig.aztecCompact.enabled; | ||
case BarkoderConstants.DecoderType.QR: | ||
return this.bkdView.config.decoderConfig.qr.enabled; | ||
case BarkoderConstants.DecoderType.QRMicro: | ||
return this.bkdView.config.decoderConfig.qrMicro.enabled; | ||
case BarkoderConstants.DecoderType.Code128: | ||
return this.bkdView.config.decoderConfig.code128.enabled; | ||
case BarkoderConstants.DecoderType.Code93: | ||
return this.bkdView.config.decoderConfig.code93.enabled; | ||
case BarkoderConstants.DecoderType.Code39: | ||
return this.bkdView.config.decoderConfig.code39.enabled; | ||
case BarkoderConstants.DecoderType.Telepen: | ||
return this.bkdView.config.decoderConfig.telepen.enabled; | ||
case BarkoderConstants.DecoderType.Code11: | ||
return this.bkdView.config.decoderConfig.code11.enabled; | ||
case BarkoderConstants.DecoderType.Msi: | ||
return this.bkdView.config.decoderConfig.msi.enabled; | ||
case BarkoderConstants.DecoderType.UpcA: | ||
return this.bkdView.config.decoderConfig.upcA.enabled; | ||
case BarkoderConstants.DecoderType.UpcE: | ||
return this.bkdView.config.decoderConfig.upcE.enabled; | ||
case BarkoderConstants.DecoderType.UpcE1: | ||
return this.bkdView.config.decoderConfig.upcE1.enabled; | ||
case BarkoderConstants.DecoderType.Ean13: | ||
return this.bkdView.config.decoderConfig.ean13.enabled; | ||
case BarkoderConstants.DecoderType.Ean8: | ||
return this.bkdView.config.decoderConfig.ean8.enabled; | ||
case BarkoderConstants.DecoderType.PDF417: | ||
return this.bkdView.config.decoderConfig.PDF417.enabled; | ||
case BarkoderConstants.DecoderType.PDF417Micro: | ||
return this.bkdView.config.decoderConfig.PDF417Micro.enabled; | ||
case BarkoderConstants.DecoderType.Datamatrix: | ||
return this.bkdView.config.decoderConfig.datamatrix.enabled; | ||
case BarkoderConstants.DecoderType.Code25: | ||
return this.bkdView.config.decoderConfig.code25.enabled; | ||
case BarkoderConstants.DecoderType.Interleaved25: | ||
return this.bkdView.config.decoderConfig.interleaved25.enabled; | ||
case BarkoderConstants.DecoderType.ITF14: | ||
return this.bkdView.config.decoderConfig.itf14.enabled; | ||
case BarkoderConstants.DecoderType.IATA25: | ||
return this.bkdView.config.decoderConfig.iata25.enabled; | ||
case BarkoderConstants.DecoderType.Matrix25: | ||
return this.bkdView.config.decoderConfig.matrix25.enabled; | ||
case BarkoderConstants.DecoderType.Datalogic25: | ||
return this.bkdView.config.decoderConfig.datalogic25.enabled; | ||
case BarkoderConstants.DecoderType.COOP25: | ||
return this.bkdView.config.decoderConfig.coop25.enabled; | ||
case BarkoderConstants.DecoderType.Dotcode: | ||
return this.bkdView.config.decoderConfig.dotcode.enabled; | ||
} | ||
} | ||
isBarcodeTypeEnabled(decoder: BarkoderConstants.DecoderType) : any { | ||
switch (decoder) { | ||
case BarkoderConstants.DecoderType.Aztec: | ||
return this.bkdView.config.decoderConfig.aztec.enabled; | ||
case BarkoderConstants.DecoderType.AztecCompact: | ||
return this.bkdView.config.decoderConfig.aztecCompact.enabled; | ||
case BarkoderConstants.DecoderType.QR: | ||
return this.bkdView.config.decoderConfig.qr.enabled; | ||
case BarkoderConstants.DecoderType.QRMicro: | ||
return this.bkdView.config.decoderConfig.qrMicro.enabled; | ||
case BarkoderConstants.DecoderType.Code128: | ||
return this.bkdView.config.decoderConfig.code128.enabled; | ||
case BarkoderConstants.DecoderType.Code93: | ||
return this.bkdView.config.decoderConfig.code93.enabled; | ||
case BarkoderConstants.DecoderType.Code39: | ||
return this.bkdView.config.decoderConfig.code39.enabled; | ||
case BarkoderConstants.DecoderType.Telepen: | ||
return this.bkdView.config.decoderConfig.telepen.enabled; | ||
case BarkoderConstants.DecoderType.Code11: | ||
return this.bkdView.config.decoderConfig.code11.enabled; | ||
case BarkoderConstants.DecoderType.Msi: | ||
return this.bkdView.config.decoderConfig.msi.enabled; | ||
case BarkoderConstants.DecoderType.UpcA: | ||
return this.bkdView.config.decoderConfig.upcA.enabled; | ||
case BarkoderConstants.DecoderType.UpcE: | ||
return this.bkdView.config.decoderConfig.upcE.enabled; | ||
case BarkoderConstants.DecoderType.UpcE1: | ||
return this.bkdView.config.decoderConfig.upcE1.enabled; | ||
case BarkoderConstants.DecoderType.Ean13: | ||
return this.bkdView.config.decoderConfig.ean13.enabled; | ||
case BarkoderConstants.DecoderType.Ean8: | ||
return this.bkdView.config.decoderConfig.ean8.enabled; | ||
case BarkoderConstants.DecoderType.PDF417: | ||
return this.bkdView.config.decoderConfig.PDF417.enabled; | ||
case BarkoderConstants.DecoderType.PDF417Micro: | ||
return this.bkdView.config.decoderConfig.PDF417Micro.enabled; | ||
case BarkoderConstants.DecoderType.Datamatrix: | ||
return this.bkdView.config.decoderConfig.datamatrix.enabled; | ||
case BarkoderConstants.DecoderType.Code25: | ||
return this.bkdView.config.decoderConfig.code25.enabled; | ||
case BarkoderConstants.DecoderType.Interleaved25: | ||
return this.bkdView.config.decoderConfig.interleaved25.enabled; | ||
case BarkoderConstants.DecoderType.ITF14: | ||
return this.bkdView.config.decoderConfig.itf14.enabled; | ||
case BarkoderConstants.DecoderType.IATA25: | ||
return this.bkdView.config.decoderConfig.iata25.enabled; | ||
case BarkoderConstants.DecoderType.Matrix25: | ||
return this.bkdView.config.decoderConfig.matrix25.enabled; | ||
case BarkoderConstants.DecoderType.Datalogic25: | ||
return this.bkdView.config.decoderConfig.datalogic25.enabled; | ||
case BarkoderConstants.DecoderType.COOP25: | ||
return this.bkdView.config.decoderConfig.coop25.enabled; | ||
case BarkoderConstants.DecoderType.Dotcode: | ||
return this.bkdView.config.decoderConfig.dotcode.enabled; | ||
} | ||
} | ||
setBarcodeTypeEnabled(decoders: BarkoderConstants.DecoderType[]): void { | ||
this.bkdView.config.decoderConfig.aztec.enabled = false; | ||
this.bkdView.config.decoderConfig.aztecCompact.enabled = false; | ||
this.bkdView.config.decoderConfig.qr.enabled = false; | ||
this.bkdView.config.decoderConfig.qrMicro.enabled = false; | ||
this.bkdView.config.decoderConfig.code128.enabled = false; | ||
this.bkdView.config.decoderConfig.code93.enabled = false; | ||
this.bkdView.config.decoderConfig.code39.enabled = false; | ||
this.bkdView.config.decoderConfig.telepen.enabled = false; | ||
this.bkdView.config.decoderConfig.code11.enabled = false; | ||
this.bkdView.config.decoderConfig.codabar.enabled = false; | ||
this.bkdView.config.decoderConfig.msi.enabled = false; | ||
this.bkdView.config.decoderConfig.upcA.enabled = false; | ||
this.bkdView.config.decoderConfig.upcE.enabled = false; | ||
this.bkdView.config.decoderConfig.upcE1.enabled = false; | ||
this.bkdView.config.decoderConfig.ean13.enabled = true; | ||
this.bkdView.config.decoderConfig.ean8.enabled = false; | ||
this.bkdView.config.decoderConfig.PDF417.enabled = false; | ||
this.bkdView.config.decoderConfig.PDF417Micro.enabled = false; | ||
this.bkdView.config.decoderConfig.datamatrix.enabled = false; | ||
this.bkdView.config.decoderConfig.code25.enabled = false; | ||
this.bkdView.config.decoderConfig.interleaved25.enabled = false; | ||
this.bkdView.config.decoderConfig.itf14.enabled = false; | ||
this.bkdView.config.decoderConfig.iata25.enabled = false; | ||
this.bkdView.config.decoderConfig.matrix25.enabled = false; | ||
this.bkdView.config.decoderConfig.datalogic25.enabled = false; | ||
this.bkdView.config.decoderConfig.coop25.enabled = false; | ||
this.bkdView.config.decoderConfig.dotcode.enabled = false; | ||
this.bkdView.config.decoderConfig.code32.enabled = false; | ||
decoders.forEach((dt: BarkoderConstants.DecoderType) => { | ||
switch (dt) { | ||
case BarkoderConstants.DecoderType.Aztec: | ||
this.bkdView.config.decoderConfig.aztec.enabled = true | ||
break; | ||
case BarkoderConstants.DecoderType.AztecCompact: | ||
this.bkdView.config.decoderConfig.aztecCompact.enabled = true | ||
break; | ||
case BarkoderConstants.DecoderType.QR: | ||
this.bkdView.config.decoderConfig.qr.enabled = true | ||
break; | ||
case BarkoderConstants.DecoderType.QRMicro: | ||
this.bkdView.config.decoderConfig.qrMicro.enabled = true | ||
break; | ||
case BarkoderConstants.DecoderType.Code128: | ||
this.bkdView.config.decoderConfig.code128.enabled = true | ||
break; | ||
case BarkoderConstants.DecoderType.Code93: | ||
this.bkdView.config.decoderConfig.code93.enabled = true | ||
break; | ||
case BarkoderConstants.DecoderType.Code39: | ||
this.bkdView.config.decoderConfig.code39.enabled = true | ||
break; | ||
case BarkoderConstants.DecoderType.Telepen: | ||
this.bkdView.config.decoderConfig.telepen.enabled = true | ||
break; | ||
case BarkoderConstants.DecoderType.Code11: | ||
this.bkdView.config.decoderConfig.code11.enabled = true | ||
break; | ||
case BarkoderConstants.DecoderType.Msi: | ||
this.bkdView.config.decoderConfig.msi.enabled = true | ||
break; | ||
case BarkoderConstants.DecoderType.UpcA: | ||
this.bkdView.config.decoderConfig.upcA.enabled = true | ||
break; | ||
case BarkoderConstants.DecoderType.UpcE: | ||
this.bkdView.config.decoderConfig.upcE.enabled = true | ||
break; | ||
case BarkoderConstants.DecoderType.UpcE1: | ||
this.bkdView.config.decoderConfig.upcE1.enabled = true | ||
break; | ||
case BarkoderConstants.DecoderType.Ean13: | ||
this.bkdView.config.decoderConfig.ean13.enabled = true | ||
break; | ||
case BarkoderConstants.DecoderType.Ean8: | ||
this.bkdView.config.decoderConfig.ean8.enabled = true | ||
break; | ||
case BarkoderConstants.DecoderType.PDF417: | ||
this.bkdView.config.decoderConfig.PDF417.enabled = true | ||
break; | ||
case BarkoderConstants.DecoderType.PDF417Micro: | ||
this.bkdView.config.decoderConfig.PDF417Micro.enabled = true | ||
break; | ||
case BarkoderConstants.DecoderType.Datamatrix: | ||
this.bkdView.config.decoderConfig.datamatrix.enabled = true | ||
break; | ||
case BarkoderConstants.DecoderType.Code25: | ||
this.bkdView.config.decoderConfig.code25.enabled = true | ||
break; | ||
case BarkoderConstants.DecoderType.Interleaved25: | ||
this.bkdView.config.decoderConfig.interleaved25.enabled = true | ||
break; | ||
case BarkoderConstants.DecoderType.ITF14: | ||
this.bkdView.config.decoderConfig.itf14.enabled = true | ||
break; | ||
case BarkoderConstants.DecoderType.IATA25: | ||
this.bkdView.config.decoderConfig.iata25.enabled = true | ||
break; | ||
case BarkoderConstants.DecoderType.Matrix25: | ||
this.bkdView.config.decoderConfig.matrix25.enabled = true | ||
break; | ||
case BarkoderConstants.DecoderType.Datalogic25: | ||
this.bkdView.config.decoderConfig.datalogic25.enabled = true | ||
break; | ||
case BarkoderConstants.DecoderType.COOP25: | ||
this.bkdView.config.decoderConfig.coop25.enabled = true | ||
break; | ||
case BarkoderConstants.DecoderType.Dotcode: | ||
this.bkdView.config.decoderConfig.dotcode.enabled = true | ||
break; | ||
default: | ||
break; | ||
} | ||
}); | ||
/** | ||
* Sets whether a specific barcode type is enabled | ||
*/ | ||
setBarcodeTypeEnabled(decoders: BarkoderConstants.DecoderType[]): void { | ||
this.bkdView.config.decoderConfig.aztec.enabled = false; | ||
this.bkdView.config.decoderConfig.aztecCompact.enabled = false; | ||
this.bkdView.config.decoderConfig.qr.enabled = false; | ||
this.bkdView.config.decoderConfig.qrMicro.enabled = false; | ||
this.bkdView.config.decoderConfig.code128.enabled = false; | ||
this.bkdView.config.decoderConfig.code93.enabled = false; | ||
this.bkdView.config.decoderConfig.code39.enabled = false; | ||
this.bkdView.config.decoderConfig.telepen.enabled = false; | ||
this.bkdView.config.decoderConfig.code11.enabled = false; | ||
this.bkdView.config.decoderConfig.codabar.enabled = false; | ||
this.bkdView.config.decoderConfig.msi.enabled = false; | ||
this.bkdView.config.decoderConfig.upcA.enabled = false; | ||
this.bkdView.config.decoderConfig.upcE.enabled = false; | ||
this.bkdView.config.decoderConfig.upcE1.enabled = false; | ||
this.bkdView.config.decoderConfig.ean13.enabled = true; | ||
this.bkdView.config.decoderConfig.ean8.enabled = false; | ||
this.bkdView.config.decoderConfig.PDF417.enabled = false; | ||
this.bkdView.config.decoderConfig.PDF417Micro.enabled = false; | ||
this.bkdView.config.decoderConfig.datamatrix.enabled = false; | ||
this.bkdView.config.decoderConfig.code25.enabled = false; | ||
this.bkdView.config.decoderConfig.interleaved25.enabled = false; | ||
this.bkdView.config.decoderConfig.itf14.enabled = false; | ||
this.bkdView.config.decoderConfig.iata25.enabled = false; | ||
this.bkdView.config.decoderConfig.matrix25.enabled = false; | ||
this.bkdView.config.decoderConfig.datalogic25.enabled = false; | ||
this.bkdView.config.decoderConfig.coop25.enabled = false; | ||
this.bkdView.config.decoderConfig.dotcode.enabled = false; | ||
this.bkdView.config.decoderConfig.code32.enabled = false; | ||
decoders.forEach((dt: BarkoderConstants.DecoderType) => { | ||
switch (dt) { | ||
case BarkoderConstants.DecoderType.Aztec: | ||
this.bkdView.config.decoderConfig.aztec.enabled = true; | ||
break; | ||
case BarkoderConstants.DecoderType.AztecCompact: | ||
this.bkdView.config.decoderConfig.aztecCompact.enabled = true; | ||
break; | ||
case BarkoderConstants.DecoderType.QR: | ||
this.bkdView.config.decoderConfig.qr.enabled = true; | ||
break; | ||
case BarkoderConstants.DecoderType.QRMicro: | ||
this.bkdView.config.decoderConfig.qrMicro.enabled = true; | ||
break; | ||
case BarkoderConstants.DecoderType.Code128: | ||
this.bkdView.config.decoderConfig.code128.enabled = true; | ||
break; | ||
case BarkoderConstants.DecoderType.Code93: | ||
this.bkdView.config.decoderConfig.code93.enabled = true; | ||
break; | ||
case BarkoderConstants.DecoderType.Code39: | ||
this.bkdView.config.decoderConfig.code39.enabled = true; | ||
break; | ||
case BarkoderConstants.DecoderType.Telepen: | ||
this.bkdView.config.decoderConfig.telepen.enabled = true; | ||
break; | ||
case BarkoderConstants.DecoderType.Code11: | ||
this.bkdView.config.decoderConfig.code11.enabled = true; | ||
break; | ||
case BarkoderConstants.DecoderType.Msi: | ||
this.bkdView.config.decoderConfig.msi.enabled = true; | ||
break; | ||
case BarkoderConstants.DecoderType.UpcA: | ||
this.bkdView.config.decoderConfig.upcA.enabled = true; | ||
break; | ||
case BarkoderConstants.DecoderType.UpcE: | ||
this.bkdView.config.decoderConfig.upcE.enabled = true; | ||
break; | ||
case BarkoderConstants.DecoderType.UpcE1: | ||
this.bkdView.config.decoderConfig.upcE1.enabled = true; | ||
break; | ||
case BarkoderConstants.DecoderType.Ean13: | ||
this.bkdView.config.decoderConfig.ean13.enabled = true; | ||
break; | ||
case BarkoderConstants.DecoderType.Ean8: | ||
this.bkdView.config.decoderConfig.ean8.enabled = true; | ||
break; | ||
case BarkoderConstants.DecoderType.PDF417: | ||
this.bkdView.config.decoderConfig.PDF417.enabled = true; | ||
break; | ||
case BarkoderConstants.DecoderType.PDF417Micro: | ||
this.bkdView.config.decoderConfig.PDF417Micro.enabled = true; | ||
break; | ||
case BarkoderConstants.DecoderType.Datamatrix: | ||
this.bkdView.config.decoderConfig.datamatrix.enabled = true; | ||
break; | ||
case BarkoderConstants.DecoderType.Code25: | ||
this.bkdView.config.decoderConfig.code25.enabled = true; | ||
break; | ||
case BarkoderConstants.DecoderType.Interleaved25: | ||
this.bkdView.config.decoderConfig.interleaved25.enabled = true; | ||
break; | ||
case BarkoderConstants.DecoderType.ITF14: | ||
this.bkdView.config.decoderConfig.itf14.enabled = true; | ||
break; | ||
case BarkoderConstants.DecoderType.IATA25: | ||
this.bkdView.config.decoderConfig.iata25.enabled = true; | ||
break; | ||
case BarkoderConstants.DecoderType.Matrix25: | ||
this.bkdView.config.decoderConfig.matrix25.enabled = true; | ||
break; | ||
case BarkoderConstants.DecoderType.Datalogic25: | ||
this.bkdView.config.decoderConfig.datalogic25.enabled = true; | ||
break; | ||
case BarkoderConstants.DecoderType.COOP25: | ||
this.bkdView.config.decoderConfig.coop25.enabled = true; | ||
break; | ||
case BarkoderConstants.DecoderType.Dotcode: | ||
this.bkdView.config.decoderConfig.dotcode.enabled = true; | ||
break; | ||
default: | ||
break; | ||
} | ||
}); | ||
} | ||
getBarcodeTypeMaximumLenght(decoder: BarkoderConstants.DecoderType) : any { | ||
switch (decoder) { | ||
case BarkoderConstants.DecoderType.Aztec: | ||
return this.bkdView.config.decoderConfig.aztec.maximumLength; | ||
case BarkoderConstants.DecoderType.AztecCompact: | ||
return this.bkdView.config.decoderConfig.aztecCompact.maximumLength; | ||
case BarkoderConstants.DecoderType.QR: | ||
return this.bkdView.config.decoderConfig.qr.maximumLength; | ||
case BarkoderConstants.DecoderType.QRMicro: | ||
return this.bkdView.config.decoderConfig.qrMicro.maximumLength; | ||
case BarkoderConstants.DecoderType.Code128: | ||
return this.bkdView.config.decoderConfig.code128.maximumLength; | ||
case BarkoderConstants.DecoderType.Code93: | ||
return this.bkdView.config.decoderConfig.code93.maximumLength; | ||
case BarkoderConstants.DecoderType.Code39: | ||
return this.bkdView.config.decoderConfig.code39.maximumLength; | ||
case BarkoderConstants.DecoderType.Telepen: | ||
return this.bkdView.config.decoderConfig.telepen.maximumLength; | ||
case BarkoderConstants.DecoderType.Code11: | ||
return this.bkdView.config.decoderConfig.code11.maximumLength; | ||
case BarkoderConstants.DecoderType.Msi: | ||
return this.bkdView.config.decoderConfig.msi.maximumLength; | ||
case BarkoderConstants.DecoderType.UpcA: | ||
return this.bkdView.config.decoderConfig.upcA.maximumLength; | ||
case BarkoderConstants.DecoderType.UpcE: | ||
return this.bkdView.config.decoderConfig.upcE.maximumLength; | ||
case BarkoderConstants.DecoderType.UpcE1: | ||
return this.bkdView.config.decoderConfig.upcE1.maximumLength; | ||
case BarkoderConstants.DecoderType.Ean13: | ||
return this.bkdView.config.decoderConfig.ean13.maximumLength; | ||
case BarkoderConstants.DecoderType.Ean8: | ||
return this.bkdView.config.decoderConfig.ean8.maximumLength; | ||
case BarkoderConstants.DecoderType.PDF417: | ||
return this.bkdView.config.decoderConfig.PDF417.maximumLength; | ||
case BarkoderConstants.DecoderType.PDF417Micro: | ||
return this.bkdView.config.decoderConfig.PDF417Micro.maximumLength; | ||
case BarkoderConstants.DecoderType.Datamatrix: | ||
return this.bkdView.config.decoderConfig.datamatrix.maximumLength; | ||
case BarkoderConstants.DecoderType.Code25: | ||
return this.bkdView.config.decoderConfig.code25.maximumLength; | ||
case BarkoderConstants.DecoderType.Interleaved25: | ||
return this.bkdView.config.decoderConfig.interleaved25.maximumLength; | ||
case BarkoderConstants.DecoderType.ITF14: | ||
return this.bkdView.config.decoderConfig.itf14.maximumLength; | ||
case BarkoderConstants.DecoderType.IATA25: | ||
return this.bkdView.config.decoderConfig.iata25.maximumLength; | ||
case BarkoderConstants.DecoderType.Matrix25: | ||
return this.bkdView.config.decoderConfig.matrix25.maximumLength; | ||
case BarkoderConstants.DecoderType.Datalogic25: | ||
return this.bkdView.config.decoderConfig.datalogic25.maximumLength; | ||
case BarkoderConstants.DecoderType.COOP25: | ||
return this.bkdView.config.decoderConfig.coop25.maximumLength; | ||
case BarkoderConstants.DecoderType.Dotcode: | ||
return this.bkdView.config.decoderConfig.dotcode.maximumLength; | ||
} | ||
getBarcodeTypeMaximumLenght(decoder: BarkoderConstants.DecoderType): any { | ||
switch (decoder) { | ||
case BarkoderConstants.DecoderType.Aztec: | ||
return this.bkdView.config.decoderConfig.aztec.maximumLength; | ||
case BarkoderConstants.DecoderType.AztecCompact: | ||
return this.bkdView.config.decoderConfig.aztecCompact.maximumLength; | ||
case BarkoderConstants.DecoderType.QR: | ||
return this.bkdView.config.decoderConfig.qr.maximumLength; | ||
case BarkoderConstants.DecoderType.QRMicro: | ||
return this.bkdView.config.decoderConfig.qrMicro.maximumLength; | ||
case BarkoderConstants.DecoderType.Code128: | ||
return this.bkdView.config.decoderConfig.code128.maximumLength; | ||
case BarkoderConstants.DecoderType.Code93: | ||
return this.bkdView.config.decoderConfig.code93.maximumLength; | ||
case BarkoderConstants.DecoderType.Code39: | ||
return this.bkdView.config.decoderConfig.code39.maximumLength; | ||
case BarkoderConstants.DecoderType.Telepen: | ||
return this.bkdView.config.decoderConfig.telepen.maximumLength; | ||
case BarkoderConstants.DecoderType.Code11: | ||
return this.bkdView.config.decoderConfig.code11.maximumLength; | ||
case BarkoderConstants.DecoderType.Msi: | ||
return this.bkdView.config.decoderConfig.msi.maximumLength; | ||
case BarkoderConstants.DecoderType.UpcA: | ||
return this.bkdView.config.decoderConfig.upcA.maximumLength; | ||
case BarkoderConstants.DecoderType.UpcE: | ||
return this.bkdView.config.decoderConfig.upcE.maximumLength; | ||
case BarkoderConstants.DecoderType.UpcE1: | ||
return this.bkdView.config.decoderConfig.upcE1.maximumLength; | ||
case BarkoderConstants.DecoderType.Ean13: | ||
return this.bkdView.config.decoderConfig.ean13.maximumLength; | ||
case BarkoderConstants.DecoderType.Ean8: | ||
return this.bkdView.config.decoderConfig.ean8.maximumLength; | ||
case BarkoderConstants.DecoderType.PDF417: | ||
return this.bkdView.config.decoderConfig.PDF417.maximumLength; | ||
case BarkoderConstants.DecoderType.PDF417Micro: | ||
return this.bkdView.config.decoderConfig.PDF417Micro.maximumLength; | ||
case BarkoderConstants.DecoderType.Datamatrix: | ||
return this.bkdView.config.decoderConfig.datamatrix.maximumLength; | ||
case BarkoderConstants.DecoderType.Code25: | ||
return this.bkdView.config.decoderConfig.code25.maximumLength; | ||
case BarkoderConstants.DecoderType.Interleaved25: | ||
return this.bkdView.config.decoderConfig.interleaved25.maximumLength; | ||
case BarkoderConstants.DecoderType.ITF14: | ||
return this.bkdView.config.decoderConfig.itf14.maximumLength; | ||
case BarkoderConstants.DecoderType.IATA25: | ||
return this.bkdView.config.decoderConfig.iata25.maximumLength; | ||
case BarkoderConstants.DecoderType.Matrix25: | ||
return this.bkdView.config.decoderConfig.matrix25.maximumLength; | ||
case BarkoderConstants.DecoderType.Datalogic25: | ||
return this.bkdView.config.decoderConfig.datalogic25.maximumLength; | ||
case BarkoderConstants.DecoderType.COOP25: | ||
return this.bkdView.config.decoderConfig.coop25.maximumLength; | ||
case BarkoderConstants.DecoderType.Dotcode: | ||
return this.bkdView.config.decoderConfig.dotcode.maximumLength; | ||
} | ||
} | ||
getBarcodeTypeMinimumLenght(decoder: BarkoderConstants.DecoderType) : any { | ||
switch (decoder) { | ||
case BarkoderConstants.DecoderType.Aztec: | ||
return this.bkdView.config.decoderConfig.aztec.minimumLength; | ||
case BarkoderConstants.DecoderType.AztecCompact: | ||
return this.bkdView.config.decoderConfig.aztecCompact.minimumLength; | ||
case BarkoderConstants.DecoderType.QR: | ||
return this.bkdView.config.decoderConfig.qr.minimumLength; | ||
case BarkoderConstants.DecoderType.QRMicro: | ||
return this.bkdView.config.decoderConfig.qrMicro.minimumLength; | ||
case BarkoderConstants.DecoderType.Code128: | ||
return this.bkdView.config.decoderConfig.code128.minimumLength; | ||
case BarkoderConstants.DecoderType.Code93: | ||
return this.bkdView.config.decoderConfig.code93.minimumLength; | ||
case BarkoderConstants.DecoderType.Code39: | ||
return this.bkdView.config.decoderConfig.code39.minimumLength; | ||
case BarkoderConstants.DecoderType.Telepen: | ||
return this.bkdView.config.decoderConfig.telepen.minimumLength; | ||
case BarkoderConstants.DecoderType.Code11: | ||
return this.bkdView.config.decoderConfig.code11.minimumLength; | ||
case BarkoderConstants.DecoderType.Msi: | ||
return this.bkdView.config.decoderConfig.msi.minimumLength; | ||
case BarkoderConstants.DecoderType.UpcA: | ||
return this.bkdView.config.decoderConfig.upcA.minimumLength; | ||
case BarkoderConstants.DecoderType.UpcE: | ||
return this.bkdView.config.decoderConfig.upcE.minimumLength; | ||
case BarkoderConstants.DecoderType.UpcE1: | ||
return this.bkdView.config.decoderConfig.upcE1.minimumLength; | ||
case BarkoderConstants.DecoderType.Ean13: | ||
return this.bkdView.config.decoderConfig.ean13.minimumLength; | ||
case BarkoderConstants.DecoderType.Ean8: | ||
return this.bkdView.config.decoderConfig.ean8.minimumLength; | ||
case BarkoderConstants.DecoderType.PDF417: | ||
return this.bkdView.config.decoderConfig.PDF417.minimumLength; | ||
case BarkoderConstants.DecoderType.PDF417Micro: | ||
return this.bkdView.config.decoderConfig.PDF417Micro.minimumLength; | ||
case BarkoderConstants.DecoderType.Datamatrix: | ||
return this.bkdView.config.decoderConfig.datamatrix.minimumLength; | ||
case BarkoderConstants.DecoderType.Code25: | ||
return this.bkdView.config.decoderConfig.code25.minimumLength; | ||
case BarkoderConstants.DecoderType.Interleaved25: | ||
return this.bkdView.config.decoderConfig.interleaved25.minimumLength; | ||
case BarkoderConstants.DecoderType.ITF14: | ||
return this.bkdView.config.decoderConfig.itf14.minimumLength; | ||
case BarkoderConstants.DecoderType.IATA25: | ||
return this.bkdView.config.decoderConfig.iata25.minimumLength; | ||
case BarkoderConstants.DecoderType.Matrix25: | ||
return this.bkdView.config.decoderConfig.matrix25.minimumLength; | ||
case BarkoderConstants.DecoderType.Datalogic25: | ||
return this.bkdView.config.decoderConfig.datalogic25.minimumLength; | ||
case BarkoderConstants.DecoderType.COOP25: | ||
return this.bkdView.config.decoderConfig.coop25.minimumLength; | ||
case BarkoderConstants.DecoderType.Dotcode: | ||
return this.bkdView.config.decoderConfig.dotcode.minimumLength; | ||
} | ||
getBarcodeTypeMinimumLenght(decoder: BarkoderConstants.DecoderType): any { | ||
switch (decoder) { | ||
case BarkoderConstants.DecoderType.Aztec: | ||
return this.bkdView.config.decoderConfig.aztec.minimumLength; | ||
case BarkoderConstants.DecoderType.AztecCompact: | ||
return this.bkdView.config.decoderConfig.aztecCompact.minimumLength; | ||
case BarkoderConstants.DecoderType.QR: | ||
return this.bkdView.config.decoderConfig.qr.minimumLength; | ||
case BarkoderConstants.DecoderType.QRMicro: | ||
return this.bkdView.config.decoderConfig.qrMicro.minimumLength; | ||
case BarkoderConstants.DecoderType.Code128: | ||
return this.bkdView.config.decoderConfig.code128.minimumLength; | ||
case BarkoderConstants.DecoderType.Code93: | ||
return this.bkdView.config.decoderConfig.code93.minimumLength; | ||
case BarkoderConstants.DecoderType.Code39: | ||
return this.bkdView.config.decoderConfig.code39.minimumLength; | ||
case BarkoderConstants.DecoderType.Telepen: | ||
return this.bkdView.config.decoderConfig.telepen.minimumLength; | ||
case BarkoderConstants.DecoderType.Code11: | ||
return this.bkdView.config.decoderConfig.code11.minimumLength; | ||
case BarkoderConstants.DecoderType.Msi: | ||
return this.bkdView.config.decoderConfig.msi.minimumLength; | ||
case BarkoderConstants.DecoderType.UpcA: | ||
return this.bkdView.config.decoderConfig.upcA.minimumLength; | ||
case BarkoderConstants.DecoderType.UpcE: | ||
return this.bkdView.config.decoderConfig.upcE.minimumLength; | ||
case BarkoderConstants.DecoderType.UpcE1: | ||
return this.bkdView.config.decoderConfig.upcE1.minimumLength; | ||
case BarkoderConstants.DecoderType.Ean13: | ||
return this.bkdView.config.decoderConfig.ean13.minimumLength; | ||
case BarkoderConstants.DecoderType.Ean8: | ||
return this.bkdView.config.decoderConfig.ean8.minimumLength; | ||
case BarkoderConstants.DecoderType.PDF417: | ||
return this.bkdView.config.decoderConfig.PDF417.minimumLength; | ||
case BarkoderConstants.DecoderType.PDF417Micro: | ||
return this.bkdView.config.decoderConfig.PDF417Micro.minimumLength; | ||
case BarkoderConstants.DecoderType.Datamatrix: | ||
return this.bkdView.config.decoderConfig.datamatrix.minimumLength; | ||
case BarkoderConstants.DecoderType.Code25: | ||
return this.bkdView.config.decoderConfig.code25.minimumLength; | ||
case BarkoderConstants.DecoderType.Interleaved25: | ||
return this.bkdView.config.decoderConfig.interleaved25.minimumLength; | ||
case BarkoderConstants.DecoderType.ITF14: | ||
return this.bkdView.config.decoderConfig.itf14.minimumLength; | ||
case BarkoderConstants.DecoderType.IATA25: | ||
return this.bkdView.config.decoderConfig.iata25.minimumLength; | ||
case BarkoderConstants.DecoderType.Matrix25: | ||
return this.bkdView.config.decoderConfig.matrix25.minimumLength; | ||
case BarkoderConstants.DecoderType.Datalogic25: | ||
return this.bkdView.config.decoderConfig.datalogic25.minimumLength; | ||
case BarkoderConstants.DecoderType.COOP25: | ||
return this.bkdView.config.decoderConfig.coop25.minimumLength; | ||
case BarkoderConstants.DecoderType.Dotcode: | ||
return this.bkdView.config.decoderConfig.dotcode.minimumLength; | ||
} | ||
} | ||
setBarcodeTypeLengthRange(decoder: BarkoderConstants.DecoderType, minimumLength:number, maximumLength: number) { | ||
switch (decoder) { | ||
case BarkoderConstants.DecoderType.Aztec: | ||
this.bkdView.config.decoderConfig.aztec.setLengthRangeWithMinimumMaximum(minimumLength,maximumLength) | ||
break; | ||
case BarkoderConstants.DecoderType.AztecCompact: | ||
this.bkdView.config.decoderConfig.aztecCompact.setLengthRangeWithMinimumMaximum(minimumLength,maximumLength) | ||
break; | ||
case BarkoderConstants.DecoderType.QR: | ||
this.bkdView.config.decoderConfig.qr.setLengthRangeWithMinimumMaximum(minimumLength,maximumLength) | ||
break; | ||
case BarkoderConstants.DecoderType.QRMicro: | ||
this.bkdView.config.decoderConfig.qrMicro.setLengthRangeWithMinimumMaximum(minimumLength,maximumLength) | ||
break; | ||
case BarkoderConstants.DecoderType.Code128: | ||
this.bkdView.config.decoderConfig.code128.setLengthRangeWithMinimumMaximum(minimumLength,maximumLength) | ||
break; | ||
case BarkoderConstants.DecoderType.Code93: | ||
this.bkdView.config.decoderConfig.code93.setLengthRangeWithMinimumMaximum(minimumLength,maximumLength) | ||
break; | ||
case BarkoderConstants.DecoderType.Code39: | ||
this.bkdView.config.decoderConfig.code39.setLengthRangeWithMinimumMaximum(minimumLength,maximumLength) | ||
break; | ||
case BarkoderConstants.DecoderType.Telepen: | ||
this.bkdView.config.decoderConfig.telepen.setLengthRangeWithMinimumMaximum(minimumLength,maximumLength) | ||
break; | ||
case BarkoderConstants.DecoderType.Code11: | ||
this.bkdView.config.decoderConfig.code11.setLengthRangeWithMinimumMaximum(minimumLength,maximumLength) | ||
break; | ||
case BarkoderConstants.DecoderType.Msi: | ||
this.bkdView.config.decoderConfig.msi.setLengthRangeWithMinimumMaximum(minimumLength,maximumLength) | ||
break; | ||
case BarkoderConstants.DecoderType.UpcA: | ||
this.bkdView.config.decoderConfig.upcA.setLengthRangeWithMinimumMaximum(minimumLength,maximumLength) | ||
break; | ||
case BarkoderConstants.DecoderType.UpcE: | ||
this.bkdView.config.decoderConfig.upcE.setLengthRangeWithMinimumMaximum(minimumLength,maximumLength) | ||
break; | ||
case BarkoderConstants.DecoderType.UpcE1: | ||
this.bkdView.config.decoderConfig.upcE1.setLengthRangeWithMinimumMaximum(minimumLength,maximumLength) | ||
break; | ||
case BarkoderConstants.DecoderType.Ean13: | ||
this.bkdView.config.decoderConfig.ean13.setLengthRangeWithMinimumMaximum(minimumLength,maximumLength) | ||
break; | ||
case BarkoderConstants.DecoderType.Ean8: | ||
this.bkdView.config.decoderConfig.ean8.setLengthRangeWithMinimumMaximum(minimumLength,maximumLength) | ||
break; | ||
case BarkoderConstants.DecoderType.PDF417: | ||
this.bkdView.config.decoderConfig.PDF417.setLengthRangeWithMinimumMaximum(minimumLength,maximumLength) | ||
break; | ||
case BarkoderConstants.DecoderType.PDF417Micro: | ||
this.bkdView.config.decoderConfig.PDF417Micro.setLengthRangeWithMinimumMaximum(minimumLength,maximumLength) | ||
break; | ||
case BarkoderConstants.DecoderType.Datamatrix: | ||
this.bkdView.config.decoderConfig.datamatrix.setLengthRangeWithMinimumMaximum(minimumLength,maximumLength) | ||
break; | ||
case BarkoderConstants.DecoderType.Code25: | ||
this.bkdView.config.decoderConfig.code25.setLengthRangeWithMinimumMaximum(minimumLength,maximumLength) | ||
break; | ||
case BarkoderConstants.DecoderType.Interleaved25: | ||
this.bkdView.config.decoderConfig.interleaved25.setLengthRangeWithMinimumMaximum(minimumLength,maximumLength) | ||
break; | ||
case BarkoderConstants.DecoderType.ITF14: | ||
this.bkdView.config.decoderConfig.itf14.setLengthRangeWithMinimumMaximum(minimumLength,maximumLength) | ||
break; | ||
case BarkoderConstants.DecoderType.IATA25: | ||
this.bkdView.config.decoderConfig.iata25.setLengthRangeWithMinimumMaximum(minimumLength,maximumLength) | ||
break; | ||
case BarkoderConstants.DecoderType.Matrix25: | ||
this.bkdView.config.decoderConfig.matrix25.setLengthRangeWithMinimumMaximum(minimumLength,maximumLength) | ||
break; | ||
case BarkoderConstants.DecoderType.Datalogic25: | ||
this.bkdView.config.decoderConfig.datalogic25.setLengthRangeWithMinimumMaximum(minimumLength,maximumLength) | ||
break; | ||
case BarkoderConstants.DecoderType.COOP25: | ||
this.bkdView.config.decoderConfig.coop25.setLengthRangeWithMinimumMaximum(minimumLength,maximumLength) | ||
break; | ||
case BarkoderConstants.DecoderType.Dotcode: | ||
this.bkdView.config.decoderConfig.dotcode.setLengthRangeWithMinimumMaximum(minimumLength,maximumLength) | ||
break; | ||
default: | ||
break; | ||
} | ||
/** | ||
* Sets the length range for the specified barcode type | ||
*/ | ||
setBarcodeTypeLengthRange( | ||
decoder: BarkoderConstants.DecoderType, | ||
minimumLength: number, | ||
maximumLength: number | ||
) { | ||
switch (decoder) { | ||
case BarkoderConstants.DecoderType.Aztec: | ||
this.bkdView.config.decoderConfig.aztec.setLengthRangeWithMinimumMaximum( | ||
minimumLength, | ||
maximumLength | ||
); | ||
break; | ||
case BarkoderConstants.DecoderType.AztecCompact: | ||
this.bkdView.config.decoderConfig.aztecCompact.setLengthRangeWithMinimumMaximum( | ||
minimumLength, | ||
maximumLength | ||
); | ||
break; | ||
case BarkoderConstants.DecoderType.QR: | ||
this.bkdView.config.decoderConfig.qr.setLengthRangeWithMinimumMaximum( | ||
minimumLength, | ||
maximumLength | ||
); | ||
break; | ||
case BarkoderConstants.DecoderType.QRMicro: | ||
this.bkdView.config.decoderConfig.qrMicro.setLengthRangeWithMinimumMaximum( | ||
minimumLength, | ||
maximumLength | ||
); | ||
break; | ||
case BarkoderConstants.DecoderType.Code128: | ||
this.bkdView.config.decoderConfig.code128.setLengthRangeWithMinimumMaximum( | ||
minimumLength, | ||
maximumLength | ||
); | ||
break; | ||
case BarkoderConstants.DecoderType.Code93: | ||
this.bkdView.config.decoderConfig.code93.setLengthRangeWithMinimumMaximum( | ||
minimumLength, | ||
maximumLength | ||
); | ||
break; | ||
case BarkoderConstants.DecoderType.Code39: | ||
this.bkdView.config.decoderConfig.code39.setLengthRangeWithMinimumMaximum( | ||
minimumLength, | ||
maximumLength | ||
); | ||
break; | ||
case BarkoderConstants.DecoderType.Telepen: | ||
this.bkdView.config.decoderConfig.telepen.setLengthRangeWithMinimumMaximum( | ||
minimumLength, | ||
maximumLength | ||
); | ||
break; | ||
case BarkoderConstants.DecoderType.Code11: | ||
this.bkdView.config.decoderConfig.code11.setLengthRangeWithMinimumMaximum( | ||
minimumLength, | ||
maximumLength | ||
); | ||
break; | ||
case BarkoderConstants.DecoderType.Msi: | ||
this.bkdView.config.decoderConfig.msi.setLengthRangeWithMinimumMaximum( | ||
minimumLength, | ||
maximumLength | ||
); | ||
break; | ||
case BarkoderConstants.DecoderType.UpcA: | ||
this.bkdView.config.decoderConfig.upcA.setLengthRangeWithMinimumMaximum( | ||
minimumLength, | ||
maximumLength | ||
); | ||
break; | ||
case BarkoderConstants.DecoderType.UpcE: | ||
this.bkdView.config.decoderConfig.upcE.setLengthRangeWithMinimumMaximum( | ||
minimumLength, | ||
maximumLength | ||
); | ||
break; | ||
case BarkoderConstants.DecoderType.UpcE1: | ||
this.bkdView.config.decoderConfig.upcE1.setLengthRangeWithMinimumMaximum( | ||
minimumLength, | ||
maximumLength | ||
); | ||
break; | ||
case BarkoderConstants.DecoderType.Ean13: | ||
this.bkdView.config.decoderConfig.ean13.setLengthRangeWithMinimumMaximum( | ||
minimumLength, | ||
maximumLength | ||
); | ||
break; | ||
case BarkoderConstants.DecoderType.Ean8: | ||
this.bkdView.config.decoderConfig.ean8.setLengthRangeWithMinimumMaximum( | ||
minimumLength, | ||
maximumLength | ||
); | ||
break; | ||
case BarkoderConstants.DecoderType.PDF417: | ||
this.bkdView.config.decoderConfig.PDF417.setLengthRangeWithMinimumMaximum( | ||
minimumLength, | ||
maximumLength | ||
); | ||
break; | ||
case BarkoderConstants.DecoderType.PDF417Micro: | ||
this.bkdView.config.decoderConfig.PDF417Micro.setLengthRangeWithMinimumMaximum( | ||
minimumLength, | ||
maximumLength | ||
); | ||
break; | ||
case BarkoderConstants.DecoderType.Datamatrix: | ||
this.bkdView.config.decoderConfig.datamatrix.setLengthRangeWithMinimumMaximum( | ||
minimumLength, | ||
maximumLength | ||
); | ||
break; | ||
case BarkoderConstants.DecoderType.Code25: | ||
this.bkdView.config.decoderConfig.code25.setLengthRangeWithMinimumMaximum( | ||
minimumLength, | ||
maximumLength | ||
); | ||
break; | ||
case BarkoderConstants.DecoderType.Interleaved25: | ||
this.bkdView.config.decoderConfig.interleaved25.setLengthRangeWithMinimumMaximum( | ||
minimumLength, | ||
maximumLength | ||
); | ||
break; | ||
case BarkoderConstants.DecoderType.ITF14: | ||
this.bkdView.config.decoderConfig.itf14.setLengthRangeWithMinimumMaximum( | ||
minimumLength, | ||
maximumLength | ||
); | ||
break; | ||
case BarkoderConstants.DecoderType.IATA25: | ||
this.bkdView.config.decoderConfig.iata25.setLengthRangeWithMinimumMaximum( | ||
minimumLength, | ||
maximumLength | ||
); | ||
break; | ||
case BarkoderConstants.DecoderType.Matrix25: | ||
this.bkdView.config.decoderConfig.matrix25.setLengthRangeWithMinimumMaximum( | ||
minimumLength, | ||
maximumLength | ||
); | ||
break; | ||
case BarkoderConstants.DecoderType.Datalogic25: | ||
this.bkdView.config.decoderConfig.datalogic25.setLengthRangeWithMinimumMaximum( | ||
minimumLength, | ||
maximumLength | ||
); | ||
break; | ||
case BarkoderConstants.DecoderType.COOP25: | ||
this.bkdView.config.decoderConfig.coop25.setLengthRangeWithMinimumMaximum( | ||
minimumLength, | ||
maximumLength | ||
); | ||
break; | ||
case BarkoderConstants.DecoderType.Dotcode: | ||
this.bkdView.config.decoderConfig.dotcode.setLengthRangeWithMinimumMaximum( | ||
minimumLength, | ||
maximumLength | ||
); | ||
break; | ||
default: | ||
break; | ||
} | ||
} | ||
setMaximumResultsCount(maximumResultsCount : number): void { | ||
this.bkdView.config.decoderConfig.maximumResultsCount = maximumResultsCount | ||
} | ||
setDuplicatesDelayMs(duplicateDelayMs : number) : void { | ||
this.bkdView.config.decoderConfig.duplicatesDelayMs = duplicateDelayMs | ||
} | ||
/** | ||
* Sets the maximum number of results to be returned from barcode scanning | ||
*/ | ||
setMaximumResultsCount(maximumResultsCount: number): void { | ||
this.bkdView.config.decoderConfig.maximumResultsCount = maximumResultsCount; | ||
} | ||
setMulticodeCachingDuration(multicodeCachingDuration : number) : void { | ||
this.bkdView.config.setMulticodeCachingDuration(multicodeCachingDuration) | ||
} | ||
/** | ||
* Sets the delay in milliseconds for considering duplicate barcodes during scanning | ||
*/ | ||
setDuplicatesDelayMs(duplicateDelayMs: number): void { | ||
this.bkdView.config.decoderConfig.duplicatesDelayMs = duplicateDelayMs; | ||
} | ||
setMulticodeCachingEnabled(multiCodeCachingEnabled : boolean) : void { | ||
this.bkdView.config.setMulticodeCachingEnabled(multiCodeCachingEnabled) | ||
} | ||
/** | ||
* Sets the caching duration (in milliseconds) for multi-code results | ||
*/ | ||
setMulticodeCachingDuration(multicodeCachingDuration: number): void { | ||
this.bkdView.config.setMulticodeCachingDuration(multicodeCachingDuration); | ||
} | ||
setDatamatrixDpmModeEnabled(dpmModeEnabled : boolean) : void { | ||
if(dpmModeEnabled) { | ||
this.bkdView.config.decoderConfig.datamatrix.dpmMode = 1 | ||
} else if (dpmModeEnabled == false) { | ||
this.bkdView.config.decoderConfig.datamatrix.dpmMode = 0 | ||
} | ||
/** | ||
* Sets whether multi-code caching is enabled | ||
*/ | ||
setMulticodeCachingEnabled(multiCodeCachingEnabled: boolean): void { | ||
this.bkdView.config.setMulticodeCachingEnabled(multiCodeCachingEnabled); | ||
} | ||
/** | ||
* Sets whether the Direct Part Marking (DPM) mode for Datamatrix barcodes is enabled. | ||
*/ | ||
setDatamatrixDpmModeEnabled(dpmModeEnabled: boolean): void { | ||
if (dpmModeEnabled) { | ||
this.bkdView.config.decoderConfig.datamatrix.dpmMode = 1; | ||
} else if (dpmModeEnabled == false) { | ||
this.bkdView.config.decoderConfig.datamatrix.dpmMode = 0; | ||
} | ||
} | ||
getDuplicatesDelayMs() : any { | ||
return this.bkdView.config.decoderConfig.duplicatesDelayMs | ||
} | ||
/** | ||
* Retrieves the delay in milliseconds for considering duplicate barcodes during scanning | ||
*/ | ||
getDuplicatesDelayMs(): any { | ||
return this.bkdView.config.decoderConfig.duplicatesDelayMs; | ||
} | ||
getMaximumResultsCount() : any { | ||
return this.bkdView.config.decoderConfig.maximumResultsCount | ||
} | ||
/** | ||
* Retrieves the maximum number of results to be returned from barcode scanning at once | ||
*/ | ||
getMaximumResultsCount(): any { | ||
return this.bkdView.config.decoderConfig.maximumResultsCount; | ||
} | ||
setUpcEanDeblurEnabled(enabled : boolean) : void { | ||
this.bkdView.config.decoderConfig.upcEanDeblur = enabled | ||
} | ||
/** | ||
* Sets whether the deblurring feature for UPC/EAN barcodes is enabled | ||
*/ | ||
setUpcEanDeblurEnabled(enabled: boolean): void { | ||
this.bkdView.config.decoderConfig.upcEanDeblur = enabled; | ||
} | ||
setEnableMisshaped1DEnabled(enabled : boolean) : void { | ||
this.bkdView.config.decoderConfig.enableMisshaped1D = enabled | ||
} | ||
/** | ||
* Sets whether the detection of misshaped 1D barcodes is enabled | ||
*/ | ||
setEnableMisshaped1DEnabled(enabled: boolean): void { | ||
this.bkdView.config.decoderConfig.enableMisshaped1D = enabled; | ||
} | ||
setBarcodeThumbnailOnResultEnabled(enabled : boolean) : void{ | ||
this.bkdView.config.barcodeThumbnailOnResult = enabled | ||
} | ||
/** | ||
* Sets whether to enable barcode thumbnail on result | ||
*/ | ||
setBarcodeThumbnailOnResultEnabled(enabled: boolean): void { | ||
this.bkdView.config.barcodeThumbnailOnResult = enabled; | ||
} | ||
isBarcodeThumbnailOnResultEnabled() : any{ | ||
return this.bkdView.config.barcodeThumbnailOnResult | ||
} | ||
/** | ||
* Retrieve whether to enable barcode thumbnail on result | ||
*/ | ||
isBarcodeThumbnailOnResultEnabled(): any { | ||
return this.bkdView.config.barcodeThumbnailOnResult; | ||
} | ||
setThresholdBetweenDuplicatesScans(thresholdBetweenDuplicatesScans : number) : void { | ||
this.bkdView.config.thresholdBetweenDuplicatesScans = thresholdBetweenDuplicatesScans | ||
} | ||
getThresholdBetweenDuplicatesScans() : any { | ||
return this.bkdView.config.thresholdBetweenDuplicatesScans | ||
} | ||
/** | ||
* Sets the threshold between duplicate scans | ||
*/ | ||
setThresholdBetweenDuplicatesScans( | ||
thresholdBetweenDuplicatesScans: number | ||
): void { | ||
this.bkdView.config.thresholdBetweenDuplicatesScans = thresholdBetweenDuplicatesScans; | ||
} | ||
getMulticodeCachingEnabled() : any { | ||
return this.bkdView.config.getMulticodeCachingEnabled() | ||
} | ||
getMulticodeCachingDuration() : any { | ||
return this.bkdView.config.getMulticodeCachingDuration() | ||
} | ||
/** | ||
* Retrieves the threshold between duplicate scans | ||
*/ | ||
getThresholdBetweenDuplicatesScans(): any { | ||
return this.bkdView.config.thresholdBetweenDuplicatesScans; | ||
} | ||
isUpcEanDeblurEnabled() : any { | ||
return this.bkdView.config.decoderConfig.upcEanDeblur | ||
} | ||
isMisshaped1DEnabled() : any { | ||
return this.bkdView.config.decoderConfig.enableMisshaped1D | ||
} | ||
/** | ||
* Retrieves whether multi-code caching is enabled | ||
*/ | ||
getMulticodeCachingEnabled(): any { | ||
return this.bkdView.config.getMulticodeCachingEnabled(); | ||
} | ||
isVINRestrictionsEnabled() : any { | ||
return this.bkdView.config.decoderConfig.enableVINRestrictions | ||
} | ||
/** | ||
* Retrieves the caching duration (in milliseconds) for multi-code results | ||
*/ | ||
getMulticodeCachingDuration(): any { | ||
return this.bkdView.config.getMulticodeCachingDuration(); | ||
} | ||
setEnableVINRestrictions(vinRestrictionsEnabled: boolean) : void { | ||
this.bkdView.config.decoderConfig.enableVINRestrictions = vinRestrictionsEnabled | ||
} | ||
/** | ||
* Retrieves the value indicating whether deblurring is enabled for UPC/EAN barcodes | ||
*/ | ||
isUpcEanDeblurEnabled(): any { | ||
return this.bkdView.config.decoderConfig.upcEanDeblur; | ||
} | ||
setLicenseKey(licenseKey : string): void { | ||
const config = new BarkoderConfig({ | ||
licenseKey: licenseKey, | ||
licenseCheckHandler: (result: LicenseCheckResult) => { | ||
} | ||
}); | ||
this.bkdView.config = config | ||
} | ||
/** | ||
* Checks if the detection of misshaped 1D barcodes is enabled | ||
*/ | ||
isMisshaped1DEnabled(): any { | ||
return this.bkdView.config.decoderConfig.enableMisshaped1D; | ||
} | ||
configureBarkoder(config : BarkoderConstants.BarkoderConfig) : void { | ||
console.log(`${config.toJsonString()}`) | ||
const nsString = NSString.stringWithString(config.toJsonString()); | ||
const jsonData = nsString.dataUsingEncoding(NSUTF8StringEncoding); | ||
BarkoderHelper.applyConfigSettingsFromJsonJsonDataFinished(this.bkdView.config, jsonData, (resultConfig: BarkoderConfig, error: NSError) => { | ||
if (error) { | ||
console.error('Error applying config settings:', error.localizedDescription); | ||
} else { | ||
console.log('Config settings applied successfully:', resultConfig); | ||
} | ||
}); | ||
/** | ||
* Checks if VIN restrictions are enabled | ||
*/ | ||
isVINRestrictionsEnabled(): any { | ||
return this.bkdView.config.decoderConfig.enableVINRestrictions; | ||
} | ||
/** | ||
* Sets whether Vehicle Identification Number (VIN) restrictions are enabled | ||
*/ | ||
setEnableVINRestrictions(vinRestrictionsEnabled: boolean): void { | ||
this.bkdView.config.decoderConfig.enableVINRestrictions = vinRestrictionsEnabled; | ||
} | ||
setLicenseKey(licenseKey: string): void { | ||
const config = new BarkoderConfig({ | ||
licenseKey: licenseKey, | ||
licenseCheckHandler: (result: LicenseCheckResult) => {}, | ||
}); | ||
this.bkdView.config = config; | ||
} | ||
/** | ||
* Configures the Barkoder functionality based on the provided configuration | ||
*/ | ||
configureBarkoder(config: BarkoderConstants.BarkoderConfig): void { | ||
const nsString = NSString.stringWithString(config.toJsonString()); | ||
const jsonData = nsString.dataUsingEncoding(NSUTF8StringEncoding); | ||
BarkoderHelper.applyConfigSettingsFromJsonJsonDataFinished( | ||
this.bkdView.config, | ||
jsonData, | ||
(resultConfig: BarkoderConfig, error: NSError) => { | ||
if (error) { | ||
console.error( | ||
"Error applying config settings:", | ||
error.localizedDescription | ||
); | ||
} else { | ||
console.log("Config settings applied successfully:", resultConfig); | ||
} | ||
} | ||
); | ||
} | ||
private hexToUIColor(hexColor: string): UIColor { | ||
hexColor = hexColor.replace("#", ""); | ||
const red = parseInt(hexColor.substring(0, 2), 16) / 255.0; | ||
const green = parseInt(hexColor.substring(2, 4), 16) / 255.0; | ||
const blue = parseInt(hexColor.substring(4, 6), 16) / 255.0; | ||
return new UIColor({ red: red, green: green, blue: blue, alpha: 1 }); | ||
} | ||
private hexToUIColor(hexColor: string): UIColor { | ||
hexColor = hexColor.replace("#", ""); | ||
const red = parseInt(hexColor.substring(0, 2), 16) / 255.0; | ||
const green = parseInt(hexColor.substring(2, 4), 16) / 255.0; | ||
const blue = parseInt(hexColor.substring(4, 6), 16) / 255.0; | ||
return new UIColor({ red: red, green: green, blue: blue, alpha: 1 }); | ||
} | ||
private getPropertiesAndMethods(obj: any): void { | ||
const propertiesAndMethods: string[] = []; | ||
for (let key in obj) { | ||
console.log(`Key: ${key}, Value: ${obj[key]}`); | ||
} | ||
private getPropertiesAndMethods(obj: any): void { | ||
const propertiesAndMethods: string[] = []; | ||
for (let key in obj) { | ||
console.log(`Key: ${key}, Value: ${obj[key]}`); | ||
} | ||
} | ||
} | ||
@NativeClass | ||
export class BarkoderViewWraper extends UIResponder implements BarkoderResultDelegate{ | ||
public callback : any | ||
static ObjCProtocols = [BarkoderResultDelegate]; | ||
export class BarkoderViewWraper extends UIResponder | ||
implements BarkoderResultDelegate { | ||
public callback: any; | ||
static ObjCProtocols = [BarkoderResultDelegate]; | ||
constructor(callback : BarkoderConstants.BarkoderResultCallback) { | ||
super(); | ||
this.callback = callback | ||
} | ||
scanningFinishedThumbnailsImage(decoderResults: NSArray<DecoderResult> | DecoderResult[], thumbnails: NSArray<UIImage> | UIImage[], image: UIImage): void { | ||
console.log(decoderResults[0].textualData) | ||
this.callback.scanningFinished(decoderResults, thumbnails, image); | ||
} | ||
constructor(callback: BarkoderConstants.BarkoderResultCallback) { | ||
super(); | ||
this.callback = callback; | ||
} | ||
static new(): BarkoderViewWraper { | ||
return super.new.call(this); | ||
} | ||
scanningFinishedThumbnailsImage( | ||
decoderResults: NSArray<DecoderResult> | DecoderResult[], | ||
thumbnails: NSArray<UIImage> | UIImage[], | ||
image: UIImage | ||
): void { | ||
this.callback.scanningFinished(decoderResults, thumbnails, image); | ||
} | ||
static new(): BarkoderViewWraper { | ||
return super.new.call(this); | ||
} | ||
} | ||
{ | ||
"name": "barkoder-nativescript", | ||
"version": "1.3.0", | ||
"version": "1.3.1", | ||
"description": "Nativescript support for Barkoder - a Barcode Scanner SDK for the modern enterprise.", | ||
@@ -5,0 +5,0 @@ "main": "barkoder-nativescript", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
13515700
29689
9