Commit cf609976b4acf01daf351c68ff35b2639b2c7637

Authored by Imanol-Mikel Barba Sabariego
1 parent 8a75e251

--no commit message

DUREX Vendor Control/Base.lproj/Localizable.strings
@@ -92,4 +92,12 @@ @@ -92,4 +92,12 @@
92 "Entered product code has an invalid format" = "Entered product code has an invalid format"; 92 "Entered product code has an invalid format" = "Entered product code has an invalid format";
93 "Entered channel has an invalid format" = "Entered channel has an invalid format"; 93 "Entered channel has an invalid format" = "Entered channel has an invalid format";
94 "Missing channel" = "Missing channel"; 94 "Missing channel" = "Missing channel";
95 -"Missing product code" = "Missing product code";  
96 \ No newline at end of file 95 \ No newline at end of file
  96 +"Missing product code" = "Missing product code";
  97 +"Time and Date changed successfully" = "Time and Date changed successfully";
  98 +"Time and Date change returned error" = "Time and Date change returned error";
  99 +"Product price changed successfully" = "Product price changed successfully";
  100 +"Product price change returned error" = "Product price change returned error";
  101 +"Product name changed successfully" = "Product name changed successfully";
  102 +"Product name change returned error" = "Product name change returned error";
  103 +"Error occurred while reading answer from device" = "Error occurred while reading answer from device";
  104 +"Error occurred while sending command to device" = "Error occurred while sending command to device";
97 \ No newline at end of file 105 \ No newline at end of file
DUREX Vendor Control/CommunicationProtocol.h
@@ -25,7 +25,7 @@ @@ -25,7 +25,7 @@
25 25
26 @protocol CommunicationProtocolDelegate <NSObject> 26 @protocol CommunicationProtocolDelegate <NSObject>
27 - (void)processMessage:(CommunicationProtocol*)protocol didFinishEnteringItem:(NSString*) response; 27 - (void)processMessage:(CommunicationProtocol*)protocol didFinishEnteringItem:(NSString*) response;
28 - 28 +- (void) reportProtocolError: (CommunicationProtocol*)protocol didFinishEnteringItem:(NSString*) error;
29 @end 29 @end
30 30
31 @interface CommunicationProtocol : NSObject 31 @interface CommunicationProtocol : NSObject
@@ -35,6 +35,7 @@ @@ -35,6 +35,7 @@
35 -(void) writeMessage: (NSString*) message; 35 -(void) writeMessage: (NSString*) message;
36 -(void) readMessage; 36 -(void) readMessage;
37 -(void) establishConnection; 37 -(void) establishConnection;
  38 +-(void) disconnect;
