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

📄 key.#2

📁 基于MST-G240128点阵液晶的 状态机机制 人机界面四级滚屏菜单 源代码 ,带时间片机制模拟操作系统
💻 #2
📖 第 1 页 / 共 5 页
字号:
		{
		   switch(page)
		   {
		   case 1:temp=temp-1;
		          switch(hunt)
		          {
				  case 11:if(temp==0)
						  temp=10;
				          break;
				  case 21:if(temp<5)
						  temp=20;
				          break;
				  case 31:if(temp<EM_TimCMD+2)
                          temp=120;
                          break;
				  case 41:if(temp<2)
				          temp=AsyncTimOutCMD-2;
				          break;
				  case 51:if(temp<10)
						  temp=500;
				          break;
				  case 61:if(temp<1)
				          temp=1000;
				          break;
				  default:break;
				  }
				  LCD_Seek11(temp,1);
		          break;
		   case 2:temp=temp-1;
		          switch(hunt)
		          {
				  case 11:if(temp>330)
						  temp=330;
				          break;
				  case 21:if(temp>330)
						  temp=330;
				          break;
				  case 31:if(temp>3000)
                          temp=3000;
                          break;
				  case 41:if(temp>3000)
				          temp=3000;
				          break;
				  case 51:if(temp>150)
						  temp=150;
				          break;
				  case 61:if(temp>150)
				          temp=150;
				          break;
				  default:break;
				  }
				  LCD_Seek11(temp,1);
		          break;
		   case 3:temp=temp-1;
		          switch(hunt)
		          {
				  case 11:if(temp<500)
						  temp=999;
				          break;
				  case 21:if(temp<500)
						  temp=999;
				          break;
				  case 31:if(temp>999)
                          temp=999;
                          break;
				  case 41:if(temp>999)
				          temp=999;
				          break;
				  case 51:if(temp<10)
						  temp=500;
				          break;
				  case 61:if(temp>1)
				          temp=1;
				          break;
				  default:break;
				  }
				  LCD_Seek11(temp,1);
		          break;
		   case 4:if(hunt<60)
		          {
				     temp=temp-1;
		             switch(hunt)
		             {
				     case 11:if(temp>2)
						     temp=2;
				             break;
				     case 21:if(temp<EM_VoltCMD)
						     temp=330;
				             break;
				     case 31:if(temp<EM_CurrCMD)
                             temp=3000;
                             break;
				     case 41:if(temp<EM_AnglCMD)
				             temp=150;
				             break;
				     case 51:if(temp>30)
						     temp=30;
				             break;
				     default:break;
					 }
				     LCD_Seek11(temp,1);
				  }
				  else if(hunt>60)
				     LCD_PassWord(4);
		          break;
		   case 5:temp=temp-1;
		          switch(hunt)
		          {
				  case 11:
							if(temp>4)
							temp=4;
							break;
				  case 21:
							if(temp<EM_VoltMinCMD||temp>EM_VoltMaxCMD)
							temp=EM_VoltMaxCMD;
							break;
				  case 31:
							if(temp<EM_CurrMinCMD||temp>EM_CurrMaxCMD)
							temp=EM_CurrMaxCMD;
							break;
				  case 41:
							if(temp<EM_AnglMinCMD||temp>EM_AnglMaxCMD)
							temp=EM_AnglMaxCMD;
							break;
				  case 51:
							if(temp<EM_PwrFactMinCMD)
							temp=EM_PwrFactMaxCMD;
							break;
				  case 61:
							if(temp<EM_NulPwrMinCMD||temp>EM_NulPwrMaxCMD)
							temp=EM_NulPwrMaxCMD;
							break;

				  default:break;
				  }
				  LCD_Seek11(temp,1);
		          break;
		   default:break;
		   }
		}
	 }
	 ////////////////////////
	 else if(seek==12)
	 {
	    if(hunt%10==0)
		{
	       LCD_CAstr(8,2*hunt/10," ",0,0);
	       hunt=hunt+10;
           if(hunt==70)
           hunt=10;
           LCD_CAstr(8,2*hunt/10,">",0,0);
		}
		else
		{
		   switch(page)
		   {
		   case 1:temp=temp-1;
		          switch(hunt)
		          {
				  case 11:if(temp<1)
						  temp=8;
				          break;
				  case 21:if(temp<1)
						  temp=10;
				          break;
				  case 31:if(temp<5)
                          temp=30;
                          break;
				  case 41:if(temp>100)
						  temp=100;
				          break;
				  case 51:if(temp<1)
						  temp=10;
				          break;
				  case 61:if(temp<135)
						  temp=145;
				          break;
				  default:break;
				  }
				  LCD_Seek12(temp,1);
		          break;
		   case 2:temp=temp-1;
		          switch(hunt)
		          {
				  case 11:if(temp<1)
						  temp=100;
				          break;
				  case 21:if(temp<1)
						  temp=100;
				          break;
				  case 31:if(temp<1)
						  temp=100;
                          break;
				  case 41:if(temp<1)
						  temp=100;
				          break;
				  case 51:if(temp<1)
						  temp=100;
				          break;
				  case 61:if(temp<1)
						  temp=100;
				          break;
				  default:break;
				  }
				  LCD_Seek12(temp,1);
		          break;
		   case 3:temp=temp-1;
		          switch(hunt)
		          {
				  case 11:if(temp<5)
						  temp=20;
				          break;
				  case 21:if(temp<5)
						  temp=80;
				          break;
				  case 31:if(temp>5)
                          temp=5;
                          break;
				  case 41:if(temp<2)
						  temp=100;
				          break;
				  case 51:if(temp<2)
						  temp=10;
				          break;
				  case 61:if(temp<1)
						  temp=50;
				          break;
				  default:break;
				  }
				  LCD_Seek12(temp,1);
		          break;
		   case 4:temp=temp-1;
		          switch(hunt)
		          {
				  case 11:if(temp<1)
						  temp=10;
				          break;
				  case 21:if(temp>120)
						  temp=120;
				          break;
				  case 31:if(temp>100)
                          temp=100;
                          break;
				  case 41:if(temp<2)
						  temp=10;
				          break;
				  case 51:if(temp<5)
						  temp=10;
				          break;
				  case 61:if(temp<4)
						  temp=6;
				          break;
				  default:break;
				  }
				  LCD_Seek12(temp,1);
		          break;
		   case 5:if(hunt<60)
		          {
	                  temp=temp-1;
			          switch(hunt)
			          {
					  case 11:if(temp<5)
							  temp=6;
					          break;
					  case 21:if(temp>1)
							  temp=1;
					          break;
					  case 31:if(temp>1)
	                          temp=1;
	                          break;
					  case 41:if(temp<2)
							  temp=10;
					          break;
					  case 51:if(temp<5)
							  temp=100;
					          break;
					  default:break;
					  }
					  LCD_Seek12(temp,1);
				  }
				  else
		           LCD_PassWord(4);
		          break;
		   default:break;
		   }
		}
	 }
	 //////////////////////////
	 else if(seek == 16 && Star_EN == 1)
	 {
	    switch(EM_ModeCMD)
		 {
		 case 0:
					EM_VoltCMD--;
					if(EM_VoltCMD<EM_VoltMinCMD||EM_VoltCMD>EM_VoltMaxCMD)
			      EM_VoltCMD=EM_VoltMinCMD;
					break;
		 case 1:
					EM_CurrCMD--;
					if(EM_CurrCMD<EM_CurrMinCMD||EM_CurrCMD>EM_CurrMaxCMD)
			      EM_CurrCMD=EM_CurrMinCMD;
					break;
		 case 2:
					EM_AnglCMD--;
					if(EM_AnglCMD<EM_AnglMinCMD||EM_AnglCMD>EM_AnglMaxCMD)
			      EM_AnglCMD=EM_AnglMinCMD;
					break;
		 case 3:
					EM_PwrFactCMD--;
					if(EM_PwrFactCMD<EM_PwrFactMinCMD)
			      EM_PwrFactCMD=EM_PwrFactMinCMD;
					break;
		 case 4:
					EM_NulPwrCMD--;
					if(EM_NulPwrCMD<EM_NulPwrMinCMD||EM_NulPwrCMD>EM_NulPwrMaxCMD)
		         EM_NulPwrCMD=EM_NulPwrMinCMD;
					break;
		 default:break;
		 }
	 }
	 //////////////////////////
	 DownKeyEvt=0;
  }
