From 49f0da06fa9f04498e428f06563ea44ef4268668 Mon Sep 17 00:00:00 2001 From: bsongis Date: Fri, 15 Mar 2013 18:02:53 +0000 Subject: [PATCH] [X9D] Grey bar rounded on main view [X9D] Column headers --- src/lcd.cpp | 12 +++++++++++- src/main_views.cpp | 2 +- src/menus.h | 4 ++++ src/model_menus.cpp | 27 +++++++++++++++++++++++++-- src/myeeprom.h | 5 ++--- src/x9d/board_x9d.h | 2 +- 6 files changed, 44 insertions(+), 8 deletions(-) diff --git a/src/lcd.cpp b/src/lcd.cpp index 02dfe437f..e526de977 100644 --- a/src/lcd.cpp +++ b/src/lcd.cpp @@ -646,10 +646,20 @@ void lcd_rect(xcoord_t x, uint8_t y, xcoord_t w, uint8_t h, uint8_t pat, LcdFlag void lcd_filled_rect(xcoord_t x, int8_t y, xcoord_t w, uint8_t h, uint8_t pat, LcdFlags att) { +#if defined(CPUM64) for (int8_t i=y; i=0 && i> 1) + ((pat & 1) << 7); } +#else + for (int8_t i=y; i> 1) + ((pat & 1) << 7); + } +#endif } void lcd_invert_line(int8_t y) diff --git a/src/main_views.cpp b/src/main_views.cpp index 89c04bf54..46e9ffa64 100644 --- a/src/main_views.cpp +++ b/src/main_views.cpp @@ -288,7 +288,7 @@ void displayTopBar() lcd_outdezNAtt(BAR_TIME_X+3*FWNUM-1, BAR_Y+1, t.tm_min, LEADING0, 2); /* The background */ - lcd_filled_rect(BAR_X, BAR_Y, BAR_W, BAR_H, SOLID, FILL_WHITE|GREY_DEFAULT); + lcd_filled_rect(BAR_X, BAR_Y, BAR_W, BAR_H, SOLID, FILL_WHITE|GREY_DEFAULT|ROUND); /* The inside of the Batt gauge */ uint8_t count = 10 * (g_vbat100mV - g_eeGeneral.vBatMin - 90) / (30 + g_eeGeneral.vBatMax - g_eeGeneral.vBatMin); diff --git a/src/menus.h b/src/menus.h index f811cbb77..b39bab645 100644 --- a/src/menus.h +++ b/src/menus.h @@ -51,6 +51,10 @@ typedef void (*MenuFuncP)(uint8_t event); void displayScreenIndex(uint8_t index, uint8_t count, uint8_t attr); +inline void displayColumnHeader(const char **headers, uint8_t index) +{ + lcd_putsAtt(17*FW, 0, headers[index], 0); +} #if LCD_W >= 212 #if defined(TRANSLATIONS_FR) diff --git a/src/model_menus.cpp b/src/model_menus.cpp index 7098ea6dc..18b20e7ff 100644 --- a/src/model_menus.cpp +++ b/src/model_menus.cpp @@ -58,6 +58,12 @@ enum EnumTabModel { IF_TEMPLATES(e_Templates) }; +#if LCD_W >= 212 +const char * STR_PHASES_HEADERS[] = { " Name ", " Switch ", " Trims ", " Fade In ", " Fade Out " }; +const char * STR_LIMITS_HEADERS[] = { " Name ", " Offset ", " Min ", " Max ", " Direction ", " PPM Center ", " Symetrical " }; +const char * STR_CSW_HEADERS[] = { " Function ", " V1 ", " V2 ", " AND Switch ", " Duration ", " Delay " }; +#endif + void menuModelSelect(uint8_t event); void menuModelSetup(uint8_t event); void menuModelHeli(uint8_t event); @@ -1287,6 +1293,13 @@ void menuModelPhasesAll(uint8_t event) int8_t sub = m_posVert - 1; + horzpos_t posHorz = m_posHorz; + if (sub==0 && posHorz > 0) { posHorz += 2; } + + if (sub=0) { + displayColumnHeader(STR_PHASES_HEADERS, posHorz); + } + for (uint8_t i=0; i 0) { posHorz += 2; } uint8_t attr = ((sub==k && posHorz==j) ? ((s_editMode>0) ? BLINK|INVERS : INVERS) : 0); uint8_t active = (attr && (s_editMode>0 || p1valdiff)) ; switch(j) @@ -2727,6 +2738,12 @@ void menuModelLimits(uint8_t event) MENU(STR_MENULIMITS, menuTabModel, e_Limits, 1+NUM_CHNOUT+1, {0, ITEM_LIMITS_MAXROW, ITEM_LIMITS_MAXROW, ITEM_LIMITS_MAXROW, ITEM_LIMITS_MAXROW, ITEM_LIMITS_MAXROW, ITEM_LIMITS_MAXROW, ITEM_LIMITS_MAXROW, ITEM_LIMITS_MAXROW, ITEM_LIMITS_MAXROW, ITEM_LIMITS_MAXROW, ITEM_LIMITS_MAXROW, ITEM_LIMITS_MAXROW, ITEM_LIMITS_MAXROW, ITEM_LIMITS_MAXROW, ITEM_LIMITS_MAXROW, ITEM_LIMITS_MAXROW, 0}); #endif +#if LCD_W >= 212 + if (sub=0) { + displayColumnHeader(STR_LIMITS_HEADERS, m_posHorz); + } +#endif + if (s_warning_result) { LimitData *ld = limitaddress(sub); ld->revert = !ld->revert; @@ -3202,6 +3219,12 @@ void menuModelCustomSwitches(uint8_t event) uint8_t k = 0; int8_t sub = m_posVert - 1; +#if LCD_W >= 212 + if (m_posHorz>=0) { + displayColumnHeader(STR_CSW_HEADERS, m_posHorz); + } +#endif + for (uint8_t i=0; i