
#ifndef _GUI_DISPLAY_H_
#define _GUI_DISPLAY_H_

typedef struct
{
	INT32U ODO_NUM;		//�����ֵ
	INT32U Trip_NUM;	//С����ֵ

	//INT16U Fuel_Res;//Ѳ��Ŀ�공����ֵ
	//INT8U Res_Valid;
	INT8U Language; //������ֵ
	uint8_t Hour;
	uint8_t Minute;    

	INT16U Speed;			  //��ǰ����
	//INT32U Ins_Fuel_Cons_NUM; //�ͺ���ֵ
	//INT32U Avg_Fuel_Cons_NUM; //�ͺ���ֵ
	INT8U NUM_Drive_Hour;
	INT8U NUM_Drive_Minute;

	INT8U Menu1_PageFlg; 

	_PDC_Infor PDC_Sts_Dis;
	//_PDC_Enum PDC_Sts_Dis;
	//INT8U LDW_Valid_Dis;	 ////������ֵ������


	INT8U  BackGround_Done ;  // �Լ�����Ƿ�ˢ����ɱ�־

	INT8U Clock_Colon ; //ʱ��ð�ŵ���ʾ״̬
//	INT8U Drive_MODE ;  //��ʻģʽ  ECO  SPORT  ��
	INT8U Speed_Valid ;



	INT8U GUI_DriverDoor;
	INT8U GUI_PassengerDoor;

	//INT16U Urea_Dis;
	//INT8U Urea_Valid;
	//INT8U AirPress_SegDis1;
	//INT8U AirPress_Valid1;
	//INT8U AirPress_SegDis2;
	//INT8U AirPress_Valid2;
	INT16U PopupAlarmDis;
	//INT8U LDWLeft_Dis;
	//INT8U LDWRight_Dis;
	INT32U ManitenceDis ;
	//INT8U Manitence_Valid ;
	//INT8U AvgSpd_Valid;
	//INT16U AvgSpd_Val;    
	//INT8U BatValt_Valid;
	//INT8U BatValt_Val;    
	Menu_Item_en_t Menu_Cur;
	INT8U AirPressGround_Done;
	INT8U Menu1Ground_Done;  
	INT8U Menu1_Dir;  

	INT8U Menu3_Hour;
	INT8U Menu3_Min;
	//INT8U Menu3_Apm;
	INT8U Menu3_OverSpd;
	INT32U Menu3_ManitenceDis ;
	INT16U Menu3_Tyre_Done;
	INT8U Menu3_SW[3];
	INT8U Menu3_HW[3];
	//INT16U  DemandAlarmDis ;
	//_MenuDispTPMS_Info_Enum ECU_TpmsCtrl;
	INT8U PopupNum ;

	INT8U Gear;
	INT8U Gear_Mode;
	INT8U Energy;

	INT8U AirPress1;
	INT8U AirPress2;

	INT8U OutTempValid;
	INT8U OutTemp;
	INT8U OutWarn;
	//INT8U SymbolTest;
	INT16U Soc;


	INT16U AvgSpeed;
	INT16U AvgSpeedValid;
	INT8U AvgNum;


	INT32U AvgPowCon;
	INT8U AvgPowConValid;
	INT8U AvgPowConNum;
	INT8U AvgPowConSymbol;

	INT16U InsPowCon;
	INT8U InsPowConValid;
	INT8U InsPowConNum;
	INT8U InsPowConSymbol;

	INT16U Range;
	INT8U RangeValid;
	//INT8U RangeNum;

	INT32U Elec_Fuel_Range;
	INT8U Elec_Fuel_RangeValid;
	INT16U WorkVol;
	INT8U WorkVolValid;
	INT8U WorkNum;


	INT16U BatteyVol;
	INT8U BatteyVolValid;
	INT8U BatteyNum;

	INT16U BatteyMaxVol;
	INT8U BatteyMaxVolValid;
	INT8U BatteyMaxNum;

	INT16U BatteyMinVol;
	INT8U BatteyMinVolValid;
	INT8U BatteyMinNum;

	INT16U WorkCur;
	INT8U WorkCurValid;
	INT8U WorkCurSymbol;
	INT8U WorkCurNum;

	INT16U SurPower;
	INT8U SurPowerValid;
	INT8U SurPowerNum;

	INT8U DriverHour;
	INT8U DriverMinute;

	INT16U FaultCode;
	INT8U FaultCodeValid;

	INT8U MaxTemp;
	INT8U MaxTempValid;
	INT8U MaxTempNum;
	INT8U MaxTempSymbol;

	INT8U MinTemp;
	INT8U MinTempValid;
	INT8U MinTempNum;
	INT8U MinTempSymbol;	


	INT16U CuriseSpeed;
	INT8U CuriseValid;


	INT16U CharVol;
	INT16U CharCur;
	INT16U CharVol_Valid;
	INT16U CharCur_Valid;
	INT16U CharHour;
	INT16U CharMinute;
	INT16U CharSoc;
	INT16U CharPower; 
	INT8U CharSymbol;

	INT8U DriverSafe;
	INT8U MidSafe;

	INT8U HintPopupNum;
	INT8U MaskPopupCurIdx;

	INT8U Eco_Valid;
	INT8U Eco;

} _GUIBackUp;

