From ce53e07dfebc9ff9f671603e9de2da678fb89c9a Mon Sep 17 00:00:00 2001 From: mmi Date: Fri, 15 Dec 2017 09:29:16 +0000 Subject: [PATCH] Fixed some message positions on display Added french translation for PCBA names git-svn-id: https://svn.vbchaos.nl/svn/hsb/trunk@369 05563f52-14a8-4384-a975-3d1654cca0fa --- .../0 - Code/Platform/Makefile | 2 +- .../0 - Code/Platform/src/PCBA.c | 15 +++++++++++ .../3 - Implementation/0 - Code/buglist.txt | 1 + .../0 - Code/hsb-mrts/src/repairMenu.c | 26 +++++++++---------- 4 files changed, 30 insertions(+), 14 deletions(-) diff --git a/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/Platform/Makefile b/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/Platform/Makefile index a81f050..0f6f477 100644 --- a/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/Platform/Makefile +++ b/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/Platform/Makefile @@ -13,7 +13,7 @@ ROOTDIR = ../ LIB_PREFIX = libPlatform LIBRARY_NAME = $(LIB_PREFIX)_$(BUILD)_$(LANG).a -CCFLAGS = -c -O2 -Wall -Werror -g -fno-common -mcpu=cortex-m3 -mthumb $(PLATFORM) $(RELEASE_DEFINES) \ +CCFLAGS = -c -O2 -Wall -Werror -g -fno-common -mcpu=cortex-m3 -mthumb $(LANGUAGE) $(PLATFORM) $(RELEASE_DEFINES) \ -Iinc \ -I$(ROOTDIR)/HAL/inc \ -I$(ROOTDIR)/hsb-mrts/inc \ diff --git a/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/Platform/src/PCBA.c b/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/Platform/src/PCBA.c index ae90ede..280ce7c 100644 --- a/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/Platform/src/PCBA.c +++ b/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/Platform/src/PCBA.c @@ -31,7 +31,12 @@ // Constant and macro definitions // ----------------------------------------------------------------------------- +#define ENGLISH (0) +#define FRENCH (1) +#ifndef LANGUAGE + #error "LANGUAGE INDEX OUT OF BOUNDS"; +#endif // ----------------------------------------------------------------------------- // Type definitions @@ -46,6 +51,7 @@ static struct Pcba* instance = NULL; static struct Pcba thisPCBA; +#if (LANGUAGE == 0) static const char nameArray[4][20] = { "Cathode/MCP repair", @@ -53,6 +59,15 @@ static const char nameArray[4][20] = "Anode repair", "UNDEFINED PCBA", }; +#elif (LANGUAGE == 1) +static const char nameArray[4][20] = +{ + "Traitement Pk/GMC", + "Traitement Tesla" , + "Traitement ecran", + "PCBA non défini", +}; +#endif // ----------------------------------------------------------------------------- // Function declarations diff --git a/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/buglist.txt b/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/buglist.txt index ff7c95c..d444ece 100644 --- a/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/buglist.txt +++ b/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/buglist.txt @@ -9,6 +9,7 @@ FIXED 0.9.0.5 - Display misses first character (row1/column1) when starting. Should be a delay problem in creating the start screen. (between putting cursor home and write action) - Makefile extention to have output file name corresponding to langugage and build targets +- Fixed some message positions for multilanguage support 0.9.0.4 - PIN change verification not functional diff --git a/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/hsb-mrts/src/repairMenu.c b/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/hsb-mrts/src/repairMenu.c index 914e777..9e3ce1b 100644 --- a/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/hsb-mrts/src/repairMenu.c +++ b/S - Software/0 - HSB MRTS Kathode-MCP/3 - Implementation/0 - Code/hsb-mrts/src/repairMenu.c @@ -814,12 +814,12 @@ static void repairMenu_printAdminVoltageInput(struct MenuCore* self) if (PCBA_getInstance()->pcba != PCBA_Tesla) { - snprintf(buffer, sizeof(buffer) / sizeof(buffer[0]), "%s1: %5dV|%4Xx", MenuText_VOLTAGE_ROW[languageIndex], ADConverter_getInputVoltage(adcRow1), ADConverter_getInputConverterValue(adcRow1)); + snprintf(buffer, sizeof(buffer) / sizeof(buffer[0]), "%*.*s1: %5dV|%4Xx", sizeof(MenuText_VOLTAGE_ROW[languageIndex]), sizeof(MenuText_VOLTAGE_ROW[languageIndex]), MenuText_VOLTAGE_ROW[languageIndex], ADConverter_getInputVoltage(adcRow1), ADConverter_getInputConverterValue(adcRow1)); Display_write(self->display, buffer, 2, 1); - snprintf(buffer, sizeof(buffer) / sizeof(buffer[0]), "%s3: %5dV|%4Xx", MenuText_VOLTAGE_ROW[languageIndex], ADConverter_getInputVoltage(adcRow3), ADConverter_getInputConverterValue(adcRow3)); + snprintf(buffer, sizeof(buffer) / sizeof(buffer[0]), "%*.*s3: %5dV|%4Xx", sizeof(MenuText_VOLTAGE_ROW[languageIndex]), sizeof(MenuText_VOLTAGE_ROW[languageIndex]), MenuText_VOLTAGE_ROW[languageIndex], ADConverter_getInputVoltage(adcRow3), ADConverter_getInputConverterValue(adcRow3)); Display_write(self->display, buffer, 4, 1); } - snprintf(buffer, sizeof(buffer) / sizeof(buffer[0]), "%s2: %5dV|%4Xx", MenuText_VOLTAGE_ROW[languageIndex], ADConverter_getInputVoltage(adcRow2), ADConverter_getInputConverterValue(adcRow2)); + snprintf(buffer, sizeof(buffer) / sizeof(buffer[0]), "%*.*s2: %5dV|%4Xx", sizeof(MenuText_VOLTAGE_ROW[languageIndex]), sizeof(MenuText_VOLTAGE_ROW[languageIndex]), MenuText_VOLTAGE_ROW[languageIndex], ADConverter_getInputVoltage(adcRow2), ADConverter_getInputConverterValue(adcRow2)); Display_write(self->display, buffer, 3, 1); } @@ -851,18 +851,18 @@ static void repairMenu_printPINVerification(struct MenuCore* self) static void repairMenu_printVoltageOutput(struct MenuCore* self) { - char buffer[self->display->displayDevice->parameters.numberOfColumns]; + char buffer[self->display->displayDevice->parameters.numberOfColumns + 1]; Display_write(self->display, MenuText_VOLTAGE_OUT_HEADER[languageIndex], 1, 1); if (PCBA_getInstance()->pcba != PCBA_Tesla) { - snprintf(buffer, sizeof(buffer) / sizeof(buffer[0]), "%s1: %5dV|%5dV", MenuText_VOLTAGE_ROW[languageIndex], (unsigned int)DAConverter_getCurrentValue(dacRow1), ADConverter_getInputVoltage(adcRow1)); + snprintf(buffer, sizeof(buffer) / sizeof(buffer[0]), "%*.*s1:%5dV|%5dV", sizeof(MenuText_VOLTAGE_ROW[languageIndex]), sizeof(MenuText_VOLTAGE_ROW[languageIndex]), MenuText_VOLTAGE_ROW[languageIndex], (unsigned int)DAConverter_getCurrentValue(dacRow1), ADConverter_getInputVoltage(adcRow1)); Display_write(self->display, buffer, 2, 1); - snprintf(buffer, sizeof(buffer) / sizeof(buffer[0]), "%s3: %5dV|%5dV", MenuText_VOLTAGE_ROW[languageIndex], (unsigned int)DAConverter_getCurrentValue(dacRow3), ADConverter_getInputVoltage(adcRow3)); + snprintf(buffer, sizeof(buffer) / sizeof(buffer[0]), "%*.*s3:%5dV|%5dV", sizeof(MenuText_VOLTAGE_ROW[languageIndex]), sizeof(MenuText_VOLTAGE_ROW[languageIndex]), MenuText_VOLTAGE_ROW[languageIndex], (unsigned int)DAConverter_getCurrentValue(dacRow3), ADConverter_getInputVoltage(adcRow3)); Display_write(self->display, buffer, 4, 1); } - snprintf(buffer, sizeof(buffer) / sizeof(buffer[0]), "%s2: %5dV|%5dV", MenuText_VOLTAGE_ROW[languageIndex], (unsigned int)DAConverter_getCurrentValue(dacRow2), ADConverter_getInputVoltage(adcRow2)); + snprintf(buffer, sizeof(buffer) / sizeof(buffer[0]), "%*.*s2:%5dV|%5dV", sizeof(MenuText_VOLTAGE_ROW[languageIndex]), sizeof(MenuText_VOLTAGE_ROW[languageIndex]), MenuText_VOLTAGE_ROW[languageIndex], (unsigned int)DAConverter_getCurrentValue(dacRow2), ADConverter_getInputVoltage(adcRow2)); Display_write(self->display, buffer, 3, 1); } @@ -1475,9 +1475,9 @@ void repairMenu_menuStateHandle(struct MenuCore* self) } snprintf(buffer, sizeof(buffer) / sizeof(buffer[0]), "%5sV", self->insertString); - Display_write(self->display, buffer, 2, 7); + Display_write(self->display, buffer, 2, sizeof(MenuText_VOLTAGE_ROW[languageIndex]) + 3); vTaskDelay(2); - Display_setCursorToPosition(self->display, 2, 11); + Display_setCursorToPosition(self->display, 2, 12); vTaskDelay(2); Display_setBlinkingCursorState(self->display, ON); } @@ -1511,9 +1511,9 @@ void repairMenu_menuStateHandle(struct MenuCore* self) } snprintf(buffer, sizeof(buffer) / sizeof(buffer[0]), "%5sV", self->insertString); - Display_write(self->display, buffer, 3, 7); + Display_write(self->display, buffer, 3, sizeof(MenuText_VOLTAGE_ROW[languageIndex]) + 3); vTaskDelay(2); - Display_setCursorToPosition(self->display, 3, 11); + Display_setCursorToPosition(self->display, 3, 12); vTaskDelay(2); Display_setBlinkingCursorState(self->display, ON); } @@ -1547,9 +1547,9 @@ void repairMenu_menuStateHandle(struct MenuCore* self) } snprintf(buffer, sizeof(buffer) / sizeof(buffer[0]), "%5sV", self->insertString); - Display_write(self->display, buffer, 4, 7); + Display_write(self->display, buffer, 4, sizeof(MenuText_VOLTAGE_ROW[languageIndex]) + 3); vTaskDelay(2); - Display_setCursorToPosition(self->display, 4, 11); + Display_setCursorToPosition(self->display, 4, 12); vTaskDelay(2); Display_setBlinkingCursorState(self->display, ON); }