Modification into 17th July New display demo code

Dependencies:   SDFileSystem ds3231 eeprom_Nikita mbed testUniGraphic_150217

Fork of Ext_Demo_17July2017_newdis by SenseSemi

Revision:
1:8316c23ec6b9
Parent:
0:c47fb0c1bbf6
Child:
2:3b7b71bfc941
--- a/display_modules.cpp	Tue Dec 27 10:30:48 2016 +0000
+++ b/display_modules.cpp	Mon Jan 30 07:45:41 2017 +0000
@@ -3,20 +3,54 @@
 #include "lcd_base.h"
 #include "display_modules.h"
 #include "touch_modules.h"
+#include "rtc.h"
+#include "main.h"
 
 
 BusOut dataBus( PTC12, PTC13, PTB10, PTC9, PTD4, PTD5, PTD6, PTD7 ); // 16 pins//POC
 ILI9325_LCD lcd( PTC5, PTB9, PTC0, PTB0, &dataBus, NC, PTE31);
 
 
-void init_screen()     // initializing the screen
-{ lcd.Initialize(PORTRAIT);
-}
+ void init_screen()     // initializing the screen
+  {    
+    lcd.Initialize(PORTRAIT);
+  }
 
  void screen_main()//main screen
  {
-     lcd.SetFont(&TerminusBigFont);
-                lcd.FillRect(5,127,230,320,COLOR_BLACK); 
+       char buff1[32];
+        time_t epoch_time;
+         DisableTouch();
+         lcd.ClearScreen();
+         lcd.SetFont(&TerminusFont);
+         epoch_time=rtc_read();
+         sprintf(buff1 ,"%s", ctime(&epoch_time));
+         lcd.Print( buff1,20,100,COLOR_YELLOW,COLOR_BLACK, 0);
+            lcd.SetFont(&TerminusBigFont);
+            lcd.Print( "SENSESEMI",50,20,COLOR_WHITE,COLOR_BLACK, 0);
+            lcd.Print( "SenseSmart",45,60,COLOR_WHITE,COLOR_BLACK, 0);// align text to center horizontally and use starndard colors
+            lcd.FillRoundRect(60,130,180,200,COLOR_YELLOW);
+            lcd.Print( "SYS",100,140,COLOR_BLACK,COLOR_YELLOW,0);
+            lcd.Print( "CONFIG",70,170,COLOR_BLACK,COLOR_YELLOW,0);
+            lcd.FillRoundRect(60,230,180,300,COLOR_GREEN);
+            lcd.Print( "TEST",90,250,COLOR_BLACK,COLOR_GREEN,0);
+      EnableTouch();
+              
+                }
+     
+    void screen_main_2(int pid)//main screen
+ {
+     
+     char buff2[10];
+        DisableTouch();
+                lcd.FillRect(5,10,250,120,COLOR_BLACK); 
+               //lcd.Print( "SenseSmart", CENTER, 95);
+             sprintf(buff2 ,"%d", pid);
+                  lcd.Print( "PATIENT ID",20,50,COLOR_YELLOW,COLOR_BLACK, 0);
+              lcd.Print(buff2,200,50,COLOR_YELLOW,COLOR_BLACK, 0);
+                
+                lcd.SetFont(&TerminusBigFont);
+                lcd.FillRect(5,120,230,320,COLOR_BLACK); 
                 lcd.FillRoundRect(10,130,100,200,COLOR_CYAN);
                 lcd.Print( "BG",40,160,COLOR_BLACK,COLOR_CYAN,0);
                 lcd.FillRoundRect(130,130,220,200,COLOR_YELLOW);
@@ -24,98 +58,157 @@
                 lcd.FillRoundRect(10,215,100,285,COLOR_MAGENTA);
                 lcd.Print( "BP",40,245,COLOR_BLACK,COLOR_MAGENTA,0);
                 lcd.FillRoundRect(130,215,220,285,COLOR_GREEN);
-                lcd.Print( "SET",160,245,COLOR_BLACK,COLOR_GREEN,0);
-                }
+                lcd.Print( "HOME",150,245,COLOR_BLACK,COLOR_GREEN,0);
+        EnableTouch();
+                }         
+                
+                
                 
+    void screen_main_1()//main screen
+ {
+        DisableTouch();
+                lcd.SetFont(&TerminusBigFont);
+                lcd.FillRect(5,127,230,320,COLOR_BLACK); 
+                lcd.FillRoundRect(10,130,100,200,COLOR_CYAN);
+                lcd.Print( "BLE",30,160,COLOR_BLACK,COLOR_CYAN,0);
+                lcd.FillRoundRect(130,130,220,200,COLOR_YELLOW);
+                lcd.Print( "ERASE",140,160,COLOR_BLACK,COLOR_YELLOW,0);
+                lcd.FillRoundRect(10,215,100,285,COLOR_MAGENTA);
+                lcd.Print( "FILE",20,245,COLOR_BLACK,COLOR_MAGENTA,0);
+                lcd.FillRoundRect(130,215,220,285,COLOR_GREEN);
+                lcd.Print( "HOME",145,245,COLOR_BLACK,COLOR_GREEN,0);
+        EnableTouch();
+                }                  
        
                 
 void screen_ecg()
    {
-   DisableTouch();
-               
-                lcd.ClearScreen();
-    //lcd.FillScreen(COLOR_BLACK);
-   
-   
-                lcd.FillRect(5,127,230,320,COLOR_BLACK); 
-                lcd.FillRect(10,30,100,90,COLOR_GREEN);
-                lcd.FillTriangle(10,30,60,10,100,30,COLOR_YELLOW);
-                lcd.DrawRect(20,90,90,40,COLOR_BLACK);
-                 //lcd.Print( "HOME",80,60,COLOR_BLACK,COLOR_GREEN,0);
-                lcd.FillRoundRect(10,130,100,200,COLOR_CYAN);
-                lcd.Print( "SET",30,160,COLOR_BLACK,COLOR_CYAN,0);
-                lcd.FillRoundRect(130,130,220,285,COLOR_YELLOW);
-                lcd.Print( "start",140,200,COLOR_BLACK,COLOR_YELLOW,0);
-                lcd.FillRoundRect(10,215,100,285,COLOR_MAGENTA);
-                lcd.Print( "HIS",40,245,COLOR_BLACK,COLOR_MAGENTA,0);
-              EnableTouch();
-                } 
+      DisableTouch();  
+               lcd.FillRect(5,127,230,320,COLOR_BLACK); 
+               lcd.FillRoundRect(60,130,180,200,COLOR_YELLOW);
+               lcd.Print( "START",80,150,COLOR_BLACK,COLOR_YELLOW,0);
+       // lcd.Print( "CONFIG",70,170,COLOR_BLACK,COLOR_YELLOW,0);
+              lcd.FillRoundRect(60,230,180,300,COLOR_GREEN);
+              lcd.Print( "RET",100,250,COLOR_BLACK,COLOR_GREEN,0);
+      EnableTouch();
+     } 
+      
+      
                 