EXTERN _GUIBackUp GUIBackUp;
EXTERN Menu_Item_en_t MenuCur;
EXTERN INT8U Menu1_Page_Flag;
EXTERN  INT8U Menu1_Page_Dir;
	   
#define  CODE_ALTITUDE 6
typedef struct
{
  INT8U ID;
}_Disp_Code_Infor;


typedef struct
{
	INT8U ECU_Blink: 1; 
	INT8U ECU_St:3; 
//	INT8U Set_Blink: 1;
	INT8U Set_St: 3; 
///	INT8U Check_Blink: 1;
	INT8U Demand_St: 3;  
} _GUI_NaviBar;

EXTERN _GUI_NaviBar GUINaviBar;
EXTERN _GUI_NaviBar GUINaviBarBackUp;


//extern  const uint16_t ECUWithOutPoint3PosY[];
//extern  const uint16_t ECUWithOutPoint2PosY[];
//extern  const uint16_t ECUWithOutPoint1PosY[];
//extern  const uint16_t ECUWithPoint3PosY[];
//extern  const uint16_t TMPSNumLF3PosY[];
//extern  const uint16_t TMPSNumLF2PosY[];
//extern  const uint16_t TMPSNumLF1PosY[];
//extern  const uint16_t TMPSNumRF3PosY[];    
//extern  const uint16_t TMPSNumRF2PosY[];  
//extern  const uint16_t TMPSNumRF1PosY[]; 
//extern  const uint16_t DTCSPNPosY[];  
//extern  const uint16_t DTCFMIPosY[]; 
//extern   const uint16_t TimeHourPosY[];     
//extern   const uint16_t TimeMinPosY[];
//extern   const uint16_t Gas1PosY[];
//extern   const uint16_t Gas2PosY[];

//extern   const uint16_t Interface2SPNPosY[];     
//extern   const uint16_t Interface2FMIPosY[];  

EXTERN uint8_t VechSpeedDispRefresh;



/***************************************************/
void GUI_Display_INIT_KL30(void);
void GUI_Display_INIT_KL15(void );
void GUI_Display_INIT_Sleep(void);
void GUI_Display_BackGround(void);
void NavigationBar_Mode_Display(void);
void GUI_BJ_Clock_Display(INT8U Colon, INT8U HOUR, INT8U Minute, INT8U Refresh);
void GUI_BJ_Gear_Display(INT8U Gear,INT8U Energy,  INT8U Gearmode,INT8U Refresh);
void GUI_BJ_ODO_Display(uint32_t Mileage, INT8U Refresh);

