GUI.h 11.8 KB
Newer Older
崔立宝's avatar
崔立宝 committed
1 2 3

#ifndef _GUI_H_
#define _GUI_H_
4

崔立宝's avatar
崔立宝 committed
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
#include "Data_Processor.h"
#include "CRG.h"
#include "Non_volatile_Memorys.h"
#include "System_Status_Monitor.h"
#include "TFT_LCD.h"
#include "stdint.h"
#include "IO_Manager.h"
#include "Popup_List.h"
#include "Telltales.h"
#include "Unit_Conv.h"
#include "Popup_Scheduler.h"
#include "Gauges.h"       //----hyq--20190430

//#include "Radar_R3.h"
extern uint16_t  Vspeed_Seg_Disp[];
//extern uint16_t  Espeed_Seg_Disp[];
/******************************************************************************
显示模式
******************************************************************************/

#define   GUI_DISP_MODE_NORMAL              0x00    //正常
#define   GUI_DISP_MODE_NEGATIVE            0x01    //负数
#define   GUI_DISP_MODE_BLANK               0x02    //空白
#define   GUI_DISP_MODE_INVALID             0x03    //无效

/*** 全局变量 ***/
extern uint8_t  DataAmbientTempDispMode;
extern uint8_t  DataAmbientTemp;
extern uint8_t  DataAmbientTempUnit;

#define  DATA_AMBIENT_TEMP_DISP_MODE        DataAmbientTempDispMode
#define  DATA_AMBIENT_TEMP                  DataAmbientTemp
#define  DATA_AMBIENT_TEMP_UNIT             DataAmbientTempUnit

39
/***************************行车电脑时间***************************************/
崔立宝's avatar
崔立宝 committed
40 41 42 43
//时间
static const uint16_t GUIBGClockHourPosX[]   = {288, 271};
static const uint16_t GUIBGClockMinutePosX[] = {330, 313};
//电压
44
static const uint16_t GUIBatPosX[]  = {95, 82, 69};
崔立宝's avatar
崔立宝 committed
45
//温度
46
static const uint16_t GUITempPosX[] = {485, 468};
崔立宝's avatar
崔立宝 committed
47
//电压
48
static const uint16_t GUIVolPosX[]  = {198, 187, 176};
崔立宝's avatar
崔立宝 committed
49
//电流
50
static const uint16_t GUICurPosX[]  = {88, 76, 64};
崔立宝's avatar
崔立宝 committed
51
//ODO
52
static const uint16_t GUIODOPosX[]  = {174, 157, 140, 123, 106, 89};
崔立宝's avatar
崔立宝 committed
53 54 55 56 57 58
//TRIP
static const uint16_t GUITirpPosX[] = {717, 692, 675, 658};

static const uint16_t GUIBGClockHour25PosY[]   = {147, 188};
static const uint16_t GUIBGClockMinute25PosY[] = {41, 82};

59
static const uint16_t GUIBGClockSecondPosy[] = {135, 155}; //测试用秒
崔立宝's avatar
崔立宝 committed
60 61 62 63 64
//车速
static const uint16_t GUIVehPosX3[] = {397, 340, 283};
static const uint16_t GUIVehPosX2[] = {120, 78};
static const uint16_t GUIVehPosX1[] = {340};
//转速
65
static const uint16_t GUIEngPosX[]  = {407, 356};
崔立宝's avatar
崔立宝 committed
66 67 68
//OFF 档充电
static const uint16_t GUICharging[] = {49, 41, 33};

69
static const uint16_t GUIFuelAvePosy[] = {23, 112, 181};
崔立宝's avatar
崔立宝 committed
70 71

//续航里程
72
static const uint16_t GUIDTEPosX3[] = {321, 302, 282, 262};
崔立宝's avatar
崔立宝 committed
73 74

//平均油耗
75
static const uint16_t GUIRAFCPosX[]  = {406, 376, 356};
崔立宝's avatar
崔立宝 committed
76 77 78
//瞬时油耗
static const uint16_t GUICurONPosX3[] = {505, 475, 455};
//车距
79
static const uint16_t GUICurONPosX2[] = {407, 373};
崔立宝's avatar
崔立宝 committed
80
//ADAS
81
static const uint16_t GUIADASPosX[] = {286, 271};
崔立宝's avatar
崔立宝 committed
82 83 84
//胎压左
static const uint16_t GUICurTPLPosX2[] = {309, 289};
//胎压右
85
static const uint16_t GUICurTPRPosX2[] = {462, 442};
崔立宝's avatar
崔立宝 committed
86 87 88
//胎温左
static const uint16_t GUICurTTLPosX3[] = {309, 296};
//胎温右
89
static const uint16_t GUICurTTRPosX3[] = {461, 449};
崔立宝's avatar
崔立宝 committed
90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192
/*************************************************************************
行车电脑名称列表
*************************************************************************/
#define   GUI_DRIVE_INFO_AVG_FUEL_CONS      0x00
#define   GUI_DRIVE_INFO_INST_FUEL_CONS     0x01
#define   GUI_DRIVE_INFO_DTE                0x02
#define   GUI_DRIVE_INFO_DRIVING_TIME       0x03
#define   GUI_DRIVE_INFO_TPMS               0x04
#define   GUI_DRIVE_INFO_WARNING            0x05

