From 8643d47cfd54c483293a31c4d880bdc4cd58d527 Mon Sep 17 00:00:00 2001 From: Imanol-Mikel Barba Sabariego Date: Thu, 7 Aug 2014 19:34:35 +0000 Subject: [PATCH] --- DUREX Vendor Control/DUREX Vendor Control.xcodeproj/project.xcworkspace/xcuserdata/imanol.xcuserdatad/UserInterfaceState.xcuserstate | Bin 58275 -> 0 bytes DUREX Vendor Control/MenuTableViewController.m | 39 ++++++++++++++++++++++++++------------- DUREX Vendor Control/durex.json | 168 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----------------------------------------------------------------------- DUREX tests/CustomNavigationController.h | 16 ---------------- DUREX tests/CustomNavigationController.m | 79 ------------------------------------------------------------------------------- DUREX tests/DUREX test.xcodeproj/project.pbxproj | 6 ------ DUREX tests/DUREX test.xcodeproj/project.xcworkspace/xcuserdata/imanol.xcuserdatad/UserInterfaceState.xcuserstate | Bin 130062 -> 0 bytes DUREX tests/DUREX test.xcodeproj/xcuserdata/imanol.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist | 22 +++------------------- DUREX tests/FirstAppExample/DUREXAppDelegate.h | 3 +-- DUREX tests/FirstAppExample/DUREXAppDelegate.m | 2 +- DUREX tests/FirstAppExample/MainStoryboard.storyboard | 8 ++++---- DUREX tests/MenuTableViewController.m | 41 +++++++++++++++++++++++++++++------------ DUREX tests/durex.json | 168 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----------------------------------------------------------------------- DUREX/Em/DUREX-STUBS.c | 2 +- DUREX/Em/DUREX.c | 4 ++-- DUREX/Em/DUREX.h | 2 +- DUREX/Em/durex.json | 10 +++++----- DUREX/bundle.properties | 2 +- 18 files changed, 268 insertions(+), 304 deletions(-) delete mode 100644 DUREX tests/CustomNavigationController.h delete mode 100644 DUREX tests/CustomNavigationController.m diff --git a/DUREX Vendor Control/DUREX Vendor Control.xcodeproj/project.xcworkspace/xcuserdata/imanol.xcuserdatad/UserInterfaceState.xcuserstate b/DUREX Vendor Control/DUREX Vendor Control.xcodeproj/project.xcworkspace/xcuserdata/imanol.xcuserdatad/UserInterfaceState.xcuserstate index 78612f5..11c668e 100644 Binary files a/DUREX Vendor Control/DUREX Vendor Control.xcodeproj/project.xcworkspace/xcuserdata/imanol.xcuserdatad/UserInterfaceState.xcuserstate and b/DUREX Vendor Control/DUREX Vendor Control.xcodeproj/project.xcworkspace/xcuserdata/imanol.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/DUREX Vendor Control/MenuTableViewController.m b/DUREX Vendor Control/MenuTableViewController.m index d8c348f..b52d885 100644 --- a/DUREX Vendor Control/MenuTableViewController.m +++ b/DUREX Vendor Control/MenuTableViewController.m @@ -73,25 +73,27 @@ - (void) changeNavLevel: (uint8_t) level : (BOOL) push { + NSLog(@"[MenuTableViewController.m]: navLevel is %d",level); if(push) { [[self parentLayout] push: [NSNumber numberWithUnsignedChar:self.currentNavLevel]]; } [self setCurrentNavLevel:level]; [self setCurrentCellIdentifier:[[self cellIdentifiers] objectAtIndex:[self currentNavLevel]]]; - if([self currentNavLevel] == MAINTENANCE) + if([self currentNavLevel] == MENU) + { + [[self navigationItem] setTitle:[[[EMConnectionManager sharedManager] connectedDevice] name]]; + [self setCurrentElements:[self menuElements]]; + [self setCurrentStructure:[self menuStructure]]; + [self setCurrentHeaders:[self menuHeaders]]; + } + else if([self currentNavLevel] == MAINTENANCE) { [self setCurrentElements:[self maintenanceElements]]; [self setCurrentStructure:[self maintenanceStructure]]; [self setCurrentHeaders:[self maintenanceHeaders]]; } //AND SO ON... - else - { - [self setCurrentElements:[self menuElements]]; - [self setCurrentStructure:[self menuStructure]]; - [self setCurrentHeaders:[self menuHeaders]]; - } [[self tableView] reloadData]; NSRange range = NSMakeRange(0, [self numberOfSectionsInTableView:[self tableView]]); NSIndexSet *sections = [NSIndexSet indexSetWithIndexesInRange:range]; @@ -115,16 +117,28 @@ return title; } +- (void) backButtonPressed: (id) sender +{ + NSLog(@"[MenuTableViewController.m]: Navigation Stack has %ld remaining levels",[[self parentLayout] count]); + if([[self parentLayout] count] > 0) + { + NSLog(@"[MenuTableViewController.m]: Falling to previous navigation level"); + [self navBack]; + } + else + { + NSLog(@"[MenuTableViewController.m]: No more navigation levels in stack, falling to previous view"); + [self.navigationController popViewControllerAnimated:YES]; + } +} + - (void)viewDidLoad { [super viewDidLoad]; [_activityIndicator setHidden:YES]; - //Set title - NSMutableString *title; - [title setString:[[self navigationItem] title]] ; - [title appendString:[[[EMConnectionManager sharedManager] connectedDevice] name]]; - [[self navigationItem] setTitle:title]; + self.navigationItem.hidesBackButton = YES; + self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"Back" style:UIBarButtonItemStylePlain target:self action:@selector(backButtonPressed:)]; //Emmoco protocol initialization _protocol = [CommunicationProtocol sharedProtocol]; @@ -234,7 +248,6 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { - NSLog(@"[MenuTableViewController.m]: navLevel is %d",[self currentNavLevel]); UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:[self currentCellIdentifier] forIndexPath:indexPath]; if (cell == nil) diff --git a/DUREX Vendor Control/durex.json b/DUREX Vendor Control/durex.json index 5bd3423..ff2a0ed 100644 --- a/DUREX Vendor Control/durex.json +++ b/DUREX Vendor Control/durex.json @@ -1,13 +1,5 @@ { "resources": { - "$schemaHash": { - "id": -6, - "align": 1, - "attributes": {"readonly": true}, - "type": "A20:u1", - "access": "r", - "size": 20 - }, "$eapProtocolLevel": { "id": -3, "align": 2, @@ -16,22 +8,6 @@ "access": "r", "size": 2 }, - "$mcmProtocolLevel": { - "id": -2, - "align": 2, - "attributes": {"readonly": true}, - "type": "u2", - "access": "r", - "size": 2 - }, - "messageAvailable": { - "id": 4, - "align": 1, - "attributes": {"indicator": true}, - "type": "E:@emmoco.com.DUREX/BOOLEAN", - "access": "irw", - "size": 1 - }, "numBytes": { "id": 1, "align": 1, @@ -40,21 +16,22 @@ "access": "rw", "size": 1 }, - "$mobileRssi": { - "id": -8, - "align": 1, - "attributes": {"readonly": true}, - "type": "i1", - "access": "r", - "size": 1 - }, "data": { "id": 2, "align": 1, "attributes": {}, - "type": "C:229", + "type": "C:201", "access": "rw", - "size": 229 + "size": 201 + }, + "$activeGroup": { + "id": -10, + "align": 1, + "pack": 1, + "attributes": {"readwrite": true}, + "type": "E:system@emmoco.com.System/ParameterGroup", + "access": "rw", + "size": 1 }, "$mcmDisconnect": { "id": -9, @@ -65,6 +42,7 @@ "size": 1 }, "$eapBuildDate": { + "dim": 8, "id": -4, "align": 1, "attributes": {"readonly": true}, @@ -72,6 +50,14 @@ "access": "r", "size": 8 }, + "numPackets": { + "id": 3, + "align": 1, + "attributes": {}, + "type": "u1", + "access": "rw", + "size": 1 + }, "$resourceCount": { "id": -7, "align": 1, @@ -80,12 +66,38 @@ "access": "r", "size": 2 }, - "numPackets": { - "id": 3, + "$schemaHash": { + "dim": 20, + "id": -6, "align": 1, - "attributes": {}, - "type": "u1", - "access": "rw", + "attributes": {"readonly": true}, + "type": "A20:u1", + "access": "r", + "size": 20 + }, + "messageAvailable": { + "id": 4, + "align": 1, + "pack": 1, + "attributes": {"indicator": true}, + "type": "E:@emmoco.com.DUREX/BOOLEAN", + "access": "ir", + "size": 1 + }, + "$mcmProtocolLevel": { + "id": -2, + "align": 2, + "attributes": {"readonly": true}, + "type": "u2", + "access": "r", + "size": 2 + }, + "$mobileRssi": { + "id": -8, + "align": 1, + "attributes": {"readonly": true}, + "type": "i1", + "access": "r", "size": 1 }, "$fileIndexReset": { @@ -98,6 +110,7 @@ } }, "resourceNamesSys": [ + "$activeGroup", "$eapBuildDate", "$eapProtocolLevel", "$fileIndexReset", @@ -108,41 +121,41 @@ "$schemaHash" ], "manifest": { - "protocolLevel": 12, + "protocolLevel": 13, "hash": [ - 245, - 13, - 216, - 92, - 22, - 189, - 34, + 0, + 164, + 192, 32, - 16, - 124, - 194, + 22, + 163, + 114, + 239, + 91, + 240, + 123, + 128, + 206, + 12, 50, - 87, - 152, - 227, - 110 + 148 ], - "toolVersion": "12.0.0.201211010336", + "toolVersion": "13.4.1.201311121909", "name": "DUREX", - "$$md5": "f316f8e8839db2a2939bf3e0120a1fdf", + "$$md5": "00a4c02016a372ef5bf07b80ce0c3294", "build": [ - 61, - 15, - 116, - 250, - 69, + 171, + 30, + 204, + 135, + 71, 1, 0, 0 ], - "date": "2014-05-14T13:18:01T", + "date": "2014-07-30T17:03:27T", "maxAlign": 2, - "maxSize": 229, + "maxSize": 201, "version": "1.0.0" }, "resourceNames": [ @@ -157,14 +170,22 @@ "$schemaHash", "$resourceCount", "$mobileRssi", - "$mcmDisconnect" + "$mcmDisconnect", + "$activeGroup" ], "attributes": { "description": "", "version": "1.0.0" }, + "resourceNamesApp": [ + "numBytes", + "data", + "numPackets", + "messageAvailable" + ], "types": { "system@emmoco.com.System/ResourceCount": { + "packed": false, "align": 1, "type": "S:system@emmoco.com.System/ResourceCount", "size": 2, @@ -193,17 +214,28 @@ "align": 1, "size": 1 }, + "std:u1": { + "align": 1, + "size": 1 + }, "@emmoco.com.DUREX/BOOLEAN": { "values": [ "TRUE", "FALSE" ], "align": 1, + "pack": 1, "type": "E:@emmoco.com.DUREX/BOOLEAN", "size": 1 }, - "std:u1": { + "system@emmoco.com.System/ParameterGroup": { + "values": [ + "GROUP_A", + "GROUP_B" + ], "align": 1, + "pack": 1, + "type": "E:system@emmoco.com.System/ParameterGroup", "size": 1 }, "std:u2": { @@ -211,11 +243,5 @@ "size": 2 } }, - "resourceNamesApp": [ - "data", - "messageAvailable", - "numBytes", - "numPackets" - ], "imports": {"@emmoco.com.DUREX": true} } \ No newline at end of file diff --git a/DUREX tests/CustomNavigationController.h b/DUREX tests/CustomNavigationController.h deleted file mode 100644 index 766914d..0000000 --- a/DUREX tests/CustomNavigationController.h +++ /dev/null @@ -1,16 +0,0 @@ -// -// CustomNavigationController.h -// DUREX test -// -// Created by Imanol Barba on 8/7/14. -// Copyright (c) 2014 Emmoco. All rights reserved. -// - -#import -#import "MenuTableViewController.h" - -@interface CustomNavigationController : UINavigationController - -@property (strong,nonatomic) MenuTableViewController *auxController; - -@end diff --git a/DUREX tests/CustomNavigationController.m b/DUREX tests/CustomNavigationController.m deleted file mode 100644 index b1d7ce9..0000000 --- a/DUREX tests/CustomNavigationController.m +++ /dev/null @@ -1,79 +0,0 @@ -// -// CustomNavigationController.m -// DUREX test -// -// Created by Imanol Barba on 8/7/14. -// Copyright (c) 2014 Emmoco. All rights reserved. -// - -#import "CustomNavigationController.h" - -@interface CustomNavigationController () - -@end - -@implementation CustomNavigationController - -- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil -{ - self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; - if (self) { - // Custom initialization - } - return self; -} - -- (void)viewDidLoad -{ - [super viewDidLoad]; - // Do any additional setup after loading the view. -} - -- (void)didReceiveMemoryWarning -{ - [super didReceiveMemoryWarning]; - // Dispose of any resources that can be recreated. -} - -- (UIViewController *)popViewControllerAnimated:(BOOL)animated -{ - if(self.auxController == nil) - { - NSLog(@"[CustomNavigationController.m]: WARNING: No Auxiliar Controller assigned to Navigation controller"); - return [super popViewControllerAnimated:animated]; - } - else - { - NSLog(@"[CustomNavigationController.m]: Navigation Stack has %d remaining levels",[[[self auxController] parentLayout] count]); - if([[[self auxController] parentLayout] count] > 0) - { - NSLog(@"[CustomNavigationController.m]: Falling to previous navigation level"); - [[self auxController] navBack]; - } - else - { - NSLog(@"[CustomNavigationController.m]: No more navigation levels in stack, falling to previous view"); - self.auxController = nil; - return [super popViewControllerAnimated:animated]; - } - } - return nil; -} - -/*- (void) setAuxController:(MenuTableViewController *)controller -{ - self.auxController = controller; -}*/ - -/* -#pragma mark - Navigation - -// In a storyboard-based application, you will often want to do a little preparation before navigation -- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender -{ - // Get the new view controller using [segue destinationViewController]. - // Pass the selected object to the new view controller. -} -*/ - -@end diff --git a/DUREX tests/DUREX test.xcodeproj/project.pbxproj b/DUREX tests/DUREX test.xcodeproj/project.pbxproj index cd401e6..eb09695 100644 --- a/DUREX tests/DUREX test.xcodeproj/project.pbxproj +++ b/DUREX tests/DUREX test.xcodeproj/project.pbxproj @@ -22,7 +22,6 @@ F9469169193015EE006DACD3 /* icon_checkmark.png in Resources */ = {isa = PBXBuildFile; fileRef = F9469167193015EE006DACD3 /* icon_checkmark.png */; }; F946916A193015EE006DACD3 /* icon_delete.png in Resources */ = {isa = PBXBuildFile; fileRef = F9469168193015EE006DACD3 /* icon_delete.png */; }; F962A233192FCA8A00E4324A /* Stack.m in Sources */ = {isa = PBXBuildFile; fileRef = F962A232192FCA8A00E4324A /* Stack.m */; }; - F97A7D701992DF1A0028036D /* CustomNavigationController.m in Sources */ = {isa = PBXBuildFile; fileRef = F97A7D6F1992DF1A0028036D /* CustomNavigationController.m */; }; F98356D6192E835F00EA6821 /* InitialViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = F98356D5192E835F00EA6821 /* InitialViewController.m */; }; F98356D8192E906600EA6821 /* bluetooth.png in Resources */ = {isa = PBXBuildFile; fileRef = F98356D7192E906600EA6821 /* bluetooth.png */; }; F98356DB192EAFD400EA6821 /* CommunicationProtocol.m in Sources */ = {isa = PBXBuildFile; fileRef = F98356DA192EAFD400EA6821 /* CommunicationProtocol.m */; }; @@ -62,8 +61,6 @@ F9469168193015EE006DACD3 /* icon_delete.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = icon_delete.png; sourceTree = SOURCE_ROOT; }; F962A231192FCA8A00E4324A /* Stack.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Stack.h; sourceTree = SOURCE_ROOT; }; F962A232192FCA8A00E4324A /* Stack.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Stack.m; sourceTree = SOURCE_ROOT; }; - F97A7D6E1992DF1A0028036D /* CustomNavigationController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CustomNavigationController.h; sourceTree = SOURCE_ROOT; }; - F97A7D6F1992DF1A0028036D /* CustomNavigationController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CustomNavigationController.m; sourceTree = SOURCE_ROOT; }; F98356D4192E835F00EA6821 /* InitialViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InitialViewController.h; sourceTree = SOURCE_ROOT; }; F98356D5192E835F00EA6821 /* InitialViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = InitialViewController.m; sourceTree = SOURCE_ROOT; }; F98356D7192E906600EA6821 /* bluetooth.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = bluetooth.png; sourceTree = SOURCE_ROOT; }; @@ -133,8 +130,6 @@ 3471866618070D9300FA0FB2 /* FirstApp */ = { isa = PBXGroup; children = ( - F97A7D6E1992DF1A0028036D /* CustomNavigationController.h */, - F97A7D6F1992DF1A0028036D /* CustomNavigationController.m */, 34AAB881189804FF0019860D /* MainStoryboard.storyboard */, 34AAB876189804FF0019860D /* DUREXAppDelegate.h */, 34AAB877189804FF0019860D /* DUREXAppDelegate.m */, @@ -300,7 +295,6 @@ 34AAB883189804FF0019860D /* DUREXAppDelegate.m in Sources */, F98356DB192EAFD400EA6821 /* CommunicationProtocol.m in Sources */, F98356E1192EC84700EA6821 /* MenuTableViewController.m in Sources */, - F97A7D701992DF1A0028036D /* CustomNavigationController.m in Sources */, 34AAB889189804FF0019860D /* main.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; diff --git a/DUREX tests/DUREX test.xcodeproj/project.xcworkspace/xcuserdata/imanol.xcuserdatad/UserInterfaceState.xcuserstate b/DUREX tests/DUREX test.xcodeproj/project.xcworkspace/xcuserdata/imanol.xcuserdatad/UserInterfaceState.xcuserstate index e90ed43..1ea41bd 100644 Binary files a/DUREX tests/DUREX test.xcodeproj/project.xcworkspace/xcuserdata/imanol.xcuserdatad/UserInterfaceState.xcuserstate and b/DUREX tests/DUREX test.xcodeproj/project.xcworkspace/xcuserdata/imanol.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/DUREX tests/DUREX test.xcodeproj/xcuserdata/imanol.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/DUREX tests/DUREX test.xcodeproj/xcuserdata/imanol.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist index 83d4fa5..205e857 100644 --- a/DUREX tests/DUREX test.xcodeproj/xcuserdata/imanol.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist +++ b/DUREX tests/DUREX test.xcodeproj/xcuserdata/imanol.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -9,28 +9,12 @@ shouldBeEnabled = "No" ignoreCount = "0" continueAfterRunningActions = "No" - filePath = "CustomNavigationController.m" - timestampString = "429064161.848095" - startingColumnNumber = "9223372036854775807" - endingColumnNumber = "9223372036854775807" - startingLineNumber = "15" - endingLineNumber = "15" - landmarkName = "@implementation CustomNavigationController" - landmarkType = "3"> - - - - diff --git a/DUREX tests/FirstAppExample/DUREXAppDelegate.h b/DUREX tests/FirstAppExample/DUREXAppDelegate.h index 5630f80..dfdd593 100644 --- a/DUREX tests/FirstAppExample/DUREXAppDelegate.h +++ b/DUREX tests/FirstAppExample/DUREXAppDelegate.h @@ -7,12 +7,11 @@ // #import -#import "CustomNavigationController.h" @interface DUREXAppDelegate : UIResponder @property (strong, nonatomic) UIWindow *window; -@property (nonatomic, strong) IBOutlet CustomNavigationController *navController; +@property (nonatomic, strong) IBOutlet UINavigationController *navController; diff --git a/DUREX tests/FirstAppExample/DUREXAppDelegate.m b/DUREX tests/FirstAppExample/DUREXAppDelegate.m index 888c2b1..afe5bba 100644 --- a/DUREX tests/FirstAppExample/DUREXAppDelegate.m +++ b/DUREX tests/FirstAppExample/DUREXAppDelegate.m @@ -20,7 +20,7 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { - CustomNavigationController *navController = (CustomNavigationController *)[[self window] rootViewController]; + UINavigationController *navController = (UINavigationController *)[[self window] rootViewController]; [self setNavController:navController]; [[self navController] setDelegate:self]; diff --git a/DUREX tests/FirstAppExample/MainStoryboard.storyboard b/DUREX tests/FirstAppExample/MainStoryboard.storyboard index 499063b..c911d2b 100644 --- a/DUREX tests/FirstAppExample/MainStoryboard.storyboard +++ b/DUREX tests/FirstAppExample/MainStoryboard.storyboard @@ -53,7 +53,7 @@ - + @@ -110,16 +110,16 @@ - + - + - + diff --git a/DUREX tests/MenuTableViewController.m b/DUREX tests/MenuTableViewController.m index a07ce18..b33f016 100644 --- a/DUREX tests/MenuTableViewController.m +++ b/DUREX tests/MenuTableViewController.m @@ -74,26 +74,29 @@ - (void) changeNavLevel: (uint8_t) level : (BOOL) push { + NSLog(@"[MenuTableViewController.m]: navLevel is %d",level); if(push) { [[self parentLayout] push: [NSNumber numberWithUnsignedChar:self.currentNavLevel]]; } [self setCurrentNavLevel:level]; [self setCurrentCellIdentifier:[[self cellIdentifiers] objectAtIndex:[self currentNavLevel]]]; - if([self currentNavLevel] == MAINTENANCE) + if([self currentNavLevel] == MENU) + { + [[self navigationItem] setTitle:@"PIECE OF CRAP 2000 PRO ULTRA"]; + [self setCurrentElements:[self menuElements]]; + [self setCurrentStructure:[self menuStructure]]; + [self setCurrentHeaders:[self menuHeaders]]; + } + else if([self currentNavLevel] == MAINTENANCE) { + [[self navigationItem] setTitle:@"Maintenance"]; [self setCurrentElements:[self maintenanceElements]]; [self setCurrentStructure:[self maintenanceStructure]]; [self setCurrentHeaders:[self maintenanceHeaders]]; } //AND SO ON... - else - { - [self setCurrentElements:[self menuElements]]; - [self setCurrentStructure:[self menuStructure]]; - [self setCurrentHeaders:[self menuHeaders]]; - } [[self tableView] reloadData]; NSRange range = NSMakeRange(0, [self numberOfSectionsInTableView:[self tableView]]); NSIndexSet *sections = [NSIndexSet indexSetWithIndexesInRange:range]; @@ -117,11 +120,29 @@ return title; } +- (void) backButtonPressed: (id) sender +{ + NSLog(@"[MenuTableViewController.m]: Navigation Stack has %d remaining levels",[[self parentLayout] count]); + if([[self parentLayout] count] > 0) + { + NSLog(@"[MenuTableViewController.m]: Falling to previous navigation level"); + [self navBack]; + } + else + { + NSLog(@"[MenuTableViewController.m]: No more navigation levels in stack, falling to previous view"); + [self.navigationController popViewControllerAnimated:YES]; + } +} + - (void)viewDidLoad { [super viewDidLoad]; [_activityIndicator setHidden:YES]; + self.navigationItem.hidesBackButton = YES; + self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"Back" style:UIBarButtonItemStylePlain target:self action:@selector(backButtonPressed:)]; + //Emmoco protocol initialization _protocol = [CommunicationProtocol sharedProtocol]; @@ -142,10 +163,7 @@ [self initializeMenuEntries]; self.currentNavLevel = 255; [self changeNavLevel:MENU:FALSE]; - DUREXAppDelegate *appDelegate = (DUREXAppDelegate *)[[UIApplication sharedApplication] delegate]; - CustomNavigationController *navController = [appDelegate navController]; - navController.auxController = self; - + // Uncomment the following line to preserve selection between presentations. // self.clearsSelectionOnViewWillAppear = NO; @@ -204,7 +222,6 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { - NSLog(@"[MenuTableViewController.m]: navLevel is %d",[self currentNavLevel]); UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:[self currentCellIdentifier] forIndexPath:indexPath]; if (cell == nil) diff --git a/DUREX tests/durex.json b/DUREX tests/durex.json index 5bd3423..ff2a0ed 100644 --- a/DUREX tests/durex.json +++ b/DUREX tests/durex.json @@ -1,13 +1,5 @@ { "resources": { - "$schemaHash": { - "id": -6, - "align": 1, - "attributes": {"readonly": true}, - "type": "A20:u1", - "access": "r", - "size": 20 - }, "$eapProtocolLevel": { "id": -3, "align": 2, @@ -16,22 +8,6 @@ "access": "r", "size": 2 }, - "$mcmProtocolLevel": { - "id": -2, - "align": 2, - "attributes": {"readonly": true}, - "type": "u2", - "access": "r", - "size": 2 - }, - "messageAvailable": { - "id": 4, - "align": 1, - "attributes": {"indicator": true}, - "type": "E:@emmoco.com.DUREX/BOOLEAN", - "access": "irw", - "size": 1 - }, "numBytes": { "id": 1, "align": 1, @@ -40,21 +16,22 @@ "access": "rw", "size": 1 }, - "$mobileRssi": { - "id": -8, - "align": 1, - "attributes": {"readonly": true}, - "type": "i1", - "access": "r", - "size": 1 - }, "data": { "id": 2, "align": 1, "attributes": {}, - "type": "C:229", + "type": "C:201", "access": "rw", - "size": 229 + "size": 201 + }, + "$activeGroup": { + "id": -10, + "align": 1, + "pack": 1, + "attributes": {"readwrite": true}, + "type": "E:system@emmoco.com.System/ParameterGroup", + "access": "rw", + "size": 1 }, "$mcmDisconnect": { "id": -9, @@ -65,6 +42,7 @@ "size": 1 }, "$eapBuildDate": { + "dim": 8, "id": -4, "align": 1, "attributes": {"readonly": true}, @@ -72,6 +50,14 @@ "access": "r", "size": 8 }, + "numPackets": { + "id": 3, + "align": 1, + "attributes": {}, + "type": "u1", + "access": "rw", + "size": 1 + }, "$resourceCount": { "id": -7, "align": 1, @@ -80,12 +66,38 @@ "access": "r", "size": 2 }, - "numPackets": { - "id": 3, + "$schemaHash": { + "dim": 20, + "id": -6, "align": 1, - "attributes": {}, - "type": "u1", - "access": "rw", + "attributes": {"readonly": true}, + "type": "A20:u1", + "access": "r", + "size": 20 + }, + "messageAvailable": { + "id": 4, + "align": 1, + "pack": 1, + "attributes": {"indicator": true}, + "type": "E:@emmoco.com.DUREX/BOOLEAN", + "access": "ir", + "size": 1 + }, + "$mcmProtocolLevel": { + "id": -2, + "align": 2, + "attributes": {"readonly": true}, + "type": "u2", + "access": "r", + "size": 2 + }, + "$mobileRssi": { + "id": -8, + "align": 1, + "attributes": {"readonly": true}, + "type": "i1", + "access": "r", "size": 1 }, "$fileIndexReset": { @@ -98,6 +110,7 @@ } }, "resourceNamesSys": [ + "$activeGroup", "$eapBuildDate", "$eapProtocolLevel", "$fileIndexReset", @@ -108,41 +121,41 @@ "$schemaHash" ], "manifest": { - "protocolLevel": 12, + "protocolLevel": 13, "hash": [ - 245, - 13, - 216, - 92, - 22, - 189, - 34, + 0, + 164, + 192, 32, - 16, - 124, - 194, + 22, + 163, + 114, + 239, + 91, + 240, + 123, + 128, + 206, + 12, 50, - 87, - 152, - 227, - 110 + 148 ], - "toolVersion": "12.0.0.201211010336", + "toolVersion": "13.4.1.201311121909", "name": "DUREX", - "$$md5": "f316f8e8839db2a2939bf3e0120a1fdf", + "$$md5": "00a4c02016a372ef5bf07b80ce0c3294", "build": [ - 61, - 15, - 116, - 250, - 69, + 171, + 30, + 204, + 135, + 71, 1, 0, 0 ], - "date": "2014-05-14T13:18:01T", + "date": "2014-07-30T17:03:27T", "maxAlign": 2, - "maxSize": 229, + "maxSize": 201, "version": "1.0.0" }, "resourceNames": [ @@ -157,14 +170,22 @@ "$schemaHash", "$resourceCount", "$mobileRssi", - "$mcmDisconnect" + "$mcmDisconnect", + "$activeGroup" ], "attributes": { "description": "", "version": "1.0.0" }, + "resourceNamesApp": [ + "numBytes", + "data", + "numPackets", + "messageAvailable" + ], "types": { "system@emmoco.com.System/ResourceCount": { + "packed": false, "align": 1, "type": "S:system@emmoco.com.System/ResourceCount", "size": 2, @@ -193,17 +214,28 @@ "align": 1, "size": 1 }, + "std:u1": { + "align": 1, + "size": 1 + }, "@emmoco.com.DUREX/BOOLEAN": { "values": [ "TRUE", "FALSE" ], "align": 1, + "pack": 1, "type": "E:@emmoco.com.DUREX/BOOLEAN", "size": 1 }, - "std:u1": { + "system@emmoco.com.System/ParameterGroup": { + "values": [ + "GROUP_A", + "GROUP_B" + ], "align": 1, + "pack": 1, + "type": "E:system@emmoco.com.System/ParameterGroup", "size": 1 }, "std:u2": { @@ -211,11 +243,5 @@ "size": 2 } }, - "resourceNamesApp": [ - "data", - "messageAvailable", - "numBytes", - "numPackets" - ], "imports": {"@emmoco.com.DUREX": true} } \ No newline at end of file diff --git a/DUREX/Em/DUREX-STUBS.c b/DUREX/Em/DUREX-STUBS.c index b8409fc..85cb9b3 100644 --- a/DUREX/Em/DUREX-STUBS.c +++ b/DUREX/Em/DUREX-STUBS.c @@ -1,4 +1,4 @@ -/**** DO NOT EDIT -- this file has been automatically generated from @emmoco.com.DUREX on 2014-07-30T17:03:27T ****/ +/**** DO NOT EDIT -- this file has been automatically generated from @emmoco.com.DUREX on 2014-08-07T19:28:56T ****/ /**** protocolLevel = 13, toolsVersion = 13.4.1.201311121909 ****/ #include "DUREX.h" diff --git a/DUREX/Em/DUREX.c b/DUREX/Em/DUREX.c index be37168..709fece 100644 --- a/DUREX/Em/DUREX.c +++ b/DUREX/Em/DUREX.c @@ -1,4 +1,4 @@ -/**** DO NOT EDIT -- this file has been automatically generated from @emmoco.com.DUREX on 2014-07-30T17:03:27T ****/ +/**** DO NOT EDIT -- this file has been automatically generated from @emmoco.com.DUREX on 2014-08-07T19:28:56T ****/ /**** protocolLevel = 13, toolsVersion = 13.4.1.201311121909 ****/ #include "Em_Message.h" @@ -19,7 +19,7 @@ typedef struct Em_App_Message { const uint8_t Em_App_hash[] = {0, 164, 192, 32, 22, 163, 114, 239, 91, 240, 123, 128, 206, 12, 50, 148, 13, 0, ((sizeof(struct{uint8_t f1; uint16_t f2;}) - sizeof(uint16_t)) << 4) | (sizeof(struct{uint8_t f1; uint32_t f2;}) - sizeof(uint32_t))}; -const uint8_t Em_App_build[] = {171, 30, 204, 135, 71, 1, 0, 0}; +const uint8_t Em_App_build[] = {131, 51, 132, 177, 71, 1, 0, 0}; #define Em_App_APP_RESOURCE_COUNT 4 #define Em_App_SYS_RESOURCE_COUNT 9 diff --git a/DUREX/Em/DUREX.h b/DUREX/Em/DUREX.h index 4963a1a..de4911b 100644 --- a/DUREX/Em/DUREX.h +++ b/DUREX/Em/DUREX.h @@ -1,4 +1,4 @@ -/**** DO NOT EDIT -- this file has been automatically generated from @emmoco.com.DUREX on 2014-07-30T17:03:27T ****/ +/**** DO NOT EDIT -- this file has been automatically generated from @emmoco.com.DUREX on 2014-08-07T19:28:56T ****/ /**** protocolLevel = 13, toolsVersion = 13.4.1.201311121909 ****/ #ifndef DUREX__H diff --git a/DUREX/Em/durex.json b/DUREX/Em/durex.json index ff2a0ed..c22e61d 100644 --- a/DUREX/Em/durex.json +++ b/DUREX/Em/durex.json @@ -144,16 +144,16 @@ "name": "DUREX", "$$md5": "00a4c02016a372ef5bf07b80ce0c3294", "build": [ - 171, - 30, - 204, - 135, + 131, + 51, + 132, + 177, 71, 1, 0, 0 ], - "date": "2014-07-30T17:03:27T", + "date": "2014-08-07T19:28:56T", "maxAlign": 2, "maxSize": 201, "version": "1.0.0" diff --git a/DUREX/bundle.properties b/DUREX/bundle.properties index 99baa05..eba6f98 100644 --- a/DUREX/bundle.properties +++ b/DUREX/bundle.properties @@ -6,5 +6,5 @@ com.emmoco.framework.Properties.schemaDestinationDirectory = Em com.emmoco.framework.Properties.serverAPIToken = com.emmoco.framework.Properties.align16 = 2 com.emmoco.framework.Properties.align32 = 4 -com.emmoco.framework.Properties.schemaFile = /Users/imanol/devel/em-builder/DUREX/DUREX.ems +com.emmoco.framework.Properties.schemaFile = /Users/imanol/devel/durex/DUREX/DUREX.ems com.emmoco.framework.Properties.toolVersion = 13.4.1.201311121909 -- libgit2 0.22.2