Commit 50109a86ca87c32f5c4c4cd928d36b5120d675c9
1 parent
3d99a27b
--no commit message
Showing
20 changed files
with
279 additions
and
74 deletions
DUREX Vendor Control/DUREX Vendor Control.xcodeproj/project.pbxproj
... | ... | @@ -25,6 +25,7 @@ |
25 | 25 | F98356D8192E906600EA6821 /* bluetooth.png in Resources */ = {isa = PBXBuildFile; fileRef = F98356D7192E906600EA6821 /* bluetooth.png */; }; |
26 | 26 | F98356DB192EAFD400EA6821 /* CommunicationProtocol.m in Sources */ = {isa = PBXBuildFile; fileRef = F98356DA192EAFD400EA6821 /* CommunicationProtocol.m */; }; |
27 | 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 | 29 | F9C77F4E192CDE18002DBE8A /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = F9C77F4C192CDE18002DBE8A /* InfoPlist.strings */; }; |
29 | 30 | F9C77F50192CDE30002DBE8A /* durex.json in Resources */ = {isa = PBXBuildFile; fileRef = F9C77F4F192CDE30002DBE8A /* durex.json */; }; |
30 | 31 | /* End PBXBuildFile section */ |
... | ... | @@ -79,6 +80,8 @@ |
79 | 80 | F98356DA192EAFD400EA6821 /* CommunicationProtocol.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CommunicationProtocol.m; sourceTree = SOURCE_ROOT; }; |
80 | 81 | F98356DF192EC84700EA6821 /* MenuTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MenuTableViewController.h; sourceTree = SOURCE_ROOT; }; |
81 | 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 | 85 | F9C77F4D192CDE18002DBE8A /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = FirstAppExample/en.lproj/InfoPlist.strings; sourceTree = SOURCE_ROOT; }; |
83 | 86 | F9C77F4F192CDE30002DBE8A /* durex.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = durex.json; sourceTree = SOURCE_ROOT; }; |
84 | 87 | /* End PBXFileReference section */ |
... | ... | @@ -151,6 +154,8 @@ |
151 | 154 | F98356E0192EC84700EA6821 /* MenuTableViewController.m */, |
152 | 155 | F98356D9192EAFD400EA6821 /* CommunicationProtocol.h */, |
153 | 156 | F98356DA192EAFD400EA6821 /* CommunicationProtocol.m */, |
157 | + F9A8EF7A192FE201009E7532 /* Stack.h */, | |
158 | + F9A8EF7B192FE201009E7532 /* Stack.m */, | |
154 | 159 | 34AAB88C189805300019860D /* Images.xcassets */, |
155 | 160 | 347186B91807290E00FA0FB2 /* Schemas */, |
156 | 161 | 347186A718070F7F00FA0FB2 /* Device Picker */, |
... | ... | @@ -322,6 +327,7 @@ |
322 | 327 | buildActionMask = 2147483647; |
323 | 328 | files = ( |
324 | 329 | F98356D6192E835F00EA6821 /* InitialViewController.m in Sources */, |
330 | + F9A8EF7C192FE201009E7532 /* Stack.m in Sources */, | |
325 | 331 | 34AAB885189804FF0019860D /* EMDevicePickerViewController.m in Sources */, |
326 | 332 | 34AAB883189804FF0019860D /* DUREXAppDelegate.m in Sources */, |
327 | 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 | 9 | #import <UIKit/UIKit.h> |
10 | 10 | #import "EMFramework.h" |
11 | 11 | #import "CommunicationProtocol.h" |
12 | +#import "Stack.h" | |
12 | 13 | |
13 | 14 | #define num(x) [NSNumber numberWithUnsignedInt:x] |
14 | 15 | |
15 | 16 | #define MENU_ELEMENTS @"Maintenance",@"Basic Configuration",@"Sending a Report" |
16 | 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 | 22 | #define CELL_IDENTIFIERS @"MenuCell",@"MaintenanceCell",@"ConfigCell",@"ReportCell" |
25 | 23 | |
... | ... | @@ -35,4 +33,6 @@ enum { |
35 | 33 | |
36 | 34 | @interface MenuTableViewController : UITableViewController |
37 | 35 | |
36 | +@property (strong,nonatomic) Stack *parentLayout; | |
37 | + | |
38 | 38 | @end | ... | ... |
DUREX Vendor Control/MenuTableViewController.m
... | ... | @@ -19,9 +19,6 @@ |
19 | 19 | @property (nonatomic,strong) const NSArray *maintenanceElements; |
20 | 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 | 22 | @property (nonatomic,strong) const NSArray *cellIdentifiers; |
26 | 23 | |
27 | 24 | @property (nonatomic,strong) CommunicationProtocol* protocol; |
... | ... | @@ -52,14 +49,12 @@ |
52 | 49 | [self setMaintenanceElements:[[NSArray alloc] initWithObjects:MAINTENANCE_ELEMENTS, nil]]; |
53 | 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 | 52 | [self setCellIdentifiers:[[NSArray alloc] initWithObjects:CELL_IDENTIFIERS, nil]]; |
59 | 53 | } |
60 | 54 | |
61 | 55 | - (void) changeNavLevel: (uint8_t) level |
62 | 56 | { |
57 | + [[self parentLayout] push: [NSNumber numberWithUnsignedChar:level]]; | |
63 | 58 | [self setCurrentNavLevel:level]; |
64 | 59 | [self setCurrentCellIdentifier:[[self cellIdentifiers] objectAtIndex:[self currentNavLevel]]]; |
65 | 60 | if([self currentNavLevel] == MAINTENANCE) |
... | ... | @@ -67,11 +62,6 @@ |
67 | 62 | [self setCurrentElements:[self maintenanceElements]]; |
68 | 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 | 65 | //AND SO ON... |
76 | 66 | else |
77 | 67 | { |
... | ... | @@ -111,6 +101,9 @@ |
111 | 101 | [[self navigationController] popToViewController:previous animated:YES]; |
112 | 102 | } |
113 | 103 | |
104 | + //Initialize parentLayout stack | |
105 | + [self setParentLayout:[[Stack alloc]init]]; | |
106 | + | |
114 | 107 | //Set navigation level |
115 | 108 | [self initializeMenuEntries]; |
116 | 109 | [self changeNavLevel:MENU]; |
... | ... | @@ -176,10 +169,6 @@ |
176 | 169 | { |
177 | 170 | [self changeNavLevel:MAINTENANCE]; |
178 | 171 | } |
179 | - else if([cellName isEqualToString:@"General Status"]) | |
180 | - { | |
181 | - [self changeNavLevel:STATUS]; | |
182 | - } | |
183 | 172 | } |
184 | 173 | |
185 | 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 | 19 | 34AAB889189804FF0019860D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 34AAB880189804FF0019860D /* main.m */; }; |
20 | 20 | 34AAB88A189804FF0019860D /* MainStoryboard.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 34AAB881189804FF0019860D /* MainStoryboard.storyboard */; }; |
21 | 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 | 24 | F962A233192FCA8A00E4324A /* Stack.m in Sources */ = {isa = PBXBuildFile; fileRef = F962A232192FCA8A00E4324A /* Stack.m */; }; |
23 | 25 | F98356D6192E835F00EA6821 /* InitialViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = F98356D5192E835F00EA6821 /* InitialViewController.m */; }; |
24 | 26 | F98356D8192E906600EA6821 /* bluetooth.png in Resources */ = {isa = PBXBuildFile; fileRef = F98356D7192E906600EA6821 /* bluetooth.png */; }; |
... | ... | @@ -55,6 +57,8 @@ |
55 | 57 | 34AAB880189804FF0019860D /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = FirstAppExample/main.m; sourceTree = SOURCE_ROOT; }; |
56 | 58 | 34AAB881189804FF0019860D /* MainStoryboard.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = MainStoryboard.storyboard; path = FirstAppExample/MainStoryboard.storyboard; sourceTree = SOURCE_ROOT; }; |
57 | 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 | 62 | F962A231192FCA8A00E4324A /* Stack.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Stack.h; sourceTree = SOURCE_ROOT; }; |
59 | 63 | F962A232192FCA8A00E4324A /* Stack.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Stack.m; sourceTree = SOURCE_ROOT; }; |
60 | 64 | F98356D4192E835F00EA6821 /* InitialViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InitialViewController.h; sourceTree = SOURCE_ROOT; }; |
... | ... | @@ -150,6 +154,8 @@ |
150 | 154 | 3471866718070D9300FA0FB2 /* Supporting Files */ = { |
151 | 155 | isa = PBXGroup; |
152 | 156 | children = ( |
157 | + F9469167193015EE006DACD3 /* icon_checkmark.png */, | |
158 | + F9469168193015EE006DACD3 /* icon_delete.png */, | |
153 | 159 | F98356D7192E906600EA6821 /* bluetooth.png */, |
154 | 160 | 34AAB87E189804FF0019860D /* DUREX test-Info.plist */, |
155 | 161 | 34AAB87F189804FF0019860D /* DUREX test-Prefix.pch */, |
... | ... | @@ -263,6 +269,8 @@ |
263 | 269 | F9C77F50192CDE30002DBE8A /* durex.json in Resources */, |
264 | 270 | F9C77F4E192CDE18002DBE8A /* InfoPlist.strings in Resources */, |
265 | 271 | 34AAB88D189805300019860D /* Images.xcassets in Resources */, |
272 | + F9469169193015EE006DACD3 /* icon_checkmark.png in Resources */, | |
273 | + F946916A193015EE006DACD3 /* icon_delete.png in Resources */, | |
266 | 274 | 34AAB88A189804FF0019860D /* MainStoryboard.storyboard in Resources */, |
267 | 275 | ); |
268 | 276 | runOnlyForDeploymentPostprocessing = 0; |
... | ... | @@ -401,6 +409,7 @@ |
401 | 409 | GCC_PRECOMPILE_PREFIX_HEADER = YES; |
402 | 410 | GCC_PREFIX_HEADER = "FirstAppExample/DUREX test-Prefix.pch"; |
403 | 411 | INFOPLIST_FILE = "FirstAppExample/DUREX test-Info.plist"; |
412 | + IPHONEOS_DEPLOYMENT_TARGET = 6.0; | |
404 | 413 | LIBRARY_SEARCH_PATHS = ( |
405 | 414 | "$(inherited)", |
406 | 415 | EmmocoMobileFramework/Framework, |
... | ... | @@ -420,6 +429,7 @@ |
420 | 429 | GCC_PRECOMPILE_PREFIX_HEADER = YES; |
421 | 430 | GCC_PREFIX_HEADER = "FirstAppExample/DUREX test-Prefix.pch"; |
422 | 431 | INFOPLIST_FILE = "FirstAppExample/DUREX test-Info.plist"; |
432 | + IPHONEOS_DEPLOYMENT_TARGET = 6.0; | |
423 | 433 | LIBRARY_SEARCH_PATHS = ( |
424 | 434 | "$(inherited)", |
425 | 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 | 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 | 82 | [[cell detailTextLabel] setText:@"FUCKING ONLINE"]; |
83 | 83 | return cell; |
84 | 84 | } | ... | ... |
DUREX tests/FirstAppExample/Images.xcassets/AppIcon.appiconset/120 - App Icon@2x.png
DUREX tests/FirstAppExample/Images.xcassets/AppIcon.appiconset/40 - App Icon@2x.png
DUREX tests/FirstAppExample/MainStoryboard.storyboard
1 | 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 | 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 | 6 | </dependencies> |
6 | 7 | <scenes> |
7 | 8 | <!--Device Picker View Controller - Select device--> |
... | ... | @@ -78,32 +79,15 @@ |
78 | 79 | </subviews> |
79 | 80 | </tableViewCellContentView> |
80 | 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 | 83 | <rect key="frame" x="0.0" y="130" width="320" height="44"/> |
83 | 84 | <autoresizingMask key="autoresizingMask"/> |
84 | 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 | 87 | <autoresizingMask key="autoresizingMask"/> |
87 | 88 | <subviews> |
88 | 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 | 91 | <autoresizingMask key="autoresizingMask"/> |
108 | 92 | <fontDescription key="fontDescription" type="system" pointSize="18"/> |
109 | 93 | <color key="textColor" cocoaTouchSystemColor="darkTextColor"/> |
... | ... | @@ -153,7 +137,7 @@ |
153 | 137 | <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> |
154 | 138 | <subviews> |
155 | 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 | 141 | <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> |
158 | 142 | <state key="normal" backgroundImage="bluetooth.png"> |
159 | 143 | <color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/> |
... | ... | @@ -163,7 +147,7 @@ |
163 | 147 | </connections> |
164 | 148 | </button> |
165 | 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 | 151 | <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> |
168 | 152 | <fontDescription key="fontDescription" type="system" pointSize="17"/> |
169 | 153 | <color key="textColor" cocoaTouchSystemColor="darkTextColor"/> |
... | ... | @@ -191,4 +175,4 @@ |
191 | 175 | <simulatedOrientationMetrics key="orientation"/> |
192 | 176 | <simulatedScreenMetrics key="destination" type="retina4"/> |
193 | 177 | </simulatedMetricsContainer> |
194 | 178 | -</document> |
179 | +</document> | |
195 | 180 | \ No newline at end of file | ... | ... |
DUREX tests/MenuTableViewController.h
... | ... | @@ -8,32 +8,31 @@ |
8 | 8 | |
9 | 9 | #import <UIKit/UIKit.h> |
10 | 10 | #import "CommunicationProtocol.h" |
11 | +#import "Stack.h" | |
11 | 12 | |
12 | 13 | #define num(x) [NSNumber numberWithUnsignedInt:x] |
13 | 14 | |
14 | 15 | #define MENU_ELEMENTS @"Maintenance",@"Basic Configuration",@"Sending a Report" |
15 | 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 | 25 | #define NUM_CHANNELS 8 |
26 | 26 | |
27 | 27 | enum { |
28 | 28 | MENU = 0, |
29 | 29 | MAINTENANCE, |
30 | - STATUS, | |
31 | 30 | BASIC_CONFIGURATION, |
32 | 31 | REPORT, |
33 | 32 | } navigationLevel; |
34 | 33 | |
35 | 34 | @interface MenuTableViewController : UITableViewController |
36 | 35 | |
37 | -@property (strong,nonatomic) Stack parentLayout; | |
36 | +@property (strong,nonatomic) Stack *parentLayout; | |
38 | 37 | |
39 | 38 | @end | ... | ... |
DUREX tests/MenuTableViewController.m
... | ... | @@ -15,12 +15,11 @@ |
15 | 15 | } |
16 | 16 | @property (nonatomic,strong) const NSArray *menuElements; |
17 | 17 | @property (nonatomic,strong) const NSArray *menuStructure; |
18 | +@property (nonatomic,strong) const NSArray *menuHeaders; | |
18 | 19 | |
19 | 20 | @property (nonatomic,strong) const NSArray *maintenanceElements; |
20 | 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 | 24 | @property (nonatomic,strong) const NSArray *cellIdentifiers; |
26 | 25 | |
... | ... | @@ -28,7 +27,8 @@ |
28 | 27 | @property uint8_t currentNavLevel; |
29 | 28 | @property NSString *currentCellIdentifier; |
30 | 29 | @property const NSArray *currentElements; |
31 | -@property const NSArray *currentStructure; | |
30 | +@property const NSArray *currentStructure; | |
31 | +@property const NSArray *currentHeaders; | |
32 | 32 | |
33 | 33 | @end |
34 | 34 | |
... | ... | @@ -48,40 +48,62 @@ |
48 | 48 | { |
49 | 49 | [self setMenuElements:[[NSArray alloc] initWithObjects:MENU_ELEMENTS, nil]]; |
50 | 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 | 60 | [self setMaintenanceElements:[[NSArray alloc] initWithObjects:MAINTENANCE_ELEMENTS, nil]]; |
53 | 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 | 71 | [self setCellIdentifiers:[[NSArray alloc] initWithObjects:CELL_IDENTIFIERS, nil]]; |
59 | 72 | } |
60 | 73 | |
61 | 74 | - (void) changeNavLevel: (uint8_t) level |
62 | 75 | { |
76 | + [[self parentLayout] push: [NSNumber numberWithUnsignedChar:level]]; | |
63 | 77 | [self setCurrentNavLevel:level]; |
64 | 78 | [self setCurrentCellIdentifier:[[self cellIdentifiers] objectAtIndex:[self currentNavLevel]]]; |
65 | 79 | if([self currentNavLevel] == MAINTENANCE) |
66 | 80 | { |
67 | 81 | [self setCurrentElements:[self maintenanceElements]]; |
68 | 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 | 85 | //AND SO ON... |
76 | 86 | else |
77 | 87 | { |
78 | 88 | [self setCurrentElements:[self menuElements]]; |
79 | 89 | [self setCurrentStructure:[self menuStructure]]; |
90 | + [self setCurrentHeaders:[self menuHeaders]]; | |
80 | 91 | } |
92 | + [[self tableView] reloadData]; | |
81 | 93 | NSRange range = NSMakeRange(0, [self numberOfSectionsInTableView:[self tableView]]); |
82 | 94 | NSIndexSet *sections = [NSIndexSet indexSetWithIndexesInRange:range]; |
83 | 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 | 108 | - (void)viewDidLoad |
87 | 109 | { |
... | ... | @@ -101,6 +123,9 @@ |
101 | 123 | [[self navigationController] popToViewController:previous animated:YES]; |
102 | 124 | } |
103 | 125 | |
126 | + //Initialize parentLayout stack | |
127 | + [self setParentLayout:[[Stack alloc]init]]; | |
128 | + | |
104 | 129 | //Set navigation level |
105 | 130 | [self initializeMenuEntries]; |
106 | 131 | [self changeNavLevel:MENU]; |
... | ... | @@ -137,16 +162,13 @@ |
137 | 162 | |
138 | 163 | - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath |
139 | 164 | { |
165 | + NSLog(@"Section: %d Row: %d",[indexPath section],[indexPath row]); | |
140 | 166 | [tableView deselectRowAtIndexPath:indexPath animated:YES]; |
141 | 167 | NSString *cellName = [[[[self tableView] cellForRowAtIndexPath:indexPath]textLabel]text]; |
142 | 168 | if([cellName isEqualToString:@"Maintenance"]) |
143 | 169 | { |
144 | 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 | 191 | |
170 | 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 | 222 | return cell; |
177 | 223 | } |
178 | 224 | ... | ... |
DUREX tests/Stack.h
DUREX tests/Stack.m
... | ... | @@ -11,19 +11,30 @@ |
11 | 11 | @interface Stack () |
12 | 12 | |
13 | 13 | @property (strong,nonatomic) NSMutableArray *dataArray; |
14 | -@property (strong,nonatomic) NSIndex *lastPosition; | |
14 | +@property (nonatomic) NSUInteger lastPosition; | |
15 | 15 | @end |
16 | 16 | |
17 | 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 | 27 | - (void) push: (id) element |
20 | 28 | { |
21 | 29 | [[self dataArray] addObject:element]; |
30 | + printf("%d elements in array\n",[self count]); | |
22 | 31 | } |
23 | 32 | - (id) pop |
24 | 33 | { |
25 | - [[self dataArray] obj] | |
34 | + id element; | |
35 | + element = [[self dataArray] objectAtIndex:[self lastPosition]]; | |
26 | 36 | [[self dataArray] removeLastObject]; |
37 | + return element; | |
27 | 38 | } |
28 | 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