aa
Dependencies: mbed LCD_DISCO_F469NIa SD_DISCO_F469NI BSP_DISCO_F469NIa EEPROM_DISCO_F469NI
Diff: screen_library.cpp
- Revision:
- 6:d6e001d7cf16
- Parent:
- 5:4b63e6845a8e
diff -r 4b63e6845a8e -r d6e001d7cf16 screen_library.cpp --- a/screen_library.cpp Wed Nov 28 12:01:20 2018 +0000 +++ b/screen_library.cpp Wed Feb 12 18:49:12 2020 +0000 @@ -6,13 +6,15 @@ extern uint8_t screen_flag,ft_main_flag,ft_2aux_flag,change_flag; extern GEAR *Gears; +extern CHAR LogoSmallEA; extern IMAGE LogoBig,LogoSmall,Branko,NewYearCongat; -extern uint16_t Rpm0, Speed0, Gear0, Water_Temp0, Oil_Temp0, TPS0, Brakes0, MAP0, Air_Temp0, Lambda0, Volts0, Crank0; -extern uint16_t Rpm, Speed, Gear, Water_Temp, Oil_Temp, TPS, Brakes, MAP, Air_Temp, Lambda, Volts, Crank; +extern uint16_t Capacity0,HV_Voltage0, Rpm0, Speed0, Gear0, Water_Temp0, Bat_Temp0, TPS0, Brakes0, MAP0, Air_Temp0, Lambda0, Volts0, Crank0; +extern uint16_t Capacity,HV_Voltage, Rpm, Speed, Gear, Water_Temp, Bat_Temp, TPS, Brakes, MAP, Air_Temp, Lambda, Volts, Crank; extern int FL_LVDT0, FR_LVDT0, RL_LVDT0, RR_LVDT0, FL_LVDT, FR_LVDT, RL_LVDT, RR_LVDT; extern int FL_LVDT_Ref,FR_LVDT_Ref,RL_LVDT_Ref,RR_LVDT_Ref; extern int LVDT_Max; +extern uint8_t Acc_Temperature0[]; //extern float Meter_counter,Meter_counter0; void ChangeCommand(){ //Interrupt function for registering change command @@ -52,23 +54,25 @@ lcd.SetTextColor(LCD_COLOR_BLACK); //Draw Main screen DrawSpeedMeter(); - DrawRGBImage(LogoSmall,LogoSmallXPos,LogoSmallYPos); + PrintChar(LogoSmallEA,LogoSmallXPos,LogoSmallYPos,LCD_COLOR_BLACK); lcd.SetFont(&Font24); - lcd.DisplayStringAt(30,170,(uint8_t*)"Oil Temp",LEFT_MODE); + lcd.DisplayStringAt(30,170,(uint8_t*)"Battery Temp",LEFT_MODE); lcd.DisplayStringAt(30,320,(uint8_t*)"Water Temp",LEFT_MODE); lcd.DisplayStringAt(584,170,(uint8_t*)"TPS",LEFT_MODE); - lcd.SetTextColor(LCD_COLOR_DARKRED); - lcd.FillRect(560,340,230,68); - lcd.SetBackColor(LCD_COLOR_DARKRED); - PrintString("BRAKE",50,575,350,LCD_COLOR_BLACK); - lcd.SetBackColor(LCD_COLOR_WHITE); + lcd.DisplayStringAt(584,320,(uint8_t*)"HVDC Voltage",LEFT_MODE); //Display initial values - PrintChar(Gears[Gear],GearXPos,GearYPos,LCD_COLOR_BLACK); - SetNumber(Oil_Temp,100,OilTempXPos,OilTempYPos,3,0,0); + lcd.SetTextColor(LCD_COLOR_BLACK); + lcd.FillRect(CapXPos-5,CapYPos-5,210,310); + lcd.FillRect(CapXPos+60,CapYPos-20,80,20); + lcd.SetTextColor(LCD_COLOR_WHITE); + lcd.FillRect(CapXPos,CapYPos,200,300); + lcd.SetTextColor(LCD_COLOR_BLACK); + UpdateCapBar(Capacity,0,CapXPos,CapYPos); + SetNumber(Bat_Temp,100,BatTempXPos,BatTempYPos,3,0,0); SetNumber(Water_Temp,100,WaterTempXPos,WaterTempYPos,3,0,0); SetNumber(TPS,100,TPSXPos,TPSYPos,3,0,0); - BrakeSignal(Brakes); + SetNumber(HV_Voltage,100,HVVXPos,HVVYPos,3,0,0); }; @@ -77,6 +81,8 @@ lcd.SetTextColor(LCD_COLOR_WHITE); lcd.FillRect(0,0,800,480); lcd.SetTextColor(LCD_COLOR_BLACK); + //PrintChar(LogoSmallEA,LogoSmallXPos,LogoSmallYPos,LCD_COLOR_BLACK); + /* //Draw First Auxiliary screen PrintString("RPM",50,20,30,LCD_COLOR_BLACK); PrintString("MAP",50,20,90,LCD_COLOR_BLACK); @@ -98,6 +104,11 @@ SetNumber(Lambda,50,LambdaXPos,LambdaYPos,4,1,0); SetNumber(Volts,50,VoltsXPos,VoltsYPos,3,2,0); //SetNumber((int)(Meter_counter/10),50,Meter_counterXPos,Meter_counterYPos,5,3,0); + */ + DrawBatTempMap(); + for (uint8_t k = 1; k <= 70; k++){ + Acc_Temperature0[k] = 10; + }; }; @@ -108,7 +119,7 @@ lcd.SetTextColor(LCD_COLOR_BLACK); // Draw Second Auxiliary screen PrintString("LVDT Sensors",50,200,20,LCD_COLOR_BLACK); - DrawRGBImage(LogoSmall,LogoSmallXPos,LogoSmallYPos); + //DrawRGBImage(LogoSmall,LogoSmallXPos,LogoSmallYPos); lcd.SetTextColor(LCD_COLOR_BLACK); lcd.SetFont(&Font24); lcd.DisplayStringAt(FLLVDTBarXPos+25,FLLVDTBarYPos,(uint8_t*)"FL",LEFT_MODE); @@ -124,7 +135,7 @@ UpdateLVDTScale(FR_LVDT,-100,FRLVDTBarXPos,FRLVDTBarYPos); UpdateLVDTScale(RL_LVDT,-100,RLLVDTBarXPos,RLLVDTBarYPos); UpdateLVDTScale(RR_LVDT,-100,RRLVDTBarXPos,RRLVDTBarYPos); - + PrintChar(LogoSmallEA,LogoSmallXPos,LogoSmallYPos,LCD_COLOR_BLACK); }; @@ -140,11 +151,11 @@ if(Speed!=Speed0){ //Check is value is changed. If it is then update it on screen. UpdateSpeedMeter((int)(Speed0/10),(int)((Speed-Speed0)/10)); }; - if(Gear!=Gear0){ - PrintChar(Gears[Gear],GearXPos,GearYPos,LCD_COLOR_BLACK); + if(Capacity!=Capacity0){ + UpdateCapBar(Capacity,Capacity0,CapXPos,CapYPos); }; - if(Oil_Temp!=Oil_Temp0){ - ChangeNumber(Oil_Temp,Oil_Temp0,100,OilTempXPos,OilTempYPos,3,0,0); + if(Bat_Temp!=Bat_Temp0){ + ChangeNumber(Bat_Temp,Bat_Temp0,100,BatTempXPos,BatTempYPos,3,0,0); }; if(Water_Temp!=Water_Temp0){ ChangeNumber(Water_Temp,Water_Temp0,100,WaterTempXPos,WaterTempYPos,3,0,0); @@ -152,14 +163,14 @@ if(TPS!=TPS0){ ChangeNumber(TPS,TPS0,100,TPSXPos,TPSYPos,3,0,0); }; - if(Brakes!=Brakes0){ - BrakeSignal(Brakes); + if(HV_Voltage!=HV_Voltage0){ + ChangeNumber(HV_Voltage,HV_Voltage0,100,HVVXPos,HVVYPos,3,0,0); }; }; void FirstAuxUpdate(){ // Update information in First Auxiliary screen - if (Rpm!=Rpm0){ + /*if (Rpm!=Rpm0){ ChangeNumber(Rpm,Rpm0,50,RpmXPos,RpmYPos,5,0,0); }; if (MAP!=MAP0){ @@ -177,6 +188,8 @@ //if (Meter_counter!=Meter_counter0){ // ChangeNumber((int)(Meter_counter/10),(int)(Meter_counter0/10),50,Meter_counterXPos,Meter_counterYPos,5,3,0); //}; + */ + UpdateBatTempMap(); }; void SecondAuxUpdate(){ // Update information in Second Auxiliary screen