Commit e77f2c01 authored by Alex Moore's avatar Alex Moore

Added continuous scanning

parent a5e1b530
No preview for this file type
......@@ -108,13 +108,10 @@
D9CA44201A8988EF002039E1 /* CaptuvoSDKDemo */ = {
isa = PBXGroup;
children = (
D9CA44501A8989C2002039E1 /* Frameworks */,
D9CA444B1A898965002039E1 /* Include */,
D9CA44261A8988EF002039E1 /* AppDelegate.m */,
EF321C8B1A9D19E100567A08 /* CaptuvoViewController.m */,
EF321C8E1A9D1A5600567A08 /* CaptuvoScannerController.m */,
EF321C911A9D1A8500567A08 /* CaptuvoOptionsController.m */,
D9CA444C1A89898D002039E1 /* Main.storyboard */,
D9CA444B1A898965002039E1 /* Include */,
EF6DFC431AC4C5A0003BB149 /* Source */,
D9CA44501A8989C2002039E1 /* Frameworks */,
D9CA442E1A8988EF002039E1 /* Images.xcassets */,
D9CA44301A8988EF002039E1 /* LaunchScreen.xib */,
D9CA44211A8988EF002039E1 /* Supporting Files */,
......@@ -170,6 +167,17 @@
name = Frameworks;
sourceTree = "<group>";
};
EF6DFC431AC4C5A0003BB149 /* Source */ = {
isa = PBXGroup;
children = (
D9CA44261A8988EF002039E1 /* AppDelegate.m */,
EF321C8B1A9D19E100567A08 /* CaptuvoViewController.m */,
EF321C8E1A9D1A5600567A08 /* CaptuvoScannerController.m */,
EF321C911A9D1A8500567A08 /* CaptuvoOptionsController.m */,
);
name = Source;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
......
......@@ -13,4 +13,6 @@
@property (weak, nonatomic) IBOutlet UIStepper *sledSoundStepper;
@property (weak, nonatomic) IBOutlet UILabel *sledSoundLabel;
@end
......@@ -20,7 +20,6 @@ int sled_volume;
[super viewDidLoad];
// Do any additional setup after loading the view.
[[Captuvo sharedCaptuvoDevice] requestDecoderGoodReadBeeperVolumeStatus];
}
- (void)didReceiveMemoryWarning {
......@@ -86,6 +85,7 @@ int sled_volume;
}
}
/*
#pragma mark - Navigation
......
......@@ -11,5 +11,6 @@
@interface CaptuvoScannerController : CaptuvoViewController
@property (weak, nonatomic) IBOutlet UILabel *barcodeLabel;
@property (weak, nonatomic) IBOutlet UISwitch *contScanSwitch;
@end
......@@ -16,8 +16,9 @@
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
[self initDecoder];
// Do any additional setup after loading the view, typically from a nib.
}
......@@ -27,6 +28,23 @@
}
- (void)beginContinuousDecoder
{
[[Captuvo sharedCaptuvoDevice] startDecoderScanning];
NSLog(@"beginContinuousDecoder");
}
- (IBAction)contScanning:(id)sender {
if (self.contScanSwitch.isOn) {
[[Captuvo sharedCaptuvoDevice] startDecoderHardware];
[[Captuvo sharedCaptuvoDevice] startDecoderScanning];
} else {
[[Captuvo sharedCaptuvoDevice] stopDecoderScanning];
[[Captuvo sharedCaptuvoDevice] stopDecoderHardware];
}
}
/**
@brief This method attempts to establish a connection to the Captuvo SL22 Enterprise Sled and start the decoder hardware. A UIAlertView prompts the user if a connection cannot be established. Additionally, this method adds the current class (self) as a CaptuvoDelegate.
......@@ -81,6 +99,8 @@
}
//[[Captuvo sharedCaptuvoDevice] requestBatteryVoltage] ;
//[[Captuvo sharedCaptuvoDevice] requestChargeStatus] ;
[[Captuvo sharedCaptuvoDevice] setDecoderGoodReadDelayInMilliSeconds:2000 persistSetting:YES];
}
......@@ -93,6 +113,7 @@
- (void) decoderDataReceived:(NSString *)data {
self.barcodeLabel.textAlignment = NSTextAlignmentLeft;
self.barcodeLabel.text = data;
[[Captuvo sharedCaptuvoDevice] startDecoderScanning];
}
/*
......
......@@ -11,4 +11,6 @@
@interface CaptuvoViewController : UIViewController<CaptuvoEventsProtocol>
@property bool contScanningEnabled;
@end
This diff is collapsed.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict/>
<dict>
<key>_XCCurrentVersionName</key>
<string>mPOS.xcdatamodel</string>
</dict>
</plist>
......@@ -21,6 +21,14 @@
}
-(void) viewDidAppear:(BOOL)animated {
[super viewDidAppear:animated];
if ([[NSUserDefaults standardUserDefaults] boolForKey:@"switchOnOff"]) {
[[Captuvo sharedCaptuvoDevice] startDecoderScanning];
[[Captuvo sharedCaptuvoDevice] setDecoderGoodReadDelayInMilliSeconds:2000 persistSetting:NO];
}
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
......@@ -61,14 +69,14 @@
}
//[[Captuvo sharedCaptuvoDevice] requestBatteryVoltage] ;
//[[Captuvo sharedCaptuvoDevice] requestChargeStatus] ;
Codabar *codabarOptions = [[Codabar alloc] init];
codabarOptions.enabled = TRUE;
codabarOptions.transmitStatStopChar = FALSE;
codabarOptions.checkCharStatus = CodabarCheckCharNoCheckChar;
codabarOptions.concatenationStatus = CodabarConcatenationOff;
codabarOptions.minMessageLength = 4;
codabarOptions.maxMessageLength = 60;
[[Captuvo sharedCaptuvoDevice] setDecoderCodabarConfiguration:codabarOptions persistSetting:NO];
// Codabar *codabarOptions = [[Codabar alloc] init];
// codabarOptions.enabled = TRUE;
// codabarOptions.transmitStatStopChar = FALSE;
// codabarOptions.checkCharStatus = CodabarCheckCharNoCheckChar;
// codabarOptions.concatenationStatus = CodabarConcatenationOff;
// codabarOptions.minMessageLength = 4;
// codabarOptions.maxMessageLength = 60;
// [[Captuvo sharedCaptuvoDevice] setDecoderCodabarConfiguration:codabarOptions persistSetting:NO];
}
......@@ -80,7 +88,6 @@
@param (NSString *)data - the scanned barcode (in text form)
*/
- (void) decoderDataReceived:(NSString *)data {
//self.txtBookID.textAlignment = NSTextAlignmentLeft;
self.txtBookID.text = data;
}
......
This diff is collapsed.
......@@ -62,18 +62,6 @@ static int BOOK_ID_LENGTH = 14;
#endif
}
-(void) viewDidAppear:(BOOL)animated {
//NSLog(@"viewDidAppear, 2nd view controller");
//GlobalWebController *globalWeb = [GlobalWebController getInstance];
//self.webview = globalWeb.web;
//[self.test_view setDelegate:self];
//self.test_view = globalWeb.web;
//[self.view addSubview:self.webview];
//[self.view addSubview:self.test_view];
//[self.test_view setScalesPageToFit:YES];
}
- (void)webViewDidFinishLoad:(UIWebView *)webView {
[super webViewDidFinishLoad:webView];
#ifdef TESTING
......@@ -307,6 +295,7 @@ static int BOOK_ID_LENGTH = 14;
//UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Invalid Book ID" message:@"Book ID improper length" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
//[alert show];
}
}
//31172001492867
......@@ -317,6 +306,11 @@ static int BOOK_ID_LENGTH = 14;
- (void)decoderDataReceived:(NSString *)data {
[super decoderDataReceived:data];
[self barcodeTextChanged];
if ([[NSUserDefaults standardUserDefaults] boolForKey:@"switchOnOff"]) {
[[Captuvo sharedCaptuvoDevice] startDecoderScanning];
}
}
//- (void)decoderDataReceived:(NSString *)data {
......
......@@ -25,6 +25,8 @@
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
NSUserDefaults *preferences = [NSUserDefaults standardUserDefaults];
[self.switchContScan setOn:[preferences boolForKey:@"switchOnOff"]];
}
......@@ -61,7 +63,10 @@
- (IBAction)switchContScanChange:(id)sender {
_contScan = _switchContScan.on;
//_contScan = _switchContScan.on;
NSUserDefaults *preferences = [NSUserDefaults standardUserDefaults];
[preferences setBool:self.switchContScan.isOn forKey:@"switchOnOff"];
[preferences synchronize];
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment