Commit 395f6416 authored by 王雅楠's avatar 王雅楠

🐞 fix:【56087】修改燃油自检走格逻辑

parent ec088745
...@@ -2765,16 +2765,6 @@ static const uint16_t PICList_ESpeed_NIGHT[] = { ...@@ -2765,16 +2765,6 @@ static const uint16_t PICList_ESpeed_NIGHT[] = {
Pic_0716_782_125, Pic_0716_782_125,
}; };
static const uint16_t PICList_Fuel[] = { static const uint16_t PICList_Fuel[] = {
Pic_0554_315_473,
Pic_0555_366_473,
Pic_0556_426_473,
Pic_0557_469_473,
Pic_0558_514_473,
Pic_0559_550_473,
Pic_0560_586_473,
Pic_0561_623_473,
};
static const uint16_t PICList_Fuel_RED[] = {
Pic_0562_315_473, Pic_0562_315_473,
Pic_0555_366_473, Pic_0555_366_473,
Pic_0556_426_473, Pic_0556_426_473,
...@@ -2784,6 +2774,16 @@ static const uint16_t PICList_Fuel_RED[] = { ...@@ -2784,6 +2774,16 @@ static const uint16_t PICList_Fuel_RED[] = {
Pic_0560_586_473, Pic_0560_586_473,
Pic_0561_623_473, Pic_0561_623_473,
}; };
// static const uint16_t PICList_Fuel_RED[] = {
// Pic_0562_315_473,
// Pic_0555_366_473,
// Pic_0556_426_473,
// Pic_0557_469_473,
// Pic_0558_514_473,
// Pic_0559_550_473,
// Pic_0560_586_473,
// Pic_0561_623_473,
// };
static const uint16_t PICList_Fuel_SelfCheck[] ={ static const uint16_t PICList_Fuel_SelfCheck[] ={
Pic_0554_315_473, Pic_0554_315_473,
Pic_0555_366_473, Pic_0555_366_473,
...@@ -2960,23 +2960,31 @@ static void AMT630H_GUI_TIME(uint16_t Hour, uint16_t Minute) ...@@ -2960,23 +2960,31 @@ static void AMT630H_GUI_TIME(uint16_t Hour, uint16_t Minute)
// } // }
/*燃油显示函数*/ /*燃油显示函数*/
uint8_t g_u16_GUI_PerFuelLevel = 0; uint8_t g_u16_GUI_PerFuelLevel = 1;
static void AMT630H_GUI_Fuel(uint8_t Fuel) static void AMT630H_GUI_Fuel(uint8_t Fuel)
{ {
/*外部传参燃油处于数组第几格*/ /*外部传参燃油处于数组第几格*/
/*R>83且处于非开路状态时 黄色燃油灯闪烁*/ /*R>83且处于非开路状态时 黄色燃油灯闪烁*/
/*R开路状态时 黄色燃油灯闪烁*/ /*R开路状态时 黄色燃油灯闪烁*/
/*以上两种情况黄色燃油灯闪烁的频率不同*/ /*以上两种情况黄色燃油灯闪烁的频率不同*/
static uint8_t s_FuelLowTime = 0U;
uint8_t FuelLevel; uint8_t FuelLevel;
FuelLevel = Fuel; FuelLevel = Fuel;
static uint8_t s_FuelLowTime = 0U; if(Fuel == 0)
{
FuelLevel = 1;
}
else
{
;
}
if (g_u8Display_Mode == ModeDAY) if (g_u8Display_Mode == ModeDAY)
{ {
SetPagePic(GRAPHICS_PAGE_0, Pic_0553_315_473); /*燃油格*/ SetPagePic(GRAPHICS_PAGE_0, Pic_0553_315_473); /*燃油格*/
SetPagePic(GRAPHICS_PAGE_0, Pic_0549_299_533); /*E*/ SetPagePic(GRAPHICS_PAGE_0, Pic_0549_299_533); /*E*/
SetPagePic(GRAPHICS_PAGE_0, Pic_0550_715_533); /*F*/ SetPagePic(GRAPHICS_PAGE_0, Pic_0550_715_533); /*F*/
/*燃油桶闪烁*/ /*开路状态黄色燃油灯 1HZ闪烁*/
if (FuelLevel == 0) if (Fuel == 0)
{ {
if (FLASH_SYNC_1Hz) if (FLASH_SYNC_1Hz)
{ {
...@@ -2984,7 +2992,7 @@ static void AMT630H_GUI_Fuel(uint8_t Fuel) ...@@ -2984,7 +2992,7 @@ static void AMT630H_GUI_Fuel(uint8_t Fuel)
} }
s_FuelLowTime = 0; s_FuelLowTime = 0;
} }
else if (FuelLevel == 1) else if (Fuel == 1)
{ {
s_FuelLowTime++; s_FuelLowTime++;
if (s_FuelLowTime <= 15) if (s_FuelLowTime <= 15)
...@@ -3007,7 +3015,7 @@ static void AMT630H_GUI_Fuel(uint8_t Fuel) ...@@ -3007,7 +3015,7 @@ static void AMT630H_GUI_Fuel(uint8_t Fuel)
SetPagePic(GRAPHICS_PAGE_0, Pic_0662_315_473); /*燃油格*/ SetPagePic(GRAPHICS_PAGE_0, Pic_0662_315_473); /*燃油格*/
SetPagePic(GRAPHICS_PAGE_0, Pic_0549_299_533); /*E*/ SetPagePic(GRAPHICS_PAGE_0, Pic_0549_299_533); /*E*/
SetPagePic(GRAPHICS_PAGE_0, Pic_0660_715_533); /*F*/ SetPagePic(GRAPHICS_PAGE_0, Pic_0660_715_533); /*F*/
if (FuelLevel == 0) if (Fuel == 0)
{ {
if (FLASH_SYNC_1Hz) if (FLASH_SYNC_1Hz)
{ {
...@@ -3015,7 +3023,7 @@ static void AMT630H_GUI_Fuel(uint8_t Fuel) ...@@ -3015,7 +3023,7 @@ static void AMT630H_GUI_Fuel(uint8_t Fuel)
} }
s_FuelLowTime = 0; s_FuelLowTime = 0;
} }
else if (FuelLevel == 1) else if (Fuel == 1)
{ {
s_FuelLowTime++; s_FuelLowTime++;
if (s_FuelLowTime <= 15) if (s_FuelLowTime <= 15)
...@@ -3034,13 +3042,12 @@ static void AMT630H_GUI_Fuel(uint8_t Fuel) ...@@ -3034,13 +3042,12 @@ static void AMT630H_GUI_Fuel(uint8_t Fuel)
} }
} }
/*燃油格数走格*/ /*燃油格数走格*/
if (FuelLevel > 0) if (FuelLevel > 0)
{ {
if (FuelLevel != g_u16_GUI_PerFuelLevel) if (FuelLevel != g_u16_GUI_PerFuelLevel)
{ {
for (uint8_t i = 0; i <= g_u16_GUI_PerFuelLevel; i++) for (uint8_t i = 0; i < g_u16_GUI_PerFuelLevel; i++)
{ {
SetPagePic(GRAPHICS_PAGE_0, PICList_Fuel[i]); SetPagePic(GRAPHICS_PAGE_0, PICList_Fuel[i]);
} }
...@@ -3058,27 +3065,60 @@ static void AMT630H_GUI_Fuel(uint8_t Fuel) ...@@ -3058,27 +3065,60 @@ static void AMT630H_GUI_Fuel(uint8_t Fuel)
; ;
} }
} }
else if (FuelLevel == g_u16_GUI_PerFuelLevel) if (FuelLevel == g_u16_GUI_PerFuelLevel)
{ {
g_u16_GUI_PerFuelLevel = FuelLevel; g_u16_GUI_PerFuelLevel = FuelLevel;
for (uint8_t i = 0; i <= g_u16_GUI_PerFuelLevel; i++) for (uint8_t i = 0; i < g_u16_GUI_PerFuelLevel; i++)
{ {
SetPagePic(GRAPHICS_PAGE_0, PICList_Fuel[i]); SetPagePic(GRAPHICS_PAGE_0, PICList_Fuel[i]);
} }
} }
}
else
{
;
}
}
uint16_t g_u16PerFuel_SelfCheck = 0;
/*燃油自检函数*/
static void AMT630H_GUI_Fuel_SelfCheck(uint8_t Fuel)
{
uint8_t FuelLevel;
FuelLevel = Fuel;
if(Fuel == 1)
{
FuelLevel = 2;
} }
else else
{
;
}
if (g_u8Display_Mode == ModeDAY)
{
SetPagePic(GRAPHICS_PAGE_0, Pic_0553_315_473); /*燃油格*/
SetPagePic(GRAPHICS_PAGE_0, Pic_0549_299_533); /*E*/
SetPagePic(GRAPHICS_PAGE_0, Pic_0550_715_533); /*F*/
SetPagePic(GRAPHICS_PAGE_0, Pic_0551_503_529); /*黑色燃油灯*/
}
else if (g_u8Display_Mode == ModeNIGHT)
{
SetPagePic(GRAPHICS_PAGE_0, Pic_0662_315_473); /*燃油格*/
SetPagePic(GRAPHICS_PAGE_0, Pic_0549_299_533); /*E*/
SetPagePic(GRAPHICS_PAGE_0, Pic_0660_715_533); /*F*/
SetPagePic(GRAPHICS_PAGE_0, Pic_0661_503_529); /*白色燃油灯*/
}
/*开机自检燃油走格*/
if (FuelLevel > 0)
{ {
if (FuelLevel != g_u16_GUI_PerFuelLevel) if (FuelLevel != g_u16_GUI_PerFuelLevel)
{ {
for (uint8_t i = 0; i <= g_u16_GUI_PerFuelLevel; i++) for (uint8_t i = 0; i < g_u16_GUI_PerFuelLevel; i++)
{ {
{ SetPagePic(GRAPHICS_PAGE_0, PICList_Fuel_SelfCheck[i]);
SetPagePic(GRAPHICS_PAGE_0, PICList_Fuel_RED[i]);
}
} }
if (FuelLevel > g_u16_GUI_PerFuelLevel) if (FuelLevel > g_u16_GUI_PerFuelLevel)
{ {
g_u16_GUI_PerFuelLevel++; g_u16_GUI_PerFuelLevel++;
...@@ -3091,60 +3131,74 @@ static void AMT630H_GUI_Fuel(uint8_t Fuel) ...@@ -3091,60 +3131,74 @@ static void AMT630H_GUI_Fuel(uint8_t Fuel)
{ {
; ;
} }
} }
else if (FuelLevel == g_u16_GUI_PerFuelLevel) if (FuelLevel == g_u16_GUI_PerFuelLevel)
{ {
g_u16_GUI_PerFuelLevel = FuelLevel; g_u16_GUI_PerFuelLevel = FuelLevel;
for (uint8_t i = 0; i <= g_u16_GUI_PerFuelLevel; i++) for (uint8_t i = 0; i < g_u16_GUI_PerFuelLevel; i++)
{ {
{ SetPagePic(GRAPHICS_PAGE_0, PICList_Fuel_SelfCheck[i]);
SetPagePic(GRAPHICS_PAGE_0, PICList_Fuel_RED[i]);
}
} }
} }
}
}
/*燃油自检函数*/
static void AMT630H_GUI_Fuel_SelfCheck(uint8_t Fuel)
{
uint8_t FuelLevel;
FuelLevel = Fuel;
if (g_u8Display_Mode == ModeDAY)
{
SetPagePic(GRAPHICS_PAGE_0, Pic_0553_315_473); /*燃油格*/
SetPagePic(GRAPHICS_PAGE_0, Pic_0549_299_533); /*E*/
SetPagePic(GRAPHICS_PAGE_0, Pic_0550_715_533); /*F*/
SetPagePic(GRAPHICS_PAGE_0, Pic_0551_503_529); /*黑色燃油灯*/
} }
else if (g_u8Display_Mode == ModeNIGHT) else
{ {
SetPagePic(GRAPHICS_PAGE_0, Pic_0662_315_473); /*燃油格*/ SetPagePic(GRAPHICS_PAGE_0, Pic_0562_315_473);/*燃油红区*/
SetPagePic(GRAPHICS_PAGE_0, Pic_0549_299_533); /*E*/
SetPagePic(GRAPHICS_PAGE_0, Pic_0660_715_533); /*F*/
SetPagePic(GRAPHICS_PAGE_0, Pic_0661_503_529); /*白色燃油灯*/
} }
/*燃油格数走格*/
if (FuelLevel > g_u16_GUI_PerFuelLevel)
{ // if (FuelLevel != g_u16PerFuel_SelfCheck)
g_u16_GUI_PerFuelLevel++; // {
} // if(g_u16PerFuel_SelfCheck == 0)
else if ((FuelLevel < g_u16_GUI_PerFuelLevel) && (g_u16_GUI_PerFuelLevel != 0)) // {
{ // SetPagePic(GRAPHICS_PAGE_0, Pic_0562_315_473);
g_u16_GUI_PerFuelLevel--; // }
} // else
else // {
{ // for (uint8_t i = 0; i < g_u16PerFuel_SelfCheck; i++)
; // {
} // SetPagePic(GRAPHICS_PAGE_0, PICList_Fuel_SelfCheck[i]);
for (uint8_t i = 0; i < g_u16_GUI_PerFuelLevel; i++) // }
{
SetPagePic(GRAPHICS_PAGE_0, PICList_Fuel_SelfCheck[i]); // if (FuelLevel > g_u16PerFuel_SelfCheck)
} // {
// g_u16PerFuel_SelfCheck++;
// }
// else
// {
// ;
// }
// }
// }
// else
// {
// for (uint8_t i = 0; i < g_u16_GUI_PerFuelLevel; i++)
// {
// SetPagePic(GRAPHICS_PAGE_0, PICList_Fuel_SelfCheck[i]);
// }
// }
// /*燃油格数走格*/
// if (FuelLevel > g_u16_GUI_PerFuelLevel)
// {
// g_u16_GUI_PerFuelLevel++;
// }
// else if ((FuelLevel < g_u16_GUI_PerFuelLevel) && (g_u16_GUI_PerFuelLevel != 0))
// {
// g_u16_GUI_PerFuelLevel--;
// }
// else
// {
// ;
// }
// for (uint8_t i = 0; i < g_u16_GUI_PerFuelLevel; i++)
// {
// SetPagePic(GRAPHICS_PAGE_0, PICList_Fuel_SelfCheck[i]);
// }
} }
......
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