memdev_autodev.c

来自「STM32F103ZET6+UCOSII+UCGUI源码」· C语言 代码 · 共 276 行 · 第 1/4 页

C
276
字号
*       static data, shape of polygon**********************************************************************/static const GUI_POINT _aNeedle[] = {  { MAG * ( 0), MAG * (  0 + 125)},  { MAG * (-3), MAG * (-15 + 125)},  { MAG * (-3), MAG * (-65 + 125)},  { MAG * ( 3), MAG * (-65 + 125)},  { MAG * ( 3), MAG * (-15 + 125)},};/*********************************************************************       structure containing information for drawing routine*/typedef struct {  /* Information about what has to be displayed */  GUI_AUTODEV_INFO AutoDevInfo;  /* Polygon data */  GUI_POINT aPoints[7];  float Angle;} PARAM;/*********************************************************************       static code**********************************************************************//*********************************************************************       _GetAngle  This routine returns the value value to indicate. In a real  application, this value would somehow be measured.*/static float _GetAngle(int tDiff) {  if (tDiff < 15000) {    return  225 - 0.006 * tDiff ;  }  tDiff -= 15000;  if (tDiff < 7500) {    return  225 - 90 + 0.012 * tDiff ;  }  tDiff -= 7000;  return 225;}/*********************************************************************       _Draw*/static void _Draw(void * p) {  PARAM * pParam = (PARAM *)p;  /* Fixed background */  if (pParam->AutoDevInfo.DrawFixed) {    GUI_ClearRect (60, 80 + bmScaleR140.YSize, 60 + bmScaleR140.XSize - 1, 180);    GUI_DrawBitmap(&bmScaleR140, 60, 80);  }  /* Moving needle */  GUI_SetColor(GUI_WHITE);  GUI_AA_FillPolygon(pParam->aPoints, countof(_aNeedle), MAG * 160, MAG * 220);  /* Fixed foreground */  if (pParam->AutoDevInfo.DrawFixed) {    GUI_SetTextMode(GUI_TM_TRANS);    GUI_SetColor(GUI_RED);

⌨️ 快捷键说明

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