Commit 50109a86ca87c32f5c4c4cd928d36b5120d675c9

Authored by Imanol-Mikel Barba Sabariego
1 parent 3d99a27b

--no commit message

DUREX Vendor Control/DUREX Vendor Control.xcodeproj/project.pbxproj
@@ -25,6 +25,7 @@ @@ -25,6 +25,7 @@
25 F98356D8192E906600EA6821 /* bluetooth.png in Resources */ = {isa = PBXBuildFile; fileRef = F98356D7192E906600EA6821 /* bluetooth.png */; }; 25 F98356D8192E906600EA6821 /* bluetooth.png in Resources */ = {isa = PBXBuildFile; fileRef = F98356D7192E906600EA6821 /* bluetooth.png */; };
26 F98356DB192EAFD400EA6821 /* CommunicationProtocol.m in Sources */ = {isa = PBXBuildFile; fileRef = F98356DA192EAFD400EA6821 /* CommunicationProtocol.m */; }; 26 F98356DB192EAFD400EA6821 /* CommunicationProtocol.m in Sources */ = {isa = PBXBuildFile; fileRef = F98356DA192EAFD400EA6821 /* CommunicationProtocol.m */; };
27 F98356E1192EC84700EA6821 /* MenuTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = F98356E0192EC84700EA6821 /* MenuTableViewController.m */; }; 27 F98356E1192EC84700EA6821 /* MenuTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = F98356E0192EC84700EA6821 /* MenuTableViewController.m */; };
  28 + F9A8EF7C192FE201009E7532 /* Stack.m in Sources */ = {isa = PBXBuildFile; fileRef = F9A8EF7B192FE201009E7532 /* Stack.m */; };
28 F9C77F4E192CDE18002DBE8A /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = F9C77F4C192CDE18002DBE8A /* InfoPlist.strings */; }; 29 F9C77F4E192CDE18002DBE8A /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = F9C77F4C192CDE18002DBE8A /* InfoPlist.strings */; };
29 F9C77F50192CDE30002DBE8A /* durex.json in Resources */ = {isa = PBXBuildFile; fileRef = F9C77F4F192CDE30002DBE8A /* durex.json */; }; 30 F9C77F50192CDE30002DBE8A /* durex.json in Resources */ = {isa = PBXBuildFile; fileRef = F9C77F4F192CDE30002DBE8A /* durex.json */; };
30 /* End PBXBuildFile section */ 31 /* End PBXBuildFile section */
@@ -79,6 +80,8 @@ @@ -79,6 +80,8 @@
79 F98356DA192EAFD400EA6821 /* CommunicationProtocol.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CommunicationProtocol.m; sourceTree = SOURCE_ROOT; }; 80 F98356DA192EAFD400EA6821 /* CommunicationProtocol.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CommunicationProtocol.m; sourceTree = SOURCE_ROOT; };
80 F98356DF192EC84700EA6821 /* MenuTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MenuTableViewController.h; sourceTree = SOURCE_ROOT; }; 81 F98356DF192EC84700EA6821 /* MenuTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MenuTableViewController.h; sourceTree = SOURCE_ROOT; };
81 F98356E0192EC84700EA6821 /* MenuTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MenuTableViewController.m; sourceTree = SOURCE_ROOT; }; 82 F98356E0192EC84700EA6821 /* MenuTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MenuTableViewController.m; sourceTree = SOURCE_ROOT; };
  83 + F9A8EF7A192FE201009E7532 /* Stack.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Stack.h; sourceTree = SOURCE_ROOT; };
  84 + F9A8EF7B192FE201009E7532 /* Stack.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Stack.m; sourceTree = SOURCE_ROOT; };
82 F9C77F4D192CDE18002DBE8A /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = FirstAppExample/en.lproj/InfoPlist.strings; sourceTree = SOURCE_ROOT; }; 85 F9C77F4D192CDE18002DBE8A /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = FirstAppExample/en.lproj/InfoPlist.strings; sourceTree = SOURCE_ROOT; };
83 F9C77F4F192CDE30002DBE8A /* durex.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = durex.json; sourceTree = SOURCE_ROOT; }; 86 F9C77F4F192CDE30002DBE8A /* durex.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = durex.json; sourceTree = SOURCE_ROOT; };
84 /* End PBXFileReference section */ 87 /* End PBXFileReference section */
@@ -151,6 +154,8 @@ @@ -151,6 +154,8 @@
151 F98356E0192EC84700EA6821 /* MenuTableViewController.m */, 154 F98356E0192EC84700EA6821 /* MenuTableViewController.m */,
152 F98356D9192EAFD400EA6821 /* CommunicationProtocol.h */, 155 F98356D9192EAFD400EA6821 /* CommunicationProtocol.h */,
153 F98356DA192EAFD400EA6821 /* CommunicationProtocol.m */, 156 F98356DA192EAFD400EA6821 /* CommunicationProtocol.m */,
  157 + F9A8EF7A192FE201009E7532 /* Stack.h */,
  158 + F9A8EF7B192FE201009E7532 /* Stack.m */,
154 34AAB88C189805300019860D /* Images.xcassets */, 159 34AAB88C189805300019860D /* Images.xcassets */,
155 347186B91807290E00FA0FB2 /* Schemas */, 160 347186B91807290E00FA0FB2 /* Schemas */,
156 347186A718070F7F00FA0FB2 /* Device Picker */, 161 347186A718070F7F00FA0FB2 /* Device Picker */,
@@ -322,6 +327,7 @@ @@ -322,6 +327,7 @@
322 buildActionMask = 2147483647; 327 buildActionMask = 2147483647;
323 files = ( 328 files = (
324 F98356D6192E835F00EA6821 /* InitialViewController.m in Sources */, 329 F98356D6192E835F00EA6821 /* InitialViewController.m in Sources */,
  330 + F9A8EF7C192FE201009E7532 /* Stack.m in Sources */,
325 34AAB885189804FF0019860D /* EMDevicePickerViewController.m in Sources */, 331 34AAB885189804FF0019860D /* EMDevicePickerViewController.m in Sources */,
326 34AAB883189804FF0019860D /* DUREXAppDelegate.m in Sources */, 332 34AAB883189804FF0019860D /* DUREXAppDelegate.m in Sources */,
327 F98356DB192EAFD400EA6821 /* CommunicationProtocol.m in Sources */, 333 F98356DB192EAFD400EA6821 /* CommunicationProtocol.m in Sources */,
DUREX Vendor Control/DUREX Vendor Control.xcodeproj/project.xcworkspace/xcshareddata/DUREX Vendor Control.xccheckout 0 → 100644
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
  3 +<plist version="1.0">
  4 +<dict>
  5 + <key>IDESourceControlProjectFavoriteDictionaryKey</key>
  6 + <false/>
  7 + <key>IDESourceControlProjectIdentifier</key>
  8 + <string>5E047851-FD9C-4741-AB1E-249FB7E14E28</string>
  9 + <key>IDESourceControlProjectName</key>
  10 + <string>DUREX Vendor Control</string>
  11 + <key>IDESourceControlProjectOriginsDictionary</key>
  12 + <dict>
  13 + <key>910DC6DA-E12E-46D3-A774-09A58FE8ED66</key>
  14 + <string>svn://server/durex</string>
  15 + </dict>
  16 + <key>IDESourceControlProjectPath</key>
  17 + <string>DUREX Vendor Control/DUREX Vendor Control.xcodeproj/project.xcworkspace</string>
  18 + <key>IDESourceControlProjectRelativeInstallPathDictionary</key>
  19 + <dict>
  20 + <key>910DC6DA-E12E-46D3-A774-09A58FE8ED66</key>
  21 + <string>../../..</string>
  22 + </dict>
  23 + <key>IDESourceControlProjectRepositoryRootDictionary</key>
  24 + <dict>
  25 + <key>910DC6DA-E12E-46D3-A774-09A58FE8ED66</key>
  26 + <string>svn://server/durex</string>
  27 + </dict>
  28 + <key>IDESourceControlProjectURL</key>
  29 + <string>svn://server/durex/DUREX%20Vendor%20Control/DUREX%20Vendor%20Control.xcodeproj</string>
  30 + <key>IDESourceControlProjectVersion</key>
  31 + <integer>110</integer>
  32 + <key>IDESourceControlProjectWCCIdentifier</key>
  33 + <string>910DC6DA-E12E-46D3-A774-09A58FE8ED66</string>
  34 + <key>IDESourceControlProjectWCConfigurations</key>
  35 + <array>
  36 + <dict>
  37 + <key>IDESourceControlRepositoryExtensionIdentifierKey</key>
  38 + <string>public.vcs.subversion</string>
  39 + <key>IDESourceControlWCCIdentifierKey</key>
  40 + <string>910DC6DA-E12E-46D3-A774-09A58FE8ED66</string>
  41 + <key>IDESourceControlWCCName</key>
  42 + <string>durex</string>
  43 + </dict>
  44 + </array>
  45 +</dict>
  46 +</plist>
DUREX Vendor Control/DUREX Vendor Control.xcodeproj/project.xcworkspace/xcuserdata/imanol.xcuserdatad/UserInterfaceState.xcuserstate
No preview for this file type
DUREX Vendor Control/MenuTableViewController.h
@@ -9,17 +9,15 @@ @@ -9,17 +9,15 @@
9 #import <UIKit/UIKit.h> 9 #import <UIKit/UIKit.h>
10 #import "EMFramework.h" 10 #import "EMFramework.h"
11 #import "CommunicationProtocol.h" 11 #import "CommunicationProtocol.h"
  12 +#import "Stack.h"
12 13
13 #define num(x) [NSNumber numberWithUnsignedInt:x] 14 #define num(x) [NSNumber numberWithUnsignedInt:x]
14 15
15 #define MENU_ELEMENTS @"Maintenance",@"Basic Configuration",@"Sending a Report" 16 #define MENU_ELEMENTS @"Maintenance",@"Basic Configuration",@"Sending a Report"
16 #define MENU_CELLS_PER_SECTION num(3) 17 #define MENU_CELLS_PER_SECTION num(3)
17 18
18 -#define MAINTENANCE_ELEMENTS @"General Status",@"Sensor Report"  
19 -#define MAINTENANCE_CELLS_PER_SECTION num(2)  
20 -  
21 -#define STATUS_ELEMENTS @"Time",@"20€ Notes",@"10€ Notes",@"5€ Notes",@"2€ Coins",@"1€ Coins",@"50c Coins",@"CPP_TABLE",@"1€ Change",@"50c Change"  
22 -#define STATUS_CELLS_PER_SECTION num(10) 19 +#define MAINTENANCE_ELEMENTS @"Time",@"20€ Notes",@"10€ Notes",@"5€ Notes",@"2€ Coins",@"1€ Coins",@"50c Coins",@"CPP_TABLE",@"1€ Change",@"50c Change"
  20 +#define MAINTENANCE_CELLS_PER_SECTION num(10)
23 21
24 #define CELL_IDENTIFIERS @"MenuCell",@"MaintenanceCell",@"ConfigCell",@"ReportCell" 22 #define CELL_IDENTIFIERS @"MenuCell",@"MaintenanceCell",@"ConfigCell",@"ReportCell"
25 23
@@ -35,4 +33,6 @@ enum { @@ -35,4 +33,6 @@ enum {
35 33
36 @interface MenuTableViewController : UITableViewController 34 @interface MenuTableViewController : UITableViewController
37 35
  36 +@property (strong,nonatomic) Stack *parentLayout;
  37 +
38 @end 38 @end
DUREX Vendor Control/MenuTableViewController.m
@@ -19,9 +19,6 @@ @@ -19,9 +19,6 @@
19 @property (nonatomic,strong) const NSArray *maintenanceElements; 19 @property (nonatomic,strong) const NSArray *maintenanceElements;
20 @property (nonatomic,strong) const NSArray *maintenanceStructure; 20 @property (nonatomic,strong) const NSArray *maintenanceStructure;
21 21
22 -@property (nonatomic,strong) const NSArray *statusElements;  
23 -@property (nonatomic,strong) const NSArray *statusStructure;  
24 -  
25 @property (nonatomic,strong) const NSArray *cellIdentifiers; 22 @property (nonatomic,strong) const NSArray *cellIdentifiers;
26 23
27 @property (nonatomic,strong) CommunicationProtocol* protocol; 24 @property (nonatomic,strong) CommunicationProtocol* protocol;
@@ -52,14 +49,12 @@ @@ -52,14 +49,12 @@
52 [self setMaintenanceElements:[[NSArray alloc] initWithObjects:MAINTENANCE_ELEMENTS, nil]]; 49 [self setMaintenanceElements:[[NSArray alloc] initWithObjects:MAINTENANCE_ELEMENTS, nil]];
53 [self setMaintenanceStructure:[[NSArray alloc] initWithObjects:MAINTENANCE_CELLS_PER_SECTION, nil]]; 50 [self setMaintenanceStructure:[[NSArray alloc] initWithObjects:MAINTENANCE_CELLS_PER_SECTION, nil]];
54 51
55 - [self setStatusElements:[[NSArray alloc] initWithObjects:STATUS_ELEMENTS, nil]];  
56 - [self setStatusStructure:[[NSArray alloc] initWithObjects:STATUS_CELLS_PER_SECTION, nil]];  
57 -  
58 [self setCellIdentifiers:[[NSArray alloc] initWithObjects:CELL_IDENTIFIERS, nil]]; 52 [self setCellIdentifiers:[[NSArray alloc] initWithObjects:CELL_IDENTIFIERS, nil]];
59 } 53 }
60 54
61 - (void) changeNavLevel: (uint8_t) level 55 - (void) changeNavLevel: (uint8_t) level
62 { 56 {
  57 + [[self parentLayout] push: [NSNumber numberWithUnsignedChar:level]];
63 [self setCurrentNavLevel:level]; 58 [self setCurrentNavLevel:level];
64 [self setCurrentCellIdentifier:[[self cellIdentifiers] objectAtIndex:[self currentNavLevel]]]; 59 [self setCurrentCellIdentifier:[[self cellIdentifiers] objectAtIndex:[self currentNavLevel]]];
65 if([self currentNavLevel] == MAINTENANCE) 60 if([self currentNavLevel] == MAINTENANCE)
@@ -67,11 +62,6 @@ @@ -67,11 +62,6 @@
67 [self setCurrentElements:[self maintenanceElements]]; 62 [self setCurrentElements:[self maintenanceElements]];
68 [self setCurrentStructure:[self maintenanceStructure]]; 63 [self setCurrentStructure:[self maintenanceStructure]];
69 } 64 }
70 - else if([self currentNavLevel] == STATUS)  
71 - {  
72 - [self setCurrentElements:[self statusElements]];  
73 - [self setCurrentStructure:[self statusStructure]];  
74 - }  
75 //AND SO ON... 65 //AND SO ON...
76 else 66 else
77 { 67 {
@@ -111,6 +101,9 @@ @@ -111,6 +101,9 @@
111 [[self navigationController] popToViewController:previous animated:YES]; 101 [[self navigationController] popToViewController:previous animated:YES];
112 } 102 }
113 103
  104 + //Initialize parentLayout stack
  105 + [self setParentLayout:[[Stack alloc]init]];
  106 +
114 //Set navigation level 107 //Set navigation level
115 [self initializeMenuEntries]; 108 [self initializeMenuEntries];
116 [self changeNavLevel:MENU]; 109 [self changeNavLevel:MENU];
@@ -176,10 +169,6 @@ @@ -176,10 +169,6 @@
176 { 169 {
177 [self changeNavLevel:MAINTENANCE]; 170 [self changeNavLevel:MAINTENANCE];
178 } 171 }
179 - else if([cellName isEqualToString:@"General Status"])  
180 - {  
181 - [self changeNavLevel:STATUS];  
182 - }  
183 } 172 }
184 173
185 #pragma mark - Table view data source 174 #pragma mark - Table view data source
DUREX Vendor Control/Stack.h 0 → 100644
  1 +//
  2 +// Stack.h
  3 +// DUREX test
  4 +//
  5 +// Created by Imanol Barba on 5/23/14.
  6 +// Copyright (c) 2014 Emmoco. All rights reserved.
  7 +//
  8 +
  9 +#import <Foundation/Foundation.h>
  10 +
  11 +@interface Stack : NSObject
  12 +
  13 +- (id) init;
  14 +- (void) push: (id) element;
  15 +- (id) pop;
  16 +- (NSInteger) count;
  17 +- (void) clear;
  18 +
  19 +@end
DUREX Vendor Control/Stack.m 0 → 100644
  1 +//
  2 +// Stack.m
  3 +// DUREX test
  4 +//
  5 +// Created by Imanol Barba on 5/23/14.
  6 +// Copyright (c) 2014 Emmoco. All rights reserved.retur
  7 +//
  8 +
  9 +#import "Stack.h"
  10 +
  11 +@interface Stack ()
  12 +
  13 +@property (strong,nonatomic) NSMutableArray *dataArray;
  14 +@property (nonatomic) NSUInteger lastPosition;
  15 +@end
  16 +
  17 +@implementation Stack
  18 +
  19 +- (id) init
  20 +{
  21 + self = [super init];
  22 + [self setLastPosition: 0];
  23 + [self setDataArray:[[NSMutableArray alloc] init]];
  24 + return self;
  25 +}
  26 +
  27 +- (void) push: (id) element
  28 +{
  29 + [[self dataArray] addObject:element];
  30 + printf("%d elements in array\n",[self count]);
  31 +}
  32 +- (id) pop
  33 +{
  34 + id element;
  35 + element = [[self dataArray] objectAtIndex:[self lastPosition]];
  36 + [[self dataArray] removeLastObject];
  37 + return element;
  38 +}
  39 +- (NSInteger) count
  40 +{
  41 + return [[self dataArray] count];
  42 +}
  43 +- (void) clear
  44 +{
  45 +
  46 +}
  47 +
  48 +@end
DUREX tests/DUREX test.xcodeproj/project.pbxproj
@@ -19,6 +19,8 @@ @@ -19,6 +19,8 @@
19 34AAB889189804FF0019860D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 34AAB880189804FF0019860D /* main.m */; }; 19 34AAB889189804FF0019860D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 34AAB880189804FF0019860D /* main.m */; };
20 34AAB88A189804FF0019860D /* MainStoryboard.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 34AAB881189804FF0019860D /* MainStoryboard.storyboard */; }; 20 34AAB88A189804FF0019860D /* MainStoryboard.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 34AAB881189804FF0019860D /* MainStoryboard.storyboard */; };
21 34AAB88D189805300019860D /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 34AAB88C189805300019860D /* Images.xcassets */; }; 21 34AAB88D189805300019860D /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 34AAB88C189805300019860D /* Images.xcassets */; };
  22 + F9469169193015EE006DACD3 /* icon_checkmark.png in Resources */ = {isa = PBXBuildFile; fileRef = F9469167193015EE006DACD3 /* icon_checkmark.png */; };
  23 + F946916A193015EE006DACD3 /* icon_delete.png in Resources */ = {isa = PBXBuildFile; fileRef = F9469168193015EE006DACD3 /* icon_delete.png */; };
