diff --git a/DUREX Vendor Control/BT Vendor.xcodeproj/project.pbxproj b/DUREX Vendor Control/BT Vendor.xcodeproj/project.pbxproj index 4d086f9..2efaecb 100644 --- a/DUREX Vendor Control/BT Vendor.xcodeproj/project.pbxproj +++ b/DUREX Vendor Control/BT Vendor.xcodeproj/project.pbxproj @@ -12,7 +12,7 @@ 3471866518070D9300FA0FB2 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3471866418070D9300FA0FB2 /* UIKit.framework */; }; 347186A618070E7200FA0FB2 /* libEMFramework.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 347186A518070E7200FA0FB2 /* libEMFramework.a */; }; 347186AC18070FAB00FA0FB2 /* CoreBluetooth.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 347186AB18070FAB00FA0FB2 /* CoreBluetooth.framework */; }; - 34AAB883189804FF0019860D /* DUREXAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 34AAB877189804FF0019860D /* DUREXAppDelegate.m */; }; + 34AAB883189804FF0019860D /* BTAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 34AAB877189804FF0019860D /* BTAppDelegate.m */; }; 34AAB885189804FF0019860D /* EMDevicePickerViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 34AAB87A189804FF0019860D /* EMDevicePickerViewController.m */; }; 34AAB889189804FF0019860D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 34AAB880189804FF0019860D /* main.m */; }; 34AAB88D189805300019860D /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 34AAB88C189805300019860D /* Images.xcassets */; }; @@ -84,8 +84,8 @@ 347186A318070E6500FA0FB2 /* EMTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EMTypes.h; sourceTree = ""; }; 347186A518070E7200FA0FB2 /* libEMFramework.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libEMFramework.a; path = EmmocoMobileFramework/Framework/libEMFramework.a; sourceTree = SOURCE_ROOT; }; 347186AB18070FAB00FA0FB2 /* CoreBluetooth.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreBluetooth.framework; path = System/Library/Frameworks/CoreBluetooth.framework; sourceTree = SDKROOT; }; - 34AAB876189804FF0019860D /* DUREXAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DUREXAppDelegate.h; path = FirstAppExample/DUREXAppDelegate.h; sourceTree = SOURCE_ROOT; }; - 34AAB877189804FF0019860D /* DUREXAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = DUREXAppDelegate.m; path = FirstAppExample/DUREXAppDelegate.m; sourceTree = SOURCE_ROOT; }; + 34AAB876189804FF0019860D /* BTAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BTAppDelegate.h; path = FirstAppExample/BTAppDelegate.h; sourceTree = SOURCE_ROOT; }; + 34AAB877189804FF0019860D /* BTAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = BTAppDelegate.m; path = FirstAppExample/BTAppDelegate.m; sourceTree = SOURCE_ROOT; }; 34AAB879189804FF0019860D /* EMDevicePickerViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = EMDevicePickerViewController.h; path = FirstAppExample/EMDevicePickerViewController.h; sourceTree = SOURCE_ROOT; }; 34AAB87A189804FF0019860D /* EMDevicePickerViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = EMDevicePickerViewController.m; path = FirstAppExample/EMDevicePickerViewController.m; sourceTree = SOURCE_ROOT; }; 34AAB87E189804FF0019860D /* BT Vendor-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = "BT Vendor-Info.plist"; path = "FirstAppExample/BT Vendor-Info.plist"; sourceTree = SOURCE_ROOT; }; @@ -218,7 +218,7 @@ 3471865418070D9300FA0FB2 = { isa = PBXGroup; children = ( - 3471866618070D9300FA0FB2 /* DUREX Vendor Control */, + 3471866618070D9300FA0FB2 /* BT Vendor */, 3471865F18070D9300FA0FB2 /* Frameworks */, 3471865E18070D9300FA0FB2 /* Products */, ); @@ -244,7 +244,7 @@ name = Frameworks; sourceTree = ""; }; - 3471866618070D9300FA0FB2 /* DUREX Vendor Control */ = { + 3471866618070D9300FA0FB2 /* BT Vendor */ = { isa = PBXGroup; children = ( F9CED59719BE0863008F3764 /* Toast View */, @@ -254,7 +254,7 @@ 3471866718070D9300FA0FB2 /* Supporting Files */, F9ED745419B89E4600C7298D /* Views */, F9ED745519B89E7700C7298D /* Headers */, - 34AAB877189804FF0019860D /* DUREXAppDelegate.m */, + 34AAB877189804FF0019860D /* BTAppDelegate.m */, F98356D5192E835F00EA6821 /* InitialViewController.m */, F98356E0192EC84700EA6821 /* MenuTableViewController.m */, F9A8EF7B192FE201009E7532 /* Stack.m */, @@ -271,7 +271,7 @@ F9B9100819E59773006D4D06 /* IncidentLog.m */, F95C3F2A19E87B8700C040C0 /* ChildViewController.m */, ); - name = "DUREX Vendor Control"; + name = "BT Vendor"; path = TestAppExample; sourceTree = ""; }; @@ -374,7 +374,7 @@ F9ED745519B89E7700C7298D /* Headers */ = { isa = PBXGroup; children = ( - 34AAB876189804FF0019860D /* DUREXAppDelegate.h */, + 34AAB876189804FF0019860D /* BTAppDelegate.h */, F98356D4192E835F00EA6821 /* InitialViewController.h */, F98356DF192EC84700EA6821 /* MenuTableViewController.h */, F98356D9192EAFD400EA6821 /* CommunicationProtocol.h */, @@ -514,7 +514,7 @@ F989B60219BCE28C00657DD9 /* SalesLog.m in Sources */, F95C3F2B19E87B8700C040C0 /* ChildViewController.m in Sources */, F92F567919B75F5E00A1EACA /* PriceChangerViewController.m in Sources */, - 34AAB883189804FF0019860D /* DUREXAppDelegate.m in Sources */, + 34AAB883189804FF0019860D /* BTAppDelegate.m in Sources */, F98356DB192EAFD400EA6821 /* CommunicationProtocol.m in Sources */, F98356E1192EC84700EA6821 /* MenuTableViewController.m in Sources */, F98446F019B9EAE9005C4992 /* Sensors.m in Sources */, diff --git a/DUREX Vendor Control/BT Vendor.xcodeproj/project.xcworkspace/xcuserdata/imanol.xcuserdatad/UserInterfaceState.xcuserstate b/DUREX Vendor Control/BT Vendor.xcodeproj/project.xcworkspace/xcuserdata/imanol.xcuserdatad/UserInterfaceState.xcuserstate index 1dd9a0e..58ca187 100644 --- a/DUREX Vendor Control/BT Vendor.xcodeproj/project.xcworkspace/xcuserdata/imanol.xcuserdatad/UserInterfaceState.xcuserstate +++ b/DUREX Vendor Control/BT Vendor.xcodeproj/project.xcworkspace/xcuserdata/imanol.xcuserdatad/UserInterfaceState.xcuserstate diff --git a/DUREX Vendor Control/BT Vendor.xcodeproj/xcuserdata/imanol.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/DUREX Vendor Control/BT Vendor.xcodeproj/xcuserdata/imanol.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist index f1c23a0..5845103 100644 --- a/DUREX Vendor Control/BT Vendor.xcodeproj/xcuserdata/imanol.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist +++ b/DUREX Vendor Control/BT Vendor.xcodeproj/xcuserdata/imanol.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -26,11 +26,11 @@ ignoreCount = "0" continueAfterRunningActions = "No" filePath = "MenuTableViewController.m" - timestampString = "435859231.211213" + timestampString = "436467072.187571" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" - startingLineNumber = "928" - endingLineNumber = "928" + startingLineNumber = "1038" + endingLineNumber = "1038" landmarkName = "-tableView:didSelectRowAtIndexPath:" landmarkType = "5"> @@ -42,11 +42,11 @@ ignoreCount = "0" continueAfterRunningActions = "No" filePath = "MenuTableViewController.m" - timestampString = "435859231.211213" + timestampString = "436467072.187571" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" - startingLineNumber = "830" - endingLineNumber = "830" + startingLineNumber = "940" + endingLineNumber = "940" landmarkName = "-tableView:didSelectRowAtIndexPath:" landmarkType = "5"> @@ -58,11 +58,11 @@ ignoreCount = "0" continueAfterRunningActions = "No" filePath = "MenuTableViewController.m" - timestampString = "435854984.608419" + timestampString = "436467072.187571" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" - startingLineNumber = "623" - endingLineNumber = "623" + startingLineNumber = "733" + endingLineNumber = "733" landmarkName = "-toggleDropList:" landmarkType = "5"> @@ -186,11 +186,11 @@ ignoreCount = "0" continueAfterRunningActions = "No" filePath = "MenuTableViewController.m" - timestampString = "435859231.211213" + timestampString = "436467072.187571" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" - startingLineNumber = "1033" - endingLineNumber = "1033" + startingLineNumber = "1143" + endingLineNumber = "1143" landmarkName = "-tableView:didSelectRowAtIndexPath:" landmarkType = "5"> @@ -202,11 +202,11 @@ ignoreCount = "0" continueAfterRunningActions = "No" filePath = "MenuTableViewController.m" - timestampString = "435854984.608419" + timestampString = "436465076.64059" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" - startingLineNumber = "212" - endingLineNumber = "212" + startingLineNumber = "214" + endingLineNumber = "214" landmarkName = "-generateIncidentListNavLevel" landmarkType = "5"> @@ -218,12 +218,12 @@ ignoreCount = "0" continueAfterRunningActions = "No" filePath = "MenuTableViewController.m" - timestampString = "435854984.608419" + timestampString = "436467072.187571" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" - startingLineNumber = "749" - endingLineNumber = "749" - landmarkName = "-tableView:numberOfRowsInSection:" + startingLineNumber = "859" + endingLineNumber = "859" + landmarkName = "-tableView:titleForHeaderInSection:" landmarkType = "5"> @@ -234,11 +234,11 @@ ignoreCount = "0" continueAfterRunningActions = "No" filePath = "MenuTableViewController.m" - timestampString = "435859231.211213" + timestampString = "436467072.187571" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" - startingLineNumber = "835" - endingLineNumber = "835" + startingLineNumber = "945" + endingLineNumber = "945" landmarkName = "-tableView:didSelectRowAtIndexPath:" landmarkType = "5"> @@ -250,11 +250,11 @@ ignoreCount = "0" continueAfterRunningActions = "No" filePath = "MenuTableViewController.m" - timestampString = "435859231.211213" + timestampString = "436467072.187571" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" - startingLineNumber = "1122" - endingLineNumber = "1122" + startingLineNumber = "1232" + endingLineNumber = "1232" landmarkName = "-numberOfSectionsInTableView:" landmarkType = "5"> @@ -266,13 +266,13 @@ ignoreCount = "0" continueAfterRunningActions = "No" filePath = "MenuTableViewController.m" - timestampString = "435859231.211213" + timestampString = "436467072.187571" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" - startingLineNumber = "1123" - endingLineNumber = "1123" - landmarkName = "@implementation MenuTableViewController" - landmarkType = "3"> + startingLineNumber = "1233" + endingLineNumber = "1233" + landmarkName = "-numberOfSectionsInTableView:" + landmarkType = "5"> @@ -314,12 +314,12 @@ ignoreCount = "0" continueAfterRunningActions = "No" filePath = "MenuTableViewController.m" - timestampString = "435854984.608419" + timestampString = "436467072.187571" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" - startingLineNumber = "553" - endingLineNumber = "553" - landmarkName = "-willRotateToInterfaceOrientation:duration:" + startingLineNumber = "663" + endingLineNumber = "663" + landmarkName = "-didRotateFromInterfaceOrientation:" landmarkType = "5"> @@ -330,11 +330,11 @@ ignoreCount = "0" continueAfterRunningActions = "No" filePath = "MenuTableViewController.m" - timestampString = "435859231.211213" + timestampString = "436467072.187571" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" - startingLineNumber = "1327" - endingLineNumber = "1327" + startingLineNumber = "1437" + endingLineNumber = "1437" landmarkName = "-tableView:cellForRowAtIndexPath:" landmarkType = "5"> @@ -346,11 +346,11 @@ ignoreCount = "0" continueAfterRunningActions = "No" filePath = "MenuTableViewController.m" - timestampString = "435859231.211213" + timestampString = "436467072.187571" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" - startingLineNumber = "1319" - endingLineNumber = "1319" + startingLineNumber = "1429" + endingLineNumber = "1429" landmarkName = "-tableView:cellForRowAtIndexPath:" landmarkType = "5"> @@ -362,11 +362,11 @@ ignoreCount = "0" continueAfterRunningActions = "No" filePath = "MenuTableViewController.m" - timestampString = "435859231.211213" + timestampString = "436467072.187571" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" - startingLineNumber = "1114" - endingLineNumber = "1114" + startingLineNumber = "1224" + endingLineNumber = "1224" landmarkName = "-tableView:indentationLevelForRowAtIndexPath:" landmarkType = "5"> @@ -378,11 +378,11 @@ ignoreCount = "0" continueAfterRunningActions = "No" filePath = "MenuTableViewController.m" - timestampString = "435859231.211213" + timestampString = "436467072.187571" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" - startingLineNumber = "1112" - endingLineNumber = "1112" + startingLineNumber = "1222" + endingLineNumber = "1222" landmarkName = "-tableView:indentationLevelForRowAtIndexPath:" landmarkType = "5"> @@ -458,11 +458,11 @@ ignoreCount = "0" continueAfterRunningActions = "No" filePath = "MenuTableViewController.m" - timestampString = "435859231.211213" + timestampString = "436467072.187571" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" - startingLineNumber = "1443" - endingLineNumber = "1443" + startingLineNumber = "1553" + endingLineNumber = "1553" landmarkName = "-tableView:cellForRowAtIndexPath:" landmarkType = "5"> @@ -474,11 +474,11 @@ ignoreCount = "0" continueAfterRunningActions = "No" filePath = "MenuTableViewController.m" - timestampString = "435859231.211213" + timestampString = "436467072.187571" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" - startingLineNumber = "1428" - endingLineNumber = "1428" + startingLineNumber = "1538" + endingLineNumber = "1538" landmarkName = "-tableView:cellForRowAtIndexPath:" landmarkType = "5"> @@ -536,11 +536,11 @@ ignoreCount = "0" continueAfterRunningActions = "No" filePath = "MenuTableViewController.m" - timestampString = "435854984.608419" + timestampString = "436467072.187571" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" - startingLineNumber = "522" - endingLineNumber = "522" + startingLineNumber = "625" + endingLineNumber = "625" landmarkName = "-viewDidLoad" landmarkType = "5"> @@ -552,11 +552,11 @@ ignoreCount = "0" continueAfterRunningActions = "No" filePath = "MenuTableViewController.m" - timestampString = "435854984.608419" + timestampString = "436465076.64059" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" - startingLineNumber = "158" - endingLineNumber = "158" + startingLineNumber = "160" + endingLineNumber = "160" landmarkName = "-generateSaleListNavLevel" landmarkType = "5"> @@ -568,11 +568,11 @@ ignoreCount = "0" continueAfterRunningActions = "No" filePath = "MenuTableViewController.m" - timestampString = "435854984.608419" + timestampString = "436465076.64059" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" - startingLineNumber = "137" - endingLineNumber = "137" + startingLineNumber = "139" + endingLineNumber = "139" landmarkName = "-generateSaleListNavLevel" landmarkType = "5"> @@ -600,11 +600,11 @@ ignoreCount = "0" continueAfterRunningActions = "No" filePath = "MenuTableViewController.m" - timestampString = "435859231.211213" + timestampString = "436467072.187571" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" - startingLineNumber = "1100" - endingLineNumber = "1100" + startingLineNumber = "1210" + endingLineNumber = "1210" landmarkName = "-tableView:didSelectRowAtIndexPath:" landmarkType = "5"> @@ -616,11 +616,11 @@ ignoreCount = "0" continueAfterRunningActions = "No" filePath = "MenuTableViewController.m" - timestampString = "435855046.616674" + timestampString = "436467072.187571" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" - startingLineNumber = "780" - endingLineNumber = "780" + startingLineNumber = "890" + endingLineNumber = "890" landmarkName = "-tableView:didSelectRowAtIndexPath:" landmarkType = "5"> @@ -632,11 +632,11 @@ ignoreCount = "0" continueAfterRunningActions = "No" filePath = "MenuTableViewController.m" - timestampString = "435855046.616674" + timestampString = "436467072.187571" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" - startingLineNumber = "779" - endingLineNumber = "779" + startingLineNumber = "889" + endingLineNumber = "889" landmarkName = "-tableView:didSelectRowAtIndexPath:" landmarkType = "5"> @@ -648,11 +648,11 @@ ignoreCount = "0" continueAfterRunningActions = "No" filePath = "MenuTableViewController.m" - timestampString = "435855046.616674" + timestampString = "436467072.187571" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" - startingLineNumber = "768" - endingLineNumber = "768" + startingLineNumber = "878" + endingLineNumber = "878" landmarkName = "-tableView:sectionForSectionIndexTitle:atIndex:" landmarkType = "5"> @@ -721,5 +721,69 @@ landmarkType = "5"> + + + + + + + + + + + + + + + + diff --git a/DUREX Vendor Control/Base.lproj/Localizable.strings b/DUREX Vendor Control/Base.lproj/Localizable.strings index 34e23b3..33a1df1 100644 --- a/DUREX Vendor Control/Base.lproj/Localizable.strings +++ b/DUREX Vendor Control/Base.lproj/Localizable.strings @@ -105,4 +105,12 @@ "Device answer timeout occurred" = "Device answer timeout occurred"; "Incident log" = "Incident log"; "Error Code" = "Error Code"; -"Error Value" = "Error Value"; \ No newline at end of file +"Error Value" = "Error Value"; +"Error obtaining data from URL" = "Error obtaining data from URL"; +"Missing fields version and/or commands in JSON file" = "Missing fields version and/or commands in JSON file"; +"Version mismatch" = "Version mismatch"; +"Do you want to run batch command file" = "Do you want to run batch command file"; +"WARNING: Machine ID does not match currently connected machine. Do you wish to continue?" = "WARNING: Machine ID does not match currently connected machine. Do you wish to continue?"; +"Confirmation" = "Confirmation"; +"OK" = "OK"; +"Cancel" = "Cancel"; \ No newline at end of file diff --git a/DUREX Vendor Control/ChildViewController.m b/DUREX Vendor Control/ChildViewController.m index bb14e53..8cd3cb8 100644 --- a/DUREX Vendor Control/ChildViewController.m +++ b/DUREX Vendor Control/ChildViewController.m @@ -46,4 +46,14 @@ } */ +- (void) parentViewControllerDidRotateWithOrientation:(UIDeviceOrientation)orientation +{ + //STUB +} + +- (void) parentViewControllerWillRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration +{ + //STUB +} + @end diff --git a/DUREX Vendor Control/DatePickerViewController.h b/DUREX Vendor Control/DatePickerViewController.h index 903dc56..feaefe6 100644 --- a/DUREX Vendor Control/DatePickerViewController.h +++ b/DUREX Vendor Control/DatePickerViewController.h @@ -10,7 +10,7 @@ #import #import -#import "DUREXAppDelegate.h" +#import "BTAppDelegate.h" @protocol DatePickerViewControllerDelegate - (void)passDateViewController:(DatePickerViewController*)controller didFinishEnteringItem:(NSDate *)date; diff --git a/DUREX Vendor Control/DateRangePickerViewController.h b/DUREX Vendor Control/DateRangePickerViewController.h index 04e384f..909c2be 100644 --- a/DUREX Vendor Control/DateRangePickerViewController.h +++ b/DUREX Vendor Control/DateRangePickerViewController.h @@ -18,7 +18,7 @@ #import #import -#import "DUREXAppDelegate.h" +#import "BTAppDelegate.h" #import "ChildViewController.h" @protocol DateRangePickerViewControllerDelegate diff --git a/DUREX Vendor Control/FirstAppExample/DUREXAppDelegate.h b/DUREX Vendor Control/FirstAppExample/BTAppDelegate.h index dfdd593..13b3d26 100644 --- a/DUREX Vendor Control/FirstAppExample/DUREXAppDelegate.h +++ b/DUREX Vendor Control/FirstAppExample/BTAppDelegate.h @@ -8,10 +8,12 @@ #import -@interface DUREXAppDelegate : UIResponder +@interface BTAppDelegate : UIResponder @property (strong, nonatomic) UIWindow *window; @property (nonatomic, strong) IBOutlet UINavigationController *navController; +@property (strong, nonatomic) NSURL *handledURL; +@property (strong,nonatomic) NSString *currentVersion; diff --git a/DUREX Vendor Control/FirstAppExample/DUREXAppDelegate.m b/DUREX Vendor Control/FirstAppExample/BTAppDelegate.m index f585645..e6bbd3e 100644 --- a/DUREX Vendor Control/FirstAppExample/DUREXAppDelegate.m +++ b/DUREX Vendor Control/FirstAppExample/BTAppDelegate.m @@ -6,18 +6,19 @@ // Copyright (c) 2013 Emmoco. All rights reserved. // -#import "DUREXAppDelegate.h" +#import "BTAppDelegate.h" #import "EMFramework.h" #import "EMDevicePickerViewController.h" +#import "MenuTableViewController.h" -@interface DUREXAppDelegate () +@interface BTAppDelegate () { } @end -@implementation DUREXAppDelegate +@implementation BTAppDelegate - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { @@ -26,6 +27,9 @@ [[self navController] setDelegate:self]; [[EMConnectionListManager sharedManager] startUpdating]; + + self.handledURL = nil; + self.currentVersion = @"1.0.0"; return YES; } @@ -74,4 +78,24 @@ } } +- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url +{ + NSLog(@"[DUREXAppDelegate.m]: Handling URL %@",url); + if ([self.navController.topViewController isKindOfClass:[MenuTableViewController class]]) + { + MenuTableViewController *viewController = (MenuTableViewController*) self.navController.topViewController; + if (url != nil && [url isFileURL]) + { + NSLog(@"[DUREXAppDelegate.m]: Pushing URL to MenuTableViewController..."); + [viewController handleOpenURL:url]; + } + } + else + { + NSLog(@"[DUREXAppDelegate.m]: Storing handled URL..."); + self.handledURL = url; + } + return YES; +} + @end diff --git a/DUREX Vendor Control/FirstAppExample/Images.xcassets/AppIcon.appiconset/120 - App Icon_2x.png b/DUREX Vendor Control/FirstAppExample/Images.xcassets/AppIcon.appiconset/120 - App Icon_2x.png deleted file mode 100644 index 1fdfff8..0000000 --- a/DUREX Vendor Control/FirstAppExample/Images.xcassets/AppIcon.appiconset/120 - App Icon_2x.png +++ /dev/null diff --git a/DUREX Vendor Control/FirstAppExample/Images.xcassets/AppIcon.appiconset/29 - App Icon_2x.png b/DUREX Vendor Control/FirstAppExample/Images.xcassets/AppIcon.appiconset/29 - App Icon_2x.png index 1507a46..b21e3ee 100644 --- a/DUREX Vendor Control/FirstAppExample/Images.xcassets/AppIcon.appiconset/29 - App Icon_2x.png +++ b/DUREX Vendor Control/FirstAppExample/Images.xcassets/AppIcon.appiconset/29 - App Icon_2x.png diff --git a/DUREX Vendor Control/FirstAppExample/Images.xcassets/AppIcon.appiconset/40 - App Icon_2x.png b/DUREX Vendor Control/FirstAppExample/Images.xcassets/AppIcon.appiconset/40 - App Icon_2x.png index a8161e3..afa08ea 100644 --- a/DUREX Vendor Control/FirstAppExample/Images.xcassets/AppIcon.appiconset/40 - App Icon_2x.png +++ b/DUREX Vendor Control/FirstAppExample/Images.xcassets/AppIcon.appiconset/40 - App Icon_2x.png diff --git a/DUREX Vendor Control/FirstAppExample/Images.xcassets/AppIcon.appiconset/60 - App Icon_2x.png b/DUREX Vendor Control/FirstAppExample/Images.xcassets/AppIcon.appiconset/60 - App Icon_2x.png new file mode 100644 index 0000000..40c2e1d --- /dev/null +++ b/DUREX Vendor Control/FirstAppExample/Images.xcassets/AppIcon.appiconset/60 - App Icon_2x.png diff --git a/DUREX Vendor Control/FirstAppExample/Images.xcassets/AppIcon.appiconset/76 - App Icon_1x.png b/DUREX Vendor Control/FirstAppExample/Images.xcassets/AppIcon.appiconset/76 - App Icon_1x.png index 8e30fa0..3185ed8 100644 --- a/DUREX Vendor Control/FirstAppExample/Images.xcassets/AppIcon.appiconset/76 - App Icon_1x.png +++ b/DUREX Vendor Control/FirstAppExample/Images.xcassets/AppIcon.appiconset/76 - App Icon_1x.png diff --git a/DUREX Vendor Control/FirstAppExample/Images.xcassets/AppIcon.appiconset/76 - App Icon_2x.png b/DUREX Vendor Control/FirstAppExample/Images.xcassets/AppIcon.appiconset/76 - App Icon_2x.png index f6fdbe3..162af87 100644 --- a/DUREX Vendor Control/FirstAppExample/Images.xcassets/AppIcon.appiconset/76 - App Icon_2x.png +++ b/DUREX Vendor Control/FirstAppExample/Images.xcassets/AppIcon.appiconset/76 - App Icon_2x.png diff --git a/DUREX Vendor Control/FirstAppExample/Images.xcassets/AppIcon.appiconset/Contents.json b/DUREX Vendor Control/FirstAppExample/Images.xcassets/AppIcon.appiconset/Contents.json index cf0124f..406ab94 100644 --- a/DUREX Vendor Control/FirstAppExample/Images.xcassets/AppIcon.appiconset/Contents.json +++ b/DUREX Vendor Control/FirstAppExample/Images.xcassets/AppIcon.appiconset/Contents.json @@ -30,7 +30,7 @@ { "size" : "60x60", "idiom" : "iphone", - "filename" : "120 - App Icon_2x.png", + "filename" : "60 - App Icon_2x.png", "scale" : "2x" }, { diff --git a/DUREX Vendor Control/FirstAppExample/main.m b/DUREX Vendor Control/FirstAppExample/main.m index 12cf982..15aca4e 100644 --- a/DUREX Vendor Control/FirstAppExample/main.m +++ b/DUREX Vendor Control/FirstAppExample/main.m @@ -8,11 +8,11 @@ #import -#import "DUREXAppDelegate.h" +#import "BTAppDelegate.h" int main(int argc, char * argv[]) { @autoreleasepool { - return UIApplicationMain(argc, argv, nil, NSStringFromClass([DUREXAppDelegate class])); + return UIApplicationMain(argc, argv, nil, NSStringFromClass([BTAppDelegate class])); } } diff --git a/DUREX Vendor Control/MenuTableViewController.h b/DUREX Vendor Control/MenuTableViewController.h index 3ad65df..20d9b64 100644 --- a/DUREX Vendor Control/MenuTableViewController.h +++ b/DUREX Vendor Control/MenuTableViewController.h @@ -22,6 +22,8 @@ #define num(x) [NSNumber numberWithUnsignedInt:x] +#define BATCH_ALERT_TAG 200 + #define CELL_CARAT_TAG 100 #define MENU_ELEMENTS @"[1000]Maintenance",@"[1001]Basic Configuration",@"[1002]Sending a Report" @@ -73,6 +75,7 @@ enum { A6, A7, //A9, + BATCH_COMMANDS, INVALID_COMMAND, NONE, } commandTypes; @@ -82,8 +85,9 @@ enum { INCIDENT_LOG, } logType; -@interface MenuTableViewController : UITableViewController +@interface MenuTableViewController : UITableViewController - (void) navBack; +- (void) handleOpenURL: (NSURL*) url; @end diff --git a/DUREX Vendor Control/MenuTableViewController.m b/DUREX Vendor Control/MenuTableViewController.m index 8233a58..8b0f327 100644 --- a/DUREX Vendor Control/MenuTableViewController.m +++ b/DUREX Vendor Control/MenuTableViewController.m @@ -48,8 +48,10 @@ //GENERAL ATTRIBUTES @property (nonatomic,strong) CommunicationProtocol* protocol; @property (strong,nonatomic) NSString *machineMACAddr; +@property (strong,nonatomic) BTAppDelegate *appDelegate; @property (strong,nonatomic) Stack *parentLayout; @property (strong,nonatomic) NSTimer *timeoutTimer; +@property (strong,nonatomic) NSMutableArray *batchCommands; @property (strong,nonatomic) Sensors *sensorStatus; @property (strong,nonatomic) SalesLog *salesLog; @@ -459,6 +461,17 @@ [self.view makeToast:NSLocalizedString(@"Product name change returned error", nil) duration:3 position:[NSValue valueWithCGPoint:CGPointMake(self.view.frame.size.width/2,self.view.frame.size.height/2)] title:NSLocalizedString(@"Error", nil) image:[UIImage imageNamed:@"icon_delete"]]; } } + else if(self.sentCommand == BATCH_COMMANDS) + { + if(self.batchCommands.count) + { + [self processBatchCommands]; + } + else + { + self.sentCommand = NONE; + } + } else { NSLog(@"[MenuTableViewController]: Unknown response received. Data discarded."); @@ -488,10 +501,99 @@ } } + +//BATCH COMMAND PROCESSING +- (void) processBatchCommands +{ + NSString *command = [self.batchCommands objectAtIndex:0]; + [self.batchCommands removeObjectAtIndex:0]; + [_protocol writeMessage:command]; + [self setSentCommand:BATCH_COMMANDS]; + [self startTimeoutTimer]; +} + +-(void) alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex +{ + if (alertView.tag == BATCH_ALERT_TAG) + { + if (buttonIndex == 1) + { + [self processBatchCommands]; + } + } +} + +- (void) handleOpenURL:(NSURL *)url +{ + NSData *data = [NSData dataWithContentsOfURL:url]; + NSString *contents = [[NSString alloc] initWithData: data encoding:NSUTF8StringEncoding]; + if(data == nil) + { + NSLog(@"[MenuTableViewController.m]: Error obtaining data from URL"); + [self.view makeToast:NSLocalizedString(@"Error obtaining data from URL", nil) duration:3 position:[NSValue valueWithCGPoint:CGPointMake(self.view.frame.size.width/2,self.view.frame.size.height/2)] title:NSLocalizedString(@"Error", nil) image:[UIImage imageNamed:@"icon_delete"]]; + return; + } + NSLog(@"[MenuTableViewController.m]: Read file contents from handled URL: %@",contents); + NSError *error = nil; + NSDictionary *JSONData = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableContainers error: &error]; + if(!JSONData) + { + NSLog(@"[MenuTableViewController.m]: %@",error); + [self.view makeToast:[error localizedDescription] duration:3 position:[NSValue valueWithCGPoint:CGPointMake(self.view.frame.size.width/2,self.view.frame.size.height/2)] title:NSLocalizedString(@"Error", nil) image:[UIImage imageNamed:@"icon_delete"]]; + return; + } + NSString *version = [JSONData objectForKey:@"version"]; + NSString *name = [JSONData objectForKey:@"name"]; + NSString *machineID = [JSONData objectForKey:@"machineID"]; + NSArray *commands = [JSONData objectForKey:@"commands"]; + NSString *errorString = nil; + UIAlertView *alert; + if(version == nil || commands == nil) + { + errorString = NSLocalizedString(@"Missing fields version and/or commands in JSON file",nil); + } + else if(![version isEqualToString:self.appDelegate.currentVersion]) + { + errorString = NSLocalizedString(@"Version mismatch",nil); + } + else + { + self.batchCommands = [[NSMutableArray alloc] initWithArray:commands]; + if(![machineID isEqualToString:self.machineMACAddr]) + { + alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Confirmation",nil) + message:[NSString stringWithFormat:@"%@ \"%@\"?\n\n",NSLocalizedString(@"Do you want to run batch command file",nil),name,NSLocalizedString(@"WARNING: Machine ID does not match currently connected machine. Do you wish to continue?",nil)] + delegate:self + cancelButtonTitle:NSLocalizedString(@"Cancel",nil) + otherButtonTitles:NSLocalizedString(@"OK",nil), nil]; + } + else + { + alert = [[UIAlertView alloc] initWithTitle: NSLocalizedString(@"Confirmation",nil) + message: [NSString stringWithFormat:@"%@ \"%@\"?",NSLocalizedString(@"Do you want to run batch command file",nil),name] + delegate:self + cancelButtonTitle:NSLocalizedString(@"Cancel",nil) + otherButtonTitles:NSLocalizedString(@"OK",nil), nil]; + } + } + if(errorString != nil) + { + alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Error",nil) + message:[NSString stringWithFormat:@"%@",errorString] + delegate:nil + cancelButtonTitle:NSLocalizedString(@"OK",nil) + otherButtonTitles:nil]; + } + alert.tag = BATCH_ALERT_TAG; + [alert show]; +} + +//UITABLEVIEWCONTROLLER FUNCTIONS - (void)viewDidLoad { [super viewDidLoad]; [_activityIndicator setHidden:YES]; + self.appDelegate = [[UIApplication sharedApplication] delegate]; //Set navigation bar UIImage *backImage = [UIImage imageNamed:@"back_arrow.png"]; @@ -516,12 +618,22 @@ //Set navigation level [self initializeMenuEntries]; + [self setChildViewControllers:[[NSMutableArray alloc]init]]; self.currentNavLevel = 255; + + //Initialize menu view + [_protocol establishConnection]; //[self setSentCommand:HELLO]; //[self startTimeoutTimer]; - [self changeNavLevel:MENU :FALSE]; - [self setChildViewControllers:[[NSMutableArray alloc]init]]; + [self changeNavLevel:MENU :FALSE]; //HACK! + + //Detect handled URL + if(self.appDelegate.handledURL != nil) + { + NSLog(@"[MenuTableViewController.m]: Detected handled URL in appDelegate"); + [self handleOpenURL: self.appDelegate.handledURL]; + } } -(void)didReceiveNotification:(NSNotification*) notification @@ -751,7 +863,7 @@ return [[[self currentStructure] objectAtIndex:section] intValue]; } -- (NSArray *)sectionIndexTitlesForTableView:(UITableView *)tableView +- (const NSArray*)sectionIndexTitlesForTableView:(UITableView *)tableView { if(self.showIndexes) { diff --git a/DUREX Vendor Control/NameChangerViewController.h b/DUREX Vendor Control/NameChangerViewController.h index 0304fd6..0c21f59 100644 --- a/DUREX Vendor Control/NameChangerViewController.h +++ b/DUREX Vendor Control/NameChangerViewController.h @@ -10,7 +10,7 @@ #import #import -#import "DUREXAppDelegate.h" +#import "BTAppDelegate.h" @protocol NameChangerViewControllerDelegate - (void)passNameViewController:(NameChangerViewController*)controller didFinishEnteringItem:(NSArray *)data; diff --git a/DUREX Vendor Control/PriceChangerViewController.h b/DUREX Vendor Control/PriceChangerViewController.h index f60a149..c12d175 100644 --- a/DUREX Vendor Control/PriceChangerViewController.h +++ b/DUREX Vendor Control/PriceChangerViewController.h @@ -10,7 +10,7 @@ #import #import -#import "DUREXAppDelegate.h" +#import "BTAppDelegate.h" @protocol PriceChangerViewControllerDelegate - (void)passPriceViewController:(PriceChangerViewController*)controller didFinishEnteringItem:(NSArray *)data; diff --git a/DUREX Vendor Control/en.lproj/Localizable.strings b/DUREX Vendor Control/en.lproj/Localizable.strings index 9eb4c02..ef9c274 100644 --- a/DUREX Vendor Control/en.lproj/Localizable.strings +++ b/DUREX Vendor Control/en.lproj/Localizable.strings @@ -105,4 +105,12 @@ "Device answer timeout occurred" = "Device answer timeout occurred"; "Incident log" = "Incident log"; "Error Code" = "Error Code"; -"Error Value" = "Error Value"; \ No newline at end of file +"Error Value" = "Error Value"; +"Error obtaining data from URL" = "Error obtaining data from URL"; +"Missing fields version and/or commands in JSON file" = "Missing fields version and/or commands in JSON file"; +"Version mismatch" = "Version mismatch"; +"Do you want to run batch command file" = "Do you want to run batch command file"; +"WARNING: Machine ID does not match currently connected machine. Do you wish to continue?" = "WARNING: Machine ID does not match currently connected machine. Do you wish to continue?"; +"Confirmation" = "Confirmation"; +"OK" = "OK"; +"Cancel" = "Cancel"; \ No newline at end of file diff --git a/DUREX Vendor Control/es.lproj/Localizable.strings b/DUREX Vendor Control/es.lproj/Localizable.strings index 88528b4..a818863 100644 --- a/DUREX Vendor Control/es.lproj/Localizable.strings +++ b/DUREX Vendor Control/es.lproj/Localizable.strings @@ -105,4 +105,12 @@ "Device answer timeout occurred" = "El tiempo de espera de respuesta del dispositivo ha expirado"; "Incident log" = "Registro de incidencias"; "Error Code" = "Código de error"; -"Error Value" = "Valor del error"; \ No newline at end of file +"Error Value" = "Valor del error"; +"Error obtaining data from URL" = "Error al obtener los datos de la URL"; +"Missing fields version and/or commands in JSON file" = "Faltan los campos de versión y/o comandos en el fichero JSON"; +"Version mismatch" = "Versiones no coincidentes"; +"Do you want to run batch command file" = "¿Desea ejecutar el fichero por lotes"; +"WARNING: Machine ID does not match currently connected machine. Do you wish to continue?" = "ADVERTENCIA: El identificador de máquina no coincide con la máquina conectada. ¿Desea continuar?"; +"Confirmation" = "Confirmación"; +"OK" = "OK"; +"Cancel" = "Cancelar"; \ No newline at end of file diff --git a/TODO b/TODO index dd37a30..94fc090 100644 --- a/TODO +++ b/TODO @@ -1,14 +1,10 @@ TESTS: - A3 command +- Batch commands +- Localization BUGS: - On date change, response is overwritten by previous query, trimming needed according to numBytes -- daterangepicker regression on landscape TODO: -- Solve bugs - -OPTIONAL: -- Batch command files, definition, parsing and pushing them to the app -- Month/Year headers on sale list and incident list - +- Refactor code diff --git a/codic.png b/codic.png new file mode 100644 index 0000000..3e6fbee --- /dev/null +++ b/codic.png