display.c
资源名称:gca-150A.rar [点击查看]
上传用户:jndfzc
上传日期:2014-06-02
资源大小:325k
文件大小:149k
源码类别:
单片机开发
开发平台:
Others
- temp_Line=1;
- for(i=30;i<32;i++)
- {
- if(select==i)
- Bcd_show(0,temp_Erect, temp_Line*16,Channel_Ration_Flag.Temp[i],0,5,0,1);
- else
- Bcd_show(1,temp_Erect, temp_Line*16,Channel_Ration_Flag.Temp[i],0,5,0,1);
- temp_Line++;
- }
- break;
- default:break;
- }
- Frame_Show(temp);
- }
- void YxTime_Value(void)
- {
- if(L_Screen_state!=414)
- {
- L_Screen_state=414;
- menupage=0;
- SubMenuPosition = 0;
- YxTime_Value_Show(menupage,100) ;
- }
- if((Key_UP==0 )&&(L_Key_UP==1))
- {
- L_Key_UP = Key_UP;
- if( menupage== 0) menupage = 1;
- else menupage--;
- YxTime_Value_Show(menupage,100) ;
- }
- if((Key_DOWN==0 )&&(L_Key_DOWN==1))
- {
- L_Key_DOWN = Key_DOWN;
- if( menupage>= 1) menupage = 0;
- else menupage++;
- YxTime_Value_Show(menupage,100) ;
- }
- if((Key_CANCEL==0 )&&(L_Key_CANCEL==1))
- {
- Screen_state =41;
- SubMenuPosition = 0;
- L_Key_CANCEL = Key_CANCEL;
- }
- if((Key_OK==0 )&&(L_Key_OK==1))
- {
- L_Key_OK= Key_OK;
- if(Flag_Password_True==1)
- Screen_state=4141;
- else
- Screen_state=110;
- Returnto_Modify=36;
- }
- }
- void YxTime_Value_Modify(void)
- {
- UC fast_step_flag;
- UC Fast_Step=10;
- if( L_Screen_state != 4141 )
- {
- L_Screen_state = 4141;
- SubMenuPosition=0;
- menupage=0;
- YxTime_Value_Show(menupage,SubMenuPosition) ;
- }
- if(((Key_ADD==0)&&(L_Key_ADD==1))||(Key_ADD_Long==1))
- {
- L_Key_ADD=Key_ADD;
- if(Key_ADD_Long==1) {Key_ADD_Long=0;fast_step_flag=1;}
- if((SubMenuPosition>-1)&&(SubMenuPosition<=10))
- {
- if(System_config[SubMenuPosition+YX1_TIME]>=YXTime_Limit.Up_Limit)
- System_config[SubMenuPosition+YX1_TIME]=YXTime_Limit.Low_Limit;
- else if(fast_step_flag==1)
- System_config[SubMenuPosition+YX1_TIME]+=YXTime_Limit.step_Size*Fast_Step;
- System_config[SubMenuPosition+YX1_TIME]+=YXTime_Limit.step_Size;
- }
- else
- Screen_state=0;
- fast_step_flag=0;
- YxTime_Value_Show(menupage,SubMenuPosition) ;
- }
- if(((Key_SUB==0)&&(L_Key_SUB==1))||(Key_SUB_Long==1))
- {
- L_Key_SUB=Key_SUB;
- if(Key_SUB_Long==1) {Key_SUB_Long=0;fast_step_flag=1;}
- if((SubMenuPosition>-1)&&(SubMenuPosition<=10))
- {
- if((System_config[SubMenuPosition+YX1_TIME]<=YXTime_Limit.Low_Limit)||
- (System_config[SubMenuPosition+YX1_TIME]>=YXTime_Limit.Up_Limit))
- System_config[SubMenuPosition+YX1_TIME]=YXTime_Limit.Up_Limit;
- else if(fast_step_flag==1)
- System_config[SubMenuPosition+YX1_TIME]-=YXTime_Limit.step_Size*Fast_Step;
- System_config[SubMenuPosition+YX1_TIME]-=YXTime_Limit.step_Size;
- }
- else
- Screen_state=0;
- fast_step_flag=0;
- YxTime_Value_Show(menupage,SubMenuPosition) ;
- }
- if((Key_UP==0)&&(L_Key_UP==1))
- {
- L_Key_UP=Key_UP;
- if(SubMenuPosition==0)
- SubMenuPosition=10;
- else
- SubMenuPosition--;
- if((SubMenuPosition==10)||(SubMenuPosition==5))
- { if(menupage==0) menupage = 1;
- else menupage--;
- }
- YxTime_Value_Show(menupage,SubMenuPosition) ;
- }
- if((Key_DOWN==0)&&((L_Key_DOWN==1)))
- {
- L_Key_DOWN=Key_DOWN;
- if(SubMenuPosition>=10)
- SubMenuPosition=0;
- else
- SubMenuPosition++;
- if((SubMenuPosition==6)||(SubMenuPosition==0))
- { if( menupage>= 1) menupage = 0;
- else menupage++;
- }
- YxTime_Value_Show(menupage,SubMenuPosition) ;
- }
- if((Key_OK==0)&&(L_Key_OK==1))
- {
- L_Key_OK=Key_OK;
- Screen_state =41;
- Returnto_Save=30;
- SubMenuPosition=0;
- SubMenuPosition_temp=0;
- }
- }
- void YxTime_Value_Show(UC page,UC select)
- { UC i,temp=0;
- cls();
- Logo_Title();
- LCDPrintf( 0,0,0,"肆遥信参数",12);
- for(i=0;i<6;i++)
- LCDPrintf( 1,1,(i+1)*16,(char *)YxTime_Text[page*6+i],20);
- switch(page)
- {
- case 0:
- for(i=0;i<6;i++)
- {
- if(select==i)
- {
- Bcd_show(0,6, ((i+1)*16),System_config[i+YX1_TIME],0,6,0,1);
- }
- else
- {
- Bcd_show(1,6, ((i+1)*16),System_config[i+YX1_TIME],0,6,0,1);
- }
- }
- temp=3;
- break;
- case 1:
- for(i=6;i<11;i++)
- {
- if(select==i)
- {
- Bcd_show(0,6, ((i-6+1)*16),System_config[i+YX1_TIME],0,6,0,1);
- }
- else
- {
- Bcd_show(1,6, ((i-6+1)*16),System_config[i+YX1_TIME],0,6,0,1);
- }
- }
- temp=1;
- break;
- default:
- break;
- }
- Frame_Show(temp);
- }
- //系统信息/端口信息
- void Comm_Information(void)
- {
- if(L_Screen_state!=416)
- {
- L_Screen_state=416;
- SubMenuPosition = 0; menupage=0;
- switch(System_config[RS485_BAUD])
- {
- case 2400:
- Rs485_Baud=0;
- break;
- case 4800:
- Rs485_Baud=1;
- break;
- case 9600:
- Rs485_Baud=2;
- break;
- case 19200:
- Rs485_Baud=3;
- break;
- default:
- Rs485_Baud=2;
- break;
- }
- Comm_Information_Show(menupage,100) ;
- }
- if((Key_UP==0 )&&(L_Key_UP==1))
- {
- L_Key_UP = Key_UP;
- if( menupage== 0) { menupage = 1;}
- else { menupage=0;}
- Comm_Information_Show(menupage,100) ;
- }
- if((Key_DOWN==0 )&&(L_Key_DOWN==1))
- {
- L_Key_DOWN = Key_DOWN;
- if( menupage>= 1) { menupage = 0;}
- else { menupage=1;}
- Comm_Information_Show(menupage,100) ;
- }
- if((Key_CANCEL==0 )&&(L_Key_CANCEL==1))
- {
- Screen_state =41;
- SubMenuPosition = 0;
- L_Key_CANCEL = Key_CANCEL;
- }
- if((Key_OK==0 )&&(L_Key_OK==1))
- {
- L_Key_OK= Key_OK;
- if(Flag_Password_True==1)
- Screen_state=4161;
- else
- Screen_state=110;
- Returnto_Modify=38;
- }
- }
- void Comm_Information_Modify(void)//
- {
- if( L_Screen_state != 4161 )
- {
- L_Screen_state = 4161;
- menupage=0;
- SubMenuPosition=0;
- Comm_Information_Show(menupage,SubMenuPosition) ;
- }
- if((Key_ADD==0)&&(L_Key_ADD==1))
- {
- L_Key_ADD=Key_ADD;
- switch(SubMenuPosition)
- {
- case 0:
- if(System_config[RS485_ADDR]>254) System_config[RS485_ADDR]=0;
- else System_config[RS485_ADDR]++;
- break;
- case 1:
- switch(System_config[RS485_BAUD])
- {
- case 2400:
- Rs485_Baud=0;
- break;
- case 4800:
- Rs485_Baud=1;
- break;
- case 9600:
- Rs485_Baud=2;
- break;
- case 19200:
- Rs485_Baud=3;
- break;
- default:
- Rs485_Baud=2;
- break;
- }
- if (Rs485_Baud>=3) Rs485_Baud=0;
- else Rs485_Baud++;
- break;
- default:
- break;
- };
- Comm_Information_Show(menupage,SubMenuPosition) ;
- }
- if((Key_SUB==0)&&(L_Key_SUB==1))
- {
- L_Key_SUB=Key_SUB;
- switch(SubMenuPosition)
- {
- case 0:
- if(System_config[RS485_ADDR]==0) System_config[RS485_ADDR]=255;
- else System_config[RS485_ADDR]--;
- break;
- case 1:
- switch(System_config[RS485_BAUD])
- {
- case 2400:
- Rs485_Baud=0;
- break;
- case 4800:
- Rs485_Baud=1;
- break;
- case 9600:
- Rs485_Baud=2;
- break;
- case 19200:
- Rs485_Baud=3;
- break;
- default:
- Rs485_Baud=2;
- break;
- }
- if (Rs485_Baud==0) Rs485_Baud=3;
- else Rs485_Baud--;
- break;
- default:
- break;
- };
- Comm_Information_Show(menupage,SubMenuPosition) ;
- }
- if((Key_UP==0)&&(L_Key_UP==1))
- {
- L_Key_UP=Key_UP;
- if(SubMenuPosition==0)
- SubMenuPosition=1;
- else
- SubMenuPosition--;
- Comm_Information_Show(menupage,SubMenuPosition) ;
- }
- if((Key_DOWN==0)&&((L_Key_DOWN==1)))
- {
- L_Key_DOWN=Key_DOWN;
- if(SubMenuPosition>=1)
- SubMenuPosition=0;
- else
- SubMenuPosition++;
- Comm_Information_Show(menupage,SubMenuPosition) ;
- }
- if((Key_OK==0)&&(L_Key_OK==1))
- {
- L_Key_OK=Key_OK;
- Screen_state =41;
- Returnto_Save=30;
- SubMenuPosition=0;
- SubMenuPosition_temp=0;
- }
- }
- void Comm_Information_Show(UC page,UC select)
- { UC i,temp=0;
- UC temp_Erect=8,temp_Line=2;
- cls();Logo_Title();
- LCDPrintf( 0,0,0,"肆端口信息",12);
- for(i=0;i<6;i++)
- LCDPrintf( 1,1,(i+1)*16,(char *)Comm_Text[i+6*page],20);
- switch(page)
- { case 0:
- temp=3;
- for(i=0;i<5;i++)
- LCDPrintf(1, (i+temp_Erect),temp_Line*16, " ", 5);
- if(select==0)
- Bcd_show(0, temp_Erect, temp_Line*16, System_config[RS485_ADDR], 0, 5, 0,1);
- else
- Bcd_show(1, temp_Erect, temp_Line*16, System_config[RS485_ADDR], 0, 5, 0,1);
- for(i=0;i<5;i++)
- LCDPrintf(1, (i+9), 48, " ", 5);
- switch(Rs485_Baud)
- {
- case 0:
- System_config[RS485_BAUD]=2400;
- break;
- case 1:
- System_config[RS485_BAUD]=4800;
- break;
- case 2:
- System_config[RS485_BAUD]=9600;
- break;
- case 3:
- System_config[RS485_BAUD]=19200;
- break;
- default:
- break;
- }
- temp_Line++;
- if(select==1)
- Bcd_show(0, temp_Erect, temp_Line*16, System_config[RS485_BAUD], 0, 5, 0,1);
- else
- Bcd_show(1, temp_Erect, temp_Line*16, System_config[RS485_BAUD], 0, 5, 0,1);
- break;
- default:break;
- }
- Frame_Show(temp);
- }
- //*****************时间设置****************************
- void ReadTime(void)//用10进制格式
- {
- if(realtime.second>59)
- realtime1.second=0;
- else
- realtime1.second =realtime.second;
- if(realtime.minute>59)
- realtime1.minute=0;
- else
- realtime1.minute= realtime.minute;
- if( realtime.hour>23)
- realtime1.hour=0;
- else
- realtime1.hour=realtime.hour;
- if(realtime.day>31)
- realtime1.day=1;
- else
- realtime1.day= realtime.day;
- if(realtime.month>12)
- realtime1.month=1;
- else
- realtime1.month = realtime.month;
- if(realtime.year>99)
- realtime1.year=04;
- else
- realtime1.year = realtime.year;
- }
- //------------------------时间状态条显示-----------------------------------
- void State_Time_Show(void)
- {
- Bcd_show(1,1,112,realtime1.month,0,0,0,2);
- LCDPrintf(1, 3, 112,"-",1);
- Bcd_show(1,4,112,realtime1.day,0,0,0,2);
- Bcd_show(1,10,112,realtime1.hour,0,0,0,2);
- LCDPrintf(1, 12, 112, ":",1);
- Bcd_show(1,13,112,realtime1.minute,0,0,0,2);
- //if(System_Info.Charge>=17999) LCDPrintf(1, 8, 112, "甸",1);//充电满
- // else LCDPrintf(1, 8, 112, "倥",1);//充电未满
- display_sqr(0,15,113,127,0x80,0x01);
- }
- void Show_Time(UC select)
- {
- if(select==0)
- Bcd_show(0,5,72,realtime1.year,0,5,0,2);
- else
- Bcd_show(1,5,72,realtime1.year,0,5,0,2);
- if(select==1)
- Bcd_show(0,8,72,realtime1.month,0,5,0,2);
- else
- Bcd_show(1,8,72,realtime1.month,0,5,0,2);
- if(select==2)
- Bcd_show(0,11,72,realtime1.day,0,5,0,2);
- else
- Bcd_show(1,11,72,realtime1.day,0,5,0,2);
- if(select==3)
- Bcd_show(0,4,88,realtime1.hour,0,5,0,2);
- else
- Bcd_show(1,4,88,realtime1.hour,0,5,0,2);
- if(select==4)
- Bcd_show(0,7,88,realtime1.minute,0,5,0,2);
- else
- Bcd_show(1,7,88,realtime1.minute,0,5,0,2);
- if(select==5)
- Bcd_show(0,10,88,realtime1.second,0,5,0,2);
- else
- Bcd_show(1,10,88,realtime1.second,0,5,0,2);
- }
- //系统信息/时间修改
- void Clock_Modify(void)
- {
- UC i;
- if( L_Screen_state != 418 )
- {
- L_Screen_state = 418;
- SubMenuPosition=0;
- for(i=4;i<7;i++)
- LCDPrintf(1, 1,( i*16), " ", 20);
- LCDPrintf(1, 3, 72, "20 - - ", 20);
- LCDPrintf(1, 3, 88, " : : ", 20);
- display_sqr(1, 14, 64,110,0x80,0x03);
- LineX(1, 112, 14);
- Show_Time(SubMenuPosition) ;
- }
- if((Key_ADD==0)&&(L_Key_ADD==1))
- {
- L_Key_ADD=Key_ADD;
- time_modify_flag=1;
- switch(SubMenuPosition)
- {
- case 0:
- if(realtime1.year>=99) realtime1.year=4;
- else realtime1.year++;
- break;
- case 1:
- if(realtime1.month>=12) realtime1.month=1;
- else realtime1.month++;
- break;
- case 2:
- if(realtime1.day>=31) realtime1.day=1;
- else realtime1.day++;
- break;
- case 3:
- if(realtime1.hour>=23) realtime1.hour=0;
- else realtime1.hour++;
- break;
- case 4:
- if(realtime1.minute>=59) realtime1.minute=0;
- else realtime1.minute++;
- break;
- case 5:
- if(realtime1.second>=59) realtime1.second=0;
- else realtime1.second++;
- break;
- default:
- break;
- };
- Show_Time(SubMenuPosition) ;
- }
- if((Key_SUB==0)&&(L_Key_SUB==1))
- {
- L_Key_SUB=Key_SUB;
- time_modify_flag=1;
- switch(SubMenuPosition)
- {
- case 0:
- if(realtime1.year<=4) realtime1.year=99;
- else realtime1.year--;
- break;
- case 1:
- if(realtime1.month<=1) realtime1.month=12;
- else realtime1.month--;
- break;
- case 2:
- if(realtime1.day<=1) realtime1.day=31;
- else realtime1.day--;
- break;
- case 3:
- if(realtime1.hour==0) realtime1.hour=23;
- else realtime1.hour--;
- break;
- case 4:
- if(realtime1.minute==0) realtime1.minute=59;
- else realtime1.minute--;
- break;
- case 5:
- if(realtime1.second==0) realtime1.second=59;
- else realtime1.second--;
- break;
- default:
- break;
- };
- Show_Time(SubMenuPosition) ;
- }
- if((Key_LEFT==0)&&(L_Key_LEFT==1))
- {
- L_Key_LEFT=Key_LEFT;
- if(SubMenuPosition==0)
- SubMenuPosition=5;
- else
- SubMenuPosition--;
- Show_Time(SubMenuPosition) ;
- }
- if((Key_RIGHT==0)&&((L_Key_RIGHT==1)))
- {
- L_Key_RIGHT=Key_RIGHT;
- if(SubMenuPosition==5)
- SubMenuPosition=0;
- else
- SubMenuPosition++;
- Show_Time(SubMenuPosition) ;
- }
- if((Key_CANCEL==0)&&(L_Key_CANCEL==1))
- {
- L_Key_CANCEL=Key_CANCEL;
- Screen_state =41;
- SubMenuPosition=0;
- time_modify_flag=0;
- }
- if((Key_OK==0)&&(L_Key_OK==1))
- {
- L_Key_OK=Key_OK;
- Screen_state =120;
- Returnto_Save=6;
- SubMenuPosition=0;
- SubMenuPosition_temp=0;
- }
- }
- void ConfigValue_Init(void)
- {
- UC i;
- if(L_Screen_state!=419)
- {
- L_Screen_state=419;
- Dlg_Frame_View();
- LCDPrintf(1, 3, 72, "写系统配置", 10);
- }
- if((Key_OK==0 )&&(L_Key_OK==1))
- {
- L_Key_OK = Key_OK;
- Screen_state =119;
- Returnto_Save=133;
- for(i=0;i<CONFIG_NUM;i++)
- System_config[i]=Config_Init[i];
- SubMenuPosition = 0;
- SubMenuPosition_temp=0;
- }
- }
- //*********************************系统信息结束****************************************
- //--------------------------------------控制操作---------------------------------------------------------
- //遥分操作
- //遥合操作
- //开出传动
- //压板投退
- //与PC通信
- //装置复归
- void System_Test(void)
- {
- UC i;
- if(L_Screen_state!=51)
- {
- L_Screen_state=51;
- cls();
- Logo_Title();
- LCDPrintf( 0,0,0,(char *)(&mainMenu[4][0]),10);
- for(i=0;i<6;i++)
- LCDPrintf( 1,1,(i+1)*16,(char *)secondMenu_systest[i],20);
- SubMenuPosition = Father2_MenuPosition;
- if(SubMenuPosition>5) SubMenuPosition=0;
- LCDPrintf( 0,1,(SubMenuPosition+1)*16,(char *)secondMenu_systest[SubMenuPosition],20);
- Frame_Show(0);
- }
- if((Key_UP==0 )&&(L_Key_UP==1))
- {
- L_Key_UP = Key_UP;
- LCDPrintf( 1,1,(SubMenuPosition+1)*16,(char *)secondMenu_systest[SubMenuPosition],20);
- if( SubMenuPosition == 0) SubMenuPosition = 5;
- else SubMenuPosition--;
- LCDPrintf( 0,1,(SubMenuPosition+1)*16,(char *)secondMenu_systest[SubMenuPosition],20);
- Frame_Show(0);
- }
- if((Key_DOWN==0 )&&(L_Key_DOWN==1))
- {
- L_Key_DOWN = Key_DOWN;
- LCDPrintf( 1,1,(SubMenuPosition+1)*16,(char *)secondMenu_systest[SubMenuPosition],20);
- if( SubMenuPosition == 5) SubMenuPosition = 0;
- else SubMenuPosition++;
- LCDPrintf( 0,1,(SubMenuPosition+1)*16,(char *)secondMenu_systest[SubMenuPosition],20);
- Frame_Show(0);
- }
- if((Key_OK==0 )&&(L_Key_OK==1))
- {
- L_Key_OK= Key_OK;
- Father2_MenuPosition=SubMenuPosition;
- Father3_MenuPosition=0;
- Father3_page=0;
- SubMenuPosition_temp=0;
- switch(SubMenuPosition)
- {
- case 0://开出传动
- case 1: //压板投退
- case 2://与PC通信
- case 3://装置复归
- Screen_state=513+SubMenuPosition;
- break;
- default: break;
- }
- }
- if((Key_CANCEL==0 )&&(L_Key_CANCEL==1))
- {
- Screen_state =1;
- Flag_Password_True=0;
- SubMenuPosition = 0;
- L_Key_CANCEL = Key_CANCEL;
- }
- }
- //控制操作/遥分操作
- //控制操作/遥合操作
- //控制操作/开出传动
- //控制操作/开出传动
- void Output_Test(void)
- {
- if(L_Screen_state!=513)
- {
- L_Screen_state=513;
- SubMenuPosition = 0;
- SubMenuPosition_temp=0;
- menupage=0;
- Outport_Test_Show(menupage, 100);
- }
- if((Key_UP==0 )&&(L_Key_UP==1))
- {
- L_Key_UP = Key_UP;
- if( menupage== 0) menupage = 2;
- else menupage--;
- Outport_Test_Show(menupage, 100);
- }
- if((Key_DOWN==0 )&&(L_Key_DOWN==1))
- {
- L_Key_DOWN = Key_DOWN;
- if( menupage>= 2) menupage = 0;
- else menupage++;
- Outport_Test_Show(menupage, 100);
- }
- if((Key_CANCEL==0 )&&(L_Key_CANCEL==1))
- {
- Screen_state =51;
- SubMenuPosition = 0;
- L_Key_CANCEL = Key_CANCEL;
- }
- if((Key_OK==0 )&&(L_Key_OK==1))
- {
- L_Key_OK= Key_OK;
- if(Flag_Password_True==1)
- Screen_state=5131;
- else
- Screen_state=110;//密码管理
- Returnto_Modify=50;
- }
- }
- void Output_Test_Modify(void)
- {
- if(L_Screen_state!=5131)
- {
- L_Screen_state=5131;
- SubMenuPosition = Father3_MenuPosition;
- SubMenuPosition_temp=0;
- menupage=Father3_page;
- if(menupage>2)menupage=0;
- if(SubMenuPosition>14) SubMenuPosition=0;
- Outport_Test_Show(menupage, SubMenuPosition);
- }
- if((Key_UP==0)&&(L_Key_UP==1))
- {
- L_Key_UP=Key_UP;
- if(SubMenuPosition==0)
- SubMenuPosition=14;
- else
- SubMenuPosition--;
- if(( SubMenuPosition==5)||(SubMenuPosition==11)||(SubMenuPosition==14))
- { if(menupage==0) menupage = 2;
- else menupage--;
- }
- Outport_Test_Show(menupage, SubMenuPosition);
- }
- if((Key_DOWN==0 )&&(L_Key_DOWN==1))
- {
- L_Key_DOWN = Key_DOWN;
- if(SubMenuPosition>=14)
- SubMenuPosition=0;
- else
- SubMenuPosition++;
- if(( SubMenuPosition==0)||(SubMenuPosition==6)||(SubMenuPosition==12))
- { if(menupage==2) menupage = 0;
- else menupage++;
- }
- Outport_Test_Show(menupage, SubMenuPosition);
- }
- if((Key_CANCEL==0 )&&(L_Key_CANCEL==1))
- {
- Screen_state =51;
- SubMenuPosition = 0;
- L_Key_CANCEL = Key_CANCEL;
- }
- if((Key_OK==0 )&&(L_Key_OK==1))
- {
- L_Key_OK= Key_OK;
- Father3_MenuPosition=SubMenuPosition;
- Father3_page=menupage;
- Output_Select_Flag=1;
- if(SubMenuPosition<=15)
- Returnto_Save=SubMenuPosition+12;
- Screen_state =119;
- SubMenuPosition_temp=0;
- }
- }
- void Outport_Test_Show(UC page,UC select)
- { UC i,temp;
- cls();
- Logo_Title();
- LCDPrintf( 0,0,0,"伍开出传动",10);
- // LineY(7, 16, 111,0x05);
- switch(page)
- {
- case 0:
- temp=3;
- for(i=0;i<6;i++)
- {
- if(select==i)
- LCDPrintf( 0,1,(i+1)*16,(char *)ThirdMenu_output1[i],20);
- else
- LCDPrintf( 1,1,(i+1)*16,(char *)ThirdMenu_output1[i],20);
- }
- break;
- case 1:
- temp=3;
- for(i=6;i<12;i++)
- {
- if(select==i)
- LCDPrintf( 0,1,(i-6+1)*16,(char *)ThirdMenu_output1[i],20);
- else
- LCDPrintf( 1,1,(i-6+1)*16,(char *)ThirdMenu_output1[i],20);
- }
- break;
- case 2:
- temp=1;
- for(i=12;i<18;i++)
- {
- if(select==i)
- LCDPrintf( 0,1,(i-12+1)*16,(char *)ThirdMenu_output1[i],20);
- else
- LCDPrintf( 1,1,(i-12+1)*16,(char *)ThirdMenu_output1[i],20);
- }
- break;
- default: break;
- }
- Frame_Show(temp);
- }
- void Yaban_Control(void)
- {
- if(L_Screen_state!=514)
- {
- L_Screen_state=514;
- SubMenuPosition = 0; menupage=0;
- YYB_Modify_Flag.YYB_temp=System_Info.YB_Soft;
- Yaban_Control_Show(menupage,100) ;
- }
- if((Key_UP==0 )&&(L_Key_UP==1))
- {
- L_Key_UP = Key_UP;
- if( menupage== 0) menupage = 3;
- else menupage--;
- Yaban_Control_Show(menupage,100) ;
- }
- if((Key_DOWN==0 )&&(L_Key_DOWN==1))
- {
- L_Key_DOWN = Key_DOWN;
- if( menupage>= 3) menupage = 0;
- else menupage++;
- Yaban_Control_Show(menupage,100) ;
- }
- if((Key_CANCEL==0 )&&(L_Key_CANCEL==1))
- {
- Screen_state =51;
- SubMenuPosition = 0;
- L_Key_CANCEL = Key_CANCEL;
- }
- if((Key_OK==0 )&&(L_Key_OK==1))
- {
- L_Key_OK= Key_OK;
- if(Flag_Password_True==1)
- {Screen_state=5141;}
- else
- Screen_state=110;//密码管理
- Returnto_Modify=51;
- }
- }
- void Yaban_Control_Modify(void)
- { UI temp_bit;
- if( L_Screen_state != 5141)
- {
- L_Screen_state = 5141;
- SubMenuPosition=0;
- menupage=0;SubMenuPosition_temp=0;
- Yaban_Control_Show(menupage,SubMenuPosition) ;
- }
- if(((Key_ADD==0)&&(L_Key_ADD==1))||((Key_SUB==0)&&(L_Key_SUB==1)))
- {
- L_Key_ADD=Key_ADD;
- L_Key_SUB=Key_SUB;
- { temp_bit=YB_D(SubMenuPosition);
- if((YYB_Modify_Flag.YYB_temp&temp_bit)==temp_bit)
- YYB_Modify_Flag.YYB_temp=YYB_Modify_Flag.YYB_temp&(~temp_bit);
- else YYB_Modify_Flag.YYB_temp=YYB_Modify_Flag.YYB_temp|temp_bit;
- }
- Yaban_Control_Show(menupage,SubMenuPosition) ;
- }
- if((Key_UP==0)&&(L_Key_UP==1))
- {
- L_Key_UP=Key_UP;
- if(SubMenuPosition==0)
- SubMenuPosition=19;
- else
- SubMenuPosition--;
- if((SubMenuPosition%5==4))
- { if(menupage==0) {menupage = 3;}
- else { menupage--;}
- }
- Yaban_Control_Show(menupage,SubMenuPosition) ;
- }
- if((Key_DOWN==0)&&((L_Key_DOWN==1)))
- {
- L_Key_DOWN=Key_DOWN;
- if(SubMenuPosition>=19)
- SubMenuPosition=0;
- else
- SubMenuPosition++;
- if((SubMenuPosition%5==0))
- { if( menupage>= 3) menupage = 0;
- else menupage++;
- }
- Yaban_Control_Show(menupage,SubMenuPosition) ;
- }
- if((Key_OK==0)&&(L_Key_OK==1))
- {
- L_Key_OK=Key_OK;
- Screen_state =119;
- Returnto_Save=51;
- SubMenuPosition=0;
- SubMenuPosition_temp=0;
- }
- }
- /*++++++++++++++++++++++++++++++++====*/
- void Yaban_Control_Show(UC page,UC select )//压板
- {
- UC temp_Erect=13,temp_Line=0;
- UC i,temp=0;
- cls();Logo_Title();
- LCDPrintf( 0,0,0,"伍压板投退",10);
- for(i=0;i<6;i++)
- LCDPrintf( 1,1,(i+1)*16,(char *)ThirdMenu_yaban[i+6*page],20);
- switch(page)
- {
- case 0:
- temp=3;
- temp_Line=2;
- for(i=0;i<5;i++)
- {
- if(select==i)
- Control_Word_Show(0,temp_Erect, temp_Line*16,(YYB_Modify_Flag.YYB_temp&YB_D(i)) , 4);
- else
- Control_Word_Show(1,temp_Erect, temp_Line*16,(YYB_Modify_Flag.YYB_temp&YB_D(i)) , 4);
- temp_Line++;
- }
- break;
- case 1:
- temp=2;
- temp_Line=2;
- for(i=5;i<10;i++)
- {
- if(select==i)
- Control_Word_Show(0,temp_Erect, temp_Line*16,(YYB_Modify_Flag.YYB_temp&YB_D(i)) , 4);
- else
- Control_Word_Show(1,temp_Erect, temp_Line*16,(YYB_Modify_Flag.YYB_temp&YB_D(i)) , 4);
- temp_Line++;
- }
- break;
- case 2:
- temp=2;
- temp_Line=2;
- for(i=10;i<15;i++)
- {
- if(select==i)
- Control_Word_Show(0,temp_Erect, temp_Line*16,(YYB_Modify_Flag.YYB_temp&YB_D(i)) , 4);
- else
- Control_Word_Show(1,temp_Erect, temp_Line*16,(YYB_Modify_Flag.YYB_temp&YB_D(i)) , 4);
- temp_Line++;
- }
- break;
- case 3:
- temp=1;
- temp_Line=2;
- for(i=15;i<20;i++)
- {
- if(select==i)
- Control_Word_Show(0,temp_Erect, temp_Line*16,(YYB_Modify_Flag.YYB_temp&YB_D(i)) , 4);
- else
- Control_Word_Show(1,temp_Erect, temp_Line*16,(YYB_Modify_Flag.YYB_temp&YB_D(i)) , 4);
- temp_Line++;
- }
- break;
- default:
- break;
- }
- Frame_Show(temp);
- }
- void PC_Com(void)
- {
- //int i;
- if(L_Screen_state!=515)
- {
- cls();
- L_Screen_state=515;
- Logo_Title();
- LCDPrintf( 0,0,0,"伍与PC通信",10);
- Comm_bmp_View();
- if(SubMenuPosition>4) SubMenuPosition = 0;
- PC_Comm_Flag=1;/*与pc通信调试标志*/
- Frame_Show(0);
- }
- if((Key_CANCEL==0 )&&(L_Key_CANCEL==1))
- {
- Screen_state =51;
- SubMenuPosition = 0;
- PC_Comm_Flag=0;/*与pc通信调试标志*/
- L_Key_CANCEL = Key_CANCEL;
- }
- }
- void System_Reset(void)
- {
- if(L_Screen_state!=516)
- {
- L_Screen_state=516;
- Dalog_Info_Show(0, 3, 0);
- }
- if((Key_CANCEL==0 )&&(L_Key_CANCEL==1))
- {
- Screen_state =51;
- L_Key_CANCEL = Key_CANCEL;
- }
- if((Key_OK==0 )&&(L_Key_OK==1))
- {
- L_Key_OK= Key_OK;
- MMI_DSP_Instruction(0x1300, 0, 0);
- SubMenuPosition=0;SubMenuPosition_temp=0;
- menupage=0;Father1_MenuPosition=0;
- Father2_MenuPosition=0;
- Father3_MenuPosition=0;
- Father2_page=0;
- Father3_page=0;
- Screen_state=0;
- }
- }
- //*****************************控制操作结束**************************************
- //---------------------------------帮助信息----------------------------------------------------
- //产品简介
- //使用指南
- //联系方式
- //功能配置
- //版本信息
- //系统状态
- void System_Help(void)
- {
- if(L_Screen_state!=61)
- {
- L_Screen_state=61;
- SubMenuPosition=0;
- System_Help_show(SubMenuPosition);
- }
- if((Key_UP==0 )&&(L_Key_UP==1))
- {
- L_Key_UP = Key_UP;
- if( SubMenuPosition == 0) SubMenuPosition = 5;
- else SubMenuPosition--;
- System_Help_show(SubMenuPosition);
- }
- if((Key_DOWN==0 )&&(L_Key_DOWN==1))
- {
- L_Key_DOWN = Key_DOWN;
- if( SubMenuPosition == 5) SubMenuPosition = 0;
- else SubMenuPosition++;
- System_Help_show(SubMenuPosition);
- }
- if((Key_OK==0 )&&(L_Key_OK==1))
- {
- L_Key_OK = Key_OK;
- // Father2_MenuPosition=SubMenuPosition;
- if(SubMenuPosition<6)
- Screen_state =611+SubMenuPosition;
- }
- if((Key_CANCEL==0 )&&(L_Key_CANCEL==1))
- {
- Screen_state =1;
- SubMenuPosition = 0;
- L_Key_CANCEL = Key_CANCEL;
- }
- }
- void System_Help_show(UC select)
- { UC i;
- cls();
- Logo_Title();
- LCDPrintf( 0,0,0,(char *)(&mainMenu[5][0]),10);
- for(i=0;i<6;i++)
- LCDPrintf( 1,1,(i+1)*16,(char *)secondMenu_syshelp[i],20);
- for(i=0;i<6;i++)
- {
- if(select==i)
- LCDPrintf( 0,1,(i+1)*16,(char *)secondMenu_syshelp[i],20);
- else
- LCDPrintf( 1,1,(i+1)*16,(char *)secondMenu_syshelp[i],20);
- }
- Frame_Show(0);
- }
- void Production_Introduction(void)
- { UC i;
- if(L_Screen_state!=611)
- {
- cls();
- L_Screen_state=611;
- Logo_Title();
- LCDPrintf(0,0,0,"陆产品简介",12);
- menupage=0;
- for(i=0;i<6;i++)
- LCDPrintf( 1,1,(i+1)*16,(char *)Production_Text[i],20);
- Frame_Show(0);
- }
- if((Key_CANCEL==0 )&&(L_Key_CANCEL==1))
- {
- Screen_state =61;
- menupage= 0;
- L_Key_CANCEL = Key_CANCEL;
- }
- }
- void User_Manual(void)
- { UC i;
- if(L_Screen_state!=612)
- {
- cls();
- L_Screen_state=612;
- Logo_Title();
- LCDPrintf(0,0,0,"陆使用指南",12);
- for(i=0;i<6;i++)
- LCDPrintf( 1,1,(i+1)*16,(char *)User_Manual_Text[i],20);
- Frame_Show(0);
- }
- if((Key_CANCEL==0 )&&(L_Key_CANCEL==1))
- {
- Screen_state =61;
- SubMenuPosition = 0;
- L_Key_CANCEL = Key_CANCEL;
- }
- }
- void Help_Tel(void)
- { UC i;
- if(L_Screen_state!=613)
- {
- cls();
- L_Screen_state=613;
- Logo_Title();
- LCDPrintf(0,0,0,"陆联系方式",12);
- for(i=0;i<6;i++)
- LCDPrintf( 1,1,(i+1)*16,(char *)Help_Tel_Text[i],20);
- Frame_Show(0);
- }
- if((Key_CANCEL==0 )&&(L_Key_CANCEL==1))
- {
- Screen_state =61;
- SubMenuPosition = 0;
- L_Key_CANCEL = Key_CANCEL;
- }
- }
- //帮助信息/功能配置
- void Function_Introduction(void)
- {
- UC i,temp=0;
- if(L_Screen_state!=614)
- {
- cls();
- L_Screen_state=614;
- Logo_Title();
- LCDPrintf(0,0,0,"肆功能配置",12);
- menupage=0;
- for(i=0;i<6;i++)
- LCDPrintf( 1,1,(i+1)*16,(char *)Function_Text[i],20);
- Frame_Show(3);
- }
- if((Key_UP==0)&&(L_Key_UP==1))
- {
- L_Key_UP=Key_UP;
- if(menupage==0)
- menupage=1;
- else
- menupage--;
- cls();
- Logo_Title();
- LCDPrintf(0,0,0,"肆功能配置",12);
- switch (menupage)
- {
- case 0:
- temp=3;
- break;
- case 1:
- temp=1;
- break;
- case 2:
- case 3:
- temp=1;
- break;
- default:break;
- }
- for(i=0;i<6;i++)
- LCDPrintf( 1,1,(i+1)*16,(char *)Function_Text[i+menupage*6],20);
- Frame_Show(temp);
- }
- if((Key_DOWN==0)&&((L_Key_DOWN==1)))
- {
- L_Key_DOWN=Key_DOWN;
- cls();
- Logo_Title();
- LCDPrintf(0,0,0,"陆产品简介",12);
- if(menupage>=1)
- menupage=0;
- else
- menupage++;
- switch (menupage)
- {
- case 0:
- temp=3;
- break;
- case 1:
- temp=1;
- break;
- case 2:
- case 3:
- temp=1;
- break;
- default:break;
- }
- for(i=0;i<6;i++)
- LCDPrintf( 1,1,(i+1)*16,(char *)Function_Text[i+menupage*6],20);
- Frame_Show(temp);
- }
- if((Key_CANCEL==0 )&&(L_Key_CANCEL==1))
- {
- Screen_state =61;
- menupage= 0;
- L_Key_CANCEL = Key_CANCEL;
- }
- }
- //系统信息/版本信息
- void Version_Show(void)
- {
- UC i;
- if(L_Screen_state!=615)
- {
- cls();
- L_Screen_state=615;
- Logo_Title();
- LCDPrintf(0,0,0,"肆版本信息",12);
- for(i=0;i<5;i++)
- LCDPrintf( 1,1,(i+1)*16,(char *)Version_Text[i],20);
- LCDPrintf( 1,7,2*16,(char *)SoftInformation.Model,8);
- LCDPrintf( 1,7,3*16,(char *)SoftInformation.Ver,6);
- Bcd_show(1,5, 4*16, SoftInformation.Year, 0, 0, 0, 2);
- Bcd_show(1,8, 4*16, SoftInformation.Month, 0, 0, 0, 2);
- Bcd_show(1,11, 4*16, SoftInformation.Day, 0, 0, 0, 2);
- Frame_Show(0);
- }
- if((Key_CANCEL==0 )&&(L_Key_CANCEL==1))
- {
- Screen_state =61;
- SubMenuPosition = 0;
- L_Key_CANCEL = Key_CANCEL;
- }
- }
- //*************************系统状态****************************************
- void System_State_Show(void)
- {UC temp_Line=1;
- if(L_Screen_state!=616)
- {
- L_Screen_state=616;
- cls();
- Logo_Title();
- LCDPrintf(0,0,0,"肆系统状态",12);
- LCDPrintf( 1,1,temp_Line*16,(char *)System_State_Text[0],20);
- temp_Line++;
- /*读取系统状态*/
- if((System_Info.SYS_Statue&0x01)==0x01)//初始化异常
- {temp_Line++;
- LCDPrintf( 1,1,temp_Line*16,(char *)System_State_Text[2],20);
- }
- else if((System_Info.SYS_Statue&0x02)==0x02)//系统参数异常
- {temp_Line++;
- LCDPrintf( 1,1,temp_Line*16,(char *)System_State_Text[3],20);
- }
- else if((System_Info.SYS_Statue&0x04)==0x04)//定值区错
- {temp_Line++;
- LCDPrintf( 1,3,temp_Line*16,(char *)System_State_Text[4],20);
- }
- else if((System_Info.SYS_Statue&0x10)==0x10)//rom出错
- {temp_Line++;
- LCDPrintf( 1,1,temp_Line*16,(char *)System_State_Text[5],20);
- }
- else //正常
- {temp_Line++;
- LCDPrintf( 1,3,temp_Line*16,(char *)System_State_Text[1],20);
- }
- Frame_Show(0);
- }
- if((Key_CANCEL==0 )&&(L_Key_CANCEL==1))
- {
- Screen_state =61;
- SubMenuPosition = 0;
- L_Key_CANCEL = Key_CANCEL;
- }
- }
- //++++++++++++++++++++++++实时运行处理++++++++++++++++++++++++++++++++++
- //时间状态条刷新、面板复归按键处理、刷新标志
- //新的soe处理
- //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++==+
- void RUN_Process(void)
- {
- WrPortE08(LED,(System_Info.LED_Statue|System_Info.MMI_Statue));//点运行灯
- if(time_modify_flag==0)//修改时间标志
- ReadTime();
- if(New_Information_Flag==1) //£新的SOE
- {
- New_Information_Flag=0;
- Screen_state=10000;
- System_Info.MMI_Statue=0x00;
- L_Screen_state=0;
- }
- if(ucsigned_1000ms_flag==1)
- {
- ucsigned_1000ms_flag=0;
- update_flag1=1;
- State_Time_Show();
- }
- if(ucsigned_60s==1) /*5min清除背光*/
- {
- ucsigned_60s=0;
- System_Info.MMI_Statue=0x80;
- }
- if((Key_FUGUI==0)&&(L_Key_FUGUI==1))//装置复归
- {
- L_Key_FUGUI= Key_FUGUI;
- MMI_DSP_Instruction(0x1300, 0, 0);
- SubMenuPosition=0;SubMenuPosition_temp=0;
- menupage=0;Father1_MenuPosition=0;
- Father2_MenuPosition=0;
- Father3_MenuPosition=0;
- Father2_page=0;
- Father3_page=0;
- Screen_state=0;
- }
- }
- //++++++++++++++++++++++++新信息显示++++++++++++++++++++
- void New_Information(void)
- { UC i;
- if(L_Screen_state!=10000)
- {
- cls();
- L_Screen_state=10000;
- Logo_Title();
- LCDPrintf(0,0,0,"新信息",12);
- for(i=0;i<6;i++)
- LCDPrintf( 1,1,(i+1)*16,(char *)LookSoe_Text[i],20);
- Bcd_show(1,9, 1*16, SOE_Buf_Show0.num, 0, 0, 0, 2);
- Bcd_show(1,5, 2*16, SOE_Buf_Show0.year, 0, 0, 0, 2);
- Bcd_show(1,8, 2*16, SOE_Buf_Show0.mon, 0, 0, 0, 2);
- Bcd_show(1,11, 2*16, SOE_Buf_Show0.day, 0, 0, 0, 2);
- Bcd_show(1,3, 3*16, SOE_Buf_Show0.hour, 0, 0, 0, 2);
- Bcd_show(1,6, 3*16, SOE_Buf_Show0.min, 0, 0, 0, 2);
- Bcd_show(1,9, 3*16, SOE_Buf_Show0.sec, 0, 0, 0, 2);
- Bcd_show(1,12, 3*16, SOE_Buf_Show0.msec, 0, 0, 0, 2);
- LCDPrintf( 1,6,4*16,(char *)&Soe_Info_Text[(UC)(Check_SoeTable(SOE_Buf_Show0.num))][0],8);
- LCDPrintf( 1,2,5*16,(char *)&Soe_Info_Text[(UC)(Check_SoeTable(SOE_Buf_Show0.num))][8],12);
- if( SOE_Buf_Show0.stu==0x02)
- LCDPrintf( 1,6,6*16,"发生",6);
- else if( SOE_Buf_Show0.stu==0x01)
- LCDPrintf( 1,6,6*16,"消失",6);
- Frame_Show(0);
- }
- if((Key_CANCEL==0 )&&(L_Key_CANCEL==1))
- {
- Screen_state =1;
- SubMenuPosition = 0;
- L_Key_CANCEL = Key_CANCEL;
- }
- }
- //+++++++++++++++++++++++++++状态条显示++++++++++++++++++++++++++++++
- void Frame_Show(UC select)
- {
- State_Time_Show();
- switch(select)
- {
- case 0:
- break;
- case 1://up
- LCDPrintf(1, 7, 112, "仩",1);
- break;
- case 2://up-down
- LCDPrintf(1, 7, 112, "肿",1);
- break;
- case 3://up-down
- LCDPrintf(1, 7, 112, "虾",1);
- break;
- default:break;
- }
- display_sqr(0,15,16,111,0x80,0x01);//画框
- display_sqr(0,15,113,127,0x80,0x01);
- }
- //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- //
- // 系统管理部分(密码管理、定值操作等)
- //
- //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- // 系统信息/密码修改(输入密码)
- void Password_Manager(void)
- {
- UC i;
- if( L_Screen_state != 110 )
- {
- L_Screen_state = 110;
- PassWordNum = 0;
- PASSWord_temp=0;
- PASSWord=System_Info.Password1;
- if(PassWordchanged==0) //输入旧密码
- {
- Dalog_Info_Show(0, 0, 0);
- }
- else //输入新密码
- {
- for(i=3;i<7;i++)
- LCDPrintf(1, 1,( i*16), " ", 20);
- Dalog_Info_Show(0, 1, 0);
- }
- }
- if((Key_UP==0 )&&(L_Key_UP==1))//----------0
- {
- L_Key_UP=Key_UP;
- if(PassWordNum<6)
- {
- PASSWord_temp = PASSWord_temp<<4;
- PASSWord_temp = PASSWord_temp|0x1;
- PassWordNum++;
- ViewPassword(PassWordNum);
- }
- }
- if((Key_DOWN==0 )&&(L_Key_DOWN==1))//--------1
- {
- L_Key_DOWN = Key_DOWN;
- if(PassWordNum<6)
- {
- PASSWord_temp = PASSWord_temp<<4;
- PASSWord_temp = PASSWord_temp|0x2;
- PassWordNum++;
- ViewPassword(PassWordNum);
- }
- }
- if((Key_LEFT==0)&&(L_Key_LEFT==1))//-------3
- {
- L_Key_LEFT = Key_LEFT;
- if(PassWordNum<6)
- {
- PASSWord_temp = PASSWord_temp<<4;
- PASSWord_temp = PASSWord_temp|0x3;
- PassWordNum++;
- ViewPassword(PassWordNum);
- }
- }
- if((Key_RIGHT==0)&&(L_Key_RIGHT==1))//-------4
- {
- L_Key_RIGHT= Key_RIGHT;
- if(PassWordNum<6)
- {
- PASSWord_temp = PASSWord_temp<<4;
- PASSWord_temp = PASSWord_temp|0x4;
- PassWordNum++;
- ViewPassword(PassWordNum);
- }
- }
- if((Key_OK==0)&&(L_Key_OK==1))//----------2
- {
- L_Key_OK=Key_OK;
- if(PassWordNum<6)
- {
- PASSWord_temp = PASSWord_temp<<4;
- PASSWord_temp = PASSWord_temp|0x5;
- PassWordNum++;
- ViewPassword(PassWordNum);
- }
- else if(PassWordchanged==1) //第一个新密码输入完成
- {
- temp1 = PASSWord_temp;
- L_Screen_state = 0;
- PassWordchanged=2;
- }
- else if(PassWordchanged==2) //第二个新密码输入完成
- {
- if(temp1 == PASSWord_temp)
- {
- Screen_state =1102;
- System_Info.Password10=PASSWord_temp;
- PASSWord=PASSWord_temp;
- PassWordchanged=0;
- }
- else
- {
- Screen_state =1101;
- PassWordchanged=0;
- }
- }
- else if((PASSWord_temp != PASSWord)&&(PASSWord_temp != 0x123421)) //密码错误//公用密码:que ren
- Screen_state =1101;
- else //密码正确 {
- {
- Flag_Password_True=1;
- switch(Returnto_Modify)
- {
- case 0:
- Screen_state =110;
- L_Screen_state=0;
- PassWordchanged=1;
- break;
- case 6:
- Screen_state =418; //时钟调整
- break;
- case 10:
- Output_Select_Flag=1;
- Screen_state=119;
- Returnto_Save=10;
- break;
- case 11:
- Output_Select_Flag=1;
- Screen_state=119;
- Returnto_Save=11;
- break;
- case 30:
- Screen_state =4111; //pt_value_modify
- break;
- case 31:
- Screen_state =4121;//cT_value_modify
- break;
- case 32:
- case 33:
- Screen_state =4131;//自动调整通道系数
- break;
- case 34:
- case 35:
- Screen_state =4132; //手动调整通道系数
- break;
- case 36:
- Screen_state =4141; //Yxtime_Value_modify
- break;
- case 37:
- Screen_state =4151; //DianDu_Value_modify
- break;
- case 38:
- Screen_state =4161; //端口信息修改
- break;
- case 50: //开出传动修改
- Screen_state =5131;
- break;
- case 51:
- Screen_state =5141; /*压板修改*/
- break;
- /*定值修改*/
- case 101:
- case 102:
- case 103:
- case 104:
- case 105:
- case 106:
- case 107:
- case 108:
- case 109:
- case 110:
- case 111:
- case 112:
- Screen_state=31020+Returnto_Modify;//过流
- break;
- case 130:
- Screen_state=315;//定值切换
- break;
- case 131:
- Screen_state=316;//定值复制
- break;
- case 132:
- Screen_state=317;//写定值xx
- break;
- case 133:
- Screen_state=419;//写系统配值
- break;
- default:
- Screen_state=0;
- break;
- };
- }
- }
- }
- void ViewPassword(UC num)
- {
- UC i;
- for(i=0;i<num;i++)
- LCDPrintf(1, (4+i), 80, "*", 1);
- }
- void PasswordModify_OK(void)
- {
- if( L_Screen_state != 1102 )
- {
- L_Screen_state = 1102;
- MMI_DSP_Instruction(0x1000,0, 0);
- Dalog_Info_Show(0, 7, 0);
- Command_Flag=1;
- }
- if((Key_OK==0)&&(L_Key_OK==1))
- {
- L_Key_OK=Key_OK;
- Screen_state=41;
- SubMenuPosition = 0;
- }
- if(Command_Flag>0)
- {
- if(Check_Instruction_Statue(0x1000)==0x00)
- {
- Dalog_Info_Show(0, 4, 0);
- PASSWord=System_Info.Password1=PASSWord_temp;
- Command_Flag=0;
- }
- else if(Check_Instruction_Statue(0x1000)==0x22)
- { Dalog_Info_Show(0,2, 0);
- Command_Flag=0;
- }
- }
- }
- ///密码修改/错误密码
- void PasswordModify_Erro(void)
- {
- if( L_Screen_state != 1101 )
- {
- L_Screen_state = 1101;
- Dalog_Info_Show(0,2, 0);
- }
- if((Key_CANCEL==0)&&(L_Key_CANCEL==1))
- {
- L_Key_CANCEL=Key_CANCEL;
- switch(Returnto_Modify)
- {
- case 0:
- Screen_state =41; //错误返回系统信息
- SubMenuPosition = 0;
- break;
- case 6://time MODIFY
- //清修改标志
- time_modify_flag=0;
- Screen_state=41;
- break;
- case 10:
- case 11:
- Screen_state=51;
- break;
- case 30://PT参数
- Screen_state=411;
- break;
- case 31://CT参数
- Screen_state=412;
- break;
- case 32: //调整通道系数
- case 33:
- case 34:
- case 35:
- Screen_state =413;
- CT_Type=0;
- break;
- case 36://yx_time
- case 37://diandu
- case 38://Rs485端口信息
- Screen_state=414+Returnto_Modify-36;
- break;
- /*开出传动*/
- case 50:
- Output_Select_Flag=0;
- Screen_state=513;
- break;
- case 51://yaban
- Screen_state=514;
- break;
- /*定值修改*/
- case 101:
- case 102:
- case 103:
- case 104:
- case 105:
- case 106:
- case 107:
- case 108:
- case 109:
- case 110:
- case 111:
- case 112:
- Screen_state=31000+Returnto_Modify;//过流
- break;
- case 130:
- case 131:
- case 132:
- Screen_state=31;//定值管理/切换定值组
- break;
- case 133:
- Screen_state=41;//定值管理/切换定值组
- break;
- default:
- Screen_state=0;
- break;
- };
- }
- }
- //系统信息/参数保存
- void Data_Save(void)
- {
- UC i,temp_per1,temp_per2;
- if( L_Screen_state != 120 )
- {
- L_Screen_state = 120;
- Dalog_Info_Show(0, 5, 0);
- }
- if((Key_OK==0)&&(L_Key_OK==1))
- {
- L_Key_OK=Key_OK;
- Dalog_Info_Show(0, 6, 0);
- switch(Returnto_Save)
- {
- case 35://手动修改通道系数
- for(i=0;i<TD_NUM;i++)
- Channel_Ration_Flag.Temp[i]=Channel_Ration_Flag.Temp[i];
- Cmd_ArmToDsp=0x0e01;
- temp_per1=CT_Type;
- temp_per2=0;
- CmdReturn_Erro_Flag=413;
- CmdReturn_True_Flag=413;
- break;
- case 6://时钟调整
- Cmd_ArmToDsp=0x0210;
- temp_per1=0;
- temp_per2=0;
- CmdReturn_Erro_Flag=416;
- CmdReturn_True_Flag=41;
- break;
- default :
- break;
- }
- MMI_DSP_Instruction(Cmd_ArmToDsp, temp_per1, temp_per2);
- Dalog_Info_Show(0, 7, 0);
- Command_Flag=1;
- }
- if((Key_CANCEL==0 )&&(L_Key_CANCEL==1))
- {
- L_Key_CANCEL = Key_CANCEL;
- switch(Returnto_Save)
- { case 35:
- for(i=0;i<TD_NUM;i++)
- Channel_Ration_Flag.Temp[i]=Channel_Ration_Flag.Value[i];
- Cmd_ArmToDsp=0x0e02;
- temp_per1=CT_Type;
- temp_per2=0;
- Screen_state =413;
- break;
- case 6://time
- //清修改标志
- time_modify_flag=0;
- Screen_state =41;
- break;
- default :
- break;
- }
- // Returnto_Save=0;
- // MMI_DSP_Instruction(Cmd_ArmToDsp, temp_per1, temp_per2);
- // Dalog_Info_Show(0, 7, 0);
- // Command_Flag=1;
- }
- if(Command_Flag>0)
- {
- if(Check_Instruction_Statue(Cmd_ArmToDsp)==0x00)
- {
- switch(CmdReturn_True_Flag)
- {
- case 413:
- Screen_state =413;
- break;
- case 41:
- time_modify_flag=0;
- Screen_state =41;
- break;
- default:break;
- }
- Command_Flag=0;
- // Returnto_Save=0;
- }
- else if(Check_Instruction_Statue(Cmd_ArmToDsp)==0x22)
- { Command_Flag=0;
- Dalog_Info_Show(1, 12, 0);
- }
- }
- }
- //定值、配置保存/选择/执行
- void Data_Select_Save(void)//选择执行保存
- { UC i,Config_Modify_flag=0,Setting_Modify_flag=0;
- if( L_Screen_state != 119 )
- {
- L_Screen_state = 119;
- //SubMenuPosition=0;
- if(Output_Select_Flag==1)
- Dalog_Info_Show(SubMenuPosition_temp, 14, 0);
- else
- Dalog_Info_Show(SubMenuPosition_temp, 15, 0);
- }
- if((Key_OK==0)&&(L_Key_OK==1))
- {
- L_Key_OK=Key_OK;
- Screen_state=1191;
- }
- if((Key_CANCEL==0 )&&(L_Key_CANCEL==1))/*要加撤销命令*/
- {
- L_Key_CANCEL = Key_CANCEL;
- Command_Flag=0;
- SubMenuPosition=0;
- SubMenuPosition_temp=0;
- Flag_Password_True=0;
- switch(Returnto_Save)
- {
- case 6://time
- //清修改标志
- time_modify_flag=0;
- Screen_state=416;
- break;
- case 30://PT参数
- Screen_state=41;
- Config_Modify_flag=1;
- break;
- case 51://yaban
- Screen_state=514;
- break;
- case 10:/*遥控操作*/
- case 11:
- Output_Select_Flag=0;
- Screen_state=51;
- break;
- /*开出传动*/
- case 12:
- case 13:
- case 14:
- case 15:
- case 16:
- case 17:
- case 18:
- case 19:
- case 20:
- case 21:
- case 22:
- case 23:
- case 24:
- case 25:
- case 26:
- Output_Select_Flag=0;
- Screen_state=513;
- break;
- /*定值修改*/
- case 110:
- Screen_state=31;//过流
- Setting_Modify_flag=1;
- break;
- case 130:
- Command_Flag=0;
- case 131:
- Screen_state=31;//定值管理/切换定值组
- break;
- case 132:
- Screen_state=31;
- Setting_Modify_flag=1;
- //Father2_MenuPosition=0;
- break;
- case 133:
- Screen_state=41;
- Config_Modify_flag=1;
- //Father2_MenuPosition=0;
- break;
- default :
- Screen_state=2;
- break;
- }
- Returnto_Save=0;
- if(Setting_Modify_flag==1)
- {
- Setting_Modify_flag=0;
- for(i=0;i<SETTING_NUM;i++)
- System_setting[i]=System_setting_Old[i];
- }
- if(Config_Modify_flag==1)
- {
- Config_Modify_flag=0;
- for(i=0;i<CONFIG_NUM;i++)
- System_config[i]=System_config_Old[i];
- }
- }
- }
- void Dialog_Select_Exectue(void)//选择执行对话框
- {
- UC i,Config_Modify_flag=0,Setting_Modify_flag=0;
- UI temp_per1,temp_per2;
- if( L_Screen_state != 1191 )
- {
- L_Screen_state = 1191;
- switch(SubMenuPosition_temp)
- {
- case 0://选择//加返回标
- switch(Returnto_Save)
- { //系统参数修改
- case 30://PT参数
- Cmd_ArmToDsp=0x0c00;
- temp_per1=0;
- temp_per2=0;
- break;
- case 51: /*Yaban*/
- Cmd_ArmToDsp=0x0f00;
- temp_per1=YYB_Modify_Flag.YYB_temp;
- temp_per2=0;
- break;
- /*遥控操作*/
- case 10://遥分
- Cmd_ArmToDsp=0x1120;
- temp_per2=0;
- temp_per1=48;
- break;
- case 11: //遥合
- Cmd_ArmToDsp=0x1110;
- temp_per2=0;
- temp_per1=48;
- break;
- /*开出传动*/
- case 12:
- case 13:
- case 14:
- case 15:
- case 16:
- case 17:
- case 18:
- case 19:
- case 20:
- case 21:
- case 22:
- case 23:
- case 24:
- case 25:
- case 26:
- Cmd_ArmToDsp=0x1100;
- temp_per2=0;
- temp_per1=36+Returnto_Save;
- break;
- /*定值修改*/
- case 110://长启动
- Cmd_ArmToDsp=0x0800;
- temp_per1=FixedValue_Num;
- temp_per2=0;
- break;
- case 130://切换
- Cmd_ArmToDsp=0x0a00;
- temp_per1=FixedValue_Switch_Num;
- temp_per2=0;
- break;
- case 131://复制
- Cmd_ArmToDsp=0x0b00;
- temp_per1=TargetArea;
- temp_per2=SourceArea;
- break;
- case 132://写初始化定值
- Cmd_ArmToDsp=0x0800;
- temp_per1=FixedValue_Switch_Num;
- temp_per2=0;
- break;
- case 133://写初始化定值
- Cmd_ArmToDsp=0x0c00;
- temp_per1=0;
- temp_per2=0;
- break;
- default :
- break;
- }
- MMI_DSP_Instruction(Cmd_ArmToDsp,temp_per1,temp_per2);
- Dalog_Info_Show(0, 7, 0);
- Command_Flag=1;
- break;
- case 1://执行//加返回标
- switch(Returnto_Save)
- { //系统参数修改
- case 30://PT参数
- Cmd_ArmToDsp=0x0d00;
- temp_per1=0;
- temp_per2=0;
- break;
- case 51: /*Yaban*/
- Cmd_ArmToDsp=0x0f01;
- temp_per1=YYB_Modify_Flag.YYB_temp;
- temp_per2=0;
- break;
- case 10://遥分
- Cmd_ArmToDsp=0x1121;
- temp_per2=0;
- temp_per1=48;
- break;
- case 11: //遥合
- Cmd_ArmToDsp=0x1111;
- temp_per2=0;
- temp_per1=48;
- break;
- /*开出传动*/
- case 12:
- case 13:
- case 14:
- case 15:
- case 16:
- case 17:
- case 18:
- case 19:
- case 20:
- case 21:
- case 22:
- case 23:
- case 24:
- case 25:
- case 26:
- Cmd_ArmToDsp=0x1101;//启动
- temp_per2=0;
- temp_per1=36+Returnto_Save;
- break;
- /*定值修改*/
- case 110:
- Cmd_ArmToDsp=0x0900;
- temp_per1=FixedValue_Num;
- temp_per2=0;
- break;
- case 130:
- Cmd_ArmToDsp=0x0a01;
- temp_per1=FixedValue_Switch_Num;
- temp_per2=0;
- break;
- case 131:
- Cmd_ArmToDsp=0x0b01;
- temp_per1=TargetArea;
- temp_per2=SourceArea;
- break;
- case 132:
- Cmd_ArmToDsp=0x0900;
- temp_per1=FixedValue_Switch_Num;
- temp_per2=0;
- break;
- case 133:
- Cmd_ArmToDsp=0x0d00;
- temp_per1=0;
- temp_per2=0;
- break;
- default :
- break;
- }
- MMI_DSP_Instruction(Cmd_ArmToDsp,temp_per1,temp_per2);
- Dalog_Info_Show(0, 7, 0);
- Command_Flag=1;
- Cmd_Exectue_Flag=1;
- break;
- default:break;
- }
- }
- if(Command_Flag>0)
- {
- if(Check_Instruction_Statue(Cmd_ArmToDsp)==0x00)
- {
- //if(SubMenuPosition==0) SubMenuPosition=1;
- Command_Flag=0;
- if(Cmd_Exectue_Flag==1)
- {
- Cmd_Exectue_Flag=0;SubMenuPosition_temp=0;
- switch(Returnto_Save)
- {
- case 30://PT参数
- Screen_state=1;
- Config_Modify_flag=1;
- break;
- case 51://yaban
- Screen_state=514;
- System_Info.YB_Soft=YYB_Modify_Flag.YYB_temp;
- break;
- case 10://遥分
- case 11: //遥合
- Output_Select_Flag=0;
- Screen_state=51;
- break;
- //开出传动
- case 12:
- case 13:
- case 14:
- case 15:
- case 16:
- case 17:
- case 18:
- case 19:
- case 20:
- case 21:
- case 22:
- case 23:
- case 24:
- case 25:
- case 26:
- Output_Select_Flag=0;
- Screen_state=5131;
- break;
- case 110:
- Screen_state=31;//过流
- Setting_Modify_flag=1;
- break;
- case 130:
- System_Info.DZ_Area=FixedValue_Switch_Num;
- case 131:
- Screen_state=31;//定值切换
- break;
- case 132:
- Screen_state=317;//过流
- Setting_Modify_flag=1;
- //Father2_MenuPosition=0;
- break;
- case 133:
- Screen_state=41;//过流
- Config_Modify_flag=1;
- //Father2_MenuPosition=0;
- break;
- default :
- Screen_state=2;
- break;
- }
- /*刷新定值、配置的备份*/
- Returnto_Save=0;
- if(Setting_Modify_flag==1)
- {
- Setting_Modify_flag=0;
- for(i=0;i<SETTING_NUM;i++)
- System_setting_Old[i]=System_setting[i];
- }
- if(Config_Modify_flag==1)
- {
- Config_Modify_flag=0;
- for(i=0;i<CONFIG_NUM;i++)
- System_config_Old[i]=System_config[i];
- }
- }
- else
- {
- Screen_state =119;
- SubMenuPosition_temp=1;
- }
- }
- else if(Check_Instruction_Statue(Cmd_ArmToDsp)==0x22)
- { if(CmdExectue_Erro_Flag==0)
- {
- CmdExectue_Erro_Flag=1;
- Dalog_Info_Show(1,12, 0);
- }
- Cmd_Exectue_Flag=0;//执行失败清零
- if((Key_OK==0)&&(L_Key_OK==1))
- {
- L_Key_OK=Key_OK;
- CmdExectue_Erro_Flag=0;
- Screen_state =119;
- }
- }
- }
- }
- void Dalog_Info_Show(UC value,UC key,UC type)
- { Dlg_Frame_View();
- switch(key)
- {
- case 0:
- LCDPrintf(1, 3, 64, "输入密码:", 12);
- break;
- case 1:
- LCDPrintf(1, 3, 64, "输入新密码:", 12);
- break;
- case 2:
- LCDPrintf(1, 3, 72, " 密码错误!", 20);
- break;
- case 3:
- LCDPrintf(1, 3, 72, " 确认执行!", 20);
- break;
- case 4:
- LCDPrintf(1, 3, 72, " 修改成功!", 20);
- break;
- case 5:
- LCDPrintf(1, 3, 72, "确认保存?", 12);
- break;
- case 6:
- LCDPrintf(1, 3, 72, "正在保存...", 12);
- break;
- case 7:
- LCDPrintf(1, 3, 72, "请等待...", 12);
- break;
- case 10:
- if(value==0) LCDPrintf(1, 3, 72, "选择成功!", 9);
- else LCDPrintf(1, 3, 72, "选择失败!", 9);
- break;
- case 11:
- if(value==0) LCDPrintf(1, 3, 72, "保存成功!", 9);
- else LCDPrintf(1, 3, 72, "保存失败!", 9);
- break;
- case 12:
- if(value==0)
- LCDPrintf(1, 3, 72, "执行成功!", 9);
- else LCDPrintf(1, 3, 72, "执行失败!", 9);
- break;
- case 13:
- if(value==0)
- LCDPrintf(1, 3, 72, "固化成功!", 9);
- else LCDPrintf(1, 3, 72, "固化失败!", 9);
- break;
- case 14:
- if(value==0)
- LCDPrintf(0, 3, 72, "选择", 4);
- else
- LCDPrintf(1, 3, 72, "选择", 4);
- if(value==1)
- LCDPrintf(0, 9, 72, "执行", 4);
- else
- LCDPrintf(1,9,72,"执行",4);
- break;
- case 15:
- if(value==0)
- LCDPrintf(0, 3, 72, "保存", 4);
- else
- LCDPrintf(1, 3, 72, "保存", 4);
- if(value==1)
- LCDPrintf(0, 9, 72, "固化", 4);
- else
- LCDPrintf(1,9,72,"固化",4);
- break;
- case 16:
- LCDPrintf(1, 3, 64, "禁止修改", 10);
- LCDPrintf(1, 2, 80, "当前定值区", 10);
- break;
- case 17:
- LCDPrintf(1, 4, 64, " 查 看", 10);
- LCDPrintf(1, 3, 80, "第 条记录", 10);
- break;
- default:
- Screen_state=2;
- break;
- }
- }
- void Show_Process(void)
- {
- switch(Screen_state)
- {
- case 0:
- Screen_Logo(); //开机界面
- break;
- case 1:
- Screen_MainMenu();//主菜单界面
- break;
- case 2:
- FirstRun_Bmp_View();/*一次运行图*/
- break;
- case 11:
- Sample_Information_Menu();//实时数据
- break;
- case 111:
- Second_Measurevalue();//二次测量值
- break;
- case 112:
- Second_Measurevalue1();//一次测量值
- break;
- case 113:
- RealYX();//实时遥信
- break;
- case 114:
- // RealPower();//实时遥信
- break;
- case 115:
- // Harmonic_Num_Modify();//谐波分量次数
- break;
- case 1151:
- // Harmonic_Num_Value();//谐波分量
- break;
- case 116:
- LookSoe_Num_Modify();//查看SOE
- break;
- case 1161:
- Look_Soe();//查看SOE
- break;
- case 21:
- Report_Manage();//报告信息
- break;
- case 214://故障报告
- Fault_Num_Modify();
- break;
- case 2141:
- Fault_Report_Show();
- break;
- case 31:
- FixedValue_Manage();//保护定值
- break;
- case 311:
- FixedValue_A();//定值组A
- break;
- case 31101:
- FixedValue_A_FYGI();//定值组A-过流
- break;
- case 31121:
- FixedValue_A_FYGI_Modify();//定值组A-过流
- break;
- case 315:
- FixedValue_Switch();
- break;
- case 316:
- FixedValue_Copy();
- break;
- case 317:
- FixedValue_Init();
- break;
- case 41:
- System_Config();//系统信息
- break;
- case 413:
- Channel_Adjust_Value();//校准系数
- break;
- case 4131:
- Channel_Adjust_Auto();//自动校准系数
- break;
- case 4132:
- Channel_Adjust_Manual();//手动校准系数
- break;
- case 414:
- YxTime_Value();//遥信参数
- break;
- case 4141:
- YxTime_Value_Modify();//遥信参数
- break;
- case 416:
- Comm_Information();//端口信息
- break;
- case 4161:
- Comm_Information_Modify();//端口信息
- break;
- case 418:
- Clock_Modify();//时钟调整
- break;
- case 419:
- ConfigValue_Init();
- break;
- case 51:
- System_Test();//控制操作
- break;
- case 513:
- Output_Test();//开出传动
- break;
- case 5131:
- Output_Test_Modify();
- break;
- case 514:
- Yaban_Control();//压板投退
- break;
- case 5141:
- Yaban_Control_Modify();//压板投退
- break;
- case 515:
- PC_Com();//与PC通信
- break;
- case 516:
- System_Reset();//装置复归
- break;
- case 61:
- System_Help();//帮助信息
- break;
- case 611:
- Production_Introduction();//产品简介
- break;
- case 612:
- User_Manual();//使用指南
- break;
- case 613:
- Help_Tel();//联系方式
- break;
- case 614:
- Function_Introduction();
- break;
- case 615:
- Version_Show();
- break;
- case 616:
- System_State_Show();
- break;
- case 119:
- Data_Select_Save();//选择执行保存
- break;
- case 1191:
- Dialog_Select_Exectue();//选择执行对话框
- break;
- case 120:
- Data_Save();//一般数据保存
- break;
- case 110:
- Password_Manager();
- break;
- case 1101:
- PasswordModify_Erro();
- break;
- case 1102:
- PasswordModify_OK();
- break;
- case 911:
- Compare_FixedValue_Num();
- break;
- case 10000:
- New_Information();
- break;
- default: Screen_state = 0;
- break;
- };
- }