+ void screen_ecg_2()
+   {
+        DisableTouch();  
+            // lcd.FillRect(5,90,230,320,COLOR_BLACK); 
+            // lcd.Print( "DONE", CENTER, 95);
+             lcd.FillRoundRect(60,230,180,300,COLOR_GREEN);
+             lcd.Print( "RET",100,250,COLOR_BLACK,COLOR_GREEN,0);
+        EnableTouch();
+    }                
+       
+       
                 
  void screen_bp()          // bp main screen
  {
-                 DisableTouch();
-                 lcd.ClearScreen();
-  //  lcd.FillScreen(COLOR_BLACK);
-                lcd.FillRect(5,127,230,320,COLOR_BLACK); 
-                lcd.FillRoundRect(10,130,100,200,COLOR_CYAN);
-                lcd.Print( "meas",30,160,COLOR_BLACK,COLOR_CYAN,0);
-                lcd.FillRoundRect(130,130,220,200,COLOR_YELLOW);
-                lcd.Print( "start",140,160,COLOR_BLACK,COLOR_YELLOW,0);
-                lcd.FillRoundRect(10,215,100,285,COLOR_MAGENTA);
-                lcd.Print( "his",40,245,COLOR_BLACK,COLOR_MAGENTA,0);
-                lcd.FillRoundRect(130,215,220,285,COLOR_GREEN);
-                lcd.Print( "SET",160,245,COLOR_BLACK,COLOR_GREEN,0);
-     
-            EnableTouch();
+        DisableTouch();  
+               lcd.FillRect(5,127,230,320,COLOR_BLACK); 
+               lcd.FillRoundRect(60,130,180,200,COLOR_YELLOW);
+               lcd.Print( "START",80,150,COLOR_BLACK,COLOR_YELLOW,0);
+       // lcd.Print( "CONFIG",70,170,COLOR_BLACK,COLOR_YELLOW,0);
+              lcd.FillRoundRect(60,230,180,300,COLOR_GREEN);
+              lcd.Print( "RET",100,250,COLOR_BLACK,COLOR_GREEN,0);
+      EnableTouch();
     }               
                 
   
-   void screen_glc()     // glc main screen
+ void screen_glc()     // glc main screen
  {
-                 DisableTouch();
-                 lcd.ClearScreen();
-   // lcd.FillScreen(COLOR_BLACK);
-                lcd.FillRect(5,127,230,320,COLOR_BLACK); 
-                lcd.FillRoundRect(10,130,100,200,COLOR_CYAN);
-                lcd.Print( "meas",30,160,COLOR_BLACK,COLOR_CYAN,0);
-                lcd.FillRoundRect(130,130,220,200,COLOR_YELLOW);
-                lcd.Print( "start",140,160,COLOR_BLACK,COLOR_YELLOW,0);
-                lcd.FillRoundRect(10,215,100,285,COLOR_MAGENTA);
-                lcd.Print( "his",40,245,COLOR_BLACK,COLOR_MAGENTA,0);
-                lcd.FillRoundRect(130,215,220,285,COLOR_GREEN);
-                lcd.Print( "SET",160,245,COLOR_BLACK,COLOR_GREEN,0);
-     
-            EnableTouch();
+        DisableTouch();
+                 //lcd.FillRect(5,127,230,320,COLOR_BLACK); 
+                 lcd.FillRect(5,127,230,320,COLOR_BLACK); 
+                 lcd.FillRoundRect(60,130,180,200,COLOR_YELLOW);
+                 lcd.Print( "START",80,150,COLOR_BLACK,COLOR_YELLOW,0);
+                 lcd.FillRoundRect(60,230,180,300,COLOR_GREEN);
+                 lcd.Print( "RET",100,250,COLOR_BLACK,COLOR_GREEN,0);
+        EnableTouch();
     }               
 
 
