📄 key.c
字号:
case 31:if(temp>999)
temp=0;
break;
case 41:if(temp>999)
temp=0;
break;
case 51:if(temp>500)
temp=10;
break;
case 61:if(temp>1)
temp=0;
break;
default:break;
}
LCD_Seek11(temp,1);
break;
case 4:if(hunt<60)
{
temp=temp+1;
switch(hunt)
{
case 11:if(temp>2)
temp=0;
break;
case 21:if(temp>330)
temp=EM_VoltCMD;
break;
case 31:if(temp>3000)
temp=EM_CurrCMD;
break;
case 41:if(temp>150)
temp=EM_AnglCMD;
break;
case 51:if(temp>30)
temp=0;
break;
default:break;
}
LCD_Seek11(temp,1);
}
else if(hunt>60)
LCD_PassWord(3);
break;
case 5:temp=temp+1;
switch(hunt)
{
case 11:
if(temp>4)
temp=0;
break;
case 21:
if(temp>EM_VoltMaxCMD)
temp=EM_VoltMinCMD;
break;
case 31:
if(temp>EM_CurrMaxCMD)
temp=EM_CurrMinCMD;
break;
case 41:
if(temp>EM_AnglMaxCMD)
temp=EM_AnglMinCMD;
break;
case 51:
if(temp>EM_PwrFactMaxCMD)
temp=EM_PwrFactMinCMD;
break;
case 61:
if(temp>EM_NulPwrMaxCMD)
temp=EM_NulPwrMinCMD;
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==0)
hunt=60;
LCD_CAstr(8,2*hunt/10,">",0,0);
}
else
{
switch(page)
{
case 1:temp=temp+1;
switch(hunt)
{
case 11:if(temp>8)
temp=1;
break;
case 21:if(temp>10)
temp=1;
break;
case 31:if(temp>30)
temp=5;
break;
case 41:if(temp>100)
temp=0;
break;
case 51:if(temp>10)
temp=1;
break;
case 61:if(temp>145)
temp=135;
break;
default:break;
}
LCD_Seek12(temp,1);
break;
case 2:temp=temp+1;
switch(hunt)
{
case 11:if(temp>100)
temp=1;
break;
case 21:if(temp>100)
temp=1;
break;
case 31:if(temp>100)
temp=1;
break;
case 41:if(temp>100)
temp=1;
break;
case 51:if(temp>100)
temp=1;
break;
case 61:if(temp>100)
temp=1;
break;
default:break;
}
LCD_Seek12(temp,1);
break;
case 3:temp=temp+1;
switch(hunt)
{
case 11:if(temp>20)
temp=5;
break;
case 21:if(temp>80)
temp=5;
break;
case 31:if(temp>5)
temp=0;
break;
case 41:if(temp>100)
temp=2;
break;
case 51:if(temp>10)
temp=2;
break;
case 61:if(temp>50)
temp=1;
break;
default:break;
}
LCD_Seek12(temp,1);
break;
case 4:temp=temp+1;
switch(hunt)
{
case 11:if(temp>10)
temp=1;
break;
case 21:if(temp>120)
temp=0;
break;
case 31:if(temp>100)
temp=0;
break;
case 41:if(temp>10)
temp=2;
break;
case 51:if(temp>10)
temp=5;
break;
case 61:if(temp>6)
temp=4;
break;
default:break;
}
LCD_Seek12(temp,1);
break;
case 5:if(hunt<60)
{
temp=temp+1;
switch(hunt)
{
case 11:if(temp>6)
temp=5;
break;
case 21:if(temp>1)
temp=0;
break;
case 31:if(temp>1)
temp=0;
break;
case 41:if(temp>10)
temp=2;
break;
case 51:if(temp>100)
temp=5;
break;
default:break;
}
LCD_Seek12(temp,1);
}
else
LCD_PassWord(3);
break;
default:break;
}
}
}
////////////////////
else if(seek == 16 && Star_EN == 1)
{
switch(EM_ModeCMD)
{
case 0:
EM_VoltCMD++;
if(EM_VoltCMD>EM_VoltMaxCMD)
EM_VoltCMD=EM_VoltMaxCMD;
break;
case 1:
EM_CurrCMD++;
if(EM_CurrCMD>EM_CurrMaxCMD)
EM_CurrCMD=EM_CurrMaxCMD;
break;
case 2:
EM_AnglCMD++;
if(EM_AnglCMD>EM_AnglMaxCMD)
EM_AnglCMD=EM_AnglMaxCMD;
break;
case 3:
EM_PwrFactCMD++;
if(EM_PwrFactCMD>EM_PwrFactMaxCMD)
EM_PwrFactCMD=EM_PwrFactMaxCMD;
break;
case 4:
EM_NulPwrCMD++;
if(EM_NulPwrCMD>EM_NulPwrMaxCMD)
EM_NulPwrCMD=EM_NulPwrMaxCMD;
break;
default:break;
}
}
/////////////////////
UpKeyEvt=0;
}
//////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////
if(DownKeyEvt)//down
{
HI_Bell=1;
LCD_BLED=1;
DmsNum=0;
PressKeyEvt=1;
if(seek==0)
{
LCD_CAstr(8,2*hunt," ",0,0);
hunt=hunt+1;
if(hunt==8)
hunt=1;
LCD_CAstr(8,2*hunt,">",0,0);
}
//////////////////////
else if(seek==1)
{
LCD_CAstr(8,2*hunt/10," ",0,0);
hunt=hunt+10;
if(hunt==30)
hunt=10;
LCD_CAstr(8,2*hunt/10,">",0,0);
}
/////////////////////
else if(seek==2)
{
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
{
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_Seek2(temp,1);
}
}
////////////////////
else if(seek==3)
{
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
{
temp=temp-1;
switch(hunt)
{
case 11:if(temp==0)
temp=99;
LCD_Seek3(temp,1);
break;
case 21:if(temp>9)
temp=9;
LCD_Seek3(temp,1);
break;
case 31:if(temp==0)
temp=3;
LCD_Seek3(temp,1);
break;
case 41:if(temp==0)
temp=3;
LCD_Seek3(temp,1);
break;
case 51:if(temp>1)
temp=1;
if(temp)
LCD_CAstr(152,10,"开",1,0);
else
LCD_CAstr(152,10,"关",1,0);
break;
default:break;
}
}
}
////////////////////
else if(seek==4)
{
if(hunt%10==0)
{
LCD_CAstr(8,2*hunt/10," ",0,0);
hunt=hunt+10;
if(hunt==80)
hunt=10;
LCD_CAstr(8,2*hunt/10,">",0,0);
}
else
{
switch(hunt)
{
case 11:
temp=temp-1;
if(temp==3)
temp=2;
if(temp==0)
temp=4;
LCD_Seek4(temp,1);
break;
case 21:temp=temp-1;
if(temp>1)
temp=1;
LCD_Seek4(temp,1);
break;
case 31:temp=temp-1;
if(temp>1)
temp=1;
LCD_Seek4(temp,1);
break;
case 41:temp=temp-1;
if(temp>1)
temp=1;
LCD_Seek4(temp,1);
break;
case 51:temp=temp-1;
if(temp==0)
temp=5;
LCD_Seek4(temp,1);
break;
case 61:temp=temp-1;
if(temp==0)
temp=5;
LCD_Seek4(temp,1);
break;
case 71:temp=temp-1;
if(temp==0)
temp=7;
LCD_Seek4(temp,1);
break;
case 73:
switch(temp)
{
case 1:
EM_k1=EM_k1-0.1;
if(EM_k1<1)
EM_k1=1;
break;
case 2:
EM_k2=EM_k2-0.1;
if(EM_k2<1)
EM_k2=1;
break;
case 3:
EM_b1=EM_b1+1;
break;
case 4:
EM_b2=EM_b2+1;
break;
default:break;
}
break;
default:break;
}
}
}
///////////////////
else if(seek==7)
{
if(hunt%10==0)
{
if(hunt == 10)
LCD_CAstr(8,2," ",0,0);
else
LCD_CAstr(8,2*hunt/10+4," ",0,0);
hunt=hunt+10;
if(hunt==50)
hunt=10;
if(hunt == 10)
LCD_CAstr(8,2,">",0,0);
else
LCD_CAstr(8,2*hunt/10+4,">",0,0);
}
switch(hunt)
{
case 11:CH1[0]=CH1[0]-1;
if(CH1[0]>99)
CH1[0]=99;
LCD_Seek7(0,1);
break;
case 12:CH1[1]=CH1[1]-1;
if(CH1[1]==0)
CH1[1]=12;
LCD_Seek7(0,1);
break;
case 13:CH1[2]=CH1[2]-1;
if(CH1[2]==0)
CH1[2]=31;
LCD_Seek7(0,1);
break;
case 14:CH1[3]=CH1[3]-1;
if(CH1[3]>23)
CH1[3]=23;
LCD_Seek7(0,1);
break;
case 15:CH1[4]=CH1[4]-1;
if(CH1[4]>59)
CH1[4]=59;
LCD_Seek7(0,1);
break;
case 16:CH1[5]=CH1[5]-1;
if(CH1[5]>59)
CH1[5]=59;
LCD_Seek7(0,1);
break;
case 21:temp=temp-1;
if(temp-5<CloseTemper)
temp=CloseTemper+5;
LCD_Seek7(temp,1);
break;
case 31:temp=temp-1;
if(temp == 0)
temp=1;
LCD_Seek7(temp,1);
break;
case 41:temp=temp-1;
if(temp-5<StartTemper)
temp=StartTemper+5;
LCD_Seek7(temp,1);
break;
default:break;
}
}
///////////////////
else if(seek==8)
{
switch(hunt)
{
case 1:CH1[0]=CH1[0]-1;
if(CH1[0]>9)
CH1[0]=9;
LCD_math(64,8,CH1[0],1);
break;
case 2:CH1[1]=CH1[1]-1;
if(CH1[1]>9)
CH1[1]=9;
LCD_math(80,8,CH1[1],1);
break;
case 3:CH1[2]=CH1[2]-1;
if(CH1[2]>9)
CH1[2]=9;
LCD_math(96,8,CH1[2],1);
break;
case 4:CH1[3]=CH1[3]-1;
if(CH1[3]>9)
CH1[3]=9;
LCD_math(112,8,CH1[3],1);
break;
case 5:CH1[4]=CH1[4]-1;
if(CH1[4]>9)
CH1[4]=9;
LCD_math(128,8,CH1[4],1);
break;
case 6:CH1[5]=CH1[5]-1;
if(CH1[5]>9)
CH1[5]=9;
LCD_math(144,8,CH1[5],1);
break;
default:break;
}
}
///////////////////
else if(seek==11)
{
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
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -