Release 1.01
Diff: DisplayCodesMenu.cpp
- Revision:
- 8:9d4e684d8eb8
- Parent:
- 6:af3769d17a35
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 {