38 -(void) updateTime: (NSDateComponents*) date; 39 -(void) updateTime: (NSDateComponents*) date;
39 -(void) updatePrice: (uint8_t) channel : (uint8_t) product : (uint8_t) eur : (uint8_t) cents; 40 -(void) updatePrice: (uint8_t) channel : (uint8_t) product : (uint8_t) eur : (uint8_t) cents;
40 -(void) updateProductName: (uint8_t) channel : (uint8_t) product : (NSString*) name; 41 -(void) updateProductName: (uint8_t) channel : (uint8_t) product : (NSString*) name;
DUREX Vendor Control/CommunicationProtocol.m
@@ -33,11 +33,6 @@ @@ -33,11 +33,6 @@
33 return shared; 33 return shared;
34 } 34 }
35 35
36 -- (void) reportError : (NSString*) error  
37 -{  
38 -  
39 -}  
40 -  
41 -(void) readMessage 36 -(void) readMessage
42 { 37 {
43 self.numPackets = -1; 38 self.numPackets = -1;
@@ -47,46 +42,47 @@ @@ -47,46 +42,47 @@
47 - (void) readNextFragment 42 - (void) readNextFragment
48 { 43 {
49 __block NSUInteger numBytes; 44 __block NSUInteger numBytes;
50 - if(self.numPackets) 45 + [[EMConnectionManager sharedManager] readResource:@"numBytes" onSuccess:^(id readValue)
51 { 46 {
52 - [[EMConnectionManager sharedManager] readResource:@"numBytes" onSuccess:^(id readValue) 47 + numBytes = [readValue unsignedCharValue];
  48 + NSLog(@"[CommunicationProtocol.m]: numBytes read: %d",numBytes);
  49 + [[EMConnectionManager sharedManager] readResource:@"data" onSuccess:^(id readValue)
53 { 50 {
54 - numBytes = [readValue unsignedCharValue];  
55 - NSLog(@"[CommunicationProtocol.m]: numBytes read: %d",numBytes);  
56 - [[EMConnectionManager sharedManager] readResource:@"data" onSuccess:^(id readValue) 51 + NSString *readData = [readValue substringToIndex:numBytes];
  52 + if([readValue length] < numBytes)
57 { 53 {
58 - NSString *readData = [readValue substringToIndex:numBytes];  
59 - if([readValue length] < numBytes)  
60 - {  
61 - NSLog(@"[CommunicationProtocol.m]: WARNING: Device issued wrong numBytes, possible truncated message.");  
62 - }  
63 - [self.message appendString:readData];  
64 - NSLog(@"[CommunicationProtocol.m]: data read: %@",readData);  
65 - [[EMConnectionManager sharedManager] writeValue:@"0" toResource:@"messageAvailableDevice" onSuccess:^ 54 + NSLog(@"[CommunicationProtocol.m]: WARNING: Device issued wrong numBytes, possible truncated message.");
  55 + }
  56 + [self.message appendString:readData];
  57 + NSLog(@"[CommunicationProtocol.m]: data read: %@",readData);
  58 + [[EMConnectionManager sharedManager] writeValue:@"0" toResource:@"messageAvailableDevice" onSuccess:^
  59 + {
  60 + NSLog(@"[CommunicationProtocol.m]: messageAvailableDevice set to FALSE");
  61 + NSLog(@"[CommunicationProtocol.m]: packet read");
  62 + self.numPackets--;
  63 + if(self.numPackets)
66 { 64 {
67 - NSLog(@"[CommunicationProtocol.m]: messageAvailableDevice set to FALSE");  
68 - NSLog(@"[CommunicationProtocol.m]: packet read");  
69 [self waitForMessage: 0]; 65 [self waitForMessage: 0];
70 - }onFail:^(NSError *error) 66 + }
  67 + else
71 { 68 {
72 - NSLog(@"[CommunicationProtocol.m]: On setMessageAvailableDevice to FALSE: %@",error);  
73 - [self reportError:[NSString stringWithFormat:@"Error occurred while reading answer from device: %@",[error localizedDescription]]];  
74 - }]; 69 + [[self delegate] processMessage:self didFinishEnteringItem:self.message];
  70 + }
75 }onFail:^(NSError *error) 71 }onFail:^(NSError *error)
76 { 72 {
77 - NSLog(@"[CommunicationProtocol.m]: On readData: %@",error);  
78 - [self reportError:[NSString stringWithFormat:@"Error occurred while reading answer from device: %@",[error localizedDescription]]]; 73 + NSLog(@"[CommunicationProtocol.m]: On setMessageAvailableDevice to FALSE: %@",error);
  74 + [[self delegate] reportProtocolError:self didFinishEnteringItem:[NSString stringWithFormat:@"%@: %@",NSLocalizedString(@"Error occurred while reading answer from device",nil),[error localizedDescription]]];
79 }]; 75 }];
80 }onFail:^(NSError *error) 76 }onFail:^(NSError *error)
81 { 77 {
82 - NSLog(@"[CommunicationProtocol.m]: On readNumBytes: %@",error);  
83 - [self reportError:[NSString stringWithFormat:@"Error occurred while reading answer from device: %@",[error localizedDescription]]]; 78 + NSLog(@"[CommunicationProtocol.m]: On readData: %@",error);
  79 + [[self delegate] reportProtocolError:self didFinishEnteringItem:[NSString stringWithFormat:@"%@: %@",NSLocalizedString(@"Error occurred while reading answer from device",nil),[error localizedDescription]]];
84 }]; 80 }];
85 - }  
86 - else 81 + }onFail:^(NSError *error)
87 { 82 {
88 - [[self delegate] processMessage:self didFinishEnteringItem:self.message];  
89 - } 83 + NSLog(@"[CommunicationProtocol.m]: On readNumBytes: %@",error);
  84 + [[self delegate] reportProtocolError:self didFinishEnteringItem:[NSString stringWithFormat:@"%@: %@",NSLocalizedString(@"Error occurred while reading answer from device",nil),[error localizedDescription]]];
  85 + }];
90 } 86 }
91 87
92 - (void) readNumPackets 88 - (void) readNumPackets
@@ -99,7 +95,7 @@ @@ -99,7 +95,7 @@
99 }onFail:^(NSError *error) 95 }onFail:^(NSError *error)
100 { 96 {
101 NSLog(@"[CommunicationProtocol.m]: On readNumPackets: %@",error); 97 NSLog(@"[CommunicationProtocol.m]: On readNumPackets: %@",error);
102 - [self reportError:[NSString stringWithFormat:@"Error occurred while reading answer from device: %@",[error localizedDescription]]]; 98 + [[self delegate] reportProtocolError:self didFinishEnteringItem:[NSString stringWithFormat:@"%@: %@",NSLocalizedString(@"Error occurred while reading answer from device",nil),[error localizedDescription]]];
103 }]; 99 }];
104 } 100 }
105 101
@@ -136,7 +132,7 @@ @@ -136,7 +132,7 @@
136 }onFail:^(NSError *error) 132 }onFail:^(NSError *error)
137 { 133 {
138 NSLog(@"[CommunicationProtocol.m]: On waitForMessage: %@",error); 134 NSLog(@"[CommunicationProtocol.m]: On waitForMessage: %@",error);
139 - [self reportError:[NSString stringWithFormat:@"Error occurred while reading answer from device: %@",[error localizedDescription]]]; 135 + [[self delegate] reportProtocolError:self didFinishEnteringItem:[NSString stringWithFormat:@"%@: %@",NSLocalizedString(@"Error occurred while reading answer from device",nil),[error localizedDescription]]];
140 }]; 136 }];
141 } 137 }
142 } 138 }
@@ -154,69 +150,60 @@ @@ -154,69 +150,60 @@
154 }onFail:^(NSError *error) 150 }onFail:^(NSError *error)
155 { 151 {
156 NSLog(@"[CommunicationProtocol.m]: On setNumPackets: %@",error); 152 NSLog(@"[CommunicationProtocol.m]: On setNumPackets: %@",error);
157 - [self reportError:[NSString stringWithFormat:@"Error occurred while sending command to device: %@",[error localizedDescription]]]; 153 + [[self delegate] reportProtocolError:self didFinishEnteringItem:[NSString stringWithFormat:@"%@: %@",NSLocalizedString(@"Error occurred while sending command to device",nil),[error localizedDescription]]];
158 }]; 154 }];
159 } 155 }
160 156
161 - (void) sendNextFragment 157 - (void) sendNextFragment
162 { 158 {
163 - NSLog(@"[CommunicationProtocol.m]: Sending next fragment");  
164 - [[EMConnectionManager sharedManager] writeValue:@"0" toResource:@"messageAvailableMobile" onSuccess:^ 159 + if(self.remainingBytes)
165 { 160 {
166 - NSLog(@"[CommunicationProtocol.m]: messageAvailableMobile set to FALSE"); 161 + NSLog(@"[CommunicationProtocol.m]: Sending next fragment");
167 NSUInteger numBytes; 162 NSUInteger numBytes;
168 - if(self.remainingBytes) 163 + if(self.remainingBytes > MAX_STRING_LENGTH)
169 { 164 {
170 - if(self.remainingBytes > MAX_STRING_LENGTH)  
171 - {  
172 - numBytes = MAX_STRING_LENGTH;  
173 - self.remainingBytes -= MAX_STRING_LENGTH;  
174 - }  
175 - else  
176 - {  
177 - numBytes = self.remainingBytes;  
178 - self.remainingBytes = 0;  
179 - }  
180 - [[EMConnectionManager sharedManager] writeValue:[NSNumber numberWithUnsignedChar:(unsigned char)numBytes] toResource:@"numBytes" onSuccess:^  
181 - {  
182 - NSLog(@"[CommunicationProtocol.m]: numBytes set to %d", numBytes);  
183 - NSString *data = [self.message substringWithRange:NSMakeRange(self.currentIndex, numBytes)];  
184 - self.currentIndex += numBytes;  
185 - [[EMConnectionManager sharedManager] writeValue:data toResource:@"data" onSuccess:^  
186 - {  
187 - NSLog(@"[CommunicationProtocol.m]: data set to: %@",data);  
188 - [[EMConnectionManager sharedManager] writeValue:@"1" toResource:@"messageAvailableMobile" onSuccess:^  
189 - {  
190 - NSLog(@"[CommunicationProtocol.m]: messageAvailableMobile set to TRUE");  
191 - NSLog(@"[CommunicationProtocol.m]: Packet written");  
192 - [self readACK: 0];  
193 - }onFail:^(NSError *error)  
194 - {  
195 - NSLog(@"[CommunicationProtocol.m]: On setMessageAvailable to TRUE: %@",error);  
196 - [self reportError:[NSString stringWithFormat:@"Error occurred while sending command to device: %@",[error localizedDescription]]];  
197 - }];  
198 - }onFail:^(NSError *error)  
199 - {  
200 - NSLog(@"[CommunicationProtocol.m]: On setData: %@",error);  
201 - [self reportError:[NSString stringWithFormat:@"Error occurred while sending command to device: %@",[error localizedDescription]]];  
202 - }];  
203 - }onFail:^(NSError *error)  
204 - {  
205 - NSLog(@"[CommunicationProtocol.m]: On setNumBytes: %@",error);  
206 - [self reportError:[NSString stringWithFormat:@"Error occurred while sending command to device: %@",[error localizedDescription]]];  
207 - }]; 165 + numBytes = MAX_STRING_LENGTH;
  166 + self.remainingBytes -= MAX_STRING_LENGTH;
208 } 167 }
209 else 168 else
210 { 169 {
211 - NSLog(@"[CommunicationProtocol.m]: Finished sending message");  
212 - [self readMessage]; 170 + numBytes = self.remainingBytes;
  171 + self.remainingBytes = 0;
213 } 172 }
214 -  
215 - }onFail:^(NSError *error) 173 + [[EMConnectionManager sharedManager] writeValue:[NSNumber numberWithUnsignedChar:(unsigned char)numBytes] toResource:@"numBytes" onSuccess:^
  174 + {
  175 + NSLog(@"[CommunicationProtocol.m]: numBytes set to %d", numBytes);
  176 + NSString *data = [self.message substringWithRange:NSMakeRange(self.currentIndex, numBytes)];
  177 + self.currentIndex += numBytes;
  178 + [[EMConnectionManager sharedManager] writeValue:data toResource:@"data" onSuccess:^
  179 + {
  180 + NSLog(@"[CommunicationProtocol.m]: data set to: %@",data);
  181 + [[EMConnectionManager sharedManager] writeValue:@"1" toResource:@"messageAvailableMobile" onSuccess:^
  182 + {
  183 + NSLog(@"[CommunicationProtocol.m]: messageAvailableMobile set to TRUE");
  184 + NSLog(@"[CommunicationProtocol.m]: Packet written");
  185 + [self readACK: 0];
  186 + }onFail:^(NSError *error)
  187 + {
  188 + NSLog(@"[CommunicationProtocol.m]: On setMessageAvailable to TRUE: %@",error);
  189 + [[self delegate] reportProtocolError:self didFinishEnteringItem:[NSString stringWithFormat:@"%@: %@",NSLocalizedString(@"Error occurred while sending command to device",nil),[error localizedDescription]]];
  190 + }];
  191 + }onFail:^(NSError *error)
  192 + {
  193 + NSLog(@"[CommunicationProtocol.m]: On setData: %@",error);
  194 + [[self delegate] reportProtocolError:self didFinishEnteringItem:[NSString stringWithFormat:@"%@: %@",NSLocalizedString(@"Error occurred while sending command to device",nil),[error localizedDescription]]];
  195 + }];
  196 + }onFail:^(NSError *error)
  197 + {
  198 + NSLog(@"[CommunicationProtocol.m]: On setNumBytes: %@",error);
  199 + [[self delegate] reportProtocolError:self didFinishEnteringItem:[NSString stringWithFormat:@"%@: %@",NSLocalizedString(@"Error occurred while sending command to device",nil),[error localizedDescription]]];
  200 + }];
  201 + }
  202 + else
216 { 203 {
217 - NSLog(@"[CommunicationProtocol.m]: On setMessageAvailableMobile to FALSE: %@",error);  
218 - [self reportError:[NSString stringWithFormat:@"Error occurred while sending command to device: %@",[error localizedDescription]]];  
219 - }]; 204 + NSLog(@"[CommunicationProtocol.m]: Finished sending message");
  205 + [self readMessage];
  206 + }
220 } 207 }
221 208
222 - (void) readACK: (uint8_t) retries 209 - (void) readACK: (uint8_t) retries
@@ -245,7 +232,7 @@ @@ -245,7 +232,7 @@
245 }onFail:^(NSError *error) 232 }onFail:^(NSError *error)
246 { 233 {
247 NSLog(@"[CommunicationProtocol.m]: On readACK: %@",error); 234 NSLog(@"[CommunicationProtocol.m]: On readACK: %@",error);
248 - [self reportError:[NSString stringWithFormat:@"Error occurred while sending command to device: %@",[error localizedDescription]]]; 235 + [[self delegate] reportProtocolError:self didFinishEnteringItem:[NSString stringWithFormat:@"%@: %@",NSLocalizedString(@"Error occurred while sending command to device",nil),[error localizedDescription]]];
249 }]; 236 }];
250 } 237 }
251 } 238 }
@@ -257,6 +244,13 @@ @@ -257,6 +244,13 @@
257 NSLog(@"[CommunicationProtocol.m]: Hello sent"); 244 NSLog(@"[CommunicationProtocol.m]: Hello sent");
258 } 245 }
259 246
  247 +-(void) disconnect
  248 +{
  249 + NSLog(@"[CommunicationProtocol.m]: Terminating connection...");
  250 + [self writeMessage:@"Bye"];
  251 + NSLog(@"[CommunicationProtocol.m]: Bye sent");
  252 +}
  253 +