22 F962A233192FCA8A00E4324A /* Stack.m in Sources */ = {isa = PBXBuildFile; fileRef = F962A232192FCA8A00E4324A /* Stack.m */; }; 24 F962A233192FCA8A00E4324A /* Stack.m in Sources */ = {isa = PBXBuildFile; fileRef = F962A232192FCA8A00E4324A /* Stack.m */; };
23 F98356D6192E835F00EA6821 /* InitialViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = F98356D5192E835F00EA6821 /* InitialViewController.m */; }; 25 F98356D6192E835F00EA6821 /* InitialViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = F98356D5192E835F00EA6821 /* InitialViewController.m */; };
24 F98356D8192E906600EA6821 /* bluetooth.png in Resources */ = {isa = PBXBuildFile; fileRef = F98356D7192E906600EA6821 /* bluetooth.png */; }; 26 F98356D8192E906600EA6821 /* bluetooth.png in Resources */ = {isa = PBXBuildFile; fileRef = F98356D7192E906600EA6821 /* bluetooth.png */; };
@@ -55,6 +57,8 @@ @@ -55,6 +57,8 @@
55 34AAB880189804FF0019860D /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = FirstAppExample/main.m; sourceTree = SOURCE_ROOT; }; 57 34AAB880189804FF0019860D /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = FirstAppExample/main.m; sourceTree = SOURCE_ROOT; };
56 34AAB881189804FF0019860D /* MainStoryboard.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = MainStoryboard.storyboard; path = FirstAppExample/MainStoryboard.storyboard; sourceTree = SOURCE_ROOT; }; 58 34AAB881189804FF0019860D /* MainStoryboard.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = MainStoryboard.storyboard; path = FirstAppExample/MainStoryboard.storyboard; sourceTree = SOURCE_ROOT; };
57 34AAB88C189805300019860D /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = FirstAppExample/Images.xcassets; sourceTree = SOURCE_ROOT; }; 59 34AAB88C189805300019860D /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = FirstAppExample/Images.xcassets; sourceTree = SOURCE_ROOT; };
  60 + F9469167193015EE006DACD3 /* icon_checkmark.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = icon_checkmark.png; sourceTree = SOURCE_ROOT; };
  61 + F9469168193015EE006DACD3 /* icon_delete.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = icon_delete.png; sourceTree = SOURCE_ROOT; };
58 F962A231192FCA8A00E4324A /* Stack.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Stack.h; sourceTree = SOURCE_ROOT; }; 62 F962A231192FCA8A00E4324A /* Stack.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Stack.h; sourceTree = SOURCE_ROOT; };
59 F962A232192FCA8A00E4324A /* Stack.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Stack.m; sourceTree = SOURCE_ROOT; }; 63 F962A232192FCA8A00E4324A /* Stack.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Stack.m; sourceTree = SOURCE_ROOT; };
60 F98356D4192E835F00EA6821 /* InitialViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InitialViewController.h; sourceTree = SOURCE_ROOT; }; 64 F98356D4192E835F00EA6821 /* InitialViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InitialViewController.h; sourceTree = SOURCE_ROOT; };
@@ -150,6 +154,8 @@ @@ -150,6 +154,8 @@
150 3471866718070D9300FA0FB2 /* Supporting Files */ = { 154 3471866718070D9300FA0FB2 /* Supporting Files */ = {
151 isa = PBXGroup; 155 isa = PBXGroup;
152 children = ( 156 children = (
  157 + F9469167193015EE006DACD3 /* icon_checkmark.png */,
  158 + F9469168193015EE006DACD3 /* icon_delete.png */,
153 F98356D7192E906600EA6821 /* bluetooth.png */, 159 F98356D7192E906600EA6821 /* bluetooth.png */,
154 34AAB87E189804FF0019860D /* DUREX test-Info.plist */, 160 34AAB87E189804FF0019860D /* DUREX test-Info.plist */,
155 34AAB87F189804FF0019860D /* DUREX test-Prefix.pch */, 161 34AAB87F189804FF0019860D /* DUREX test-Prefix.pch */,
@@ -263,6 +269,8 @@ @@ -263,6 +269,8 @@
263 F9C77F50192CDE30002DBE8A /* durex.json in Resources */, 269 F9C77F50192CDE30002DBE8A /* durex.json in Resources */,
264 F9C77F4E192CDE18002DBE8A /* InfoPlist.strings in Resources */, 270 F9C77F4E192CDE18002DBE8A /* InfoPlist.strings in Resources */,
265 34AAB88D189805300019860D /* Images.xcassets in Resources */, 271 34AAB88D189805300019860D /* Images.xcassets in Resources */,
  272 + F9469169193015EE006DACD3 /* icon_checkmark.png in Resources */,
  273 + F946916A193015EE006DACD3 /* icon_delete.png in Resources */,
266 34AAB88A189804FF0019860D /* MainStoryboard.storyboard in Resources */, 274 34AAB88A189804FF0019860D /* MainStoryboard.storyboard in Resources */,
267 ); 275 );
268 runOnlyForDeploymentPostprocessing = 0; 276 runOnlyForDeploymentPostprocessing = 0;
@@ -401,6 +409,7 @@ @@ -401,6 +409,7 @@
401 GCC_PRECOMPILE_PREFIX_HEADER = YES; 409 GCC_PRECOMPILE_PREFIX_HEADER = YES;
402 GCC_PREFIX_HEADER = "FirstAppExample/DUREX test-Prefix.pch"; 410 GCC_PREFIX_HEADER = "FirstAppExample/DUREX test-Prefix.pch";
403 INFOPLIST_FILE = "FirstAppExample/DUREX test-Info.plist"; 411 INFOPLIST_FILE = "FirstAppExample/DUREX test-Info.plist";
  412 + IPHONEOS_DEPLOYMENT_TARGET = 6.0;
404 LIBRARY_SEARCH_PATHS = ( 413 LIBRARY_SEARCH_PATHS = (
405 "$(inherited)", 414 "$(inherited)",
406 EmmocoMobileFramework/Framework, 415 EmmocoMobileFramework/Framework,
@@ -420,6 +429,7 @@ @@ -420,6 +429,7 @@
420 GCC_PRECOMPILE_PREFIX_HEADER = YES; 429 GCC_PRECOMPILE_PREFIX_HEADER = YES;
421 GCC_PREFIX_HEADER = "FirstAppExample/DUREX test-Prefix.pch"; 430 GCC_PREFIX_HEADER = "FirstAppExample/DUREX test-Prefix.pch";
422 INFOPLIST_FILE = "FirstAppExample/DUREX test-Info.plist"; 431 INFOPLIST_FILE = "FirstAppExample/DUREX test-Info.plist";
  432 + IPHONEOS_DEPLOYMENT_TARGET = 6.0;
423 LIBRARY_SEARCH_PATHS = ( 433 LIBRARY_SEARCH_PATHS = (
424 "$(inherited)", 434 "$(inherited)",
425 EmmocoMobileFramework/Framework, 435 EmmocoMobileFramework/Framework,
DUREX tests/DUREX test.xcodeproj/project.xcworkspace/xcshareddata/DUREX test.xccheckout 0 → 100644
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
  3 +<plist version="1.0">
  4 +<dict>
  5 + <key>IDESourceControlProjectFavoriteDictionaryKey</key>
  6 + <false/>
  7 + <key>IDESourceControlProjectIdentifier</key>
  8 + <string>3DEF8FD7-874A-4291-AEBE-9A5EDB5EDFFF</string>
  9 + <key>IDESourceControlProjectName</key>
  10 + <string>DUREX test</string>
  11 + <key>IDESourceControlProjectOriginsDictionary</key>
  12 + <dict>
  13 + <key>910DC6DA-E12E-46D3-A774-09A58FE8ED66</key>
  14 + <string>svn://server/durex</string>
  15 + </dict>
  16 + <key>IDESourceControlProjectPath</key>
  17 + <string>DUREX tests/DUREX test.xcodeproj/project.xcworkspace</string>
  18 + <key>IDESourceControlProjectRelativeInstallPathDictionary</key>
  19 + <dict>
  20 + <key>910DC6DA-E12E-46D3-A774-09A58FE8ED66</key>
  21 + <string>../../..</string>
  22 + </dict>
  23 + <key>IDESourceControlProjectRepositoryRootDictionary</key>
  24 + <dict>
  25 + <key>910DC6DA-E12E-46D3-A774-09A58FE8ED66</key>
  26 + <string>svn://server/durex</string>
  27 + </dict>
  28 + <key>IDESourceControlProjectURL</key>
  29 + <string>svn://server/durex/DUREX%20tests/DUREX%20test.xcodeproj</string>
  30 + <key>IDESourceControlProjectVersion</key>
  31 + <integer>110</integer>
  32 + <key>IDESourceControlProjectWCCIdentifier</key>
  33 + <string>910DC6DA-E12E-46D3-A774-09A58FE8ED66</string>
  34 + <key>IDESourceControlProjectWCConfigurations</key>
  35 + <array>
  36 + <dict>
  37 + <key>IDESourceControlRepositoryExtensionIdentifierKey</key>
  38 + <string>public.vcs.subversion</string>
  39 + <key>IDESourceControlWCCIdentifierKey</key>
  40 + <string>910DC6DA-E12E-46D3-A774-09A58FE8ED66</string>
  41 + <key>IDESourceControlWCCName</key>
  42 + <string>durex</string>
  43 + </dict>
  44 + </array>
  45 +</dict>
  46 +</plist>
DUREX tests/DUREX test.xcodeproj/project.xcworkspace/xcuserdata/imanol.xcuserdatad/UserInterfaceState.xcuserstate
No preview for this file type
DUREX tests/FirstAppExample/EMDevicePickerViewController.m
@@ -78,7 +78,7 @@ @@ -78,7 +78,7 @@
78 cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"DeviceCell"]; 78 cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"DeviceCell"];
79 } 79 }
80 80
81 - [[cell textLabel] setText:@"FUCKING PIECE OF CRAP 2000 PRO ULTRA"]; 81 + [[cell textLabel] setText:@"PIECE OF CRAP 2000 PRO ULTRA"];
82 [[cell detailTextLabel] setText:@"FUCKING ONLINE"]; 82 [[cell detailTextLabel] setText:@"FUCKING ONLINE"];
83 return cell; 83 return cell;
84 } 84 }
DUREX tests/FirstAppExample/Images.xcassets/AppIcon.appiconset/120 - App Icon@2x.png

