jz.c

来自「基于MB95F168气体检漏仪软件代码」· C语言 代码 · 共 230 行

C
230
字号
#include "mb95100.h"
extern unsigned char keybuf;
extern unsigned char menustate;
unsigned int press[3],voltpress[3];
unsigned int temperature[3],volttem[3];
unsigned int flownum[3],voltflow[3];
_YLJZ()
{
unsigned char num=0,flag=1,input=0;
unsigned char x=0;
unsigned char buf[5]={0};

	while(flag)
	{
	while((_Judgekey()!=0x03)&&flag)
	{
	ShowHZ16x16(2,num+2,96);
   	if(keybuf==0x01) num+=1;
	else if(keybuf==0x02) num-=1;
	if(num==0x03) num=0x00;
	if(num==0xff) num=0x02;
	ShowHZ16x16(2,num+2,95);
	if(keybuf==0x00) flag=0x00;
	}
	input=1;
	 while(flag&&input)
	 {
		while(_Judgekey()!=3)
		{
	
		if(keybuf==0x00) 
		{
		x+=1;
		if(x==5) x=0;
		}
		else if(keybuf==0x01) buf[x]-=1;
			else if(keybuf==0x02) buf[x]+=1;
		if(buf[x]>=0x0a&&buf[x]<=0xe0) 
		buf[x]=0;
		else if(buf[x]<=0xff&&buf[x]>=0xf0) 
		buf[x]=9;
			else buf[x]=buf[x];
		ShowSZ16x16(13-x,num+2,buf[x]);
		}
		for(x=0;x<5;x++)
		{
		press[num]*=10;
		press[num]+=buf[4-x];
		buf[4-x]=0;
		}
		x=0;
		while(_Judgekey()!=3)
		{
		if(keybuf==0x00) 
		{
		x+=1;
		if(x==5) x=0;
		}
		else if(keybuf==0x01) buf[x]-=1;
		else if(keybuf==0x02) buf[x]+=1;
		if(buf[x]>=0x0a&&buf[x]<=0xe0) 
		buf[x]=0;
		else if(buf[x]<=0xff&&buf[x]>=0xf0) 
		buf[x]=9;
		else buf[x]=buf[x];
		ShowSZ16x16(22-x,num+2,buf[x]);
		}
		for(x=0;x<5;x++)
		{
		voltpress[num]*=10;
		voltpress[num]+=buf[4-x];
		buf[4-x]=0;
		}
		x=0;
		input=0;
	 }
	}
	menustate=5;
	_ScreenCSJZ();
}
_WDJZ()
{
unsigned char num=0,flag=1,input=0;
unsigned char x=0;
unsigned char buf[5]={0};

	while(flag)
	{
	while((_Judgekey()!=0x03)&&flag)
	{
	ShowHZ16x16(2,num+2,96);
   	if(keybuf==0x01) num+=1;
	else if(keybuf==0x02) num-=1;
	if(num==0x03) num=0x00;
	if(num==0xff) num=0x02;
	ShowHZ16x16(2,num+2,95);
	if(keybuf==0x00) flag=0x00;
	}
	input=1;
	 while(flag&&input)
	 {
		while(_Judgekey()!=3)
		{
	
		if(keybuf==0x00) 
		{
		x+=1;
		if(x==5) x=0;
		}
		else if(keybuf==0x01) buf[x]-=1;
			else if(keybuf==0x02) buf[x]+=1;
		if(buf[x]>=0x0a&&buf[x]<=0xe0) 
		buf[x]=0;
		else if(buf[x]<=0xff&&buf[x]>=0xf0) 
		buf[x]=9;
			else buf[x]=buf[x];
		ShowSZ16x16(13-x,num+2,buf[x]);
		}
		for(x=0;x<5;x++)
		{
		temperature[num]*=10;
		temperature[num]+=buf[4-x];
		buf[4-x]=0;
		}
		x=0;
		while(_Judgekey()!=3)
		{
		if(keybuf==0x00) 
		{
		x+=1;
		if(x==5) x=0;
		}
		else if(keybuf==0x01) buf[x]-=1;
		else if(keybuf==0x02) buf[x]+=1;
		if(buf[x]>=0x0a&&buf[x]<=0xe0) 
		buf[x]=0;
		else if(buf[x]<=0xff&&buf[x]>=0xf0) 
		buf[x]=9;
		else buf[x]=buf[x];
		ShowSZ16x16(22-x,num+2,buf[x]);
		}
		for(x=0;x<5;x++)
		{
		volttem[num]*=10;
		volttem[num]+=buf[4-x];
		buf[4-x]=0;
		}
		x=0;
		input=0;
	 }
	}
	menustate=5;
	_ScreenCSJZ();
}
_LLJZ()
{
unsigned char num=0,flag=1,input=0;
unsigned char x=0;
unsigned char buf[5]={0};

	while(flag)
	{
	while((_Judgekey()!=0x03)&&flag)
	{
	ShowHZ16x16(2,num+2,96);
   	if(keybuf==0x01) num+=1;
	else if(keybuf==0x02) num-=1;
	if(num==0x03) num=0x00;
	if(num==0xff) num=0x02;
	ShowHZ16x16(2,num+2,95);
	if(keybuf==0x00) flag=0x00;
	}
	input=1;
	 while(flag&&input)
	 {
		while(_Judgekey()!=3)
		{
	
		if(keybuf==0x00) 
		{
		x+=1;
		if(x==5) x=0;
		}
		else if(keybuf==0x01) buf[x]-=1;
			else if(keybuf==0x02) buf[x]+=1;
		if(buf[x]>=0x0a&&buf[x]<=0xe0) 
		buf[x]=0;
		else if(buf[x]<=0xff&&buf[x]>=0xf0) 
		buf[x]=9;
			else buf[x]=buf[x];
		ShowSZ16x16(13-x,num+2,buf[x]);
		}
		for(x=0;x<5;x++)
		{
		flownum[num]*=10;
		flownum[num]+=buf[4-x];
		buf[4-x]=0;
		}
		x=0;
		while(_Judgekey()!=3)
		{
		if(keybuf==0x00) 
		{
		x+=1;
		if(x==5) x=0;
		}
		else if(keybuf==0x01) buf[x]-=1;
		else if(keybuf==0x02) buf[x]+=1;
		if(buf[x]>=0x0a&&buf[x]<=0xe0) 
		buf[x]=0;
		else if(buf[x]<=0xff&&buf[x]>=0xf0) 
		buf[x]=9;
		else buf[x]=buf[x];
		ShowSZ16x16(22-x,num+2,buf[x]);
		}
		for(x=0;x<5;x++)
		{
		voltflow[num]*=10;
		voltflow[num]+=buf[4-x];
		buf[4-x]=0;
		}
		x=0;
		input=0;
	 }
	}
	menustate=5;
	_ScreenCSJZ();
}

⌨️ 快捷键说明

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