
#ifndef _POPUP_LIST_H_
#define _POPUP_LIST_H_

#include "stdint.h"
#include "Sound_List.h"
#include "Popup_Message_List.h"

/******************************************************************************
报警名称列表

注意：1. 报警名称所指代的序号应与该报警位于报警属性表中的序号一一对应
      2. 标注有的"[报警类]"的为报警类名称,不可直接用于报警的申请与删除,但可用于
         该类报警的查询
******************************************************************************/
enum PopupName
{ 
  POPUP_PEPS_Fault,            // PEPS 系统异常  2
  POPUP_ESCL_Fault,            // ESCL 异常    1
  POPUP_Engine_Prewarming,     // 发动机预热，禁止启动         6
  POPUP_Prewarming_End,        // 发动机预热结束   5
  POPUP_Press_Brake_Start,     // 踩刹车启动     7
  POPUP_Press_clutch_Start,    // 踩离合启动    8
  POPUP_Key_Not_Found,         // 无钥匙
  POPUP_No_Key_Incar,          // 钥匙不在车内    3
  POPUP_N_Level_Start,         // N档启动
  POPUP_Press_SSB_by_key,      // 未检测到钥匙下，请用钥匙末端按启动开关  1
  POPUP_POWEROFF_WithoutN,     // 未挂入N 档下电
  POPUP_Key_Battery_Low,       // 电量低         4
  //POPUP_Lock_WithKeyInCar,     // 闭锁时钥匙在车内
  POPUP_Child_Loca_State,      // 童锁状态
  POPUP_LowPress_ReleaseLimit, // 低压释放限制状态  
  POPUP_Running_Err,
  POPUP_noSignal_Left,         // 无信号
  POPUP_HighTEMP_Left,         // 胎温高
  POPUP_HighPRESSURE_Left,     // Tire pressure high
  POPUP_LowPRESSURE_Left,      // Tire pressure low
  POPUP_noSignal_Right,        // 无信号
  POPUP_HighTEMP_Right,        // 胎温高
  POPUP_HighPRESSURE_Right,    // Tire pressure high
  POPUP_LowPRESSURE_Right,     // Tire pressure low
  POPUP_TireIDStudy_Left,      // 左轮ID未学习
  POPUP_TireIDStudy_Right,     // 右轮ID未学习
};

#define   POPUP_NONE                        0xFF  //无报警

/******************************************************************************
报警成员列表
******************************************************************************/
//蹄片磨损
/*
static const uint8_t PopupMbrListHOOVES[] =
{
  POPUP_LF_HOOVES_ERROR,                //左前
  POPUP_RF_HOOVES_ERROR,                //右前
  POPUP_LR_HOOVES_ERROR,                //左后
  POPUP_RR_HOOVES_ERROR,                //右后
};   
*/

/******************************************************************************
报警类型定义
******************************************************************************/
#define   POPUP_TYPE_FATAL                  0x00  //严重报警信息
#define   POPUP_TYPE_HINT                   0x01  //提示信息
#define   POPUP_TYPE_WARNING                0x02  //报警信息

/******************************************************************************
显示/声音模式
******************************************************************************/
#define   POPUP_MODE_MULTI                  0x00  //可多次触发
#define   POPUP_MODE_SINGLE                 0x01  //只触发一次

/******************************************************************************
报警属性结构
******************************************************************************/
typedef struct
{
  uint8_t        Type;
  uint8_t        Priority;
  uint8_t        Class;
  const uint8_t  *pMbrList;
  uint8_t        MbrCnt;
  uint8_t        Message;
  uint8_t        DispMode;
  uint8_t        Snd;
  uint8_t        SndMode;
} PopupAttributeStruct;

/******************************************************************************
报警属性表
******************************************************************************/
static const PopupAttributeStruct PopupAttributeTable[] =
{
  /*===============================================================================================================================================================================================================================================================================
    报警名称         |      报警类型      | 优先级 | 报警类            |            成员列表         |   成员数量        |            文字消息            |     显示模式     |           报警音            |   声音提示模式
  -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
  // {/* OFF档充电     */  POPUP_TYPE_WARNING,   1, POPUP_CHARGING,            NULL,                       1,                POPUP_MSG_CHARGING            , POPUP_MODE_MULTI,    SND_NONE                 ,  POPUP_MODE_SINGLE,},
  // {/* 水温高        */  POPUP_TYPE_WARNING,   1, POPUP_HI_COOLANT_TEMP,     NULL,                       1,                POPUP_MSG_HI_COOLANT_TEMP     , POPUP_MODE_MULTI,    SND_HI_COOLANT_TEMP_SPEED,  POPUP_MODE_MULTI ,},
  // {/* 气压不足      */  POPUP_TYPE_WARNING,   1, POPUT_HI_PRESSURE,         NULL,                       1,                POPUT_MSG_HI_PRESSURE         , POPUP_MODE_MULTI,    SND_HI_PRESSURE_SPEED    ,  POPUP_MODE_MULTI ,},
  // {/* CAN掉线       */  POPUP_TYPE_WARNING,   1, POPUT_CAN_ERROR,           NULL,                       1,                POPUT_MSG_CAN_ERROR           , POPUP_MODE_MULTI,    SND_CAN_ERROR_SPEED      ,  POPUP_MODE_SINGLE,},
  // {/* 尿素液位低    */  POPUP_TYPE_WARNING,   1, POPUT_LOW_ADBLUE,          NULL,                       1,                POPUT_MSG_LOW_ADBLUE          , POPUP_MODE_MULTI,    SND_LOW_ADBLUE_SPEED     ,  POPUP_MODE_SINGLE,},
  // {/* 尿素质量      */  POPUP_TYPE_WARNING,   1, POPUT_ADBLUE_ERROR,        NULL,                       1,                POPUT_MSG_ADBLUE_ERROR        , POPUP_MODE_MULTI,    SND_ADBLUE_ERROR         ,  POPUP_MODE_SINGLE,},
  // {/* 雷达报警      */    POPUP_TYPE_FATAL,   1, POPUP_RADAR,               NULL,                       1,                POPUP_MSG_RADAR               , POPUP_MODE_MULTI,    SND_RADAR                ,  POPUP_MODE_MULTI ,},
  // {/* 雷达故障      */    POPUP_TYPE_FATAL,   1, POPUP_RADAR_SENSOR_FAILURE,NULL,                       1,                POPUP_MSG_RADAR_SENSOR_FAILURE, POPUP_MODE_MULTI,    SND_RADAR_SENSOR_FAILURE ,  POPUP_MODE_SINGLE,},
  // {/* 蹄片磨损      */  POPUP_TYPE_WARNING,   1, POPUP_HOOVES_ERROR,        PopupMbrListHOOVES,sizeof(PopupMbrListHOOVES),POPUT_MSG_YOUTIPIAN_ERROR     , POPUP_MODE_MULTI,    SND_YOUTIPIAN_ERROR      ,  POPUP_MODE_SINGLE,},
  // {/* 蹄片磨损      */  POPUP_TYPE_WARNING,   1, POPUP_HOOVES_ERROR,        NULL,                       0,                POPUT_MSG_YOUTIPIAN_ERROR     , POPUP_MODE_MULTI,    SND_YOUTIPIAN_ERROR      ,  POPUP_MODE_SINGLE,},
  // {/* 蹄片磨损      */  POPUP_TYPE_WARNING,   1, POPUP_HOOVES_ERROR,        NULL,                       0,                POPUT_MSG_YOUTIPIAN_ERROR     , POPUP_MODE_MULTI,    SND_YOUTIPIAN_ERROR      ,  POPUP_MODE_SINGLE,},
  // {/* 蹄片磨损      */  POPUP_TYPE_WARNING,   1, POPUP_HOOVES_ERROR,        NULL,                       0,                POPUT_MSG_YOUTIPIAN_ERROR     , POPUP_MODE_MULTI,    SND_YOUTIPIAN_ERROR      ,  POPUP_MODE_SINGLE,},
  // {/* 蹄片磨损      */  POPUP_TYPE_WARNING,   1, POPUP_HOOVES_ERROR,        NULL,                       0,                POPUT_MSG_YOUTIPIAN_ERROR     , POPUP_MODE_MULTI,    SND_YOUTIPIAN_ERROR      ,  POPUP_MODE_SINGLE,},
  // {/* 机油压力低    */  POPUP_TYPE_WARNING,   1, POPUT_LOW_OIL,             NULL,                       1,                POPUT_MSG_LOW_OIL             , POPUP_MODE_MULTI,    SND_LOW_OIL_SPEED        ,  POPUP_MODE_SINGLE,},
  // {/* 请加燃油      */  POPUP_TYPE_WARNING,   1, POPUP_LOW_FUEL,            NULL,                       1,                POPUP_MSG_LOW_FUEL            , POPUP_MODE_MULTI,    SND_LOW_FUEL_SPEED       ,  POPUP_MODE_SINGLE,},
  // {/* 制动液位低    */  POPUP_TYPE_WARNING,   1, POPUP_LOW_PBRAKE,          NULL,                       1,                POPUP_MSG_LOW_PBRAKE          , POPUP_MODE_MULTI,    SND_LOW_PBRAKE_SPEED     ,  POPUP_MODE_MULTI ,},
  
  {/* POPUP_PEPS_Fault,           */ POPUP_TYPE_WARNING, 2, POPUP_PEPS_Fault,            NULL,         1,              POPUP_MSG_PEPS_Fault,            POPUP_MODE_MULTI,    SND_NONE                 ,  POPUP_MODE_SINGLE,},
  {/* POPUP_ESCL_Fault,           */ POPUP_TYPE_WARNING, 2, POPUP_ESCL_Fault,            NULL,         1,              POPUP_MSG_ESCL_Fault,            POPUP_MODE_MULTI,    SND_NONE                 ,  POPUP_MODE_SINGLE,},
  {/* POPUP_Engine_Prewarming,    */ POPUP_TYPE_WARNING, 2, POPUP_Engine_Prewarming,     NULL,         1,              POPUP_MSG_Engine_Prewarming,     POPUP_MODE_MULTI,    SND_NONE                 ,  POPUP_MODE_SINGLE,},
  {/* POPUP_Prewarming_End,       */ POPUP_TYPE_WARNING, 2, POPUP_Prewarming_End,        NULL,         1,              POPUP_MSG_Prewarming_End,        POPUP_MODE_MULTI,    SND_NONE                 ,  POPUP_MODE_SINGLE,},
  {/* POPUP_Press_Brake_Start,    */ POPUP_TYPE_WARNING, 2, POPUP_Press_Brake_Start,     NULL,         1,              POPUP_MSG_Press_Brake_Start,     POPUP_MODE_MULTI,    SND_NONE                 ,  POPUP_MODE_SINGLE,},
  {/* POPUP_Press_clutch_Start,   */ POPUP_TYPE_WARNING, 2, POPUP_Press_clutch_Start,    NULL,         1,              POPUP_MSG_Press_clutch_Start,    POPUP_MODE_MULTI,    SND_NONE                 ,  POPUP_MODE_SINGLE,},
  {/* POPUP_Key_Not_Found,        */ POPUP_TYPE_WARNING, 2, POPUP_Key_Not_Found,         NULL,         1,              POPUP_MSG_Key_Not_Found,         POPUP_MODE_MULTI,    SND_NONE                 ,  POPUP_MODE_SINGLE,},
  {/* POPUP_No_Key_Incar,         */ POPUP_TYPE_WARNING, 2, POPUP_No_Key_Incar,          NULL,         1,              POPUP_MSG_No_Key_Incar,          POPUP_MODE_MULTI,    SND_noKeyInCar           ,  POPUP_MODE_MULTI ,},
  {/* POPUP_N_Level_Start,        */ POPUP_TYPE_WARNING, 2, POPUP_N_Level_Start,         NULL,         1,              POPUP_MSG_N_Level_Start,         POPUP_MODE_MULTI,    SND_NONE                 ,  POPUP_MODE_SINGLE,},
  {/* POPUP_Press_SSB_by_key,     */ POPUP_TYPE_WARNING, 2, POPUP_Press_SSB_by_key,      NULL,         1,              POPUP_MSG_Press_SSB_by_key,      POPUP_MODE_MULTI,    SND_NONE                 ,  POPUP_MODE_SINGLE,},
  {/* POPUP_POWEROFF_WithoutN,    */ POPUP_TYPE_WARNING, 2, POPUP_POWEROFF_WithoutN,     NULL,         1,              POPUP_MSG_POWEROFF_WithoutN,     POPUP_MODE_MULTI,    SND_POffWithoutN         ,  POPUP_MODE_MULTI ,},
  {/* POPUP_Key_Battery_Low,      */ POPUP_TYPE_WARNING, 2, POPUP_Key_Battery_Low,       NULL,         1,              POPUP_MSG_Key_Battery_Low,       POPUP_MODE_MULTI,    SND_NONE                 ,  POPUP_MODE_SINGLE,},
  //{/* POPUP_Lock_WithKeyInCar,    */ POPUP_TYPE_HINT,    1, POPUP_Lock_WithKeyInCar,     NULL,         1,              POPUP_MSG_Lock_WithKeyInCar,     POPUP_MODE_MULTI,    SND_NONE                 ,  POPUP_MODE_SINGLE,},

  {/* POPUP_Child_Loca_State,     */ POPUP_TYPE_WARNING, 1, POPUP_Child_Loca_State,      NULL,         1,              POPUP_MSG_Child_Loca_State,      POPUP_MODE_MULTI,    SND_NONE                 ,  POPUP_MODE_SINGLE,},
  {/* POPUP_LowPress_ReleaseLimit,*/ POPUP_TYPE_WARNING, 1, POPUP_LowPress_ReleaseLimit, NULL,         1,              POPUP_MSG_LowPress_ReleaseLimit, POPUP_MODE_MULTI,    SND_NONE                 ,  POPUP_MODE_SINGLE,},
  {/* POPUP_Key_Battery_Low,      */ POPUP_TYPE_WARNING, 2, POPUP_Running_Err,           NULL,         1,              POPUP_MSG_Running_Err,           POPUP_MODE_MULTI,    SND_NONE                 ,  POPUP_MODE_SINGLE,},
  {/* POPUP_noSignal_Left,        */ POPUP_TYPE_WARNING, 0, POPUP_noSignal_Left,         NULL,         1,              POPUP_MSG_noSignal_Left,         POPUP_MODE_MULTI,    SND_NONE                 ,  POPUP_MODE_SINGLE,},
  {/* POPUP_HighTEMP_Left,        */ POPUP_TYPE_WARNING, 0, POPUP_HighTEMP_Left,         NULL,         1,              POPUP_MSG_HighTEMP_Left,         POPUP_MODE_MULTI,    SND_NONE                 ,  POPUP_MODE_SINGLE,},
  {/* POPUP_HighPRESSURE_Left,    */ POPUP_TYPE_WARNING, 0, POPUP_HighPRESSURE_Left,     NULL,         1,              POPUP_MSG_HighPRESSURE_Left,     POPUP_MODE_MULTI,    SND_NONE                 ,  POPUP_MODE_SINGLE,},
  {/* POPUP_LowPRESSURE_Left,     */ POPUP_TYPE_WARNING, 0, POPUP_LowPRESSURE_Left,      NULL,         1,              POPUP_MSG_LowPRESSURE_Left,      POPUP_MODE_MULTI,    SND_NONE                 ,  POPUP_MODE_SINGLE,},
  {/* POPUP_noSignal_Right,       */ POPUP_TYPE_WARNING, 0, POPUP_noSignal_Right,        NULL,         1,              POPUP_MSG_noSignal_Right,        POPUP_MODE_MULTI,    SND_NONE                 ,  POPUP_MODE_SINGLE,},
  {/* POPUP_HighTEMP_Right,       */ POPUP_TYPE_WARNING, 0, POPUP_HighTEMP_Right,        NULL,         1,              POPUP_MSG_HighTEMP_Right,        POPUP_MODE_MULTI,    SND_NONE                 ,  POPUP_MODE_SINGLE,},
  {/* POPUP_HighPRESSURE_Right,   */ POPUP_TYPE_WARNING, 0, POPUP_HighPRESSURE_Right,    NULL,         1,              POPUP_MSG_HighPRESSURE_Right,    POPUP_MODE_MULTI,    SND_NONE                 ,  POPUP_MODE_SINGLE,},
  {/* POPUP_LowPRESSURE_Right,    */ POPUP_TYPE_WARNING, 0, POPUP_LowPRESSURE_Right,     NULL,         1,              POPUP_MSG_LowPRESSURE_Right,     POPUP_MODE_MULTI,    SND_NONE                 ,  POPUP_MODE_SINGLE,},
  {/* POPUP_TireIDStudy_Left,     */ POPUP_TYPE_WARNING, 0, POPUP_TireIDStudy_Left,      NULL,         1,              POPUP_MSG_TireIDStudy_Left,      POPUP_MODE_MULTI,    SND_NONE                 ,  POPUP_MODE_SINGLE,},
  {/* POPUP_TireIDStudy_Right,    */ POPUP_TYPE_WARNING, 0, POPUP_TireIDStudy_Right,     NULL,         1,              POPUP_MSG_TireIDStudy_Right,     POPUP_MODE_MULTI,    SND_NONE                 ,  POPUP_MODE_SINGLE,},
  
  /*=============================================================================================================================================================================================================================================================================*/
};

/******************************************************************************
报警属性表统计信息       
******************************************************************************/
#define   POPUP_NUMBER_TOTAL                (sizeof(PopupAttributeTable) / sizeof(PopupAttributeStruct))
#define   POPUP_NUMBER_FATAL                1
#define   POPUP_NUMBER_HINT                 1
#define   POPUP_NUMBER_WARNING              25

#define   POPUP_PRIORITY_NUMBER_FATAL       1
#define   POPUP_PRIORITY_NUMBER_HINT        1
#define   POPUP_PRIORITY_NUMBER_WARNING     3

#endif