260 -(void) updateTime: (NSDateComponents*) date 254 -(void) updateTime: (NSDateComponents*) date
261 { 255 {
262 NSMutableString *command = [NSMutableString stringWithFormat: @"A5"]; 256 NSMutableString *command = [NSMutableString stringWithFormat: @"A5"];
@@ -288,20 +282,7 @@ @@ -288,20 +282,7 @@
288 NSString *command = @"A4"; 282 NSString *command = @"A4";
289 [self writeMessage:command]; 283 [self writeMessage:command];
290 284
291 - /*NSMutableString *answer = [[NSMutableString alloc]initWithString:@"P400015000150001500000001001003005002000001002"];  
292 - for(int i = 0; i < 4; i++)  
293 - {  
294 - [answer appendString:@"0"];  
295 - [answer appendString:@"1"];  
296 - }  
297 - for(int i = 0; i < 12; i++)  
298 - {  
299 - [answer appendString:@"0"];  
300 - [answer appendString:@"0"];  
301 - }  
302 -  
303 - [answer appendString:@"0"];  
304 - [answer appendString:@"0"];*/ 285 + /*NSMutableString *answer = [[NSMutableString alloc]initWithString:@"P4000150001500015000000010010030050020000010020101010100000000000000000000000000"];*/
305 } 286 }
306 287
307 -(void) readSalesLog : (NSDateComponents*) start : (NSDateComponents*) end 288 -(void) readSalesLog : (NSDateComponents*) start : (NSDateComponents*) end
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
@@ -26,11 +26,11 @@ @@ -26,11 +26,11 @@
26 ignoreCount = "0" 26 ignoreCount = "0"
27 continueAfterRunningActions = "No" 27 continueAfterRunningActions = "No"
28 filePath = "MenuTableViewController.m" 28 filePath = "MenuTableViewController.m"
29 - timestampString = "434037601.622012" 29 + timestampString = "434133664.559575"
30 startingColumnNumber = "9223372036854775807" 30 startingColumnNumber = "9223372036854775807"
31 endingColumnNumber = "9223372036854775807" 31 endingColumnNumber = "9223372036854775807"
32 - startingLineNumber = "770"  
33 - endingLineNumber = "770" 32 + startingLineNumber = "774"
  33 + endingLineNumber = "774"
34 landmarkName = "-tableView:cellForRowAtIndexPath:" 34 landmarkName = "-tableView:cellForRowAtIndexPath:"
35 landmarkType = "5"> 35 landmarkType = "5">
36 </BreakpointContent> 36 </BreakpointContent>
@@ -42,12 +42,12 @@ @@ -42,12 +42,12 @@
42 ignoreCount = "0" 42 ignoreCount = "0"
43 continueAfterRunningActions = "No" 43 continueAfterRunningActions = "No"
44 filePath = "MenuTableViewController.m" 44 filePath = "MenuTableViewController.m"
45 - timestampString = "434037601.622012" 45 + timestampString = "434133664.559575"
46 startingColumnNumber = "9223372036854775807" 46 startingColumnNumber = "9223372036854775807"
47 endingColumnNumber = "9223372036854775807" 47 endingColumnNumber = "9223372036854775807"
48 - startingLineNumber = "712"  
49 - endingLineNumber = "712"  
50 - landmarkName = "-tableView:cellForRowAtIndexPath:" 48 + startingLineNumber = "716"
  49 + endingLineNumber = "716"
  50 + landmarkName = "-tableView:indentationLevelForRowAtIndexPath:"
51 landmarkType = "5"> 51 landmarkType = "5">
52 </BreakpointContent> 52 </BreakpointContent>
53 </BreakpointProxy> 53 </BreakpointProxy>
@@ -58,11 +58,11 @@ @@ -58,11 +58,11 @@
58 ignoreCount = "0" 58 ignoreCount = "0"
59 continueAfterRunningActions = "No" 59 continueAfterRunningActions = "No"
60 filePath = "MenuTableViewController.m" 60 filePath = "MenuTableViewController.m"
61 - timestampString = "434037601.622012" 61 + timestampString = "434133664.559575"
62 startingColumnNumber = "9223372036854775807" 62 startingColumnNumber = "9223372036854775807"
63 endingColumnNumber = "9223372036854775807" 63 endingColumnNumber = "9223372036854775807"
64 - startingLineNumber = "571"  
65 - endingLineNumber = "571" 64 + startingLineNumber = "575"
  65 + endingLineNumber = "575"
66 landmarkName = "-tableView:didSelectRowAtIndexPath:" 66 landmarkName = "-tableView:didSelectRowAtIndexPath:"
67 landmarkType = "5"> 67 landmarkType = "5">
68 </BreakpointContent> 68 </BreakpointContent>
@@ -74,13 +74,13 @@ @@ -74,13 +74,13 @@
74 ignoreCount = "0" 74 ignoreCount = "0"
75 continueAfterRunningActions = "No" 75 continueAfterRunningActions = "No"
76 filePath = "CommunicationProtocol.m" 76 filePath = "CommunicationProtocol.m"
77 - timestampString = "434038085.179085" 77 + timestampString = "434133664.559575"
78 startingColumnNumber = "9223372036854775807" 78 startingColumnNumber = "9223372036854775807"
79 endingColumnNumber = "9223372036854775807" 79 endingColumnNumber = "9223372036854775807"
80 - startingLineNumber = "341"  
81 - endingLineNumber = "341"  
82 - landmarkName = "-updateProductName:::"  
83 - landmarkType = "5"> 80 + startingLineNumber = "336"
  81 + endingLineNumber = "336"
  82 + landmarkName = "@implementation CommunicationProtocol"
  83 + landmarkType = "3">
84 </BreakpointContent> 84 </BreakpointContent>
85 </BreakpointProxy> 85 </BreakpointProxy>
86 <BreakpointProxy 86 <BreakpointProxy
@@ -90,12 +90,12 @@ @@ -90,12 +90,12 @@
90 ignoreCount = "0" 90 ignoreCount = "0"
91 continueAfterRunningActions = "No" 91 continueAfterRunningActions = "No"
92 filePath = "CommunicationProtocol.m" 92 filePath = "CommunicationProtocol.m"
93 - timestampString = "434038085.179085" 93 + timestampString = "434133664.559575"
94 startingColumnNumber = "9223372036854775807" 94 startingColumnNumber = "9223372036854775807"
95 endingColumnNumber = "9223372036854775807" 95 endingColumnNumber = "9223372036854775807"
96 - startingLineNumber = "340"  
97 - endingLineNumber = "340"  
98 - landmarkName = "-updateProductName:::" 96 + startingLineNumber = "335"
  97 + endingLineNumber = "335"
  98 + landmarkName = "-readSalesLog::"
