Commit 89ce4066 authored by 郑萍's avatar 郑萍

🐞 fix:51365 【润通草地车】【下电充电显示】根据电源信号发送下电充电显示状态,关闭其他显示

parent a1a8fb8f
......@@ -30,7 +30,7 @@ void Gauge_Cutterhead_Gear_Display(void)
uint8_t Signal1 = Get_CAN_Num_BMCU_BladeSpeedGear();
uint8_t Signal2 = Get_CAN_Num_BMCU_ErrorGrage();
// uint8_t MBMS_StatBattWorkState = Get_CAN_CH0_ID_18203220_Sig_MBMS_StatBattWorkState();
if ((Common_Get_IG_Sts() == COMMON_POWER_ON) && (Charge_OFF_Flag == 0)&& (System_Indicator_CANFlag != 1))
if ((Common_Get_IG_Sts() == COMMON_POWER_ON) && (Charge_OFF_Flag == 0) && (System_Indicator_CANFlag != 1))
{
if ((Signal2 == 0x1) || (Signal2 == 0x2) || (Signal2 == 0x3) || (Signal2 == 0x4))
{
......@@ -59,7 +59,7 @@ void Gauge_Gears_Display(void)
uint8_t Signal1 = Get_CAN_Num_MMCU_TravelSpeedGear();
uint8_t Signal2 = Get_CAN_Num_MMCU_ParkingGearState();
// uint8_t MBMS_StatBattWorkState = Get_CAN_CH0_ID_18203220_Sig_MBMS_StatBattWorkState();
if ((Common_Get_IG_Sts() == COMMON_POWER_ON) && (Charge_OFF_Flag == 0) &&(Get_CAN_Power_State() != KEY_OFF) && (System_Indicator_CANFlag != 1))
if ((Common_Get_IG_Sts() == COMMON_POWER_ON) && (Charge_OFF_Flag == 0) && (Get_CAN_Power_State() != KEY_OFF) && (System_Indicator_CANFlag != 1))
{
if (Signal2 != 0x1)
{
......@@ -84,19 +84,18 @@ uint8_t Get_CAN_Num_MBMS_Soc_1_Grid(void)
uint8_t num = 0;
uint8_t Current_SOC_1_Num = Get_CAN_Num_MBMS_Soc();
num = (Current_SOC_1_Num / 10);
if((Current_SOC_1_Num % 10) != 0)
if ((Current_SOC_1_Num % 10) != 0)
{
num++;
}
return num;
return num;
}
uint8_t Get_CAN_Num_SBMS_Soc_2_Grid(void)
{
uint8_t num = 0;
uint8_t Current_SOC_2_Num = Get_CAN_Num_SBMS_Soc();
num = (Current_SOC_2_Num / 10);
if((Current_SOC_2_Num % 10) != 0)
if ((Current_SOC_2_Num % 10) != 0)
{
num++;
}
......@@ -210,10 +209,10 @@ uint8_t AllSOC_DIS = 0;
void Gauge_EleDial_AllSOC_Display(void)
{
if ((Common_Get_IG_Sts() == COMMON_POWER_ON) && (Get_CAN_Power_State() != KEY_OFF) && (Get_CAN_Power_State() != PKEY_ON)&& (System_Indicator_CANFlag != 1))
if ((Common_Get_IG_Sts() == COMMON_POWER_ON) && (Get_CAN_Power_State() != KEY_OFF) && (Get_CAN_Power_State() != PKEY_ON) && (System_Indicator_CANFlag != 1))
{
AllSOC_DIS = Get_CAN_Num_MBMS_StatSoc();
if(AllSOC_DIS > 100)
if (AllSOC_DIS > 100)
{
AllSOC_DIS = 100;
}
......@@ -246,7 +245,7 @@ void Gauge_Clock_Display(void)
{
Clock_all = Get_CAN_Num_MMCU_SingleWorkingHours();
uint8_t Clock_hours = Clock_all / 10;
uint8_t Clock_min = (Clock_all % 10)*6;
uint8_t Clock_min = (Clock_all % 10) * 6;
SEG_SET_Clock(Clock_hours, Clock_min, FLASH_SYNC_1Hz, 1, 1);
Clockonetime_flag = 1;
}
......@@ -413,6 +412,8 @@ void Gauge_CAN_setup_Service(void)
Gauge_Frame_Display();
Gauge_Cutterhead_Gear_Display();
Gauge_Gears_Display();
uint8_t MBMS_TOTALSigAcc = Get_CAN_Num_MBMS_TOTALSigAcc();
uint8_t MBMS_TOTALSigCharge = Get_CAN_Num_MBMS_TOTALSigCharge();
switch (state)
{
case KEY_ACC:
......@@ -437,24 +438,22 @@ void Gauge_CAN_setup_Service(void)
if (poweroff_time < 3600)
{
Gauge_Power_SOC_CHAGING_Display();
if (poweroff_time == 0)
if (MBMS_TOTALSigAcc == 0x0 && MBMS_TOTALSigCharge == 0x1) // 下电充电)
{
Charge_OFF_Flag = 0;
Charge_OFF_Flag = 1;
}
else
{
Charge_OFF_Flag = 1;
Charge_OFF_Flag = 0;
}
}
else
{
Charge_OFF_Flag = 2;
uint8_t MBMS_TOTALSigAcc = Get_CAN_Num_MBMS_TOTALSigAcc();
uint8_t MBMS_TOTALSigCharge = Get_CAN_Num_MBMS_TOTALSigCharge();
SEG_SET_EleDial_AllSOC(0, 0);
SEG_SET_EleDial_1SOC(0, 0);
SEG_SET_EleDial_2SOC(0, 0);
if (MBMS_TOTALSigAcc == 0x1 && MBMS_TOTALSigCharge == 0x1) // 电充电)
if (MBMS_TOTALSigAcc == 0x1 && MBMS_TOTALSigCharge == 0x1) // 电充电)
{
Charge_OFF_Flag = 0;
poweroff_time = 0;
......@@ -463,17 +462,23 @@ void Gauge_CAN_setup_Service(void)
}
break;
case CHRG_PLUGIN:
{
Charge_OFF_Flag = 0;
Gauge_Power_SOC_pull_Display();
poweroff_time = 0;
}
break;
case CHRGEND:
{
if (MBMS_TOTALSigAcc == 0x0 && MBMS_TOTALSigCharge == 0x1) // 下电充电)
{
Charge_OFF_Flag = 2;
SEG_SET_EleDial_AllSOC(0, 0);
SEG_SET_EleDial_1SOC(0, 0);
SEG_SET_EleDial_2SOC(0, 0);
SOC1_Count = 0;
SOC2_Count = 0;
}
else
{
Charge_OFF_Flag = 0;
Gauge_Power_SOC_pull_Display();
}
poweroff_time = 0;
Charge_OFF_Flag = 0;
Gauge_Power_SOC_pull_Display();
}
break;
......
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