////////////////////////////////////////////////////////////////////////////////////  
////////////////////////////////////////////////////////////////////////////////////  
////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////
	 
  if(LeftKeyEvt)//left
  {
     HI_Bell=1;
	  LCD_BLED=1;
	  DmsNum=0;
	  PressKeyEvt=1;
     ///////////////////////////
     if(seek==4&&hunt==73)
	 {
	    EM_speed=EM_speed-1;
	    if(EM_speed==0)
	    EM_speed=1;
	    LCD_Seek4(EM_speed,0);
	 }
	 /////////////////
	 else if(seek==6)
	 {
        hunt=hunt-10;
		if(hunt==0)
		hunt=40;
	    LCD_Seek6(hunt);
	 }
     /////////////////
     else if(seek==7)
	 {
		if(hunt>10&&hunt<20)
		{
			hunt=hunt-1;
			if(hunt==10)
			hunt=16;
			LCD_Seek7(0,1);
		}
	 }
	 /////////////////
     else if(seek==8)
	 {
	    hunt=hunt-1;
		if(hunt==0)
		hunt=6;
		LCD_CAstr(64,8,"* * * * * *",0,0);
	    switch(hunt)
	    {
	    case 1:LCD_CAstr(64,8,"*",1,0);
	           break;
	    case 2:LCD_CAstr(80,8,"*",1,0);
		       break;
	    case 3:LCD_CAstr(96,8,"*",1,0);
		       break;
	    case 4:LCD_CAstr(112,8,"*",1,0);
		       break;
	    case 5:LCD_CAstr(128,8,"*",1,0);
		       break;
	    case 6:LCD_CAstr(144,8,"*",1,0);
		       break;
	    default:break;
	    }
	 }
	 ////////////////
	 else if(seek==9)
	 {
	    hunt=hunt-1;
		if(hunt==0)
		hunt=2;
	    switch(hunt)
	    {
	    case 1:LCD_CAstr(160,8,"No",0,0);
		       LCD_CAstr(128,8,"Yes",1,0);
		       break;
	    case 2:LCD_CAstr(160,8,"No",1,0);
		       LCD_CAstr(128,8,"Yes",0,0);
		       break;
	    default:break;
	    }
	 }
     ////////////////
	 else if(seek==11)
	 {
	    if(hunt%10==0)
	    {
		page=page-1;
		if(page==0)
		page=5;
		LCD_Stat1();
		}
		else if(page==4)
		   LCD_PassWord(5);

	 }
	 /////////////////////
	 else if(seek==12)
	 {
	    if(hunt%10==0)
		{
	    page=page-1;
		if(page==0)
		page=5;
		LCD_Stat2();
		}
		else if(page==5)
		   LCD_PassWord(5);
	 }
	 /////////////////////
	 else if(seek==16)
	 {
		page=page-1;
		if(ErrorTemp==0&&page<1)
		   page=2;
		else if(ErrorTemp!=0&&page<1)
		   page=3;
		Menue(16);
	 }
	 //////////////////////
  LeftKeyEvt=0;
  }