5.49 KB | W: | H:

5.51 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin
DUREX tests/FirstAppExample/Images.xcassets/AppIcon.appiconset/40 - App Icon@2x.png

3.96 KB | W: | H:

3.98 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin
DUREX tests/FirstAppExample/MainStoryboard.storyboard
1 <?xml version="1.0" encoding="UTF-8" standalone="no"?> 1 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2 -<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="5056" systemVersion="12F45" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" initialViewController="kWw-Rk-wD6"> 2 +<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="4510" systemVersion="12F45" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" initialViewController="kWw-Rk-wD6">
3 <dependencies> 3 <dependencies>
4 - <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="3733"/> 4 + <deployment defaultVersion="1536" identifier="iOS"/>
  5 + <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="3742"/>
5 </dependencies> 6 </dependencies>
6 <scenes> 7 <scenes>
7 <!--Device Picker View Controller - Select device--> 8 <!--Device Picker View Controller - Select device-->
@@ -78,32 +79,15 @@ @@ -78,32 +79,15 @@
78 </subviews> 79 </subviews>
79 </tableViewCellContentView> 80 </tableViewCellContentView>
80 </tableViewCell> 81 </tableViewCell>
81 - <tableViewCell contentMode="scaleToFill" selectionStyle="blue" accessoryType="disclosureIndicator" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" reuseIdentifier="MaintenanceCell" textLabel="oML-ji-1Ho" style="IBUITableViewCellStyleDefault" id="apQ-aM-g3l"> 82 + <tableViewCell contentMode="scaleToFill" selectionStyle="blue" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" reuseIdentifier="MaintenanceCell" textLabel="oML-ji-1Ho" style="IBUITableViewCellStyleDefault" id="apQ-aM-g3l">
82 <rect key="frame" x="0.0" y="130" width="320" height="44"/> 83 <rect key="frame" x="0.0" y="130" width="320" height="44"/>
83 <autoresizingMask key="autoresizingMask"/> 84 <autoresizingMask key="autoresizingMask"/>
84 <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="apQ-aM-g3l" id="dQQ-Yv-wa7"> 85 <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="apQ-aM-g3l" id="dQQ-Yv-wa7">
85 - <rect key="frame" x="0.0" y="0.0" width="287" height="43"/> 86 + <rect key="frame" x="0.0" y="0.0" width="320" height="43"/>
86 <autoresizingMask key="autoresizingMask"/> 87 <autoresizingMask key="autoresizingMask"/>
87 <subviews> 88 <subviews>
88 <label opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="left" text="Title" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="oML-ji-1Ho"> 89 <label opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="left" text="Title" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="oML-ji-1Ho">
89 - <rect key="frame" x="15" y="0.0" width="270" height="43"/>  
90 - <autoresizingMask key="autoresizingMask"/>  
91 - <fontDescription key="fontDescription" type="system" pointSize="18"/>  
92 - <color key="textColor" cocoaTouchSystemColor="darkTextColor"/>  
93 - <nil key="highlightedColor"/>  
94 - </label>  
95 - </subviews>  
96 - </tableViewCellContentView>  
97 - </tableViewCell>  
98 - <tableViewCell contentMode="scaleToFill" selectionStyle="blue" accessoryType="checkmark" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" reuseIdentifier="StatusCell" textLabel="92b-AM-cXo" style="IBUITableViewCellStyleDefault" id="wqw-36-rKK">  
99 - <rect key="frame" x="0.0" y="174" width="320" height="44"/>  
100 - <autoresizingMask key="autoresizingMask"/>  
101 - <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="wqw-36-rKK" id="oyX-dF-srq">  
102 - <rect key="frame" x="0.0" y="0.0" width="281" height="43"/>  
103 - <autoresizingMask key="autoresizingMask"/>  
104 - <subviews>  
105 - <label opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="left" text="Title" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="92b-AM-cXo">  
106 - <rect key="frame" x="15" y="0.0" width="266" height="43"/> 90 + <rect key="frame" x="15" y="0.0" width="290" height="43"/>
107 <autoresizingMask key="autoresizingMask"/> 91 <autoresizingMask key="autoresizingMask"/>
108 <fontDescription key="fontDescription" type="system" pointSize="18"/> 92 <fontDescription key="fontDescription" type="system" pointSize="18"/>
109 <color key="textColor" cocoaTouchSystemColor="darkTextColor"/> 93 <color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
@@ -153,7 +137,7 @@ @@ -153,7 +137,7 @@
153 <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> 137 <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
154 <subviews> 138 <subviews>
155 <button opaque="NO" contentMode="scaleAspectFit" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="bXZ-vt-REt"> 139 <button opaque="NO" contentMode="scaleAspectFit" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="bXZ-vt-REt">
156 - <rect key="frame" x="96" y="220" width="128" height="128"/> 140 + <rect key="frame" x="96" y="137" width="128" height="128"/>
157 <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> 141 <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
158 <state key="normal" backgroundImage="bluetooth.png"> 142 <state key="normal" backgroundImage="bluetooth.png">
159 <color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/> 143 <color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
@@ -163,7 +147,7 @@ @@ -163,7 +147,7 @@
163 </connections> 147 </connections>
164 </button> 148 </button>
165 <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="Connect to Device" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="oyW-sA-Lfb"> 149 <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="Connect to Device" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="oyW-sA-Lfb">
166 - <rect key="frame" x="86" y="356" width="149" height="21"/> 150 + <rect key="frame" x="86" y="273" width="149" height="21"/>
167 <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> 151 <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
168 <fontDescription key="fontDescription" type="system" pointSize="17"/> 152 <fontDescription key="fontDescription" type="system" pointSize="17"/>
169 <color key="textColor" cocoaTouchSystemColor="darkTextColor"/> 153 <color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
@@ -191,4 +175,4 @@ @@ -191,4 +175,4 @@
191 <simulatedOrientationMetrics key="orientation"/> 175 <simulatedOrientationMetrics key="orientation"/>
192 <simulatedScreenMetrics key="destination" type="retina4"/> 176 <simulatedScreenMetrics key="destination" type="retina4"/>
193 </simulatedMetricsContainer> 177 </simulatedMetricsContainer>
194 -</document> 178 -</document>
  179 +</document>
