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

📄 display_switchmode_65k320240.c

📁 可以学习
💻 C
📖 第 1 页 / 共 2 页
字号:
/*--------------------------------------------------------------------------
*主界面显示模块
--------------------------------------------------------------------------*/

/*--------------------------------------------------------------------------
*INCLUDES
--------------------------------------------------------------------------*/
#include "SwitchMode_bmp.h"
#include "Interface.h"

/*--------------------------------------------------------------------------
* Variable ,constant or function
--------------------------------------------------------------------------*/
const U8 SwitchMode_Table[SWITCHMODE_MAINITEM_COUNT]=
{
};

//主界面图标显示位置
static const U16 SwitchMode_Icon_Pos[][2]=
{//y,x
	38,2,
	
	80,2,
	
	123,10,
	
	165,23,
	
	183,68,
	
	188,114,
	
	187,164,
	
	178,211,
	
	166,257,
	
	122,267,
	
	80,274,
	
	38,274
};

//学习机和扩展功能图标显示位置
static const U16 Learn_Extend_Icon_Pos[][2]=
{//y,x
	78,18,

	78,75,

	78,132,

	78,189,

	78,246,

	134,18,

	134,75,

	134,132,

	134,189
};

static const U16 Camera_And_Vidicon_Pos[][2]=
{//y,x
	78,23,
	
	78,78,
	
	78,135,
	
	78,189,
	
	78,247	
	
};


//主界面电量图标
static const U8 SWITCHMODE_BATTERY[4][18]=
{
	//电量空
	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
	//电量1格
	0x00,0x0F,0x00,0x0F,0x00,0x0F,0x00,0x0F,0x00,0x0F,0x00,0x0F,0x00,0x0F,0x00,0x0F,0x00,0x0F,
	//电量2格
	0x03,0xCF,0x03,0xCF,0x03,0xCF,0x03,0xCF,0x03,0xCF,0x03,0xCF,0x03,0xCF,0x03,0xCF,0x03,0xCF,
	//电量3格
	0xF3,0xCF,0xF3,0xCF,0xF3,0xCF,0xF3,0xCF,0xF3,0xCF,0xF3,0xCF,0xF3,0xCF,0xF3,0xCF,0xF3,0xCF
};


//主界面星期图标
static const U8 SWITCHMODE_WEEK[][36]=
{
	//SUN
	0x78,0x00,0x00,0x00,0xC8,0x00,0x00,0x00,0xC0,0x00,0x00,0x00,0xE1,0xDC,0xEE,0x00,
	0x78,0xCC,0x76,0x00,0x1C,0xCC,0x66,0x00,0x8C,0xCC,0x66,0x00,0x8C,0xCC,0x66,0x00,
	0xF8,0xFE,0xF7,0x00,
	//MON
	0xE0,0x70,0x00,0x00,0x70,0xE0,0x00,0x00,0x70,0xE0,0x00,0x00,0x59,0x63,0xCE,0xE0,
	0x59,0x66,0x67,0x60,0x4D,0x66,0x66,0x60,0x4E,0x66,0x66,0x60,0x46,0x66,0x66,0x60,
	0xE6,0xF3,0xCF,0x70,
	//TUE
	0xFF,0x00,0x00,0x00,0x99,0x00,0x00,0x00,0x18,0x00,0x00,0x00,0x18,0x77,0x1C,0x00,
	0x18,0x33,0x36,0x00,0x18,0x33,0x3E,0x00,0x18,0x33,0x30,0x00,0x18,0x33,0x38,0x00,
	0x3C,0x3F,0x9E,0x00,
	//WED
	0x00,0x00,0x0E,0x00,0xCC,0xC0,0x06,0x00,0xCC,0xC0,0x06,0x00,0x4C,0x8E,0x1E,0x00,
	0x6D,0x9B,0x26,0x00,0x7F,0x9F,0x66,0x00,0x33,0x18,0x66,0x00,0x33,0x1C,0x66,0x00,
	0x33,0x0F,0x3F,0x00,
	//THU
	0xFF,0x70,0x00,0x00,0x99,0x30,0x00,0x00,0x18,0x30,0x00,0x00,0x18,0x37,0x77,0x00,
	0x18,0x3B,0x33,0x00,0x18,0x33,0x33,0x00,0x18,0x33,0x33,0x00,0x18,0x33,0x33,0x00,
	0x3C,0x7B,0xBF,0x80,
	//FRI
	0xFE,0x00,0x60,0x00,0x62,0x00,0x60,0x00,0x60,0x00,0x00,0x00,0x64,0x74,0xE0,0x00,
	0x7C,0x38,0x60,0x00,0x64,0x30,0x60,0x00,0x60,0x30,0x60,0x00,0x60,0x30,0x60,0x00,
	0xF0,0x78,0xF0,0x00,
	//SAT
	0x78,0x00,0x00,0x00,0xC8,0x01,0x80,0x00,0xC0,0x01,0x80,0x00,0xE0,0xF3,0xC0,0x00,
	0x78,0x31,0x80,0x00,0x1C,0xF1,0x80,0x00,0x8D,0xB1,0x80,0x00,0x8D,0xB1,0x80,0x00,
	0xF9,0xF9,0xC0,0x00,

};