//////////////////////////////////////////////////////////////////////////////////////////  
//////////////////////////////////////////////////////////////////////////////////////////  
//////////////////////////////////////////////////////////////////////////////////////////  
//////////////////////////////////////////////////////////////////////////////////////////
	if(RightKeyEvt)//right
	{
		HI_Bell=1;
		LCD_BLED=1;
		DmsNum=0;
		PressKeyEvt=1;
	   /////////////////////////////
		if(seek==4&&hunt==73)
		{
			EM_speed=EM_speed+1;
			if(EM_speed==7)
			EM_speed=6;
			LCD_Seek4(EM_speed,0);
	   }
     ////////////////
		else if(seek==6)
		{
			hunt=hunt+10;
			if(hunt==50)
			hunt=10;
			LCD_Seek6(hunt);
	   }
	 /////////////////
    else if(seek==7)
	 {
			if(hunt>10&&hunt<20)
			{
				hunt=hunt+1;
				if(hunt==17)
				hunt=11;
				LCD_Seek7(0,1);
			}
	 }
	 /////////////////
    else if(seek==8)
	 {
		hunt=hunt+1;
		if(hunt==7)
		hunt=1;
		LCD_CAstr(64,8,"* * * * * *",0,0);
	    switch(hunt)
	    {
	    case 1:LCD_CAstr(64,8,"*",1,0);
	           break;
	    case 2:LCD_CAstr(80,8,"*",1,0);
		       break;
	    case 3:LCD_CAstr(96,8,"*",1,0);
		       break;
	    case 4:LCD_CAstr(112,8,"*",1,0);
		       break;
	    case 5:LCD_CAstr(128,8,"*",1,0);
		       break;
	    case 6:LCD_CAstr(144,8,"*",1,0);
		       break;
	    default:break;
	    }
	 }
	 ////////////////
	 else if(seek==9)
	 {
	    hunt=hunt+1;
		if(hunt>=3)
		hunt=1;
	    switch(hunt)
	    {
	    case 1:LCD_CAstr(160,8,"No",0,0);
		       LCD_CAstr(128,8,"Yes",1,0);
		       break;
	    case 2:LCD_CAstr(160,8,"No",1,0);
		       LCD_CAstr(128,8,"Yes",0,0);
		       break;
	    default:break;
	    }
	 }
     ////////////////
     else if(seek==11)
	 {
	    if(hunt%10==0)
		{
	    page=page+1;
		if(page==6)
		page=1;
		LCD_Stat1();
		}
		else if(page==4)
		   LCD_PassWord(6);
	 }
	 /////////////////////
	 else if(seek==12)
	 {
	    if(hunt%10==0)
	    {
		page=page+1;
		if(page==6)
		page=1;
		LCD_Stat2();
		}
		else if(page==5)
		   LCD_PassWord(6);
	 }
     ////////////////////
	 else if(seek==16)
	 {
	    page=page+1;
		 if(ErrorTemp==0&&page>2)
		    page=1;
       else if(ErrorTemp!=0&&page>3)
		    page=1;
		 Menue(16);
	 }
	 /////////////////////
    RightKeyEvt=0;
  }
  /////////////////////////////////////////////////////////////////
  /////////////////////////////////////////////////////////////////
  /////////////////////////////////////////////////////////////////

		
}

⌨️ 快捷键说明

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