-void screen_ecg_2()     // ecg second screen 
-{
+
+            
+     
+ void ecg_countdown()
+ {    
+     char tim1[5];
       DisableTouch();
+          lcd.DrawRect(20,90,90,40,COLOR_BLACK);
+          lcd.FillRect(5,127,230,320,COLOR_BLACK); 
+          lcd.Print( "ECG starts in", CENTER, 95);
+        for(int i=5;i>=0;i--)
+            {
+                wait(1);
+                sprintf (tim1, "%d",i);
+                lcd.Print( tim1,120,120,COLOR_YELLOW,COLOR_BLACK, 0);
+                        
+            }
+        EnableTouch();
+  }                
+  
+  
+  
+ void screen_again()
+ {
+   DisableTouch();
+          //lcd.DrawRect(20,90,90,40,COLOR_BLACK);
+          lcd.FillRect(5,127,230,200,COLOR_BLACK); 
+           lcd.Print( "Take test",50,130 ,COLOR_CYAN,COLOR_BLACK, 0);
+            lcd.Print( "again?",75,160 ,COLOR_CYAN,COLOR_BLACK, 0);
+  lcd.Print( "YES",30,245,COLOR_BLACK,COLOR_MAGENTA,0);
+
+  lcd.Print( " NO ",150,245,COLOR_BLACK,COLOR_GREEN,0);
+   //lcd.FillRect(5 ,127,230,200,COLOR_BLACK); 
+  }
+  
+  
+  void screen_glc_2()
+   {
+        DisableTouch();  
+          lcd.FillRect(5,127,230,320,COLOR_BLACK); 
+          
            
-                lcd.ClearScreen();
-   // lcd.FillScreen(COLOR_BLACK);
+             lcd.FillRoundRect(60,230,180,300,COLOR_GREEN);
+             lcd.Print( "RET",100,250,COLOR_BLACK,COLOR_GREEN,0);
+        EnableTouch();
+    }  
+  
+  void glc_1()
+  {
+        DisableTouch();
+     //lcd.ClearScreen();
+     lcd.DrawRect(20,90,90,40,COLOR_BLACK);
+            lcd.FillRect(5,127,230,320,COLOR_BLACK); 
+     lcd.Print( "BLOOD GLUCOSE",20,130 ,COLOR_CYAN,COLOR_BLACK, 0); // align text to center horizontally and use starndard colors
+     lcd.Print( "Insert strip",5,160,COLOR_MAGENTA,COLOR_BLACK, 0); // align text to center horizontally and use starndard colors
+  }
+  
+   void glc_2()
+  {
+        DisableTouch();
+     lcd.Print( "Strip Detected",5,160, COLOR_GREEN,COLOR_BLACK, 0);
+     lcd.Print( "Insert Blood",5,190,COLOR_RED,COLOR_BLACK, 0);
+   }
    
-                lcd.FillRect(10,30,100,90,COLOR_GREEN);
-                lcd.FillTriangle(10,30,60,10,100,30,COLOR_YELLOW);
-                lcd.DrawRect(20,90,90,40,COLOR_BLACK);
-                //lcd.FillRect(5,127,230,320,COLOR_BLACK); 
-                //lcd.FillRect(60,30,170,90,COLOR_GREEN);
-                //lcd.FillTriangle(60,30,115,10,170,30,COLOR_YELLOW);
-                //lcd.DrawRect(90,90,140,40,COLOR_BLACK);
-                 //lcd.Print( "HOME",80,60,COLOR_BLACK,COLOR_GREEN,0);
-                lcd.FillRoundRect(10,130,100,200,COLOR_CYAN);
-                lcd.Print( "2 s",30,160,COLOR_BLACK,COLOR_CYAN,0);
-                lcd.FillRoundRect(130,130,220,200,COLOR_YELLOW);
-                lcd.Print( "5 s",140,160,COLOR_BLACK,COLOR_YELLOW,0);
-                lcd.FillRoundRect(10,215,100,285,COLOR_MAGENTA);
-                lcd.Print( "10 s",40,245,COLOR_BLACK,COLOR_MAGENTA,0);
-                lcd.FillRoundRect(130,215,220,285,COLOR_GREEN);
-                lcd.Print( "1 m",160,245,COLOR_BLACK,COLOR_GREEN,0);
-     
-            EnableTouch();
-             }
-     
-     
-                    
\ No newline at end of file
+  void glc_3()
+  {
+        DisableTouch();
+     lcd.Print( "Blood Detected",5,190,COLOR_GREEN,COLOR_BLACK, 0);
+     lcd.Print( "computing", 5,220,COLOR_MAGENTA,COLOR_BLACK, 0);
+   }
+   
+  void glc_4(unsigned int mgdl)
+   {
+    DisableTouch();
+    lcd.FillRect(5,127,230,320,COLOR_BLACK); 
+     char buf[10];
+     sprintf (buf, "BG is %d mgdl",mgdl);
+     lcd.Print( buf, 5,100,COLOR_YELLOW,COLOR_BLACK, 0);
+   }
\ No newline at end of file