Release 1.01
Revision 8:9d4e684d8eb8, committed 2020-03-17
- Comitter:
- foxbrianr
- Date:
- Tue Mar 17 17:23:15 2020 +0000
- Parent:
- 7:d8673bb9fb6f
- Commit message:
- fix up code for barry
Changed in this revision
diff -r d8673bb9fb6f -r 9d4e684d8eb8 DisplayCodesMenu.cpp --- a/DisplayCodesMenu.cpp Fri Sep 27 13:20:32 2019 +0000 +++ b/DisplayCodesMenu.cpp Tue Mar 17 17:23:15 2020 +0000 @@ -61,6 +61,7 @@ static int lastPos = 0; static int lastSize = 0; + int hr = 0; int update_page = 0; char buf[40]; @@ -140,26 +141,47 @@ int selected = current_index == index; - ESCM_Event *event = escmEventLog.index (index) ; if (event != NULL && index < escmEventLog.size() ) { - sprintf(buf,"%02d | %02d | %02d | %02d:%02d:%02d %02d/%02d/%04d", + if ( event->hours < 12 ) { + + hr = event[i].hours; + hr = (hr == 0) ? 12 : hr; + sprintf(buf,"%02d | %02d | %02d | %02d:%02d:%02dam %02d/%02d/%04d", index + 1, event->port, event->address, - event->hours, + hr, event->mins, event->secs, event->month, event->day, event->year ); - - + + } + else { + hr = (event->hours - 12); + hr = (hr == 0) ? 12 : hr; + ; + sprintf(buf,"%02d | %02d | %02d | %02d:%02d:%02dpm %02d/%02d/%04d", + index + 1, + event->port, + event->address, + hr, + event->mins, + event->secs, + event->month, + event->day, + event->year + ); + + } + } else { - sprintf(buf,"%-s | %-s | %-s | %-s", + sprintf(buf,"%-s | %-s | %-s | %-s", "--", "--", "--", @@ -220,18 +242,40 @@ event->year ); #else - char * ev_desc = addressMap.getDescription(event->address); - sprintf(buf,"%02d | %-12s | %02d:%02d:%02d %02d/%02d/%04d", + char * ev_desc = addressMap.getDescription(event->address); + + if ( event->hours < 12 ) { + hr = (event[i].hours == 0) ? 12 : event[i].hours; + hr = (hr == 0) ? 12 : hr; + sprintf(buf,"%02d | %-12s | %02d:%02d:%02dam %02d/%02d/%02d", event->address, ev_desc, - event->hours, + hr, event->mins, event->secs, event->month, event->day, - event->year + (event->year % 100) ); + } else { + + hr = (event->hours - 12); + hr = (hr == 0) ? 12 : hr; + + sprintf(buf,"%02d | %-12s | %02d:%02d:%02dpm %02d/%02d/%02d", + + event->address, + ev_desc, + hr, + event->mins, + event->secs, + event->month, + event->day, + (event->year % 100) + ); + } + #endif } else {
diff -r d8673bb9fb6f -r 9d4e684d8eb8 EditTimeMenu.cpp --- a/EditTimeMenu.cpp Fri Sep 27 13:20:32 2019 +0000 +++ b/EditTimeMenu.cpp Tue Mar 17 17:23:15 2020 +0000 @@ -1,3 +1,4 @@ + /************************************************************************** * @file EditTimeMenu.cpp * @brief Base class for implementing the Edit Time Menu display @@ -107,14 +108,36 @@ } else { + // edit mode secs = timeinfo->tm_sec; + + if ( hours < 12 ) { + cur_hours = (hours == 0) ? 12 : hours; + + } else { + cur_hours = (hours - 12); + } lcd->locate(2,0); switch(active_selection) { case 1: - lcd->printf("Set Time (hours) : %02d", hours); + +#if 1 + if ( hours < 12 ) { + cur_hours = (hours == 0) ? 12 : hours; + lcd->printf("Set Time (hours) : %02dam", cur_hours); + + } else { + cur_hours = (hours - 12); + cur_hours = (cur_hours == 0) ? 12 : cur_hours; + + lcd->printf("Set Time (hours) : %02dpm", cur_hours); + } +#else + lcd->printf("Set Time (hours) : %02d", hours); +#endif break; case 2: lcd->printf("Set Time (min) : %02d", mins); @@ -137,9 +160,32 @@ lcd->locate(3,0); lcd->printf("Updated Time :"); - +#if 1 + + if ( hours < 12 ) { + + cur_hours = (hours == 0) ? 12 : hours; + cur_hours = (cur_hours == 0) ? 12 : cur_hours; + lcd->locate(3,20); + lcd->printf(" %02d:%02d:%02dam %02d/%02d/%02d", + cur_hours, mins, secs, months, days, (years%100)); + + } else { + + cur_hours = (hours - 12); + cur_hours = (cur_hours == 0) ? 12 : cur_hours; + lcd->locate(3,20); + lcd->printf(" %02d:%02d:%02dpm %02d/%02d/%02d", + cur_hours, mins, secs, months, days, (years%100)); + + + } +#else lcd->locate(3,20); lcd->printf(" %02d:%02d %02d/%02d/%04d", hours, mins, months, days, years); + +#endif + }
diff -r d8673bb9fb6f -r 9d4e684d8eb8 Menu.cpp --- a/Menu.cpp Fri Sep 27 13:20:32 2019 +0000 +++ b/Menu.cpp Tue Mar 17 17:23:15 2020 +0000 @@ -243,10 +243,8 @@ /******************************************************************************/ void Menu::displayVersion (LCD * lcd) { - - lcd->locate(3,35); - lcd->printf("v1.01"); + lcd->printf("v1.02"); } /******************************************************************************/ void Menu::displayCurrentTime (LCD * lcd) @@ -267,8 +265,33 @@ cur_month = timeinfo->tm_mon + 1; cur_day = timeinfo->tm_mday; +#if 1 + + if ( cur_hours < 12 ) { + + cur_hours = (cur_hours == 0) ? 12 : cur_hours; + lcd->locate(0,20); + lcd->printf(" %02d:%02d:%02dam %02d/%02d/%02d", + cur_hours, cur_mins, cur_secs, cur_month, cur_day, (cur_year%100)); + + } else { + + cur_hours = (cur_hours - 12); + cur_hours = (cur_hours == 0) ? 12 : cur_hours; + lcd->locate(0,20); + lcd->printf(" %02d:%02d:%02dpm %02d/%02d/%02d", + cur_hours, cur_mins, cur_secs, cur_month, cur_day, (cur_year%100)); + + + } + +#else + lcd->locate(0,20); - lcd->printf(" %02d:%02d:%02d %02d/%02d/%04d", cur_hours, cur_mins, cur_secs, cur_month, cur_day, cur_year); + lcd->printf(" %02d:%02d:%02d %02d/%02d/%04d", + cur_hours, cur_mins, cur_secs, cur_month, cur_day, cur_year); + +#endif lcd->locate(1,33); lcd->printf("Addr=%02d",escmController.cur_address);