瀏覽代碼

Merge branch 'master' into AW-Regular

FolusWen 4 年之前
父節點
當前提交
00909312ac

+ 9 - 0
EVSE/Modularization/WebService.c

@@ -428,6 +428,7 @@ int main(int argc, char *argv[]) {
 			int MaxChargingEnergy= 0;
 			int MaxChargingPower = 0;
 			int MaxChargingCurrent = 0;
+			int AcMaxChargingCurrent = 0;
 			int MaxChargingDuration = 0;
 			int PhaseLossPolicy = 0;
 			char *LocalWhiteCard0 = NULL;
@@ -476,6 +477,9 @@ int main(int argc, char *argv[]) {
 			if( json_object_object_get_ex(jobj, "MaxChargingCurrent", &val_obj) ) {
 				MaxChargingCurrent = json_object_get_int(val_obj);
 			}
+			if( json_object_object_get_ex(jobj, "AcMaxChargingCurrent", &val_obj) ) {
+				AcMaxChargingCurrent = json_object_get_int(val_obj);
+			}
 			if( json_object_object_get_ex(jobj, "MaxChargingDuration", &val_obj) ) {
 				MaxChargingDuration = json_object_get_int(val_obj);
 			}
@@ -593,6 +597,7 @@ int main(int argc, char *argv[]) {
 			ShmSysConfigAndInfo->SysConfig.MaxChargingEnergy = MaxChargingEnergy;
 			ShmSysConfigAndInfo->SysConfig.MaxChargingPower = MaxChargingPower;
 			ShmSysConfigAndInfo->SysConfig.MaxChargingCurrent = MaxChargingCurrent;
+			ShmSysConfigAndInfo->SysConfig.AcMaxChargingCurrent = AcMaxChargingCurrent;
 			ShmSysConfigAndInfo->SysConfig.MaxChargingDuration = MaxChargingDuration;
 			ShmSysConfigAndInfo->SysConfig.PhaseLossPolicy = PhaseLossPolicy;
 			strcpy((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[0],LocalWhiteCard0);
@@ -838,6 +843,7 @@ int main(int argc, char *argv[]) {
 		ShmSysConfigAndInfo->SysConfig.MaxChargingEnergy=0;
 		ShmSysConfigAndInfo->SysConfig.MaxChargingPower=0;
 		ShmSysConfigAndInfo->SysConfig.MaxChargingCurrent= 0;
+		ShmSysConfigAndInfo->SysConfig.AcMaxChargingCurrent= 0;
 		ShmSysConfigAndInfo->SysConfig.MaxChargingDuration=0;
 		ShmSysConfigAndInfo->SysConfig.PhaseLossPolicy=0;
 		strcpy((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[0], "111");
@@ -1108,6 +1114,7 @@ int main(int argc, char *argv[]) {
 		struct json_object *MaxChargingEnergy;
 		struct json_object *MaxChargingPower;
 		struct json_object *MaxChargingCurrent;
+		struct json_object *AcMaxChargingCurrent;
 		struct json_object *MaxChargingDuration;
 		struct json_object *PhaseLossPolicy;
 		struct json_object *LocalWhiteCard[10];
@@ -1263,6 +1270,7 @@ int main(int argc, char *argv[]) {
 		MaxChargingEnergy = json_object_new_int(ShmSysConfigAndInfo->SysConfig.MaxChargingEnergy);
 		MaxChargingPower = json_object_new_int(ShmSysConfigAndInfo->SysConfig.MaxChargingPower);
 		MaxChargingCurrent = json_object_new_int(ShmSysConfigAndInfo->SysConfig.MaxChargingCurrent);
+		AcMaxChargingCurrent = json_object_new_int(ShmSysConfigAndInfo->SysConfig.AcMaxChargingCurrent);
 		MaxChargingDuration = json_object_new_int(ShmSysConfigAndInfo->SysConfig.MaxChargingDuration);
 		PhaseLossPolicy = json_object_new_int(ShmSysConfigAndInfo->SysConfig.PhaseLossPolicy);
 		LocalWhiteCard[0] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[0]);
@@ -1684,6 +1692,7 @@ int main(int argc, char *argv[]) {
 		json_object_object_add(jobj2,"MaxChargingEnergy",MaxChargingEnergy);
 		json_object_object_add(jobj2,"MaxChargingPower",MaxChargingPower);
 		json_object_object_add(jobj2,"MaxChargingCurrent",MaxChargingCurrent);
+		json_object_object_add(jobj2,"AcMaxChargingCurrent",AcMaxChargingCurrent);
 		json_object_object_add(jobj2,"MaxChargingDuration",MaxChargingDuration);
 		json_object_object_add(jobj2,"PhaseLossPolicy",PhaseLossPolicy);
 		json_object_array_add(LocalWhiteCardArr,LocalWhiteCard[0]);

+ 5 - 10
EVSE/Projects/AW-CCS/Apps/main.c

@@ -1178,7 +1178,7 @@ void get_firmware_version(unsigned char gun_index)
 	strcpy((char*)ShmSysConfigAndInfo->SysInfo.CsuPrimFwRev, ShmCharger->gun_info[gun_index].ver.Version_FW);
 
 	// Get CSU root file system version
-	sprintf((char*)ShmSysConfigAndInfo->SysInfo.CsuRootFsFwRev, "B0.36.00.0000.00");
+	sprintf((char*)ShmSysConfigAndInfo->SysInfo.CsuRootFsFwRev, "B0.01.00.0000.00");
 
 	// Get AC connector type from model name
 	for(uint8_t idx=0;idx<3;idx++)
@@ -1881,13 +1881,10 @@ void checkTask()
 		system("/root/Module_EventLogging &");
 	}
 
-	if(strcmp((char *)&ShmSysConfigAndInfo->SysConfig.OcppServerURL,"") != 0)
+	if(system("pidof -s OcppBackend > /dev/null") != 0)
 	{
-		if(system("pidof -s OcppBackend > /dev/null") != 0)
-		{
-			DEBUG_INFO("OcppBackend not running, restart it.\r\n");
-			system("/root/OcppBackend &");
-		}
+		DEBUG_INFO("OcppBackend not running, restart it.\r\n");
+		system("/root/OcppBackend &");
 	}
 
 	if(system("pidof -s Module_AlarmDetect > /dev/null") != 0)
@@ -2510,7 +2507,6 @@ int main(void)
 					else if((ShmCharger->gun_info[gun_index].primaryMcuState.relay_state == ON))
 					{
 						ShmCharger->gun_info[ShmOCPP16Data->UnlockConnector[gun_index].ConnectorId-1].isUnlockerConnetor = OFF;
-						ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].OutputEnergy = 0;
 						ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PresentChargedEnergy = 0;
 						getDateTimeString((char*)ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].StartDateTime);
 						ShmCharger->gun_info[gun_index].powerConsumption.power_consumption_at_start = ShmCharger->gun_info[gun_index].powerConsumption.power_consumption;
@@ -2545,11 +2541,10 @@ int main(void)
 					else
 					{
 						setLedMotion(gun_index,LED_ACTION_CHARGING);
-						ShmOCPP16Data->StopTransaction[gun_index].MeterStop = (ShmCharger->gun_info[gun_index].powerConsumption.power_consumption - ShmCharger->gun_info[gun_index].powerConsumption.power_consumption_at_start)/100;
+						ShmOCPP16Data->StopTransaction[gun_index].MeterStop = (ShmCharger->gun_info[gun_index].powerConsumption.power_consumption/100);
 						ftime(&endChargingTime[gun_index]);
 						ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PresentChargedDuration = DiffTimeb(startChargingTime[gun_index], endChargingTime[gun_index])/1000;
 						ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PresentChargedEnergy = ((float)(ShmCharger->gun_info[gun_index].powerConsumption.power_consumption - ShmCharger->gun_info[gun_index].powerConsumption.power_consumption_at_start))/100;
-						ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].OutputEnergy =  ((float)(ShmCharger->gun_info[gun_index].powerConsumption.power_consumption - ShmCharger->gun_info[gun_index].powerConsumption.power_consumption_at_start))/100;
 
 						// Response StartTransactionConf
 						if(ShmOCPP16Data->CpMsg.bits[gun_index].StartTransactionConf == ON)

二進制
EVSE/Projects/AW-CCS/Images/FactoryDefaultConfig.bin


二進制
EVSE/Projects/AW-CCS/Images/MLO


二進制
EVSE/Projects/AW-CCS/Images/ramdisk.gz


二進制
EVSE/Projects/AW-CCS/Images/u-boot-spl.bin


二進制
EVSE/Projects/AW-CCS/Images/u-boot.img


二進制
EVSE/Projects/AW-CCS/Images/zImage


+ 3 - 3
EVSE/rootfs/var/www/set_charging.php

@@ -1005,13 +1005,13 @@ img {
 		if(AcMaxChargingCurrent >65535)
 		{
 			alert("Ac Max Charging Current must <= 65535!");
-			document.getElementById("MaxChargingCurrent").focus();
+			document.getElementById("AcMaxChargingCurrent").focus();
 			return false;
 		}
 		if(AcMaxChargingCurrent < 0)
 		{
 			alert("Ac Max Charging Current must >= 0!");
-			document.getElementById("MaxChargingCurrent").focus();
+			document.getElementById("AcMaxChargingCurrent").focus();
 			return false;
 		}
 		if(RatingPower!="" && RatingPower!=0){
@@ -1055,7 +1055,7 @@ img {
 		if(AcRatingCurrent!="" && AcRatingCurrent!=0){
 			if(parseFloat(AcMaxChargingCurrent) > parseFloat(AcRatingCurrent))
 			{
-				alert("Ac Max Charging Current must be less than Ac Rating Current("+RatingCurrent+")!");
+				alert("Ac Max Charging Current must be less than Ac Rating Current("+AcRatingCurrent+")!");
 				document.getElementById("AcMaxChargingCurrent").focus();
 				return false;
 			}

+ 2 - 0
EVSE/rootfs/var/www/set_charging_action.php

@@ -25,6 +25,7 @@
 		checkMaxValue("MaxChargingEnergy");
 		checkMaxValue("MaxChargingPower");
 		checkMaxValue("MaxChargingCurrent");
+		checkMaxValue("AcMaxChargingCurrent");
 		checkMaxValue("MaxChargingDuration");
 		checkValue("PhaseLossPolicy");
 //		$json = json_decode(file_get_contents("charging.txt"), true);
@@ -32,6 +33,7 @@
 		$json['MaxChargingEnergy']			= (int)$_POST['MaxChargingEnergy'];
 		$json['MaxChargingPower'] 			= (int)$_POST['MaxChargingPower'];
 		$json['MaxChargingCurrent']			= (int)$_POST['MaxChargingCurrent'];
+		$json['AcMaxChargingCurrent']		= (int)$_POST['AcMaxChargingCurrent'];
 		$json['MaxChargingDuration'] 		= (int)$_POST['MaxChargingDuration'];
 		$json['PhaseLossPolicy']			= (int)$_POST['PhaseLossPolicy'];
 		$json['LocalWhiteCard0']			= isset($_POST['LocalWhiteCard0'])?$_POST['LocalWhiteCard0']:"";