Renamed English to British and added American (MDY)

This commit is contained in:
phl0 2016-06-22 14:13:22 +02:00
parent 3f4f4d340d
commit 3b09e2cf2f
No known key found for this signature in database
GPG key ID: 48EA1E640798CA9A
4 changed files with 10 additions and 5 deletions

View file

@ -135,12 +135,12 @@ m_hd44780PWMBright(),
m_hd44780PWMDim(),
m_hd44780DisplayClock(false),
m_hd44780UTC(false),
m_hd44780DateFormat("English"),
m_hd44780DateFormat("British"),
m_nextionPort("/dev/ttyAMA0"),
m_nextionBrightness(50U),
m_nextionDisplayClock(false),
m_nextionUTC(false),
m_nextionDateFormat("English"),
m_nextionDateFormat("British"),
m_oledType(3),
m_oledBrightness(0),
m_oledInvert(0)

View file

@ -735,10 +735,12 @@ void CHD44780::clockInt(unsigned int ms)
if (m_cols != 16U && m_rows != 2U) {
::lcdPosition(m_fd, (m_cols - 8) / 2, m_rows == 2 ? 0 : 1);
if (strcmp(m_dateformat.c_str(), "English") == 0) {
if (strcmp(m_dateformat.c_str(), "British") == 0) {
::lcdPrintf(m_fd, "%02d/%02d/%2d", Day, Month, Year%100);
} else if (strcmp(m_dateformat.c_str(), "German") == 0) {
::lcdPrintf(m_fd, "%02d.%02d.%2d", Day, Month, Year%100);
} else if (strcmp(m_dateformat.c_str(), "American") == 0) {
::lcdPrintf(m_fd, "%02d/%02d/%2d", Month, Day, Year%100);
}
}
m_clockDisplayTimer.start();

View file

@ -118,13 +118,14 @@ PWMBright=100
PWMDim=16
DisplayClock=1
UTC=0
DateFormat=British
[Nextion]
Port=/dev/ttyAMA0
Brightness=50
DisplayClock=1
UTC=0
DateFormat=English
DateFormat=British
[OLED]
Type=3

View file

@ -242,10 +242,12 @@ void CNextion::clockInt(unsigned int ms)
int Sec = Time->tm_sec;
char text[50U];
if (strcmp(m_dateformat.c_str(), "English") == 0) {
if (strcmp(m_dateformat.c_str(), "British") == 0) {
::sprintf(text, "t2.txt=\"%02d:%02d:%02d %02d/%02d/%2d\"", Hour, Min, Sec, Day, Month, Year % 100);
} else if (strcmp(m_dateformat.c_str(), "German") == 0) {
::sprintf(text, "t2.txt=\"%02d:%02d:%02d %02d.%02d.%2d\"", Hour, Min, Sec, Day, Month, Year % 100);
} else if (strcmp(m_dateformat.c_str(), "American") == 0) {
::sprintf(text, "t2.txt=\"%02d:%02d:%02d %02d/%02d/%2d\"", Hour, Min, Sec, Month, Day, Year % 100);
}
sendCommand(text);