99 landmarkType = "5"> 99 landmarkType = "5">
100 </BreakpointContent> 100 </BreakpointContent>
101 </BreakpointProxy> 101 </BreakpointProxy>
@@ -106,13 +106,11 @@ @@ -106,13 +106,11 @@
106 ignoreCount = "0" 106 ignoreCount = "0"
107 continueAfterRunningActions = "No" 107 continueAfterRunningActions = "No"
108 filePath = "CommunicationProtocol.m" 108 filePath = "CommunicationProtocol.m"
109 - timestampString = "434038085.179085" 109 + timestampString = "434133664.559575"
110 startingColumnNumber = "9223372036854775807" 110 startingColumnNumber = "9223372036854775807"
111 endingColumnNumber = "9223372036854775807" 111 endingColumnNumber = "9223372036854775807"
112 - startingLineNumber = "353"  
113 - endingLineNumber = "353"  
114 - landmarkName = "-readSensorData"  
115 - landmarkType = "5"> 112 + startingLineNumber = "348"
  113 + endingLineNumber = "348">
116 </BreakpointContent> 114 </BreakpointContent>
117 </BreakpointProxy> 115 </BreakpointProxy>
118 <BreakpointProxy 116 <BreakpointProxy
@@ -186,11 +184,11 @@ @@ -186,11 +184,11 @@
186 ignoreCount = "0" 184 ignoreCount = "0"
187 continueAfterRunningActions = "No" 185 continueAfterRunningActions = "No"
188 filePath = "MenuTableViewController.m" 186 filePath = "MenuTableViewController.m"
189 - timestampString = "434037601.622012" 187 + timestampString = "434133664.559575"
190 startingColumnNumber = "9223372036854775807" 188 startingColumnNumber = "9223372036854775807"
191 endingColumnNumber = "9223372036854775807" 189 endingColumnNumber = "9223372036854775807"
192 - startingLineNumber = "821"  
193 - endingLineNumber = "821" 190 + startingLineNumber = "825"
  191 + endingLineNumber = "825"
194 landmarkName = "-tableView:cellForRowAtIndexPath:" 192 landmarkName = "-tableView:cellForRowAtIndexPath:"
195 landmarkType = "5"> 193 landmarkType = "5">
196 </BreakpointContent> 194 </BreakpointContent>
@@ -202,12 +200,12 @@ @@ -202,12 +200,12 @@
202 ignoreCount = "0" 200 ignoreCount = "0"
203 continueAfterRunningActions = "No" 201 continueAfterRunningActions = "No"
204 filePath = "MenuTableViewController.m" 202 filePath = "MenuTableViewController.m"
205 - timestampString = "434037601.622012" 203 + timestampString = "434127499.570083"
206 startingColumnNumber = "9223372036854775807" 204 startingColumnNumber = "9223372036854775807"
207 endingColumnNumber = "9223372036854775807" 205 endingColumnNumber = "9223372036854775807"
208 - startingLineNumber = "105"  
209 - endingLineNumber = "105"  
210 - landmarkName = "-generateSaleListNavLevel" 206 + startingLineNumber = "101"
  207 + endingLineNumber = "101"
  208 + landmarkName = "-generateMaintenanceLevel"
211 landmarkType = "5"> 209 landmarkType = "5">
212 </BreakpointContent> 210 </BreakpointContent>
213 </BreakpointProxy> 211 </BreakpointProxy>
@@ -218,12 +216,12 @@ @@ -218,12 +216,12 @@
218 ignoreCount = "0" 216 ignoreCount = "0"
219 continueAfterRunningActions = "No" 217 continueAfterRunningActions = "No"
220 filePath = "MenuTableViewController.m" 218 filePath = "MenuTableViewController.m"
221 - timestampString = "434037601.622012" 219 + timestampString = "434127499.570083"
222 startingColumnNumber = "9223372036854775807" 220 startingColumnNumber = "9223372036854775807"
223 endingColumnNumber = "9223372036854775807" 221 endingColumnNumber = "9223372036854775807"
224 - startingLineNumber = "108"  
225 - endingLineNumber = "108"  
226 - landmarkName = "-generateSaleListNavLevel" 222 + startingLineNumber = "104"
  223 + endingLineNumber = "104"
  224 + landmarkName = "-generateMaintenanceLevel"
227 landmarkType = "5"> 225 landmarkType = "5">
228 </BreakpointContent> 226 </BreakpointContent>
229 </BreakpointProxy> 227 </BreakpointProxy>
@@ -234,11 +232,11 @@ @@ -234,11 +232,11 @@
234 ignoreCount = "0" 232 ignoreCount = "0"
235 continueAfterRunningActions = "No" 233 continueAfterRunningActions = "No"
236 filePath = "MenuTableViewController.m" 234 filePath = "MenuTableViewController.m"
237 - timestampString = "434037601.622012" 235 + timestampString = "434127499.570083"
238 startingColumnNumber = "9223372036854775807" 236 startingColumnNumber = "9223372036854775807"
239 endingColumnNumber = "9223372036854775807" 237 endingColumnNumber = "9223372036854775807"
240 - startingLineNumber = "116"  
241 - endingLineNumber = "116" 238 + startingLineNumber = "112"
  239 + endingLineNumber = "112"
242 landmarkName = "-generateSaleListNavLevel" 240 landmarkName = "-generateSaleListNavLevel"
243 landmarkType = "5"> 241 landmarkType = "5">
244 </BreakpointContent> 242 </BreakpointContent>
@@ -250,11 +248,11 @@ @@ -250,11 +248,11 @@
250 ignoreCount = "0" 248 ignoreCount = "0"
251 continueAfterRunningActions = "No" 249 continueAfterRunningActions = "No"
252 filePath = "MenuTableViewController.m" 250 filePath = "MenuTableViewController.m"
253 - timestampString = "434037601.622012" 251 + timestampString = "434127499.570083"
254 startingColumnNumber = "9223372036854775807" 252 startingColumnNumber = "9223372036854775807"
255 endingColumnNumber = "9223372036854775807" 253 endingColumnNumber = "9223372036854775807"
256 - startingLineNumber = "188"  
257 - endingLineNumber = "188" 254 + startingLineNumber = "184"
  255 + endingLineNumber = "184"
258 landmarkName = "-changeNavLevel::" 256 landmarkName = "-changeNavLevel::"
259 landmarkType = "5"> 257 landmarkType = "5">
260 </BreakpointContent> 258 </BreakpointContent>
@@ -266,28 +264,12 @@ @@ -266,28 +264,12 @@
266 ignoreCount = "0" 264 ignoreCount = "0"
267 continueAfterRunningActions = "No" 265 continueAfterRunningActions = "No"
268 filePath = "MenuTableViewController.m" 266 filePath = "MenuTableViewController.m"
269 - timestampString = "434037601.622012"  
270 - startingColumnNumber = "9223372036854775807"  
271 - endingColumnNumber = "9223372036854775807"  
272 - startingLineNumber = "556"  
273 - endingLineNumber = "556"  
274 - landmarkName = "-tableView:numberOfRowsInSection:"  
275 - landmarkType = "5">  
276 - </BreakpointContent>  
277 - </BreakpointProxy>  
278 - <BreakpointProxy  
279 - BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">  
280 - <BreakpointContent  
281 - shouldBeEnabled = "No"  
282 - ignoreCount = "0"  
283 - continueAfterRunningActions = "No"  
284 - filePath = "MenuTableViewController.m"  
285 - timestampString = "434037601.622012" 267 + timestampString = "434133664.559575"
286 startingColumnNumber = "9223372036854775807" 268 startingColumnNumber = "9223372036854775807"
287 endingColumnNumber = "9223372036854775807" 269 endingColumnNumber = "9223372036854775807"
288 - startingLineNumber = "697"  
289 - endingLineNumber = "697"  
290 - landmarkName = "-tableView:indentationLevelForRowAtIndexPath:" 270 + startingLineNumber = "701"
  271 + endingLineNumber = "701"
  272 + landmarkName = "-tableView:didSelectRowAtIndexPath:"
291 landmarkType = "5"> 273 landmarkType = "5">
292 </BreakpointContent> 274 </BreakpointContent>
293 </BreakpointProxy> 275 </BreakpointProxy>
@@ -298,12 +280,12 @@ @@ -298,12 +280,12 @@
298 ignoreCount = "0" 280 ignoreCount = "0"
299 continueAfterRunningActions = "No" 281 continueAfterRunningActions = "No"
300 filePath = "MenuTableViewController.m" 282 filePath = "MenuTableViewController.m"
301 - timestampString = "434037601.622012" 283 + timestampString = "434133664.559575"
302 startingColumnNumber = "9223372036854775807" 284 startingColumnNumber = "9223372036854775807"
303 endingColumnNumber = "9223372036854775807" 285 endingColumnNumber = "9223372036854775807"
304 - startingLineNumber = "717"  
305 - endingLineNumber = "717"  
306 - landmarkName = "-tableView:cellForRowAtIndexPath:" 286 + startingLineNumber = "721"
  287 + endingLineNumber = "721"
  288 + landmarkName = "-numberOfSectionsInTableView:"
