فهرست منبع

Merge branch 'AW-CCS' of https://git.phihong.com.tw:30000/System_Integration/CSU3_AM335x into AW-CCS

FolusWen 2 سال پیش
والد
کامیت
bdf5fa5392
2فایلهای تغییر یافته به همراه25 افزوده شده و 3 حذف شده
  1. 2 2
      EVSE/Projects/AW-CCS/Apps/LCM/Module_LcmControl.c
  2. 23 1
      EVSE/Projects/AW-CCS/Apps/Module_InternalComm.c

+ 2 - 2
EVSE/Projects/AW-CCS/Apps/LCM/Module_LcmControl.c

@@ -2436,7 +2436,7 @@ void setTextToEmpty(uint8_t gun_index)
 	memset(data, 0x00, ARRAY_SIZE(data));
 	memset(text_empty, 0x00, ARRAY_SIZE(text_empty));
 
-	strcpy((char*)text_empty, "                ");
+	strcpy((char*)text_empty, "               ");
 	string2ByteArray(text_empty, data);
 
 	lcdRegisterWrite(Uart1Fd, REG_TYPE_RAM, TEXT_CHARGING_TOTAL_COST, data, ARRAY_SIZE(data));
@@ -2700,7 +2700,7 @@ void setClearPrechargingValueToEmpty()
 	memset(data, 0x00, ARRAY_SIZE(data));
 	memset(text, 0x00, ARRAY_SIZE(text));
 
-	strcpy((char*)text, "                ");
+	strcpy((char*)text, "               ");
 	string2ByteArray(text, data);
 
 	lcdRegisterWrite(Uart1Fd, REG_TYPE_RAM, TEXT_PRECHARGING_TIMER, data, ARRAY_SIZE(data));

+ 23 - 1
EVSE/Projects/AW-CCS/Apps/Module_InternalComm.c

@@ -52,6 +52,9 @@ struct Charger					*ShmCharger;
 uint16_t						stepIndex=21, logIndex;
 long long						tsLast, tsNow, tsPrintLog[2];
 uint64_t						tmpPowerConsumption;
+uint64_t						tmpL1PowerConsumption;
+uint64_t						tmpL2PowerConsumption;
+uint64_t						tmpL3PowerConsumption;
 
 void trim(char *s);
 int mystrcmp(char *p1,char *p2);
@@ -1000,7 +1003,26 @@ unsigned char Query_Power_Consumption(unsigned char fd, unsigned char targetAddr
 
 #else	//SIMULATION
 			tsNow = current_timestamp();
-			tmpPowerConsumption += (uint64_t)((ShmSysConfigAndInfo->SysInfo.AcChargingData[0].PresentChargingVoltage*ShmSysConfigAndInfo->SysInfo.AcChargingData[0].PresentChargingCurrent)*((tsNow-tsLast)/360000.0));
+
+			if(ShmSysConfigAndInfo->SysConfig.AcPhaseCount == 3)
+			{
+				tmpPowerConsumption += ((uint64_t)((ShmSysConfigAndInfo->SysInfo.AcChargingData[0].PresentChargingVoltage*ShmSysConfigAndInfo->SysInfo.AcChargingData[0].PresentChargingCurrent)*((tsNow-tsLast)/360000.0)) +
+										(uint64_t)((ShmSysConfigAndInfo->SysInfo.AcChargingData[0].PresentChargingVoltageL2*ShmSysConfigAndInfo->SysInfo.AcChargingData[0].PresentChargingCurrentL2)*((tsNow-tsLast)/360000.0)) +
+										(uint64_t)((ShmSysConfigAndInfo->SysInfo.AcChargingData[0].PresentChargingVoltageL3*ShmSysConfigAndInfo->SysInfo.AcChargingData[0].PresentChargingCurrentL3)*((tsNow-tsLast)/360000.0)));
+
+				tmpL1PowerConsumption += (uint64_t)((ShmSysConfigAndInfo->SysInfo.AcChargingData[0].PresentChargingVoltage*ShmSysConfigAndInfo->SysInfo.AcChargingData[0].PresentChargingCurrent)*((tsNow-tsLast)/360000.0));
+				tmpL2PowerConsumption += (uint64_t)((ShmSysConfigAndInfo->SysInfo.AcChargingData[0].PresentChargingVoltageL2*ShmSysConfigAndInfo->SysInfo.AcChargingData[0].PresentChargingCurrentL2)*((tsNow-tsLast)/360000.0));
+				tmpL3PowerConsumption += (uint64_t)((ShmSysConfigAndInfo->SysInfo.AcChargingData[0].PresentChargingVoltageL3*ShmSysConfigAndInfo->SysInfo.AcChargingData[0].PresentChargingCurrentL3)*((tsNow-tsLast)/360000.0));
+
+				Ret_Buf_L1-> power_consumption = tmpL1PowerConsumption;
+				Ret_Buf_L2-> power_consumption = tmpL2PowerConsumption;
+				Ret_Buf_L3-> power_consumption = tmpL3PowerConsumption;
+			}
+			else
+			{
+				tmpPowerConsumption += (uint64_t)((ShmSysConfigAndInfo->SysInfo.AcChargingData[0].PresentChargingVoltage*ShmSysConfigAndInfo->SysInfo.AcChargingData[0].PresentChargingCurrent)*((tsNow-tsLast)/360000.0));
+			}
+
 			Ret_Buf_T-> power_consumption = tmpPowerConsumption;
 			tsLast = tsNow;
 #endif	//SIMULATION