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

2020-01-21 / Kathy Yeh
1. modify compare AC / DC rule

Kathy_Yeh 5 жил өмнө
parent
commit
c56bc3a2b1

+ 6 - 71
EVSE/Modularization/ocppfiles/MessageHandler.c

@@ -44,7 +44,6 @@
 
 
 
-
 #define PASS				1
 #define FAIL				-1
 
@@ -936,24 +935,6 @@ struct StructConfigurationKey staticResponseConfigurationKeyArray[GetConfigurati
 struct StructConfigurationKeyItems staticResponseUnknownKey[10]={0};
 struct StructLocalAuthorizationList staticLocalAuthorizationList[500]={0};
 
-#if 0
-struct StructChargingSchedulePeriod staticCHAdeMOChargingSchedulePeriod[10]={0};
-struct StructChargingSchedulePeriod staticCCSChargingSchedulePeriod[10]={0};
-struct StructChargingSchedulePeriod staticGBChargingSchedulePeriod[10]={0};
-struct StructChargingSchedulePeriod staticACChargingSchedulePeriod[10]={0};
-
-struct StructChargingSchedulePeriod staticCHAdeMOCompositeChargingSchedulePeriod[10]={0};
-struct StructChargingSchedulePeriod staticCCSCompositeChargingSchedulePeriod[10]={0};
-struct StructChargingSchedulePeriod staticGBCompositeChargingSchedulePeriod[10]={0};
-struct StructChargingSchedulePeriod staticACCompositeChargingSchedulePeriod[10]={0};
-
-struct StructChargingSchedulePeriod staticCHAdeMORemoteStartTransactionChargingSchedulePeriod[10]={0};
-struct StructChargingSchedulePeriod staticCCSRemoteStartTransactionChargingSchedulePeriod[10]={0};
-struct StructChargingSchedulePeriod staticGBRemoteStartTransactionChargingSchedulePeriod[10]={0};
-struct StructChargingSchedulePeriod staticACRemoteStartTransactionChargingSchedulePeriod[10]={0};
-#endif
-
-
 //==========================================
 // Init all share memory
 //==========================================
@@ -1082,61 +1063,15 @@ int InitShareMemory()
 	ShmOCPP16Data->SendLocalList.LocalAuthorizationList = staticLocalAuthorizationList;
 
 
-	if(strstr((const char *)ShmSysConfigAndInfo->SysConfig.ModelName ,"DC") != NULL)
+	if(ShmSysConfigAndInfo->SysConfig.ModelName[0]=='D') // 'D' means DC
 	{
-#if 0
-		if(CHAdeMO_QUANTITY != 0)
-		{
-			int index = ShmSysConfigAndInfo->SysInfo.ChademoChargingData[0].Index;
-			ShmOCPP16Data->SetChargingProfile[index].ChargingProfile.ChargingSchedule.ChargingSchedulePeriod = staticCHAdeMOChargingSchedulePeriod;
-			ShmOCPP16Data->GetCompositeSchedule[index].ResponseChargingSchedule.ChargingSchedulePeriod = staticCHAdeMOCompositeChargingSchedulePeriod;
-			ShmOCPP16Data->RemoteStartTransaction[index].ChargingProfile.ChargingSchedule.ChargingSchedulePeriod = staticCHAdeMORemoteStartTransactionChargingSchedulePeriod;
-			//ShmOCPP16Data->StopTransaction[index].TransactionData = (struct StructMeterValue *)&staticCHAdeMOTransactionDataForStopTransactionRequest;
-			//ShmOCPP16Data->StopTransaction[index].TransactionData[0].SampledValue = staticCHAdeMOTransactionDataForStopTransactionRequest[0].SampledValue;
-		}
-
-		if(CCS_QUANTITY != 0)
-		{
-			int index = ShmSysConfigAndInfo->SysInfo.CcsChargingData[0].Index;
-			ShmOCPP16Data->SetChargingProfile[index].ChargingProfile.ChargingSchedule.ChargingSchedulePeriod = staticCCSChargingSchedulePeriod;
-			ShmOCPP16Data->GetCompositeSchedule[index].ResponseChargingSchedule.ChargingSchedulePeriod = staticCCSCompositeChargingSchedulePeriod;
-			ShmOCPP16Data->RemoteStartTransaction[index].ChargingProfile.ChargingSchedule.ChargingSchedulePeriod = staticCCSRemoteStartTransactionChargingSchedulePeriod;
-			//ShmOCPP16Data->StopTransaction[index].TransactionData = (struct StructMeterValue *)&staticCCSTransactionDataForStopTransactionRequest;
-			//ShmOCPP16Data->StopTransaction[index].TransactionData[0].SampledValue = staticCCSTransactionDataForStopTransactionRequest[0].SampledValue;
-		}
-
-		if(GB_QUANTITY != 0)
-		{
-			int index = ShmSysConfigAndInfo->SysInfo.GbChargingData[0].Index;
-			ShmOCPP16Data->SetChargingProfile[index].ChargingProfile.ChargingSchedule.ChargingSchedulePeriod = staticGBChargingSchedulePeriod;
-			ShmOCPP16Data->GetCompositeSchedule[index].ResponseChargingSchedule.ChargingSchedulePeriod = staticGBCompositeChargingSchedulePeriod;
-			ShmOCPP16Data->RemoteStartTransaction[index].ChargingProfile.ChargingSchedule.ChargingSchedulePeriod = staticGBRemoteStartTransactionChargingSchedulePeriod;
-			//ShmOCPP16Data->StopTransaction[index].TransactionData = (struct StructMeterValue *)&staticGBTransactionDataForStopTransactionRequest;
-			//ShmOCPP16Data->StopTransaction[index].TransactionData[0].SampledValue = staticGBTransactionDataForStopTransactionRequest[0].SampledValue;
-		}
-#endif
 		SystemInitial = CHAdeMO_QUANTITY + CCS_QUANTITY + GB_QUANTITY;
 		DEBUG_INFO("DC ...\n");
 	}
-	else
+	else if (ShmSysConfigAndInfo->SysConfig.ModelName[0]=='A') //'A' means AC
 	{
-#if 0
-		if(AC_QUANTITY != 0)
-		{
-			int index = ShmSysConfigAndInfo->SysInfo.AcChargingData[0].Index;
-			ShmOCPP16Data->SetChargingProfile[index].ChargingProfile.ChargingSchedule.ChargingSchedulePeriod = staticACChargingSchedulePeriod;
-			ShmOCPP16Data->GetCompositeSchedule[index].ResponseChargingSchedule.ChargingSchedulePeriod = staticACCompositeChargingSchedulePeriod;
-			ShmOCPP16Data->RemoteStartTransaction[index].ChargingProfile.ChargingSchedule.ChargingSchedulePeriod = staticACRemoteStartTransactionChargingSchedulePeriod;
-			//ShmOCPP16Data->StopTransaction[index].TransactionData = (struct StructMeterValue *)&staticACTransactionDataForStopTransactionRequest;
-			//ShmOCPP16Data->StopTransaction[index].TransactionData[0].SampledValue = staticACTransactionDataForStopTransactionRequest[0].SampledValue;
-		}
-#endif
 		SystemInitial = AC_QUANTITY;
 		DEBUG_INFO("AC ...\n");
-
-		DEBUG_INFO("gunTotalNumber=%d\n",gunTotalNumber);
-
-
 	}
 
 	//Status Setting
@@ -2491,7 +2426,7 @@ S_FAULT                 =12
 
 	if(hashmap_operation(0, guid, tempdata) == 1)//if(hashmap_operation(0,NULL/*hashMap*/, guid, mapItem, tempdata/*(void**)(&mapItem)*//*(void**)(&mapItem)*/) ==  MAP_OK/*hashmap_put(hashMap, mapItem->key_string, mapItem) == MAP_OK*/)
 	{
-		DEBUG_ERROR("statusNotification mapitem pass");
+		//DEBUG_ERROR("statusNotification mapitem pass");
 		result = PASS;
 	}
 
@@ -10262,9 +10197,9 @@ void handleHeartbeatResponse(char *payload, int gun_index)
 	sstr[c] = '\0';
 	strcpy((char *)ShmOCPP16Data->Heartbeat.ResponseCurrentTime,sstr);
 
-	#ifdef SystemLogMessage
-	DEBUG_INFO("currentTime: %s\n", ShmOCPP16Data->Heartbeat.ResponseCurrentTime);
-	#endif
+//	#ifdef SystemLogMessage
+//	DEBUG_INFO("currentTime: %s\n", ShmOCPP16Data->Heartbeat.ResponseCurrentTime);
+//	#endif
 
 	strptime((const char *)ShmOCPP16Data->Heartbeat.ResponseCurrentTime, "%Y-%m-%dT%H:%M:%S", &tp);
 	tp.tm_isdst = -1;