Skip to content

Commit

Permalink
43.0.0-preview.3
Browse files Browse the repository at this point in the history
  • Loading branch information
aldrichanyline committed Jan 30, 2023
1 parent c785a72 commit aaf4d4f
Show file tree
Hide file tree
Showing 560 changed files with 4,412 additions and 4,335 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#import "ALOthersExampleManager.h"
#import "ALUniversalSerialNumberScanViewController.h"
#import "ALContainerScanViewController.h"
#import "ALBottlecapScanViewController.h"


@interface ALOthersExampleManager ()
Expand Down Expand Up @@ -35,15 +34,10 @@ - (void)initExampleData {
image:[UIImage imageNamed:@"vertical container scanner"]
viewController:[ALContainerScanViewController class]
title:NSLocalizedString(@"Vertical Shipping Container", nil)];

ALExample *bottleCapScanning = [[ALExample alloc] initWithName:NSLocalizedString(@"Pepsi Code", nil)
image:[UIImage imageNamed:@"tile_pepsicode"]
viewController:[ALBottlecapScanViewController class]];


self.sectionNames = @[@"Others",];

self.sectionNames = @[ @"Others" ];
self.examples = @{
self.sectionNames[0] : @[containerScanning, verticalContainerScanning, bottleCapScanning],
self.sectionNames[0] : @[ containerScanning, verticalContainerScanning ],
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ - (void)showResultControllerWithResults:(ALScanResult *)scanResult {

NSAssert(barcodesFound.count > 0, @"no barcodes found");

NSArray <ALResultEntry *> *resultData = scanResult.pluginResult.barcodeResult.resultEntryList;
NSArray<ALResultEntry *> *resultData = scanResult.pluginResult.fieldList.resultEntries;
NSString *resultDataJSONStr = [ALResultEntry JSONStringFromList:resultData];

__weak __block typeof(self) weakSelf = self;
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
@interface ALContainerScanViewController () <ALScanPluginDelegate>

@property (nonatomic, strong) ALScanViewPlugin *scanViewPlugin;
// @property (nullable, nonatomic, strong) ALScanView *scanView;

@property (assign, nonatomic) BOOL isVertical;

Expand All @@ -30,7 +29,6 @@ - (void)viewDidLoad {
[self reloadScanView];

[self setColors];

}

- (void)viewWillAppear:(BOOL)animated {
Expand Down Expand Up @@ -90,7 +88,7 @@ - (void)reloadScanView {
#pragma mark -- ALScanPluginDelegate

- (void)scanPlugin:(ALScanPlugin *)scanPlugin resultReceived:(ALScanResult *)scanResult {
NSArray <ALResultEntry*> *resultData = scanResult.pluginResult.containerResult.resultEntryList;
NSArray<ALResultEntry*> *resultData = scanResult.pluginResult.fieldList.resultEntries;
NSString *resultDataJSONStr = [ALResultEntry JSONStringFromList:resultData];
__weak ALContainerScanViewController *weakSelf = self;
[self anylineDidFindResult:resultDataJSONStr
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"alignment": "top_half",
"ratioFromSize": {
"width": 62,
"height": 9,
"height": 9
},
"offset": {
"x": 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"alignment": "center",
"ratioFromSize": {
"width": 9,
"height": 62,
"height": 62
},
"offset": {
"x": 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -540,16 +540,9 @@ - (void)scanPlugin:(ALScanPlugin *)scanPlugin resultReceived:(ALScanResult *)sca
if (scanResult.pluginResult.barcodeResult) {
self.barcodeResult = scanResult.pluginResult.barcodeResult;
}

ALUniversalIDResult *IDResult = scanResult.pluginResult.universalIDResult;

[self addResultsAtIndex:IDResult.resultEntryList.mutableCopy];

NSArray *pdf417ResultsList = self.barcodeResult.resultEntryList;
if (pdf417ResultsList.count > 0) {
[self addResultsAtIndex:pdf417ResultsList.mutableCopy];
}


[self addResultsAtIndex:scanResult.pluginResult.fieldList.resultEntries.mutableCopy];

if (scanResult.faceImage && !self.faceImage) { // save only the first face image that is scanned
// front side will have a first chance to do so, then the back side.
// so if both sides have photos, the front pic will be used.
Expand All @@ -568,7 +561,9 @@ - (void)scanPlugin:(ALScanPlugin *)scanPlugin resultReceived:(ALScanResult *)sca
}];
});
} else {


ALUniversalIDResult *IDResult = scanResult.pluginResult.universalIDResult;

// if it was barcode, wait for ID before returning
[self stopTroubleScanningTimeout];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
"feedbackStrokeColor": "0099FF"
},
"scanFeedbackConfig" : {
"style": "CONTOUR_RECT",
"style": "contour_rect",
"visualFeedbackRedrawTimeout": 100,
"strokeColor": "0099FF",
"fillColor" : "220099FF",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,53 +34,35 @@ - (void)viewDidLoad {
} else if ([self.title isEqualToString:@"African License Plate"] || [self.title isEqualToString:@"AF License Plate"]) {
licensePlateConfigJSONFile = kLicensePlateScanVC_configAF;
}

id JSONConfigObj = [[self configJSONStrWithFilename:licensePlateConfigJSONFile] asJSONObject];


NSError *error;
self.scanViewPlugin = [ALScanViewPluginFactory withJSONDictionary:JSONConfigObj error:&error];

if ([self popWithAlertOnError:error]) {
return;
}

self.scanViewConfig = [[ALScanViewConfig alloc] initWithJSONDictionary:JSONConfigObj error:nil];

self.scanView = [[ALScanView alloc] initWithFrame:CGRectZero
scanViewPlugin:self.scanViewPlugin
scanViewConfig:self.scanViewConfig
error:&error];

NSString *path = [[NSBundle mainBundle] pathForResource:licensePlateConfigJSONFile ofType:@"json"];
self.scanView = [ALScanViewFactory withConfigFilePath:path delegate:self error:&error];
if ([self popWithAlertOnError:error]) {
return;
}

[self installScanView:self.scanView];

ALScanViewPlugin *scanViewPlugin = self.scanViewPlugin;

scanViewPlugin.scanPlugin.delegate = self;

[self.scanView startCamera];


self.scanViewPlugin = (ALScanViewPlugin *)self.scanView.scanViewPlugin;

self.controllerType = ALScanHistoryLicensePlates;
}

- (void)viewDidAppear:(BOOL)animated {
[super viewDidAppear:animated];
// We use this subroutine to start Anyline. The reason it has its own subroutine is
// so that we can later use it to restart the scanning process.
[self.scanViewPlugin startWithError:nil];
NSError *error;
[self.scanViewPlugin startWithError:&error];
}


// MARK: - Handle & present results

- (void)scanPlugin:(ALScanPlugin *)scanPlugin resultReceived:(ALScanResult *)scanResult {
[self enableLandscapeOrientation:NO];
ALLicensePlateResult *result = scanResult.pluginResult.licensePlateResult;

NSArray <ALResultEntry *> *resultData = result.resultEntryList;
NSArray <ALResultEntry *> *resultData = scanResult.pluginResult.fieldList.resultEntries;
NSString *resultString = [ALResultEntry JSONStringFromList:resultData];
UIImage *image = scanResult.croppedImage;

Expand Down
Loading

0 comments on commit aaf4d4f

Please sign in to comment.