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

📄 display.c

📁 人机界面程序
💻 C
📖 第 1 页 / 共 5 页
字号:
//#################################################
//                     2006年11月   
//  	                 Ver 1.0
//                   GCA-150A
//           完成人:黄光林
//modify:  2006-11 
//#################################################

#include  "Define.h"
#include  "maindef.h"
#include  "LCD.h"
#include  "Display.h"
#include  "table.H"
#include  "P103_mmi2dsp.h"

/******************ARM  TO   DSP  交换数据所需的变量*********************888*/

UC Return_flag;
UC Flag_Password_True=0;
UI   YC_Value[YC_NUM];       /*数组存所有YC数据*/
UI   YC_Value1[YC_NUM];       /*数组存所有YC数据*/

short  YC_POWER_P;//有功功率
short  YC_POWER_Q;//无功功率
struct  System_Info_fm  System_Info; //实时信息

unsigned char TargetArea;            //目标区(用于复制定值)
unsigned char SourceArea;            //原始区(用于复制定值)

struct  SOE_Buf_Show_fm      SOE_Buf_Show0;          //存放SOE的缓冲区
struct  Report_Buf_Show_fm   Report_Buf_Show0;

struct SoftInformation_fm  SoftInformation;

struct Setting_Copy_fm    Setting_Copy;
struct Setting_Switch_fm  Setting_Switch;
struct Output_Test_YK_fm  Output_Test_YK;

struct  Channel_Ration_Flag_fm  Channel_Ration_Flag;

struct  YYB_Modify_Flag_fm   YYB_Modify_Flag;

struct  Fault_Recode_Flag_fm   Fault_Recode_Flag;    //召唤故障报告/SOE缓冲区
struct Harmonic_Value_fm Harmonic_Value;
struct Time_buf realtime;
struct  Time_buf  realtime1;         //实时时钟修改用
unsigned int   System_config[CONFIG_NUM];    //系统配置
unsigned int   System_setting[SETTING_NUM];   //定值

/*+++++++++++++++++++++++++++++++内部用+++++++++++++++++++++++++*/
UI   System_config_Old[CONFIG_NUM];    //系统配置
UI   System_setting_Old[SETTING_NUM];   //定值

UI   YC_Value1_Change[10];  

UI   Screen_state = 1;
UI   L_Screen_state = 0;
UI  Outport_FixedValue=0;
UC   SubMenuPosition=0, menupage=0,SubMenuPosition_temp=0;
UC   Father1_MenuPosition=0,Father2_MenuPosition=0,Father3_MenuPosition=0;
UC    Father2_page=0,Father3_page=0;
UC   CT_Type=0,Select_CT_Type=0,Auto_CT_Type=0;
UI   temp1=0;
UC   PassWordNum,PassWordchanged=0;			
UI   PASSWord_temp,PASSWord;

UI  Returnto_Modify;
/*
	修改返回地址
0	系统信息
4	自动调整
5     手动调整
6      时钟调整
7	TA 参数
8     TV参数
9   开出传动
10    端口信息
11    压板投退
12    遥信参数
101~112 定值修改
116 查看SOE
211 事件报告
212 故障简报
213 操作记录
*/

UI  Returnto_Save;
/*
	保存返回地址
5    手动调整
6    时钟调整
7	TA 参数
8     TV参数
9	 
10    端口信息
11    压板投退
12    遥信参数
18  遥分操作
19  遥合操作
20~30  开出传动
101~112 定值修改



*/
UC   Key_UP,Key_DOWN,Key_LEFT,Key_RIGHT,Key_OK,Key_CANCEL,Key_FUGUI,Key_ADD,Key_SUB;
UC   L_Key_UP,L_Key_DOWN,L_Key_LEFT,L_Key_RIGHT,L_Key_OK,L_Key_CANCEL,L_Key_FUGUI,L_Key_ADD,L_Key_SUB;
UC   Key_ADD_Long,Key_SUB_Long;
UC FixedValue_Num=0;//临时定值区号
UC FixedValue_Switch_Num=0;//定值切换区号
UC PC_Comm_Flag=0;
UC New_Information_Flag=0;
UI  Rs485_Baud;//通信参数用
UC Sametime_Phase=0;
UC time_modify_flag=0;
UC update_flag1=0;
UC Output_Select_Flag=0;//开出传动用
UC Harmonic_Num=2;
UC Soe_Num=0;
UC Fault_Num=0;

UC Command_Flag=0;
UI Cmd_ArmToDsp;
UI CmdReturn_True_Flag=0;
UI CmdReturn_Erro_Flag=0;
UC Cmd_Exectue_Flag=0;
UC CmdExectue_Erro_Flag=0;
UC PT_num;
struct Limit
{
 UI Low_Limit;
 UI Up_Limit;
 UI step_Size;
};					//下限上限步长	

const struct Limit  PT_Limit={0,250,1};//*10
const struct Limit  PT_FF_Limit={0,400,1};//*10
const struct Limit  CT_YF_Limit={0,5000,1};
const struct Limit  CT_FF_Limit={1,5,4}; 
const struct Limit  YXTime_Limit={0,32000,1};
const struct Limit  YMBase_Limit={0,999999999,1};
const struct Limit  FXP_Limit={10,20000,1};
const struct Limit  P_Limit={50,20000,1};
const struct Limit  IntegralWidth_Limit={0,250,1};
const struct Limit Control_Word_Limit={0,1,1};
const struct Limit FXCurrent_Limit={5,9999,1};//*100
const struct Limit GZCurrent_Limit={5,9999,1};//*100
const struct Limit  Current_Limit={5,9999,1};//*100

const struct Limit Voltage_Limit={50,15000,1};//*100
const struct Limit GVoltage_Limit={50,15000,1};//*100
const struct Limit Time_Limit={3,9999,1};//*100
const struct Limit PTime_Limit={3,20000,1};//*100

const struct Limit KZD_Limit={0,100,1};
const struct Limit K_Limit={20,9999,1};
const struct Limit  Freq_limit={4000,6000,1};//*100
const struct Limit  GFreq_limit={4000,6000,1};//*100
const struct Limit Huacha_limit={0,1000,1};
const struct Limit Changle_limit={0,9000,100};//*10重合角度
const struct Limit Channel_limit={8000,12000,1};//*10
const struct Limit Harmonic_limit={2,23,1};//谐波次数
const struct Limit XBGJ_limit={0,100,1};//谐波告警
const UI Setting_Init[SETTING_NUM]=
	{0,0,7000,100,7000,100,11000,100,11000,100,
	  5000,100,7000,100,7000,100,11000,100,11000,100,
	  5000,100,7000,100,7000,100,11000,100,11000,100,
	  5000,100,7000,100,7000,100,11000,100,11000,100,
	  5000,100,
	 };
const UI Config_Init[CONFIG_NUM]=
	{ 1,  9600, 100,  100, 100, 100, 100, 100,   100,  100, 100,  100,
	  100,   
	 };

extern UC display_buf[20];
extern UC ucsigned_60s;
extern US ucsigned_60s_Count;

extern UC  ucsigned_1000ms_flag;

//++++++++++++++++++++++++++++++函数声明区++++++++++++++++++++++++++++++++++
void Dalog_Info_Show(UC value,UC key,UC type);
void FirstRun_Bmp_View(void);
void Second_Measurevalue_Show(UC page);
void Second_Measurevalue1_Show(UC page);

void Run_Bmp_Value_Show(void);

void RealYX_Show(UC page,UC select);
void RealPower_Show(UC page);

void  Screen_MainMenu(void);
void ViewPassword(UC num);
void Comm_Information_Show(UC page,UC select);
void YxTime_Value_Show(UC page,UC select);
void Yaban_Control_Show(UC page,UC select );//压板
void  Yaban_Control_Modify(void);
void  System_Config_Show(UC page,UC select);
void   Outport_Test_Show(UC page,UC select);
void Channel_Adjust_Manual(void);
void Channel_Value_Show(UC page,UC select) ;
void Channel_Adjust_Auto(void);
void Function_Introduction(void);
void Version_Show(void);
void System_Reset(void);
void  FixedValue_A_Show(UC page,UC select);
void Fault_Record_Show(UC select);
void Look_Soe_Show(void);
void   FixedValue_Manage_Show(UC page ,UC select);
void  System_Help_show(UC select);

void FixedValue_A_FYGI_Show(UC page,UC select );//定值组A-零序过流
void FixedValue_A_FYGI_Modify(void);/*定值组A-零序过流*/
void Outport_Setting_Show(UC page ,UC select);
void  Outport_Value_Show(UC page,UC select);

void New_Information(void);
void Frame_Show(UC select);
void Data_Save(void);
void Data_Select_Save(void);
void Data_Select_show(UC select);

//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++


//+++++++++++++++++++++++++++++++++++++++++++++++++
//
//                              函数原代码区
//+++++++++++++++++++++++++++++++++++++++++++++++++
void delayfor(long count)
{
    long i,j;
    for(i=0;i<count;i++)
        for(j=0;j<10;j++);
}
/*显示定值组*/

/*键盘检查*/
void  Updata_key(US Key)
{      
	static UC ucTempADD=0,ucTempSUB=0; 
    L_Key_UP     = Key_UP;
    L_Key_DOWN   = Key_DOWN;
    L_Key_LEFT   = Key_LEFT;
    L_Key_RIGHT  = Key_RIGHT;
    L_Key_OK     = Key_OK;
    L_Key_CANCEL = Key_CANCEL;
    L_Key_FUGUI  = Key_FUGUI;
     L_Key_ADD= Key_ADD;
    L_Key_SUB= Key_SUB;
     
    if( (Key&0x1ff) != 0x1ff)
    		{System_Info.MMI_Statue=0x00;ucsigned_60s=0;ucsigned_60s_Count=0;}
    if( (Key&0x02) != 0)        Key_CANCEL = 0;
      else                       Key_CANCEL = 1;
    
    if( (Key&0x0080) != 0)        Key_LEFT = 0;
    else                           Key_LEFT = 1;

    if( (Key&0x0040) != 0)       Key_DOWN= 0;
    else                          Key_DOWN= 1;

    if( (Key&0x0020) != 0)     Key_UP   = 0;
    else                          Key_UP = 1;

    if( (Key&0x0100) != 0)       Key_RIGHT= 0;
    else                          Key_RIGHT = 1;
    
    if( (Key&0x0001) != 0)       Key_OK = 0;//0x004
    else                          Key_OK = 1;
    
    if( (Key&0x0010) != 0)     Key_ADD = 0;//0x0008
    else                          Key_ADD = 1;
    
    if( (Key&0x0008) != 0)       Key_SUB = 0;//0x0010
    else                          Key_SUB = 1;
    
    if( (Key&0x004) != 0)     Key_FUGUI = 0;//0x0001
    else                          Key_FUGUI = 1;
    
      /*ADD*/
 if( Key_ADD==1 )
   {
    ucTempADD++;
    if( ucTempADD > 50 )
      { ucTempADD=45; Key_ADD_Long=1; }
   }
 else
   {
  //  if( ucTempADD > 5 ) { Key_Up_Change=1; }   /*按键*/
    ucTempADD=0; Key_ADD_Long=0;
   }
 /*SUB*/
 if( Key_SUB==1 )
   {
    ucTempSUB++;
    if( ucTempSUB > 50 )
      { ucTempSUB=45; Key_SUB_Long=1; }
   }
 else
   {
  //  if( ucTempDown > 5 ) { Key_Down_Change=1; }   /*按键*/
    ucTempSUB=0; Key_SUB_Long=0;
   }

}

//############################################################
//		              以下为菜单结构程序:
//		
//
//                        第一部分         
//############################################################
void Screen_Logo(void)
{  
    if(L_Screen_state!=0)
     {  
       Logo_View();
       L_Screen_state=0;
     }
   if((Key_OK==0 )&&(L_Key_OK==1))
     {
     	Screen_state =1;
        L_Key_OK    = Key_OK;
        
     }

}
/*一次系统运行图*/
void FirstRun_Bmp_View(void)
{
	  if(L_Screen_state!=2)
     {  
      		 Run_Bmp_View();
      		//Run_Bmp_Value_Show();
    		   State_Time_Show();
  		 L_Screen_state=2;
     }
	
	
   if((Key_OK==0 )&&(L_Key_OK==1))
     {
     	Screen_state =1;
        L_Key_OK    = Key_OK;
    }
}

//++++++++++++++主菜单++++++++++++++++++
//         实时数据
//         报告信息
//         保护定值
//         系统信息
//         控制操作
//         帮助信息
//++++++++++++++++++++++++++++++++++++++++=
void  Screen_MainMenu(void)
{
 	 UC  i;
    if(L_Screen_state!=1)
     {  
       
       L_Screen_state=1;
	  cls();
	Logo_Title();
	LCDPrintf(0,0,0,"拾主菜单",8);
       
       for(i=0;i<6;i++)
         LCDPrintf( 1,1,(i+1)*16,(char *)mainMenu[i],20);
            SubMenuPosition= Father1_MenuPosition;
	if(SubMenuPosition>6) SubMenuPosition = 0;	
       LCDPrintf( 0,1,(SubMenuPosition+1)*16,(char *)mainMenu[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 *)mainMenu[SubMenuPosition],20);
       
       if( SubMenuPosition == 0) SubMenuPosition = 5;
       else                       SubMenuPosition--;
       
       LCDPrintf( 0,1,(SubMenuPosition+1)*16,(char *)mainMenu[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 *)mainMenu[SubMenuPosition],20);
       
       if( SubMenuPosition == 5) SubMenuPosition = 0;
       else                       SubMenuPosition++;
       
       LCDPrintf( 0,1,(SubMenuPosition+1)*16,(char *)mainMenu[SubMenuPosition],20);
         Frame_Show(0);
     } 
   if((Key_OK==0 )&&(L_Key_OK==1))
     {  
        L_Key_OK = Key_OK;
		    if(((SubMenuPosition<6)&&(SubMenuPosition!=3))||(((System_Info.LED_Statue&0x02)==0x02)&&(SubMenuPosition==3)))
      	 Screen_state =(1+SubMenuPosition)*10+1;
	       if(SubMenuPosition==3)  
	       	{ 
	       	   MMI_DSP_Instruction(0x0500,0,0);/*读系统定值*/
      			    Dalog_Info_Show(0, 7, 0);
				Command_Flag=1;
		
			}
       	Father1_MenuPosition=SubMenuPosition;
		Father2_MenuPosition=0;
		Father2_page=0;
     }
    if((Key_CANCEL==0 )&&(L_Key_CANCEL==1))
     {
        Screen_state =2;
        SubMenuPosition = 0;
	Father1_MenuPosition=0;

⌨️ 快捷键说明

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