Commit bdf23998 authored by hu's avatar hu

增加发动机油&滤清器,功能未验证

parent 8eea069c
......@@ -404,16 +404,16 @@ const st_CANMsgAttribute CAN_MSG_CONST_ARRAY[ID_TOTAL_MAX] =
(( void * )0),
(( void * )0),
},
//{
// {0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u},
// {0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u},
// {0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u},
// 5000ul,
// 0x18EA0021ul,
// (( void * )0),
// (( void * )0),
// (( void * )0),
//},
{
{0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u},
{0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u},
{0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u},
5000ul,
0x18FF3018ul,
(( void * )0),
(( void * )0),
(( void * )0),
},
{
{0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u},
{0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u},
......@@ -996,6 +996,16 @@ uint8_t Get_ID_18FEED00_Sig_Maximum_Vehicle_Speed_Limit(void)
// ((uint32_t)((uint32_t)CAN_MSG_Read(ID_CanMsg18EA0021_Msg_Count, 0u) >> 0u) & 0xFFu));
//}
uint8_t Get_ID_18FF3018_Sig_Engine_oil_filte(void)
{
return (((uint8_t)((uint8_t)CAN_MSG_Read(ID_CanMsg18FF3018_Msg_Count, 0u) >> 6u) & 0x03u));
}
uint8_t Get_ID_18FF3018_Sig_Starter(void)
{
return (((uint8_t)((uint8_t)CAN_MSG_Read(ID_CanMsg18FF3018_Msg_Count, 0u) >> 0u) & 0x03u));
}
uint8_t Get_ID_0C010305_Sig_Auto_EcoPow(void)
{
return (((uint8_t)((uint8_t)CAN_MSG_Read(ID_CanMsg0C010305_Msg_Count, 5u) >> 2u) & 0x03u));
......@@ -1147,9 +1157,9 @@ uint8_t Co_Can_ConvertSubID(uint32_t MsgID)
case ID_CanMsg18FEED00_Msg:
u8Result = ID_CanMsg18FEED00_Msg_Count;
break;
//case ID_CanMsg18EA0021_Msg:
// u8Result = ID_CanMsg18EA0021_Msg_Count;
// break;
case ID_CanMsg18FF3018_Msg:
u8Result = ID_CanMsg18FF3018_Msg_Count;
break;
case ID_CanMsg18021733_Msg:
u8Result = ID_CanMsg18021733_Msg_Count;
break;
......
......@@ -44,7 +44,7 @@ typedef enum
/*35*/ID_CanMsg18FD7C00_Msg_Count,
/*36*/ID_CanMsg18FECAE8_Msg_Count,
/*37*/ID_CanMsg18FEED00_Msg_Count,
/*38*///ID_CanMsg18EA0021_Msg_Count,
/*38*/ID_CanMsg18FF3018_Msg_Count,
/*39*/ID_CanMsg18021733_Msg_Count,
/*40*/ID_CanMsg0C010305_Msg_Count,
/*41*/ID_CanMsg18FECA2A_Msg_Count,
......@@ -116,7 +116,7 @@ extern const st_CAN_SendAttribute st_CANSendAttr[ID_SEND_TOTAL] ;
#define ID_CanMsg18FD7C00_Msg 0x18FD7C00u
#define ID_CanMsg18FECAE8_Msg 0x18FECAE8u
#define ID_CanMsg18FEED00_Msg 0x18FEED00u
//#define ID_CanMsg18EA0021_Msg 0x18EA0021u
#define ID_CanMsg18FF3018_Msg 0x18FF3018u
#define ID_CanMsg18021733_Msg 0x18021733u
#define ID_CanMsg0C010305_Msg 0x0C010305u
#define ID_CanMsg18FECA2A_Msg 0x18FECA2Au
......@@ -227,6 +227,8 @@ extern uint8_t Get_ID_18FD7C00_Sig_DPF_Lamp_Status_Amber(void);
extern uint8_t Get_ID_18FECAE8_Sig_Amber_Warning_Lamp_Status(void);
extern uint8_t Get_ID_18FEED00_Sig_Maximum_Vehicle_Speed_Limit(void);
//extern uint32_t Get_ID_18EA0021_Sig_CruiseControl_VehicleSpeedSetup(void);
extern uint8_t Get_ID_18FF3018_Sig_Engine_oil_filte(void);
extern uint8_t Get_ID_18FF3018_Sig_Starter(void);
extern uint8_t Get_ID_0C010305_Sig_Auto_EcoPow(void);
extern uint32_t Get_ID_18FECA03_Sig_SPN(void);
extern uint8_t Get_ID_18FECA03_Sig_FMI(void);
......
......@@ -1325,6 +1325,8 @@ void Drive_Info_IC1_STATUS_Rx(void)
case 0x64:
User_ECU.TripB_Runing = Temp;
break;
case 0x20:
User_ECU.Engine_Oil = Temp;
case 0x22:
User_ECU.Engine_Surplus = Temp;
break;
......@@ -1365,6 +1367,8 @@ void Drive_Info_IC1_STATUS_Rx(void)
case 0x64:
User_ECU.TripB_Runing = Temp;
break;
case 0x20:
User_ECU.Engine_Oil = Temp;
case 0x22:
User_ECU.Engine_Surplus = Temp;
break;
......
......@@ -15,8 +15,8 @@ typedef struct
uint32_t TripB_Fuel_Consume;
uint32_t TripB_Idling;
uint32_t TripB_Runing;
uint32_t Engine_Oil;
uint32_t Engine_Surplus;
uint32_t Reserved1;
} USER_ECU;
extern USER_ECU User_ECU;
......
......@@ -3987,52 +3987,114 @@ void GUI_BG_RepMenu_3_1_Display(uint8_t Mode)
uint32_t User_Value = 0u;
uint8_t User_FLAG = 0u;
uint8_t Sig_Engine_oil = 0u;
uint8_t Sig_Starter = 0u;
uint8_t CanStatus = 0u;
if (Mode == GUI_DISP_MODE_NORMAL)
{
User_Value = User_App.User_FDJYLQQ; /*显示数据*/
User_FLAG = State_Flag.User_FDJYLQQ_FLAG; /*显示状态*/
/*发动机油&滤清器*/ /*User_ECU.Engine_Oil*/ /*User_App.User_FDJYLQQ = User_ECU.Engine_Oil;*/
Sig_Engine_oil = Get_ID_18FF3018_Sig_Engine_oil_filte();/*78*/
Sig_Starter = Get_ID_18FF3018_Sig_Starter();/*12*/
CanStatus = CAN_MSG_Status(ID_CanMsg18EF1718_Msg_Count);
if (User_Value > 0u)
User_Value = User_ECU.Engine_Oil;/*显示数据*/
if (Sig_Engine_oil)
{
if (User_Value > 999u)
GUI_General_Display(MENU_Sprite, CN_User_Menu3_01_12, GUI_BLENDMODE_SRC_OVER); /*距离更换*/
GUI_General_Display(MENU_Sprite, CN_User_Menu3_01_ERROR, GUI_BLENDMODE_SRC_OVER); /*error*/
}
else
{
if (Sig_Engine_oil == 1u)/*事前报警*/
{
GUI_General_Display(MENU_Sprite, CN_User_Menu3_01_12, GUI_BLENDMODE_SRC_OVER); /*距离更换*/
GUI_General_Display(MENU_Sprite, CN_User_Menu3_01_12, GUI_BLENDMODE_SRC_OVER); /*更换*/
//if (User_Value > 1000)
//{
// GUI_General_Display(MENU_Sprite, CN_User_Menu3_01_12, GUI_BLENDMODE_SRC_OVER); /*距离更换*/
//}
//else
//{
// GUI_General_Display(MENU_Sprite, CN_User_Menu3_01_14, GUI_BLENDMODE_SRC_OVER); /*即将更换*/
//}
GUI_General_Digit_Display(MENU_Sprite, User_Value, Nb_15_0, 6u, 5u, GUI_REP1_X, 277u, GUI_BLENDMODE_SRC_OVER);
GUI_Translate_Display(MENU_Sprite, Nb_15_douhao, 534u, 281u, GUI_BLENDMODE_SRC_OVER); /*逗号*/
if (User_Value >= 1000u)
{
GUI_Translate_Display(MENU_Sprite, Nb_15_douhao, 534u, 281u, GUI_BLENDMODE_SRC_OVER); /*逗号*/
}
else
{
GUI_General_Display(MENU_Sprite, SpriteSize, GUI_BLENDMODE_SRC_OVER);
}
}
else
else if ((Sig_Engine_oil == 0u) && (Sig_Starter == 0u)) /*无报警*/
{
GUI_General_Display(MENU_Sprite, CN_User_Menu3_01_12, GUI_BLENDMODE_SRC_OVER); /*请更换*/
GUI_General_Display(MENU_Sprite, SpriteSize, GUI_BLENDMODE_SRC_OVER);
}
GUI_General_Digit_Display(MENU_Sprite, User_Value, Nb_15_0, 6u, 5u, GUI_REP1_X, 277u, GUI_BLENDMODE_SRC_OVER);
}
else
{
GUI_General_Display(MENU_Sprite, CN_User_Menu3_01_13, GUI_BLENDMODE_SRC_OVER); /*请更换*/
GUI_Translate_Display(MENU_Sprite, Nb_15_douhao, 534u, 281u, GUI_BLENDMODE_SRC_OVER); /*逗号*/
if (User_FLAG == 1u)
GUI_General_Digit_Display(MENU_Sprite, User_Value, Nb_15_0, 6u, 5u, GUI_REP1_X, 277u, GUI_BLENDMODE_SRC_OVER);
}
else if ((Sig_Engine_oil == 2u) && (Sig_Starter == 2u)) /*本报警*/
{
GUI_Translate_Display(MENU_Sprite, Nb_15_douhao, 534u, 281u, GUI_BLENDMODE_SRC_OVER); /*逗号*/
GUI_General_Display(MENU_Sprite, CN_User_Menu3_01_12, GUI_BLENDMODE_SRC_OVER); /*请更换*/
GUI_Translate_Display(MENU_Sprite, Nb_15_fuhao, 506u, 279u, GUI_BLENDMODE_SRC_OVER); /*负号*/
GUI_Translate_Display(MENU_Sprite, Nb_15_douhao, 534u, 281u, GUI_BLENDMODE_SRC_OVER); /*逗号*/
GUI_General_Digit_Display(MENU_Sprite, 1000u, Nb_15_0, 4u, 3u, GUI_REP_X, 277u, GUI_BLENDMODE_SRC_OVER);
GUI_General_Digit_Display(MENU_Sprite, 1000u, Nb_15_0, 6u, 5u, GUI_REP1_X, 277u, GUI_BLENDMODE_SRC_OVER);
}
else if (User_FLAG == 3u)
else if ((Sig_Engine_oil == 3u) && (Sig_Starter == 3u))/*空白*/
{
GUI_General_Display(MENU_Sprite, CN_User_Menu3_01_12, GUI_BLENDMODE_SRC_OVER); /*请更换*/
GUI_General_Display(MENU_Sprite, SpriteSize, GUI_BLENDMODE_SRC_OVER);
}
else
{
GUI_General_Display(MENU_Sprite, CN_User_Menu3_01_12, GUI_BLENDMODE_SRC_OVER); /*请更换*/
GUI_General_Display(MENU_Sprite, SpriteSize, GUI_BLENDMODE_SRC_OVER);
}
}
// User_Value = User_App.User_FDJYLQQ; /*显示数据*/
// User_FLAG = State_Flag.User_FDJYLQQ_FLAG; /*显示状态*/
//
// if (User_Value > 0u)
// {
// if (User_Value > 999u)
// {
// GUI_General_Display(MENU_Sprite, CN_User_Menu3_01_12, GUI_BLENDMODE_SRC_OVER); /*距离更换*/
//
// //if (User_Value > 1000)
// //{
// // GUI_General_Display(MENU_Sprite, CN_User_Menu3_01_12, GUI_BLENDMODE_SRC_OVER); /*距离更换*/
// //}
// //else
// //{
// // GUI_General_Display(MENU_Sprite, CN_User_Menu3_01_14, GUI_BLENDMODE_SRC_OVER); /*即将更换*/
// //}
//
// GUI_Translate_Display(MENU_Sprite, Nb_15_douhao, 534u, 281u, GUI_BLENDMODE_SRC_OVER); /*逗号*/
// }
// else
// {
// GUI_General_Display(MENU_Sprite, CN_User_Menu3_01_12, GUI_BLENDMODE_SRC_OVER); /*请更换*/
// GUI_General_Display(MENU_Sprite, SpriteSize, GUI_BLENDMODE_SRC_OVER);
// }
//
// GUI_General_Digit_Display(MENU_Sprite, User_Value, Nb_15_0, 6u, 5u, GUI_REP1_X, 277u, GUI_BLENDMODE_SRC_OVER);
// }
// else
// {
// GUI_General_Display(MENU_Sprite, CN_User_Menu3_01_13, GUI_BLENDMODE_SRC_OVER); /*请更换*/
//
// if (User_FLAG == 1u)
// {
// GUI_Translate_Display(MENU_Sprite, Nb_15_douhao, 534u, 281u, GUI_BLENDMODE_SRC_OVER); /*逗号*/
// GUI_Translate_Display(MENU_Sprite, Nb_15_fuhao, 506u, 279u, GUI_BLENDMODE_SRC_OVER); /*负号*/
//
// GUI_General_Digit_Display(MENU_Sprite, 1000u, Nb_15_0, 4u, 3u, GUI_REP_X, 277u, GUI_BLENDMODE_SRC_OVER);
// }
// else if (User_FLAG == 3u)
// {
// GUI_General_Display(MENU_Sprite, SpriteSize, GUI_BLENDMODE_SRC_OVER);
// }
// }
}
else
{
......@@ -6235,30 +6297,33 @@ void GUI_BG_Enter_Return_Display(uint8_t Mode)
void Common_EOL_User_Server(void)
{
/*发动机油*/
if (State_Flag.User_FDJYLQQ_FLAG != 3u)
{
if (User_App.User_FDJYLQQ > 0 )
{
if (User_App.User_FDJYLQQ >= (Data_Read_Trip(EM_TRIP_JY) / 10u))
{
User_App.User_FDJYLQQ = ((uint32_t)K_Line_Set.K_Line_LID4F * 1000u) - Data_Read_Trip(EM_TRIP_JY) / 10u;
}
else
{
User_App.User_FDJYLQQ = 0u;
}
if (User_App.User_FDJYLQQ <= 1000)
{
State_Flag.User_FDJYLQQ_FLAG = 2u;
}
}
else
{
State_Flag.User_FDJYLQQ_FLAG = 1;
}
}
uint8_t Sig_Engine_oil = 0u;
uint8_t Sig_Starter = 0u;
uint8_t CanStatus = 0u;
/*发动机油&滤清器*/
// if (State_Flag.User_FDJYLQQ_FLAG != 3u)
// {
// if (User_App.User_FDJYLQQ > 0 )
// {
// if (User_App.User_FDJYLQQ >= (Data_Read_Trip(EM_TRIP_JY) / 10u))
// {
// User_App.User_FDJYLQQ = ((uint32_t)K_Line_Set.K_Line_LID4F * 1000u) - Data_Read_Trip(EM_TRIP_JY) / 10u;
// }
// else
// {
// User_App.User_FDJYLQQ = 0u;
// }
//
// if (User_App.User_FDJYLQQ <= 1000)
// {
// State_Flag.User_FDJYLQQ_FLAG = 2u;
// }
// }
// else
// {
// State_Flag.User_FDJYLQQ_FLAG = 1;
// }
// }
/*燃油滤清器*/
if ( State_Flag.User_RYLQQ_FLAG != 3u)
......
......@@ -945,18 +945,18 @@ void Level2_6Menu_2Exit(void)
{}
/*----三级菜单----保养通知----系列子菜单*/
/*发动机机油滤清器*/
/*发动机机油滤清器 特殊处理*/
void Level3_2Menu_1Enter(void)
{
if (MenuFlag.Menu_Return)
{
User_App.User_FDJYLQQ = (uint32_t)K_Line_Set.K_Line_LID4F * 1000;
State_Flag.User_FDJYLQQ_FLAG = 0;
MenuFlag.Menu_Return = 0;
Data_Clear_Trip(EM_TRIP_JY);
}
// if (MenuFlag.Menu_Return)
// {
// User_App.User_FDJYLQQ = (uint32_t)K_Line_Set.K_Line_LID4F * 1000;
//
// State_Flag.User_FDJYLQQ_FLAG = 0;
// MenuFlag.Menu_Return = 0;
//
// Data_Clear_Trip(EM_TRIP_JY);
// }
}
void Level3_2Menu_1Do(void)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment