Commit 1aa1c506 authored by 张金硕's avatar 张金硕

feat:新增导航界面水温表和灯的功能

parent 14123428
#include "Data_Coolant.h" #include "Data_Coolant.h"
#include "Components.h" #include "Components.h"
#include "Hysteresis.h" #include "Hysteresis.h"
#define FAST_TIME 20 //20*20 400ms变化一格 #define FAST_TIME 15 //20*20 400ms变化一格
#define NORMAL_TIME 500 //500*20 10s变化一格 #define NORMAL_TIME 500 //500*20 10s变化一格
#define Disconnected_TIME 25 //掉线时间 #define Disconnected_TIME 25 //掉线时间
#pragma ghs section bss = ".myNonInitArea" #pragma ghs section bss = ".myNonInitArea"
...@@ -46,7 +46,7 @@ const HYS_Seg_Table_st_t stHYSSegTablePWM[3] = ...@@ -46,7 +46,7 @@ const HYS_Seg_Table_st_t stHYSSegTablePWM[3] =
const HYS_Attribute_st_t stHysAttribute[HYS_NUM_MAX] = const HYS_Attribute_st_t stHysAttribute[HYS_NUM_MAX] =
{ {
{stHYSSegTableCng, 0U, 7U, 1U}, {stHYSSegTableCng, 0U, 9U, 1U},
{stHYSSegTablePWM, 0U, 3U, 1U}, /*为了过QAC用的,实际完全不会使用*/ {stHYSSegTablePWM, 0U, 3U, 1U}, /*为了过QAC用的,实际完全不会使用*/
}; };
...@@ -113,6 +113,7 @@ void TEMP_KL30_Init ( void ) ...@@ -113,6 +113,7 @@ void TEMP_KL30_Init ( void )
DataCoolantTemp.TEMPMode = 0; DataCoolantTemp.TEMPMode = 0;
DataCoolantTemp_Dis.u8_CurSeg = 0; DataCoolantTemp_Dis.u8_CurSeg = 0;
DataCoolantTemp.TEMPSetp = 0; DataCoolantTemp.TEMPSetp = 0;
DataCoolantTemp.u8_ResStatus = 0;
TEMP_SPEED = 0; TEMP_SPEED = 0;
time_power_on = 0; time_power_on = 0;
time_lost = 0; time_lost = 0;
...@@ -131,6 +132,7 @@ void TEMP_KL15_Init ( void ) ...@@ -131,6 +132,7 @@ void TEMP_KL15_Init ( void )
DataCoolantTemp.u8Res_Valid = 0 ; DataCoolantTemp.u8Res_Valid = 0 ;
DataCoolantTemp.u16Res_ADValue = 0; DataCoolantTemp.u16Res_ADValue = 0;
DataCoolantTemp.u8Res_ADValid = 0; DataCoolantTemp.u8Res_ADValid = 0;
DataCoolantTemp.u8_ResStatus = 0;
DataCoolantTemp_Dis.u8_CurSeg = 0; DataCoolantTemp_Dis.u8_CurSeg = 0;
DataResCoolantTempSampler.Cnt = 0; DataResCoolantTempSampler.Cnt = 0;
DataCoolantTemp.TEMPMode = 0; DataCoolantTemp.TEMPMode = 0;
...@@ -247,6 +249,7 @@ void Data_Coolant_Temp_Processing_Service ( void ) ...@@ -247,6 +249,7 @@ void Data_Coolant_Temp_Processing_Service ( void )
} }
else else
{ {
DataCoolantTemp.u8_ResStatus = 3;//当前状态为开路
DataCoolantTemp.u8Res_Valid = 0 ; DataCoolantTemp.u8Res_Valid = 0 ;
DataCoolantTemp.u16Res_Actual = 0 ; DataCoolantTemp.u16Res_Actual = 0 ;
DataResCoolantTempSampler.ResOpen_InActTimer = 0; DataResCoolantTempSampler.ResOpen_InActTimer = 0;
...@@ -269,16 +272,28 @@ void Data_Coolant_Temp_Processing_Service ( void ) ...@@ -269,16 +272,28 @@ void Data_Coolant_Temp_Processing_Service ( void )
} }
} }
} }
if (DataCoolantTemp.u8Can_Valid ==1) if(DataCoolantTemp.u8Can_Valid || DataCoolantTemp.u8Res_Valid )
{
DataCoolantTemp.u8_ResStatus = 1;//当前状态正常
}
if (DataCoolantTemp.u8Can_Valid == 1)
{ {
DataCoolantTemp.Temp_Value = DataCoolantTemp.u16Can_Actual; DataCoolantTemp.Temp_Value = DataCoolantTemp.u16Can_Actual;
} }
else if( DataCoolantTemp.u8Res_Valid ==1) else if( DataCoolantTemp.u8Res_Valid == 1)
{ {
DataCoolantTemp.Temp_Value = DataCoolantTemp.u16Res_Actual; DataCoolantTemp.Temp_Value = DataCoolantTemp.u16Res_Actual;
if(DataCoolantTemp.u16Res_ADValue < 40)
{
DataCoolantTemp.u8_ResStatus = 2;//当前状态为短路
}
} }
else else
{ {
if(DataCoolantTemp.u8_ResStatus != 3)
{
DataCoolantTemp.u8_ResStatus = 0;
}
DataCoolantTemp.Temp_Value = 0; DataCoolantTemp.Temp_Value = 0;
} }
...@@ -444,3 +459,7 @@ uint16_t GET_DataCollantTempSegValid(void) ...@@ -444,3 +459,7 @@ uint16_t GET_DataCollantTempSegValid(void)
{ {
return DataCoolantTemp.u16Res_ADValue;//DataCoolantTemp_Dis.Dis_Valid; return DataCoolantTemp.u16Res_ADValue;//DataCoolantTemp_Dis.Dis_Valid;
} }
uint16_t GET_DataCollantTempSegStatus(void)
{
return DataCoolantTemp.u8_ResStatus;//DataCoolantTemp_Dis.Dis_Valid;
}
...@@ -31,6 +31,7 @@ typedef struct ...@@ -31,6 +31,7 @@ typedef struct
uint8_t TEMPSetp; uint8_t TEMPSetp;
uint8_t TEMPMode; uint8_t TEMPMode;
uint16_t TEMP_Fastime ; uint16_t TEMP_Fastime ;
uint8_t u8_ResStatus //
}DataCoolantTempStruct; //水温数据结构 }DataCoolantTempStruct; //水温数据结构
...@@ -52,6 +53,7 @@ uint16_t Get_Coolant_Res_To_Temp(uint16_t Temp_Res); ...@@ -52,6 +53,7 @@ uint16_t Get_Coolant_Res_To_Temp(uint16_t Temp_Res);
void Get_Coolant_Temp_Seg(uint16_t Temp_Value); void Get_Coolant_Temp_Seg(uint16_t Temp_Value);
void Data_Coolant_Temp_Display ( void ); void Data_Coolant_Temp_Display ( void );
extern uint16_t GET_DataCollantTempSegValid(void); extern uint16_t GET_DataCollantTempSegValid(void);
extern uint16_t GET_DataCollantTempSegStatus(void);
extern void TEMP_KL30_Init ( void ); extern void TEMP_KL30_Init ( void );
extern void TEMP_KL15_Init ( void ); extern void TEMP_KL15_Init ( void );
extern uint8_t GET_DataCoolantTempSegDisp(void); extern uint8_t GET_DataCoolantTempSegDisp(void);
......
...@@ -20,6 +20,7 @@ uint16_t g_u16voltagenumberup = 0; ...@@ -20,6 +20,7 @@ uint16_t g_u16voltagenumberup = 0;
uint16_t g_u16voltagenumberdown = 160; uint16_t g_u16voltagenumberdown = 160;
uint8_t Voltage_Selfcheck = 1; uint8_t Voltage_Selfcheck = 1;
uint8_t TFT_SelfCheck = 0; uint8_t TFT_SelfCheck = 0;
uint8_t CoolantOpenShortCirTimeCnt = 0;
//自检函数 //自检函数
void AMT630H_GUI_BACKGRAND_SelfCheck(void); void AMT630H_GUI_BACKGRAND_SelfCheck(void);
...@@ -2939,14 +2940,14 @@ static void AMT630H_GUI_PhoneConnect_Light() ...@@ -2939,14 +2940,14 @@ static void AMT630H_GUI_PhoneConnect_Light()
{ {
SetPagePic(GRAPHICS_PAGE_0, Pic_0468_819_486); SetPagePic(GRAPHICS_PAGE_0, Pic_0468_819_486);
} }
if(Get_TelltalesLedSts(em_LED_Coolant_Temperature)) // if(Get_TelltalesLedSts(em_LED_Coolant_Temperature))
{ // {
SetPagePic(GRAPHICS_PAGE_0, Pic_0436_981_528); // SetPagePic(GRAPHICS_PAGE_0, Pic_0436_981_528);
} // }
else // else
{ // {
SetPagePic(GRAPHICS_PAGE_0, Pic_0435_981_528); // SetPagePic(GRAPHICS_PAGE_0, Pic_0435_981_528);
} // }
} }
/* /*
*NAME : AMT630H_GUI_TIME() *NAME : AMT630H_GUI_TIME()
...@@ -3559,11 +3560,87 @@ void AMT630H_GUI_PhoneConnect_Coolant(uint8_t Coolant) ...@@ -3559,11 +3560,87 @@ void AMT630H_GUI_PhoneConnect_Coolant(uint8_t Coolant)
SetPagePic(GRAPHICS_PAGE_0, Pic_0947_709_533); SetPagePic(GRAPHICS_PAGE_0, Pic_0947_709_533);
SetPagePic(GRAPHICS_PAGE_0, Pic_0948_967_533); SetPagePic(GRAPHICS_PAGE_0, Pic_0948_967_533);
SetPagePic(GRAPHICS_PAGE_0, Pic_0413_727_533); SetPagePic(GRAPHICS_PAGE_0, Pic_0413_727_533);
if(Coolant>0)
if(GET_DataCollantTempSegStatus() == 1)//正常模式下
{ {
for(uint8_t i=0;i<Coolant;i++) if((Coolant > 0)&&(Coolant <= 8))
{
for(uint8_t i=0;i<Coolant;i++)
{
SetPagePic(GRAPHICS_PAGE_0, Pic_0427_729_536+i);
}
}
if(Coolant < 8)
{
SetPagePic(GRAPHICS_PAGE_0, Pic_0435_981_528);//水温灯(黑)
}
else
{
if(FLASH_SYNC_1Hz)
{
SetPagePic(GRAPHICS_PAGE_0, Pic_0436_981_528);/*水温灯(红)报警闪烁1HZ*/
}
else
{
;
}
}
}
else if(GET_DataCollantTempSegStatus() == 2)//短路
{
if((Coolant > 0)&&(Coolant <= 8))
{
for(uint8_t i=0;i<Coolant;i++)
{
SetPagePic(GRAPHICS_PAGE_0, Pic_0427_729_536+i);
}
}
if(Coolant == 8)
{
CoolantOpenShortCirTimeCnt++;
if(CoolantOpenShortCirTimeCnt <= 15)
{
SetPagePic(GRAPHICS_PAGE_0, Pic_0436_981_528);/*水温灯(红)报警闪烁0.75ms*/
}
else if(CoolantOpenShortCirTimeCnt <= 20)
{
;
}
else
{
CoolantOpenShortCirTimeCnt = 0;
}
}
else
{
SetPagePic(GRAPHICS_PAGE_0, Pic_0435_981_528);//水温灯(黑)
CoolantOpenShortCirTimeCnt = 0;
}
}
else if(GET_DataCollantTempSegStatus() == 3)//开路
{
if((Coolant > 0)&&(Coolant <= 8))
{
for(uint8_t i=0;i<Coolant;i++)
{
SetPagePic(GRAPHICS_PAGE_0, Pic_0427_729_536+i);
}
}
if(Coolant == 0)
{
if((FLASH_SYNC_1Hz))
{
SetPagePic(GRAPHICS_PAGE_0, Pic_0436_981_528);/*水温灯(红)报警闪烁1HZ*/
}
else
{
;
}
}
else
{ {
SetPagePic(GRAPHICS_PAGE_0, Pic_0427_729_536+i); SetPagePic(GRAPHICS_PAGE_0, Pic_0435_981_528);//水温灯(黑)
} }
} }
......
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