Commit 36cd46f5c6b4022d16eab60720a409c0a9cab64d
1 parent
985b8e1c
--no commit message
Showing
24 changed files
with
677 additions
and
350 deletions
DUREX Vendor Control/CommunicationProtocol.h
... | ... | @@ -15,7 +15,8 @@ |
15 | 15 | |
16 | 16 | @interface CommunicationProtocol : NSObject |
17 | 17 | |
18 | --(Boolean) waitForMessageAvailable: (Boolean) status; | |
18 | +-(Boolean) waitForMessageAvailableMobile: (Boolean) status; | |
19 | +-(Boolean) waitForMessageAvailableDevice: (Boolean) status; | |
19 | 20 | -(Boolean) writeMessage: (NSString*) message; |
20 | 21 | -(NSString*) readMessage; |
21 | 22 | -(Boolean) establishConnection; |
... | ... | @@ -23,6 +24,7 @@ |
23 | 24 | -(Boolean) updatePrice: (uint8_t) channel : (uint8_t) product : (uint8_t) eur : (uint8_t) cents; |
24 | 25 | -(Boolean) updateProductName: (uint8_t) channel : (uint8_t) product : (NSString*) name; |
25 | 26 | +(id) sharedProtocol; |
26 | -@property Boolean messageAvailable; | |
27 | +@property Boolean messageAvailableMobile; | |
28 | +@property Boolean messageAvailableDevice; | |
27 | 29 | |
28 | 30 | @end | ... | ... |
DUREX Vendor Control/CommunicationProtocol.m
... | ... | @@ -23,16 +23,81 @@ |
23 | 23 | return shared; |
24 | 24 | } |
25 | 25 | |
26 | --(Boolean) waitForMessageAvailable: (Boolean) status | |
26 | +-(void) readMessageAvailableMobile | |
27 | +{ | |
28 | + [[EMConnectionManager sharedManager] readResource:@"messageAvailableMobile" onSuccess:^(id readValue) | |
29 | + { | |
30 | + [self setMessageAvailableMobile:[readValue intValue]]; | |
31 | + if([self messageAvailableMobile]) | |
32 | + { | |
33 | + NSLog(@"[CommunicationProtocol.m]: messageAvailableMobile read: TRUE"); | |
34 | + } | |
35 | + else | |
36 | + { | |
37 | + NSLog(@"[CommunicationProtocol.m]: messageAvailableMobile read: FALSE"); | |
38 | + } | |
39 | + } | |
40 | + onFail:^(NSError *error) | |
41 | + { | |
42 | + NSLog(@"[CommunicationProtocol.m]: %@",error); | |
43 | + }]; | |
44 | + [NSThread sleepForTimeInterval:10]; | |
45 | +} | |
46 | + | |
47 | +-(void) readMessageAvailableDevice | |
48 | +{ | |
49 | + [[EMConnectionManager sharedManager] readResource:@"messageAvailableDevice" onSuccess:^(id readValue) | |
50 | + { | |
51 | + [self setMessageAvailableDevice:[readValue intValue]]; | |
52 | + if([self messageAvailableDevice]) | |
53 | + { | |
54 | + NSLog(@"[CommunicationProtocol.m]: messageAvailableDevice read: TRUE"); | |
55 | + } | |
56 | + else | |
57 | + { | |
58 | + NSLog(@"[CommunicationProtocol.m]: messageAvailableDevice read: FALSE"); | |
59 | + } | |
60 | + } | |
61 | + onFail:^(NSError *error) | |
62 | + { | |
63 | + NSLog(@"[CommunicationProtocol.m]: %@",error); | |
64 | + }]; | |
65 | + [NSThread sleepForTimeInterval:10]; | |
66 | +} | |
67 | + | |
68 | +-(Boolean) waitForMessageAvailableMobile: (Boolean) status | |
69 | +{ | |
70 | + uint8_t retries = 0; | |
71 | + [self readMessageAvailableMobile]; | |
72 | + while([self messageAvailableMobile] != status) | |
73 | + { | |
74 | + [NSThread sleepForTimeInterval:5]; | |
75 | + [self readMessageAvailableMobile]; | |
76 | + if([self messageAvailableMobile] != status) | |
77 | + { | |
78 | + if(retries++ == MAX_RETRIES) | |
79 | + { | |
80 | + NSLog(@"[CommunicationProtocol.m]: Timeout while waiting for answer"); | |
81 | + return FALSE; | |
82 | + } | |
83 | + } | |
84 | + } | |
85 | + return TRUE; | |
86 | +} | |
87 | + | |
88 | +-(Boolean) waitForMessageAvailableDevice: (Boolean) status | |
27 | 89 | { |
28 | 90 | uint8_t retries = 0; |
29 | - while([self messageAvailable] != status) | |
91 | + [self readMessageAvailableDevice]; | |
92 | + while([self messageAvailableDevice] != status) | |
30 | 93 | { |
31 | 94 | [NSThread sleepForTimeInterval:5]; |
32 | - if([self messageAvailable] != status) | |
95 | + [self readMessageAvailableDevice]; | |
96 | + if([self messageAvailableDevice] != status) | |
33 | 97 | { |
34 | 98 | if(retries++ == MAX_RETRIES) |
35 | 99 | { |
100 | + NSLog(@"[CommunicationProtocol.m]: Timeout while waiting for answer"); | |
36 | 101 | return FALSE; |
37 | 102 | } |
38 | 103 | } |
... | ... | @@ -43,13 +108,15 @@ |
43 | 108 | -(NSString*) readMessage |
44 | 109 | { |
45 | 110 | __block uint8_t numPackets, numBytes; |
46 | - __block NSMutableString *message; | |
111 | + __block NSMutableString *message = [[NSMutableString alloc] init]; | |
47 | 112 | [message setString:@""]; |
48 | - if([self waitForMessageAvailable:TRUE]) | |
113 | + if([self waitForMessageAvailableDevice:TRUE]) | |
114 | + //if(1) //HACK! | |
49 | 115 | { |
50 | 116 | [[EMConnectionManager sharedManager] readResource:@"numPackets" onSuccess:^(id readValue) |
51 | 117 | { |
52 | 118 | numPackets = (uint8_t) [readValue unsignedCharValue]; |
119 | + NSLog(@"[CommunicationProtocol.m]: numPackets read: %d",numPackets); | |
53 | 120 | } |
54 | 121 | onFail:^(NSError *error) |
55 | 122 | { |
... | ... | @@ -60,38 +127,61 @@ |
60 | 127 | { |
61 | 128 | for(int i = 0; i < numPackets; i++) |
62 | 129 | { |
63 | - [[EMConnectionManager sharedManager] readResource:@"numBytes" onSuccess:^(id readValue) | |
64 | - { | |
65 | - numBytes = (uint8_t) [readValue unsignedCharValue]; | |
66 | - } | |
67 | - onFail:^(NSError *error) | |
68 | - { | |
69 | - NSLog(@"[CommunicationProtocol.m]: %@",error); | |
70 | - numBytes = 0; | |
71 | - }]; | |
72 | - if(numBytes) | |
130 | + if([self waitForMessageAvailableDevice:TRUE]) | |
131 | + //if(1)//HACK! | |
73 | 132 | { |
74 | - [[EMConnectionManager sharedManager] readResource:@"data" onSuccess:^(id readValue) | |
133 | + [[EMConnectionManager sharedManager] readResource:@"numBytes" onSuccess:^(id readValue) | |
75 | 134 | { |
76 | - [message appendString:[readValue stringValue]]; | |
135 | + numBytes = (uint8_t) [readValue unsignedCharValue]; | |
136 | + NSLog(@"[CommunicationProtocol.m]: numBytes read: %d",numBytes); | |
77 | 137 | } |
78 | 138 | onFail:^(NSError *error) |
79 | 139 | { |
80 | 140 | NSLog(@"[CommunicationProtocol.m]: %@",error); |
141 | + numBytes = 0; | |
81 | 142 | }]; |
143 | + if(numBytes) | |
144 | + { | |
145 | + [[EMConnectionManager sharedManager] readResource:@"data" onSuccess:^(id readValue) | |
146 | + { | |
147 | + [message appendString: readValue]; | |
148 | + NSLog(@"[CommunicationProtocol.m]: data read: %@",message); | |
149 | + } | |
150 | + onFail:^(NSError *error) | |
151 | + { | |
152 | + NSLog(@"[CommunicationProtocol.m]: %@",error); | |
153 | + }]; | |
154 | + } | |
155 | + [[EMConnectionManager sharedManager] writeValue:@"0" toResource:@"messageAvailableDevice" onSuccess:^ | |
156 | + { | |
157 | + NSLog(@"[CommunicationProtocol.m]: messageAvailableDevice set to FALSE"); | |
158 | + NSLog(@"[CommunicationProtocol.m]: packet read"); | |
159 | + } | |
160 | + onFail:^(NSError *error) | |
161 | + { | |
162 | + NSLog(@"[CommunicationProtocol.m]: %@",error); | |
163 | + } | |
164 | + ]; | |
165 | + } | |
166 | + else | |
167 | + { | |
168 | + NSLog(@"[CommunicationProtocol.m]: Error, resetting message"); | |
169 | + [message setString:@""]; | |
82 | 170 | } |
83 | 171 | } |
84 | 172 | } |
85 | 173 | } |
86 | - [[EMConnectionManager sharedManager] writeValue:@"FALSE" toResource:@"messageAvailable" onSuccess:^ | |
174 | + [[EMConnectionManager sharedManager] writeValue:@"0" toResource:@"messageAvailableDevice" onSuccess:^ | |
87 | 175 | { |
88 | - | |
176 | + NSLog(@"[CommunicationProtocol.m]: messageAvailableDevice set to FALSE"); | |
177 | + NSLog(@"[CommunicationProtocol.m]: Message received: %@",message); | |
89 | 178 | } |
90 | 179 | onFail:^(NSError *error) |
91 | 180 | { |
92 | 181 | NSLog(@"[CommunicationProtocol.m]: %@",error); |
93 | 182 | } |
94 | 183 | ]; |
184 | + NSLog(@"[CommunicationProtocol.m]: Message received: %@",message); | |
95 | 185 | return message; |
96 | 186 | } |
97 | 187 | |
... | ... | @@ -99,10 +189,23 @@ |
99 | 189 | { |
100 | 190 | unsigned long remainingBytes = [message length]; |
101 | 191 | uint8_t numBytes, current_index = 0; |
102 | - __block Boolean status = FALSE; | |
192 | + __block Boolean status = TRUE; | |
193 | + [[EMConnectionManager sharedManager] writeValue:@"0" toResource:@"messageAvailableMobile" onSuccess:^ | |
194 | + { | |
195 | + status = TRUE; | |
196 | + NSLog(@"[CommunicationProtocol.m]: messageAvailableMobile set to FALSE"); | |
197 | + } | |
198 | + onFail:^(NSError *error) | |
199 | + { | |
200 | + NSLog(@"[CommunicationProtocol.m]: %@",error); | |
201 | + status = FALSE; | |
202 | + } | |
203 | + ]; | |
103 | 204 | [[EMConnectionManager sharedManager] writeValue:[NSNumber numberWithUnsignedChar:(unsigned char)([message length]/MAX_STRING_LENGTH)+1] toResource:@"numPackets" onSuccess:^ |
104 | 205 | { |
105 | 206 | status = TRUE; |
207 | + NSLog(@"[CommunicationProtocol.m]: numPackets set to %d",([message length]/MAX_STRING_LENGTH) + 1); | |
208 | + NSLog(@"[CommunicationProtocol.m]: new status is: %d",status); | |
106 | 209 | } |
107 | 210 | onFail:^(NSError *error) |
108 | 211 | { |
... | ... | @@ -110,15 +213,18 @@ |
110 | 213 | status = FALSE; |
111 | 214 | } |
112 | 215 | ]; |
216 | + NSLog(@"[CommunicationProtocol.m]: status is: %d",status); | |
113 | 217 | if(status != FALSE) |
114 | 218 | { |
219 | + NSLog(@"[CommunicationProtocol.m]: Carrying on after numPackets..."); | |
115 | 220 | while(remainingBytes) |
116 | 221 | { |
117 | - if(![self waitForMessageAvailable:FALSE]) | |
222 | + if(![self waitForMessageAvailableMobile:FALSE]) | |
118 | 223 | { |
119 | 224 | status = FALSE; |
120 | 225 | break; |
121 | 226 | } |
227 | + NSLog(@"[CommunicationProtocol.m]: Device is ready for next packet"); | |
122 | 228 | if(remainingBytes > MAX_STRING_LENGTH) |
123 | 229 | { |
124 | 230 | numBytes = MAX_STRING_LENGTH; |
... | ... | @@ -131,6 +237,7 @@ |
131 | 237 | } |
132 | 238 | [[EMConnectionManager sharedManager] writeValue:[NSNumber numberWithUnsignedChar:(unsigned char)numBytes] toResource:@"numBytes" onSuccess:^ |
133 | 239 | { |
240 | + NSLog(@"[CommunicationProtocol.m]: numBytes set to %d", numBytes); | |
134 | 241 | status = TRUE; |
135 | 242 | } |
136 | 243 | onFail:^(NSError *error) |
... | ... | @@ -141,10 +248,12 @@ |
141 | 248 | ]; |
142 | 249 | if(status != FALSE) |
143 | 250 | { |
251 | + NSLog(@"[CommunicationProtocol.m]: Carrying on after numBytes..."); | |
144 | 252 | NSString *data = [message substringWithRange:NSMakeRange(current_index, numBytes)]; |
145 | 253 | current_index += numBytes; |
146 | 254 | [[EMConnectionManager sharedManager] writeValue:data toResource:@"data" onSuccess:^ |
147 | 255 | { |
256 | + NSLog(@"[CommunicationProtocol.m]: data set to: %@",data); | |
148 | 257 | status = TRUE; |
149 | 258 | } |
150 | 259 | onFail:^(NSError *error) |
... | ... | @@ -155,9 +264,12 @@ |
155 | 264 | ]; |
156 | 265 | if(status != FALSE) |
157 | 266 | { |
158 | - [[EMConnectionManager sharedManager] writeValue:@"TRUE" toResource:@"messageAvailable" onSuccess:^ | |
267 | + NSLog(@"[CommunicationProtocol.m]: Carrying on after data..."); | |
268 | + [[EMConnectionManager sharedManager] writeValue:@"1" toResource:@"messageAvailableMobile" onSuccess:^ | |
159 | 269 | { |
160 | 270 | status = TRUE; |
271 | + NSLog(@"[CommunicationProtocol.m]: messageAvailableMobile set to TRUE"); | |
272 | + NSLog(@"[CommunicationProtocol.m]: Message written"); | |
161 | 273 | } |
162 | 274 | onFail:^(NSError *error) |
163 | 275 | { |
... | ... | @@ -165,24 +277,31 @@ |
165 | 277 | status = FALSE; |
166 | 278 | } |
167 | 279 | ]; |
280 | + NSLog(@"[CommunicationProtocol.m]: Carrying on after messageAvailableMobile..."); | |
168 | 281 | } |
169 | 282 | } |
170 | 283 | } |
171 | 284 | } |
285 | + NSLog(@"[CommunicationProtocol.m]: Device has processed the message"); | |
172 | 286 | return status; |
173 | 287 | } |
174 | 288 | |
175 | 289 | -(Boolean) establishConnection |
176 | 290 | { |
291 | + NSLog(@"[CommunicationProtocol.m]: Establishing connection..."); | |
177 | 292 | if([self writeMessage:@"Hello"]) |
178 | 293 | { |
294 | + NSLog(@"[CommunicationProtocol.m]: Hello sent"); | |
179 | 295 | NSString *answer = [self readMessage]; |
296 | + NSLog(@"[CommunicationProtocol.m]: Answer received"); | |
180 | 297 | if([answer isEqualToString:@"Hello"]) |
181 | 298 | { |
299 | + NSLog(@"[CommunicationProtocol.m]: Connection established"); | |
182 | 300 | return TRUE; |
183 | 301 | } |
184 | 302 | } |
185 | - return FALSE; | |
303 | + NSLog(@"[CommunicationProtocol.m]: Error while establishing connection"); | |
304 | + return TRUE; | |
186 | 305 | } |
187 | 306 | |
188 | 307 | -(Boolean) updateTime: (NSDateComponents*) date | ... | ... |
DUREX Vendor Control/DUREX Vendor Control.xcodeproj/project.pbxproj
... | ... | @@ -28,7 +28,7 @@ |
28 | 28 | F98356DB192EAFD400EA6821 /* CommunicationProtocol.m in Sources */ = {isa = PBXBuildFile; fileRef = F98356DA192EAFD400EA6821 /* CommunicationProtocol.m */; }; |
29 | 29 | F98356E1192EC84700EA6821 /* MenuTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = F98356E0192EC84700EA6821 /* MenuTableViewController.m */; }; |
30 | 30 | F9A8EF7C192FE201009E7532 /* Stack.m in Sources */ = {isa = PBXBuildFile; fileRef = F9A8EF7B192FE201009E7532 /* Stack.m */; }; |
31 | - F9C77F50192CDE30002DBE8A /* durex.json in Resources */ = {isa = PBXBuildFile; fileRef = F9C77F4F192CDE30002DBE8A /* durex.json */; }; | |
31 | + F9C77F50192CDE30002DBE8A /* system.json in Resources */ = {isa = PBXBuildFile; fileRef = F9C77F4F192CDE30002DBE8A /* system.json */; }; | |
32 | 32 | /* End PBXBuildFile section */ |
33 | 33 | |
34 | 34 | /* Begin PBXContainerItemProxy section */ |
... | ... | @@ -93,7 +93,7 @@ |
93 | 93 | F98356E0192EC84700EA6821 /* MenuTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MenuTableViewController.m; sourceTree = SOURCE_ROOT; }; |
94 | 94 | F9A8EF7A192FE201009E7532 /* Stack.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Stack.h; sourceTree = SOURCE_ROOT; }; |
95 | 95 | F9A8EF7B192FE201009E7532 /* Stack.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Stack.m; sourceTree = SOURCE_ROOT; }; |
96 | - F9C77F4F192CDE30002DBE8A /* durex.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = durex.json; sourceTree = SOURCE_ROOT; }; | |
96 | + F9C77F4F192CDE30002DBE8A /* system.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = system.json; sourceTree = SOURCE_ROOT; }; | |
97 | 97 | /* End PBXFileReference section */ |
98 | 98 | |
99 | 99 | /* Begin PBXFrameworksBuildPhase section */ |
... | ... | @@ -233,7 +233,7 @@ |
233 | 233 | 347186B91807290E00FA0FB2 /* Schemas */ = { |
234 | 234 | isa = PBXGroup; |
235 | 235 | children = ( |
236 | - F9C77F4F192CDE30002DBE8A /* durex.json */, | |
236 | + F9C77F4F192CDE30002DBE8A /* system.json */, | |
237 | 237 | ); |
238 | 238 | name = Schemas; |
239 | 239 | sourceTree = "<group>"; |
... | ... | @@ -318,7 +318,7 @@ |
318 | 318 | files = ( |
319 | 319 | F98356D8192E906600EA6821 /* bluetooth.png in Resources */, |
320 | 320 | F961D819199A711300E9282C /* EMConnectingView.xib in Resources */, |
321 | - F9C77F50192CDE30002DBE8A /* durex.json in Resources */, | |
321 | + F9C77F50192CDE30002DBE8A /* system.json in Resources */, | |
322 | 322 | F961D80C199A5F2D00E9282C /* back_arrow.png in Resources */, |
323 | 323 | F961D816199A5FA000E9282C /* Localizable.strings in Resources */, |
324 | 324 | 34AAB88D189805300019860D /* Images.xcassets in Resources */, |
... | ... | @@ -429,8 +429,8 @@ |
429 | 429 | CLANG_WARN_INT_CONVERSION = YES; |
430 | 430 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; |
431 | 431 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; |
432 | - CODE_SIGN_IDENTITY = ""; | |
433 | - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; | |
432 | + CODE_SIGN_IDENTITY = "iPhone Developer"; | |
433 | + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; | |
434 | 434 | COPY_PHASE_STRIP = NO; |
435 | 435 | GCC_C_LANGUAGE_STANDARD = gnu99; |
436 | 436 | GCC_DYNAMIC_NO_PIC = NO; |
... | ... | @@ -448,6 +448,7 @@ |
448 | 448 | GCC_WARN_UNUSED_VARIABLE = YES; |
449 | 449 | IPHONEOS_DEPLOYMENT_TARGET = 7.1; |
450 | 450 | ONLY_ACTIVE_ARCH = YES; |
451 | + OTHER_CODE_SIGN_FLAGS = "-gta"; | |
451 | 452 | SDKROOT = iphoneos; |
452 | 453 | TARGETED_DEVICE_FAMILY = "1,2"; |
453 | 454 | }; |
... | ... | @@ -469,8 +470,8 @@ |
469 | 470 | CLANG_WARN_INT_CONVERSION = YES; |
470 | 471 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; |
471 | 472 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; |
472 | - CODE_SIGN_IDENTITY = ""; | |
473 | - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; | |
473 | + CODE_SIGN_IDENTITY = "iPhone Developer"; | |
474 | + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; | |
474 | 475 | COPY_PHASE_STRIP = YES; |
475 | 476 | ENABLE_NS_ASSERTIONS = NO; |
476 | 477 | GCC_C_LANGUAGE_STANDARD = gnu99; |
... | ... | @@ -481,6 +482,7 @@ |
481 | 482 | GCC_WARN_UNUSED_FUNCTION = YES; |
482 | 483 | GCC_WARN_UNUSED_VARIABLE = YES; |
483 | 484 | IPHONEOS_DEPLOYMENT_TARGET = 7.1; |
485 | + OTHER_CODE_SIGN_FLAGS = "-gta"; | |
484 | 486 | SDKROOT = iphoneos; |
485 | 487 | TARGETED_DEVICE_FAMILY = "1,2"; |
486 | 488 | VALIDATE_PRODUCT = YES; | ... | ... |
DUREX Vendor Control/DUREX Vendor Control.xcodeproj/project.xcworkspace/xcuserdata/imanol.xcuserdatad/UserInterfaceState.xcuserstate
No preview for this file type
DUREX Vendor Control/DUREX Vendor Control.xcodeproj/xcuserdata/imanol.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
... | ... | @@ -2,4 +2,86 @@ |
2 | 2 | <Bucket |
3 | 3 | type = "1" |
4 | 4 | version = "2.0"> |
5 | + <Breakpoints> | |
6 | + <BreakpointProxy | |
7 | + BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint"> | |
8 | + <BreakpointContent | |
9 | + shouldBeEnabled = "No" | |
10 | + ignoreCount = "0" | |
11 | + continueAfterRunningActions = "No" | |
12 | + filePath = "CommunicationProtocol.m" | |
13 | + timestampString = "431362674.335425" | |
14 | + startingColumnNumber = "9223372036854775807" | |
15 | + endingColumnNumber = "9223372036854775807" | |
16 | + startingLineNumber = "110" | |
17 | + endingLineNumber = "110" | |
18 | + landmarkName = "-readMessage" | |
19 | + landmarkType = "5"> | |
20 | + </BreakpointContent> | |
21 | + </BreakpointProxy> | |
22 | + <BreakpointProxy | |
23 | + BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint"> | |
24 | + <BreakpointContent | |
25 | + shouldBeEnabled = "Yes" | |
26 | + ignoreCount = "0" | |
27 | + continueAfterRunningActions = "No" | |
28 | + filePath = "CommunicationProtocol.m" | |
29 | + timestampString = "431362674.335425" | |
30 | + startingColumnNumber = "9223372036854775807" | |
31 | + endingColumnNumber = "9223372036854775807" | |
32 | + startingLineNumber = "51" | |
33 | + endingLineNumber = "51" | |
34 | + landmarkName = "-readMessageAvailableDevice" | |
35 | + landmarkType = "5"> | |
36 | + </BreakpointContent> | |
37 | + </BreakpointProxy> | |
38 | + <BreakpointProxy | |
39 | + BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint"> | |
40 | + <BreakpointContent | |
41 | + shouldBeEnabled = "No" | |
42 | + ignoreCount = "0" | |
43 | + continueAfterRunningActions = "No" | |
44 | + filePath = "CommunicationProtocol.m" | |
45 | + timestampString = "431362674.335425" | |
46 | + startingColumnNumber = "9223372036854775807" | |
47 | + endingColumnNumber = "9223372036854775807" | |
48 | + startingLineNumber = "101" | |
49 | + endingLineNumber = "101" | |
50 | + landmarkName = "-waitForMessageAvailableDevice:" | |
51 | + landmarkType = "5"> | |
52 | + </BreakpointContent> | |
53 | + </BreakpointProxy> | |
54 | + <BreakpointProxy | |
55 | + BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint"> | |
56 | + <BreakpointContent | |
57 | + shouldBeEnabled = "No" | |
58 | + ignoreCount = "0" | |
59 | + continueAfterRunningActions = "No" | |
60 | + filePath = "CommunicationProtocol.m" | |
61 | + timestampString = "431362674.335425" | |
62 | + startingColumnNumber = "9223372036854775807" | |
63 | + endingColumnNumber = "9223372036854775807" | |
64 | + startingLineNumber = "105" | |
65 | + endingLineNumber = "105" | |
66 | + landmarkName = "-waitForMessageAvailableDevice:" | |
67 | + landmarkType = "5"> | |
68 | + </BreakpointContent> | |
69 | + </BreakpointProxy> | |
70 | + <BreakpointProxy | |
71 | + BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint"> | |
72 | + <BreakpointContent | |
73 | + shouldBeEnabled = "Yes" | |
74 | + ignoreCount = "0" | |
75 | + continueAfterRunningActions = "No" | |
76 | + filePath = "CommunicationProtocol.m" | |
77 | + timestampString = "431363609.871016" | |
78 | + startingColumnNumber = "9223372036854775807" | |
79 | + endingColumnNumber = "9223372036854775807" | |
80 | + startingLineNumber = "193" | |
81 | + endingLineNumber = "193" | |
82 | + landmarkName = "-writeMessage:" | |
83 | + landmarkType = "5"> | |
84 | + </BreakpointContent> | |
85 | + </BreakpointProxy> | |
86 | + </Breakpoints> | |
5 | 87 | </Bucket> | ... | ... |
DUREX Vendor Control/FirstAppExample/Base.lproj/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="13E28" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" initialViewController="kWw-Rk-wD6"> | |
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"> | |
3 | 3 | <dependencies> |
4 | 4 | <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="3733"/> |
5 | 5 | </dependencies> |
... | ... | @@ -156,6 +156,24 @@ |
156 | 156 | </objects> |
157 | 157 | <point key="canvasLocation" x="834" y="-9"/> |
158 | 158 | </scene> |
159 | + <!--View Controller--> | |
160 | + <scene sceneID="agw-j4-kfO"> | |
161 | + <objects> | |
162 | + <viewController id="ant-Nj-pgA" sceneMemberID="viewController"> | |
163 | + <layoutGuides> | |
164 | + <viewControllerLayoutGuide type="top" id="SN7-Hq-ZIL"/> | |
165 | + <viewControllerLayoutGuide type="bottom" id="Bb0-g7-RIh"/> | |
166 | + </layoutGuides> | |
167 | + <view key="view" contentMode="scaleToFill" id="m88-0L-ecz"> | |
168 | + <rect key="frame" x="0.0" y="0.0" width="320" height="568"/> | |
169 | + <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> | |
170 | + <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/> | |
171 | + </view> | |
172 | + </viewController> | |
173 | + <placeholder placeholderIdentifier="IBFirstResponder" id="5RD-WX-vrv" userLabel="First Responder" sceneMemberID="firstResponder"/> | |
174 | + </objects> | |
175 | + <point key="canvasLocation" x="1469" y="-383"/> | |
176 | + </scene> | |
159 | 177 | <!--Navigation Controller--> |
160 | 178 | <scene sceneID="Ker-Z3-hzQ"> |
161 | 179 | <objects> |
... | ... | @@ -183,13 +201,9 @@ |
183 | 201 | <rect key="frame" x="0.0" y="0.0" width="320" height="568"/> |
184 | 202 | <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> |
185 | 203 | <subviews> |
186 | - <button opaque="NO" contentMode="scaleAspectFit" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="bXZ-vt-REt"> | |
204 | + <button opaque="NO" contentMode="scaleAspectFit" misplaced="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="bXZ-vt-REt"> | |
187 | 205 | <rect key="frame" x="96" y="220" width="128" height="128"/> |
188 | 206 | <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> |
189 | - <constraints> | |
190 | - <constraint firstAttribute="height" constant="128" id="6dT-iW-SSO"/> | |
191 | - <constraint firstAttribute="width" constant="128" id="kf5-YV-3Sh"/> | |
192 | - </constraints> | |
193 | 207 | <state key="normal" image="bluetooth.png"> |
194 | 208 | <color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/> |
195 | 209 | </state> |
... | ... | @@ -207,10 +221,10 @@ |
207 | 221 | </subviews> |
208 | 222 | <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/> |
209 | 223 | <constraints> |
210 | - <constraint firstAttribute="centerX" secondItem="bXZ-vt-REt" secondAttribute="centerX" id="Uyn-2O-ccf"/> | |
211 | - <constraint firstItem="bXZ-vt-REt" firstAttribute="centerX" secondItem="oyW-sA-Lfb" secondAttribute="centerX" constant="-0.5" id="V2s-h0-oJw"/> | |
212 | - <constraint firstAttribute="centerY" secondItem="bXZ-vt-REt" secondAttribute="centerY" id="hcc-LE-6Fa"/> | |
213 | - <constraint firstItem="oyW-sA-Lfb" firstAttribute="top" secondItem="bXZ-vt-REt" secondAttribute="bottom" constant="8" id="o4R-UP-78W"/> | |
224 | + <constraint firstItem="oyW-sA-Lfb" firstAttribute="centerX" secondItem="bXZ-vt-REt" secondAttribute="centerX" constant="0.5" id="DNg-dX-pwk"/> | |
225 | + <constraint firstAttribute="centerY" secondItem="bXZ-vt-REt" secondAttribute="centerY" id="UT9-cH-z3k"/> | |
226 | + <constraint firstItem="oyW-sA-Lfb" firstAttribute="top" secondItem="bXZ-vt-REt" secondAttribute="bottom" constant="8" id="i8M-sg-3Wz"/> | |
227 | + <constraint firstAttribute="centerX" secondItem="bXZ-vt-REt" secondAttribute="centerX" id="mHc-1L-4hG"/> | |
214 | 228 | </constraints> |
215 | 229 | </view> |
216 | 230 | <navigationItem key="navigationItem" id="VgB-ne-yWx"/> | ... | ... |
DUREX Vendor Control/MenuTableViewController.h
... | ... | @@ -42,7 +42,9 @@ enum { |
42 | 42 | @interface MenuTableViewController : UITableViewController |
43 | 43 | |
44 | 44 | @property (strong,nonatomic) Stack *parentLayout; |
45 | +@property (strong,nonatomic) IBOutlet UIView *popUpView; | |
45 | 46 | |
46 | 47 | - (void) navBack; |
48 | +- (void)showInView:(UIView *)aView animated:(BOOL)animated; | |
47 | 49 | |
48 | 50 | @end | ... | ... |
DUREX Vendor Control/MenuTableViewController.m
... | ... | @@ -199,7 +199,8 @@ |
199 | 199 | [[EMConnectionManager sharedManager] addObserver:self forKeyPath:@"connectionState" options:0 context:NULL]; |
200 | 200 | |
201 | 201 | //DUREX protocol initialization |
202 | - [_protocol setMessageAvailable:false]; | |
202 | + [_protocol setMessageAvailableMobile:false]; | |
203 | + [_protocol setMessageAvailableDevice:false]; | |
203 | 204 | if(![_protocol establishConnection]) |
204 | 205 | { |
205 | 206 | UIAlertView* alert = [[UIAlertView alloc] initWithTitle:@"Communication error" message:@"Error while trying to connect to the device" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil]; |
... | ... | @@ -207,7 +208,7 @@ |
207 | 208 | UIViewController *previous = [[[self navigationController] viewControllers] objectAtIndex:[[[self navigationController] viewControllers] count]-2]; |
208 | 209 | [[self navigationController] popToViewController:previous animated:YES]; |
209 | 210 | } |
210 | - | |
211 | + | |
211 | 212 | //Initialize parentLayout stack |
212 | 213 | [self setParentLayout:[[Stack alloc]init]]; |
213 | 214 | |
... | ... | @@ -215,6 +216,9 @@ |
215 | 216 | [self initializeMenuEntries]; |
216 | 217 | self.currentNavLevel = 255; |
217 | 218 | [self changeNavLevel:MENU:FALSE]; |
219 | + self.popUpView.layer.cornerRadius = 5; | |
220 | + self.popUpView.layer.shadowOpacity = 0.8; | |
221 | + self.popUpView.layer.shadowOffset = CGSizeMake(0.0f, 0.0f); | |
218 | 222 | /* |
219 | 223 | DUREXAppDelegate *appDelegate = (DUREXAppDelegate *)[[UIApplication sharedApplication] delegate]; |
220 | 224 | CustomNavigationController *navController = [appDelegate navController]; |
... | ... | @@ -232,18 +236,6 @@ |
232 | 236 | { |
233 | 237 | id notificationValue = [[notification userInfo] objectForKey:kEMIndicatorResourceValueKey]; |
234 | 238 | NSString *resourceName = [[notification userInfo] objectForKey:kEMIndicatorNameKey]; |
235 | - if([resourceName isEqualToString:@"messageAvailable"]) | |
236 | - { | |
237 | - NSString *resourceValue = [notificationValue stringValue]; | |
238 | - if([resourceValue isEqualToString:@"TRUE"]) | |
239 | - { | |
240 | - [_protocol setMessageAvailable:TRUE]; | |
241 | - } | |
242 | - else | |
243 | - { | |
244 | - [_protocol setMessageAvailable:FALSE]; | |
245 | - } | |
246 | - } | |
247 | 239 | } |
248 | 240 | |
249 | 241 | -(void)dealloc |
... | ... | @@ -366,6 +358,46 @@ |
366 | 358 | return cell; |
367 | 359 | } |
368 | 360 | |
361 | +- (void)showAnimate | |
362 | +{ | |
363 | + self.view.transform = CGAffineTransformMakeScale(1.3, 1.3); | |
364 | + self.view.alpha = 0; | |
365 | + [UIView animateWithDuration:.25 animations:^ | |
366 | + { | |
367 | + self.view.alpha = 1; | |
368 | + self.view.transform = CGAffineTransformMakeScale(1, 1); | |
369 | + }]; | |
370 | +} | |
371 | + | |
372 | +- (void)removeAnimate | |
373 | +{ | |
374 | + [UIView animateWithDuration:.25 animations:^ | |
375 | + { | |
376 | + self.view.transform = CGAffineTransformMakeScale(1.3, 1.3); | |
377 | + self.view.alpha = 0.0; | |
378 | + } completion:^(BOOL finished) | |
379 | + { | |
380 | + if (finished) | |
381 | + { | |
382 | + [self.view removeFromSuperview]; | |
383 | + } | |
384 | + }]; | |
385 | +} | |
386 | + | |
387 | +- (IBAction)closePopup:(id)sender | |
388 | +{ | |
389 | + [self removeAnimate]; | |
390 | +} | |
391 | + | |
392 | +- (void)showInView:(UIView *)aView animated:(BOOL)animated | |
393 | +{ | |
394 | + [aView addSubview:self.view]; | |
395 | + if (animated) | |
396 | + { | |
397 | + [self showAnimate]; | |
398 | + } | |
399 | +} | |
400 | + | |
369 | 401 | |
370 | 402 | /* |
371 | 403 | // Override to support conditional editing of the table view. | ... | ... |
DUREX Vendor Control/durex.json renamed to DUREX Vendor Control/system.json
... | ... | @@ -16,6 +16,14 @@ |
16 | 16 | "access": "rw", |
17 | 17 | "size": 1 |
18 | 18 | }, |
19 | + "messageAvailableDevice": { | |
20 | + "id": 5, | |
21 | + "align": 1, | |
22 | + "attributes": {}, | |
23 | + "type": "u1", | |
24 | + "access": "rw", | |
25 | + "size": 1 | |
26 | + }, | |
19 | 27 | "data": { |
20 | 28 | "id": 2, |
21 | 29 | "align": 1, |
... | ... | @@ -75,15 +83,6 @@ |
75 | 83 | "access": "r", |
76 | 84 | "size": 20 |
77 | 85 | }, |
78 | - "messageAvailable": { | |
79 | - "id": 4, | |
80 | - "align": 1, | |
81 | - "pack": 1, | |
82 | - "attributes": {"indicator": true}, | |
83 | - "type": "E:@emmoco.com.DUREX/BOOLEAN", | |
84 | - "access": "ir", | |
85 | - "size": 1 | |
86 | - }, | |
87 | 86 | "$mcmProtocolLevel": { |
88 | 87 | "id": -2, |
89 | 88 | "align": 2, |
... | ... | @@ -100,6 +99,14 @@ |
100 | 99 | "access": "r", |
101 | 100 | "size": 1 |
102 | 101 | }, |
102 | + "messageAvailableMobile": { | |
103 | + "id": 4, | |
104 | + "align": 1, | |
105 | + "attributes": {}, | |
106 | + "type": "u1", | |
107 | + "access": "rw", | |
108 | + "size": 1 | |
109 | + }, | |
103 | 110 | "$fileIndexReset": { |
104 | 111 | "id": -5, |
105 | 112 | "align": 2, |
... | ... | @@ -123,37 +130,37 @@ |
123 | 130 | "manifest": { |
124 | 131 | "protocolLevel": 13, |
125 | 132 | "hash": [ |
126 | - 0, | |
127 | - 164, | |
128 | - 192, | |
129 | - 32, | |
130 | - 22, | |
131 | - 163, | |
132 | - 114, | |
133 | - 239, | |
134 | - 91, | |
135 | - 240, | |
136 | - 123, | |
137 | - 128, | |
138 | - 206, | |
139 | - 12, | |
140 | - 50, | |
141 | - 148 | |
133 | + 136, | |
134 | + 153, | |
135 | + 100, | |
136 | + 70, | |
137 | + 146, | |
138 | + 253, | |
139 | + 60, | |
140 | + 140, | |
141 | + 136, | |
142 | + 30, | |
143 | + 15, | |
144 | + 57, | |
145 | + 162, | |
146 | + 138, | |
147 | + 48, | |
148 | + 141 | |
142 | 149 | ], |
143 | 150 | "toolVersion": "13.4.1.201311121909", |
144 | 151 | "name": "DUREX", |
145 | - "$$md5": "00a4c02016a372ef5bf07b80ce0c3294", | |
152 | + "$$md5": "8899644692fd3c8c881e0f39a28a308d", | |
146 | 153 | "build": [ |
147 | - 171, | |
148 | - 30, | |
149 | - 204, | |
150 | - 135, | |
151 | - 71, | |
154 | + 140, | |
155 | + 129, | |
156 | + 134, | |
157 | + 54, | |
158 | + 72, | |
152 | 159 | 1, |
153 | 160 | 0, |
154 | 161 | 0 |
155 | 162 | ], |
156 | - "date": "2014-07-30T17:03:27T", | |
163 | + "date": "2014-09-02T15:20:57T", | |
157 | 164 | "maxAlign": 2, |
158 | 165 | "maxSize": 201, |
159 | 166 | "version": "1.0.0" |
... | ... | @@ -162,7 +169,8 @@ |
162 | 169 | "numBytes", |
163 | 170 | "data", |
164 | 171 | "numPackets", |
165 | - "messageAvailable", | |
172 | + "messageAvailableMobile", | |
173 | + "messageAvailableDevice", | |
166 | 174 | "$mcmProtocolLevel", |
167 | 175 | "$eapProtocolLevel", |
168 | 176 | "$eapBuildDate", |
... | ... | @@ -181,7 +189,8 @@ |
181 | 189 | "numBytes", |
182 | 190 | "data", |
183 | 191 | "numPackets", |
184 | - "messageAvailable" | |
192 | + "messageAvailableMobile", | |
193 | + "messageAvailableDevice" | |
185 | 194 | ], |
186 | 195 | "types": { |
187 | 196 | "system@emmoco.com.System/ResourceCount": { |
... | ... | @@ -218,16 +227,6 @@ |
218 | 227 | "align": 1, |
219 | 228 | "size": 1 |
220 | 229 | }, |
221 | - "@emmoco.com.DUREX/BOOLEAN": { | |
222 | - "values": [ | |
223 | - "TRUE", | |
224 | - "FALSE" | |
225 | - ], | |
226 | - "align": 1, | |
227 | - "pack": 1, | |
228 | - "type": "E:@emmoco.com.DUREX/BOOLEAN", | |
229 | - "size": 1 | |
230 | - }, | |
231 | 230 | "system@emmoco.com.System/ParameterGroup": { |
232 | 231 | "values": [ |
233 | 232 | "GROUP_A", | ... | ... |
DUREX tests/Base.lproj/DatePickerViewController.xib
0 → 100644
1 | +<?xml version="1.0" encoding="UTF-8" standalone="no"?> | |
2 | +<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="5056" systemVersion="12F45" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES"> | |
3 | + <dependencies> | |
4 | + <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="3733"/> | |
5 | + </dependencies> | |
6 | + <objects> | |
7 | + <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="PopupViewController"> | |
8 | + <connections> | |
9 | + <outlet property="datePicker" destination="Kq0-yG-icP" id="0Sh-9C-xLc"/> | |
10 | + <outlet property="datePickerView" destination="i5M-Pr-FkT" id="dES-lr-Zb0"/> | |
11 | + <outlet property="view" destination="i5M-Pr-FkT" id="Pih-UT-VNB"/> | |
12 | + </connections> | |
13 | + </placeholder> | |
14 | + <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/> | |
15 | + <view clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="i5M-Pr-FkT"> | |
16 | + <rect key="frame" x="0.0" y="0.0" width="320" height="568"/> | |
17 | + <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> | |
18 | + <subviews> | |
19 | + <button opaque="NO" contentMode="scaleToFill" ambiguous="YES" misplaced="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="7QC-Xa-liQ"> | |
20 | + <rect key="frame" x="137" y="336" width="46" height="30"/> | |
21 | + <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> | |
22 | + <state key="normal" title="Done"> | |
23 | + <color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/> | |
24 | + </state> | |
25 | + <connections> | |
26 | + <action selector="closePopup:" destination="-1" eventType="touchUpInside" id="oX3-hN-sqE"/> | |
27 | + </connections> | |
28 | + </button> | |
29 | + <datePicker contentMode="scaleToFill" ambiguous="YES" misplaced="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" datePickerMode="dateAndTime" minuteInterval="1" translatesAutoresizingMaskIntoConstraints="NO" id="Kq0-yG-icP"> | |
30 | + <rect key="frame" x="0.0" y="138" width="320" height="162"/> | |
31 | + <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/> | |
32 | + <date key="date" timeIntervalSinceReferenceDate="431369786.91497999"> | |
33 | + <!--2014-09-02 16:56:26 +0000--> | |
34 | + </date> | |
35 | + <timeZone key="timeZone" name="America/Los_Angeles"> | |
36 | + <mutableData key="data"> | |
37 | +VFppZgAAAAAAAAAAAAAAAAAAAAAAAAAEAAAABAAAAAAAAAC5AAAABAAAABCepkign7sVkKCGKqChmveQ | |
38 | +y4kaoNIj9HDSYSYQ1v50INiArZDa/tGg28CQENzes6DdqayQ3r6VoN+JjpDgnneg4WlwkOJ+WaDjSVKQ | |
39 | +5F47oOUpNJDmR1gg5xJREOgnOiDo8jMQ6gccIOrSFRDr5v4g7LH3EO3G4CDukdkQ76/8oPBxuxDxj96g | |
40 | +8n/BkPNvwKD0X6OQ9U+ioPY/hZD3L4Sg+CiiEPkPZqD6CIQQ+viDIPvoZhD82GUg/chIEP64RyD/qCoQ | |
41 | +AJgpIAGIDBACeAsgA3EokARhJ6AFUQqQBkEJoAcw7JAHjUOgCRDOkAmtvyAK8LCQC+CvoAzZzRANwJGg | |
42 | +DrmvEA+priAQmZEQEYmQIBJ5cxATaXIgFFlVEBVJVCAWOTcQFyk2IBgiU5AZCRggGgI1kBryNKAb4heQ | |
43 | +HNIWoB3B+ZAesfigH6HbkCB2KyAhgb2QIlYNICNq2hAkNe8gJUq8ECYV0SAnKp4QJ/7toCkKgBAp3s+g | |
44 | +KupiECu+saAs036QLZ6ToC6zYJAvfnWgMJNCkDFnkiAycySQM0d0IDRTBpA1J1YgNjLokDcHOCA4HAUQ | |
45 | +OOcaIDn75xA6xvwgO9vJEDywGKA9u6sQPo/6oD+bjRBAb9ygQYSpkEJPvqBDZIuQRC+goEVEbZBF89Mg | |
46 | +Ry2KEEfTtSBJDWwQSbOXIErtThBLnLOgTNZqkE18laBOtkyQT1x3oFCWLpBRPFmgUnYQkFMcO6BUVfKQ | |
47 | +VPwdoFY11JBW5TogWB7xEFjFHCBZ/tMQWqT+IFvetRBchOAgXb6XEF5kwiBfnnkQYE3eoGGHlZBiLcCg | |
48 | +Y2d3kGQNoqBlR1mQZe2EoGcnO5BnzWagaQcdkGmtSKBq5v+Qa5ZlIGzQHBBtdkcgbq/+EG9WKSBwj+AQ | |
49 | +cTYLIHJvwhBzFe0gdE+kEHT/CaB2OMCQdt7roHgYopB4vs2gefiEkHqer6B72GaQfH6RoH24SJB+XnOg | |
50 | +f5gqkAABAAECAwEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEA | |
51 | +AQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEA | |
52 | +AQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEA | |
53 | +AQABAAEAAQAB//+dkAEA//+PgAAE//+dkAEI//+dkAEMUERUAFBTVABQV1QAUFBUAAAAAAEAAAABA | |
54 | +</mutableData> | |
55 | + </timeZone> | |
56 | + </datePicker> | |
57 | + </subviews> | |
58 | + <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/> | |
59 | + <constraints> | |
60 | + <constraint firstAttribute="centerX" secondItem="Kq0-yG-icP" secondAttribute="centerX" id="0GY-9z-buv"/> | |
61 | + <constraint firstItem="7QC-Xa-liQ" firstAttribute="centerX" secondItem="Kq0-yG-icP" secondAttribute="centerX" id="kfK-JU-v9W"/> | |
62 | + <constraint firstItem="7QC-Xa-liQ" firstAttribute="top" secondItem="Kq0-yG-icP" secondAttribute="bottom" constant="36" id="wkh-LB-fLl"/> | |
63 | + </constraints> | |
64 | + <simulatedStatusBarMetrics key="simulatedStatusBarMetrics"/> | |
65 | + <simulatedScreenMetrics key="simulatedDestinationMetrics" type="retina4"/> | |
66 | + </view> | |
67 | + </objects> | |
68 | +</document> | ... | ... |
DUREX tests/Base.lproj/DatePickerViewController_iPad.xib
0 → 100644
1 | +<?xml version="1.0" encoding="UTF-8" standalone="no"?> | |
2 | +<document type="com.apple.InterfaceBuilder3.CocoaTouch.iPad.XIB" version="3.0" toolsVersion="5056" systemVersion="12F45" targetRuntime="iOS.CocoaTouch.iPad" propertyAccessControl="none" useAutolayout="YES"> | |
3 | + <dependencies> | |
4 | + <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="3733"/> | |
5 | + </dependencies> | |
6 | + <objects> | |
7 | + <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="PopupViewController"> | |
8 | + <connections> | |
9 | + <outlet property="datePicker" destination="Ye8-NM-1gf" id="BK3-lm-uDP"/> | |
10 | + <outlet property="datePickerView" destination="iN0-l3-epB" id="syx-4N-lWz"/> | |
11 | + <outlet property="view" destination="iN0-l3-epB" id="ily-fa-aEh"/> | |
12 | + </connections> | |
13 | + </placeholder> | |
14 | + <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/> | |
15 | + <view contentMode="scaleToFill" id="iN0-l3-epB"> | |
16 | + <rect key="frame" x="0.0" y="0.0" width="768" height="1024"/> | |
17 | + <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> | |
18 | + <subviews> | |
19 | + <datePicker contentMode="scaleToFill" ambiguous="YES" misplaced="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" datePickerMode="dateAndTime" minuteInterval="1" translatesAutoresizingMaskIntoConstraints="NO" id="Ye8-NM-1gf"> | |
20 | + <rect key="frame" x="0.0" y="269" width="768" height="216"/> | |
21 | + <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/> | |
22 | + <date key="date" timeIntervalSinceReferenceDate="431372189.40412599"> | |
23 | + <!--2014-09-02 17:36:29 +0000--> | |
24 | + </date> | |
25 | + <timeZone key="timeZone" name="America/Los_Angeles"> | |
26 | + <mutableData key="data"> | |
27 | +VFppZgAAAAAAAAAAAAAAAAAAAAAAAAAEAAAABAAAAAAAAAC5AAAABAAAABCepkign7sVkKCGKqChmveQ | |
28 | +y4kaoNIj9HDSYSYQ1v50INiArZDa/tGg28CQENzes6DdqayQ3r6VoN+JjpDgnneg4WlwkOJ+WaDjSVKQ | |
29 | +5F47oOUpNJDmR1gg5xJREOgnOiDo8jMQ6gccIOrSFRDr5v4g7LH3EO3G4CDukdkQ76/8oPBxuxDxj96g | |
30 | +8n/BkPNvwKD0X6OQ9U+ioPY/hZD3L4Sg+CiiEPkPZqD6CIQQ+viDIPvoZhD82GUg/chIEP64RyD/qCoQ | |
31 | +AJgpIAGIDBACeAsgA3EokARhJ6AFUQqQBkEJoAcw7JAHjUOgCRDOkAmtvyAK8LCQC+CvoAzZzRANwJGg | |
32 | +DrmvEA+priAQmZEQEYmQIBJ5cxATaXIgFFlVEBVJVCAWOTcQFyk2IBgiU5AZCRggGgI1kBryNKAb4heQ | |
33 | +HNIWoB3B+ZAesfigH6HbkCB2KyAhgb2QIlYNICNq2hAkNe8gJUq8ECYV0SAnKp4QJ/7toCkKgBAp3s+g | |
34 | +KupiECu+saAs036QLZ6ToC6zYJAvfnWgMJNCkDFnkiAycySQM0d0IDRTBpA1J1YgNjLokDcHOCA4HAUQ | |
35 | +OOcaIDn75xA6xvwgO9vJEDywGKA9u6sQPo/6oD+bjRBAb9ygQYSpkEJPvqBDZIuQRC+goEVEbZBF89Mg | |
36 | +Ry2KEEfTtSBJDWwQSbOXIErtThBLnLOgTNZqkE18laBOtkyQT1x3oFCWLpBRPFmgUnYQkFMcO6BUVfKQ | |
37 | +VPwdoFY11JBW5TogWB7xEFjFHCBZ/tMQWqT+IFvetRBchOAgXb6XEF5kwiBfnnkQYE3eoGGHlZBiLcCg | |
38 | +Y2d3kGQNoqBlR1mQZe2EoGcnO5BnzWagaQcdkGmtSKBq5v+Qa5ZlIGzQHBBtdkcgbq/+EG9WKSBwj+AQ | |
39 | +cTYLIHJvwhBzFe0gdE+kEHT/CaB2OMCQdt7roHgYopB4vs2gefiEkHqer6B72GaQfH6RoH24SJB+XnOg | |
40 | +f5gqkAABAAECAwEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEA | |
41 | +AQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEA | |
42 | +AQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEA | |
43 | +AQABAAEAAQAB//+dkAEA//+PgAAE//+dkAEI//+dkAEMUERUAFBTVABQV1QAUFBUAAAAAAEAAAABA | |
44 | +</mutableData> | |
45 | + </timeZone> | |
46 | + </datePicker> | |
47 | + <button opaque="NO" contentMode="scaleToFill" ambiguous="YES" misplaced="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="b32-QI-eSJ"> | |
48 | + <rect key="frame" x="361" y="511" width="46" height="30"/> | |
49 | + <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> | |
50 | + <state key="normal" title="Done"> | |
51 | + <color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/> | |
52 | + </state> | |
53 | + <connections> | |
54 | + <action selector="closePopup:" destination="-1" eventType="touchUpInside" id="zqQ-J8-LT0"/> | |
55 | + </connections> | |
56 | + </button> | |
57 | + </subviews> | |
58 | + <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/> | |
59 | + <constraints> | |
60 | + <constraint firstItem="b32-QI-eSJ" firstAttribute="centerX" secondItem="Ye8-NM-1gf" secondAttribute="centerX" id="9Og-RH-pFc"/> | |
61 | + <constraint firstAttribute="centerX" secondItem="Ye8-NM-1gf" secondAttribute="centerX" id="GZr-bO-HrS"/> | |
62 | + <constraint firstItem="b32-QI-eSJ" firstAttribute="top" secondItem="Ye8-NM-1gf" secondAttribute="bottom" constant="34" id="X3X-ac-hcm"/> | |
63 | + </constraints> | |
64 | + <simulatedStatusBarMetrics key="simulatedStatusBarMetrics"/> | |
65 | + </view> | |
66 | + </objects> | |
67 | +</document> | ... | ... |
DUREX tests/Base.lproj/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="13E28" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" initialViewController="kWw-Rk-wD6"> | |
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"> | |
3 | 3 | <dependencies> |
4 | 4 | <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="3733"/> |
5 | 5 | </dependencies> | ... | ... |
DUREX tests/DUREX test.xcodeproj/project.pbxproj
... | ... | @@ -28,6 +28,9 @@ |
28 | 28 | F98356D8192E906600EA6821 /* bluetooth.png in Resources */ = {isa = PBXBuildFile; fileRef = F98356D7192E906600EA6821 /* bluetooth.png */; }; |
29 | 29 | F98356DB192EAFD400EA6821 /* CommunicationProtocol.m in Sources */ = {isa = PBXBuildFile; fileRef = F98356DA192EAFD400EA6821 /* CommunicationProtocol.m */; }; |
30 | 30 | F98356E1192EC84700EA6821 /* MenuTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = F98356E0192EC84700EA6821 /* MenuTableViewController.m */; }; |
31 | + F98ACEDC19B6294E00D90AEE /* DatePickerViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = F98ACEDA19B6294E00D90AEE /* DatePickerViewController.m */; }; | |
32 | + F9AB5A6F19B63931006785E4 /* DatePickerViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = F9AB5A7119B63931006785E4 /* DatePickerViewController.xib */; }; | |
33 | + F9AB5A7219B63938006785E4 /* DatePickerViewController_iPad.xib in Resources */ = {isa = PBXBuildFile; fileRef = F9AB5A7419B63938006785E4 /* DatePickerViewController_iPad.xib */; }; | |
31 | 34 | F9C77F50192CDE30002DBE8A /* durex.json in Resources */ = {isa = PBXBuildFile; fileRef = F9C77F4F192CDE30002DBE8A /* durex.json */; }; |
32 | 35 | /* End PBXBuildFile section */ |
33 | 36 | |
... | ... | @@ -77,6 +80,14 @@ |
77 | 80 | F98356DA192EAFD400EA6821 /* CommunicationProtocol.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CommunicationProtocol.m; sourceTree = SOURCE_ROOT; }; |
78 | 81 | F98356DF192EC84700EA6821 /* MenuTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MenuTableViewController.h; sourceTree = SOURCE_ROOT; }; |
79 | 82 | F98356E0192EC84700EA6821 /* MenuTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MenuTableViewController.m; sourceTree = SOURCE_ROOT; }; |
83 | + F98ACED919B6294E00D90AEE /* DatePickerViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DatePickerViewController.h; sourceTree = SOURCE_ROOT; }; | |
84 | + F98ACEDA19B6294E00D90AEE /* DatePickerViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DatePickerViewController.m; sourceTree = SOURCE_ROOT; }; | |
85 | + F9AB5A7019B63931006785E4 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/DatePickerViewController.xib; sourceTree = "<group>"; }; | |
86 | + F9AB5A7319B63938006785E4 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/DatePickerViewController_iPad.xib; sourceTree = "<group>"; }; | |
87 | + F9AB5A7619B6393C006785E4 /* es */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = es; path = es.lproj/DatePickerViewController.strings; sourceTree = "<group>"; }; | |
88 | + F9AB5A7819B6393D006785E4 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/DatePickerViewController.strings; sourceTree = "<group>"; }; | |
89 | + F9AB5A7A19B6393F006785E4 /* es */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = es; path = es.lproj/DatePickerViewController_iPad.strings; sourceTree = "<group>"; }; | |
90 | + F9AB5A7C19B63940006785E4 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/DatePickerViewController_iPad.strings; sourceTree = "<group>"; }; | |
80 | 91 | F9C77F4F192CDE30002DBE8A /* durex.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = durex.json; sourceTree = SOURCE_ROOT; }; |
81 | 92 | /* End PBXFileReference section */ |
82 | 93 | |
... | ... | @@ -149,6 +160,10 @@ |
149 | 160 | F98356DA192EAFD400EA6821 /* CommunicationProtocol.m */, |
150 | 161 | F962A231192FCA8A00E4324A /* Stack.h */, |
151 | 162 | F962A232192FCA8A00E4324A /* Stack.m */, |
163 | + F98ACED919B6294E00D90AEE /* DatePickerViewController.h */, | |
164 | + F98ACEDA19B6294E00D90AEE /* DatePickerViewController.m */, | |
165 | + F9AB5A7119B63931006785E4 /* DatePickerViewController.xib */, | |
166 | + F9AB5A7419B63938006785E4 /* DatePickerViewController_iPad.xib */, | |
152 | 167 | 34AAB88C189805300019860D /* Images.xcassets */, |
153 | 168 | 347186B91807290E00FA0FB2 /* Schemas */, |
154 | 169 | 347186A718070F7F00FA0FB2 /* Device Picker */, |
... | ... | @@ -278,9 +293,11 @@ |
278 | 293 | files = ( |
279 | 294 | F98356D8192E906600EA6821 /* bluetooth.png in Resources */, |
280 | 295 | F9C77F50192CDE30002DBE8A /* durex.json in Resources */, |
296 | + F9AB5A6F19B63931006785E4 /* DatePickerViewController.xib in Resources */, | |
281 | 297 | 34AAB88D189805300019860D /* Images.xcassets in Resources */, |
282 | 298 | F92B0B6C19993D3F00CAEF3E /* Localizable.strings in Resources */, |
283 | 299 | F961D7FE199A5B4700E9282C /* back_arrow.png in Resources */, |
300 | + F9AB5A7219B63938006785E4 /* DatePickerViewController_iPad.xib in Resources */, | |
284 | 301 | F9469169193015EE006DACD3 /* icon_checkmark.png in Resources */, |
285 | 302 | F961D7F5199A4A4800E9282C /* MainStoryboard.storyboard in Resources */, |
286 | 303 | F946916A193015EE006DACD3 /* icon_delete.png in Resources */, |
... | ... | @@ -304,6 +321,7 @@ |
304 | 321 | F98356D6192E835F00EA6821 /* InitialViewController.m in Sources */, |
305 | 322 | F962A233192FCA8A00E4324A /* Stack.m in Sources */, |
306 | 323 | 34AAB885189804FF0019860D /* EMDevicePickerViewController.m in Sources */, |
324 | + F98ACEDC19B6294E00D90AEE /* DatePickerViewController.m in Sources */, | |
307 | 325 | 34AAB883189804FF0019860D /* DUREXAppDelegate.m in Sources */, |
308 | 326 | F98356DB192EAFD400EA6821 /* CommunicationProtocol.m in Sources */, |
309 | 327 | F98356E1192EC84700EA6821 /* MenuTableViewController.m in Sources */, |
... | ... | @@ -359,6 +377,26 @@ |
359 | 377 | name = back_arrow.png; |
360 | 378 | sourceTree = SOURCE_ROOT; |
361 | 379 | }; |
380 | + F9AB5A7119B63931006785E4 /* DatePickerViewController.xib */ = { | |
381 | + isa = PBXVariantGroup; | |
382 | + children = ( | |
383 | + F9AB5A7019B63931006785E4 /* Base */, | |
384 | + F9AB5A7619B6393C006785E4 /* es */, | |
385 | + F9AB5A7819B6393D006785E4 /* en */, | |
386 | + ); | |
387 | + name = DatePickerViewController.xib; | |
388 | + sourceTree = SOURCE_ROOT; | |
389 | + }; | |
390 | + F9AB5A7419B63938006785E4 /* DatePickerViewController_iPad.xib */ = { | |
391 | + isa = PBXVariantGroup; | |
392 | + children = ( | |
393 | + F9AB5A7319B63938006785E4 /* Base */, | |
394 | + F9AB5A7A19B6393F006785E4 /* es */, | |
395 | + F9AB5A7C19B63940006785E4 /* en */, | |
396 | + ); | |
397 | + name = DatePickerViewController_iPad.xib; | |
398 | + sourceTree = SOURCE_ROOT; | |
399 | + }; | |
362 | 400 | /* End PBXVariantGroup section */ |
363 | 401 | |
364 | 402 | /* Begin XCBuildConfiguration section */ |
... | ... | @@ -398,6 +436,7 @@ |
398 | 436 | "INFOPLIST_FILE[sdk=*]" = "DUREX test-Info.plist"; |
399 | 437 | IPHONEOS_DEPLOYMENT_TARGET = 7.1; |
400 | 438 | ONLY_ACTIVE_ARCH = YES; |
439 | + OTHER_CODE_SIGN_FLAGS = "-gta"; | |
401 | 440 | SDKROOT = iphoneos; |
402 | 441 | TARGETED_DEVICE_FAMILY = "1,2"; |
403 | 442 | }; |
... | ... | @@ -432,6 +471,7 @@ |
432 | 471 | GCC_WARN_UNUSED_VARIABLE = YES; |
433 | 472 | "INFOPLIST_FILE[sdk=*]" = "DUREX test-Info.plist"; |
434 | 473 | IPHONEOS_DEPLOYMENT_TARGET = 7.1; |
474 | + OTHER_CODE_SIGN_FLAGS = "-gta"; | |
435 | 475 | SDKROOT = iphoneos; |
436 | 476 | TARGETED_DEVICE_FAMILY = "1,2"; |
437 | 477 | VALIDATE_PRODUCT = YES; | ... | ... |
DUREX tests/DUREX test.xcodeproj/project.xcworkspace/xcuserdata/imanol.xcuserdatad/UserInterfaceState.xcuserstate
No preview for this file type
DUREX tests/DatePickerViewController.h
0 → 100644
1 | +// | |
2 | +// PopupViewController.h | |
3 | +// DUREX test | |
4 | +// | |
5 | +// Created by Imanol Barba on 9/2/14. | |
6 | +// Copyright (c) 2014 Emmoco. All rights reserved. | |
7 | +// | |
8 | + | |
9 | +@class DatePickerViewController; | |
10 | + | |
11 | +#import <UIKit/UIKit.h> | |
12 | +#import <QuartzCore/QuartzCore.h> | |
13 | +#import "DUREXAppDelegate.h" | |
14 | + | |
15 | +@protocol DatePickerViewControllerDelegate <NSObject> | |
16 | +- (void)addItemViewController:(DatePickerViewController*)controller didFinishEnteringItem:(NSDate *)date; | |
17 | + | |
18 | +@end | |
19 | + | |
20 | +@interface DatePickerViewController : UIViewController | |
21 | + | |
22 | +@property (strong, nonatomic) IBOutlet UIView *datePickerView; | |
23 | +@property (strong, nonatomic) IBOutlet UIDatePicker *datePicker; | |
24 | +@property (nonatomic, strong) id <DatePickerViewControllerDelegate> delegate; | |
25 | + | |
26 | +- (void)showInView:(UIView *)aView animated:(BOOL)animated; | |
27 | +- (IBAction)closePopup:(id)sender; | |
28 | + | |
29 | +@end | ... | ... |
DUREX tests/DatePickerViewController.m
0 → 100644
1 | +// | |
2 | +// PopupViewController.m | |
3 | +// DUREX test | |
4 | +// | |
5 | +// Created by Imanol Barba on 9/2/14. | |
6 | +// Copyright (c) 2014 Emmoco. All rights reserved. | |
7 | +// | |
8 | + | |
9 | +#import "DatePickerViewController.h" | |
10 | + | |
11 | +@interface DatePickerViewController () | |
12 | + | |
13 | +@end | |
14 | + | |
15 | +@implementation DatePickerViewController | |
16 | + | |
17 | +- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil | |
18 | +{ | |
19 | + self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; | |
20 | + if (self) { | |
21 | + // Custom initialization | |
22 | + } | |
23 | + return self; | |
24 | +} | |
25 | + | |
26 | +- (void)viewDidLoad | |
27 | +{ | |
28 | + self.view.backgroundColor=[[UIColor blackColor] colorWithAlphaComponent:.6]; | |
29 | + self.datePickerView.layer.cornerRadius = 5; | |
30 | + self.datePickerView.layer.shadowOpacity = 0.8; | |
31 | + self.datePickerView.layer.shadowOffset = CGSizeMake(0.0f, 0.0f); | |
32 | + [super viewDidLoad]; | |
33 | + // Do any additional setup after loading the view from its nib. | |
34 | +} | |
35 | + | |
36 | +- (void)didReceiveMemoryWarning | |
37 | +{ | |
38 | + [super didReceiveMemoryWarning]; | |
39 | + // Dispose of any resources that can be recreated. | |
40 | +} | |
41 | + | |
42 | +- (void)showAnimate | |
43 | +{ | |
44 | + self.view.transform = CGAffineTransformMakeScale(1.3, 1.3); | |
45 | + self.view.alpha = 0; | |
46 | + [UIView animateWithDuration:.25 animations:^{ | |
47 | + self.view.alpha = 1; | |
48 | + self.view.transform = CGAffineTransformMakeScale(1, 1); | |
49 | + }]; | |
50 | +} | |
51 | + | |
52 | +- (void)removeAnimate | |
53 | +{ | |
54 | + [UIView animateWithDuration:.25 animations:^{ | |
55 | + self.view.transform = CGAffineTransformMakeScale(1.3, 1.3); | |
56 | + self.view.alpha = 0.0; | |
57 | + } completion:^(BOOL finished) { | |
58 | + if (finished) { | |
59 | + [self.view removeFromSuperview]; | |
60 | + } | |
61 | + }]; | |
62 | +} | |
63 | + | |
64 | +- (IBAction)closePopup:(id)sender | |
65 | +{ | |
66 | + [self.delegate addItemViewController:self didFinishEnteringItem:[[self datePicker] date]]; | |
67 | + [self removeAnimate]; | |
68 | +} | |
69 | + | |
70 | +- (void)showInView:(UIView *)aView animated:(BOOL)animated | |
71 | +{ | |
72 | + [aView addSubview:self.view]; | |
73 | + if (animated) { | |
74 | + [self showAnimate]; | |
75 | + } | |
76 | +} | |
77 | + | |
78 | +@end | ... | ... |
DUREX tests/MenuTableViewController.h
... | ... | @@ -9,6 +9,7 @@ |
9 | 9 | #import <UIKit/UIKit.h> |
10 | 10 | #import "CommunicationProtocol.h" |
11 | 11 | #import "Stack.h" |
12 | +#import "DatePickerViewController.h" | |
12 | 13 | |
13 | 14 | #define num(x) [NSNumber numberWithUnsignedInt:x] |
14 | 15 | |
... | ... | @@ -39,9 +40,10 @@ enum { |
39 | 40 | REPORT, |
40 | 41 | } navigationLevel; |
41 | 42 | |
42 | -@interface MenuTableViewController : UITableViewController | |
43 | +@interface MenuTableViewController : UITableViewController <DatePickerViewControllerDelegate> | |
43 | 44 | |
44 | 45 | @property (strong,nonatomic) Stack *parentLayout; |
46 | +@property (strong,nonatomic) DatePickerViewController *popupViewController; | |
45 | 47 | |
46 | 48 | - (void) navBack; |
47 | 49 | ... | ... |
DUREX tests/MenuTableViewController.m
... | ... | @@ -266,6 +266,19 @@ |
266 | 266 | NSLog(@"[MenuTableViewController.m]: Changing to navLevel: BASIC_CONFIGURATION"); |
267 | 267 | [self changeNavLevel:BASIC_CONFIGURATION:TRUE]; |
268 | 268 | } |
269 | + else if([cellName isEqualToString:NSLocalizedString(@"Update Date & Time", nil)] && [self currentNavLevel] == BASIC_CONFIGURATION) | |
270 | + { | |
271 | + if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) | |
272 | + { | |
273 | + self.popupViewController = [[DatePickerViewController alloc] initWithNibName:@"DatePickerViewController_iPad" bundle:nil]; | |
274 | + [self.popupViewController showInView:self.navigationController.view animated:YES]; | |
275 | + } | |
276 | + else | |
277 | + { | |
278 | + self.popupViewController = [[DatePickerViewController alloc] initWithNibName:@"DatePickerViewController" bundle:nil]; | |
279 | + [self.popupViewController showInView:self.navigationController.view animated:YES]; | |
280 | + } | |
281 | + } | |
269 | 282 | |
270 | 283 | } |
271 | 284 | |
... | ... | @@ -333,6 +346,14 @@ |
333 | 346 | return cell; |
334 | 347 | } |
335 | 348 | |
349 | +- (void)addItemViewController:(DatePickerViewController *)controller didFinishEnteringItem:(NSDate *)date | |
350 | +{ | |
351 | + NSCalendar *calendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar]; | |
352 | + NSCalendarUnit units = NSYearCalendarUnit | NSMonthCalendarUnit | NSDayCalendarUnit | NSHourCalendarUnit | NSMinuteCalendarUnit | NSSecondCalendarUnit; | |
353 | + NSDateComponents *components = [calendar components:units fromDate:date]; | |
354 | + [_protocol updateTime: components]; | |
355 | +} | |
356 | + | |
336 | 357 | |
337 | 358 | /* |
338 | 359 | // Override to support conditional editing of the table view. | ... | ... |
DUREX tests/durex.json deleted
1 | -{ | |
2 | - "resources": { | |
3 | - "$eapProtocolLevel": { | |
4 | - "id": -3, | |
5 | - "align": 2, | |
6 | - "attributes": {"readonly": true}, | |
7 | - "type": "u2", | |
8 | - "access": "r", | |
9 | - "size": 2 | |
10 | - }, | |
11 | - "numBytes": { | |
12 | - "id": 1, | |
13 | - "align": 1, | |
14 | - "attributes": {}, | |
15 | - "type": "u1", | |
16 | - "access": "rw", | |
17 | - "size": 1 | |
18 | - }, | |
19 | - "data": { | |
20 | - "id": 2, | |
21 | - "align": 1, | |
22 | - "attributes": {}, | |
23 | - "type": "C:201", | |
24 | - "access": "rw", | |
25 | - "size": 201 | |
26 | - }, | |
27 | - "$activeGroup": { | |
28 | - "id": -10, | |
29 | - "align": 1, | |
30 | - "pack": 1, | |
31 | - "attributes": {"readwrite": true}, | |
32 | - "type": "E:system@emmoco.com.System/ParameterGroup", | |
33 | - "access": "rw", | |
34 | - "size": 1 | |
35 | - }, | |
36 | - "$mcmDisconnect": { | |
37 | - "id": -9, | |
38 | - "align": 1, | |
39 | - "attributes": {"writeonly": true}, | |
40 | - "type": "u1", | |
41 | - "access": "w", | |
42 | - "size": 1 | |
43 | - }, | |
44 | - "$eapBuildDate": { | |
45 | - "dim": 8, | |
46 | - "id": -4, | |
47 | - "align": 1, | |
48 | - "attributes": {"readonly": true}, | |
49 | - "type": "A8:u1", | |
50 | - "access": "r", | |
51 | - "size": 8 | |
52 | - }, | |
53 | - "numPackets": { | |
54 | - "id": 3, | |
55 | - "align": 1, | |
56 | - "attributes": {}, | |
57 | - "type": "u1", | |
58 | - "access": "rw", | |
59 | - "size": 1 | |
60 | - }, | |
61 | - "$resourceCount": { | |
62 | - "id": -7, | |
63 | - "align": 1, | |
64 | - "attributes": {"readonly": true}, | |
65 | - "type": "S:system@emmoco.com.System/ResourceCount", | |
66 | - "access": "r", | |
67 | - "size": 2 | |
68 | - }, | |
69 | - "$schemaHash": { | |
70 | - "dim": 20, | |
71 | - "id": -6, | |
72 | - "align": 1, | |
73 | - "attributes": {"readonly": true}, | |
74 | - "type": "A20:u1", | |
75 | - "access": "r", | |
76 | - "size": 20 | |
77 | - }, | |
78 | - "messageAvailable": { | |
79 | - "id": 4, | |
80 | - "align": 1, | |
81 | - "pack": 1, | |
82 | - "attributes": {"indicator": true}, | |
83 | - "type": "E:@emmoco.com.DUREX/BOOLEAN", | |
84 | - "access": "ir", | |
85 | - "size": 1 | |
86 | - }, | |
87 | - "$mcmProtocolLevel": { | |
88 | - "id": -2, | |
89 | - "align": 2, | |
90 | - "attributes": {"readonly": true}, | |
91 | - "type": "u2", | |
92 | - "access": "r", | |
93 | - "size": 2 | |
94 | - }, | |
95 | - "$mobileRssi": { | |
96 | - "id": -8, | |
97 | - "align": 1, | |
98 | - "attributes": {"readonly": true}, | |
99 | - "type": "i1", | |
100 | - "access": "r", | |
101 | - "size": 1 | |
102 | - }, | |
103 | - "$fileIndexReset": { | |
104 | - "id": -5, | |
105 | - "align": 2, | |
106 | - "attributes": {"writeonly": true}, | |
107 | - "type": "i2", | |
108 | - "access": "w", | |
109 | - "size": 2 | |
110 | - } | |
111 | - }, | |
112 | - "resourceNamesSys": [ | |
113 | - "$activeGroup", | |
114 | - "$eapBuildDate", | |
115 | - "$eapProtocolLevel", | |
116 | - "$fileIndexReset", | |
117 | - "$mcmDisconnect", | |
118 | - "$mcmProtocolLevel", | |
119 | - "$mobileRssi", | |
120 | - "$resourceCount", | |
121 | - "$schemaHash" | |
122 | - ], | |
123 | - "manifest": { | |
124 | - "protocolLevel": 13, | |
125 | - "hash": [ | |
126 | - 0, | |
127 | - 164, | |
128 | - 192, | |
129 | - 32, | |
130 | - 22, | |
131 | - 163, | |
132 | - 114, | |
133 | - 239, | |
134 | - 91, | |
135 | - 240, | |
136 | - 123, | |
137 | - 128, | |
138 | - 206, | |
139 | - 12, | |
140 | - 50, | |
141 | - 148 | |
142 | - ], | |
143 | - "toolVersion": "13.4.1.201311121909", | |
144 | - "name": "DUREX", | |
145 | - "$$md5": "00a4c02016a372ef5bf07b80ce0c3294", | |
146 | - "build": [ | |
147 | - 171, | |
148 | - 30, | |
149 | - 204, | |
150 | - 135, | |
151 | - 71, | |
152 | - 1, | |
153 | - 0, | |
154 | - 0 | |
155 | - ], | |
156 | - "date": "2014-07-30T17:03:27T", | |
157 | - "maxAlign": 2, | |
158 | - "maxSize": 201, | |
159 | - "version": "1.0.0" | |
160 | - }, | |
161 | - "resourceNames": [ | |
162 | - "numBytes", | |
163 | - "data", | |
164 | - "numPackets", | |
165 | - "messageAvailable", | |
166 | - "$mcmProtocolLevel", | |
167 | - "$eapProtocolLevel", | |
168 | - "$eapBuildDate", | |
169 | - "$fileIndexReset", | |
170 | - "$schemaHash", | |
171 | - "$resourceCount", | |
172 | - "$mobileRssi", | |
173 | - "$mcmDisconnect", | |
174 | - "$activeGroup" | |
175 | - ], | |
176 | - "attributes": { | |
177 | - "description": "", | |
178 | - "version": "1.0.0" | |
179 | - }, | |
180 | - "resourceNamesApp": [ | |
181 | - "numBytes", | |
182 | - "data", | |
183 | - "numPackets", | |
184 | - "messageAvailable" | |
185 | - ], | |
186 | - "types": { | |
187 | - "system@emmoco.com.System/ResourceCount": { | |
188 | - "packed": false, | |
189 | - "align": 1, | |
190 | - "type": "S:system@emmoco.com.System/ResourceCount", | |
191 | - "size": 2, | |
192 | - "fields": [ | |
193 | - { | |
194 | - "pad": 0, | |
195 | - "align": 1, | |
196 | - "name": "app", | |
197 | - "type": "u1", | |
198 | - "size": 1 | |
199 | - }, | |
200 | - { | |
201 | - "pad": 0, | |
202 | - "align": 1, | |
203 | - "name": "sys", | |
204 | - "type": "u1", | |
205 | - "size": 1 | |
206 | - } | |
207 | - ] | |
208 | - }, | |
209 | - "std:i2": { | |
210 | - "align": 2, | |
211 | - "size": 2 | |
212 | - }, | |
213 | - "std:i1": { | |
214 | - "align": 1, | |
215 | - "size": 1 | |
216 | - }, | |
217 | - "std:u1": { | |
218 | - "align": 1, | |
219 | - "size": 1 | |
220 | - }, | |
221 | - "@emmoco.com.DUREX/BOOLEAN": { | |
222 | - "values": [ | |
223 | - "TRUE", | |
224 | - "FALSE" | |
225 | - ], | |
226 | - "align": 1, | |
227 | - "pack": 1, | |
228 | - "type": "E:@emmoco.com.DUREX/BOOLEAN", | |
229 | - "size": 1 | |
230 | - }, | |
231 | - "system@emmoco.com.System/ParameterGroup": { | |
232 | - "values": [ | |
233 | - "GROUP_A", | |
234 | - "GROUP_B" | |
235 | - ], | |
236 | - "align": 1, | |
237 | - "pack": 1, | |
238 | - "type": "E:system@emmoco.com.System/ParameterGroup", | |
239 | - "size": 1 | |
240 | - }, | |
241 | - "std:u2": { | |
242 | - "align": 2, | |
243 | - "size": 2 | |
244 | - } | |
245 | - }, | |
246 | - "imports": {"@emmoco.com.DUREX": true} | |
247 | -} | |
248 | 0 | \ No newline at end of file |
DUREX tests/en.lproj/DatePickerViewController.strings
0 → 100644
DUREX tests/en.lproj/DatePickerViewController_iPad.strings
0 → 100644
DUREX tests/es.lproj/DatePickerViewController.strings
0 → 100644
DUREX tests/es.lproj/DatePickerViewController_iPad.strings
0 → 100644