195 \ No newline at end of file 180 \ No newline at end of file
DUREX tests/MenuTableViewController.h
@@ -8,32 +8,31 @@ @@ -8,32 +8,31 @@
8 8
9 #import <UIKit/UIKit.h> 9 #import <UIKit/UIKit.h>
10 #import "CommunicationProtocol.h" 10 #import "CommunicationProtocol.h"
  11 +#import "Stack.h"
11 12
12 #define num(x) [NSNumber numberWithUnsignedInt:x] 13 #define num(x) [NSNumber numberWithUnsignedInt:x]
13 14
14 #define MENU_ELEMENTS @"Maintenance",@"Basic Configuration",@"Sending a Report" 15 #define MENU_ELEMENTS @"Maintenance",@"Basic Configuration",@"Sending a Report"
15 #define MENU_CELLS_PER_SECTION num(3) 16 #define MENU_CELLS_PER_SECTION num(3)
  17 +#define MENU_HEADERS nil
16 18
17 -#define MAINTENANCE_ELEMENTS @"General Status",@"Sensor Report"  
18 -#define MAINTENANCE_CELLS_PER_SECTION num(2) 19 +#define MAINTENANCE_ELEMENTS @"Time",@"20€ Notes",@"10€ Notes",@"5€ Notes",@"2€ Coins",@"1€ Coins",@"50c Coins",@"CPP_TABLE",@"1€ Change",@"50c Change"
  20 +#define MAINTENANCE_CELLS_PER_SECTION num(10),num(0)
  21 +#define MAINTENANCE_HEADERS @"Status",@"Sensors"
