⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ra8835.c

📁 SSD1963.zip
💻 C
📖 第 1 页 / 共 5 页
字号:
  LCDVertLine(top+1,bottom,right,0) ;
  // and two horizonal lines 
  LCDHorzLine(left,right,top,1) ;
  LCDHorzLine(left,right,bottom,1) ;
}
//------------------------------------------------------------------------------
// Function Name: LCDPixel
// Parameters: unsigned short left, unsigned short top,unsigned short right, unsigned short bottom
// Return: none
// Description: function to Draw a box in display memory starting at the 
//left/top and going to the right/bottom. No runtime error checking is performed.
//It is assumed that left is less than right and that top is less than bottom.
//------------------------------------------------------------------------------
void LCDPixel(unsigned x,unsigned y)
{
   unsigned int Div,Rem,Addr = 0x1000;
   Div = x/8;
   Rem = x%8;
   Addr=Addr + y*40;
   Addr = Addr + Div;
   LCDMemWrite(Addr&0xff,(Addr>>8)&0xff);
   Addr = 0x80;
   Addr = Addr>>Rem;
   LCDDataWrite(Addr);
}
//------------------------------------------------------------------------------
// Function Name: LCDLine
// Parameters: x1, y1,x2,y2
// Return: none
// Description: Function to draw line x1,y1,x2,y2 are coordinates
//------------------------------------------------------------------------------
#define sign(x)  ((x) > 0 ? 1 : ((x) == 0 ? 0 : (-1)))
void LCDDraLine( int x1,int y1,int x2,int y2)
{
  int ix,iy,inc,x,y,dx,dy,plotx,ploty,i;
  int plot;
  inc = 500;
  dx = x2-x1;
  dy = y2-y1;
  ix = abs(dx);
  iy = abs(dy);
  plotx = x1;
  ploty = y1;
  x=y=0;
  LCDPixel(plotx,ploty);
  for(i=0;i<=inc;++i)
  {
    x+=ix;
    y+=iy;
    plot = FALSE;
    if(  x > inc )
    {
      plot = TRUE;
      x -= inc;
      plotx += sign(dx);
    }
    if( y > inc )
    {
      plot = TRUE;
      y -= inc;
      ploty += sign(dy);
    }
    if( plot )
      LCDPixel(plotx,ploty);
  }
}
//------------------------------------------------------------------------------
// Function Name: LCDBox
// Parameters: unsigned short left, unsigned short top,unsigned short right, unsigned short bottom,unsigned short Fill
//Fill = 1/0
// Return: none
// Description: function to Fill a box in display memory starting at the 
//left/top and going to the right/bottom. No runtime error checking is performed.
//It is assumed that left is less than right and that top is less than bottom.
//------------------------------------------------------------------------------
void LCDFillBox(unsigned short left, unsigned short top,unsigned short right, unsigned short bottom,unsigned short Fill)
{
  unsigned short i;
  for(i=top;i<bottom;i++)
  LCDHorzLine(left,right,i,Fill);
}
//------------------------------------------------------------------------------
// Function Name: DisplayClock
// Parameters: None
// Return: none
// Description: Displays the Date & time on warning area
//------------------------------------------------------------------------------
void DisplayClock(void)
{
    //Read RTC Date
    RTC_GetDate(BINARY,&Gc.ActDate);    
    //Display RTC Date
    sprintf(Buffer,"%02d:%02d:%02d%02d",Gc.ActDate.day,Gc.ActDate.month,Gc.ActDate.century,Gc.ActDate.year);
    LCDText(Buffer,28,7);
    
    LCDText(Day[Gc.ActDate.weekday-1],28, 18);    

    //Read RTC Time
    RTC_GetTime(BINARY,&Gc.ActTime);    
    //Display RTC Time
    sprintf(Buffer,"%02d:%02d:%02d",(Gc.ActTime.hours>=13)?Gc.ActTime.hours-12:Gc.ActTime.hours,Gc.ActTime.minutes,Gc.ActTime.seconds);
    LCDText(Buffer,28,23);
    
    (Gc.ActTime.hours>=12)?LCDText(AmPm[1],28,32):LCDText(AmPm[0],28,32);
    
}    
//------------------------------------------------------------------------------
// Function Name: Drawscreen
// Parameters: unsigned short Screen number
// 0: Startup screen
// Return: none
// Description: function to Draw screen as per screen no.
//------------------------------------------------------------------------------
void DrawScreen(unsigned short Screen)
{
  CurrScreen = Screen ;
  PrevScreen = CurrScreen ;
  ClearGraphics();
  ClearText();  
  switch(Screen)
  {
    case SCREENSTRATUP:
    LCDBox(0,0,39,239);
    LCDBox(1,20,38,220);  
    LCDBox(2,40,37,200);
    LCDText("      THERMO SCIENTIFIC      ",11,6);
    LCDText("      GAS CHROMATOGRAPH      ",13,6); 
    LCDText("    FIRMWARE RELEASE 0.00    ",17,6);
    LCDText("         (MAR - 2009)        ",19,6);  
    LCDFillBox(4,60,35,180,1);
    break;
   
    case SCREENLOCK:
    LCDBox(0,0,39,18); 	//heading box
    LCDBox(0,20,39,34);
    LCDBox(0,36,39,50);
    LCDBox(0,52,39,94);    
    LCDBox(0,96,39,172);
    LCDBox(0,174,39,214);
    LCDBox(0,216,39,239);	//warning message
    
    LCDText("***SUMMARY SCREEN***",1,10); 	
    LCDText("METHOD:",3,2);
    LCDText("OVEN TEMP ACTUAL C:      SET C:     ",5,2);	
    LCDChar(0xdf,5,19);		//Deg for actual tempr
    LCDChar(0xdf,5,31);	        //Deg for set tempr
    LCDText("INJ :",7,2);	
    LCDText("DET :",13,2);	
    break;    

    case SCREENOVEN:
    LCDBox(0,0,39,18);       //heading box DrawRect(0,0,39,21);
    LCDBox(0,20,39,34);    
    LCDBox(0,36,18,97);
    LCDBox(19,36,39,97);
    LCDBox(0,99,39,214);    
    LCDBox(0,216,39,239);     //warning message
    
     
    LCDText("***OVEN PARAMETERS***",1,8); 	
    
    LCDText("ACT TEMP :    C",3,2);
    LCDChar(0xdf,3,16);     //Degree centigrade
    LCDText("GC STATUS:",3,22);
    
    LCDText("SET TEMP :     C",5,2);
    LCDChar(0xdf,5,16);     //Degree centigrade
    LCDText("SET TIME :",7,2);
    LCDText("SET RATE :",9,2);
    LCDText("TOTAL TIME:0.00",11,1);

    LCDText("MAX TEMP :     C",5,22);
    LCDChar(0xdf,5,36);     //Degree centigrade
    LCDText("OVEN CRYO:",7,22);
    LCDText("OVEN FAN :",9,22);  
    break;    

    case SCREENINJECTOR:      
    LCDBox(0,0,39,18);       //heading box
    LCDBox(0,216,39,239);     //warning message
    
     
    LCDText("***INJECTOR CONTROL***",1,10); 	
    LCDText("INJECTOR   :",3,2);
    sprintf(Buffer,"%d",Gc.SelInj+1);
    LCDText(Buffer,3,10);
    LCDText(InjType[Gc.Inj[Gc.SelInj].Type],3,15);
    switch(Gc.Inj[Gc.SelInj].Type)
    {
      case NONE:
      LCDBox(0,20,39,214);
      break;
      
      case SSL:   //Ssl
      LCDBox(0,20,39,146);
      LCDBox(0,148,39,214);            
      LCDText("CARRIER GAS:",5,2);            
      LCDText("LENGTH(Mtr):",7,2);
      LCDText("DIA(mm)    :",9,2); 
  
      LCDText("SET          ACTUAL",11,15);
      LCDText("TEMP  C    :            :          ",13,2);
      LCDChar(0xdf,13,7);    
      LCDText("FLOW(mlpm) :            :          ",15,2);
      LCDText("PRESS(   ) :            :          ",17,2);
      LCDText(Units[Gc.PresUnit],17,8);

      LCDText(InjCntrl[Gc.Inj[Gc.SelInj].Ssl.SslSet.CntrlMode],19,15);
      switch(Gc.Inj[Gc.SelInj].Ssl.SslSet.CntrlMode)
      {
        case 0:
        LCDText("PRES :",21,13);
        break;

        case 1:
        LCDText("FLOW :",21,13);
        break;               
      }        
      LCDText("TIME :",23,13);
      LCDText("RATE :",25,13);
      break;
      
      case PTV: //Ptv
      LCDBox(0,20,39,146);
      LCDBox(0,148,39,214);                   
      LCDText("CARRIER GAS:",5,2);                  
      LCDText("LENGTH(Mtr):",7,2);
      LCDText("DIA(mm)    :",9,2); 
  
      LCDText("SET          ACTUAL",11,15);
      LCDText("TEMP  C    :            :          ",13,2);
      LCDChar(0xdf,13,7);    
      LCDText("FLOW(mlpm) :            :          ",15,2);
      LCDText("PRESS(   ) :            :          ",17,2);
      LCDText(Units[Gc.PresUnit],17,8);

      LCDText(InjCntrl[Gc.Inj[Gc.SelInj].Ptv.PtvSet.CntrlMode],19,15);
      switch(Gc.Inj[Gc.SelInj].Ptv.PtvSet.CntrlMode)
      {
        case 0:
        LCDText("PRES :",21,13);
        break;

        case 1:
        LCDText("FLOW :",21,13);
        break;       
        
        case 2:
        LCDText("TEMP :",21,13);
        break;        
      }        
      LCDText("TIME :",23,13);
      LCDText("RATE :",25,13);        
      break;
      
      case PKD:
      LCDBox(0,20,39,214);
      LCDText("CARRIER GAS:",5,2);                   
      LCDText("SET          ACTUAL",7,15);
      LCDText("TEMP  C    :            :          ",9,2);
      LCDChar(0xdf,9,7);    
      LCDText("FLOW(mlpm) :            :          ",11,2);      
      break;
    }            
    break;

    case SCREENDETECTOR:
    LCDBox(0,0,39,18);       //heading box
    LCDBox(0,20,39,66);
    LCDBox(0,68,18,214);
    LCDBox(19,68,39,214);        
    LCDBox(0,216,39,239);     //warning message
    
    LCDText("***DETECTOR CONTROL***",1,10); 	
    LCDText("DETECTOR  :",3,2);
    sprintf(Buffer,"%d",Gc.SelDet+1);
    LCDText(Buffer,3,10);
    LCDText(DetType[Gc.Det[Gc.SelDet].Type],3,13);
    switch(Gc.Det[Gc.SelDet].Type)
    {
      case FID:
      LCDText("ACT mV    :",5,2);
      LCDText("TEMP  C",7,2);
      LCDChar(0xdf,7,7);
      LCDText("SET:",7,12);
      LCDText("ACTUAL:",7,24);
      
      LCDText("OFSET mV:",9,2);
      LCDText("ATTEN   : 2^",11,2);
      LCDText("RANGE   : 10^",13,2);      
      LCDText("POLARITY:",15,2);
      LCDText("THRE. mV:",17,2);  
      LCDText("IGNITION:",19,2);    

      LCDText("FLOWS(in mlpm):-",9,21);    
      LCDText("AIR   :",11,21);    
      LCDText("H2    :",15,21);     
      LCDText("MKP   :",19,21);       
      break;
      
      case TCD:
      LCDText("ACT mV    :",5,2);
      LCDText("TEMP  C",7,2);
      LCDChar(0xdf,7,7);
      LCDText("SET:",7,12);
      LCDText("ACTUAL:",7,24);
      
      LCDText("OFSET mV:",9,2);
      LCDText("ATTEN   : 2^",11,2);
      LCDText("RANGE   : 10^",13,2);      
      LCDText("POLARITY:",15,2);
      LCDText("BRIDGE V:",17,2);  
      LCDText("MAX CUR.:",19,2);    

      LCDText("FLOWS(in mlpm):-",9,21);    
      LCDText("MKP1   :",11,21);     
      LCDText("MKP2   :",15,21);                 
      break;      
      
      case ECD:
      LCDText("ACT mV    :",5,2);
      LCDText("TEMP  C",7,2);
      LCDChar(0xdf,7,7);
      LCDText("SET:",7,12);
      LCDText("ACTUAL:",7,24);
      
      LCDText("OFSET mV:",9,2);
      LCDText("ATTEN   : 2^",11,2);
      LCDText("CURRENT : ",13,2);         

      LCDText("FLOWS(in mlpm):-",9,21);    
      LCDText("MKP   :",11,21);     
      break;   
      
      case NPD:
      LCDText("ACT mV    :",5,2);
      LCDText("TEMP  C",7,2);
      LCDChar(0xdf,7,7);
      LCDText("SET:",7,12);
      LCDText("ACTUAL:",7,24);
      
      LCDText("OFSET mV:",9,2);
      LCDText("ATTEN   : 2^",11,2);
      LCDText("RANGE   : 10^",13,2);      
      LCDText("THRE. mV:",15,2);  
      LCDText("IGNITION:",17,2);    
      LCDText("BI VOLT :",19,2);  
      LCDText("CURRENT :",21,2);  
      
      LCDText("FLOWS(in mlpm):-",9,21);    
      LCDText("AIR1  :",11,21);    
      LCDText("AIR2  :",15,21);        
      LCDText("H2    :",19,21);     
      LCDText("MKP   :",23,21);     
      break;      
    }
    break;    
    
    case SCREENAUXILARY:
    LCDBox(0,0,39,18);       //heading box
    LCDBox(0,20,39,214);
    LCDBox(0,216,39,239);     //warning message
    LCDBox(2,85,37,160);            
    LCDBox(3,90,36,155);        
    
    LCDText("***AUXILARY TEMPERATURES***",1,7); 	
    LCDText("SET     ACT",13,23);
    LCDText("AUXILARY1 TEMP:",15,5);
    LCDText("AUXILARY2 TEMP:",17,5);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -