Changes done in ECG and BT

Dependencies:   SDFileSystem ds3231 eeprom_Nikita mbed testUniGraphic_150217

Fork of merged_code2_20sept_2017_4th_oct_2017 by nikita teggi

Revision:
3:9a06c2bed650
Parent:
2:3b7b71bfc941
Child:
4:6bd81bb1790d
diff -r 3b7b71bfc941 -r 9a06c2bed650 display_modules.cpp
--- a/display_modules.cpp	Mon Jan 30 10:57:38 2017 +0000
+++ b/display_modules.cpp	Fri Feb 10 10:39:13 2017 +0000
@@ -4,7 +4,7 @@
 #include "display_modules.h"
 #include "touch_modules.h"
 #include "rtc.h"
-#include "main.h"
+//#include "main.h"
 
 
 BusOut dataBus( PTC12, PTC13, PTB10, PTC9, PTD4, PTD5, PTD6, PTD7 ); // 16 pins//POC
@@ -20,7 +20,6 @@
  {
        char buff1[32];
         time_t epoch_time;
-         DisableTouch();
          lcd.ClearScreen();
          lcd.SetFont(&TerminusFont);
          epoch_time=rtc_read();
@@ -34,15 +33,14 @@
             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);
@@ -50,7 +48,9 @@
               lcd.Print(buff2,200,50,COLOR_YELLOW,COLOR_BLACK, 0);
                 
                 lcd.SetFont(&TerminusBigFont);
-                lcd.FillRect(5,120,230,320,COLOR_BLACK); 
+               // lcd.FillRect(5,120,230,320,COLOR_BLACK); 
+                 lcd.FillRoundRect(60,130,180,200,COLOR_BLACK);
+                   lcd.FillRoundRect(60,230,180,300,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);
@@ -59,14 +59,14 @@
                 lcd.Print( "BP",40,245,COLOR_BLACK,COLOR_MAGENTA,0);
                 lcd.FillRoundRect(130,215,220,285,COLOR_GREEN);
                 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);
@@ -77,71 +77,116 @@
                 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.FillRect(5,127,230,320,COLOR_BLACK); 
+       
+             //  lcd.FillRect(5,127,230,320,COLOR_BLACK); 
+             
+              lcd.FillRoundRect(10,130,100,200,COLOR_BLACK);
+               lcd.FillRoundRect(130,130,220,200,COLOR_BLACK);
+              lcd.FillRoundRect(10,215,100,285,COLOR_BLACK);
+                lcd.FillRoundRect(130,215,220,285,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.FillRect(5,90,230,150,COLOR_BLACK); 
+             lcd.Print( "  Tst is Done  ",3,150,COLOR_GREEN,COLOR_BLACK,0);
+           //  lcd.Print( "DONE", CENTER, 95);
+           // lcd.Print( "s Done   ",80,150,COLOR_GREEN,COLOR_BLACK,0);
+            lcd.FillRect(10,215,230,290,COLOR_BLACK);
+          //  lcd.FillRoundRect(10,215,100,285,COLOR_MAGENTA);
+           // lcd.FillRoundRect(130,215,220,285,COLOR_GREEN);
              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.FillRect(5,127,230,320,COLOR_BLACK); 
+       lcd.FillRoundRect(10,130,100,200,COLOR_BLACK);
+               lcd.FillRoundRect(130,130,220,200,COLOR_BLACK);
+              lcd.FillRoundRect(10,215,100,285,COLOR_BLACK);
+                lcd.FillRoundRect(130,215,220,285,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_bp1(float SBP, float DBP)          // bp main screen
+ {
+        lcd.FillRoundRect(3,130,200,200,COLOR_BLACK);
+           lcd.FillRoundRect(60,230,180,300,COLOR_BLACK);
+    char buf[10];
+     sprintf (buf, "SBP: %f",SBP);
+     lcd.Print( buf, 5,100,COLOR_CYAN,COLOR_BLACK, 0);
+      sprintf (buf, "DBP: %f",DBP);
+     lcd.Print( buf, 5,150,COLOR_CYAN,COLOR_BLACK, 0);
+       lcd.FillRoundRect(60,230,180,300,COLOR_GREEN);
+             lcd.Print( "RET",100,250,COLOR_BLACK,COLOR_GREEN,0);
+}   
+    
+    
+                   
                 
   
  void screen_glc()     // glc main screen
  {
-        DisableTouch();
+        
                  //lcd.FillRect(5,127,230,320,COLOR_BLACK); 
-                 lcd.FillRect(5,127,230,320,COLOR_BLACK); 
+              //   lcd.FillRect(5,127,230,320,COLOR_BLACK); 
+              lcd.FillRoundRect(10,130,100,200,COLOR_BLACK);
+               lcd.FillRoundRect(130,130,220,200,COLOR_BLACK);
+              lcd.FillRoundRect(10,215,100,285,COLOR_BLACK);
+                lcd.FillRoundRect(130,215,220,285,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_bp2()
+ {    
+     
+         
+           lcd.FillRoundRect(3,130,200,200,COLOR_BLACK);
+           lcd.FillRoundRect(60,230,180,300,COLOR_BLACK);
+           lcd.FillRect(5,215,230,290,COLOR_BLACK);
+           
 
-
+}
             
      
  void ecg_countdown()
  {    
      char tim1[5];
-      DisableTouch();
-          lcd.DrawRect(20,90,90,40,COLOR_BLACK);
-          lcd.FillRect(5,127,230,320,COLOR_BLACK); 
+     
+         // lcd.DrawRect(20,90,90,40,COLOR_BLACK);
+         // lcd.FillRect(5,127,230,320,COLOR_BLACK); 
+           lcd.FillRoundRect(3,130,200,200,COLOR_BLACK);
+           lcd.FillRoundRect(60,230,180,300,COLOR_BLACK);
+           lcd.FillRect(5,215,230,290,COLOR_BLACK);
           lcd.Print( "ECG starts in", CENTER, 95);
         for(int i=5;i>=0;i--)
             {
@@ -151,14 +196,14 @@
                         
             }
             lcd.Print( "Tst in Progres",3,150,COLOR_GREEN,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);
@@ -172,42 +217,45 @@
   
   void screen_glc_2()
    {
-        DisableTouch();  
+       
           lcd.FillRect(5,127,230,320,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.DrawRect(20,90,90,40,COLOR_BLACK);
+          //  lcd.FillRect(5,127,230,320,COLOR_BLACK); 
+           lcd.FillRoundRect(3,130,200,200,COLOR_BLACK);
+           lcd.FillRoundRect(60,230,180,300,COLOR_BLACK);
+           lcd.FillRect(5,215,230,290,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);
    }
    
   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 mg/dl",mgdl);