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

📄 configinterfacehandler.c

📁 在ARM7处理器S3C444B0X上的脉搏测量仪程序
💻 C
字号:
#include "option.h"
#include "def.h"
#include "44b.h"
#include "44blib.h"

#include "ctype.h"
#include "stdlib.h"
#include "GUI.H"
#include "GUI_Protected.H"

#include "define.h"
//--------------------------------------------------
extern const GUI_BITMAP bmreturnMainFromMeasure;//从测量界面返回主界面
extern struct ConfigData configData;//配置

//------------------------------------------------------------------
void DrawButton(int LeftOrRight)//绘制数字增加减少按钮
{
  GUI_POINT Leftpoints[3]={{0,0},{15,7},{15,-7}};
  GUI_POINT Rightpoints[3]={{0,0},{-15,7},{-15,-7}};
  
  if(LeftOrRight)
  {
   GUI_SetColor(GUI_GRAY);
   GUI_FillRect(15,45,35,60);
   GUI_SetColor(GUI_BLACK);
   GUI_FillPolygon(Leftpoints,3,15,52);
   GUI_SetColor(GUI_WHITE);
  }
  else
  {
   GUI_SetColor(GUI_GRAY);
   GUI_FillRect(125,45,145,60);
   GUI_SetColor(GUI_BLACK);
   GUI_FillPolygon(Rightpoints,3,145,52);
   GUI_SetColor(GUI_WHITE);
  }
}
//------------------------------------------------------- 
void DrawCheckbox(int select)//绘制复选框
{
 GUI_SetColor(GUI_GRAY);
 GUI_DrawRect(115,65,135,80);
 GUI_DrawRect(116,66,134,79);
 GUI_DrawRect(117,67,133,78);
 GUI_SetColor(GUI_WHITE);
 if(select)
   GUI_FillRect(122,71,128,74);
}
//------------------------------------------
void DrawRedioButton(int select,int x,int y,int r)//绘制单选按钮
{
 GUI_SetColor(GUI_GRAY);
 GUI_FillCircle(x, y,r);
 GUI_SetColor(GUI_WHITE);
 if(select)
   GUI_FillCircle(x,y,r/2);
 else
 {
   GUI_SetColor(GUI_BLACK);
   GUI_FillCircle(x,y,r/2);
   GUI_SetColor(GUI_WHITE);
 }
}
//------------------------------------------------------------------
void ConfigHander(struct ConfigData *pConfig)
{
     char p[2];
     GUI_Clear();
     GUI_DrawBitmap(&bmreturnMainFromMeasure,0,220);
     GUI_SetColor(GUI_BLUE);
	 GUI_DrawHLine(17,0,160);
	 GUI_DrawHLine(18,0,160);
	 GUI_DrawHLine(19,0,160);
	 //---
	 GUI_DrawHLine(216,0,160);
	 GUI_DrawHLine(217,0,160);
	 GUI_DrawHLine(218,0,160); 
	 GUI_SetColor(GUI_WHITE);
	 
     GUI_SetBkColor(GUI_BLUE);
     GUI_SetColor(GUI_WHITE);
   	 GUI_SetFont(&GUI_Font_HZK16);
	 GUI_DispString(" 脉搏测量仪选项设置 ");
	 
	 GUI_GotoXY(0,25);
	 GUI_DispString("时间(分钟):=========");
	 GUI_GotoXY(60,45);
	 p[0]=(char)(pConfig->minutes+48);
	 p[1]='\0';
	 GUI_DispString(p);
	 GUI_DispString("分钟");
	 DrawButton(1);//左
	 DrawButton(0);//右
	 
	 GUI_GotoXY(0,65);
	 GUI_DispString("提示健康状态:");
	 DrawCheckbox(pConfig->prompt);//绘制复选框
	if(pConfig->prompt)
	{
	 GUI_GotoXY(0,90);
	 GUI_DispString("正常:");
	 DrawRedioButton(pConfig->exerciseOrNormal,50,100,8);//绘制单选按钮
	 GUI_GotoXY(80,90);
	 GUI_DispString("运动:");
	 DrawRedioButton(!pConfig->exerciseOrNormal,130,100,8);//绘制单选按钮
	   
	 GUI_GotoXY(0,110);
	 GUI_DispString("性别================");
	 GUI_GotoXY(0,130);
	 GUI_DispString("男:");
	  DrawRedioButton(pConfig->sex,50,140,8);//绘制单选按钮
	 GUI_GotoXY(80,130);
	 GUI_DispString("女:");
	 DrawRedioButton(!pConfig->sex,130,140,8);//绘制单选按钮
	 
	 GUI_GotoXY(0,150);
	 GUI_DispString("年龄阶段============");
	 GUI_GotoXY(0,170);
	 GUI_DispString("儿童:");
	 if(pConfig->ageLevel==1)
	    DrawRedioButton(1,50,180,8);//绘制单选按钮
	 else
	    DrawRedioButton(0,50,180,8);//绘制单选按钮
	 GUI_GotoXY(0,195);
	 GUI_DispString("成年:");
	 if(pConfig->ageLevel==2)
	    DrawRedioButton(1,50,205,8);//绘制单选按钮
	 else
	    DrawRedioButton(0,50,205,8);//绘制单选按钮
	 GUI_GotoXY(80,195);
	 GUI_DispString("老年:");
	 if(pConfig->ageLevel==3)
	    DrawRedioButton(1,130,205,8);//绘制单选按钮
	 else
	    DrawRedioButton(0,130,205,8);//绘制单选按钮
	}    
	 GUI_SetBkColor(GUI_BLACK);
}

⌨️ 快捷键说明

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