void GUI_Drive_Info_LDW_Display(uint8_t Valid, uint8_t leftstate, uint8_t rightstate , uint8_t Refresh );
void Clear_PDC_L_Display(void) ;
void Clear_PDC_M_Display(void) ;
void Clear_PDC_R_Display(void) ;
void GUI_Drive_Info_PDC_Display(_PDC_Infor pdc_state,uint8_t Refresh);   
//void GUI_Drive_Info_PDC_Display(_PDC_Enum pdc_state,uint8_t Refresh);   
void GUI_DRIVE_INFO_Display(void);
void GUI_Setting_Menu1_Page_Ground(void);
void GUI_Setting_Menu1_Display(void);

void GUI_Setting_Menu2_Time_Display(void) ;

void GUI_Setting_Menu2_OveSpd_Display(void) ;
void GUI_Setting_Menu3_OveSpd_Set_Display(void);     
void GUI_Setting_Menu3_OveSpd_Set_Clear_XuanKuang(Menu_Item_en_t Item0); 
void GUI_Setting_Menu3_OveSpd_Set_Draw_XuanKuang(Menu_Item_en_t Item0);

void GUI_Setting_Menu2_MAINT_Display(void) ;
void	GUI_Setting_Menu3_MAINT_Check_Display(void); 
void GUI_Setting_Menu2_Clear_Display(void);
void GUI_Setting_Menu3_Clear_AvgSpd_Display(void);      
void GUI_Setting_Menu3_Clear_DriveTime_Display(void);      
void GUI_Setting_Menu3_Clear_Trip_Display(void);      
void GUI_Setting_Menu3_ClearTrip_Draw_XuanKuang(Menu_Item_en_t Item0);  
void GUI_Setting_Menu3_ClearTrip_Clear_XuanKuang(Menu_Item_en_t Item0) ; 

void GUI_Setting_Menu2_Language_Display(void);   
void GUI_Setting_Menu2_TPMSLearn_Display(void); 
void GUI_Setting_Menu2_TPMSLearn_Flash_XuanKuang(Menu_Item_en_t Item0,uint8_t flash);  
void GUI_Setting_Menu3_TPMSLearning_Display(void); 
void GUI_Setting_Menu4_TPMSLearn_Display(void); 
void GUI_Setting_Menu2_IC_Check_Display(void);  
void GUI_Setting_Menu3_IC_Res_Display(void);
void GUI_Setting_Menu2_FactoryReset_Display(void);
void GUI_Setting_Menu3_FactoryReset_Clear_XuanKuang(Menu_Item_en_t Item0) ;
void GUI_Setting_Menu3_FactoryReset_Draw_XuanKuang(Menu_Item_en_t Item0);
void GUI_Setting_Menu3_FactoryReset_Display(void);  
void GUI_Navi_Demand_Alam_Display(void);	

void GUI_Setting_Menu2_Time_Clear_XuanKuang(Menu_Item_en_t Item0);  
void GUI_Setting_Menu2_Time_Draw_XuanKuang(Menu_Item_en_t Item0);  
void GUI_Setting_Menu3_TimeMode_Display(void); 

void GUI_Setting_Menu3_TimeClock_Display(void);  
void GUI_Setting_Menu3_TimeClock_Clear_XuanKuang(Menu_Item_en_t Item0); 
void GUI_Setting_Menu3_TimeClock_Draw_XuanKuang(Menu_Item_en_t Item0) ;

//void GUI_DoorOpen_Warning_Display( INT8U Refresh); 
void GUI_PopAlarm_Display(INT16U  PopupAlarmDis );
void GUI_Alarm_Demand_Display(INT16U  PopupAlarmDis);
//void GUI_PDC_Warning_Display(INT16U PopupAlarmDis, INT8U Refresh);
void GUI_MANIT_Warning_Display(INT32U ManitDis, INT8U Refresh);
void NavigationBar_Page_Display( void );
void GUI_OTA_Display( OTA_HMI_Ctrl_Struct  OTA );	

//void GUI_Alarm_Demand_Clear_XuanKuang(Menu_Item_en_t Item0);  
//void GUI_Alarm_Demand_Draw_XuanKuang(Menu_Item_en_t Item0);  

