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

📄 t6963c.c

📁 t6963与8051的驱动程序
💻 C
📖 第 1 页 / 共 3 页
字号:
{	uchar	a,b,c;
	a=examineadd%10;
	b=(examineadd%100)/10;
	c=(examineadd%1000)/100;
	if(!i)
	{a=36;b=36;c=36;}
	PutChar(x,y,str1[c]);
	PutChar(x+1,y,str1[b]);
	PutChar(x+2,y,str1[a]);
}
//显示断纱次数
void PutString_3_break(uchar x,uchar y,bit	i)
{	uchar	a,b,c;
	a=breakadd%10;
	b=(breakadd%100)/10;
	c=(breakadd%1000)/100;
	if(!i)
	{a=36;b=36;c=36;}
	PutChar(x,y,str1[c]);
	PutChar(x+1,y,str1[b]);
	PutChar(x+2,y,str1[a]);
}
//LCD显示一个字的函数
void showword(uchar *puts,uchar	xy,bit	b)
{//showword(word,0x23);//说明word是字的数组,0X23的2是显的列,3是行;
	uchar j,i=0,L,H; 
 	L=xy/16;
	H=xy%16;
    L=L*2;        
	for(j=0;j<16;j++)
	{
		LocateXY(L,(H*16)+j,Graphic);
		LcmWriteCommand(0xB0);//进入自动写 	
		CheckAutoWrite();
		if(b)
		LcmWriteData(~puts[i]);
		else	LcmWriteData(puts[i]);
		CheckAutoWrite();
		i=i+1;
		if(b)
		LcmWriteData(~puts[i]);
		else	LcmWriteData(puts[i]);
		i=i+1;
		LcmWriteCommand(0xB2); //退出自动写
	}
}
/**********************************/
//显示金星标志
void	mode0(void)
{  
	showword(jin,	0x00,0);
	showword(xin,	0x10,0);
	showword(ji,	0x20,0);
	showword(xie,	0x30,0);
	showword(you,	0x40,0);
	showword(xian,	0x50,0);
	showword(guang,	0x60,0);
	showword(si,	0x70,0);
	showword(shu,	0x80,0);
	showword(ju,	0x90,0);
	showword(cai,	0xa0,0);
	showword(jie,	0xb0,0);
	showword(xi,	0xc0,0);
	showword(toug,	0xd0,0);
}
//显示机号设置
void	mode1(bit	i)
{  
	showword(yi,	0x02,0);
	showword(ji,	0x12,i);
	showword(hao,	0x22,i);
	showword(she,	0x32,i);
	showword(zhi,	0x42,i);

}
//显示故障检修
void	mode2(bit	i)
{  
	showword(el,	0x52,0);
	showword(gu,	0x62,i);
	showword(zhang,	0x72,i);
	showword(jian,	0x82,i);
	showword(xiu,	0x92,i);
}
//显示改机
void	mode3(bit	i)
{   
	showword(san,	0xa2,0);
	showword(gai,	0xb2,i);
	showword(ji,	0xc2,i);
}
//显示产量设置
void	mode4(bit	i)
{
	showword(siu,	0x03,0);
	showword(chan,	0x13,i);
	showword(liang,	0x23,i);
	showword(she,	0x33,i);
	showword(zhi,	0x43,i);
}
//显示主界面
void	showsetwindos(void)
{	bit	a=0,b=0,c=0,d=0,e=0;
	LcmWriteCommand(0x9c);
	switch(mode)
	{
		case	0:{mode=1;a=1;b=0;c=0;d=0;e=0;} ;break;
		case	1:{a=1;b=0;c=0;d=0;e=0;} ;break;
		case	2:{a=0;b=1;c=0;d=0;e=0;} ;break;
		case	3:{a=0;b=0;c=1;d=0;e=0;} ;break;
		case	4:{a=0;b=0;c=0;d=1;e=0;} ;break;
		case	5:{a=0;b=0;c=0;d=0;e=1;} ;break;
		default:break;
	}
	if(b_all)
	{
		PutString11(12,11,0);
		PutString41(11,11,0);
	}
	if(b_refurbish)
	{
		clr1();
		b_refurbish=0;
		showword(ji,0x05,0);
		showword(su,0x25,0);
		showword(maohao,0x35,0);

		showword(bun,0x75,0);
		showword(ji,0x85,0);
		showword(hao,0x95,0);
		showword(maohao,0xa5,0);

		showword(fo,0x06,0);
		showword(dan,0x16,0);
		showword(hao,0x26,0);
		showword(maohao,0x36,0);

		showword(yue,0x07,0);
		showword(sheng,0x17,0);
		showword(chan,0x27,0);
		showword(maohao,0x37,0);
		showword(mi,0x77,0);
		
		PutString_jisu(7,11,1);
		PutString11(21,11,1);
		PutString_fodan(7,13,1);
		PutString_chanliang(7,15,1);
		
		PutString_2_examine(13,11,0);
		
		PutString_3_break(13,9,0);
	}
	if(mode==1||mode==2||mode==4||b_all)
	{mode1(a);}
	if(mode==1||mode==2||mode==3||b_all)
	{mode2(b);}
	if(mode==2||mode==3||mode==4||b_all)
	{mode3(c);}
	if(mode==3||mode==4||mode==1||b_all)
	{mode4(d);}
	b_all=0;
}
//显示本机号
void	show1windos(void)
{
	showword(bun,	0x25,0);
	showword(ji,	0x35,0);
	showword(hao,	0x45,0);
	showword(maohao,0x55,0);
}
//显示故障检修设置界面
void	show2windos(void)
{	
	showword(zuojian,	0x22,0);
	showword(kai,	0x32,0);
	showword(shi,	0x42,0);
	showword(jian,	0x52,0);
	showword(xiu,	0x62,0);
	showword(qio,	0x82,0);
	showword(din,	0x92,0);
	showword(xiu,	0xa2,0);
	showword(fu,	0xb2,0);
	showword(youjian,0xc2,0);

	showword(gu,	0x04,0);
	showword(zhang,	0x14,0);
	showword(jian,	0x24,0);
	showword(xiu,	0x34,0);
	showword(bian,	0x44,0);
	showword(hao,	0x54,0);
	showword(maohao,0x64,0);

	showword(jian,	0x05,0);
	showword(xiu,	0x15,0);
	showword(ci,	0x45,0);
	showword(shu,	0x55,0);
	showword(maohao,0x65,0);

	showword(zong,	0x06,0);
	showword(xiu,	0x16,0);
	showword(shii,	0x46,0);
	showword(jien,	0x56,0);
	showword(maohao,0x66,0);

	showword(bun,	0x07,0);
	showword(ci,	0x17,0);
	showword(jian,	0x27,0);
	showword(xiu,	0x37,0);
	showword(shii,	0x47,0);
	showword(jien,	0x57,0);
	showword(maohao,0x67,0);
}
//显示改机设置界面
void	show3windos()
{	
	showword(zuojian,0x22,0);
	showword(gai,	0x32,0);
	showword(ji,	0x42,0);
	showword(kai,	0x52,0);
	showword(shi,	0x62,0);
	showword(gai,	0x82,0);
	showword(ji,	0x92,0);
	showword(jiei,	0xa2,0);
	showword(shui,	0xb2,0);
	showword(youjian,	0xc2,0);

	showword(duan,	0x04,0);
	showword(sha,	0x14,0);
	showword(ci,	0x44,0);
	showword(shu,	0x54,0);
	showword(maohao,0x64,0);

	showword(zong,	0x05,0);
	showword(duan,	0x15,0);
	showword(shii,	0x46,0);
	showword(jien,	0x55,0);
	showword(maohao,0x65,0);

	showword(bun,	0x06,0);
	showword(ci,	0x16,0);
	showword(duan,	0x26,0);
	showword(sha,	0x36,0);
	showword(shii,	0x46,0);
	showword(jien,	0x56,0);
	showword(maohao,0x66,0);
}
//显示产量设置界面
void	show5windos(void)
{	
	showword(jing,	0x94,0);
	showword(yei,	0xa4,0);

	showword(ji1,	0x45,0);
	showword(mi,	0x95,0);
	showword(tin,	0xa5,0);
	showword(ji,	0xb5,0);
}
//
void	mode1121314151(void)
{	
	if(mode==11)
	{	if(b_mode11_p||b_mode11)
		{
			PutString11(12,11,1);
			b_mode11_p=0;
		}
		if(b_mode11)
		{	clr1();
			show1windos();
			PutString11(21,11,0);
			PutString_jisu(7,11,0);
			PutString_fodan(7,13,0);
			PutString_chanliang(7,15,0);
			LcmWriteCommand(0x9f); 
			LcmWriteCommandWith2Par(12,11,0x21);
			b_mode11=0;
		}

	}
	if(mode==21)
	{	if(b_21_examine||b_mode21)
		{PutString_2_examine(13,11,1);b_21_examine=0;}
		if(b_21_number||b_mode21)
		{
			PutString_2_number(13,9,1);b_21_number=0;
			LcmWriteCommandWith2Par(13+numberbitadd,9,0x21);
			
		}
		if(b_mode21)
		{	clr1();
			show2windos();
			PutString11(21,11,0);
			PutString_jisu(7,11,0);
			PutString_fodan(7,13,0);
			PutString_chanliang(7,15,0);
			b_mode21=0;
			
		}
	}
	if(mode==31)
	{	if(b_31_break||b_mode31)
		{PutString_3_break(13,9,1);b_31_break=0;}	
		if(b_mode31)
		{	clr1();
			show3windos();
			PutString11(21,11,0);
			PutString_jisu(7,11,0);
			PutString_fodan(7,13,0);
			PutString_chanliang(7,15,0);
			b_mode31=0;
			LcmWriteCommand(0x9c);
		}

	}
	//按键触发显示产量设置
	if(mode==41)
	{		if(b_mode41_p||b_mode41)
				{PutString41(11,11,1);b_mode41_p=0;}
			if(b_guangbiao||b_mode41)
			{	if(chanliangset==0)
					LcmWriteCommandWith2Par(11,11,0x21);
				if(chanliangset==1)
					LcmWriteCommandWith2Par(12,11,0x21);
				if(chanliangset==2)
					LcmWriteCommandWith2Par(13,11,0x21);
				if(chanliangset==3)
					LcmWriteCommandWith2Par(14,11,0x21);
				if(chanliangset==4)
					LcmWriteCommandWith2Par(15,11,0x21);
				if(chanliangset==5)
					LcmWriteCommandWith2Par(16,11,0x21);
				if(chanliangset==6)
					LcmWriteCommandWith2Par(17,11,0x21);
				if(chanliangset==7)
					LcmWriteCommandWith2Par(15,9,0x21);
				b_guangbiao=0;
			}
			//按键触发显示产量设置
			if(b_mode41)
			{	clr1();
				show5windos();
				PutString11(21,11,0);
				PutString_jisu(7,11,0);
				PutString_fodan(7,13,0);
				PutString_chanliang(7,15,0);
				LcmWriteCommand(0x9f); 
				b_mode41=0;
			}
	}
	//中断触发显示已生产量
	if((mode>0&&mode<5)&&b_canliang)
	{	PutString_chanliang(7,15,1);
		b_canliang=0;
	}
}


⌨️ 快捷键说明

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