Commit 1f470d3a authored by 王雅楠's avatar 王雅楠

Merge branch 'wangyanan' into 'dev'

Wangyanan

See merge request !70
parents a4f3b9c3 c6a5ec5b
#include "FaultCode.h"
#include "CAN_CH0_CAN_Communication_Matrix.h"
static _st_Init FaultCodeInit;
static uint16_t u16FaultCodeDtcCount = 0;
static uint16_t u16FaultCodeDtcCountBack = 0;
......@@ -395,3 +396,21 @@ uint8_t Get_FaultCode_Valid(void)
{
return u8FaultCodeValid;
}
/*
*NAME : Get_FaultCode_Lost()
*FUNCTION : 获取发送故障码的CAN是否掉线
*RETURN : 0-LOST 1-ONLINE
*/
uint8_t Get_FaultCode_Lost(void)
{
uint8_t u8FaultCodeLost = 0;
if(CAN_MSG_Status(&CAN_CH0_CanMsgOp, CAN_CH0_ID_CH0_402_Msg_Count) == CAN_SIG_LOST)
{
u8FaultCodeLost = 0;
}
else
{
u8FaultCodeLost = 1;
}
return u8FaultCodeLost;
}
......@@ -11,13 +11,14 @@ uint8_t g_u8UnitSetting = Metric ;
uint8_t g_u8SelfCheck = 0;/*自检*/
uint16_t g_u16fuelnumberup = 0;
uint16_t g_u16fuelnumberdown = 320;
uint16_t g_u16fuelnumberdown = 200;
uint16_t g_u16vspeednumberup = 0;
uint16_t g_u16vspeednumberdown = 200;
uint16_t g_u16espeednumberup = 0;
uint16_t g_u16espeednumberdown = 300;
uint16_t g_u16voltagenumberup = 0;
uint16_t g_u16voltagenumberdown = 160;
uint8_t Voltage_Selfcheck = 1;
//自检函数
void AMT630H_GUI_BACKGRAND_SelfCheck(void);
......@@ -29,7 +30,7 @@ void AMT630H_GUI_SETTING(void);
void AMT630H_GUI_Quit(void);
void AMT630H_GUI_Phone_Connect(void);
void AMT630H_GUI_Fault_Information(void);
void AMT630H_GUI_FaultCode(uint8_t FaultCodevalid,uint8_t FaultCode_hight,uint8_t FaultCode_mid);
void AMT630H_GUI_FaultCode(uint8_t FaultCodeLost,uint8_t FaultCodevalid,uint8_t FaultCode_hight,uint8_t FaultCode_mid);
void AMT630H_GUI_Language_Information(void);
void AMT630H_GUI_Unit_Information(void);
void AMT630H_GUI_Display_Mode_Information(void);
......@@ -45,6 +46,12 @@ void AMT630H_GUI_Unit_Setting(Menu_Interface_en_t select);
void AMT630H_GUI_Language_Setting(Menu_Interface_en_t select); /*语言设置*/
void AMT630H_GUI_Phone_Connect_Win(void); /*手机互联*/
void AMT630H_GUI_ReadPosittion_Display(void);
/*投屏界面*/
static void AMT630H_GUI_PhoneConnect_Light();
static void AMT630H_GUI_PhoneConnect_TIME(uint16_t Hour ,uint16_t Minute);
static void AMT630H_GUI_PhoneConnect_VSpeed(uint16_t VechileSpeed);
void AMT630H_GUI_Background()
{
if (SYS_OPR_STAT_IGN_ON)
......@@ -88,7 +95,7 @@ void AMT630H_GUI_Fault_Information(void)
SetPagePic(GRAPHICS_PAGE_0, Pic_0168_350_290);
SetPagePic(GRAPHICS_PAGE_0, Pic_0169_353_227);/*历史故障*/
SetPagePic(GRAPHICS_PAGE_0, Pic_0170_354_162);/*当前故障*/
AMT630H_GUI_FaultCode(Get_FaultCode_Valid(),Get_Current_Hight_FaultCode(),Get_Current_Mid_FaultCode());
AMT630H_GUI_FaultCode(Get_FaultCode_Lost(),Get_FaultCode_Valid(),Get_Current_Hight_FaultCode(),Get_Current_Mid_FaultCode());
}
else if(g_u8Language == EN)
{
......@@ -105,7 +112,7 @@ void AMT630H_GUI_Fault_Information(void)
SetPagePic(GRAPHICS_PAGE_0, Pic_0096_338_228);/*Fault history*/
SetPagePic(GRAPHICS_PAGE_0, Pic_0097_334_163);/*current fault*/
AMT630H_GUI_FaultCode(Get_FaultCode_Valid(),Get_Current_Hight_FaultCode(),Get_Current_Mid_FaultCode());
AMT630H_GUI_FaultCode(Get_FaultCode_Lost(),Get_FaultCode_Valid(),Get_Current_Hight_FaultCode(),Get_Current_Mid_FaultCode());
}
}
else if(g_u8Display_Mode == ModeNIGHT)
......@@ -125,7 +132,7 @@ void AMT630H_GUI_Fault_Information(void)
SetPagePic(GRAPHICS_PAGE_0, Pic_0356_353_227);/*历史故障*/
SetPagePic(GRAPHICS_PAGE_0, Pic_0357_354_162);/*当前故障*/
AMT630H_GUI_FaultCode(Get_FaultCode_Valid(),Get_Current_Hight_FaultCode(),Get_Current_Mid_FaultCode());
AMT630H_GUI_FaultCode(Get_FaultCode_Lost(),Get_FaultCode_Valid(),Get_Current_Hight_FaultCode(),Get_Current_Mid_FaultCode());
}
else if(g_u8Language == EN)
{
......@@ -142,7 +149,7 @@ void AMT630H_GUI_Fault_Information(void)
SetPagePic(GRAPHICS_PAGE_0, Pic_0284_338_228);
SetPagePic(GRAPHICS_PAGE_0, Pic_0285_334_163);/*current fault*/
AMT630H_GUI_FaultCode(Get_FaultCode_Valid(),Get_Current_Hight_FaultCode(),Get_Current_Mid_FaultCode());
AMT630H_GUI_FaultCode(Get_FaultCode_Lost(),Get_FaultCode_Valid(),Get_Current_Hight_FaultCode(),Get_Current_Mid_FaultCode());
}
}
}
......@@ -175,95 +182,164 @@ static uint16_t NumbeList_FaultCode_night[]={
uint8_t FaultCodevalid_monitor = 2;
/*故障码显示函数*/
static void AMT630H_GUI_FaultCode(uint8_t FaultCodevalid,uint8_t FaultCode_hight,uint8_t FaultCode_mid)
static void AMT630H_GUI_FaultCode(uint8_t FaultCodeLost,uint8_t FaultCodevalid,uint8_t FaultCode_hight,uint8_t FaultCode_mid)
{
/*数字只有两组 历史故障和故障信息纵坐标不同*/
FaultCodevalid_monitor = FaultCodevalid;
if(FaultCodevalid == 1)
if(FaultCodeLost == 1)
{
DISPLAY_NUM_ST DisplayNumPara;
uint16_t frontnumber;
uint16_t midnumber;
frontnumber = FaultCode_hight;
midnumber = FaultCode_mid;
if(FaultCodevalid > 0)
{
DISPLAY_NUM_ST DisplayNumPara;
uint16_t frontnumber;
uint16_t midnumber;
frontnumber = FaultCode_hight;
midnumber = FaultCode_mid;
if(g_u8Display_Mode == ModeDAY)
if(g_u8Display_Mode == ModeDAY)
{
SetPagePicFree(GRAPHICS_PAGE_0, Pic_0876_639_293, 610, 164);//当前故障码的P
SetPagePicFree(GRAPHICS_PAGE_0, Pic_0876_639_293, 610, 229);//历史故障码的P
/*当前故障码前两位显示*/
DisplayNumPara.NumList = NumbeList_FaultCode_day;
DisplayNumPara.x = 639;
DisplayNumPara.NumInterval = GROUP_PIC_DIR_LEFT | 14;
DisplayNumPara.y = 164;
DisplayNumPara.DecimalNum = 0;
DisplayNumPara.MinDigits = 2;
DisplayNum(GRAPHICS_PAGE_0, &DisplayNumPara, frontnumber);
/*当前故障码后两位显示*/
DisplayNumPara.NumList = NumbeList_FaultCode_day;
DisplayNumPara.x = 667;
DisplayNumPara.NumInterval = GROUP_PIC_DIR_LEFT | 14;
DisplayNumPara.y = 164;
DisplayNumPara.DecimalNum = 0;
DisplayNumPara.MinDigits = 2;
DisplayNum(GRAPHICS_PAGE_0, &DisplayNumPara, midnumber);
/*历史故障码前两位显示*/
DisplayNumPara.NumList = NumbeList_FaultCode_day;
DisplayNumPara.x = 639;
DisplayNumPara.NumInterval = GROUP_PIC_DIR_LEFT | 14;
DisplayNumPara.y = 229;
DisplayNumPara.DecimalNum = 0;
DisplayNumPara.MinDigits = 2;
DisplayNum(GRAPHICS_PAGE_0, &DisplayNumPara, frontnumber);
/*历史故障码后两位显示*/
DisplayNumPara.NumList = NumbeList_FaultCode_day;
DisplayNumPara.x = 667;
DisplayNumPara.NumInterval = GROUP_PIC_DIR_LEFT | 14;
DisplayNumPara.y = 229;
DisplayNumPara.DecimalNum = 0;
DisplayNumPara.MinDigits = 2;
DisplayNum(GRAPHICS_PAGE_0, &DisplayNumPara, frontnumber);
}
else if(g_u8Display_Mode == ModeNIGHT)
{
SetPagePicFree(GRAPHICS_PAGE_0, Pic_0912_639_293, 610, 164);//当前故障码的P
SetPagePicFree(GRAPHICS_PAGE_0, Pic_0912_639_293, 610, 229);//历史故障码的P
/*当前故障码前两位显示*/
DisplayNumPara.NumList = NumbeList_FaultCode_night;
DisplayNumPara.x = 639;
DisplayNumPara.NumInterval = GROUP_PIC_DIR_LEFT | 14;
DisplayNumPara.y = 164;
DisplayNumPara.DecimalNum = 0;
DisplayNumPara.MinDigits = 2;
DisplayNum(GRAPHICS_PAGE_0, &DisplayNumPara, frontnumber);
/*当前故障码后两位显示*/
DisplayNumPara.NumList = NumbeList_FaultCode_night;
DisplayNumPara.x = 667;
DisplayNumPara.NumInterval = GROUP_PIC_DIR_LEFT | 14;
DisplayNumPara.y = 164;
DisplayNumPara.DecimalNum = 0;
DisplayNumPara.MinDigits = 2;
DisplayNum(GRAPHICS_PAGE_0, &DisplayNumPara, midnumber);
/*历史故障码前两位显示*/
DisplayNumPara.NumList = NumbeList_FaultCode_night;
DisplayNumPara.x = 639;
DisplayNumPara.NumInterval = GROUP_PIC_DIR_LEFT | 14;
DisplayNumPara.y = 229;
DisplayNumPara.DecimalNum = 0;
DisplayNumPara.MinDigits = 2;
DisplayNum(GRAPHICS_PAGE_0, &DisplayNumPara, frontnumber);
/*历史故障码后两位显示*/
DisplayNumPara.NumList = NumbeList_FaultCode_night;
DisplayNumPara.x = 667;
DisplayNumPara.NumInterval = GROUP_PIC_DIR_LEFT | 14;
DisplayNumPara.y = 229;
DisplayNumPara.DecimalNum = 0;
DisplayNumPara.MinDigits = 2;
DisplayNum(GRAPHICS_PAGE_0, &DisplayNumPara, midnumber);
}
}
else if(FaultCodevalid == 0)
{
SetPagePicFree(GRAPHICS_PAGE_0, Pic_0876_639_293, 610, 164);//当前故障码的P
SetPagePicFree(GRAPHICS_PAGE_0, Pic_0876_639_293, 610, 229);//历史故障码的P
/*当前故障码前两位显示*/
DisplayNumPara.NumList = NumbeList_FaultCode_day;
DisplayNumPara.x = 639;
DisplayNumPara.NumInterval = GROUP_PIC_DIR_LEFT | 14;
DisplayNumPara.y = 164;
DisplayNumPara.DecimalNum = 0;
DisplayNumPara.MinDigits = 2;
DisplayNum(GRAPHICS_PAGE_0, &DisplayNumPara, frontnumber);
/*当前故障码后两位显示*/
DisplayNumPara.NumList = NumbeList_FaultCode_day;
DisplayNumPara.x = 667;
DisplayNumPara.NumInterval = GROUP_PIC_DIR_LEFT | 14;
DisplayNumPara.y = 164;
DisplayNumPara.DecimalNum = 0;
DisplayNumPara.MinDigits = 2;
DisplayNum(GRAPHICS_PAGE_0, &DisplayNumPara, midnumber);
/*历史故障码前两位显示*/
DisplayNumPara.NumList = NumbeList_FaultCode_day;
DisplayNumPara.x = 639;
DisplayNumPara.NumInterval = GROUP_PIC_DIR_LEFT | 14;
DisplayNumPara.y = 229;
DisplayNumPara.DecimalNum = 0;
DisplayNumPara.MinDigits = 2;
DisplayNum(GRAPHICS_PAGE_0, &DisplayNumPara, frontnumber);
/*历史故障码后两位显示*/
DisplayNumPara.NumList = NumbeList_FaultCode_day;
DisplayNumPara.x = 667;
DisplayNumPara.NumInterval = GROUP_PIC_DIR_LEFT | 14;
DisplayNumPara.y = 229;
DisplayNumPara.DecimalNum = 0;
DisplayNumPara.MinDigits = 2;
DisplayNum(GRAPHICS_PAGE_0, &DisplayNumPara, frontnumber);
/*显示P0000*/
if(g_u8Display_Mode == ModeDAY)
{
SetPagePicFree(GRAPHICS_PAGE_0, Pic_0876_639_293, 610, 164);//当前故障码的P
SetPagePicFree(GRAPHICS_PAGE_0, Pic_0876_639_293, 610, 229);//历史故障码的P
DISPLAY_NUM_ST DisplayNumPara;
/*当前故障码前两位显示*/
DisplayNumPara.NumList = NumbeList_FaultCode_day;
DisplayNumPara.x = 639;
DisplayNumPara.NumInterval = GROUP_PIC_DIR_LEFT | 14;
DisplayNumPara.y = 164;
DisplayNumPara.DecimalNum = 0;
DisplayNumPara.MinDigits = 2;
DisplayNum(GRAPHICS_PAGE_0, &DisplayNumPara, 0);
/*当前故障码后两位显示*/
DisplayNumPara.NumList = NumbeList_FaultCode_day;
DisplayNumPara.x = 667;
DisplayNumPara.NumInterval = GROUP_PIC_DIR_LEFT | 14;
DisplayNumPara.y = 164;
DisplayNumPara.DecimalNum = 0;
DisplayNumPara.MinDigits = 2;
DisplayNum(GRAPHICS_PAGE_0, &DisplayNumPara, 0);
/*历史故障码前两位显示*/
DisplayNumPara.NumList = NumbeList_FaultCode_day;
DisplayNumPara.x = 639;
DisplayNumPara.NumInterval = GROUP_PIC_DIR_LEFT | 14;
DisplayNumPara.y = 229;
DisplayNumPara.DecimalNum = 0;
DisplayNumPara.MinDigits = 2;
DisplayNum(GRAPHICS_PAGE_0, &DisplayNumPara, 0);
/*历史故障码后两位显示*/
DisplayNumPara.NumList = NumbeList_FaultCode_day;
DisplayNumPara.x = 667;
DisplayNumPara.NumInterval = GROUP_PIC_DIR_LEFT | 14;
DisplayNumPara.y = 229;
DisplayNumPara.DecimalNum = 0;
DisplayNumPara.MinDigits = 2;
DisplayNum(GRAPHICS_PAGE_0, &DisplayNumPara, 0);
}
else if(g_u8Display_Mode == ModeNIGHT)
{
/*显示P0000(直接贴图方式)*/
SetPagePic(GRAPHICS_PAGE_0, Pic_0900_610_164);
SetPagePic(GRAPHICS_PAGE_0, Pic_0901_625_164);
SetPagePic(GRAPHICS_PAGE_0, Pic_0901_639_164);
SetPagePic(GRAPHICS_PAGE_0, Pic_0901_653_164);
SetPagePic(GRAPHICS_PAGE_0, Pic_0901_667_164);
SetPagePic(GRAPHICS_PAGE_0, Pic_0900_610_229);
SetPagePic(GRAPHICS_PAGE_0, Pic_0901_625_229);
SetPagePic(GRAPHICS_PAGE_0, Pic_0901_639_229);
SetPagePic(GRAPHICS_PAGE_0, Pic_0901_653_229);
SetPagePic(GRAPHICS_PAGE_0, Pic_0901_667_229);
}
else
{
;
}
}
else if(g_u8Display_Mode == ModeNIGHT)
else
{
SetPagePicFree(GRAPHICS_PAGE_0, Pic_0912_639_293, 610, 164);//当前故障码的P
SetPagePicFree(GRAPHICS_PAGE_0, Pic_0912_639_293, 610, 229);//历史故障码的P
/*当前故障码前两位显示*/
DisplayNumPara.NumList = NumbeList_FaultCode_night;
DisplayNumPara.x = 639;
DisplayNumPara.NumInterval = GROUP_PIC_DIR_LEFT | 14;
DisplayNumPara.y = 164;
DisplayNumPara.DecimalNum = 0;
DisplayNumPara.MinDigits = 2;
DisplayNum(GRAPHICS_PAGE_0, &DisplayNumPara, frontnumber);
/*当前故障码后两位显示*/
DisplayNumPara.NumList = NumbeList_FaultCode_night;
DisplayNumPara.x = 667;
DisplayNumPara.NumInterval = GROUP_PIC_DIR_LEFT | 14;
DisplayNumPara.y = 164;
DisplayNumPara.DecimalNum = 0;
DisplayNumPara.MinDigits = 2;
DisplayNum(GRAPHICS_PAGE_0, &DisplayNumPara, midnumber);
/*历史故障码前两位显示*/
DisplayNumPara.NumList = NumbeList_FaultCode_night;
DisplayNumPara.x = 639;
DisplayNumPara.NumInterval = GROUP_PIC_DIR_LEFT | 14;
DisplayNumPara.y = 229;
DisplayNumPara.DecimalNum = 0;
DisplayNumPara.MinDigits = 2;
DisplayNum(GRAPHICS_PAGE_0, &DisplayNumPara, frontnumber);
/*历史故障码后两位显示*/
DisplayNumPara.NumList = NumbeList_FaultCode_night;
DisplayNumPara.x = 667;
DisplayNumPara.NumInterval = GROUP_PIC_DIR_LEFT | 14;
DisplayNumPara.y = 229;
DisplayNumPara.DecimalNum = 0;
DisplayNumPara.MinDigits = 2;
DisplayNum(GRAPHICS_PAGE_0, &DisplayNumPara, midnumber);
;
}
}
else if(FaultCodevalid == 0)
else if(FaultCodeLost == 0)
{
if(g_u8Display_Mode == ModeDAY)
{
......@@ -2647,6 +2723,18 @@ static const uint16_t NumbeList_TIME_NIGHT[] = {
Pic_0645_959_511,
Pic_0646_953_501,
};
static const uint16_t NumbeList_PhoneConnect_TIME[] = {
Pic_0385_357_553,
Pic_0386_367_553,
Pic_0387_358_553,
Pic_0388_359_553,
Pic_0389_356_553,
Pic_0390_358_553,
Pic_0391_358_553,
Pic_0392_357_553,
Pic_0393_357_553,
Pic_0394_358_553,
};
static const uint16_t NumbeList_Telephone[] = {
Pic_0536_54_499,
Pic_0537_55_499,
......@@ -2731,6 +2819,18 @@ static const uint16_t NumbeList_VSpeed_DAY[] = {
Pic_0604_500_361,
Pic_0605_470_308,
};
static const uint16_t NumbeList_PhoneConnect_VSpeed[] ={
Pic_0399_484_510,
Pic_0400_502_509,
Pic_0401_485_509,
Pic_0402_486_509,
Pic_0403_481_509,
Pic_0404_485_509,
Pic_0405_485_509,
Pic_0406_483_509,
Pic_0407_484_509,
Pic_0408_485_509,
};
static const uint16_t NumbeList_VSpeed_NIGHT[] = {
Pic_0702_456_256,
Pic_0703_492_255,
......@@ -2804,7 +2904,12 @@ static const uint16_t PICList_Fuel_SelfCheck[] ={
Pic_0561_623_473,
};
/*指示灯*/
/*
*NAME : AMT630H_GUI_Light()
*FUNCTION : 指示灯点亮函数
*PARAMETER : NULL
*RETURN : NULL
**/
static void AMT630H_GUI_Light()
{
if(Get_TelltalesLedSts(em_LED_Turn_Left))
......@@ -2884,9 +2989,55 @@ static void AMT630H_GUI_Light()
;
}
}
/*时间显示函数*/
static void AMT630H_GUI_PhoneConnect_Light()
{
if(Get_TelltalesLedSts(em_LED_Turn_Left))
{
SetPagePic(GRAPHICS_PAGE_0, Pic_0475_30_481);
}
if(Get_TelltalesLedSts(em_LED_Turn_Right))
{
SetPagePic(GRAPHICS_PAGE_0, Pic_0467_952_481);
}
if(Get_TelltalesLedSts(em_LED_High_Beam))
{
SetPagePic(GRAPHICS_PAGE_0, Pic_0474_101_487);
}
if(Get_TelltalesLedSts(em_LED_Efi_Fault))
{
SetPagePic(GRAPHICS_PAGE_0, Pic_0469_749_487);
}
if(Get_TelltalesLedSts(em_LED_ABS))
{
SetPagePic(GRAPHICS_PAGE_0, Pic_0471_312_486);
}
if(Get_TelltalesLedSts(em_LED_Auto_Start_Stop))
{
SetPagePic(GRAPHICS_PAGE_0, Pic_0472_251_485);
}
if(Get_TelltalesLedSts(em_LED_Oil_Pressure_Alert))
{
SetPagePic(GRAPHICS_PAGE_0, Pic_0466_874_488);
}
if(Get_TelltalesLedSts(em_LED_TCS))
{
SetPagePic(GRAPHICS_PAGE_0, Pic_0473_172_490);
}
if(Get_TelltalesLedSts(em_LED_WIFI))
{
SetPagePic(GRAPHICS_PAGE_0, Pic_0465_881_487);
}
if(Get_TelltalesLedSts(em_LED_Bluetooth))
{
SetPagePic(GRAPHICS_PAGE_0, Pic_0468_819_486);
}
}
/*
*NAME : AMT630H_GUI_TIME()
*FUNCTION : 主界面时间显示函数
*PARAMETER : uint16_t Hour-小时 uint16_t Minute-分钟
*RETURN : NULL
**/
static void AMT630H_GUI_TIME(uint16_t Hour, uint16_t Minute)
{
if (g_u8Display_Mode == ModeDAY)
......@@ -2948,63 +3099,83 @@ static void AMT630H_GUI_TIME(uint16_t Hour, uint16_t Minute)
DisplayNum(GRAPHICS_PAGE_0, &DisplayNumPara, MinuteNumber);
}
}
/*
*NAME : AMT630H_GUI_PhoneConnect_TIME()
*FUNCTION : 投屏界面时间显示函数
*PARAMETER : uint16_t Hour-小时 uint16_t Minute-分钟
*RETURN : NULL
**/
static void AMT630H_GUI_PhoneConnect_TIME(uint16_t Hour ,uint16_t Minute)
{
/*外部接收小时和分钟*/
if (FLASH_SYNC_1Hz)
{
SetPagePic(GRAPHICS_PAGE_0, Pic_0397_315_562); /*时间 : */
}
DISPLAY_NUM_ST DisplayNumPara;
uint16_t HourNumber;
uint16_t MinuteNumber;
HourNumber = Hour;
MinuteNumber = Minute;
/*小时显示*/
DisplayNumPara.NumList = NumbeList_PhoneConnect_TIME;
DisplayNumPara.x = 280;
DisplayNumPara.NumInterval = GROUP_PIC_DIR_LEFT | 30;
DisplayNumPara.y = GROUP_PIC_USE_PSD_Y_POS;
DisplayNumPara.DecimalNum = 0;
DisplayNumPara.MinDigits = 2;
DisplayNum(GRAPHICS_PAGE_0, &DisplayNumPara, HourNumber);
/*分钟显示*/
DisplayNumPara.NumList = NumbeList_PhoneConnect_TIME;
DisplayNumPara.x = 357;
DisplayNumPara.NumInterval = GROUP_PIC_DIR_LEFT | 30;
DisplayNumPara.y = GROUP_PIC_USE_PSD_Y_POS;
DisplayNumPara.DecimalNum = 0;
DisplayNumPara.MinDigits = 2;
DisplayNum(GRAPHICS_PAGE_0, &DisplayNumPara, MinuteNumber);
}
/*
*NAME : AMT630H_GUI_Telephone
*SCOPE : 主界面来电显示
*PARAMETER : Tele_State-手机通话状态
* Instrument_State-仪表目前状态(主界面/投屏状态)
*RETURN : NULL
*/
static void AMT630H_GUI_Telephone()
{
if(BlueToothPhoneData.BlueToothPhoneSate == Phone_Outgoing)
{
//SetPagePic(GRAPHICS_PAGE_0, );
}
else if(BlueToothPhoneData.BlueToothPhoneSate == Phone_Talking)
{
//SetPagePic(GRAPHICS_PAGE_0, );
}
else if(BlueToothPhoneData.BlueToothPhoneSate == Phone_Incoming)
{
SetPagePic(GRAPHICS_PAGE_0, Pic_0548_62_401);
}
else
{
;
}
uint8_t *BLUETOOTH_PHONENAME = (uint8_t *)TEXT_NUM_BLUETOOTH_PHONENAME;
uint8_t *PHONE_NUMBER = (uint8_t *)TEXT_NUM_PHONE_NUMBER;
/*联系人*/
PackedTransfer_LabelsList( 0x4007, BLUETOOTH_PHONENAME , 22);
SetPageText(GRAPHICS_PAGE_0, 0x4007, 200, 200, 200, ALIGN_LEFT, 0, TEXT_COLOR(0XFF,0XFF,0XFF,0XFF),TEXT_LINE_OFFSET(1,1));
/*手机号码*/
PackedTransfer_LabelsList(0x4009, PHONE_NUMBER, 22);
SetPageText(GRAPHICS_PAGE_0, 0x4009, 200, 200, 200, ALIGN_LEFT, 0, TEXT_COLOR(0XFF,0XFF,0XFF,0XFF),TEXT_LINE_OFFSET(1,1));
}
/*
*NAME : AMT630H_GUI_Telephone
*PARAMETER : Tele_State-手机通话状态 _BlueToothPhoneData.BlueToothPhoneSate == Phone_Outgoing/Phone_Incoming/Phone_Talking
* Telephone-手机号
* Instrument_State 仪表目前状态(主界面/投屏状态)g_u8Cursor_Posittion
* Connectperson_Name 联系人名称
*RETURN : NULL
*NAME : AMT630H_GUI_Fuel
*FUNCTION : 燃油显示函数
*PARAMETER : uint8_t Fuel- 燃油格数
*RETURN : NULL
*/
//uint16_t Telephone[] = {1,2,3,4,5,6,7,8,9,1,1};
// static void AMT630H_GUI_Telephone(uint8_t Instrument_State,uint8_t Tele_State,uint16_t Telephone,uint16_t Connectperson_Name)
// {
// // /*Instrument_State 仪表目前状态(主界面/投屏状态)g_u8Cursor_Posittion*/
// // if(Instrument_State == MENU_ITEM_MAIN_ITEM)
// // {
// // }
// // else
// // {
// // }
// if(Tele_State == Phone_Outgoing)
// {
// //SetPagePic(GRAPHICS_PAGE_0, );
// }
// else if(Tele_State == Phone_Talking)
// {
// //SetPagePic(GRAPHICS_PAGE_0, );
// }
// else if(Tele_State == Phone_Incoming)
// {
// SetPagePic(GRAPHICS_PAGE_0, Pic_0548_62_401);
// }
// else
// {
// ;
// }
// PackedTransfer_LabelsList(10000, TEXT_NUM_BLUETOOTH_PHONENAME, 22);
// SetPageText(GRAPHICS_PAGE_0, 10000, int16_t 200, int16_t 200, int16_t 200, ALIGN_LEFT, 0, TEXT_COLOR(0XFF,0XFF,0XFF,0XFF));
// // DISPLAY_NUM_ST DisplayNumPara;
// // SetPagePic(GRAPHICS_PAGE_0, Pic_0548_62_401); /*电话图标*/
// // /*预留来电人显示*/
// // for(int i=0;i<11;i++)
// // {
// // DisplayNumPara.NumList = NumbeList_Telephone;
// // DisplayNumPara.x = XList_Telephone[i];
// // DisplayNumPara.NumInterval = GROUP_PIC_DIR_LEFT |0;
// // DisplayNumPara.y = GROUP_PIC_USE_PSD_Y_POS;
// // DisplayNumPara.DecimalNum = 0;
// // DisplayNumPara.MinDigits = 1;
// // DisplayNum(GRAPHICS_PAGE_0, &DisplayNumPara,Telephone[i]);
// // }
// }
/*燃油显示函数*/
uint8_t g_u16_GUI_PerFuelLevel = 1;
static void AMT630H_GUI_Fuel(uint8_t Fuel)
{
......@@ -3125,7 +3296,7 @@ static void AMT630H_GUI_Fuel(uint8_t Fuel)
}
}
uint16_t g_u16PerFuel_SelfCheck = 0;
uint16_t g_u16PerFuel_SelfCheck = 1;
/*燃油自检函数*/
static void AMT630H_GUI_Fuel_SelfCheck(uint8_t Fuel)
{
......@@ -3157,30 +3328,30 @@ static void AMT630H_GUI_Fuel_SelfCheck(uint8_t Fuel)
if (FuelLevel > 0)
{
if (FuelLevel != g_u16_GUI_PerFuelLevel)
if (FuelLevel != g_u16PerFuel_SelfCheck)
{
for (uint8_t i = 0; i < g_u16_GUI_PerFuelLevel; i++)
for (uint8_t i = 0; i < g_u16PerFuel_SelfCheck; i++)
{
SetPagePic(GRAPHICS_PAGE_0, PICList_Fuel_SelfCheck[i]);
}
if (FuelLevel > g_u16_GUI_PerFuelLevel)
if (FuelLevel > g_u16PerFuel_SelfCheck)
{
g_u16_GUI_PerFuelLevel++;
g_u16PerFuel_SelfCheck++;
}
else if ((FuelLevel < g_u16_GUI_PerFuelLevel) && (g_u16_GUI_PerFuelLevel != 0))
else if ((FuelLevel < g_u16PerFuel_SelfCheck) && (g_u16PerFuel_SelfCheck != 0))
{
g_u16_GUI_PerFuelLevel--;/*fuellevel = 8 */
g_u16PerFuel_SelfCheck--;/*fuellevel = 8 */
}
else
{
;
}
}
if (FuelLevel == g_u16_GUI_PerFuelLevel)
if (FuelLevel == g_u16PerFuel_SelfCheck)
{
g_u16_GUI_PerFuelLevel = FuelLevel;
for (uint8_t i = 0; i < g_u16_GUI_PerFuelLevel; i++)
g_u16PerFuel_SelfCheck = FuelLevel;
for (uint8_t i = 0; i < g_u16PerFuel_SelfCheck; i++)
{
SetPagePic(GRAPHICS_PAGE_0, PICList_Fuel_SelfCheck[i]);
}
......@@ -3194,8 +3365,6 @@ static void AMT630H_GUI_Fuel_SelfCheck(uint8_t Fuel)
}
/*电压显示函数*/
static void AMT630H_GUI_Voltage(uint16_t Voltage)
{
......@@ -3212,13 +3381,20 @@ static void AMT630H_GUI_Voltage(uint16_t Voltage)
uint16_t Voltage_Ten;
uint16_t Voltage_Unit;
uint16_t Front;
if ((VoltageNumber <= 120) || (VoltageNumber > 150))
if(Voltage_Selfcheck == 1)
{
SetPagePic(GRAPHICS_PAGE_0, Pic_0563_923_407); /*红色电压图标*/
}
else
{
SetPagePic(GRAPHICS_PAGE_0, Pic_0865_923_407);/*绿色电压图标显示*/
if ((VoltageNumber <= 120) || (VoltageNumber > 150))
{
SetPagePic(GRAPHICS_PAGE_0, Pic_0563_923_407); /*红色电压图标*/
}
else
{
SetPagePic(GRAPHICS_PAGE_0, Pic_0865_923_407);/*绿色电压图标显示*/
}
}
/*数据处理*/
Voltage_Hundred = VoltageNumber / 100;
......@@ -3667,20 +3843,28 @@ static void AMT630H_GUI_Trip(uint32_t Trip, uint8_t Uint)
}
}
/*车速显示函数*/
static void AMT630H_GUI_VSpeed(uint16_t VSpeed,uint8_t Unit)
/*
*NAME : AMT630H_GUI_VSpeed
*FUNCTION : 主界面车速显示
*PARAMETER : uint16_t VSpeed-车速
*RETURN : NULL
*/
static void AMT630H_GUI_VSpeed(uint16_t VSpeed)
{
if (g_u8Display_Mode == ModeDAY)
{
SetPagePic(GRAPHICS_PAGE_0, Pic_0592_617_271);
if(Unit == 0)
if(g_u8UnitSetting == Metric)
{
SetPagePic(GRAPHICS_PAGE_0, Pic_0593_889_310);/*单位 km/h */
}
else if(g_u8UnitSetting == Imperial)
{
SetPagePic(GRAPHICS_PAGE_0, Pic_0593_889_310);/*单位 km*/
SetPagePic(GRAPHICS_PAGE_0, Pic_0928_894_310);/*单位 mph/h */
}
else
{
SetPagePic(GRAPHICS_PAGE_0, Pic_0928_894_310);/*单位 mph */
;
}
/*数据处理*/
......@@ -3733,13 +3917,17 @@ static void AMT630H_GUI_VSpeed(uint16_t VSpeed,uint8_t Unit)
else if (g_u8Display_Mode == ModeNIGHT)
{
SetPagePic(GRAPHICS_PAGE_0, Pic_0700_617_271);
if(Unit == 0)
if(g_u8UnitSetting == Metric)
{
SetPagePic(GRAPHICS_PAGE_0, Pic_0701_889_310);/*单位 km/h */
}
else if(g_u8UnitSetting == Imperial)
{
SetPagePic(GRAPHICS_PAGE_0, Pic_0929_894_310);/*单位 mph/h */
}
else
{
SetPagePic(GRAPHICS_PAGE_0, Pic_0929_894_310);/*单位 mile/h */
;
}
/*数据处理*/
......@@ -3796,6 +3984,75 @@ static void AMT630H_GUI_VSpeed(uint16_t VSpeed,uint8_t Unit)
}
}
/*
*NAME : AMT630H_GUI_PhoneConnect_VSpeed
*FUNCTION : 投屏界面车速显示
*PARAMETER : uint16_t VSpeed-车速
*RETURN : NULL
*/
static void AMT630H_GUI_PhoneConnect_VSpeed(uint16_t VSpeed)
{
if(g_u8UnitSetting == Metric)
{
//SetPagePic(GRAPHICS_PAGE_0, );/*单位 km/h */
}
else if(g_u8UnitSetting == Imperial)
{
//SetPagePic(GRAPHICS_PAGE_0, );/*单位 mph/h */
}
else
{
;
}
/*数据处理*/
DISPLAY_NUM_ST DisplayNumPara;
uint16_t VSpeedNumber;
VSpeedNumber = VSpeed;
DisplayNumPara.NumList = NumbeList_PhoneConnect_VSpeed;
if (100 <= VSpeedNumber)
{
DisplayNumPara.x = 544;
DisplayNumPara.NumInterval = GROUP_PIC_DIR_LEFT | 60;
DisplayNumPara.y = GROUP_PIC_USE_PSD_Y_POS;
DisplayNumPara.DecimalNum = 0;
DisplayNumPara.MinDigits = 3;
DisplayNum(GRAPHICS_PAGE_0, &DisplayNumPara, VSpeedNumber);
}
else if ((10 <= VSpeedNumber))
{
DisplayNumPara.x = 514;
DisplayNumPara.NumInterval = GROUP_PIC_DIR_LEFT | 60;
DisplayNumPara.y = GROUP_PIC_USE_PSD_Y_POS;
DisplayNumPara.DecimalNum = 0;
DisplayNumPara.MinDigits = 2;
DisplayNum(GRAPHICS_PAGE_0, &DisplayNumPara, VSpeedNumber);
}
else if (0 <= VSpeedNumber)
{
if (VSpeedNumber == 1)
{
DisplayNumPara.x = 484; // 1的宽度与其他数字不同 坐标没给
}
else
{
DisplayNumPara.x = 484;
}
DisplayNumPara.NumInterval = GROUP_PIC_DIR_LEFT | 60;
DisplayNumPara.y = GROUP_PIC_USE_PSD_Y_POS;
DisplayNumPara.DecimalNum = 0;
DisplayNumPara.MinDigits = 1;
DisplayNum(GRAPHICS_PAGE_0, &DisplayNumPara, VSpeedNumber);
}
else
{
;
}
}
/*转速显示函数*/
static void AMT630H_GUI_ESpeed(uint16_t ESpeed)
{
......@@ -3918,10 +4175,10 @@ void AMT630H_GUI_BACKGRAND()
}
}
/*主界面函数*/
AMT630H_GUI_Light();
AMT630H_GUI_TIME(Get_Dis_Hour_Time(), Get_Dis_Minute_Time());
// AMT630H_GUI_Telephone(Telephone);
AMT630H_GUI_Telephone();
/*燃油*/
if (Get_Fuel_Sensor_State() == FuelSensorNormal)
{
......@@ -3962,11 +4219,11 @@ void AMT630H_GUI_BACKGRAND()
}
if (Get_VechileSpeedValid() == 1)
{
AMT630H_GUI_VSpeed(VechileSpeed, Get_Dis_Unit());
AMT630H_GUI_VSpeed(VechileSpeed);
}
else
{
AMT630H_GUI_VSpeed(0,0);
AMT630H_GUI_VSpeed(0);
}
/*转速*/
if (Get_EngineValid() == 1)
......@@ -4026,7 +4283,7 @@ void AMT630H_GUI_BACKGRAND_SelfCheck()
SetPagePic(GRAPHICS_PAGE_0, Pic_0740_682_21);/*蓝牙*/
SetPagePic(GRAPHICS_PAGE_0, Pic_0748_194_26);/*E*/
//AMT630H_GUI_Telephone(Telephone);
AMT630H_GUI_Telephone();
AMT630H_GUI_TIME(Get_Dis_Hour_Time(), Get_Dis_Minute_Time());
if(KL30_VOLTAGE_time < 10)
{
......@@ -4047,9 +4304,9 @@ void AMT630H_GUI_BACKGRAND_SelfCheck()
AMT630H_GUI_Trip(Get_Trip_Value(), Get_Dis_Unit());
}
/*燃油自检*/
if(g_u16fuelnumberup < 320)
if(g_u16fuelnumberup <= 200)
{
AMT630H_GUI_Fuel_SelfCheck(g_u16fuelnumberup/40);
AMT630H_GUI_Fuel_SelfCheck(g_u16fuelnumberup/25);
g_u16fuelnumberup += 8;
}
else
......@@ -4057,7 +4314,7 @@ void AMT630H_GUI_BACKGRAND_SelfCheck()
if(g_u16fuelnumberdown > 0)
{
g_u16fuelnumberdown -= 8;
AMT630H_GUI_Fuel_SelfCheck(g_u16fuelnumberdown/40);/*初始化g_u16fuelnumberdown = 320*/
AMT630H_GUI_Fuel_SelfCheck(g_u16fuelnumberdown/25);/*初始化g_u16fuelnumberdown = 320*/
}
else
{
......@@ -4067,7 +4324,7 @@ void AMT630H_GUI_BACKGRAND_SelfCheck()
/*车速自检*/
if(g_u16vspeednumberup <= 200)
{
AMT630H_GUI_VSpeed(g_u16vspeednumberup,Get_Dis_Unit());/*初始化g_u16vspeednumberup = 0*/
AMT630H_GUI_VSpeed(g_u16vspeednumberup);/*初始化g_u16vspeednumberup = 0*/
g_u16vspeednumberup += 8;
}
else
......@@ -4075,7 +4332,7 @@ void AMT630H_GUI_BACKGRAND_SelfCheck()
if(g_u16vspeednumberdown >0)
{
g_u16vspeednumberdown -= 8;/*初始化g_u16vspeednumberup=200*/
AMT630H_GUI_VSpeed(g_u16vspeednumberdown,Get_Dis_Unit());/*if g_u16vspeednumberup=0 车速自检结束*/
AMT630H_GUI_VSpeed(g_u16vspeednumberdown);/*if g_u16vspeednumberup=0 车速自检结束*/
}
else
{
......@@ -4092,7 +4349,7 @@ void AMT630H_GUI_BACKGRAND_SelfCheck()
{
if(g_u16espeednumberdown > 0)
{
AMT630H_GUI_ESpeed(g_u16espeednumberdown*40);/*初始化g_u16espeednumberdown = 600*/
AMT630H_GUI_ESpeed(g_u16espeednumberdown*40);/*初始化g_u16espeednumberdown = 300*/
g_u16espeednumberdown -= 12;/*g_u16espeednumberdown = 0 转速自检结束*/
}
}
......@@ -4118,13 +4375,13 @@ void AMT630H_GUI_BACKGRAND_SelfCheck()
}
}
/*结束状态*/
if(g_u16fuelnumberup == 600)
if(g_u16fuelnumberdown == 0)
{
AMT630H_GUI_Fuel_SelfCheck(8);
AMT630H_GUI_Fuel_SelfCheck(0);
}
if(g_u16vspeednumberdown == 0)
{
AMT630H_GUI_VSpeed(g_u16vspeednumberdown, Get_Dis_Unit());
AMT630H_GUI_VSpeed(g_u16vspeednumberdown);
}
if(g_u16espeednumberdown == 0)
{
......@@ -4138,6 +4395,7 @@ void AMT630H_GUI_BACKGRAND_SelfCheck()
if((g_u16fuelnumberdown == 0)&&(g_u16vspeednumberdown == 0)&&(g_u16espeednumberdown == 0)&&(g_u16voltagenumberdown == 0))
{
g_u8SelfCheck = 1;/*自检结束标志*/
Voltage_Selfcheck = 0;
}
else
{
......@@ -4148,10 +4406,10 @@ void AMT630H_GUI_SELFCHECK_STS_INIT(void)
{
g_u8SelfCheck = 0U;
g_u16fuelnumberup = 0U;
g_u16fuelnumberdown = 320U;
g_u16fuelnumberdown = 200U;
g_u16vspeednumberup = 0U;
g_u16espeednumberup = 0U;
g_u16vspeednumberdown = 200U;
g_u16espeednumberup = 0U;
g_u16espeednumberdown = 300U;
g_u16voltagenumberup = 0U;
g_u16voltagenumberdown = 160U;
......@@ -4366,7 +4624,7 @@ void AMT630H_GUI_ReadPosittion_Display(void)
AMT630H_GUI_SETTING();
AMT630H_GUI_Quit();
break;
case MENU_ITEM_PHONE_CONNECT_SET:/*28 手机互联成功*/
case MENU_ITEM_PHONE_CONNECT_SET:/*30 手机互联成功*/
AMT630H_GUI_SETTING();
AMT630H_GUI_Phone_Connect_Win();
break;
......@@ -4384,7 +4642,10 @@ void AMT630H_GUI_ReadPosittion_Display(void)
// SetPagePic(GRAPHICS_PAGE_0, Pic_0234_605_289);
// SetPagePic(GRAPHICS_PAGE_0, Pic_0479_242_313);
// SetPagePic(GRAPHICS_PAGE_0, Pic_0411_56_533);
SetPagePic(GRAPHICS_PAGE_0, Pic_0382_0_0);/*背景图*/
AMT630H_GUI_PhoneConnect_Light();
AMT630H_GUI_PhoneConnect_TIME(Get_Dis_Hour_Time(), Get_Dis_Minute_Time());
AMT630H_GUI_PhoneConnect_VSpeed(VechileSpeed);
break;
default:
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