307 landmarkType = "5"> 289 landmarkType = "5">
308 </BreakpointContent> 290 </BreakpointContent>
309 </BreakpointProxy> 291 </BreakpointProxy>
@@ -314,11 +296,11 @@ @@ -314,11 +296,11 @@
314 ignoreCount = "0" 296 ignoreCount = "0"
315 continueAfterRunningActions = "No" 297 continueAfterRunningActions = "No"
316 filePath = "MenuTableViewController.m" 298 filePath = "MenuTableViewController.m"
317 - timestampString = "434037601.622012" 299 + timestampString = "434133664.559575"
318 startingColumnNumber = "9223372036854775807" 300 startingColumnNumber = "9223372036854775807"
319 endingColumnNumber = "9223372036854775807" 301 endingColumnNumber = "9223372036854775807"
320 - startingLineNumber = "910"  
321 - endingLineNumber = "910" 302 + startingLineNumber = "914"
  303 + endingLineNumber = "914"
322 landmarkName = "-tableView:cellForRowAtIndexPath:" 304 landmarkName = "-tableView:cellForRowAtIndexPath:"
323 landmarkType = "5"> 305 landmarkType = "5">
324 </BreakpointContent> 306 </BreakpointContent>
@@ -330,11 +312,11 @@ @@ -330,11 +312,11 @@
330 ignoreCount = "0" 312 ignoreCount = "0"
331 continueAfterRunningActions = "No" 313 continueAfterRunningActions = "No"
332 filePath = "MenuTableViewController.m" 314 filePath = "MenuTableViewController.m"
333 - timestampString = "434037601.622012" 315 + timestampString = "434133664.559575"
334 startingColumnNumber = "9223372036854775807" 316 startingColumnNumber = "9223372036854775807"
335 endingColumnNumber = "9223372036854775807" 317 endingColumnNumber = "9223372036854775807"
336 - startingLineNumber = "911"  
337 - endingLineNumber = "911" 318 + startingLineNumber = "915"
  319 + endingLineNumber = "915"
338 landmarkName = "-tableView:cellForRowAtIndexPath:" 320 landmarkName = "-tableView:cellForRowAtIndexPath:"
339 landmarkType = "5"> 321 landmarkType = "5">
340 </BreakpointContent> 322 </BreakpointContent>
@@ -362,11 +344,11 @@ @@ -362,11 +344,11 @@
362 ignoreCount = "0" 344 ignoreCount = "0"
363 continueAfterRunningActions = "No" 345 continueAfterRunningActions = "No"
364 filePath = "MenuTableViewController.m" 346 filePath = "MenuTableViewController.m"
365 - timestampString = "434037601.622012" 347 + timestampString = "434133664.559575"
366 startingColumnNumber = "9223372036854775807" 348 startingColumnNumber = "9223372036854775807"
367 endingColumnNumber = "9223372036854775807" 349 endingColumnNumber = "9223372036854775807"
368 - startingLineNumber = "1030"  
369 - endingLineNumber = "1030" 350 + startingLineNumber = "1034"
  351 + endingLineNumber = "1034"
370 landmarkName = "-tableView:cellForRowAtIndexPath:" 352 landmarkName = "-tableView:cellForRowAtIndexPath:"
371 landmarkType = "5"> 353 landmarkType = "5">
372 </BreakpointContent> 354 </BreakpointContent>
@@ -378,11 +360,11 @@ @@ -378,11 +360,11 @@
378 ignoreCount = "0" 360 ignoreCount = "0"
379 continueAfterRunningActions = "No" 361 continueAfterRunningActions = "No"
380 filePath = "MenuTableViewController.m" 362 filePath = "MenuTableViewController.m"
381 - timestampString = "434037601.622012" 363 + timestampString = "434133664.559575"
382 startingColumnNumber = "9223372036854775807" 364 startingColumnNumber = "9223372036854775807"
383 endingColumnNumber = "9223372036854775807" 365 endingColumnNumber = "9223372036854775807"
384 - startingLineNumber = "512"  
385 - endingLineNumber = "512" 366 + startingLineNumber = "505"
  367 + endingLineNumber = "505"
386 landmarkName = "-toggleDropList:" 368 landmarkName = "-toggleDropList:"
387 landmarkType = "5"> 369 landmarkType = "5">
388 </BreakpointContent> 370 </BreakpointContent>
@@ -394,11 +376,11 @@ @@ -394,11 +376,11 @@
394 ignoreCount = "0" 376 ignoreCount = "0"
395 continueAfterRunningActions = "No" 377 continueAfterRunningActions = "No"
396 filePath = "MenuTableViewController.m" 378 filePath = "MenuTableViewController.m"
397 - timestampString = "434037601.622012" 379 + timestampString = "434133664.559575"
398 startingColumnNumber = "9223372036854775807" 380 startingColumnNumber = "9223372036854775807"
399 endingColumnNumber = "9223372036854775807" 381 endingColumnNumber = "9223372036854775807"
400 - startingLineNumber = "1115"  
401 - endingLineNumber = "1115" 382 + startingLineNumber = "1119"
  383 + endingLineNumber = "1119"
402 landmarkName = "-tableView:cellForRowAtIndexPath:" 384 landmarkName = "-tableView:cellForRowAtIndexPath:"
403 landmarkType = "5"> 385 landmarkType = "5">
404 </BreakpointContent> 386 </BreakpointContent>
@@ -410,11 +392,11 @@ @@ -410,11 +392,11 @@
410 ignoreCount = "0" 392 ignoreCount = "0"
411 continueAfterRunningActions = "No" 393 continueAfterRunningActions = "No"
412 filePath = "MenuTableViewController.m" 394 filePath = "MenuTableViewController.m"
413 - timestampString = "434037601.622012" 395 + timestampString = "434133664.559575"
414 startingColumnNumber = "9223372036854775807" 396 startingColumnNumber = "9223372036854775807"
415 endingColumnNumber = "9223372036854775807" 397 endingColumnNumber = "9223372036854775807"
416 - startingLineNumber = "1107"  
417 - endingLineNumber = "1107" 398 + startingLineNumber = "1111"
  399 + endingLineNumber = "1111"
418 landmarkName = "-tableView:cellForRowAtIndexPath:" 400 landmarkName = "-tableView:cellForRowAtIndexPath:"
419 landmarkType = "5"> 401 landmarkType = "5">
420 </BreakpointContent> 402 </BreakpointContent>
@@ -426,11 +408,11 @@ @@ -426,11 +408,11 @@
426 ignoreCount = "0" 408 ignoreCount = "0"
427 continueAfterRunningActions = "No" 409 continueAfterRunningActions = "No"
428 filePath = "MenuTableViewController.m" 410 filePath = "MenuTableViewController.m"
429 - timestampString = "434037601.622012" 411 + timestampString = "434133664.559575"
430 startingColumnNumber = "9223372036854775807" 412 startingColumnNumber = "9223372036854775807"
431 endingColumnNumber = "9223372036854775807" 413 endingColumnNumber = "9223372036854775807"
432 - startingLineNumber = "902"  
433 - endingLineNumber = "902" 414 + startingLineNumber = "906"
  415 + endingLineNumber = "906"
434 landmarkName = "-tableView:cellForRowAtIndexPath:" 416 landmarkName = "-tableView:cellForRowAtIndexPath:"
435 landmarkType = "5"> 417 landmarkType = "5">
436 </BreakpointContent> 418 </BreakpointContent>
@@ -442,11 +424,11 @@ @@ -442,11 +424,11 @@
442 ignoreCount = "0" 424 ignoreCount = "0"
443 continueAfterRunningActions = "No" 425 continueAfterRunningActions = "No"
444 filePath = "MenuTableViewController.m" 426 filePath = "MenuTableViewController.m"
445 - timestampString = "434037601.622012" 427 + timestampString = "434133664.559575"
446 startingColumnNumber = "9223372036854775807" 428 startingColumnNumber = "9223372036854775807"
447 endingColumnNumber = "9223372036854775807" 429 endingColumnNumber = "9223372036854775807"
448 - startingLineNumber = "900"  
449 - endingLineNumber = "900" 430 + startingLineNumber = "904"
  431 + endingLineNumber = "904"
450 landmarkName = "-tableView:cellForRowAtIndexPath:" 432 landmarkName = "-tableView:cellForRowAtIndexPath:"
451 landmarkType = "5"> 433 landmarkType = "5">
452 </BreakpointContent> 434 </BreakpointContent>
@@ -458,11 +440,11 @@ @@ -458,11 +440,11 @@
458 ignoreCount = "0" 440 ignoreCount = "0"
459 continueAfterRunningActions = "No" 441 continueAfterRunningActions = "No"
460 filePath = "MenuTableViewController.m" 442 filePath = "MenuTableViewController.m"
461 - timestampString = "434037601.622012" 443 + timestampString = "434133664.559575"
462 startingColumnNumber = "9223372036854775807" 444 startingColumnNumber = "9223372036854775807"
463 endingColumnNumber = "9223372036854775807" 445 endingColumnNumber = "9223372036854775807"
464 - startingLineNumber = "761"  
465 - endingLineNumber = "761" 446 + startingLineNumber = "765"
  447 + endingLineNumber = "765"
466 landmarkName = "-tableView:cellForRowAtIndexPath:" 448 landmarkName = "-tableView:cellForRowAtIndexPath:"
467 landmarkType = "5"> 449 landmarkType = "5">
468 </BreakpointContent> 450 </BreakpointContent>
@@ -538,11 +520,11 @@ @@ -538,11 +520,11 @@
538 ignoreCount = "0" 520 ignoreCount = "0"
539 continueAfterRunningActions = "No" 521 continueAfterRunningActions = "No"
540 filePath = "MenuTableViewController.m" 522 filePath = "MenuTableViewController.m"
541 - timestampString = "434037601.622012" 523 + timestampString = "434133664.559575"
542 startingColumnNumber = "9223372036854775807" 524 startingColumnNumber = "9223372036854775807"
543 endingColumnNumber = "9223372036854775807" 525 endingColumnNumber = "9223372036854775807"
544 - startingLineNumber = "1230"  
545 - endingLineNumber = "1230" 526 + startingLineNumber = "1235"
  527 + endingLineNumber = "1235"
546 landmarkName = "-passDateRangeViewController:didFinishEnteringItem::" 528 landmarkName = "-passDateRangeViewController:didFinishEnteringItem::"
547 landmarkType = "5"> 529 landmarkType = "5">
548 </BreakpointContent> 530 </BreakpointContent>
@@ -554,12 +536,12 @@ @@ -554,12 +536,12 @@
554 ignoreCount = "0" 536 ignoreCount = "0"
555 continueAfterRunningActions = "No" 537 continueAfterRunningActions = "No"
556 filePath = "MenuTableViewController.m" 538 filePath = "MenuTableViewController.m"
557 - timestampString = "434037601.622012" 539 + timestampString = "434133664.559575"
558 startingColumnNumber = "9223372036854775807" 540 startingColumnNumber = "9223372036854775807"
559 endingColumnNumber = "9223372036854775807" 541 endingColumnNumber = "9223372036854775807"
560 - startingLineNumber = "1215"  
561 - endingLineNumber = "1215"  
562 - landmarkName = "-passDateRangeViewController:didFinishEnteringItem::" 542 + startingLineNumber = "1220"
  543 + endingLineNumber = "1220"
  544 + landmarkName = "-passNameViewController:didFinishEnteringItem:"
