-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
85ac201
commit 364276f
Showing
498 changed files
with
3,733 additions
and
3,667 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 0 additions & 7 deletions
7
...Examples/Anyline Examples Source/Container/ViewController/ALContainerScanViewController.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
...amples Source/Processes/Composite Scanning/ViewController/ALCompositeScanViewController.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#import <UIKit/UIKit.h> | ||
#import "ALBaseScanViewController.h" | ||
|
||
NS_ASSUME_NONNULL_BEGIN | ||
|
||
@interface ALCompositeScanViewController : ALBaseScanViewController | ||
|
||
@end | ||
|
||
NS_ASSUME_NONNULL_END |
94 changes: 94 additions & 0 deletions
94
...amples Source/Processes/Composite Scanning/ViewController/ALCompositeScanViewController.m
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
#import "ALCompositeScanViewController.h" | ||
#import <Anyline/Anyline.h> | ||
#import "AnylineExamples-Swift.h" | ||
|
||
NSString * const kCompositeVC_configJSONFilename = @"parallel_first_vin_barcode"; | ||
|
||
@interface ALCompositeScanViewController () <ALViewPluginCompositeDelegate> | ||
|
||
@property (nonatomic, strong) id<ALScanViewPluginBase> scanViewPlugin; | ||
|
||
@end | ||
|
||
@implementation ALCompositeScanViewController | ||
|
||
- (void)viewDidLoad { | ||
[super viewDidLoad]; | ||
self.title = @"First of VIN + Barcode"; | ||
self.controllerType = ALScanHistoryVIN; | ||
[self reloadScanView]; | ||
} | ||
|
||
- (void)viewWillAppear:(BOOL)animated { | ||
[super viewWillAppear:animated]; | ||
[self.scanViewPlugin startWithError:nil]; | ||
} | ||
|
||
- (void)viewWillDisappear:(BOOL)animated { | ||
[super viewWillDisappear:animated]; | ||
[self.scanViewPlugin stop]; | ||
} | ||
|
||
- (void)reloadScanView { | ||
NSDictionary *configJSONDictionary = [[self configJSONStrWithFilename:kCompositeVC_configJSONFilename] asJSONObject]; | ||
|
||
NSError *error; | ||
ALViewPluginComposite *composite = [[ALViewPluginComposite alloc] initWithJSONDictionary:configJSONDictionary error:&error]; | ||
|
||
if ([self popWithAlertOnError:error]) { | ||
return; | ||
} | ||
|
||
composite.delegate = self; | ||
|
||
[self.scanView stopCamera]; | ||
if (self.scanView) { | ||
[self.scanView removeFromSuperview]; | ||
} | ||
|
||
self.scanViewPlugin = composite; | ||
|
||
ALScanViewConfig *scanViewConfig = [ALScanViewConfig withJSONDictionary:configJSONDictionary]; | ||
self.scanView = [[ALScanView alloc] initWithFrame:CGRectZero | ||
scanViewPlugin:composite | ||
scanViewConfig:scanViewConfig | ||
error:&error]; | ||
|
||
if ([self popWithAlertOnError:error]) { | ||
return; | ||
} | ||
|
||
[self installScanView:self.scanView]; // call startCamera and start the plugin outside | ||
// we've just readded the ScanView, make sure it goes beneath the other views. | ||
[self.view sendSubviewToBack:self.scanView]; | ||
[self.scanView startCamera]; | ||
} | ||
|
||
// MARK: - ALViewPluginCompositeDelegate | ||
|
||
- (void)viewPluginComposite:(ALViewPluginComposite *)viewPluginComposite allResultsReceived:(NSArray<ALScanResult *> *)scanResults { | ||
// there will be only one result - this is the way the plugin is configured | ||
ALScanResult *scanResult = scanResults[0]; | ||
|
||
// Locate plugin using the pluginID | ||
ALScanViewPlugin *scanViewPlugin = (ALScanViewPlugin *)[viewPluginComposite pluginWithID:scanResult.pluginID]; | ||
ALScanPlugin *scanPlugin = scanViewPlugin.scanPlugin; | ||
|
||
NSArray<ALResultEntry *> *resultData = scanResult.pluginResult.fieldList.resultEntries; | ||
NSString *resultDataJSONStr = [ALResultEntry JSONStringFromList:resultData]; | ||
__weak ALCompositeScanViewController *weakSelf = self; | ||
[self anylineDidFindResult:resultDataJSONStr | ||
barcodeResult:@"" // not using this, even though it's for a barcode + VIN | ||
image:scanResult.croppedImage | ||
scanPlugin:scanPlugin | ||
viewPlugin:self.scanViewPlugin | ||
completion:^{ | ||
ALResultViewController *vc = [[ALResultViewController alloc] | ||
initWithResults:resultData]; | ||
vc.imagePrimary = scanResult.croppedImage; | ||
|
||
[weakSelf.navigationController pushViewController:vc animated:YES]; | ||
}]; | ||
} | ||
|
||
@end |
67 changes: 67 additions & 0 deletions
67
...ples/Anyline Examples Source/Processes/Composite Scanning/parallel_first_vin_barcode.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
{ | ||
"cameraConfig": { | ||
"pictureResolution": "1080p" | ||
}, | ||
"flashConfig": { | ||
"mode": "manual_off", | ||
"alignment": "top_left" | ||
}, | ||
"viewPluginCompositeConfig": { | ||
"id": "parallel_first_vin_barcode", | ||
"processingMode": "parallelFirstScan", | ||
"viewPlugins": [ | ||
{ | ||
"viewPluginConfig": { | ||
"pluginConfig": { | ||
"id": "barcode", | ||
"barcodeConfig": { | ||
"barcodeFormats": [ "ALL" ] | ||
} | ||
}, | ||
"scanFeedbackConfig": { | ||
"style": "rect", | ||
"strokeWidth": 2, | ||
"strokeColor": "0099FF", | ||
"fillColor": "330099FF", | ||
"cornerRadius": 0, | ||
"beepOnResult": false, | ||
"vibrateOnResult": false, | ||
"blinkAnimationOnResult": true | ||
} | ||
} | ||
}, | ||
{ | ||
"viewPluginConfig": { | ||
"pluginConfig": { | ||
"id": "vin", | ||
"vinConfig": {} | ||
}, | ||
"cutoutConfig": { | ||
"style": "rect", | ||
"maxWidthPercent": "85%", | ||
"alignment": "top_half", | ||
"ratioFromSize": { "width": 62, "height": 9 }, | ||
"offset": { "x": 0, "y": 0 }, | ||
"outerColor": "000000", | ||
"outerAlpha": 0, | ||
"strokeWidth": 2, | ||
"strokeColor": "0099FF", | ||
"cornerRadius": 4, | ||
"feedbackStrokeColor": "0099FF" | ||
}, | ||
"scanFeedbackConfig": { | ||
"style": "contour_rect", | ||
"animation": "traverse_multi", | ||
"animationDuration": 250, | ||
"strokeWidth": 2, | ||
"strokeColor": "0099FF", | ||
"fillColor": "220099FF", | ||
"beepOnResult": false, | ||
"vibrateOnResult": false, | ||
"blinkAnimationOnResult": true | ||
} | ||
} | ||
} | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.