Эх сурвалжийг харах

[Improve][NoodoeAX][main.c]
2022-12-29 / EASON YANG
Action:
1. Improve: Synchronize powerConsumptionTotal -> PowerConsumption.

File:
1. main.c
Action 1

FIRMWARE VERSION: B0.62.XX.XXXX.NX

8009 2 жил өмнө
parent
commit
9ab0ea7913

+ 16 - 0
EVSE/Projects/NoodoeAX/Apps/main.c

@@ -6074,6 +6074,19 @@ int main(void)
 				}
 			}
 
+			//==========================================
+			// Synchronized total power consumption
+			//==========================================
+			if(ShmSysConfigAndInfo->SysConfig.AcPhaseCount==1)
+				ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PowerConsumption = (ShmCharger->gun_info[gun_index].powerConsumptionTotal.power_consumption/10000.0);
+			else
+			{
+				ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PowerConsumption = (ShmCharger->gun_info[gun_index].powerConsumptionTotal.power_consumption/10000.0);
+				//ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PowerConsumption[0] = (ShmCharger->gun_info[gun_index].powerConsumption[0].power_consumption/10000.0);
+				//ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PowerConsumption[1] = (ShmCharger->gun_info[gun_index].powerConsumption[1].power_consumption/10000.0);
+				//ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PowerConsumption[2] = (ShmCharger->gun_info[gun_index].powerConsumption[2].power_consumption/10000.0);
+			}
+
 			//==========================================
 			// Connector process
 			//==========================================
@@ -6187,6 +6200,9 @@ int main(void)
 						// Refresh PTB resend timer
 						if(ShmSysConfigAndInfo->SysConfig.ModelName[3] == 'P')
 							refreshStartTimer(&startTime[gun_index][TMR_IDX_PTB_METER_SEND]);
+
+						DEBUG_INFO("System memory power consumption: %.4f \n",(ShmCharger->gun_info[gun_index].powerConsumptionTotal.power_consumption/10000.0));
+						DEBUG_INFO("Share memory power consumption: %.4f \n",ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PowerConsumption);
 					}
 
 					break;