/***************************************************/
INT8U GUI_Display_Get_Index(INT8U character) ;
INT8U GUI_Display_Get_Index_14(INT8U character) ;
INT8U GUI_Display_Get_Index_18(INT8U character) ;
extern void  GUI_Display_Version_Code_Service(INT8U StarX, INT8U  PosY,INT8U *Str,  INT8U *far Version[] ) ;
extern void GUI_General_Digit_Display(uint32_t Digit, INT8U *far Font[], uint8_t Len, uint8_t Blank, const uint16_t *px, uint16_t y) ;
extern void Clear_pBmp(uint16_t StartX, uint16_t StartY, uint8_t *__far pBmp);
extern void Clear_Box(uint16_t StartX, uint16_t StartY, uint16_t EndX, uint16_t EndY);

extern void Clear_All(void );
extern void Clear_Middle(void );
extern void Clear_Mid_Under(void );
extern void Clear_Above(void );
extern void GUI_BJ_TRIP_Display( INT32U  MileageDisp, INT8U Refresh);
extern void GUI_TPMS_Warning_Display( _MenuDispTpmsCtrl_Struct Msg , uint8_t Refresh  ) ;

void GUI_Setting_Menu1_Draw_XuanKuang(Menu_Item_en_t Item0, INT8U Dir);
void GUI_Setting_Menu1_Clear_XuanKuang(Menu_Item_en_t Item0, INT8U Dir);

extern void Gui_Display_Service(void );


void Gui_AirPress1(INT8U Valid,INT8U AirPress1,INT8U Refresh);
void Gui_AirPress2(INT8U Valid,INT8U AirPress2,INT8U Refresh);
void Gui_OutTmep(INT8U Valid, INT8U Temp, INT8U Warn, INT8U Refresh);
void Gui_Soc(INT16U Soc,INT8U Refresh);
void Gui_AvgSpeed(INT8U Valid, INT8U AvgSpeed, INT8U Refresh);
void Gui_AvgPowCon(INT8U Valid, INT32U AvgPowCon, INT8U Refresh) ;
void Gui_InsPowCon(INT8U Valid, INT16U InsPowCon, INT8U Refresh);
void Gui_Elec_Range(INT8U Valid, INT16U Range, INT8U Refresh);
void Gui_Elec_Fuel_Range(INT8U Valid, INT32U Range, INT8U Refresh);
void Gui_WorkVoltage(INT8U Valid, INT32U WorkVoltage, INT8U Refresh);
void Gui_BatteyVoltage(INT8U Valid,INT16U BatteyVoltage,INT8U Refresh);
void Gui_BatteyMaxVoltage(INT8U Valid,INT8U BatteyMaxVoltage,INT8U Refresh);
void Gui_BatteyMinVoltage(INT8U Valid,INT8U BatteyMinVoltage,INT8U Refresh);
void Gui_WorkCurrent(INT8U Valid,INT16U WorkCurrent,INT8U Symbol, INT8U Refresh);
void Gui_SurPlusPower(INT8U Valid,INT16U SurPlusPower,INT8U Refresh);
void DriverTime(INT8U Hour, INT8U Minute,INT8U Refresh);
void Gui_FaultCode(INT8U Valid, INT16U FaultCode,  INT8U Refresh);
void Gui_BatteyMaxTemp(INT8U Valid, INT8U MaxTemp, INT8U Symbol,  INT8U Refresh);
void Gui_BatteyMinTemp(INT8U Valid, INT8U MinTemp, INT8U Symbol,  INT8U Refresh);
void Gui_CruiseSpeed(INT8U Valid, INT16U CruiseSpeed,INT8U Refresh);
void Gui_ChargeSoc(INT16U Soc,INT8U Hour,INT8U Minute,INT8U Refresh);
void GUI_Setting_Menu3_Clear_AvgEcl_Display(void);
void Gui_DriveMode(INT8U Valid, INT8U Eco, INT8U Refresh);

void Gui_POPUP_TYPE_HINT(INT16U PopupAlarmDis, INT8U Refresh);
void Confirm_Cancel59(void);
#endif