Dual CANbus monitor and instrumentation cluster

Dependencies:   SPI_TFTx2 TFT_fonts TOUCH_TFTx2 beep mbed

Fork of CANary by Tick Tock

Revision:
55:591406a71fa8
Parent:
54:6ce808d0995e
Parent:
52:d5385fbf4ea1
Child:
58:4d06288d75a2
--- a/displayModes.cpp	Tue Apr 09 06:16:26 2013 +0000
+++ b/displayModes.cpp	Tue Apr 09 06:45:46 2013 +0000
@@ -721,8 +721,10 @@
 
     tt.background(Navy);
     tt.foreground(Yellow);
+    if(force){
+        tt.cls();
+    }
     if(force||lgids!=gids){
-        tt.cls();
         tt.set_font((unsigned char*) Arial12x12);
         for(i=0;i<10;i++){
             y=200-i*20;
@@ -736,27 +738,27 @@
         }
 
         x=50+0*6;
-        tt.locate(x-6,226);
+        tt.locate(x-10,226);
         printf("sec\n");  
         tt.line(x,10,x,220,DarkGrey);     
         x=50+9*6;
-        tt.locate(x-6,226);
+        tt.locate(x-10,226);
         printf("min\n");  
         tt.line(x,10,x,220,DarkGrey);     
         x=50+18*6;
-        tt.locate(x-6,226);
+        tt.locate(x-10,226);
         printf("hour\n");  
         tt.line(x,10,x,220,DarkGrey);     
         x=50+25*6;
-        tt.locate(x-6,226);
+        tt.locate(x-10,226);
         printf("day\n");  
         tt.line(x,10,x,220,DarkGrey);     
         x=50+32*6;
-        tt.locate(x-6,226);
+        tt.locate(x-10,226);
         printf("mon\n");  
         tt.line(x,10,x,220,DarkGrey);     
         x=50+38*6;
-        tt.locate(x-6,226);
+        tt.locate(x-10,226);
         printf("year\n");  
         tt.line(x,10,x,220,DarkGrey);
         lgids=gids;    
@@ -785,10 +787,11 @@
         tt.line(x,180,x,220,DarkGrey);     
         tt.set_font((unsigned char*) SCProSB31x55);
         tt.foreground(Green);
-        tt.locate(180,10);
         if (showMiles){
-            printf("%4.1f\n",mpkWh[dtePeriod]*((float)(gids-5)*.075));
+            tt.locate(160,10);
+            printf("%4.1f \n",mpkWh[dtePeriod]*((float)(gids-5)*.075));
         } else {
+            tt.locate(180,10);
             printf("%3.1f\n",mpkWh[dtePeriod]);
         }
         lx=50;
@@ -799,7 +802,7 @@
             ly=0;
         }
         if(dtePeriod==0){
-            radius=4;
+            radius=6;
             color=Magenta;
         }else{
             radius=2;
@@ -826,7 +829,9 @@
             tt.fillcircle(x,leff[i],radius,Navy);
             tt.line(x-6,leff[i-1],x,leff[i],Navy);
             leff[i-1]=ly;
-            tt.fillcircle(x,y,radius,color);
+            if(y>0){
+                tt.fillcircle(x,y,radius,color);
+            }
             tt.line(lx,ly,x,y,White);
             lx=x;
             ly=y;