#define   DATA_GEAR_P1                      0x01
#define   DATA_GEAR_R1                      0x02
#define   DATA_GEAR_N1                      0x03
#define   DATA_GEAR_D1                      0x04
#define   DATA_GEAR_S1                      0xF3
#define   DATA_GEAR_L1                      0xF4
#define   DATA_GEAR_VALID                   0xFF

#define   DATA_GEAR_11                      0x01
#define   DATA_GEAR_21                      0x02
#define   DATA_GEAR_31                      0x03
#define   DATA_GEAR_41                      0x04
#define   DATA_GEAR_51                      0x05
#define   DATA_GEAR_61                      0x06

/*** 数字显示状态结构 ***/
typedef struct
{
  uint8_t Warning;
  uint8_t PressureStatus;
  uint8_t TemperatureStatus;
} GUITPMSTireStruct;

/*** 数字显示状态 ***/
#define   GUI_TPMS_DIGIT_NORMAL             0x00
#define   GUI_TPMS_DIGIT_INVALID            0x01
#define   GUI_TPMS_DIGIT_BLANK              0x02
#define   GUI_TPMS_DIGIT_RED                0x80

/*** 报警显示方式 ***/
#define   GUI_TPMS_NO_WARNING               0x00
#define   GUI_TPMS_WARNING_WITH_DIGIT       0x01
#define   GUI_TPMS_WARNING_WITHOUT_DIGIT    0x02

/*** 文字列表结构 ***/
typedef struct
{
  uint16_t  Text;
  uint16_t  X13;
  uint16_t  Y13;
} GUITPMSTextStruct;

/*===============================================================================
                             TPMS状态文字列表
---------------------------------------------------------------------------------
               |                                |
      语言     |            文字名称            |
               |                                | x坐标 | y坐标
---------------------------------------------------------------------------------*/

/*************************************************************************
胎压学习模式
*************************************************************************/
 #define Learnfailed   0
 #define Learning      1
 #define Learnfanish   2
/******************************************************************************
数字字体
******************************************************************************/
#define DIGIT_FONT_TIME			         SN_NB_16_00_png            //时间显示数字
#define DIGIT_FONT_VEHICLE           SN_NB_55_00_png            //车速数字
#define DIGIT_FONT_ENGINE            SN_NB_32_5_00_png          //转速数字
#define DIGIT_FONT_DTE               SN_NB_17_00_png            //续航里程数字
/******************************************************************************
开机动画
******************************************************************************/
typedef struct
{
  uint8_t Status;
  uint8_t FrameCnt;
  uint8_t Timer;
} GUIAnimationPlayStruct;

/******************************************************************************
报警
******************************************************************************/
typedef struct
{
  uint16_t       HImage;     //三厢车图片/手动
  uint16_t       SImage;
} GUIGeneralPopupStruct;

/*typedef struct
{
  const uint16_t *pText;    //文字
  uint16_t       HImage;    //两厢车图片
  //uint16_t       SImage;    //三厢车图片
}GUIGeneralPopupStruct;   */                                      
/*===============================================================================================
                                       弹出信息文字坐标
-------------------------------------------------------------------------------------------------
          *          |         坐标             | 中文 | 英语
-----------------------------------------------------------------------------------------------*/
193 194
static const uint16_t  GUIPopupTextPosX[] =    {  265,   136, };
static const uint16_t  GUIPopupTextPosY[] =    {  140,    48, };
崔立宝's avatar
崔立宝 committed
195

196 197
static const uint16_t  GUIPopupTextcanPosX[] = {  199,    23, };
static const uint16_t  GUIPopupTextcanPosY[] = {  32,    130, };
崔立宝's avatar
崔立宝 committed
198

199 200
static const uint16_t  GUIPopupTextwenziPosX[] = { 136,    23, };
static const uint16_t  GUIPopupTextwenziPosY[] = {  48,   130, };
崔立宝's avatar
崔立宝 committed
201 202 203 204 205 206 207 208
/*===========================================================================================================*/