563 landmarkType = "5"> 545 landmarkType = "5">
564 </BreakpointContent> 546 </BreakpointContent>
565 </BreakpointProxy> 547 </BreakpointProxy>
DUREX Vendor Control/FirstAppExample/EMDevicePickerViewController.m
@@ -106,7 +106,7 @@ @@ -106,7 +106,7 @@
106 106
107 -(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath 107 -(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
108 { 108 {
109 - //[self performSegueWithIdentifier:@"ConnectionSegue" sender:self]; 109 + [self performSegueWithIdentifier:@"ConnectionSegue" sender:self];
110 if(![[[[tableView cellForRowAtIndexPath:indexPath] textLabel] text] isEqualToString:NSLocalizedString(@"Searching for devices...",nil)]) 110 if(![[[[tableView cellForRowAtIndexPath:indexPath] textLabel] text] isEqualToString:NSLocalizedString(@"Searching for devices...",nil)])
111 { 111 {
112 [self _showConnectingView]; 112 [self _showConnectingView];
DUREX Vendor Control/MenuTableViewController.h
@@ -73,16 +73,6 @@ enum { @@ -73,16 +73,6 @@ enum {
73 73
74 @interface MenuTableViewController : UITableViewController <DatePickerViewControllerDelegate,PriceChangerViewControllerDelegate,NameChangerViewControllerDelegate, DateRangePickerViewControllerDelegate, CommunicationProtocolDelegate, NSURLConnectionDataDelegate> 74 @interface MenuTableViewController : UITableViewController <DatePickerViewControllerDelegate,PriceChangerViewControllerDelegate,NameChangerViewControllerDelegate, DateRangePickerViewControllerDelegate, CommunicationProtocolDelegate, NSURLConnectionDataDelegate>
75 75
76 -@property (strong,nonatomic) Stack *parentLayout;  
77 -@property (strong,nonatomic) DatePickerViewController *datePickerViewController;  
78 -@property (strong,nonatomic) PriceChangerViewController *priceChangerViewController;  
79 -@property (strong,nonatomic) NameChangerViewController *nameChangerViewController;  
80 -@property (strong,nonatomic) DateRangePickerViewController *dateRangePickerViewController;  
81 -@property (strong,nonatomic) Sensors *sensorStatus;  
82 -@property (strong,nonatomic) SalesLog *salesLog;  
83 -@property (strong,nonatomic) Sale *currentSale;  
84 -@property (strong,nonatomic) NSString *machineMACAddr;  
85 -  
86 - (void) navBack; 76 - (void) navBack;
87 77
88 @end 78 @end
DUREX Vendor Control/MenuTableViewController.m
@@ -13,6 +13,8 @@ @@ -13,6 +13,8 @@
13 IBOutlet UIActivityIndicatorView *_activityIndicator; 13 IBOutlet UIActivityIndicatorView *_activityIndicator;
14 NSTimer *_writeTimer; 14 NSTimer *_writeTimer;
15 } 15 }
  16 +
  17 +//NAVIGATION LEVELS LAYOUT AND CELL IDENTIFIERS
16 @property (nonatomic,strong) const NSMutableArray *menuElements; 18 @property (nonatomic,strong) const NSMutableArray *menuElements;
17 @property (nonatomic,strong) const NSMutableArray *menuStructure; 19 @property (nonatomic,strong) const NSMutableArray *menuStructure;
18 @property (nonatomic,strong) const NSMutableArray *menuHeaders; 20 @property (nonatomic,strong) const NSMutableArray *menuHeaders;
@@ -35,29 +37,32 @@ @@ -35,29 +37,32 @@
35 37
36 @property (nonatomic,strong) const NSArray *cellIdentifiers; 38 @property (nonatomic,strong) const NSArray *cellIdentifiers;
37 39
  40 +//GENERAL ATTRIBUTES
38 @property (nonatomic,strong) CommunicationProtocol* protocol; 41 @property (nonatomic,strong) CommunicationProtocol* protocol;
39 -@property uint8_t currentNavLevel;  
40 -@property NSString *currentCellIdentifier;  
41 -@property const NSMutableArray *currentElements;  
42 -@property const NSMutableArray *currentStructure;  
43 -@property const NSMutableArray *currentHeaders; 42 +@property (strong,nonatomic) NSString *machineMACAddr;
  43 +@property (strong,nonatomic) Stack *parentLayout;
44 44
  45 +@property (strong,nonatomic) Sensors *sensorStatus;
  46 +@property (strong,nonatomic) SalesLog *salesLog;
  47 +@property (strong,nonatomic) Sale *currentSale;
45 @property uint8_t requestedLog; 48 @property uint8_t requestedLog;
46 @property uint8_t sentCommand; 49 @property uint8_t sentCommand;
  50 +
  51 +@property uint8_t currentNavLevel;
  52 +@property (strong,nonatomic) NSString *currentCellIdentifier;
  53 +@property (strong,nonatomic) const NSMutableArray *currentElements;
  54 +@property (strong,nonatomic) const NSMutableArray *currentStructure;
  55 +@property (strong,nonatomic) const NSMutableArray *currentHeaders;
  56 +
  57 +@property (strong,nonatomic) DatePickerViewController *datePickerViewController;
  58 +@property (strong,nonatomic) PriceChangerViewController *priceChangerViewController;
  59 +@property (strong,nonatomic) NameChangerViewController *nameChangerViewController;
  60 +@property (strong,nonatomic) DateRangePickerViewController *dateRangePickerViewController;
47 @end 61 @end
48 62
49 @implementation MenuTableViewController 63 @implementation MenuTableViewController
50 64
51 -- (id)initWithStyle:(UITableViewStyle)style  
52 -{  
53 - self = [super initWithStyle:style];  
54 - if (self)  
55 - {  
56 - // Custom initialization  
57 - }  
58 - return self;  
59 -}  
60 - 65 +//NAVIGATION LEVELS GENERATION AND NAVIGATION
61 - (void) initializeMenuEntries 66 - (void) initializeMenuEntries
62 { 67 {
63 [self setMenuElements:[[NSMutableArray alloc] initWithObjects:MENU_ELEMENTS, nil]]; 68 [self setMenuElements:[[NSMutableArray alloc] initWithObjects:MENU_ELEMENTS, nil]];
@@ -203,16 +208,6 @@ @@ -203,16 +208,6 @@
203 [self changeNavLevel: prevLevel.intValue : FALSE]; 208 [self changeNavLevel: prevLevel.intValue : FALSE];
204 } 209 }
205 210
206 -- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section  
207 -{  
208 - NSString *title = @"";  
209 - if([self currentHeaders] != nil)  
210 - {  
211 - title = [[self currentHeaders] objectAtIndex:section];  
212 - }  
213 - return title;  
214 -}  
215 -  
216 - (void) backButtonPressed: (id) sender 211 - (void) backButtonPressed: (id) sender
217 { 212 {
218 NSLog(@"[MenuTableViewController.m]: Navigation Stack has %ld remaining levels",(long)[[self parentLayout] count]); 213 NSLog(@"[MenuTableViewController.m]: Navigation Stack has %ld remaining levels",(long)[[self parentLayout] count]);
@@ -224,10 +219,12 @@ @@ -224,10 +219,12 @@
224 else 219 else
225 { 220 {
226 NSLog(@"[MenuTableViewController.m]: No more navigation levels in stack, falling to previous view"); 221 NSLog(@"[MenuTableViewController.m]: No more navigation levels in stack, falling to previous view");
  222 + [_protocol disconnect];
227 [self.navigationController popViewControllerAnimated:YES]; 223 [self.navigationController popViewControllerAnimated:YES];
228 } 224 }
229 } 225 }
230 226
  227 +//MAINTENANCE REPORT SENDING
231 - (void) sendMaintenanceReport : (NSString*) status : (NSString*) date : (NSString*) machineid 228 - (void) sendMaintenanceReport : (NSString*) status : (NSString*) date : (NSString*) machineid
232 { 229 {
233 NSString *content = [NSString stringWithFormat:@"status=%@&date=%@&machineid=%@",status,date,machineid]; 230 NSString *content = [NSString stringWithFormat:@"status=%@&date=%@&machineid=%@",status,date,machineid];
@@ -235,15 +232,11 @@ @@ -235,15 +232,11 @@
235 NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:[NSURL URLWithString:REPORT_SERVER_URL]]; 232 NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:[NSURL URLWithString:REPORT_SERVER_URL]];
236 [request setHTTPMethod:@"POST"]; 233 [request setHTTPMethod:@"POST"];
237 [request setHTTPBody:[content dataUsingEncoding:NSUTF8StringEncoding]]; 234 [request setHTTPBody:[content dataUsingEncoding:NSUTF8StringEncoding]];
238 -  
239 - // generates an autoreleased NSURLConnection  
240 [NSURLConnection connectionWithRequest:request delegate:self]; 235 [NSURLConnection connectionWithRequest:request delegate:self];
241 } 236 }
242 237
243 - (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data 238 - (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data
244 { 239 {
245 - // Append the new data to receivedData.  
246 - // receivedData is an instance variable declared elsewhere.  
247 NSLog(@"[MenuTableViewController.m]: Received response from report server: %@",[NSString stringWithUTF8String:[data bytes]]); 240 NSLog(@"[MenuTableViewController.m]: Received response from report server: %@",[NSString stringWithUTF8String:[data bytes]]);
248 [self.view makeToast:NSLocalizedString(@"Report sent successfully", nil) duration:3 position:[NSValue valueWithCGPoint:CGPointMake(self.view.frame.size.width/2,self.view.frame.size.height/2)] title:NSLocalizedString(@"Success!", nil) image:[UIImage imageNamed:@"icon_checkmark"]]; 241 [self.view makeToast:NSLocalizedString(@"Report sent successfully", nil) duration:3 position:[NSValue valueWithCGPoint:CGPointMake(self.view.frame.size.width/2,self.view.frame.size.height/2)] title:NSLocalizedString(@"Success!", nil) image:[UIImage imageNamed:@"icon_checkmark"]];
249 } 242 }
@@ -253,7 +246,20 @@ @@ -253,7 +246,20 @@
253 NSLog(@"[MenuTableViewController.m]: Error connecting to server: %@ %@",[error localizedDescription],[[error userInfo] objectForKey:NSURLErrorFailingURLStringErrorKey]); 246 NSLog(@"[MenuTableViewController.m]: Error connecting to server: %@ %@",[error localizedDescription],[[error userInfo] objectForKey:NSURLErrorFailingURLStringErrorKey]);
254 [self.view makeToast:NSLocalizedString(@"Connection to server failed", nil) duration:3 position:[NSValue valueWithCGPoint:CGPointMake(self.view.frame.size.width/2,self.view.frame.size.height/2)] title:NSLocalizedString(@"Error", nil) image:[UIImage imageNamed:@"icon_delete"]]; 247 [self.view makeToast:NSLocalizedString(@"Connection to server failed", nil) duration:3 position:[NSValue valueWithCGPoint:CGPointMake(self.view.frame.size.width/2,self.view.frame.size.height/2)] title:NSLocalizedString(@"Error", nil) image:[UIImage imageNamed:@"icon_delete"]];
255 } 248 }
  249 +//PROTOCOL ERROR CALLBACK
  250 +- (void) reportProtocolError: (CommunicationProtocol*)protocol didFinishEnteringItem:(NSString*) error
  251 +{
  252 + if(self.currentNavLevel == 255)
  253 + {
  254 + [self processMessage:protocol didFinishEnteringItem:@"ERROR"];
  255 + }
  256 + else
  257 + {
  258 + [self.view makeToast:error duration:3 position:[NSValue valueWithCGPoint:CGPointMake(self.view.frame.size.width/2,self.view.frame.size.height/2)] title:NSLocalizedString(@"Error", nil) image:[UIImage imageNamed:@"icon_delete"]];
  259 + }
  260 +}
256 261
  262 +//MESSAGE RECEIVED CALLBACK
257 - (void)processMessage:(CommunicationProtocol*)protocol didFinishEnteringItem:(NSString*) response 263 - (void)processMessage:(CommunicationProtocol*)protocol didFinishEnteringItem:(NSString*) response
258 { 264 {
259 NSLog(@"[MenuTableViewController.m]: Answer received"); 265 NSLog(@"[MenuTableViewController.m]: Answer received");
@@ -298,11 +304,12 @@ @@ -298,11 +304,12 @@
298 NSLog(@"[MenuTableViewController.m]: Received A5 answer"); 304 NSLog(@"[MenuTableViewController.m]: Received A5 answer");
299 if([response isEqualToString:@"P51"]) 305 if([response isEqualToString:@"P51"])
300 { 306 {
301 - 307 + [self.view makeToast:NSLocalizedString(@"Time and Date changed successfully", nil) duration:3 position:[NSValue valueWithCGPoint:CGPointMake(self.view.frame.size.width/2,self.view.frame.size.height/2)] title:nil image:[UIImage imageNamed:@"icon_checkmark"]];
302 } 308 }
303 else if([response isEqualToString:@"P52"]) 309 else if([response isEqualToString:@"P52"])
304 { 310 {
305 NSLog(@"[MenuTableViewController.m]: Device returned error for command A5"); 311 NSLog(@"[MenuTableViewController.m]: Device returned error for command A5");
  312 + [self.view makeToast:NSLocalizedString(@"Time and Date change returned error", nil) duration:3 position:[NSValue valueWithCGPoint:CGPointMake(self.view.frame.size.width/2,self.view.frame.size.height/2)] title:NSLocalizedString(@"Error", nil) image:[UIImage imageNamed:@"icon_delete"]];
306 } 313 }
307 } 314 }
308 else if(self.sentCommand == A6 && [[response substringToIndex:2]isEqualToString:@"P6"]) 315 else if(self.sentCommand == A6 && [[response substringToIndex:2]isEqualToString:@"P6"])
@@ -310,11 +317,12 @@ @@ -310,11 +317,12 @@
310 NSLog(@"[MenuTableViewController.m]: Received A6 answer"); 317 NSLog(@"[MenuTableViewController.m]: Received A6 answer");
311 if([response isEqualToString:@"P61"]) 318 if([response isEqualToString:@"P61"])
312 { 319 {
313 - 320 + [self.view makeToast:NSLocalizedString(@"Product price changed successfully", nil) duration:3 position:[NSValue valueWithCGPoint:CGPointMake(self.view.frame.size.width/2,self.view.frame.size.height/2)] title:nil image:[UIImage imageNamed:@"icon_checkmark"]];
314 } 321 }
315 else if([response isEqualToString:@"P62"]) 322 else if([response isEqualToString:@"P62"])
316 { 323 {
317 NSLog(@"[MenuTableViewController.m]: Device returned error for command A6"); 324 NSLog(@"[MenuTableViewController.m]: Device returned error for command A6");
  325 + [self.view makeToast:NSLocalizedString(@"Product price change returned error", nil) duration:3 position:[NSValue valueWithCGPoint:CGPointMake(self.view.frame.size.width/2,self.view.frame.size.height/2)] title:NSLocalizedString(@"Error", nil) image:[UIImage imageNamed:@"icon_delete"]];
318 } 326 }
319 } 327 }
320 else if(self.sentCommand == A7 && [[response substringToIndex:2]isEqualToString:@"P7"]) 328 else if(self.sentCommand == A7 && [[response substringToIndex:2]isEqualToString:@"P7"])
@@ -322,11 +330,12 @@ @@ -322,11 +330,12 @@
322 NSLog(@"[MenuTableViewController.m]: Received A7 answer"); 330 NSLog(@"[MenuTableViewController.m]: Received A7 answer");
323 if([response isEqualToString:@"P71"]) 331 if([response isEqualToString:@"P71"])
324 { 332 {
325 - 333 + [self.view makeToast:NSLocalizedString(@"Product name changed successfully", nil) duration:3 position:[NSValue valueWithCGPoint:CGPointMake(self.view.frame.size.width/2,self.view.frame.size.height/2)] title:nil image:[UIImage imageNamed:@"icon_checkmark"]];
326 } 334 }
327 else if([response isEqualToString:@"P72"]) 335 else if([response isEqualToString:@"P72"])
328 { 336 {
329 NSLog(@"[MenuTableViewController.m]: Device returned error for command A7"); 337 NSLog(@"[MenuTableViewController.m]: Device returned error for command A7");
  338 + [self.view makeToast:NSLocalizedString(@"Product name change returned error", nil) duration:3 position:[NSValue valueWithCGPoint:CGPointMake(self.view.frame.size.width/2,self.view.frame.size.height/2)] title:NSLocalizedString(@"Error", nil) image:[UIImage imageNamed:@"icon_delete"]];
330 } 339 }
331 } 340 }
332 else 341 else
@@ -402,6 +411,7 @@ @@ -402,6 +411,7 @@
402 411
403 #pragma mark - Table view delegate 412 #pragma mark - Table view delegate
404 413
  414 +//CELL PROCESSING AND CUSTOMIZATION
