diff --git a/DUREX Vendor Control/Base.lproj/Localizable.strings b/DUREX Vendor Control/Base.lproj/Localizable.strings index 8c7bf12..43ab022 100644 --- a/DUREX Vendor Control/Base.lproj/Localizable.strings +++ b/DUREX Vendor Control/Base.lproj/Localizable.strings @@ -45,4 +45,16 @@ "Searching for devices..." = "Searching for devices..."; "Connection Failed" = "Connection Failed"; "An error occurred while trying to connect to the selected device" = "An error occurred while trying to connect to the selected device"; -"Close" = "Close"; \ No newline at end of file +"Close" = "Close"; +"20€ Notes" = "20€ Notes"; +"10€ Notes" = "10€ Notes"; +"5€ Notes" = "5€ Notes"; +"2€ Coins" = "2€ Coins"; +"1€ Coins" = "1€ Coins"; +"50c Coins" = "50c Coins"; +"Channel" = "Channel"; +"Product Code" = "Product Code"; +"Nominal Price" = "Nominal Price"; +"Discounted Price" = "Discounted Price"; +"1€ Change" = "1€ Change"; +"50c Change" = "50c Change"; \ No newline at end of file diff --git a/DUREX Vendor Control/CommunicationProtocol.h b/DUREX Vendor Control/CommunicationProtocol.h index 2903169..2983ba8 100644 --- a/DUREX Vendor Control/CommunicationProtocol.h +++ b/DUREX Vendor Control/CommunicationProtocol.h @@ -9,8 +9,9 @@ #import #import "EMFramework.h" -#define MAX_STRING_LENGTH ((int)200) -#define MAX_RETRIES ((int)3) +#define MAX_STRING_LENGTH ((int)200) +#define MAX_RETRIES ((int)3) +#define MAX_PRODUCT_NAME_LENGTH ((int)64) @interface CommunicationProtocol : NSObject @@ -18,6 +19,9 @@ -(Boolean) writeMessage: (NSString*) message; -(NSString*) readMessage; -(Boolean) establishConnection; +-(Boolean) updateTime: (NSDateComponents*) date; +-(Boolean) updatePrice: (uint8_t) channel : (uint8_t) product : (uint8_t) eur : (uint8_t) cents; +-(Boolean) updateProductName: (uint8_t) channel : (uint8_t) product : (NSString*) name; +(id) sharedProtocol; @property Boolean messageAvailable; diff --git a/DUREX Vendor Control/CommunicationProtocol.m b/DUREX Vendor Control/CommunicationProtocol.m index 5d08152..bcdffae 100644 --- a/DUREX Vendor Control/CommunicationProtocol.m +++ b/DUREX Vendor Control/CommunicationProtocol.m @@ -185,4 +185,54 @@ return FALSE; } +-(Boolean) updateTime: (NSDateComponents*) date +{ + if(date == nil) + { + NSCalendar *calendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar]; + NSCalendarUnit units = NSYearCalendarUnit | NSMonthCalendarUnit | NSDayCalendarUnit | NSHourCalendarUnit | NSMinuteCalendarUnit | NSSecondCalendarUnit; + date = [calendar components:units fromDate:[NSDate date]]; + } + NSMutableString *command = [NSMutableString stringWithFormat: @"A5"]; + NSInteger year = [date year]; + year = year - (year/100)*100; + [command appendString:[NSString stringWithFormat:@"%02d",year]]; + [command appendString:[NSString stringWithFormat:@"%02d%02d%02d%02d%02d",[date month],[date day],[date hour],[date minute],[date second]]]; + [self writeMessage:command]; + NSString *answer = [self readMessage]; + if([answer isEqualToString:@"P51"]) + { + return TRUE; + } + return FALSE; +} + +-(Boolean) updatePrice: (uint8_t) channel : (uint8_t) product : (uint8_t) eur : (uint8_t) cents +{ + NSMutableString *command = [NSMutableString stringWithFormat: @"A6%01d%01d%02d%02d",channel,product,eur,cents]; + [self writeMessage:command]; + NSString *answer = [self readMessage]; + if([answer isEqualToString:@"P61"]) + { + return TRUE; + } + return FALSE; +} + +-(Boolean) updateProductName: (uint8_t) channel : (uint8_t) product : (NSString*) name +{ + if([name length] > MAX_PRODUCT_NAME_LENGTH) + { + name = [name substringToIndex:MAX_PRODUCT_NAME_LENGTH-1]; + } + NSMutableString *command = [NSMutableString stringWithFormat: @"A7%01d%01d%@",channel,product,name]; + [self writeMessage:command]; + NSString *answer = [self readMessage]; + if([answer isEqualToString:@"P71"]) + { + return TRUE; + } + return FALSE; +} + @end diff --git a/DUREX Vendor Control/DUREX Vendor Control.xcodeproj/project.pbxproj b/DUREX Vendor Control/DUREX Vendor Control.xcodeproj/project.pbxproj index 53e8b52..35ccf49 100644 --- a/DUREX Vendor Control/DUREX Vendor Control.xcodeproj/project.pbxproj +++ b/DUREX Vendor Control/DUREX Vendor Control.xcodeproj/project.pbxproj @@ -429,8 +429,8 @@ CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - CODE_SIGN_IDENTITY = "iPhone Developer"; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CODE_SIGN_IDENTITY = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; COPY_PHASE_STRIP = NO; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; @@ -469,8 +469,8 @@ CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - CODE_SIGN_IDENTITY = "iPhone Developer"; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CODE_SIGN_IDENTITY = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; COPY_PHASE_STRIP = YES; ENABLE_NS_ASSERTIONS = NO; GCC_C_LANGUAGE_STANDARD = gnu99; diff --git a/DUREX Vendor Control/DUREX Vendor Control.xcodeproj/project.xcworkspace/xcuserdata/imanol.xcuserdatad/UserInterfaceState.xcuserstate b/DUREX Vendor Control/DUREX Vendor Control.xcodeproj/project.xcworkspace/xcuserdata/imanol.xcuserdatad/UserInterfaceState.xcuserstate index 13cd5c4..35d3138 100644 --- a/DUREX Vendor Control/DUREX Vendor Control.xcodeproj/project.xcworkspace/xcuserdata/imanol.xcuserdatad/UserInterfaceState.xcuserstate +++ b/DUREX Vendor Control/DUREX Vendor Control.xcodeproj/project.xcworkspace/xcuserdata/imanol.xcuserdatad/UserInterfaceState.xcuserstate diff --git a/DUREX Vendor Control/FirstAppExample/Base.lproj/MainStoryboard.storyboard b/DUREX Vendor Control/FirstAppExample/Base.lproj/MainStoryboard.storyboard index 378c741..76d7e6e 100644 --- a/DUREX Vendor Control/FirstAppExample/Base.lproj/MainStoryboard.storyboard +++ b/DUREX Vendor Control/FirstAppExample/Base.lproj/MainStoryboard.storyboard @@ -1,5 +1,5 @@ - + @@ -78,9 +78,26 @@ - + + + + + + + + + + + + @@ -102,6 +119,30 @@ + + + + + + + + + + + + diff --git a/DUREX Vendor Control/MenuTableViewController.h b/DUREX Vendor Control/MenuTableViewController.h index a2861b2..d320392 100644 --- a/DUREX Vendor Control/MenuTableViewController.h +++ b/DUREX Vendor Control/MenuTableViewController.h @@ -21,13 +21,20 @@ #define MAINTENANCE_CELLS_PER_SECTION num(23),num(3) #define MAINTENANCE_HEADERS NSLocalizedString(@"Sensors", nil),NSLocalizedString(@"Commands", nil) -#define CELL_IDENTIFIERS @"MenuCell",@"MaintenanceCell",@"ConfigCell",@"ReportCell" +#define SALES_ELEMENTS @"20€ Notes",@"10€ Notes",@"5€ Notes",@"2€ Coins",@"1€ Coins",@"50c Coins",@"Channel",@"Product Code",@"Nominal Price",@"Discounted Price",@"1€ Change",@"50c Change",@"20€ Notes",@"10€ Notes",@"5€ Notes",@"2€ Coins",@"1€ Coins",@"50c Coins",@"Channel",@"Product Code",@"Nominal Price",@"Discounted Price",@"1€ Change",@"50c Change",@"20€ Notes",@"10€ Notes",@"5€ Notes",@"2€ Coins",@"1€ Coins",@"50c Coins",@"Channel",@"Product Code",@"Nominal Price",@"Discounted Price",@"1€ Change",@"50c Change" +#define SALES_CELLS_PER_SECTION num(12),num(12),num(12) +#define SALES_HEADERS @"14/06/2014",@"25/06/2014",@"05/07/2014" -#define NUM_CHANNELS 8 +#define CONFIGURATION_ELEMENTS @"Update Date & Time",@"Update product price",@"Update product name" +#define CONFIGURATION_CELLS_PER_SECTION num(3) +#define CONFIGURATION_HEADERS nil + +#define CELL_IDENTIFIERS @"MenuCell",@"MaintenanceCell",@"SalesCell",@"ConfigCell",@"ReportCell" enum { MENU = 0, MAINTENANCE, + SALES, BASIC_CONFIGURATION, REPORT, } navigationLevel; diff --git a/DUREX Vendor Control/MenuTableViewController.m b/DUREX Vendor Control/MenuTableViewController.m index ae9c227..49b6f5e 100644 --- a/DUREX Vendor Control/MenuTableViewController.m +++ b/DUREX Vendor Control/MenuTableViewController.m @@ -21,6 +21,14 @@ @property (nonatomic,strong) const NSArray *maintenanceStructure; @property (nonatomic,strong) const NSArray *maintenanceHeaders; +@property (nonatomic,strong) const NSArray *salesElements; +@property (nonatomic,strong) const NSArray *salesStructure; +@property (nonatomic,strong) const NSArray *salesHeaders; + +@property (nonatomic,strong) const NSArray *configElements; +@property (nonatomic,strong) const NSArray *configStructure; +@property (nonatomic,strong) const NSArray *configHeaders; + @property (nonatomic,strong) const NSArray *cellIdentifiers; @property (nonatomic,strong) CommunicationProtocol* protocol; @@ -68,6 +76,28 @@ [self setMaintenanceHeaders:nil]; } + [self setSalesElements:[[NSArray alloc] initWithObjects:SALES_ELEMENTS, nil]]; + [self setSalesStructure:[[NSArray alloc] initWithObjects:SALES_CELLS_PER_SECTION, nil]]; + if([[self salesStructure] count] > 1) + { + [self setSalesHeaders:[[NSArray alloc] initWithObjects:SALES_HEADERS, nil]]; + } + else + { + [self setSalesHeaders:nil]; + } + + [self setConfigElements:[[NSArray alloc] initWithObjects:CONFIGURATION_ELEMENTS, nil]]; + [self setConfigStructure:[[NSArray alloc] initWithObjects:CONFIGURATION_CELLS_PER_SECTION, nil]]; + if([[self configStructure] count] > 1) + { + [self setConfigHeaders:[[NSArray alloc] initWithObjects:CONFIGURATION_HEADERS, nil]]; + } + else + { + [self setConfigHeaders:nil]; + } + [self setCellIdentifiers:[[NSArray alloc] initWithObjects:CELL_IDENTIFIERS, nil]]; } @@ -94,6 +124,20 @@ [self setCurrentStructure:[self maintenanceStructure]]; [self setCurrentHeaders:[self maintenanceHeaders]]; } + else if([self currentNavLevel] == SALES) + { + [[self navigationItem] setTitle:NSLocalizedString(@"Sales log", nil)]; + [self setCurrentElements:[self salesElements]]; + [self setCurrentStructure:[self salesStructure]]; + [self setCurrentHeaders:[self salesHeaders]]; + } + else if([self currentNavLevel] == BASIC_CONFIGURATION) + { + [[self navigationItem] setTitle:NSLocalizedString(@"Basic Configuration", nil)]; + [self setCurrentElements:[self configElements]]; + [self setCurrentStructure:[self configStructure]]; + [self setCurrentHeaders:[self configHeaders]]; + } //AND SO ON... [[self tableView] reloadData]; NSRange range = NSMakeRange(0, [self numberOfSectionsInTableView:[self tableView]]); @@ -235,12 +279,27 @@ NSLog(@"Section: %ld Row: %ld",(long)[indexPath section],(long)[indexPath row]); [tableView deselectRowAtIndexPath:indexPath animated:YES]; NSString *cellName = [[[[self tableView] cellForRowAtIndexPath:indexPath]textLabel]text]; - if([cellName isEqualToString:NSLocalizedString(@"Maintenance", nil)]) + if([cellName isEqualToString:NSLocalizedString(@"Maintenance", nil)] && [self currentNavLevel] == MENU) { NSLog(@"[MenuTableViewController.m]: Changing to navLevel: MAINTENANCE"); [self changeNavLevel:MAINTENANCE:TRUE]; } + else if([cellName isEqualToString:NSLocalizedString(@"Sales log", nil)] && [self currentNavLevel] == MAINTENANCE) + { + NSLog(@"[MenuTableViewController.m]: Changing to navLevel: SALES"); + [self changeNavLevel:SALES:TRUE]; + } + else if([cellName isEqualToString:NSLocalizedString(@"Sales log", nil)] && [self currentNavLevel] == MAINTENANCE) + { + NSLog(@"[MenuTableViewController.m]: Changing to navLevel: SALES"); + [self changeNavLevel:SALES:TRUE]; + } + else if([cellName isEqualToString:NSLocalizedString(@"Basic Configuration", nil)] && [self currentNavLevel] == MENU) + { + NSLog(@"[MenuTableViewController.m]: Changing to navLevel: BASIC_CONFIGURATION"); + [self changeNavLevel:BASIC_CONFIGURATION:TRUE]; + } } #pragma mark - Table view data source @@ -300,6 +359,10 @@ } } + else if([self currentNavLevel] == SALES) + { + + } return cell; } diff --git a/DUREX Vendor Control/Stack.m b/DUREX Vendor Control/Stack.m index 9e4aa88..25d90b4 100644 --- a/DUREX Vendor Control/Stack.m +++ b/DUREX Vendor Control/Stack.m @@ -27,10 +27,12 @@ - (void) push: (id) element { [[self dataArray] addObject:element]; + [self setLastPosition: [self lastPosition] + 1]; } - (id) pop { id element; + [self setLastPosition: [self lastPosition] - 1]; element = [[self dataArray] objectAtIndex:[self lastPosition]]; [[self dataArray] removeLastObject]; return element; diff --git a/DUREX Vendor Control/en.lproj/Localizable.strings b/DUREX Vendor Control/en.lproj/Localizable.strings index 8c7bf12..43ab022 100644 --- a/DUREX Vendor Control/en.lproj/Localizable.strings +++ b/DUREX Vendor Control/en.lproj/Localizable.strings @@ -45,4 +45,16 @@ "Searching for devices..." = "Searching for devices..."; "Connection Failed" = "Connection Failed"; "An error occurred while trying to connect to the selected device" = "An error occurred while trying to connect to the selected device"; -"Close" = "Close"; \ No newline at end of file +"Close" = "Close"; +"20€ Notes" = "20€ Notes"; +"10€ Notes" = "10€ Notes"; +"5€ Notes" = "5€ Notes"; +"2€ Coins" = "2€ Coins"; +"1€ Coins" = "1€ Coins"; +"50c Coins" = "50c Coins"; +"Channel" = "Channel"; +"Product Code" = "Product Code"; +"Nominal Price" = "Nominal Price"; +"Discounted Price" = "Discounted Price"; +"1€ Change" = "1€ Change"; +"50c Change" = "50c Change"; \ No newline at end of file diff --git a/DUREX Vendor Control/es.lproj/Localizable.strings b/DUREX Vendor Control/es.lproj/Localizable.strings index edc9139..3987546 100644 --- a/DUREX Vendor Control/es.lproj/Localizable.strings +++ b/DUREX Vendor Control/es.lproj/Localizable.strings @@ -45,4 +45,16 @@ "Searching for devices..." = "Buscando dispositivos..."; "Connection Failed" = "Falló la conexión"; "An error occurred while trying to connect to the selected device" = "Error al intentar conectarse al dispositivo seleccionado"; -"Close" = "Cerrar"; \ No newline at end of file +"Close" = "Cerrar"; +"20€ Notes" = "Billetes de 20€"; +"10€ Notes" = "Billetes de 10€"; +"5€ Notes" = "Billetes de 5€"; +"2€ Coins" = "Monedas de 2€"; +"1€ Coins" = "Monedas de 1€"; +"50c Coins" = "Monedas de 50c"; +"Channel" = "Canal"; +"Product Code" = "Código del producto"; +"Nominal Price" = "Precio Nominal"; +"Discounted Price" = "Precio con descuento"; +"1€ Change" = "Cambio de 1€"; +"50c Change" = "Cambio de 50c"; \ No newline at end of file diff --git a/DUREX tests/Base.lproj/Localizable.strings b/DUREX tests/Base.lproj/Localizable.strings index 4c4f4cd..93dcb30 100644 --- a/DUREX tests/Base.lproj/Localizable.strings +++ b/DUREX tests/Base.lproj/Localizable.strings @@ -38,4 +38,19 @@ "50c Coin spin" = "50c Coin spin"; "Sales log" = "Sales log"; "Incident report" = "Incident report"; -"Send report" = "Send report"; \ No newline at end of file +"Send report" = "Send report"; +"20€ Notes" = "20€ Notes"; +"10€ Notes" = "10€ Notes"; +"5€ Notes" = "5€ Notes"; +"2€ Coins" = "2€ Coins"; +"1€ Coins" = "1€ Coins"; +"50c Coins" = "50c Coins"; +"Channel" = "Channel"; +"Product Code" = "Product Code"; +"Nominal Price" = "Nominal Price"; +"Discounted Price" = "Discounted Price"; +"1€ Change" = "1€ Change"; +"50c Change" = "50c Change"; +"Update Date & Time" = "Update Date & Time"; +"Update product price" = "Update product price"; +"Update product name" = "Update product name"; \ No newline at end of file diff --git a/DUREX tests/Base.lproj/MainStoryboard.storyboard b/DUREX tests/Base.lproj/MainStoryboard.storyboard index 8b1c189..9f0a6e4 100644 --- a/DUREX tests/Base.lproj/MainStoryboard.storyboard +++ b/DUREX tests/Base.lproj/MainStoryboard.storyboard @@ -1,5 +1,5 @@ - + @@ -78,9 +78,26 @@ - + + + + + + + + + + + + @@ -102,6 +119,30 @@ + + + + + + + + + + + + @@ -166,10 +207,10 @@ - + + - diff --git a/DUREX tests/DUREX test.xcodeproj/project.xcworkspace/xcuserdata/imanol.xcuserdatad/UserInterfaceState.xcuserstate b/DUREX tests/DUREX test.xcodeproj/project.xcworkspace/xcuserdata/imanol.xcuserdatad/UserInterfaceState.xcuserstate index df5336e..172956a 100644 --- a/DUREX tests/DUREX test.xcodeproj/project.xcworkspace/xcuserdata/imanol.xcuserdatad/UserInterfaceState.xcuserstate +++ b/DUREX tests/DUREX test.xcodeproj/project.xcworkspace/xcuserdata/imanol.xcuserdatad/UserInterfaceState.xcuserstate diff --git a/DUREX tests/MenuTableViewController.h b/DUREX tests/MenuTableViewController.h index 050ea55..9143567 100644 --- a/DUREX tests/MenuTableViewController.h +++ b/DUREX tests/MenuTableViewController.h @@ -20,13 +20,21 @@ #define MAINTENANCE_CELLS_PER_SECTION num(23),num(3) #define MAINTENANCE_HEADERS NSLocalizedString(@"Sensors", nil),NSLocalizedString(@"Commands", nil) -#define CELL_IDENTIFIERS @"MenuCell",@"MaintenanceCell",@"ConfigCell",@"ReportCell" +#define SALES_ELEMENTS @"20€ Notes",@"10€ Notes",@"5€ Notes",@"2€ Coins",@"1€ Coins",@"50c Coins",@"Channel",@"Product Code",@"Nominal Price",@"Discounted Price",@"1€ Change",@"50c Change",@"20€ Notes",@"10€ Notes",@"5€ Notes",@"2€ Coins",@"1€ Coins",@"50c Coins",@"Channel",@"Product Code",@"Nominal Price",@"Discounted Price",@"1€ Change",@"50c Change",@"20€ Notes",@"10€ Notes",@"5€ Notes",@"2€ Coins",@"1€ Coins",@"50c Coins",@"Channel",@"Product Code",@"Nominal Price",@"Discounted Price",@"1€ Change",@"50c Change" +#define SALES_CELLS_PER_SECTION num(12),num(12),num(12) +#define SALES_HEADERS @"14/06/2014",@"25/06/2014",@"05/07/2014" -#define NUM_CHANNELS 8 +#define CONFIGURATION_ELEMENTS @"Update Date & Time",@"Update product price",@"Update product name" +#define CONFIGURATION_CELLS_PER_SECTION num(3) +#define CONFIGURATION_HEADERS nil + + +#define CELL_IDENTIFIERS @"MenuCell",@"MaintenanceCell",@"SalesCell",@"ConfigCell",@"ReportCell" enum { MENU = 0, MAINTENANCE, + SALES, BASIC_CONFIGURATION, REPORT, } navigationLevel; diff --git a/DUREX tests/MenuTableViewController.m b/DUREX tests/MenuTableViewController.m index a339fc1..7a75198 100644 --- a/DUREX tests/MenuTableViewController.m +++ b/DUREX tests/MenuTableViewController.m @@ -22,6 +22,14 @@ @property (nonatomic,strong) const NSArray *maintenanceStructure; @property (nonatomic,strong) const NSArray *maintenanceHeaders; +@property (nonatomic,strong) const NSArray *salesElements; +@property (nonatomic,strong) const NSArray *salesStructure; +@property (nonatomic,strong) const NSArray *salesHeaders; + +@property (nonatomic,strong) const NSArray *configElements; +@property (nonatomic,strong) const NSArray *configStructure; +@property (nonatomic,strong) const NSArray *configHeaders; + @property (nonatomic,strong) const NSArray *cellIdentifiers; @property (nonatomic,strong) CommunicationProtocol* protocol; @@ -68,6 +76,28 @@ { [self setMaintenanceHeaders:nil]; } + + [self setSalesElements:[[NSArray alloc] initWithObjects:SALES_ELEMENTS, nil]]; + [self setSalesStructure:[[NSArray alloc] initWithObjects:SALES_CELLS_PER_SECTION, nil]]; + if([[self salesStructure] count] > 1) + { + [self setSalesHeaders:[[NSArray alloc] initWithObjects:SALES_HEADERS, nil]]; + } + else + { + [self setSalesHeaders:nil]; + } + + [self setConfigElements:[[NSArray alloc] initWithObjects:CONFIGURATION_ELEMENTS, nil]]; + [self setConfigStructure:[[NSArray alloc] initWithObjects:CONFIGURATION_CELLS_PER_SECTION, nil]]; + if([[self configStructure] count] > 1) + { + [self setConfigHeaders:[[NSArray alloc] initWithObjects:CONFIGURATION_HEADERS, nil]]; + } + else + { + [self setConfigHeaders:nil]; + } [self setCellIdentifiers:[[NSArray alloc] initWithObjects:CELL_IDENTIFIERS, nil]]; } @@ -96,6 +126,20 @@ [self setCurrentHeaders:[self maintenanceHeaders]]; } + else if([self currentNavLevel] == SALES) + { + [[self navigationItem] setTitle:NSLocalizedString(@"Sales log", nil)]; + [self setCurrentElements:[self salesElements]]; + [self setCurrentStructure:[self salesStructure]]; + [self setCurrentHeaders:[self salesHeaders]]; + } + else if([self currentNavLevel] == BASIC_CONFIGURATION) + { + [[self navigationItem] setTitle:NSLocalizedString(@"Basic Configuration", nil)]; + [self setCurrentElements:[self configElements]]; + [self setCurrentStructure:[self configStructure]]; + [self setCurrentHeaders:[self configHeaders]]; + } //AND SO ON... [[self tableView] reloadData]; NSRange range = NSMakeRange(0, [self numberOfSectionsInTableView:[self tableView]]); @@ -207,13 +251,22 @@ NSLog(@"[MenuTableViewController.m]: Section: %d Row: %d",[indexPath section],[indexPath row]); [tableView deselectRowAtIndexPath:indexPath animated:YES]; NSString *cellName = [[[[self tableView] cellForRowAtIndexPath:indexPath]textLabel]text]; - if([cellName isEqualToString:NSLocalizedString(@"Maintenance", nil)]) + if([cellName isEqualToString:NSLocalizedString(@"Maintenance", nil)] && [self currentNavLevel] == MENU) { NSLog(@"[MenuTableViewController.m]: Changing to navLevel: MAINTENANCE"); [self changeNavLevel:MAINTENANCE:TRUE]; } + else if([cellName isEqualToString:NSLocalizedString(@"Sales log", nil)] && [self currentNavLevel] == MAINTENANCE) + { + NSLog(@"[MenuTableViewController.m]: Changing to navLevel: SALES"); + [self changeNavLevel:SALES:TRUE]; + } + else if([cellName isEqualToString:NSLocalizedString(@"Basic Configuration", nil)] && [self currentNavLevel] == MENU) + { + NSLog(@"[MenuTableViewController.m]: Changing to navLevel: BASIC_CONFIGURATION"); + [self changeNavLevel:BASIC_CONFIGURATION:TRUE]; + } - } #pragma mark - Table view data source @@ -273,6 +326,10 @@ } } + else if([self currentNavLevel] == SALES) + { + + } return cell; } diff --git a/DUREX tests/Stack.m b/DUREX tests/Stack.m index 9e4aa88..370f985 100644 --- a/DUREX tests/Stack.m +++ b/DUREX tests/Stack.m @@ -27,14 +27,17 @@ - (void) push: (id) element { [[self dataArray] addObject:element]; + [self setLastPosition: [self lastPosition] + 1]; } - (id) pop { id element; + [self setLastPosition: [self lastPosition] - 1]; element = [[self dataArray] objectAtIndex:[self lastPosition]]; [[self dataArray] removeLastObject]; return element; } + - (NSInteger) count { return [[self dataArray] count]; diff --git a/DUREX tests/en.lproj/Localizable.strings b/DUREX tests/en.lproj/Localizable.strings index 4c4f4cd..93dcb30 100644 --- a/DUREX tests/en.lproj/Localizable.strings +++ b/DUREX tests/en.lproj/Localizable.strings @@ -38,4 +38,19 @@ "50c Coin spin" = "50c Coin spin"; "Sales log" = "Sales log"; "Incident report" = "Incident report"; -"Send report" = "Send report"; \ No newline at end of file +"Send report" = "Send report"; +"20€ Notes" = "20€ Notes"; +"10€ Notes" = "10€ Notes"; +"5€ Notes" = "5€ Notes"; +"2€ Coins" = "2€ Coins"; +"1€ Coins" = "1€ Coins"; +"50c Coins" = "50c Coins"; +"Channel" = "Channel"; +"Product Code" = "Product Code"; +"Nominal Price" = "Nominal Price"; +"Discounted Price" = "Discounted Price"; +"1€ Change" = "1€ Change"; +"50c Change" = "50c Change"; +"Update Date & Time" = "Update Date & Time"; +"Update product price" = "Update product price"; +"Update product name" = "Update product name"; \ No newline at end of file diff --git a/DUREX tests/es.lproj/Localizable.strings b/DUREX tests/es.lproj/Localizable.strings index 7110525..546dd5b 100644 --- a/DUREX tests/es.lproj/Localizable.strings +++ b/DUREX tests/es.lproj/Localizable.strings @@ -39,3 +39,18 @@ "Sales log" = "Registro de ventas"; "Incident report" = "Registro de incidencias"; "Send report" = "Mandar informe"; +"20€ Notes" = "Billetes de 20€"; +"10€ Notes" = "Billetes de 10€"; +"5€ Notes" = "Billetes de 5€"; +"2€ Coins" = "Monedas de 2€"; +"1€ Coins" = "Monedas de 1€"; +"50c Coins" = "Monedas de 50c"; +"Channel" = "Canal"; +"Product Code" = "Código del producto"; +"Nominal Price" = "Precio Nominal"; +"Discounted Price" = "Precio con descuento"; +"1€ Change" = "Cambio de 1€"; +"50c Change" = "Cambio de 50c"; +"Update Date & Time" = "Actualizar fecha y hora"; +"Update product price" = "Actualizar precio del producto"; +"Update product name" = "Actualizar nombre del producto"; \ No newline at end of file diff --git a/TODO b/TODO index 0680de9..9abdceb 100644 --- a/TODO +++ b/TODO @@ -1,4 +1,9 @@ --Implement sensors options --Make changes to DUREX Vendor Control Project --Implement Navigation Controller --Implement table inside UITableViewCell +- Incident class +- Sale class +- Sale parser +- Incident parser +- Popup view +- A2 command +- A3 command +- Redefine A4 command +- A4 command