//外接卡图标取模数据  W=24 H=16
static const U8 CARD[48]=
{
	0x78,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xE0,0x00,0x1F,0xDF,0xFF,0xEB,0xFF,
	0xFF,0xFB,0xFE,0x11,0xFB,0xFD,0xF6,0xFB,0xFE,0x36,0xFB,0xFF,0xD6,0xFB,0xFC,0x31,
	0xFB,0xDF,0xFF,0xEB,0xE0,0x00,0x1F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xE0,0x1F,0xFF
};



/*-----------------------------------------------------------------------------
* 函数:	DisplaySwitchMode_Refresh
* 功能:	模式切换模块SwitchMode的显示程序
* 参数:	FocusItemNo	当前焦点
* 返回:	none
*----------------------------------------------------------------------------*/
void DisplaySwitchMode_Refresh(void)
{
	SwitchMode_Id_e	SwitchModeId;
	U8 FocusItemNo;
	U8 languageIndex;
	RECT Rect;
	U32 bmpOffset;
	STRING string;

	if(Hyc_GetSwitchModeRefreshMode()==NOT)
	{
		return;
	}

	Hyc_DisplaySpecial_Cancel();
	Hyc_SetColumnLimit(cLCD_TOTAL_COLUMN);

	SwitchModeId=Hyc_GetSwitchModeId();
	FocusItemNo=Hyc_GetSwitchMode_FocusItemNo();
	
	languageIndex=Hyc_GetLanguageIndex();//获得焦点项字符串序号
	
	languageIndex *= (tSwitchModeInfo[SwitchModeId].u8TotalItemNum&~cSWITCHMODE_HAVE_CHILD);
	
	if(Hyc_GetSwitchModeRefreshMode()==PART)
	{//部分刷新
	
		U8 FocusItemNo_Last;

		FocusItemNo_Last=Hyc_GetSwitchMode_FocusItemNoLast();

		if(SwitchModeId==SwitchMode_Id_Main)
		{//处于主菜单界面

			Rect.h = cBMPSIZE_SWITCHMODE_SMALL_BMP_H;
			Rect.w = cBMPSIZE_SWITCHMODE_SMALL_BMP_W;
			Rect.y = SwitchMode_Icon_Pos[FocusItemNo_Last][0];
			Rect.x = SwitchMode_Icon_Pos[FocusItemNo_Last][1];
			bmpOffset = cOFFSET_SWITCHMODE_BMP + FocusItemNo_Last*2*cBMPSIZE_SWITCHMODE_SMALL_BMP;
			Hyc_WriteBMPFromNand((U32)bmpOffset, &Rect);

			
			Rect.h = cBMPSIZE_SWITCHMODE_SMALL_BMP_H;
			Rect.w = cBMPSIZE_SWITCHMODE_SMALL_BMP_W;
			Rect.y = SwitchMode_Icon_Pos[FocusItemNo][0];
			Rect.x = SwitchMode_Icon_Pos[FocusItemNo][1];
			bmpOffset = cOFFSET_SWITCHMODE_BMP + (FocusItemNo*2+1)*cBMPSIZE_SWITCHMODE_SMALL_BMP;			
			Hyc_WriteBMPFromNand((U32)bmpOffset, &Rect);

			languageIndex=Hyc_GetLanguageIndex();
			if(languageIndex>2)languageIndex=0;//如果当前语言不是英语、中文、繁体中文,则显示英文标题

			Rect.h = cSWITCHMODE_SWITCHMODE_BMPST_H;
			Rect.w = cSWITCHMODE_SWITCHMODE_BMPST_W;
			Rect.y = cSWITCHMODE_SWITCHMODE_BMPST_Y;
			Rect.x = cSWITCHMODE_SWITCHMODE_BMPST_X;
			bmpOffset=cOFFSET_SWITCHMODE_ENGLISH_BMP
			 + languageIndex*cBMPSIZE_SWITCHMODE_LANGUAGE + FocusItemNo*cBMPSIZE_SWITCHMODE_BMPSTR;
			Hyc_WriteBMPFromNand((U32)bmpOffset, &Rect);
		}
		else if(SwitchModeId==SwitchMode_Id_Learn)
		{//处于学习机界面

			Rect.h = cSWITCHMODE_LEARN_BMP_H;
			Rect.w = cSWITCHMODE_LEARN_BMP_W;
			Rect.y = Learn_Extend_Icon_Pos[FocusItemNo_Last][0];
			Rect.x = Learn_Extend_Icon_Pos[FocusItemNo_Last][1];
			bmpOffset=cOFFSET_SWITCHMODE_LEARN_BMP+(FocusItemNo_Last*2)*cBMPSIZE_SWITCHMODE_LEARN_BMP;
			Hyc_WriteBMPFromNand((U32)bmpOffset, &Rect);
					
			Rect.h = cSWITCHMODE_LEARN_BMP_H;
			Rect.w = cSWITCHMODE_LEARN_BMP_W;
			Rect.y = Learn_Extend_Icon_Pos[FocusItemNo][0];
			Rect.x = Learn_Extend_Icon_Pos[FocusItemNo][1];
			bmpOffset=cOFFSET_SWITCHMODE_LEARN_BMP+(FocusItemNo*2+1)*cBMPSIZE_SWITCHMODE_LEARN_BMP;
			Hyc_WriteBMPFromNand((U32)bmpOffset, &Rect);
			
			Rect.h = 16;
			Rect.w = 320;
			Rect.y = cDISPLAY_MENU_TITLE2_Y;
			Rect.x = 0;
			Hyc_Background2DisplayMemory(&Rect);
						
			string.pstring=(U8*)tSwitchModeInfo[SwitchModeId].pItemString[languageIndex+FocusItemNo];
			string.y=cSWITCHMODE_STR2_Y;
			string.x=Hyc_GetDisplayString_Center(FONTSIZE8X16,(U8*)string.pstring);
			string.attribute=FONTSIZE8X16;
			string.FrontColor=COLOR_WHITE;
			string.BackColor=COLOR_BLACK;
			Hyc_DisplayString(&string);
		}
		else if(SwitchModeId==SwitchMode_Id_Extend)
		{//处于扩展功能界面

			Rect.h = cSWITCHMODE_EXTEND_BMP_H;
			Rect.w = cSWITCHMODE_EXTEND_BMP_W;
			Rect.y = Learn_Extend_Icon_Pos[FocusItemNo_Last][0];
			Rect.x = Learn_Extend_Icon_Pos[FocusItemNo_Last][1];
			bmpOffset=cOFFSET_SWITCHMODE_EXTEND_BMP+(FocusItemNo_Last*2)*cBMPSIZE_SWITCHMODE_EXTEND_BMP;
			Hyc_WriteBMPFromNand((U32)bmpOffset, &Rect);
			
			Rect.h = cSWITCHMODE_EXTEND_BMP_H;
			Rect.w = cSWITCHMODE_EXTEND_BMP_W;
			Rect.y = Learn_Extend_Icon_Pos[FocusItemNo][0];
			Rect.x = Learn_Extend_Icon_Pos[FocusItemNo][1];
			bmpOffset=cOFFSET_SWITCHMODE_EXTEND_BMP+(FocusItemNo*2+1)*cBMPSIZE_SWITCHMODE_EXTEND_BMP;
			Hyc_WriteBMPFromNand((U32)bmpOffset, &Rect);
					
			Rect.h = 16;
			Rect.w = 88;
			Rect.y = cSWITCHMODE_STR2_Y;
			Rect.x = 116;
			Hyc_Background2DisplayMemory(&Rect);
			
			string.pstring=(U8*)tSwitchModeInfo[SwitchModeId].pItemString[languageIndex+FocusItemNo];
			string.y=cSWITCHMODE_STR2_Y;
			string.x=Hyc_GetDisplayString_Center(FONTSIZE8X16,(U8*)string.pstring);
			string.attribute=FONTSIZE8X16;
			string.FrontColor=COLOR_WHITE;
			string.BackColor=COLOR_BLACK;
			Hyc_DisplayString(&string);
		}
		else if(SwitchModeId == SwitchMode_Id_Vidicon)
		{
			
			Rect.h = cOFFSET_VIDICION_BMP_H;
			Rect.w = cOFFSET_VIDICION_BMP_W;
			Rect.y = Camera_And_Vidicon_Pos[FocusItemNo_Last][0];
			Rect.x = Camera_And_Vidicon_Pos[FocusItemNo_Last][1];
			bmpOffset=cOFFSET_VIDICION_BMP+(FocusItemNo_Last*2)*cOFFSET_VIDICION_BMP_SIZE;
			Hyc_WriteBMPFromNand((U32)bmpOffset, &Rect);
			
			
			Rect.h = cOFFSET_VIDICION_BMP_H;
			Rect.w = cOFFSET_VIDICION_BMP_W;
			Rect.y = Camera_And_Vidicon_Pos[FocusItemNo][0];
			Rect.x = Camera_And_Vidicon_Pos[FocusItemNo][1];
			bmpOffset=cOFFSET_VIDICION_BMP+(FocusItemNo*2+1)*cOFFSET_VIDICION_BMP_SIZE;
			Hyc_WriteBMPFromNand((U32)bmpOffset, &Rect);
			
			
			Rect.h = 16;
			Rect.w = 320;
			Rect.y = cSWITCHMODE_STR2_Y;
			Rect.x = 0;
			Hyc_Background2DisplayMemory(&Rect);
			
			string.pstring=(U8*)tSwitchModeInfo[SwitchModeId].pItemString[languageIndex+FocusItemNo];
			string.y=cSWITCHMODE_STR2_Y;
			string.x=Hyc_GetDisplayString_Center(FONTSIZE8X16,(U8*)string.pstring);
			string.attribute=FONTSIZE8X16;
			string.FrontColor=COLOR_WHITE;
			string.BackColor=COLOR_BLACK;
			Hyc_DisplayString(&string);
			
		}
		else if(SwitchModeId == SwitchMode_Id_Camera)
		{
		
		    Rect.h = cOFFSET_CAMERA_BMP_H;
			Rect.w = cOFFSET_CAMERA_BMP_W;
			Rect.y = Camera_And_Vidicon_Pos[FocusItemNo_Last][0];
			Rect.x = Camera_And_Vidicon_Pos[FocusItemNo_Last][1];
			bmpOffset=cOFFSET_CAMERA_BMP+(FocusItemNo_Last*2)*cOFFSET_CAMERA_BMP_SIZE;
			Hyc_WriteBMPFromNand((U32)bmpOffset, &Rect);
			
			
			Rect.h = cOFFSET_CAMERA_BMP_H;
			Rect.w = cOFFSET_CAMERA_BMP_W;
			Rect.y = Camera_And_Vidicon_Pos[FocusItemNo][0];
			Rect.x = Camera_And_Vidicon_Pos[FocusItemNo][1];
			bmpOffset=cOFFSET_CAMERA_BMP+(FocusItemNo*2+1)*cOFFSET_CAMERA_BMP_SIZE;
			Hyc_WriteBMPFromNand((U32)bmpOffset, &Rect);
			
			
			Rect.h = 16;
			Rect.w = 320;
			Rect.y = cSWITCHMODE_STR2_Y;
			Rect.x = 0;
			Hyc_Background2DisplayMemory(&Rect);
			
			string.pstring=(U8*)tSwitchModeInfo[SwitchModeId].pItemString[languageIndex+FocusItemNo];
			string.y=cSWITCHMODE_STR2_Y;
			string.x=Hyc_GetDisplayString_Center(FONTSIZE8X16,(U8*)string.pstring);
			string.attribute=FONTSIZE8X16;
			string.FrontColor=COLOR_WHITE;
			string.BackColor=COLOR_BLACK;
			Hyc_DisplayString(&string);
		
		}
		
	}
	else if(Hyc_GetSwitchModeRefreshMode()==ALL)
	{//获得标题字符串序号
		
		U8 Refresh_Item,TotalNum;

		Refresh_Item=Hyc_GetLanguageIndex()*12+(U8)SwitchModeId-1;
		TotalNum=tSwitchModeInfo[SwitchModeId].u8TotalItemNum & ~cSWITCHMODE_HAVE_CHILD;

		//背景刷新
		if(SwitchModeId==SwitchMode_Id_Main)
		{//主菜单背景
			
			Rect.h = cLCD_TOTAL_ROW;
			Rect.w = cLCD_TOTAL_COLUMN;
			Rect.y = 0;
			Rect.x = 0;
			bmpOffset=cOFFSET_SWITCHMODE_BACKGND;
			Hyc_WriteBMPFromNand((U32)bmpOffset, &Rect);
		}
		else if(SwitchModeId==SwitchMode_Id_Learn)
		{//学习机背景图、字符
		
			Rect.h = cLCD_TOTAL_ROW;
			Rect.w = cLCD_TOTAL_COLUMN;
			Rect.y = 0;
			Rect.x = 0;
			bmpOffset=cDISPLAY_MENU_BACKGROUND_FIG_OFFSET;
			Hyc_WriteBMPFromNand((U32)bmpOffset, &Rect);

			Rect.h = 16;
			Rect.w = 96;
			Rect.y = cSWITCHMODE_STR1_Y;
			Rect.x = cSWITCHMODE_STR1_X;
			Hyc_Background2DisplayMemory(&Rect);

			string.pstring=(U8*)tSwitchModeInfo[SwitchModeId].pPreItemString[Refresh_Item];
			string.y=cSWITCHMODE_STR1_Y;
			string.x=cSWITCHMODE_STR1_X;
			string.attribute=0;
			string.FrontColor=COLOR_WHITE;
			string.BackColor=COLOR_BLACK;
			Hyc_DisplayString(&string);
		}
		else if(SwitchModeId==SwitchMode_Id_Extend)
		{//扩展功能背景图、字符

			Rect.h = cLCD_TOTAL_ROW;

⌨️ 快捷键说明

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