19 22
20 -#define STATUS_ELEMENTS @"Time",@"20€ Notes",@"10€ Notes",@"5€ Notes",@"2€ Coins",@"1€ Coins",@"50c Coins",@"CPP_TABLE",@"1€ Change",@"50c Change"  
21 -#define STATUS_CELLS_PER_SECTION num(10)  
22 -  
23 -#define CELL_IDENTIFIERS @"MenuCell",@"MaintenanceCell",@"StatusCell",@"ConfigCell",@"ReportCell" 23 +#define CELL_IDENTIFIERS @"MenuCell",@"MaintenanceCell",@"ConfigCell",@"ReportCell"
24 24
25 #define NUM_CHANNELS 8 25 #define NUM_CHANNELS 8
26 26
27 enum { 27 enum {
28 MENU = 0, 28 MENU = 0,
29 MAINTENANCE, 29 MAINTENANCE,
30 - STATUS,  
31 BASIC_CONFIGURATION, 30 BASIC_CONFIGURATION,
32 REPORT, 31 REPORT,
33 } navigationLevel; 32 } navigationLevel;
34 33
35 @interface MenuTableViewController : UITableViewController 34 @interface MenuTableViewController : UITableViewController
36 35
37 -@property (strong,nonatomic) Stack parentLayout; 36 +@property (strong,nonatomic) Stack *parentLayout;
38 37
39 @end 38 @end
DUREX tests/MenuTableViewController.m
@@ -15,12 +15,11 @@ @@ -15,12 +15,11 @@
15 } 15 }
16 @property (nonatomic,strong) const NSArray *menuElements; 16 @property (nonatomic,strong) const NSArray *menuElements;
17 @property (nonatomic,strong) const NSArray *menuStructure; 17 @property (nonatomic,strong) const NSArray *menuStructure;
  18 +@property (nonatomic,strong) const NSArray *menuHeaders;
18 19
19 @property (nonatomic,strong) const NSArray *maintenanceElements; 20 @property (nonatomic,strong) const NSArray *maintenanceElements;
20 @property (nonatomic,strong) const NSArray *maintenanceStructure; 21 @property (nonatomic,strong) const NSArray *maintenanceStructure;
21 -  
22 -@property (nonatomic,strong) const NSArray *statusElements;  
23 -@property (nonatomic,strong) const NSArray *statusStructure; 22 +@property (nonatomic,strong) const NSArray *maintenanceHeaders;
24 23
25 @property (nonatomic,strong) const NSArray *cellIdentifiers; 24 @property (nonatomic,strong) const NSArray *cellIdentifiers;
26 25
@@ -28,7 +27,8 @@ @@ -28,7 +27,8 @@
28 @property uint8_t currentNavLevel; 27 @property uint8_t currentNavLevel;
29 @property NSString *currentCellIdentifier; 28 @property NSString *currentCellIdentifier;
30 @property const NSArray *currentElements; 29 @property const NSArray *currentElements;
31 -@property const NSArray *currentStructure; 30 +@property const NSArray *currentStructure;
  31 +@property const NSArray *currentHeaders;
32 32
33 @end 33 @end
34 34
@@ -48,40 +48,62 @@ @@ -48,40 +48,62 @@
48 { 48 {
49 [self setMenuElements:[[NSArray alloc] initWithObjects:MENU_ELEMENTS, nil]]; 49 [self setMenuElements:[[NSArray alloc] initWithObjects:MENU_ELEMENTS, nil]];
50 [self setMenuStructure:[[NSArray alloc] initWithObjects:MENU_CELLS_PER_SECTION, nil]]; 50 [self setMenuStructure:[[NSArray alloc] initWithObjects:MENU_CELLS_PER_SECTION, nil]];
  51 + if([[self menuStructure] count] > 1)
  52 + {
  53 + [self setMenuHeaders:[[NSArray alloc] initWithObjects:MENU_HEADERS, nil]];
  54 + }
  55 + else
  56 + {
  57 + [self setMenuHeaders:nil];
  58 + }
51 59
52 [self setMaintenanceElements:[[NSArray alloc] initWithObjects:MAINTENANCE_ELEMENTS, nil]]; 60 [self setMaintenanceElements:[[NSArray alloc] initWithObjects:MAINTENANCE_ELEMENTS, nil]];
53 [self setMaintenanceStructure:[[NSArray alloc] initWithObjects:MAINTENANCE_CELLS_PER_SECTION, nil]]; 61 [self setMaintenanceStructure:[[NSArray alloc] initWithObjects:MAINTENANCE_CELLS_PER_SECTION, nil]];
54 -  
55 - [self setStatusElements:[[NSArray alloc] initWithObjects:STATUS_ELEMENTS, nil]];  
56 - [self setStatusStructure:[[NSArray alloc] initWithObjects:STATUS_CELLS_PER_SECTION, nil]]; 62 + if([[self maintenanceStructure] count] > 1)
  63 + {
  64 + [self setMaintenanceHeaders:[[NSArray alloc] initWithObjects:MAINTENANCE_HEADERS, nil]];
  65 + }
  66 + else
  67 + {
  68 + [self setMaintenanceHeaders:nil];
  69 + }
57 70
58 [self setCellIdentifiers:[[NSArray alloc] initWithObjects:CELL_IDENTIFIERS, nil]]; 71 [self setCellIdentifiers:[[NSArray alloc] initWithObjects:CELL_IDENTIFIERS, nil]];
59 } 72 }
60 73
61 - (void) changeNavLevel: (uint8_t) level 74 - (void) changeNavLevel: (uint8_t) level
62 { 75 {
  76 + [[self parentLayout] push: [NSNumber numberWithUnsignedChar:level]];
63 [self setCurrentNavLevel:level]; 77 [self setCurrentNavLevel:level];
64 [self setCurrentCellIdentifier:[[self cellIdentifiers] objectAtIndex:[self currentNavLevel]]]; 78 [self setCurrentCellIdentifier:[[self cellIdentifiers] objectAtIndex:[self currentNavLevel]]];
65 if([self currentNavLevel] == MAINTENANCE) 79 if([self currentNavLevel] == MAINTENANCE)
66 { 80 {
67 [self setCurrentElements:[self maintenanceElements]]; 81 [self setCurrentElements:[self maintenanceElements]];
68 [self setCurrentStructure:[self maintenanceStructure]]; 82 [self setCurrentStructure:[self maintenanceStructure]];
69 - }  
70 - else if([self currentNavLevel] == STATUS)  
71 - {  
72 - [self setCurrentElements:[self statusElements]];  
73 - [self setCurrentStructure:[self statusStructure]]; 83 + [self setCurrentHeaders:[self maintenanceHeaders]];
74 } 84 }
75 //AND SO ON... 85 //AND SO ON...
76 else 86 else
77 { 87 {
78 [self setCurrentElements:[self menuElements]]; 88 [self setCurrentElements:[self menuElements]];
79 [self setCurrentStructure:[self menuStructure]]; 89 [self setCurrentStructure:[self menuStructure]];
  90 + [self setCurrentHeaders:[self menuHeaders]];
80 } 91 }
  92 + [[self tableView] reloadData];
81 NSRange range = NSMakeRange(0, [self numberOfSectionsInTableView:[self tableView]]); 93 NSRange range = NSMakeRange(0, [self numberOfSectionsInTableView:[self tableView]]);
82 NSIndexSet *sections = [NSIndexSet indexSetWithIndexesInRange:range]; 94 NSIndexSet *sections = [NSIndexSet indexSetWithIndexesInRange:range];
83 [[self tableView] reloadSections:sections withRowAnimation:UITableViewRowAnimationAutomatic]; 95 [[self tableView] reloadSections:sections withRowAnimation:UITableViewRowAnimationAutomatic];
84 } 96 }
  97 +
  98 +- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section
  99 +{
  100 + NSString *title = @"";
  101 + if([self currentHeaders] != nil)
  102 + {
  103 + title = [[self currentHeaders] objectAtIndex:section];
  104 + }
  105 + return title;
  106 +}
85 107
86 - (void)viewDidLoad 108 - (void)viewDidLoad
87 { 109 {
@@ -101,6 +123,9 @@ @@ -101,6 +123,9 @@
101 [[self navigationController] popToViewController:previous animated:YES]; 123 [[self navigationController] popToViewController:previous animated:YES];
102 } 124 }
103 125
  126 + //Initialize parentLayout stack
  127 + [self setParentLayout:[[Stack alloc]init]];
  128 +
104 //Set navigation level 129 //Set navigation level
105 [self initializeMenuEntries]; 130 [self initializeMenuEntries];
106 [self changeNavLevel:MENU]; 131 [self changeNavLevel:MENU];
@@ -137,16 +162,13 @@ @@ -137,16 +162,13 @@
137 162
138 - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath 163 - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
139 { 164 {
  165 + NSLog(@"Section: %d Row: %d",[indexPath section],[indexPath row]);
140 [tableView deselectRowAtIndexPath:indexPath animated:YES]; 166 [tableView deselectRowAtIndexPath:indexPath animated:YES];
141 NSString *cellName = [[[[self tableView] cellForRowAtIndexPath:indexPath]textLabel]text]; 167 NSString *cellName = [[[[self tableView] cellForRowAtIndexPath:indexPath]textLabel]text];
142 if([cellName isEqualToString:@"Maintenance"]) 168 if([cellName isEqualToString:@"Maintenance"])
143 { 169 {
144 [self changeNavLevel:MAINTENANCE]; 170 [self changeNavLevel:MAINTENANCE];
145 } 171 }
146 - else if([cellName isEqualToString:@"General Status"])  
147 - {  
148 - [self changeNavLevel:STATUS];  
149 - }  
150 172
151 173
152 } 174 }
@@ -169,10 +191,34 @@ @@ -169,10 +191,34 @@
169 191
170 if (cell == nil) 192 if (cell == nil)
171 { 193 {
172 - cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:[self currentCellIdentifier]]; 194 + if([self currentNavLevel] == MAINTENANCE)
  195 + {
  196 + cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:[self currentCellIdentifier]];
  197 + }
  198 + else
  199 + {
  200 + cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:[self currentCellIdentifier]];
  201 + }
  202 + }
  203 + uint8_t offset = 0;
  204 + if([indexPath section] )
  205 + {
  206 + for (int i = 0; i < [indexPath section]; i++)
  207 + {
  208 + offset += [[[self currentStructure] objectAtIndex:i] unsignedCharValue];
  209 + }
  210 + }
  211 + [[cell textLabel] setText:[[self currentElements] objectAtIndex:[indexPath row]+offset]];
  212 + if([self currentNavLevel] == MAINTENANCE)
  213 + {
  214 + [[cell detailTextLabel] setText:@"VALUE"];
  215 + [cell setAccessoryView: [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"icon_checkmark"]]];
  216 + if( [[[cell textLabel] text] isEqualToString:@"5€ Notes"])
  217 + {
  218 + [cell setAccessoryView: [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"icon_delete"]]];
  219 + }
173 } 220 }
174 221
175 - [[cell textLabel] setText:[[self currentElements] objectAtIndex:indexPath.row]];  
176 return cell; 222 return cell;
177 } 223 }
178 224
DUREX tests/Stack.h
@@ -10,6 +10,7 @@ @@ -10,6 +10,7 @@
10 10
11 @interface Stack : NSObject 11 @interface Stack : NSObject
12 12
  13 +- (id) init;
13 - (void) push: (id) element; 14 - (void) push: (id) element;
14 - (id) pop; 15 - (id) pop;
15 - (NSInteger) count; 16 - (NSInteger) count;
DUREX tests/Stack.m
@@ -11,19 +11,30 @@ @@ -11,19 +11,30 @@
11 @interface Stack () 11 @interface Stack ()
12 12
13 @property (strong,nonatomic) NSMutableArray *dataArray; 13 @property (strong,nonatomic) NSMutableArray *dataArray;
14 -@property (strong,nonatomic) NSIndex *lastPosition; 14 +@property (nonatomic) NSUInteger lastPosition;
15 @end 15 @end
16 16
17 @implementation Stack 17 @implementation Stack
18 18
  19 +- (id) init
  20 +{
  21 + self = [super init];
  22 + [self setLastPosition: 0];
  23 + [self setDataArray:[[NSMutableArray alloc] init]];
  24 + return self;
  25 +}
  26 +
19 - (void) push: (id) element 27 - (void) push: (id) element
20 { 28 {
21 [[self dataArray] addObject:element]; 29 [[self dataArray] addObject:element];
  30 + printf("%d elements in array\n",[self count]);
22 } 31 }
23 - (id) pop 32 - (id) pop
24 { 33 {
25 - [[self dataArray] obj] 34 + id element;
  35 + element = [[self dataArray] objectAtIndex:[self lastPosition]];
26 [[self dataArray] removeLastObject]; 36 [[self dataArray] removeLastObject];
  37 + return element;
27 } 38 }
28 - (NSInteger) count 39 - (NSInteger) count
29 { 40 {
DUREX tests/icon_checkmark.png 0 → 100755

2.92 KB

DUREX tests/icon_delete.png 0 → 100755

2.93 KB