/*************************************************************************************************************
报警显示表      hyq
*************************************************************************************************************/
static const GUIGeneralPopupStruct GUIGeneralPopupTable[] =
{
  /* |            图片              |    |            文字                |*/
209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229
  // { 0,                                                    0 },                                         
  // { 0,                                                    0 },                                         
  // { 0,                                                    0 },                          
  // { 0,                                                    0 },           
  // { 0,                                                    0 },            
  // { 0,                                                    0 },            
  // { 0,                                                    0 },            
  // { 0,                                                    0 },            
  // { 0,                                                    0 },                                     
  // { 0,                                                    0 },                                     
  // { 0,                                                    0 }, 
  { SN_ALARM_14_png,                                   0xFF },
  { SN_ALARM_13_png,                                   0xFF },
  { SN_ALARM_20_png,                                   0xFF },
  { SN_ALARM_19_png,                                   0xFF },
  { SN_ALARM_10_png,                                   0xFF },
  { SN_ALARM_07_png,                                   0xFF }, //6
  { SN_ALARM_11_png,                                   0xFF }, 
  { SN_ALARM_17_png,                                   0xFF }, 
  { SN_ALARM_09_png,                                   0xFF },
  { SN_ALARM_15_png,                                   0xFF },
崔立宝's avatar
崔立宝 committed
230
  
231 232 233 234 235
  { SN_ALARM_25_png,                        SN_ALARM_22_png },  
  { SN_ALARM_12_png,                                   0xFF },   
  { SN_qingcaixiashacheshifangzhuche_png,              0xFF }, 
  { SN_GasPressLow_png,                                0xFF }, 
  { SN_running_staus_err_png,                          0xFF },                                
崔立宝's avatar
崔立宝 committed
236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278
  /*==========================================================================================================*/
};
/***************************************应用函数***********************************************************/
void Clear_TFT(void);
//----开机动画
void GUI_Animation_Frame_Display(uint8_t Frame);
//----时间日期显示    
void GUI_BG_Clock_Display(uint8_t Mode);
void GUI_BG_TEMP_Display(uint8_t Mode);
void GUI_BG_Gear_Alarm_Display(uint8_t Mode);      
void GUI_BG_Gear_Display(uint8_t Mode);     
void GUI_BG_TRIP_A_Display(uint8_t ValidA, uint16_t TripA, uint8_t TripA_Mode) ;
void GUI_BG_ODO_Display(uint8_t Valid, uint32_t Mileage) ;

void GUI_BG_Oil_Temp_Display(uint8_t Mode, uint8_t Temp);
void GUI_Cruise_SET(uint8_t Speednum);
void GUI_General_Digit_Display(uint32_t Digit, uint16_t Font, uint8_t Len, uint8_t Blank, uint8_t Layer, const uint16_t *px, uint16_t y, uint8_t Scale);
//void GUI_General_Digit_Display(uint32_t Digit, uint16_t Font, uint8_t Len, uint8_t Blank, uint8_t Layer, const uint16_t x, uint16_t *py, uint8_t Scale);
/****************************************报警**************************************************************/
void GUI_General_Popup_Display(uint8_t PopupID);
void GUI_General_Charging_Popup_Display(uint8_t PopupID);
void GUI_RADAR_Display(uint8_t PopupID);
void GUI_HOOVES_Display(uint8_t PopupMsg);
void GUI_Door_Open_Display(uint8_t PwrMode, uint8_t PopupMsg);
/****************************************行车电脑********************************************************/
void GUI_BG_Vehicle_Display(uint8_t SegNum);
void SEG_LCD_Vehicle_Speed_Num_Display(uint16_t Value);

void GUI_BG_Engine_Display(uint8_t SegNum);
void SEG_LCD_Engine_Speed_Num_Display(uint16_t Value);

void GUI_BG_GAS1_Display(uint8_t SegNum);
void GUI_BG_GAS2_Display(uint8_t SegNum);

 void  GUI_TPMS_Display(uint8_t PopupID);
/********************************************************************************************************/

void Gauges_VSpeed_LCD_Status(void);
void Gauges_ESpeed_LCD_Status(void);
void Gauges_GAS1_LCD_Status(void);
void Gauges_GAS2_LCD_Status(void);
void Telltale_LCD_Display(void);
void Menu1_1_Display(void);
279
void Menu2_3_Display(void);
崔立宝's avatar
崔立宝 committed
280
void Menu2_4_Display(void);
281
void GUI_ADAS_Display(void);
崔立宝's avatar
崔立宝 committed
282
#endif