405 - (void) addTags : (NSMutableArray*) rows : (NSInteger) tag 415 - (void) addTags : (NSMutableArray*) rows : (NSInteger) tag
406 { 416 {
407 for(int i = 0; i < [rows count]; i++) 417 for(int i = 0; i < [rows count]; i++)
@@ -552,6 +562,17 @@ @@ -552,6 +562,17 @@
552 [[self currentStructure] replaceObjectAtIndex:[indexPath section] withObject:[NSNumber numberWithInt:([[[self currentStructure] objectAtIndex:[indexPath section]] intValue] - numRows)]]; 562 [[self currentStructure] replaceObjectAtIndex:[indexPath section] withObject:[NSNumber numberWithInt:([[[self currentStructure] objectAtIndex:[indexPath section]] intValue] - numRows)]];
553 } 563 }
554 564
  565 +//UITABLEVIEWCONTROLLER FUNCTIONS
  566 +- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section
  567 +{
  568 + NSString *title = @"";
  569 + if([self currentHeaders] != nil)
  570 + {
  571 + title = [[self currentHeaders] objectAtIndex:section];
  572 + }
  573 + return title;
  574 +}
  575 +
555 - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section 576 - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
556 { 577 {
557 return [[[self currentStructure] objectAtIndex:section] intValue]; 578 return [[[self currentStructure] objectAtIndex:section] intValue];
@@ -1120,6 +1141,7 @@ @@ -1120,6 +1141,7 @@
1120 return cell; 1141 return cell;
1121 } 1142 }
1122 1143
  1144 +//DELEGATE FUNCTIONS
1123 - (void)passDateViewController:(DatePickerViewController *)controller didFinishEnteringItem:(NSDate *)date 1145 - (void)passDateViewController:(DatePickerViewController *)controller didFinishEnteringItem:(NSDate *)date
1124 { 1146 {
1125 NSCalendar *calendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar]; 1147 NSCalendar *calendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar];
DUREX Vendor Control/en.lproj/Localizable.strings
@@ -92,4 +92,12 @@ @@ -92,4 +92,12 @@
92 "Entered product code has an invalid format" = "Entered product code has an invalid format"; 92 "Entered product code has an invalid format" = "Entered product code has an invalid format";
93 "Entered channel has an invalid format" = "Entered channel has an invalid format"; 93 "Entered channel has an invalid format" = "Entered channel has an invalid format";
94 "Missing channel" = "Missing channel"; 94 "Missing channel" = "Missing channel";
95 -"Missing product code" = "Missing product code";  
96 \ No newline at end of file 95 \ No newline at end of file
  96 +"Missing product code" = "Missing product code";
  97 +"Time and Date changed successfully" = "Time and Date changed successfully";
  98 +"Time and Date change returned error" = "Time and Date change returned error";
  99 +"Product price changed successfully" = "Product price changed successfully";
  100 +"Product price change returned error" = "Product price change returned error";
  101 +"Product name changed successfully" = "Product name changed successfully";
  102 +"Product name change returned error" = "Product name change returned error";
  103 +"Error occurred while reading answer from device" = "Error occurred while reading answer from device";
  104 +"Error occurred while sending command to device" = "Error occurred while sending command to device";
97 \ No newline at end of file 105 \ No newline at end of file
DUREX Vendor Control/es.lproj/Localizable.strings
@@ -92,4 +92,12 @@ @@ -92,4 +92,12 @@
92 "Entered code has an invalid format" = "El código de producto introducido está en un formato incorrecto"; 92 "Entered code has an invalid format" = "El código de producto introducido está en un formato incorrecto";
93 "Entered channel has an invalid format" = "El canal introducido está en un formato incorrecto"; 93 "Entered channel has an invalid format" = "El canal introducido está en un formato incorrecto";
94 "Missing channel" = "Falta el canal"; 94 "Missing channel" = "Falta el canal";
95 -"Missing product code" = "Falta el código del producto";  
96 \ No newline at end of file 95 \ No newline at end of file
  96 +"Missing product code" = "Falta el código del producto";
  97 +"Time and Date changed successfully" = "Fecha y hora cambiadas con éxito";
  98 +"Time and Date change returned error" = "Error al cambiar la fecha y hora";
  99 +"Product price changed successfully" = "El precio del producto se cambió con éxito";
  100 +"Product price change returned error" = "Error al cambiar el precio del producto";
  101 +"Product name changed successfully" = "El nombre del producto se cambió con éxito";
  102 +"Product name change returned error" = "Error al cambiar el nombre del producto";
  103 +"Error occurred while reading answer from device" = "Error al leer la respuesta del dispositivo";
  104 +"Error occurred while sending command to device" = "Error al mandar el comando al dispositivo";
97 \ No newline at end of file 105 \ No newline at end of file
@@ -5,12 +5,9 @@ BUGS: @@ -5,12 +5,9 @@ BUGS:
5 - On date change, response is overwritten by previous query, trimming needed according to numBytes 5 - On date change, response is overwritten by previous query, trimming needed according to numBytes
6 6
7 TODO: 7 TODO:
8 -- Error reporting function  
9 -- Toast if success or error on processMessage (except nav changes)  
10 - Incident class 8 - Incident class
11 - Incident parser 9 - Incident parser
12 - A3 command 10 - A3 command
13 -- BYE command  
14 - Channels and codes to 2 ciphers 11 - Channels and codes to 2 ciphers
15 - Add landscape layout and inverted layout 12 - Add landscape layout and inverted layout
16 - Month/Year headers on sale list 13 - Month/Year headers on sale list