diff --git a/Firmware/Source/Component/AMT630H/AMT630H_Datas.c b/Firmware/Source/Component/AMT630H/AMT630H_Datas.c index 551f04d3feccda0f5e1f82fa8816a47b63c9b4e0..77b0bb51031bcb97734ae4c2de2427143dfa297e 100644 --- a/Firmware/Source/Component/AMT630H/AMT630H_Datas.c +++ b/Firmware/Source/Component/AMT630H/AMT630H_Datas.c @@ -2832,36 +2832,21 @@ static void AMT630H_GUI_Fuel_SelfCheck(uint8_t Fuel) } /*ç‡ƒæ²¹æ ¼æ•°èµ°æ ¼*/ - if (FuelLevel > 1) - { - if (FuelLevel != g_u16_GUI_PerFuelLevel) + if (FuelLevel > g_u16_GUI_PerFuelLevel) { - 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 - { - ; - } + g_u16_GUI_PerFuelLevel++; } - else if (FuelLevel == g_u16_GUI_PerFuelLevel) + else if ((FuelLevel < g_u16_GUI_PerFuelLevel) && (g_u16_GUI_PerFuelLevel != 0)) { - SetPagePic(GRAPHICS_PAGE_0, Pic_0554_315_473); + g_u16_GUI_PerFuelLevel--; } - - for (uint8_t i = 0; i < g_u16_GUI_PerFuelLevel; i++) + else { - SetPagePic(GRAPHICS_PAGE_0, PICList_Fuel_SelfCheck[i]); + ; } - } - else + for (uint8_t i = 0; i < g_u16_GUI_PerFuelLevel; i++) { - ; + SetPagePic(GRAPHICS_PAGE_0, PICList_Fuel_SelfCheck[i]); } } @@ -2995,7 +2980,7 @@ static void AMT630H_GUI_Voltage(uint16_t Voltage) } /*大计里程显示函数*/ -static void AMT630H_GUI_ODO(uint32_t ODO, uint8_t mode) +static void AMT630H_GUI_ODO(uint32_t ODO, uint8_t Uint) { if (g_u8Display_Mode == ModeDAY) { @@ -3013,37 +2998,79 @@ static void AMT630H_GUI_ODO(uint32_t ODO, uint8_t mode) { DisplayNumPara.x = 173; DisplayNumPara.MinDigits = 6; - SetPagePic(GRAPHICS_PAGE_0, Pic_0580_211_324);/*KM*/ + if(Uint == 0) + { + SetPagePic(GRAPHICS_PAGE_0, Pic_0580_211_324);/*KM*/ + } + else + { + SetPagePic(GRAPHICS_PAGE_0, Pic_0861_211_324);/*mile*/ + } } else if((ODONumber<100000)&&(ODONumber>=10000)) { DisplayNumPara.x = 149; DisplayNumPara.MinDigits = 5; - SetPagePic(GRAPHICS_PAGE_0, Pic_0580_187_324);/*KM*/ + if(Uint == 0) + { + SetPagePic(GRAPHICS_PAGE_0, Pic_0580_187_324);/*KM*/ + } + else + { + SetPagePic(GRAPHICS_PAGE_0, Pic_0861_187_324);/*mile*/ + } } else if((ODONumber<10000)&&(ODONumber>=1000)) { DisplayNumPara.x = 125; DisplayNumPara.MinDigits = 4; - SetPagePic(GRAPHICS_PAGE_0, Pic_0580_163_324);/*KM*/ + if(Uint == 0) + { + SetPagePic(GRAPHICS_PAGE_0, Pic_0580_163_324);/*KM*/ + } + else + { + SetPagePic(GRAPHICS_PAGE_0, Pic_0861_163_324);/*mile*/ + } } else if((ODONumber<1000)&&(ODONumber>=100)) { DisplayNumPara.x = 101; DisplayNumPara.MinDigits = 3; - SetPagePic(GRAPHICS_PAGE_0, Pic_0580_139_324);/*KM*/ + if(Uint == 0) + { + SetPagePic(GRAPHICS_PAGE_0, Pic_0580_139_324);/*KM*/ + } + else + { + SetPagePic(GRAPHICS_PAGE_0, Pic_0861_139_324);/*mile*/ + } } else if((ODONumber<100)&&(ODONumber>=10)) { DisplayNumPara.x = 77; DisplayNumPara.MinDigits = 2; - SetPagePic(GRAPHICS_PAGE_0, Pic_0580_115_324);/*KM*/ + if(Uint == 0) + { + SetPagePic(GRAPHICS_PAGE_0, Pic_0580_115_324);/*KM*/ + } + else + { + SetPagePic(GRAPHICS_PAGE_0, Pic_0861_115_324);/*mile*/ + } } else if((ODONumber<10)&&(ODONumber>=0)) { DisplayNumPara.x = 53; DisplayNumPara.MinDigits = 1; - SetPagePic(GRAPHICS_PAGE_0, Pic_0580_91_324);/*KM*/ + if(Uint == 0) + { + SetPagePic(GRAPHICS_PAGE_0, Pic_0580_91_324);/*KM*/ + } + else + { + SetPagePic(GRAPHICS_PAGE_0, Pic_0861_91_324);/*mile*/ + } } else { @@ -3060,39 +3087,86 @@ static void AMT630H_GUI_ODO(uint32_t ODO, uint8_t mode) uint16_t ODONumber; ODONumber = ODO; DisplayNumPara.NumList = NumbeList_ODO_NIGHT; - DisplayNumPara.x = 173; DisplayNumPara.NumInterval = GROUP_PIC_DIR_LEFT | 24; DisplayNumPara.y = GROUP_PIC_USE_PSD_Y_POS; DisplayNumPara.DecimalNum = 0; if((ODONumber<1000000)&&(ODONumber>=100000)) { + DisplayNumPara.x = 173; DisplayNumPara.MinDigits = 6; - SetPagePic(GRAPHICS_PAGE_0, Pic_0688_211_324);/*KM*/ + if(Uint == 0) + { + SetPagePic(GRAPHICS_PAGE_0, Pic_0688_211_324);/*KM*/ + } + else + { + SetPagePic(GRAPHICS_PAGE_0, Pic_0863_211_324);/*å•ä½mile*/ + } } else if((ODONumber<100000)&&(ODONumber>=10000)) { + DisplayNumPara.x = 149; DisplayNumPara.MinDigits = 5; - SetPagePic(GRAPHICS_PAGE_0, Pic_0688_187_324);/*KM*/ + if(Uint == 0) + { + SetPagePic(GRAPHICS_PAGE_0, Pic_0688_187_324);/*KM*/ + } + else + { + SetPagePic(GRAPHICS_PAGE_0, Pic_0863_187_324);/*å•ä½mile*/ + } } else if((ODONumber<10000)&&(ODONumber>=1000)) { + DisplayNumPara.x = 125; DisplayNumPara.MinDigits = 4; - SetPagePic(GRAPHICS_PAGE_0, Pic_0688_163_324);/*KM*/ + if(Uint == 0) + { + SetPagePic(GRAPHICS_PAGE_0, Pic_0688_163_324);/*KM*/ + } + else + { + SetPagePic(GRAPHICS_PAGE_0, Pic_0863_163_324);/*å•ä½mile*/ + } } else if((ODONumber<1000)&&(ODONumber>=100)) { + DisplayNumPara.x = 101; DisplayNumPara.MinDigits = 3; - SetPagePic(GRAPHICS_PAGE_0, Pic_0688_139_324);/*KM*/ + if(Uint == 0) + { + SetPagePic(GRAPHICS_PAGE_0, Pic_0688_139_324);/*KM*/ + } + else + { + SetPagePic(GRAPHICS_PAGE_0, Pic_0863_139_324);/*å•ä½mile*/ + } } else if((ODONumber<100)&&(ODONumber>=10)) { + DisplayNumPara.x = 77; DisplayNumPara.MinDigits = 2; - SetPagePic(GRAPHICS_PAGE_0, Pic_0688_115_324);/*KM*/ + if(Uint == 0) + { + SetPagePic(GRAPHICS_PAGE_0, Pic_0688_115_324);/*KM*/ + } + else + { + SetPagePic(GRAPHICS_PAGE_0, Pic_0863_115_324);/*å•ä½mile*/ + } } else if((ODONumber<10)&&(ODONumber>=0)) { + DisplayNumPara.x = 53; DisplayNumPara.MinDigits = 1; - SetPagePic(GRAPHICS_PAGE_0, Pic_0688_91_324);/*KM*/ + if(Uint == 0) + { + SetPagePic(GRAPHICS_PAGE_0, Pic_0688_91_324);/*KM*/ + } + else + { + SetPagePic(GRAPHICS_PAGE_0, Pic_0863_91_324);/*å•ä½mile*/ + } } else { @@ -3106,6 +3180,131 @@ static void AMT630H_GUI_ODO(uint32_t ODO, uint8_t mode) } } +/*å°è®¡é‡Œç¨‹æ˜¾ç¤ºå‡½æ•°*/ +static void AMT630H_GUI_Trip(uint32_t Trip, uint8_t Uint) +{ + DISPLAY_NUM_ST DisplayNumPara; + uint32_t Tripnumber; + Tripnumber = Trip; + if (g_u8Display_Mode == ModeDAY) + { + SetPagePic(GRAPHICS_PAGE_0, Pic_0577_48_272); + SetPagePic(GRAPHICS_PAGE_0, Pic_0862_54_297);/*TRIPå›¾æ ‡*/ + + DisplayNumPara.NumList = NumbeList_ODO_DAY; + DisplayNumPara.NumInterval = GROUP_PIC_DIR_LEFT | 24; + DisplayNumPara.y = GROUP_PIC_USE_PSD_Y_POS; + DisplayNumPara.DecimalNum = 1;/*å°æ•°ç‚¹åŽä¸€ä½*/ + if((Tripnumber<10000)&&(Tripnumber>=1000)) + { + DisplayNumPara.x = 125; + DisplayNumPara.MinDigits = 4; + if(Uint == 0) + { + SetPagePic(GRAPHICS_PAGE_0, Pic_0580_163_324);/*KM*/ + } + else + { + SetPagePic(GRAPHICS_PAGE_0, Pic_0861_163_324);/*å•ä½mile*/ + } + } + else if((Tripnumber<1000)&&(Tripnumber>=100)) + { + DisplayNumPara.x = 101; + DisplayNumPara.MinDigits = 4; + if(Uint == 0) + { + SetPagePic(GRAPHICS_PAGE_0, Pic_0580_139_324);/*KM*/ + } + else + { + SetPagePic(GRAPHICS_PAGE_0, Pic_0861_139_324);/*å•ä½mile*/ + } + } + else if((Tripnumber<100)&&(Tripnumber>=10)) + { + DisplayNumPara.x = 77; + DisplayNumPara.MinDigits = 4; + if(Uint == 0) + { + SetPagePic(GRAPHICS_PAGE_0, Pic_0580_115_324);/*KM*/ + } + else + { + SetPagePic(GRAPHICS_PAGE_0, Pic_0861_115_324);/*å•ä½mile*/ + } + } + else if((Tripnumber<10)&&(Tripnumber>=0)) + { + DisplayNumPara.x = 53; + DisplayNumPara.MinDigits = 4; + if(Uint == 0) + { + SetPagePic(GRAPHICS_PAGE_0, Pic_0580_91_324);/*å•ä½KM*/ + } + else + { + SetPagePic(GRAPHICS_PAGE_0, Pic_0861_91_324);/*å•ä½mile*/ + } + } + } + else if(g_u8Display_Mode == ModeDAY) + { + SetPagePic(GRAPHICS_PAGE_0, Pic_0685_48_272); + SetPagePic(GRAPHICS_PAGE_0, Pic_0864_54_297);/*TRIPå›¾æ ‡*/ + DisplayNumPara.NumList = NumbeList_ODO_NIGHT; + DisplayNumPara.NumInterval = GROUP_PIC_DIR_LEFT | 24; + DisplayNumPara.y = GROUP_PIC_USE_PSD_Y_POS; + DisplayNumPara.DecimalNum = 1;/*å°æ•°ç‚¹åŽä¸€ä½*/ + if((Tripnumber<10000)&&(Tripnumber>=1000)) + { + DisplayNumPara.x = 125; + DisplayNumPara.MinDigits = 4; + if(Uint == 0) + { + SetPagePic(GRAPHICS_PAGE_0, Pic_0688_163_324);/*KM*/ + } + else + { + SetPagePic(GRAPHICS_PAGE_0, Pic_0863_163_324);/*å•ä½mile*/ + } + } + else if((Tripnumber<1000)&&(Tripnumber>=100)) + { + DisplayNumPara.x = 101; + DisplayNumPara.MinDigits = 4; + SetPagePic(GRAPHICS_PAGE_0, Pic_0688_139_324);/*KM*/ + SetPagePic(GRAPHICS_PAGE_0, Pic_0863_139_324);/*å•ä½mile*/ + } + else if((Tripnumber<100)&&(Tripnumber>=10)) + { + DisplayNumPara.x = 77; + DisplayNumPara.MinDigits = 4; + if(Uint == 0) + { + SetPagePic(GRAPHICS_PAGE_0, Pic_0688_115_324);/*KM*/ + } + else + { + SetPagePic(GRAPHICS_PAGE_0, Pic_0863_115_324);/*å•ä½mile*/ + } + } + else if((Tripnumber<10)&&(Tripnumber>=0)) + { + DisplayNumPara.x = 53; + DisplayNumPara.MinDigits = 4; + if(Uint == 0) + { + SetPagePic(GRAPHICS_PAGE_0, Pic_0688_91_324);/*å•ä½KM*/ + } + else + { + SetPagePic(GRAPHICS_PAGE_0, Pic_0863_91_324);/*å•ä½mile*/ + } + } + } +} + /*车速显示函数*/ static void AMT630H_GUI_VSpeed(uint16_t VSpeed) { @@ -3341,7 +3540,9 @@ void AMT630H_GUI_BACKGRAND() /*主界é¢å‡½æ•°*/ AMT630H_GUI_Light(); AMT630H_GUI_TIME(Get_Dis_Hour_Time(), Get_Dis_Minute_Time()); + AMT630H_GUI_Voltage((ADC_Read_Signal(ADC_CH_KL30_VOLTAGE)) / 10); // AMT630H_GUI_Telephone(Telephone); + /*燃油*/ if (Get_Fuel_Sensor_State() == FuelSensorNormal) { AMT630H_GUI_Fuel(Get_CurFuelSetp()); @@ -3350,8 +3551,16 @@ void AMT630H_GUI_BACKGRAND() { AMT630H_GUI_Fuel(0); } - AMT630H_GUI_Voltage((ADC_Read_Signal(ADC_CH_KL30_VOLTAGE)) / 10); - AMT630H_GUI_ODO(Get_ODO_Value() / 10, 0); + /*里程*/ + if(Get_Dis_OdoAndTrip() == 0) + { + AMT630H_GUI_ODO(Get_ODO_Value() / 10, Get_Dis_Unit()); + } + else + { + AMT630H_GUI_Trip(Get_Trip_Value(), Get_Dis_Unit()); + } + /*车速*/ if (Get_VechileSpeedValid() == 1) { AMT630H_GUI_VSpeed(Get_DispVechileSpeed() / 10); @@ -3360,6 +3569,7 @@ void AMT630H_GUI_BACKGRAND() { AMT630H_GUI_VSpeed(0); } + /*转速*/ if (Get_EngineValid() == 1) { AMT630H_GUI_ESpeed(Get_DispEngineSpeed()); @@ -3371,7 +3581,7 @@ void AMT630H_GUI_BACKGRAND() } - +/*自检*/ void AMT630H_GUI_BACKGRAND_SelfCheck() { /*背景图*/ @@ -3422,9 +3632,19 @@ void AMT630H_GUI_BACKGRAND_SelfCheck() AMT630H_GUI_TIME(Get_Dis_Hour_Time(), Get_Dis_Minute_Time()); - // AMT630H_GUI_Telephone(Telephone); AMT630H_GUI_Voltage((ADC_Read_Signal(ADC_CH_KL30_VOLTAGE)) / 10); - AMT630H_GUI_ODO(Get_ODO_Value() / 10, 0); + // AMT630H_GUI_Telephone(Telephone); + + /*里程 æ— è‡ªæ£€*/ + if(Get_Dis_OdoAndTrip() == 0) + { + AMT630H_GUI_ODO(Get_ODO_Value() / 10, Get_Dis_Unit()); + } + else + { + AMT630H_GUI_Trip(Get_Trip_Value(), Get_Dis_Unit()); + } + /*燃油自检*/ if(g_u16fuelnumberup < 1200) { g_u16fuelnumberup+=6; @@ -3434,7 +3654,7 @@ void AMT630H_GUI_BACKGRAND_SelfCheck() { ; } - + /*车速自检*/ if(g_u16vspeednumberup < 600) { AMT630H_GUI_VSpeed(g_u16vspeednumberup/3);/*åˆå§‹åŒ–g_u16vspeednumberup = 0*/ @@ -3452,7 +3672,7 @@ void AMT630H_GUI_BACKGRAND_SelfCheck() ; } } - + /*转速自检*/ if(g_u16espeednumberup <= 600) { AMT630H_GUI_ESpeed(g_u16espeednumberup*20);/*åˆå§‹åŒ–g_u16espeednumberup = 0*/ @@ -3466,7 +3686,7 @@ void AMT630H_GUI_BACKGRAND_SelfCheck() g_u16espeednumberdown-=6;/*g_u16espeednumberdown = 0 转速自检结æŸ*/ } } - + /*结æŸçжæ€*/ if(g_u16fuelnumberup == 1200) { AMT630H_GUI_Fuel(8); @@ -3479,6 +3699,7 @@ void AMT630H_GUI_BACKGRAND_SelfCheck() { AMT630H_GUI_ESpeed(g_u16espeednumberdown); } + /*结æŸè‡ªæ£€*/ if((g_u16fuelnumberup == 1200)&&(g_u16vspeednumberdown == 0)&&(g_u16espeednumberdown == 0)) { g_u8SelfCheck = 1;/*è‡ªæ£€ç»“æŸæ ‡å¿—*/