Commit 13d8c876 authored by Andrew D'Abbraccio's avatar Andrew D'Abbraccio

Continuous scanning tested and working. Also fixed bug where app would crash...

Continuous scanning tested and working.  Also fixed bug where app would crash upon return from settings page to scan page
parent 3efc283d
...@@ -485,7 +485,7 @@ ...@@ -485,7 +485,7 @@
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
buildSettings = { buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
"GCC_PREPROCESSOR_DEFINITIONS_NOT_USED_IN_PRECOMPS[arch=*]" = "TESTING=1"; CODE_SIGN_IDENTITY = "iPhone Developer";
INFOPLIST_FILE = WAMI/Info.plist; INFOPLIST_FILE = WAMI/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
LIBRARY_SEARCH_PATHS = ( LIBRARY_SEARCH_PATHS = (
...@@ -500,6 +500,7 @@ ...@@ -500,6 +500,7 @@
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
buildSettings = { buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_IDENTITY = "iPhone Developer";
INFOPLIST_FILE = WAMI/Info.plist; INFOPLIST_FILE = WAMI/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
LIBRARY_SEARCH_PATHS = ( LIBRARY_SEARCH_PATHS = (
......
...@@ -23,10 +23,6 @@ ...@@ -23,10 +23,6 @@
-(void) viewDidAppear:(BOOL)animated { -(void) viewDidAppear:(BOOL)animated {
[super viewDidAppear:animated]; [super viewDidAppear:animated];
if ([[NSUserDefaults standardUserDefaults] boolForKey:@"switchOnOff"]) {
[[Captuvo sharedCaptuvoDevice] startDecoderScanning];
[[Captuvo sharedCaptuvoDevice] setDecoderGoodReadDelayInMilliSeconds:2000 persistSetting:NO];
}
} }
- (void)didReceiveMemoryWarning { - (void)didReceiveMemoryWarning {
...@@ -78,6 +74,7 @@ ...@@ -78,6 +74,7 @@
// codabarOptions.maxMessageLength = 60; // codabarOptions.maxMessageLength = 60;
// [[Captuvo sharedCaptuvoDevice] setDecoderCodabarConfiguration:codabarOptions persistSetting:NO]; // [[Captuvo sharedCaptuvoDevice] setDecoderCodabarConfiguration:codabarOptions persistSetting:NO];
[[Captuvo sharedCaptuvoDevice] setDecoderGoodReadDelayInMilliSeconds:2000 persistSetting:YES];
} }
......
...@@ -59,11 +59,14 @@ ...@@ -59,11 +59,14 @@
} }
-(void) resetRTI { -(void) resetRTI {
NSLog(@"Reseting RTI");
GlobalWebController *globalWeb = [GlobalWebController resetInstance]; GlobalWebController *globalWeb = [GlobalWebController resetInstance];
self.webview = [[UIWebView alloc] initWithFrame:CGRectMake(0, 0, 0, 0)]; self.webview = [[UIWebView alloc] initWithFrame:CGRectMake(0, 0, 0, 0)];
globalWeb.web = self.webview; globalWeb.web = self.webview;
globalWeb.isInitialized = true; globalWeb.isInitialized = true;
[self.webview setDelegate:self];
#ifndef TESTING #ifndef TESTING
NSLog(@"TESTING not defined");
NSURLRequest *rti = [NSURLRequest requestWithURL:[NSURL URLWithString:@"http://192.168.1.131/rti/"]]; NSURLRequest *rti = [NSURLRequest requestWithURL:[NSURL URLWithString:@"http://192.168.1.131/rti/"]];
[[NSURLCache sharedURLCache] removeCachedResponseForRequest:rti]; [[NSURLCache sharedURLCache] removeCachedResponseForRequest:rti];
//Clean the cookie jar //Clean the cookie jar
...@@ -77,7 +80,7 @@ ...@@ -77,7 +80,7 @@
// Test collection page on mac mini desktop // Test collection page on mac mini desktop
[self.webview loadRequest:[NSURLRequest requestWithURL: [NSURL URLWithString:@"file:///Users/plucseniordesign/Desktop/response.html"]]];//RTISetup.html"]]]; [self.webview loadRequest:[NSURLRequest requestWithURL: [NSURL URLWithString:@"file:///Users/plucseniordesign/Desktop/response.html"]]];//RTISetup.html"]]];
#endif #endif
[self.webview setDelegate:self]; [self.view addSubview:self.webview];
} }
...@@ -138,7 +141,7 @@ ...@@ -138,7 +141,7 @@
NSString *login = [login1 stringByAppendingString:[username stringByAppendingString:[password stringByAppendingString:login2]]]; NSString *login = [login1 stringByAppendingString:[username stringByAppendingString:[password stringByAppendingString:login2]]];
NSLog(@"%@", login); //NSLog(@"%@", login);
NSString *success = NSString *success =
[self.webview stringByEvaluatingJavaScriptFromString:login]; [self.webview stringByEvaluatingJavaScriptFromString:login];
......
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="6254" systemVersion="14C109" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="juL-Mo-vpA"> <document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="6751" systemVersion="13F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="BYZ-38-t0r">
<dependencies> <dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6247"/> <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6736"/>
<capability name="Constraints to layout margins" minToolsVersion="6.0"/> <capability name="Constraints to layout margins" minToolsVersion="6.0"/>
</dependencies> </dependencies>
<scenes> <scenes>
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/> <rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews> <subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Username" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="1dA-Bp-AXg"> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" misplaced="YES" text="Username" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="1dA-Bp-AXg">
<rect key="frame" x="16" y="160" width="79" height="21"/> <rect key="frame" x="16" y="160" width="79" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/> <fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/> <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
......
...@@ -38,6 +38,7 @@ static int BOOK_ID_LENGTH = 14; ...@@ -38,6 +38,7 @@ static int BOOK_ID_LENGTH = 14;
@synthesize imgX; @synthesize imgX;
- (void)viewDidLoad { - (void)viewDidLoad {
NSLog(@"ScanBook did load");
[super viewDidLoad]; [super viewDidLoad];
// Do any additional setup after loading the view. // Do any additional setup after loading the view.
lblSection.text = session.section; lblSection.text = session.section;
...@@ -62,6 +63,32 @@ static int BOOK_ID_LENGTH = 14; ...@@ -62,6 +63,32 @@ static int BOOK_ID_LENGTH = 14;
#endif #endif
} }
-(void)viewDidAppear:(BOOL)animated {
NSLog(@"ScanBook did appear");
self.webview = [GlobalWebController getInstance].web;
[self.webview setDelegate:self];
[self.view addSubview:self.webview];
[super viewDidAppear:animated];
if ([[NSUserDefaults standardUserDefaults] boolForKey:@"switchOnOff"]) {
[[Captuvo sharedCaptuvoDevice] requestDecoderSerialTriggerTimeoutInMilliSecondsStatus];
[[Captuvo sharedCaptuvoDevice] startDecoderScanning];
}
}
-(void)decoderSerialTriggerTimeoutInMilliSecondsStatus:(int)milliseconds {
//NSString *msg = [[NSString alloc] initWithFormat:@"%ul", milliseconds];
//UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Timeout" message:msg delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
//[alert show];
}
-(void)viewWillDisappear:(BOOL)animated {
if ([[NSUserDefaults standardUserDefaults] boolForKey:@"switchOnOff"]) {
[[Captuvo sharedCaptuvoDevice] stopDecoderScanning];
}
}
- (void)webViewDidFinishLoad:(UIWebView *)webView { - (void)webViewDidFinishLoad:(UIWebView *)webView {
[super webViewDidFinishLoad:webView]; [super webViewDidFinishLoad:webView];
#ifdef TESTING #ifdef TESTING
......
...@@ -40,8 +40,9 @@ ...@@ -40,8 +40,9 @@
} }
- (void)viewDidAppear:(BOOL)animated { - (void)viewDidAppear:(BOOL)animated {
NSLog(@"viewDidAppear"); [super viewDidAppear:animated];
[self.view addSubview:self.webview]; //NSLog(@"viewDidAppear");
//[self.view addSubview:self.webview];
} }
- (void)webViewDidFinishLoad:(UIWebView *)webView { - (void)webViewDidFinishLoad:(UIWebView *)webView {
......
...@@ -48,6 +48,10 @@ ...@@ -48,6 +48,10 @@
//NSString *newHtml = [webView stringByEvaluatingJavaScriptFromString:@"test1"]; //NSString *newHtml = [webView stringByEvaluatingJavaScriptFromString:@"test1"];
//NSLog(@"%@\n", newHtml); //NSLog(@"%@\n", newHtml);
NSURLRequest *currentRequest = [webView request];
NSURL *currentURL = [currentRequest URL];
NSLog(@"Current URL is %@", currentURL.absoluteString);
NSString *path = NSString *path =
[[NSBundle mainBundle] pathForResource:@"WhatPage" ofType:@"js"]; [[NSBundle mainBundle] pathForResource:@"WhatPage" ofType:@"js"];
NSString *content = [NSString stringWithContentsOfFile:path NSString *content = [NSString stringWithContentsOfFile:path
......
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