LCDproc development and user support list

Text archives Help


[Lcdproc] BigClock update in chrono.c


Chronological Thread 
  • From: herdler AT gmx.de (Stefan Herdler)
  • Subject: [Lcdproc] BigClock update in chrono.c
  • Date: Thu Jun 22 08:57:01 2006

Oops, I forgot to attach the attachment.
--- ../cvs/lcdproc/clients/lcdproc/chrono.c 2006-05-07 19:32:35.000000000
+0200
+++ ./clients/lcdproc/chrono.c 2006-06-20 23:47:50.000000000 +0200
@@ -370,12 +370,13 @@ uptime_screen (int rep, int display, int
//////////////////////////////////////////////////////////////////////
// Big Clock Screen displays current time...
//
-// +--------------------+
-// | _ _ _ _ |
-// | ||_ . _||_|. _| ||
-// | ||_|. _| |.|_ ||
-// | |
-// +--------------------+
+// +--------------------+ +----------------+ +-------------+
+------------+
+// | _ _ _ _ | | _ _ 27| | _ _ | | _ _
|
+// | ||_ . _||_|. _| || | ||_ . _||_| | | ||_ . _||_|| | ||_
_||_||
+// | ||_|. _| |.|_ || | ||_|. _| | | | ||_|. _| || | ||_| _|
||
+// | | | | | | |
|
+// +--------------------+ +----------------+ +-------------+
+------------+
+// ?x20 ?x16 ?x13 ?x12
//
int
big_clock_screen (int rep, int display, int *flags_ptr)
@@ -386,7 +387,7 @@ big_clock_screen (int rep, int display,
char cmdbuf[64] ;
char fulltxt[16], old_fulltxt[16];
static int heartbeat = 0;
- int j = 0;
+ int j = 0, big_digits = 4;

// toggle colon display
heartbeat ^= 1;
@@ -400,26 +401,56 @@ big_clock_screen (int rep, int display,
sock_send_string (sock, "widget_add K d1 num\n");
sock_send_string (sock, "widget_add K d2 num\n");
sock_send_string (sock, "widget_add K d3 num\n");
- sock_send_string (sock, "widget_add K d4 num\n");
- sock_send_string (sock, "widget_add K d5 num\n");
- sock_send_string (sock, "widget_add K c0 num\n");
- sock_send_string (sock, "widget_add K c1 num\n");
-
- sock_send_string (sock, "widget_set K d0 1 0\n");
- sock_send_string (sock, "widget_set K d1 4 0\n");
- sock_send_string (sock, "widget_set K d2 8 0\n");
- sock_send_string (sock, "widget_set K d3 11 0\n");
- sock_send_string (sock, "widget_set K d4 15 0\n");
- sock_send_string (sock, "widget_set K d5 18 0\n");
-
+ if(lcd_wid >= 20) {
+ sock_send_string (sock, "widget_add K d4 num\n");
+ sock_send_string (sock, "widget_add K d5 num\n");
+ sock_send_string (sock, "widget_add K c0 num\n");
+ sock_send_string (sock, "widget_add K c1 num\n");
+ }
+ else if(lcd_wid >= 13) {
+ sock_send_string (sock, "widget_add K c0 num\n");
+ if(lcd_wid >= 16) {
+ sock_send_string (sock, "widget_add K d45
string\n");
+ }
+ }
strcpy(old_fulltxt, "000000");
}

time (&thetime);
rtime = localtime (&thetime);

+ if(lcd_wid >= 20) {
+ big_digits = 6;
+ if (heartbeat) { // 10 means: colon
+ sock_send_string (sock, "widget_set K c0 7 10\n");
+ sock_send_string (sock, "widget_set K c1 14 10\n");
+ }
+ else { // kludge: use illegal number to
clear colon display
+ sock_send_string (sock, "widget_set K c0 7 11\n");
+ sock_send_string (sock, "widget_set K c1 14 11\n");
+ }
+ }
+ else if(lcd_wid >= 16) { //small seconds on ?x16
displays
+ sprintf(cmdbuf, "widget_set K d45 15 1 %02d\n",
rtime->tm_sec);
+ sock_send_string (sock, cmdbuf);
+ if (heartbeat) // 10 means: colon
+ sock_send_string (sock, "widget_set K c0 7
10\n");
+ else // kludge: use illegal number
to clear colon display
+ sock_send_string (sock, "widget_set K c0 7
11\n");
+ }
+ else if(lcd_wid >= 13) {
+ if (heartbeat) // 10 means: colon
+ sock_send_string (sock, "widget_set K c0 7
10\n");
+ else // kludge: use illegal number
to clear colon display
+ sock_send_string (sock, "widget_set K c0 7
11\n");
+ }
+ else { // (lcd_wid <= 12)
+ pos[2] = 7;
+ pos[3] = 10;
+ }
+
sprintf (fulltxt, "%02d%02d%02d", rtime->tm_hour, rtime->tm_min,
rtime->tm_sec);
- for (j = 0; j < 6; j++) {
+ for (j = 0; j < big_digits; j++) {
if (fulltxt[j] != old_fulltxt[j]) {
sprintf (cmdbuf, "widget_set K d%d %d %c\n", j,
pos[j], fulltxt[j]);
sock_send_string (sock, cmdbuf);
@@ -427,15 +458,6 @@ big_clock_screen (int rep, int display,
}
}

- if (heartbeat) { // 10 means: colon
- sock_send_string (sock, "widget_set K c0 7 10\n");
- sock_send_string (sock, "widget_set K c1 14 10\n");
- }
- else { // kludge: use illegal number to clear colon
display
- sock_send_string (sock, "widget_set K c0 7 11\n");
- sock_send_string (sock, "widget_set K c1 14 11\n");
- }
-
return 0;
}
// End big_clock_screen()




Archive powered by MHonArc 2.6.18.

Top of page