|
@@ -1439,13 +1439,13 @@ int DB_cbVariableIsCreate(void *para, int columnCount, char **columnValue, char
|
|
|
sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[AlignedDataCtrlr_Measurands].component.name, "AlignedDataCtrlr");
|
|
|
sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[AlignedDataCtrlr_Measurands].variable.name, "Measurands");
|
|
|
sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[AlignedDataCtrlr_Measurands].variableCharacteristics.dataType, "%s", DataEnumTypeStr[DataEnumType_MemberList]);
|
|
|
- ShmOCPP20Data->ControllerComponentVariable[AlignedDataCtrlr_Measurands].variableCharacteristics.maxLimit = 10;
|
|
|
+ ShmOCPP20Data->ControllerComponentVariable[AlignedDataCtrlr_Measurands].variableCharacteristics.maxLimit = 20;
|
|
|
sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[AlignedDataCtrlr_Measurands].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Target]);
|
|
|
sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[AlignedDataCtrlr_Measurands].variableAttribute[0].mutability, "%s", MutabilityEnumTypeStr[MutabilityEnumType_ReadOnly]);
|
|
|
if(ShmSysConfigAndInfo->SysConfig.ModelName[0]=='D')
|
|
|
- sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[AlignedDataCtrlr_Measurands].variableAttribute[0].value, "Current.Import,Energy.Active.Import.Register,Energy.Active.Import.Interval,Power.Active.Import,Voltage,SOC");
|
|
|
+ sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[AlignedDataCtrlr_Measurands].variableAttribute[0].value, "Current.Import,Energy.Active.Import.Register,Energy.Active.Import.Interval,Power.Active.Import,Voltage,SOC,Current.Offered,Power.Offered");
|
|
|
else
|
|
|
- sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[AlignedDataCtrlr_Measurands].variableAttribute[0].value, "Current.Import,Energy.Active.Import.Register,Energy.Active.Import.Interval,Power.Active.Import,Voltage");
|
|
|
+ sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[AlignedDataCtrlr_Measurands].variableAttribute[0].value, "Current.Import,Energy.Active.Import.Register,Energy.Active.Import.Interval,Power.Active.Import,Voltage,Current.Offered");
|
|
|
DB_variableSaveToDb(&ShmOCPP20Data->ControllerComponentVariable[AlignedDataCtrlr_Measurands]);
|
|
|
|
|
|
sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[AlignedDataCtrlr_Interval].component.name, "AlignedDataCtrlr");
|
|
@@ -2190,13 +2190,13 @@ int DB_cbVariableIsCreate(void *para, int columnCount, char **columnValue, char
|
|
|
sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[SampledDataCtrlr_TxUpdatedMeasurands].component.name, "SampledDataCtrlr");
|
|
|
sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[SampledDataCtrlr_TxUpdatedMeasurands].variable.name, "TxUpdatedMeasurands");
|
|
|
sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[SampledDataCtrlr_TxUpdatedMeasurands].variableCharacteristics.dataType, "%s", DataEnumTypeStr[DataEnumType_MemberList]);
|
|
|
- ShmOCPP20Data->ControllerComponentVariable[SampledDataCtrlr_TxUpdatedMeasurands].variableCharacteristics.maxLimit = 10;
|
|
|
+ ShmOCPP20Data->ControllerComponentVariable[SampledDataCtrlr_TxUpdatedMeasurands].variableCharacteristics.maxLimit = 0;
|
|
|
sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[SampledDataCtrlr_TxUpdatedMeasurands].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Target]);
|
|
|
sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[SampledDataCtrlr_TxUpdatedMeasurands].variableAttribute[0].mutability, "%s", MutabilityEnumTypeStr[MutabilityEnumType_ReadWrite]);
|
|
|
if(ShmSysConfigAndInfo->SysConfig.ModelName[0]=='D')
|
|
|
- sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[SampledDataCtrlr_TxUpdatedMeasurands].variableAttribute[0].value, "Current.Import,Energy.Active.Import.Register,Energy.Active.Import.Interval,Power.Active.Import,Voltage,SOC");
|
|
|
+ sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[SampledDataCtrlr_TxUpdatedMeasurands].variableAttribute[0].value, "Current.Import,Energy.Active.Import.Register,Energy.Active.Import.Interval,Power.Active.Import,Voltage,SOC,Current.Offered,Power.Offered");
|
|
|
else
|
|
|
- sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[SampledDataCtrlr_TxUpdatedMeasurands].variableAttribute[0].value, "Current.Import,Energy.Active.Import.Register,Energy.Active.Import.Interval,Power.Active.Import,Voltage");
|
|
|
+ sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[SampledDataCtrlr_TxUpdatedMeasurands].variableAttribute[0].value, "Current.Import,Energy.Active.Import.Register,Energy.Active.Import.Interval,Power.Active.Import,Voltage,Current.Offered");
|
|
|
DB_variableSaveToDb(&ShmOCPP20Data->ControllerComponentVariable[SampledDataCtrlr_TxUpdatedMeasurands]);
|
|
|
|
|
|
sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[SampledDataCtrlr_TxUpdatedInterval].component.name, "SampledDataCtrlr");
|
|
@@ -7323,6 +7323,7 @@ int sendMeterValuesRequest(int gun_index, ReadingContextEnumType dataType)
|
|
|
DEBUG_INFO("sendMeterValuesRequest...\n");
|
|
|
|
|
|
memset(queuedata, 0, ARRAY_SIZE(queuedata));
|
|
|
+ memset(&ShmOCPP20Data->MeterValues[gun_index], 0, sizeof(struct MeterValues_20));
|
|
|
//set value
|
|
|
ShmOCPP20Data->MeterValues[gun_index].evseId = gun_index + 1; // gun start from 1~
|
|
|
|
|
@@ -7343,118 +7344,240 @@ int sendMeterValuesRequest(int gun_index, ReadingContextEnumType dataType)
|
|
|
|
|
|
//idx_sample=0;
|
|
|
//********************************(1)Current.Import L1************************************************/
|
|
|
- //J: CHAdeMO U: CCS1 combo E: CCS2 combo G: GBT DC
|
|
|
- if(gunType[gun_index] == GUN_TYPE_CHAdeMO)
|
|
|
+ if(((dataType == ReadingContextEnumType_Sample_Clock) && (strstr((char*)ShmOCPP20Data->ControllerComponentVariable[AlignedDataCtrlr_Measurands].variableAttribute[0].value, MeasurandEnumTypeStr[MeasurandEnumType_Current_Import]) != NULL)) ||
|
|
|
+ ((dataType == ReadingContextEnumType_Sample_Periodic) && (strstr((char*)ShmOCPP20Data->ControllerComponentVariable[SampledDataCtrlr_TxUpdatedMeasurands].variableAttribute[0].value, MeasurandEnumTypeStr[MeasurandEnumType_Current_Import]) != NULL)) ||
|
|
|
+ (dataType == ReadingContextEnumType_Trigger))
|
|
|
{
|
|
|
- if(ShmSysConfigAndInfo->SysConfig.ModelName[8] != '0')
|
|
|
+ //J: CHAdeMO U: CCS1 combo E: CCS2 combo G: GBT DC
|
|
|
+ if(gunType[gun_index] == GUN_TYPE_CHAdeMO)
|
|
|
{
|
|
|
- tempIndex = ((gun_index==2) ? 1: 0);
|
|
|
+ if(ShmSysConfigAndInfo->SysConfig.ModelName[8] != '0')
|
|
|
+ {
|
|
|
+ tempIndex = ((gun_index==2) ? 1: 0);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ tempIndex = gun_index;
|
|
|
+ }
|
|
|
+
|
|
|
+ for (int index = 0; index < CHAdeMO_QUANTITY; index++)
|
|
|
+ {
|
|
|
+ if (ShmSysConfigAndInfo->SysInfo.ChademoChargingData[index].Index == tempIndex)
|
|
|
+ {
|
|
|
+ ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[0].value = ShmSysConfigAndInfo->SysInfo.ChademoChargingData[index].PresentChargingCurrent;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[0].phase, PhaseEnumTypeStr[PhaseEnumType_L3_N]);
|
|
|
}
|
|
|
- else
|
|
|
+ else if(gunType[gun_index] == GUN_TYPE_CCS)
|
|
|
{
|
|
|
- tempIndex = gun_index;
|
|
|
- }
|
|
|
+ if(ShmSysConfigAndInfo->SysConfig.ModelName[8] != '0')
|
|
|
+ {
|
|
|
+ tempIndex = ((gun_index==2) ? 1: 0);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ tempIndex = gun_index;
|
|
|
+ }
|
|
|
|
|
|
- for (int index = 0; index < CHAdeMO_QUANTITY; index++)
|
|
|
- {
|
|
|
- if (ShmSysConfigAndInfo->SysInfo.ChademoChargingData[index].Index == tempIndex)
|
|
|
+ for (int index = 0; index < CCS_QUANTITY; index++)
|
|
|
{
|
|
|
- ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[0].value = ShmSysConfigAndInfo->SysInfo.ChademoChargingData[index].PresentChargingCurrent;
|
|
|
+ if (ShmSysConfigAndInfo->SysInfo.CcsChargingData[index].Index == tempIndex)
|
|
|
+ {
|
|
|
+ ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[0].value = ShmSysConfigAndInfo->SysInfo.CcsChargingData[index].PresentChargingCurrent;
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
|
|
|
- strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[0].phase, PhaseEnumTypeStr[PhaseEnumType_L3_N]);
|
|
|
- }
|
|
|
- else if(gunType[gun_index] == GUN_TYPE_CCS)
|
|
|
- {
|
|
|
- if(ShmSysConfigAndInfo->SysConfig.ModelName[8] != '0')
|
|
|
- {
|
|
|
- tempIndex = ((gun_index==2) ? 1: 0);
|
|
|
+ strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[0].phase, PhaseEnumTypeStr[PhaseEnumType_L3_N]);
|
|
|
}
|
|
|
- else
|
|
|
+ else if(gunType[gun_index] == GUN_TYPE_GBT)
|
|
|
{
|
|
|
- tempIndex = gun_index;
|
|
|
- }
|
|
|
+ if(ShmSysConfigAndInfo->SysConfig.ModelName[8] != '0')
|
|
|
+ {
|
|
|
+ tempIndex = ((gun_index==2) ? 1: 0);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ tempIndex = gun_index;
|
|
|
+ }
|
|
|
|
|
|
- for (int index = 0; index < CCS_QUANTITY; index++)
|
|
|
- {
|
|
|
- if (ShmSysConfigAndInfo->SysInfo.CcsChargingData[index].Index == tempIndex)
|
|
|
+ for (int index = 0; index < GB_QUANTITY; index++)
|
|
|
{
|
|
|
- ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[0].value = ShmSysConfigAndInfo->SysInfo.CcsChargingData[index].PresentChargingCurrent;
|
|
|
+ if (ShmSysConfigAndInfo->SysInfo.GbChargingData[index].Index == tempIndex)
|
|
|
+ {
|
|
|
+ ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[0].value = ShmSysConfigAndInfo->SysInfo.GbChargingData[index].PresentChargingCurrent;
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
|
|
|
- strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[0].phase, PhaseEnumTypeStr[PhaseEnumType_L3_N]);
|
|
|
- }
|
|
|
- else if(gunType[gun_index] == GUN_TYPE_GBT)
|
|
|
- {
|
|
|
- if(ShmSysConfigAndInfo->SysConfig.ModelName[8] != '0')
|
|
|
- {
|
|
|
- tempIndex = ((gun_index==2) ? 1: 0);
|
|
|
+ strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[0].phase, PhaseEnumTypeStr[PhaseEnumType_L3_N]);
|
|
|
}
|
|
|
- else
|
|
|
+ else if(gunType[gun_index] == GUN_TYPE_DO)
|
|
|
{
|
|
|
tempIndex = gun_index;
|
|
|
- }
|
|
|
|
|
|
- for (int index = 0; index < GB_QUANTITY; index++)
|
|
|
- {
|
|
|
- if (ShmSysConfigAndInfo->SysInfo.GbChargingData[index].Index == tempIndex)
|
|
|
+ for (int index = 0; index < GENERAL_GUN_QUANTITY; index++)
|
|
|
{
|
|
|
- ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[0].value = ShmSysConfigAndInfo->SysInfo.GbChargingData[index].PresentChargingCurrent;
|
|
|
+ if (ShmSysConfigAndInfo->SysInfo.ConnectorInfo[index].GeneralChargingData.Index == tempIndex)
|
|
|
+ {
|
|
|
+ ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[0].value = ShmSysConfigAndInfo->SysInfo.ConnectorInfo[index].GeneralChargingData.PresentChargingCurrent;
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
|
|
|
- strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[0].phase, PhaseEnumTypeStr[PhaseEnumType_L3_N]);
|
|
|
- }
|
|
|
- else if(gunType[gun_index] == GUN_TYPE_DO)
|
|
|
- {
|
|
|
- tempIndex = gun_index;
|
|
|
-
|
|
|
- for (int index = 0; index < GENERAL_GUN_QUANTITY; index++)
|
|
|
+ strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[0].phase, PhaseEnumTypeStr[PhaseEnumType_L3_N]);
|
|
|
+ }
|
|
|
+ else
|
|
|
{
|
|
|
- if (ShmSysConfigAndInfo->SysInfo.ConnectorInfo[index].GeneralChargingData.Index == tempIndex)
|
|
|
+ if(ShmSysConfigAndInfo->SysConfig.ModelName[0]=='D')
|
|
|
+ {
|
|
|
+ tempIndex = 2;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ tempIndex = gun_index;
|
|
|
+ }
|
|
|
+
|
|
|
+ for (int index = 0; index < AC_QUANTITY; index++)
|
|
|
{
|
|
|
- ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[0].value = ShmSysConfigAndInfo->SysInfo.ConnectorInfo[index].GeneralChargingData.PresentChargingCurrent;
|
|
|
+ if (ShmSysConfigAndInfo->SysInfo.AcChargingData[index].Index == tempIndex)
|
|
|
+ {
|
|
|
+ ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[0].value = ShmSysConfigAndInfo->SysInfo.AcChargingData[index].PresentChargingCurrent;
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
+ strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[0].phase, PhaseEnumTypeStr[PhaseEnumType_L1_N]);
|
|
|
}
|
|
|
|
|
|
- strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[0].phase, PhaseEnumTypeStr[PhaseEnumType_L3_N]);
|
|
|
+ strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[0].context, ReadingContextEnumTypeStr[dataType]);
|
|
|
+ strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[0].measurand, MeasurandEnumTypeStr[MeasurandEnumType_Current_Import]);
|
|
|
+ strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[0].location, LocationEnumTypeStr[LocationEnumType_Outlet]);
|
|
|
+ strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[0].unitOfMeasure.uint , "A");
|
|
|
+ ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[0].unitOfMeasure.multiplier = 0;
|
|
|
}
|
|
|
- else
|
|
|
+
|
|
|
+ //idx_sample=1;
|
|
|
+ //********************************(2)Energy.Active.Import.Register ************************************************/
|
|
|
+ if(((dataType == ReadingContextEnumType_Sample_Clock) && (strstr((char*)ShmOCPP20Data->ControllerComponentVariable[AlignedDataCtrlr_Measurands].variableAttribute[0].value, MeasurandEnumTypeStr[MeasurandEnumType_Energy_Active_Import_Register]) != NULL)) ||
|
|
|
+ ((dataType == ReadingContextEnumType_Sample_Periodic) && (strstr((char*)ShmOCPP20Data->ControllerComponentVariable[SampledDataCtrlr_TxUpdatedMeasurands].variableAttribute[0].value, MeasurandEnumTypeStr[MeasurandEnumType_Energy_Active_Import_Register]) != NULL)) ||
|
|
|
+ (dataType == ReadingContextEnumType_Trigger))
|
|
|
{
|
|
|
- if(ShmSysConfigAndInfo->SysConfig.ModelName[0]=='D')
|
|
|
+ //J: CHAdeMO U: CCS1 combo E: CCS2 combo G: GBT DC
|
|
|
+ if(gunType[gun_index] == GUN_TYPE_CHAdeMO)
|
|
|
{
|
|
|
- tempIndex = 2;
|
|
|
+ if(ShmSysConfigAndInfo->SysConfig.ModelName[8] != '0')
|
|
|
+ {
|
|
|
+ tempIndex = ((gun_index==2) ? 1: 0);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ tempIndex = gun_index;
|
|
|
+ }
|
|
|
+
|
|
|
+ for (int index = 0; index < CHAdeMO_QUANTITY; index++)
|
|
|
+ {
|
|
|
+ if (ShmSysConfigAndInfo->SysInfo.ChademoChargingData[index].Index == tempIndex)
|
|
|
+ {
|
|
|
+ ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[1].value = ShmSysConfigAndInfo->SysInfo.ChademoChargingData[index].PowerConsumption;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[1].phase, PhaseEnumTypeStr[PhaseEnumType_L3_N]);
|
|
|
}
|
|
|
- else
|
|
|
+ else if(gunType[gun_index] == GUN_TYPE_CCS)
|
|
|
{
|
|
|
- tempIndex = gun_index;
|
|
|
+ if(ShmSysConfigAndInfo->SysConfig.ModelName[8] != '0')
|
|
|
+ {
|
|
|
+ tempIndex = ((gun_index==2) ? 1: 0);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ tempIndex = gun_index;
|
|
|
+ }
|
|
|
+
|
|
|
+ for (int index = 0; index < CCS_QUANTITY; index++)
|
|
|
+ {
|
|
|
+ if (ShmSysConfigAndInfo->SysInfo.CcsChargingData[index].Index == tempIndex)
|
|
|
+ {
|
|
|
+ ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[1].value = ShmSysConfigAndInfo->SysInfo.CcsChargingData[index].PowerConsumption;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[1].phase, PhaseEnumTypeStr[PhaseEnumType_L3_N]);
|
|
|
}
|
|
|
+ else if(gunType[gun_index] == GUN_TYPE_GBT)
|
|
|
+ {
|
|
|
+ if(ShmSysConfigAndInfo->SysConfig.ModelName[8] != '0')
|
|
|
+ {
|
|
|
+ tempIndex = ((gun_index==2) ? 1: 0);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ tempIndex = gun_index;
|
|
|
+ }
|
|
|
|
|
|
- for (int index = 0; index < AC_QUANTITY; index++)
|
|
|
+ for (int index = 0; index < GB_QUANTITY; index++)
|
|
|
+ {
|
|
|
+ if (ShmSysConfigAndInfo->SysInfo.GbChargingData[index].Index == tempIndex)
|
|
|
+ {
|
|
|
+ ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[1].value = ShmSysConfigAndInfo->SysInfo.GbChargingData[index].PowerConsumption;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[1].phase, PhaseEnumTypeStr[PhaseEnumType_L3_N]);
|
|
|
+ }
|
|
|
+ else if(gunType[gun_index] == GUN_TYPE_DO)
|
|
|
{
|
|
|
- if (ShmSysConfigAndInfo->SysInfo.AcChargingData[index].Index == tempIndex)
|
|
|
- {
|
|
|
- ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[0].value = ShmSysConfigAndInfo->SysInfo.AcChargingData[index].PresentChargingCurrent;
|
|
|
- }
|
|
|
+
|
|
|
+ tempIndex = gun_index;
|
|
|
+
|
|
|
+ for (int index = 0; index < GENERAL_GUN_QUANTITY; index++)
|
|
|
+ {
|
|
|
+ if (ShmSysConfigAndInfo->SysInfo.ConnectorInfo[index].GeneralChargingData.Index == tempIndex)
|
|
|
+ {
|
|
|
+ ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[1].value = ShmSysConfigAndInfo->SysInfo.ConnectorInfo[index].GeneralChargingData.PowerConsumption;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[1].phase, PhaseEnumTypeStr[PhaseEnumType_L3_N]);
|
|
|
}
|
|
|
+ else
|
|
|
+ {
|
|
|
+ if(ShmSysConfigAndInfo->SysConfig.ModelName[0]=='D')
|
|
|
+ {
|
|
|
+ tempIndex = 2;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ tempIndex = gun_index;
|
|
|
+ }
|
|
|
|
|
|
- strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[0].phase, PhaseEnumTypeStr[PhaseEnumType_L1_N]);
|
|
|
- }
|
|
|
+ for (int index = 0; index < AC_QUANTITY; index++)
|
|
|
+ {
|
|
|
+ if (ShmSysConfigAndInfo->SysInfo.AcChargingData[index].Index == tempIndex)
|
|
|
+ {
|
|
|
+ ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[1].value = ShmSysConfigAndInfo->SysInfo.AcChargingData[index].PowerConsumption;
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
- strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[0].context, ReadingContextEnumTypeStr[dataType]);
|
|
|
- strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[0].measurand, MeasurandEnumTypeStr[MeasurandEnumType_Current_Import]);
|
|
|
- strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[0].location, LocationEnumTypeStr[LocationEnumType_Outlet]);
|
|
|
- strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[0].unitOfMeasure.uint , "A");
|
|
|
- ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[0].unitOfMeasure.multiplier = 0;
|
|
|
+ strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[1].phase, PhaseEnumTypeStr[PhaseEnumType_L1_N]);
|
|
|
+ }
|
|
|
|
|
|
- //idx_sample=1;
|
|
|
- //********************************(2)Energy.Active.Import.Register ************************************************/
|
|
|
- //J: CHAdeMO U: CCS1 combo E: CCS2 combo G: GBT DC
|
|
|
+ strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[1].context, ReadingContextEnumTypeStr[dataType]);
|
|
|
+ strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[1].measurand, MeasurandEnumTypeStr[MeasurandEnumType_Energy_Active_Import_Register]);
|
|
|
+ strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[1].location, LocationEnumTypeStr[LocationEnumType_Outlet]);
|
|
|
+ strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[1].unitOfMeasure.uint , "kWh");
|
|
|
+ ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[2].unitOfMeasure.multiplier = 0;
|
|
|
+ }
|
|
|
|
|
|
- if(gunType[gun_index] == GUN_TYPE_CHAdeMO)
|
|
|
+ //idx_sample=2;
|
|
|
+ //****************************************************(3)Energy.Active.Import.Interval*********************************************/
|
|
|
+ if(((dataType == ReadingContextEnumType_Sample_Clock) && (strstr((char*)ShmOCPP20Data->ControllerComponentVariable[AlignedDataCtrlr_Measurands].variableAttribute[0].value, MeasurandEnumTypeStr[MeasurandEnumType_Energy_Active_Import_Interval]) != NULL)) ||
|
|
|
+ ((dataType == ReadingContextEnumType_Sample_Periodic) && (strstr((char*)ShmOCPP20Data->ControllerComponentVariable[SampledDataCtrlr_TxUpdatedMeasurands].variableAttribute[0].value, MeasurandEnumTypeStr[MeasurandEnumType_Energy_Active_Import_Interval]) != NULL)) ||
|
|
|
+ (dataType == ReadingContextEnumType_Trigger))
|
|
|
{
|
|
|
+ //J: CHAdeMO U: CCS1 combo E: CCS2 combo G: GBT DC
|
|
|
+ if(gunType[gun_index] == GUN_TYPE_CHAdeMO)
|
|
|
+ {
|
|
|
if(ShmSysConfigAndInfo->SysConfig.ModelName[8] != '0')
|
|
|
{
|
|
|
tempIndex = ((gun_index==2) ? 1: 0);
|
|
@@ -7468,14 +7591,14 @@ int sendMeterValuesRequest(int gun_index, ReadingContextEnumType dataType)
|
|
|
{
|
|
|
if (ShmSysConfigAndInfo->SysInfo.ChademoChargingData[index].Index == tempIndex)
|
|
|
{
|
|
|
- ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[1].value = ShmSysConfigAndInfo->SysInfo.ChademoChargingData[index].PowerConsumption;
|
|
|
+ ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[2].value = ShmSysConfigAndInfo->SysInfo.ChademoChargingData[index].PresentChargedEnergy;
|
|
|
}
|
|
|
- }
|
|
|
+ } // END OF FOR CHAdeMO_QUANTITY
|
|
|
|
|
|
- strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[1].phase, PhaseEnumTypeStr[PhaseEnumType_L3_N]);
|
|
|
- }
|
|
|
- else if(gunType[gun_index] == GUN_TYPE_CCS)
|
|
|
- {
|
|
|
+ strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[2].phase, PhaseEnumTypeStr[PhaseEnumType_L3_N]);
|
|
|
+ }
|
|
|
+ else if(gunType[gun_index] == GUN_TYPE_CCS)
|
|
|
+ {
|
|
|
if(ShmSysConfigAndInfo->SysConfig.ModelName[8] != '0')
|
|
|
{
|
|
|
tempIndex = ((gun_index==2) ? 1: 0);
|
|
@@ -7489,14 +7612,14 @@ int sendMeterValuesRequest(int gun_index, ReadingContextEnumType dataType)
|
|
|
{
|
|
|
if (ShmSysConfigAndInfo->SysInfo.CcsChargingData[index].Index == tempIndex)
|
|
|
{
|
|
|
- ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[1].value = ShmSysConfigAndInfo->SysInfo.CcsChargingData[index].PowerConsumption;
|
|
|
+ ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[2].value = ShmSysConfigAndInfo->SysInfo.CcsChargingData[index].PresentChargedEnergy;
|
|
|
}
|
|
|
- }
|
|
|
+ } // END OF CCS_QUANTITY
|
|
|
|
|
|
- strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[1].phase, PhaseEnumTypeStr[PhaseEnumType_L3_N]);
|
|
|
- }
|
|
|
- else if(gunType[gun_index] == GUN_TYPE_GBT)
|
|
|
- {
|
|
|
+ strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[2].phase, PhaseEnumTypeStr[PhaseEnumType_L3_N]);
|
|
|
+ }
|
|
|
+ else if(gunType[gun_index] == GUN_TYPE_GBT)
|
|
|
+ {
|
|
|
if(ShmSysConfigAndInfo->SysConfig.ModelName[8] != '0')
|
|
|
{
|
|
|
tempIndex = ((gun_index==2) ? 1: 0);
|
|
@@ -7510,29 +7633,28 @@ int sendMeterValuesRequest(int gun_index, ReadingContextEnumType dataType)
|
|
|
{
|
|
|
if (ShmSysConfigAndInfo->SysInfo.GbChargingData[index].Index == tempIndex)
|
|
|
{
|
|
|
- ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[1].value = ShmSysConfigAndInfo->SysInfo.GbChargingData[index].PowerConsumption;
|
|
|
+ ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[2].value = ShmSysConfigAndInfo->SysInfo.GbChargingData[index].PresentChargedEnergy;
|
|
|
}
|
|
|
- }
|
|
|
-
|
|
|
- strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[1].phase, PhaseEnumTypeStr[PhaseEnumType_L3_N]);
|
|
|
- }
|
|
|
- else if(gunType[gun_index] == GUN_TYPE_DO)
|
|
|
- {
|
|
|
+ } // END OF GB_QUANTITY
|
|
|
|
|
|
+ strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[2].phase, PhaseEnumTypeStr[PhaseEnumType_L3_N]);
|
|
|
+ }
|
|
|
+ else if(gunType[gun_index] == GUN_TYPE_DO)
|
|
|
+ {
|
|
|
tempIndex = gun_index;
|
|
|
|
|
|
for (int index = 0; index < GENERAL_GUN_QUANTITY; index++)
|
|
|
{
|
|
|
if (ShmSysConfigAndInfo->SysInfo.ConnectorInfo[index].GeneralChargingData.Index == tempIndex)
|
|
|
{
|
|
|
- ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[1].value = ShmSysConfigAndInfo->SysInfo.ConnectorInfo[index].GeneralChargingData.PowerConsumption;
|
|
|
+ ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[2].value = ShmSysConfigAndInfo->SysInfo.ConnectorInfo[index].GeneralChargingData.PresentChargedEnergy;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[1].phase, PhaseEnumTypeStr[PhaseEnumType_L3_N]);
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
+ strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[2].phase, PhaseEnumTypeStr[PhaseEnumType_L3_N]);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
if(ShmSysConfigAndInfo->SysConfig.ModelName[0]=='D')
|
|
|
{
|
|
|
tempIndex = 2;
|
|
@@ -7546,533 +7668,659 @@ int sendMeterValuesRequest(int gun_index, ReadingContextEnumType dataType)
|
|
|
{
|
|
|
if (ShmSysConfigAndInfo->SysInfo.AcChargingData[index].Index == tempIndex)
|
|
|
{
|
|
|
- ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[1].value = ShmSysConfigAndInfo->SysInfo.AcChargingData[index].PowerConsumption;
|
|
|
+ ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[2].value = ShmSysConfigAndInfo->SysInfo.AcChargingData[index].PresentChargedEnergy;
|
|
|
}
|
|
|
- }
|
|
|
-
|
|
|
- strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[1].phase, PhaseEnumTypeStr[PhaseEnumType_L1_N]);
|
|
|
- }
|
|
|
+ }
|
|
|
|
|
|
- strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[1].context, ReadingContextEnumTypeStr[dataType]);
|
|
|
- strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[1].measurand, MeasurandEnumTypeStr[MeasurandEnumType_Energy_Active_Import_Register]);
|
|
|
- strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[1].location, LocationEnumTypeStr[LocationEnumType_Outlet]);
|
|
|
- strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[1].unitOfMeasure.uint , "kWh");
|
|
|
- ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[2].unitOfMeasure.multiplier = 0;
|
|
|
+ strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[2].phase, PhaseEnumTypeStr[PhaseEnumType_L1_N]);
|
|
|
+ }
|
|
|
|
|
|
- //idx_sample=2;
|
|
|
- //****************************************************(3)Energy.Active.Import.Interval*********************************************/
|
|
|
- //J: CHAdeMO U: CCS1 combo E: CCS2 combo G: GBT DC
|
|
|
+ strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[2].context, ReadingContextEnumTypeStr[dataType]);
|
|
|
+ strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[2].measurand, MeasurandEnumTypeStr[MeasurandEnumType_Energy_Active_Import_Interval]);
|
|
|
+ strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[2].location, LocationEnumTypeStr[LocationEnumType_Outlet]);
|
|
|
+ strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[2].unitOfMeasure.uint , "kWh");
|
|
|
+ ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[2].unitOfMeasure.multiplier = 0;
|
|
|
+ }
|
|
|
|
|
|
- if(gunType[gun_index] == GUN_TYPE_CHAdeMO)
|
|
|
+ //idx_sample=3;
|
|
|
+ //********************************(4)Power.Active.Import************************************************/
|
|
|
+ if(((dataType == ReadingContextEnumType_Sample_Clock) && (strstr((char*)ShmOCPP20Data->ControllerComponentVariable[AlignedDataCtrlr_Measurands].variableAttribute[0].value, MeasurandEnumTypeStr[MeasurandEnumType_Power_Active_Import]) != NULL)) ||
|
|
|
+ ((dataType == ReadingContextEnumType_Sample_Periodic) && (strstr((char*)ShmOCPP20Data->ControllerComponentVariable[SampledDataCtrlr_TxUpdatedMeasurands].variableAttribute[0].value, MeasurandEnumTypeStr[MeasurandEnumType_Power_Active_Import]) != NULL)) ||
|
|
|
+ (dataType == ReadingContextEnumType_Trigger))
|
|
|
{
|
|
|
- if(ShmSysConfigAndInfo->SysConfig.ModelName[8] != '0')
|
|
|
- {
|
|
|
- tempIndex = ((gun_index==2) ? 1: 0);
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- tempIndex = gun_index;
|
|
|
- }
|
|
|
-
|
|
|
- for (int index = 0; index < CHAdeMO_QUANTITY; index++)
|
|
|
+ //J : CHAdeMO U: CCS1 combo E: CCS2 combo G: GBT DC
|
|
|
+ if(gunType[gun_index] == GUN_TYPE_CHAdeMO)
|
|
|
{
|
|
|
- if (ShmSysConfigAndInfo->SysInfo.ChademoChargingData[index].Index == tempIndex)
|
|
|
+ if(ShmSysConfigAndInfo->SysConfig.ModelName[8] != '0')
|
|
|
+ {
|
|
|
+ tempIndex = ((gun_index==2) ? 1: 0);
|
|
|
+ }
|
|
|
+ else
|
|
|
{
|
|
|
- ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[2].value = ShmSysConfigAndInfo->SysInfo.ChademoChargingData[index].PresentChargedEnergy;
|
|
|
+ tempIndex = gun_index;
|
|
|
}
|
|
|
- } // END OF FOR CHAdeMO_QUANTITY
|
|
|
|
|
|
- strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[2].phase, PhaseEnumTypeStr[PhaseEnumType_L3_N]);
|
|
|
- }
|
|
|
- else if(gunType[gun_index] == GUN_TYPE_CCS)
|
|
|
- {
|
|
|
- if(ShmSysConfigAndInfo->SysConfig.ModelName[8] != '0')
|
|
|
- {
|
|
|
- tempIndex = ((gun_index==2) ? 1: 0);
|
|
|
+ for (int index = 0; index < CHAdeMO_QUANTITY; index++)
|
|
|
+ {
|
|
|
+ if (ShmSysConfigAndInfo->SysInfo.ChademoChargingData[index].Index == tempIndex)
|
|
|
+ {
|
|
|
+ ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[3].value = ShmSysConfigAndInfo->SysInfo.ChademoChargingData[index].PresentChargingPower;
|
|
|
+ }
|
|
|
+ } // END OF FOR
|
|
|
+
|
|
|
+ strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[3].phase, PhaseEnumTypeStr[PhaseEnumType_L3_N]);
|
|
|
}
|
|
|
- else
|
|
|
+ else if(gunType[gun_index] == GUN_TYPE_CCS)
|
|
|
{
|
|
|
- tempIndex = gun_index;
|
|
|
- }
|
|
|
+ if(ShmSysConfigAndInfo->SysConfig.ModelName[8] != '0')
|
|
|
+ {
|
|
|
+ tempIndex = ((gun_index==2) ? 1: 0);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ tempIndex = gun_index;
|
|
|
+ }
|
|
|
|
|
|
- for (int index = 0; index < CCS_QUANTITY; index++)
|
|
|
- {
|
|
|
- if (ShmSysConfigAndInfo->SysInfo.CcsChargingData[index].Index == tempIndex)
|
|
|
+ for (int index = 0; index < CCS_QUANTITY; index++)
|
|
|
{
|
|
|
- ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[2].value = ShmSysConfigAndInfo->SysInfo.CcsChargingData[index].PresentChargedEnergy;
|
|
|
+ if (ShmSysConfigAndInfo->SysInfo.CcsChargingData[index].Index == tempIndex)
|
|
|
+ {
|
|
|
+ ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[3].value = ShmSysConfigAndInfo->SysInfo.CcsChargingData[index].PresentChargingPower;
|
|
|
+ }
|
|
|
}
|
|
|
- } // END OF CCS_QUANTITY
|
|
|
|
|
|
- strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[2].phase, PhaseEnumTypeStr[PhaseEnumType_L3_N]);
|
|
|
- }
|
|
|
- else if(gunType[gun_index] == GUN_TYPE_GBT)
|
|
|
- {
|
|
|
- if(ShmSysConfigAndInfo->SysConfig.ModelName[8] != '0')
|
|
|
- {
|
|
|
- tempIndex = ((gun_index==2) ? 1: 0);
|
|
|
+ strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[3].phase, PhaseEnumTypeStr[PhaseEnumType_L3_N]);
|
|
|
}
|
|
|
- else
|
|
|
- {
|
|
|
- tempIndex = gun_index;
|
|
|
- }
|
|
|
-
|
|
|
- for (int index = 0; index < GB_QUANTITY; index++)
|
|
|
+ else if(gunType[gun_index] == GUN_TYPE_GBT)
|
|
|
{
|
|
|
- if (ShmSysConfigAndInfo->SysInfo.GbChargingData[index].Index == tempIndex)
|
|
|
+ if(ShmSysConfigAndInfo->SysConfig.ModelName[8] != '0')
|
|
|
+ {
|
|
|
+ tempIndex = ((gun_index==2) ? 1: 0);
|
|
|
+ }
|
|
|
+ else
|
|
|
{
|
|
|
- ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[2].value = ShmSysConfigAndInfo->SysInfo.GbChargingData[index].PresentChargedEnergy;
|
|
|
+ tempIndex = gun_index;
|
|
|
}
|
|
|
- } // END OF GB_QUANTITY
|
|
|
|
|
|
- strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[2].phase, PhaseEnumTypeStr[PhaseEnumType_L3_N]);
|
|
|
- }
|
|
|
- else if(gunType[gun_index] == GUN_TYPE_DO)
|
|
|
- {
|
|
|
- tempIndex = gun_index;
|
|
|
+ for (int index = 0; index < GB_QUANTITY; index++)
|
|
|
+ {
|
|
|
+ if (ShmSysConfigAndInfo->SysInfo.GbChargingData[index].Index == tempIndex)
|
|
|
+ {
|
|
|
+ //ShmSysConfigAndInfo->SysInfo.GbChargingData[index].PresentChargingPower = 100.0;
|
|
|
+ ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[3].value = ShmSysConfigAndInfo->SysInfo.GbChargingData[index].PresentChargingPower;
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
- for (int index = 0; index < GENERAL_GUN_QUANTITY; index++)
|
|
|
+ strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[3].phase, PhaseEnumTypeStr[PhaseEnumType_L3_N]);
|
|
|
+ }
|
|
|
+ else if(gunType[gun_index] == GUN_TYPE_DO)
|
|
|
{
|
|
|
- if (ShmSysConfigAndInfo->SysInfo.ConnectorInfo[index].GeneralChargingData.Index == tempIndex)
|
|
|
+ tempIndex = gun_index;
|
|
|
+
|
|
|
+ for (int index = 0; index < GENERAL_GUN_QUANTITY; index++)
|
|
|
{
|
|
|
- ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[2].value = ShmSysConfigAndInfo->SysInfo.ConnectorInfo[index].GeneralChargingData.PresentChargedEnergy;
|
|
|
+ if (ShmSysConfigAndInfo->SysInfo.ConnectorInfo[index].GeneralChargingData.Index == tempIndex)
|
|
|
+ {
|
|
|
+ //ShmSysConfigAndInfo->SysInfo.GbChargingData[index].PresentChargingPower = 100.0;
|
|
|
+ ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[3].value = ShmSysConfigAndInfo->SysInfo.ConnectorInfo[index].GeneralChargingData.PresentChargingPower;
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
|
|
|
- strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[2].phase, PhaseEnumTypeStr[PhaseEnumType_L3_N]);
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- if(ShmSysConfigAndInfo->SysConfig.ModelName[0]=='D')
|
|
|
- {
|
|
|
- tempIndex = 2;
|
|
|
+ strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[3].phase, PhaseEnumTypeStr[PhaseEnumType_L3_N]);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- tempIndex = gun_index;
|
|
|
- }
|
|
|
+ if(ShmSysConfigAndInfo->SysConfig.ModelName[0]=='D')
|
|
|
+ {
|
|
|
+ tempIndex = 2;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ tempIndex = gun_index;
|
|
|
+ }
|
|
|
|
|
|
- for (int index = 0; index < AC_QUANTITY; index++)
|
|
|
- {
|
|
|
- if (ShmSysConfigAndInfo->SysInfo.AcChargingData[index].Index == tempIndex)
|
|
|
+ for (int index = 0; index < AC_QUANTITY; index++)
|
|
|
{
|
|
|
- ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[2].value = ShmSysConfigAndInfo->SysInfo.AcChargingData[index].PresentChargedEnergy;
|
|
|
+ if (ShmSysConfigAndInfo->SysInfo.AcChargingData[index].Index == tempIndex)
|
|
|
+ {
|
|
|
+ ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[3].value = ShmSysConfigAndInfo->SysInfo.AcChargingData[index].PresentChargingPower;
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
|
|
|
- strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[2].phase, PhaseEnumTypeStr[PhaseEnumType_L1_N]);
|
|
|
- }
|
|
|
+ strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[3].phase, PhaseEnumTypeStr[PhaseEnumType_L1_N]);
|
|
|
+ }
|
|
|
|
|
|
- strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[2].context, ReadingContextEnumTypeStr[dataType]);
|
|
|
- strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[2].measurand, MeasurandEnumTypeStr[MeasurandEnumType_Energy_Active_Import_Interval]);
|
|
|
- strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[2].location, LocationEnumTypeStr[LocationEnumType_Outlet]);
|
|
|
- strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[2].unitOfMeasure.uint , "kWh");
|
|
|
- ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[2].unitOfMeasure.multiplier = 0;
|
|
|
+ strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[3].context, ReadingContextEnumTypeStr[dataType]);
|
|
|
+ strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[3].measurand, MeasurandEnumTypeStr[MeasurandEnumType_Power_Active_Import]);
|
|
|
+ strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[3].location, LocationEnumTypeStr[LocationEnumType_Outlet]);
|
|
|
+ strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[3].unitOfMeasure.uint , "kW");
|
|
|
+ ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[3].unitOfMeasure.multiplier = 0;
|
|
|
+ }
|
|
|
|
|
|
- //idx_sample=3;
|
|
|
- //********************************(4)Power.Active.Import************************************************/
|
|
|
- //J : CHAdeMO U: CCS1 combo E: CCS2 combo G: GBT DC
|
|
|
- if(gunType[gun_index] == GUN_TYPE_CHAdeMO)
|
|
|
+ //idx_sample=4;
|
|
|
+ //***********************************************(5)VOLTAGE L1******************************************************/
|
|
|
+ if(((dataType == ReadingContextEnumType_Sample_Clock) && (strstr((char*)ShmOCPP20Data->ControllerComponentVariable[AlignedDataCtrlr_Measurands].variableAttribute[0].value, MeasurandEnumTypeStr[MeasurandEnumType_Voltage]) != NULL)) ||
|
|
|
+ ((dataType == ReadingContextEnumType_Sample_Periodic) && (strstr((char*)ShmOCPP20Data->ControllerComponentVariable[SampledDataCtrlr_TxUpdatedMeasurands].variableAttribute[0].value, MeasurandEnumTypeStr[MeasurandEnumType_Voltage]) != NULL)) ||
|
|
|
+ (dataType == ReadingContextEnumType_Trigger))
|
|
|
{
|
|
|
- if(ShmSysConfigAndInfo->SysConfig.ModelName[8] != '0')
|
|
|
+ //J : CHAdeMO U: CCS1 combo E: CCS2 combo G: GBT DC
|
|
|
+ if(gunType[gun_index] == GUN_TYPE_CHAdeMO)
|
|
|
{
|
|
|
- tempIndex = ((gun_index==2) ? 1: 0);
|
|
|
+ if(ShmSysConfigAndInfo->SysConfig.ModelName[8] != '0')
|
|
|
+ {
|
|
|
+ tempIndex = ((gun_index==2) ? 1: 0);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ tempIndex = gun_index;
|
|
|
+ }
|
|
|
+
|
|
|
+ for (int index = 0; index < CHAdeMO_QUANTITY; index++)
|
|
|
+ {
|
|
|
+ if (ShmSysConfigAndInfo->SysInfo.ChademoChargingData[index].Index == tempIndex)
|
|
|
+ {
|
|
|
+ ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[4].value = ShmSysConfigAndInfo->SysInfo.ChademoChargingData[index].PresentChargingVoltage;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[4].phase, PhaseEnumTypeStr[PhaseEnumType_L3_N]);
|
|
|
}
|
|
|
- else
|
|
|
+ else if(gunType[gun_index] == GUN_TYPE_CCS)
|
|
|
{
|
|
|
- tempIndex = gun_index;
|
|
|
- }
|
|
|
+ if(ShmSysConfigAndInfo->SysConfig.ModelName[8] != '0')
|
|
|
+ {
|
|
|
+ tempIndex = ((gun_index==2) ? 1: 0);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ tempIndex = gun_index;
|
|
|
+ }
|
|
|
|
|
|
- for (int index = 0; index < CHAdeMO_QUANTITY; index++)
|
|
|
- {
|
|
|
- if (ShmSysConfigAndInfo->SysInfo.ChademoChargingData[index].Index == tempIndex)
|
|
|
+ for (int index = 0; index < CCS_QUANTITY; index++)
|
|
|
{
|
|
|
- ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[3].value = ShmSysConfigAndInfo->SysInfo.ChademoChargingData[index].PresentChargingPower;
|
|
|
+ if (ShmSysConfigAndInfo->SysInfo.CcsChargingData[index].Index == tempIndex)
|
|
|
+ {
|
|
|
+ ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[4].value = ShmSysConfigAndInfo->SysInfo.CcsChargingData[index].PresentChargingVoltage;
|
|
|
+ }
|
|
|
}
|
|
|
- } // END OF FOR
|
|
|
|
|
|
- strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[3].phase, PhaseEnumTypeStr[PhaseEnumType_L3_N]);
|
|
|
- }
|
|
|
- else if(gunType[gun_index] == GUN_TYPE_CCS)
|
|
|
- {
|
|
|
- if(ShmSysConfigAndInfo->SysConfig.ModelName[8] != '0')
|
|
|
+ strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[4].phase, PhaseEnumTypeStr[PhaseEnumType_L3_N]);
|
|
|
+ }
|
|
|
+ else if(gunType[gun_index] == GUN_TYPE_GBT)
|
|
|
{
|
|
|
- tempIndex = ((gun_index==2) ? 1: 0);
|
|
|
+ if(ShmSysConfigAndInfo->SysConfig.ModelName[8] != '0')
|
|
|
+ {
|
|
|
+ tempIndex = ((gun_index==2) ? 1: 0);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ tempIndex = gun_index;
|
|
|
+ }
|
|
|
+
|
|
|
+ for (int index = 0; index < GB_QUANTITY; index++)
|
|
|
+ {
|
|
|
+ if (ShmSysConfigAndInfo->SysInfo.GbChargingData[index].Index == tempIndex)
|
|
|
+ {
|
|
|
+ ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[4].value = ShmSysConfigAndInfo->SysInfo.GbChargingData[index].PresentChargingVoltage;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[4].phase, PhaseEnumTypeStr[PhaseEnumType_L3_N]);
|
|
|
}
|
|
|
- else
|
|
|
+ else if(gunType[gun_index] == GUN_TYPE_DO)
|
|
|
{
|
|
|
tempIndex = gun_index;
|
|
|
- }
|
|
|
|
|
|
- for (int index = 0; index < CCS_QUANTITY; index++)
|
|
|
- {
|
|
|
- if (ShmSysConfigAndInfo->SysInfo.CcsChargingData[index].Index == tempIndex)
|
|
|
+ for (int index = 0; index < GENERAL_GUN_QUANTITY; index++)
|
|
|
{
|
|
|
- ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[3].value = ShmSysConfigAndInfo->SysInfo.CcsChargingData[index].PresentChargingPower;
|
|
|
+ if (ShmSysConfigAndInfo->SysInfo.ConnectorInfo[index].GeneralChargingData.Index == tempIndex)
|
|
|
+ {
|
|
|
+ ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[4].value = ShmSysConfigAndInfo->SysInfo.ConnectorInfo[index].GeneralChargingData.PresentChargingVoltage;
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
|
|
|
- strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[3].phase, PhaseEnumTypeStr[PhaseEnumType_L3_N]);
|
|
|
- }
|
|
|
- else if(gunType[gun_index] == GUN_TYPE_GBT)
|
|
|
- {
|
|
|
- if(ShmSysConfigAndInfo->SysConfig.ModelName[8] != '0')
|
|
|
- {
|
|
|
- tempIndex = ((gun_index==2) ? 1: 0);
|
|
|
+ strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[4].phase, PhaseEnumTypeStr[PhaseEnumType_L3_N]);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- tempIndex = gun_index;
|
|
|
- }
|
|
|
+ if(ShmSysConfigAndInfo->SysConfig.ModelName[0]=='D')
|
|
|
+ {
|
|
|
+ tempIndex = 2;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ tempIndex = gun_index;
|
|
|
+ }
|
|
|
|
|
|
- for (int index = 0; index < GB_QUANTITY; index++)
|
|
|
- {
|
|
|
- if (ShmSysConfigAndInfo->SysInfo.GbChargingData[index].Index == tempIndex)
|
|
|
+ for (int index = 0; index < AC_QUANTITY; index++)
|
|
|
{
|
|
|
- //ShmSysConfigAndInfo->SysInfo.GbChargingData[index].PresentChargingPower = 100.0;
|
|
|
- ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[3].value = ShmSysConfigAndInfo->SysInfo.GbChargingData[index].PresentChargingPower;
|
|
|
+ if (ShmSysConfigAndInfo->SysInfo.AcChargingData[index].Index == tempIndex)
|
|
|
+ {
|
|
|
+ ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[4].value = ShmSysConfigAndInfo->SysInfo.AcChargingData[index].PresentChargingVoltage;
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
+ strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[4].phase, PhaseEnumTypeStr[PhaseEnumType_L1_N]);
|
|
|
}
|
|
|
|
|
|
- strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[3].phase, PhaseEnumTypeStr[PhaseEnumType_L3_N]);
|
|
|
+ strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[4].context, ReadingContextEnumTypeStr[dataType]);
|
|
|
+ strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[4].measurand, MeasurandEnumTypeStr[MeasurandEnumType_Voltage]);
|
|
|
+ strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[4].location, LocationEnumTypeStr[LocationEnumType_Outlet]);
|
|
|
+ strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[4].unitOfMeasure.uint , "V");
|
|
|
+ ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[4].unitOfMeasure.multiplier = 0;
|
|
|
}
|
|
|
- else if(gunType[gun_index] == GUN_TYPE_DO)
|
|
|
- {
|
|
|
- tempIndex = gun_index;
|
|
|
|
|
|
- for (int index = 0; index < GENERAL_GUN_QUANTITY; index++)
|
|
|
+ //***********************************************(6)SOC******************************************************/
|
|
|
+ if(((dataType == ReadingContextEnumType_Sample_Clock) && (strstr((char*)ShmOCPP20Data->ControllerComponentVariable[AlignedDataCtrlr_Measurands].variableAttribute[0].value, MeasurandEnumTypeStr[MeasurandEnumType_SoC]) != NULL)) ||
|
|
|
+ ((dataType == ReadingContextEnumType_Sample_Periodic) && (strstr((char*)ShmOCPP20Data->ControllerComponentVariable[SampledDataCtrlr_TxUpdatedMeasurands].variableAttribute[0].value, MeasurandEnumTypeStr[MeasurandEnumType_SoC]) != NULL)) ||
|
|
|
+ (dataType == ReadingContextEnumType_Trigger))
|
|
|
+ {
|
|
|
+ if((gunType[gun_index] == GUN_TYPE_CHAdeMO)||(gunType[gun_index] == GUN_TYPE_CCS)||(gunType[gun_index] == GUN_TYPE_GBT)||(gunType[gun_index] == GUN_TYPE_DO))
|
|
|
{
|
|
|
- if (ShmSysConfigAndInfo->SysInfo.ConnectorInfo[index].GeneralChargingData.Index == tempIndex)
|
|
|
+ if((ShmSysConfigAndInfo->SysConfig.ModelName[8] != '0') && (gunType[gun_index] != GUN_TYPE_DO))
|
|
|
{
|
|
|
- //ShmSysConfigAndInfo->SysInfo.GbChargingData[index].PresentChargingPower = 100.0;
|
|
|
- ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[3].value = ShmSysConfigAndInfo->SysInfo.ConnectorInfo[index].GeneralChargingData.PresentChargingPower;
|
|
|
+ tempIndex = ((gun_index==2) ? 1: 0);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ tempIndex = gun_index;
|
|
|
}
|
|
|
- }
|
|
|
|
|
|
- strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[3].phase, PhaseEnumTypeStr[PhaseEnumType_L3_N]);
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- if(ShmSysConfigAndInfo->SysConfig.ModelName[0]=='D')
|
|
|
- {
|
|
|
- tempIndex = 2;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- tempIndex = gun_index;
|
|
|
- }
|
|
|
+ if(gunType[gun_index] == GUN_TYPE_CHAdeMO)
|
|
|
+ {
|
|
|
+ //tempIndex = ((gun_index==2) ? 1: 0);
|
|
|
|
|
|
- for (int index = 0; index < AC_QUANTITY; index++)
|
|
|
- {
|
|
|
- if (ShmSysConfigAndInfo->SysInfo.AcChargingData[index].Index == tempIndex)
|
|
|
+ for (int index = 0; index < CHAdeMO_QUANTITY; index++)
|
|
|
+ {
|
|
|
+ if (ShmSysConfigAndInfo->SysInfo.ChademoChargingData[index].Index == tempIndex)
|
|
|
+ {
|
|
|
+ ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[5].value = ShmSysConfigAndInfo->SysInfo.ChademoChargingData[index].EvBatterySoc;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else if(gunType[gun_index] == GUN_TYPE_CCS)
|
|
|
{
|
|
|
- ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[3].value = ShmSysConfigAndInfo->SysInfo.AcChargingData[index].PresentChargingPower;
|
|
|
+ //tempIndex = ((gun_index==2) ? 1: 0);
|
|
|
+
|
|
|
+ for (int index = 0; index < CCS_QUANTITY; index++)
|
|
|
+ {
|
|
|
+ if (ShmSysConfigAndInfo->SysInfo.CcsChargingData[index].Index == tempIndex)
|
|
|
+ {
|
|
|
+ ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[5].value = ShmSysConfigAndInfo->SysInfo.CcsChargingData[index].EvBatterySoc;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
- }
|
|
|
+ else if(gunType[gun_index] == GUN_TYPE_GBT)
|
|
|
+ {
|
|
|
+ //tempIndex = ((gun_index==2) ? 1: 0);
|
|
|
|
|
|
- strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[3].phase, PhaseEnumTypeStr[PhaseEnumType_L1_N]);
|
|
|
- }
|
|
|
+ for (int index = 0; index < GB_QUANTITY; index++)
|
|
|
+ {
|
|
|
+ if (ShmSysConfigAndInfo->SysInfo.GbChargingData[index].Index == tempIndex)
|
|
|
+ {
|
|
|
+ ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[5].value = ShmSysConfigAndInfo->SysInfo.GbChargingData[index].EvBatterySoc;
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
- strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[3].context, ReadingContextEnumTypeStr[dataType]);
|
|
|
- strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[3].measurand, MeasurandEnumTypeStr[MeasurandEnumType_Power_Active_Import]);
|
|
|
- strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[3].location, LocationEnumTypeStr[LocationEnumType_Outlet]);
|
|
|
- strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[3].unitOfMeasure.uint , "kW");
|
|
|
- ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[3].unitOfMeasure.multiplier = 0;
|
|
|
+ }
|
|
|
+ else if(gunType[gun_index] == GUN_TYPE_DO)
|
|
|
+ {
|
|
|
+ //tempIndex = ((gun_index==2) ? 1: 0);
|
|
|
|
|
|
- //idx_sample=4;
|
|
|
- //***********************************************(5)VOLTAGE L1******************************************************/
|
|
|
- //J : CHAdeMO U: CCS1 combo E: CCS2 combo G: GBT DC
|
|
|
- if(gunType[gun_index] == GUN_TYPE_CHAdeMO)
|
|
|
- {
|
|
|
- if(ShmSysConfigAndInfo->SysConfig.ModelName[8] != '0')
|
|
|
- {
|
|
|
- tempIndex = ((gun_index==2) ? 1: 0);
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- tempIndex = gun_index;
|
|
|
- }
|
|
|
+ for (int index = 0; index < GENERAL_GUN_QUANTITY; index++)
|
|
|
+ {
|
|
|
+ if (ShmSysConfigAndInfo->SysInfo.ConnectorInfo[index].GeneralChargingData.Index == tempIndex)
|
|
|
+ {
|
|
|
+ ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[5].value = ShmSysConfigAndInfo->SysInfo.ConnectorInfo[index].GeneralChargingData.EvBatterySoc;
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
- for (int index = 0; index < CHAdeMO_QUANTITY; index++)
|
|
|
- {
|
|
|
- if (ShmSysConfigAndInfo->SysInfo.ChademoChargingData[index].Index == tempIndex)
|
|
|
- {
|
|
|
- ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[4].value = ShmSysConfigAndInfo->SysInfo.ChademoChargingData[index].PresentChargingVoltage;
|
|
|
}
|
|
|
- }
|
|
|
|
|
|
- strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[4].phase, PhaseEnumTypeStr[PhaseEnumType_L3_N]);
|
|
|
+ strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[5].context, ReadingContextEnumTypeStr[dataType]);
|
|
|
+ strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[5].measurand, MeasurandEnumTypeStr[MeasurandEnumType_SoC]);
|
|
|
+ strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[5].phase, PhaseEnumTypeStr[PhaseEnumType_L3_N]);
|
|
|
+ strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[5].location, LocationEnumTypeStr[LocationEnumType_EV]);
|
|
|
+ strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[5].unitOfMeasure.uint , "Percent");
|
|
|
+ ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[5].unitOfMeasure.multiplier = 0;
|
|
|
+ }
|
|
|
}
|
|
|
- else if(gunType[gun_index] == GUN_TYPE_CCS)
|
|
|
+
|
|
|
+
|
|
|
+ //********************************(7)Current.Import L2************************************************/
|
|
|
+ if(((dataType == ReadingContextEnumType_Sample_Clock) && (strstr((char*)ShmOCPP20Data->ControllerComponentVariable[AlignedDataCtrlr_Measurands].variableAttribute[0].value, MeasurandEnumTypeStr[MeasurandEnumType_Current_Import]) != NULL)) ||
|
|
|
+ ((dataType == ReadingContextEnumType_Sample_Periodic) && (strstr((char*)ShmOCPP20Data->ControllerComponentVariable[SampledDataCtrlr_TxUpdatedMeasurands].variableAttribute[0].value, MeasurandEnumTypeStr[MeasurandEnumType_Current_Import]) != NULL)) ||
|
|
|
+ (dataType == ReadingContextEnumType_Trigger))
|
|
|
{
|
|
|
- if(ShmSysConfigAndInfo->SysConfig.ModelName[8] != '0')
|
|
|
- {
|
|
|
- tempIndex = ((gun_index==2) ? 1: 0);
|
|
|
- }
|
|
|
- else
|
|
|
+ // Only for AC 3 phase
|
|
|
+ if((gunType[gun_index] == GUN_TYPE_AC) && ((ShmSysConfigAndInfo->SysConfig.ModelName[2] == 'Y') || (ShmSysConfigAndInfo->SysConfig.ModelName[2] == 'W') || (ShmSysConfigAndInfo->SysConfig.ModelName[2] == 'D')))
|
|
|
{
|
|
|
- tempIndex = gun_index;
|
|
|
- }
|
|
|
+ if(ShmSysConfigAndInfo->SysConfig.ModelName[0]=='D')
|
|
|
+ {
|
|
|
+ tempIndex = 2;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ tempIndex = gun_index;
|
|
|
+ }
|
|
|
|
|
|
- for (int index = 0; index < CCS_QUANTITY; index++)
|
|
|
- {
|
|
|
- if (ShmSysConfigAndInfo->SysInfo.CcsChargingData[index].Index == tempIndex)
|
|
|
+ for (int index = 0; index < AC_QUANTITY; index++)
|
|
|
{
|
|
|
- ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[4].value = ShmSysConfigAndInfo->SysInfo.CcsChargingData[index].PresentChargingVoltage;
|
|
|
+ if (ShmSysConfigAndInfo->SysInfo.AcChargingData[index].Index == tempIndex)
|
|
|
+ {
|
|
|
+ ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[6].value = ShmSysConfigAndInfo->SysInfo.AcChargingData[index].PresentChargingCurrentL2;
|
|
|
+ }
|
|
|
}
|
|
|
+ strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[6].phase, PhaseEnumTypeStr[PhaseEnumType_L2_N]);
|
|
|
}
|
|
|
-
|
|
|
- strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[4].phase, PhaseEnumTypeStr[PhaseEnumType_L3_N]);
|
|
|
+ strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[6].context, ReadingContextEnumTypeStr[dataType]);
|
|
|
+ strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[6].measurand, MeasurandEnumTypeStr[MeasurandEnumType_Current_Import]);
|
|
|
+ strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[6].location, LocationEnumTypeStr[LocationEnumType_Outlet]);
|
|
|
+ strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[6].unitOfMeasure.uint , "A");
|
|
|
+ ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[6].unitOfMeasure.multiplier = 0;
|
|
|
}
|
|
|
- else if(gunType[gun_index] == GUN_TYPE_GBT)
|
|
|
+
|
|
|
+ //********************************(8)Current.Import L3************************************************/
|
|
|
+ if(((dataType == ReadingContextEnumType_Sample_Clock) && (strstr((char*)ShmOCPP20Data->ControllerComponentVariable[AlignedDataCtrlr_Measurands].variableAttribute[0].value, MeasurandEnumTypeStr[MeasurandEnumType_Current_Import]) != NULL)) ||
|
|
|
+ ((dataType == ReadingContextEnumType_Sample_Periodic) && (strstr((char*)ShmOCPP20Data->ControllerComponentVariable[SampledDataCtrlr_TxUpdatedMeasurands].variableAttribute[0].value, MeasurandEnumTypeStr[MeasurandEnumType_Current_Import]) != NULL)) ||
|
|
|
+ (dataType == ReadingContextEnumType_Trigger))
|
|
|
{
|
|
|
- if(ShmSysConfigAndInfo->SysConfig.ModelName[8] != '0')
|
|
|
- {
|
|
|
- tempIndex = ((gun_index==2) ? 1: 0);
|
|
|
- }
|
|
|
- else
|
|
|
+ // Only for AC 3 phase
|
|
|
+ if( (gunType[gun_index] == GUN_TYPE_AC) && ((ShmSysConfigAndInfo->SysConfig.ModelName[2] == 'Y') || (ShmSysConfigAndInfo->SysConfig.ModelName[2] == 'W') || (ShmSysConfigAndInfo->SysConfig.ModelName[2] == 'D')))
|
|
|
{
|
|
|
- tempIndex = gun_index;
|
|
|
- }
|
|
|
+ if(ShmSysConfigAndInfo->SysConfig.ModelName[0]=='D')
|
|
|
+ {
|
|
|
+ tempIndex = 2;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ tempIndex = gun_index;
|
|
|
+ }
|
|
|
|
|
|
- for (int index = 0; index < GB_QUANTITY; index++)
|
|
|
- {
|
|
|
- if (ShmSysConfigAndInfo->SysInfo.GbChargingData[index].Index == tempIndex)
|
|
|
+ for (int index = 0; index < AC_QUANTITY; index++)
|
|
|
{
|
|
|
- ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[4].value = ShmSysConfigAndInfo->SysInfo.GbChargingData[index].PresentChargingVoltage;
|
|
|
+ if (ShmSysConfigAndInfo->SysInfo.AcChargingData[index].Index == tempIndex)
|
|
|
+ {
|
|
|
+ ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[7].value = ShmSysConfigAndInfo->SysInfo.AcChargingData[index].PresentChargingCurrentL3;
|
|
|
+ }
|
|
|
}
|
|
|
+ strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[7].phase, PhaseEnumTypeStr[PhaseEnumType_L3_N]);
|
|
|
}
|
|
|
-
|
|
|
- strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[4].phase, PhaseEnumTypeStr[PhaseEnumType_L3_N]);
|
|
|
+ strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[7].context, ReadingContextEnumTypeStr[dataType]);
|
|
|
+ strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[7].measurand, MeasurandEnumTypeStr[MeasurandEnumType_Current_Import]);
|
|
|
+ strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[7].location, LocationEnumTypeStr[LocationEnumType_Outlet]);
|
|
|
+ strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[7].unitOfMeasure.uint , "A");
|
|
|
+ ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[7].unitOfMeasure.multiplier = 0;
|
|
|
}
|
|
|
- else if(gunType[gun_index] == GUN_TYPE_DO)
|
|
|
- {
|
|
|
- tempIndex = gun_index;
|
|
|
|
|
|
- for (int index = 0; index < GENERAL_GUN_QUANTITY; index++)
|
|
|
+
|
|
|
+ //***********************************************(9)VOLTAGE L2******************************************************/
|
|
|
+ if(((dataType == ReadingContextEnumType_Sample_Clock) && (strstr((char*)ShmOCPP20Data->ControllerComponentVariable[AlignedDataCtrlr_Measurands].variableAttribute[0].value, MeasurandEnumTypeStr[MeasurandEnumType_Voltage]) != NULL)) ||
|
|
|
+ ((dataType == ReadingContextEnumType_Sample_Periodic) && (strstr((char*)ShmOCPP20Data->ControllerComponentVariable[SampledDataCtrlr_TxUpdatedMeasurands].variableAttribute[0].value, MeasurandEnumTypeStr[MeasurandEnumType_Voltage]) != NULL)) ||
|
|
|
+ (dataType == ReadingContextEnumType_Trigger))
|
|
|
+ {
|
|
|
+ if( (gunType[gun_index] == GUN_TYPE_AC) && ((ShmSysConfigAndInfo->SysConfig.ModelName[2] == 'Y') || (ShmSysConfigAndInfo->SysConfig.ModelName[2] == 'W') || (ShmSysConfigAndInfo->SysConfig.ModelName[2] == 'D')))
|
|
|
{
|
|
|
- if (ShmSysConfigAndInfo->SysInfo.ConnectorInfo[index].GeneralChargingData.Index == tempIndex)
|
|
|
+ if(ShmSysConfigAndInfo->SysConfig.ModelName[0]=='D')
|
|
|
+ {
|
|
|
+ tempIndex = 2;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ tempIndex = gun_index;
|
|
|
+ }
|
|
|
+
|
|
|
+ for (int index = 0; index < AC_QUANTITY; index++)
|
|
|
{
|
|
|
- ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[4].value = ShmSysConfigAndInfo->SysInfo.ConnectorInfo[index].GeneralChargingData.PresentChargingVoltage;
|
|
|
+ if (ShmSysConfigAndInfo->SysInfo.AcChargingData[index].Index == tempIndex)
|
|
|
+ {
|
|
|
+ ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[8].value = ShmSysConfigAndInfo->SysInfo.AcChargingData[index].PresentChargingVoltageL2;
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
+ strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[8].phase, PhaseEnumTypeStr[PhaseEnumType_L2_N]);
|
|
|
}
|
|
|
|
|
|
- strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[4].phase, PhaseEnumTypeStr[PhaseEnumType_L3_N]);
|
|
|
+ strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[8].context, ReadingContextEnumTypeStr[dataType]);
|
|
|
+ strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[8].measurand, MeasurandEnumTypeStr[MeasurandEnumType_Voltage]);
|
|
|
+ strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[8].location, LocationEnumTypeStr[LocationEnumType_Outlet]);
|
|
|
+ strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[8].unitOfMeasure.uint , "V");
|
|
|
+ ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[8].unitOfMeasure.multiplier = 0;
|
|
|
}
|
|
|
- else
|
|
|
+
|
|
|
+ //***********************************************(10)VOLTAGE L3******************************************************/
|
|
|
+ if(((dataType == ReadingContextEnumType_Sample_Clock) && (strstr((char*)ShmOCPP20Data->ControllerComponentVariable[AlignedDataCtrlr_Measurands].variableAttribute[0].value, MeasurandEnumTypeStr[MeasurandEnumType_Voltage]) != NULL)) ||
|
|
|
+ ((dataType == ReadingContextEnumType_Sample_Periodic) && (strstr((char*)ShmOCPP20Data->ControllerComponentVariable[SampledDataCtrlr_TxUpdatedMeasurands].variableAttribute[0].value, MeasurandEnumTypeStr[MeasurandEnumType_Voltage]) != NULL)) ||
|
|
|
+ (dataType == ReadingContextEnumType_Trigger))
|
|
|
{
|
|
|
- if(ShmSysConfigAndInfo->SysConfig.ModelName[0]=='D')
|
|
|
- {
|
|
|
- tempIndex = 2;
|
|
|
- }
|
|
|
- else
|
|
|
+ if((gunType[gun_index] == GUN_TYPE_AC) && ((ShmSysConfigAndInfo->SysConfig.ModelName[2] == 'Y') || (ShmSysConfigAndInfo->SysConfig.ModelName[2] == 'W') || (ShmSysConfigAndInfo->SysConfig.ModelName[2] == 'D')))
|
|
|
{
|
|
|
- tempIndex = gun_index;
|
|
|
- }
|
|
|
+ if(ShmSysConfigAndInfo->SysConfig.ModelName[0]=='D')
|
|
|
+ {
|
|
|
+ tempIndex = 2;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ tempIndex = gun_index;
|
|
|
+ }
|
|
|
|
|
|
- for (int index = 0; index < AC_QUANTITY; index++)
|
|
|
- {
|
|
|
- if (ShmSysConfigAndInfo->SysInfo.AcChargingData[index].Index == tempIndex)
|
|
|
+ for (int index = 0; index < AC_QUANTITY; index++)
|
|
|
{
|
|
|
- ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[4].value = ShmSysConfigAndInfo->SysInfo.AcChargingData[index].PresentChargingVoltage;
|
|
|
+ if (ShmSysConfigAndInfo->SysInfo.AcChargingData[index].Index == tempIndex)
|
|
|
+ {
|
|
|
+ ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[9].value = ShmSysConfigAndInfo->SysInfo.AcChargingData[index].PresentChargingVoltageL3;
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
+ strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[9].phase, PhaseEnumTypeStr[PhaseEnumType_L3_N]);
|
|
|
}
|
|
|
|
|
|
- strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[4].phase, PhaseEnumTypeStr[PhaseEnumType_L1_N]);
|
|
|
+ strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[9].context, ReadingContextEnumTypeStr[dataType]);
|
|
|
+ strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[9].measurand, MeasurandEnumTypeStr[MeasurandEnumType_Voltage]);
|
|
|
+ strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[9].location, LocationEnumTypeStr[LocationEnumType_Outlet]);
|
|
|
+ strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[9].unitOfMeasure.uint , "V");
|
|
|
+ ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[9].unitOfMeasure.multiplier = 0;
|
|
|
}
|
|
|
|
|
|
- strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[4].context, ReadingContextEnumTypeStr[dataType]);
|
|
|
- strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[4].measurand, MeasurandEnumTypeStr[MeasurandEnumType_Voltage]);
|
|
|
- strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[4].location, LocationEnumTypeStr[LocationEnumType_Outlet]);
|
|
|
- strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[4].unitOfMeasure.uint , "V");
|
|
|
- ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[4].unitOfMeasure.multiplier = 0;
|
|
|
-
|
|
|
-
|
|
|
- //***********************************************(6)SOC******************************************************/
|
|
|
- if((gunType[gun_index] == GUN_TYPE_CHAdeMO)||(gunType[gun_index] == GUN_TYPE_CCS)||(gunType[gun_index] == GUN_TYPE_GBT)||(gunType[gun_index] == GUN_TYPE_DO))
|
|
|
+ //***********************************************(11)Current.Offered******************************************************/
|
|
|
+ if(((dataType == ReadingContextEnumType_Sample_Clock) && (strstr((char*)ShmOCPP20Data->ControllerComponentVariable[AlignedDataCtrlr_Measurands].variableAttribute[0].value, MeasurandEnumTypeStr[MeasurandEnumType_Current_Offered]) != NULL)) ||
|
|
|
+ ((dataType == ReadingContextEnumType_Sample_Periodic) && (strstr((char*)ShmOCPP20Data->ControllerComponentVariable[SampledDataCtrlr_TxUpdatedMeasurands].variableAttribute[0].value, MeasurandEnumTypeStr[MeasurandEnumType_Current_Offered]) != NULL)) ||
|
|
|
+ (dataType == ReadingContextEnumType_Trigger))
|
|
|
{
|
|
|
- if((ShmSysConfigAndInfo->SysConfig.ModelName[8] != '0') && (gunType[gun_index] != GUN_TYPE_DO))
|
|
|
- {
|
|
|
- tempIndex = ((gun_index==2) ? 1: 0);
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- tempIndex = gun_index;
|
|
|
- }
|
|
|
-
|
|
|
+ //J : CHAdeMO U: CCS1 combo E: CCS2 combo G: GBT DC
|
|
|
if(gunType[gun_index] == GUN_TYPE_CHAdeMO)
|
|
|
{
|
|
|
- //tempIndex = ((gun_index==2) ? 1: 0);
|
|
|
+ if(ShmSysConfigAndInfo->SysConfig.ModelName[8] != '0')
|
|
|
+ {
|
|
|
+ tempIndex = ((gun_index==2) ? 1: 0);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ tempIndex = gun_index;
|
|
|
+ }
|
|
|
|
|
|
for (int index = 0; index < CHAdeMO_QUANTITY; index++)
|
|
|
{
|
|
|
if (ShmSysConfigAndInfo->SysInfo.ChademoChargingData[index].Index == tempIndex)
|
|
|
{
|
|
|
- ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[5].value = ShmSysConfigAndInfo->SysInfo.ChademoChargingData[index].EvBatterySoc;
|
|
|
+ ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[10].value = (uint16_t) (ShmSysConfigAndInfo->SysInfo.ChademoChargingData[index].AvailableChargingCurrent/10);
|
|
|
}
|
|
|
- }
|
|
|
+ } // END OF FOR
|
|
|
}
|
|
|
else if(gunType[gun_index] == GUN_TYPE_CCS)
|
|
|
{
|
|
|
- //tempIndex = ((gun_index==2) ? 1: 0);
|
|
|
+ if(ShmSysConfigAndInfo->SysConfig.ModelName[8] != '0')
|
|
|
+ {
|
|
|
+ tempIndex = ((gun_index==2) ? 1: 0);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ tempIndex = gun_index;
|
|
|
+ }
|
|
|
|
|
|
for (int index = 0; index < CCS_QUANTITY; index++)
|
|
|
{
|
|
|
if (ShmSysConfigAndInfo->SysInfo.CcsChargingData[index].Index == tempIndex)
|
|
|
{
|
|
|
- ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[5].value = ShmSysConfigAndInfo->SysInfo.CcsChargingData[index].EvBatterySoc;
|
|
|
+ ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[10].value = (uint16_t) (ShmSysConfigAndInfo->SysInfo.CcsChargingData[index].AvailableChargingCurrent/10);
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
else if(gunType[gun_index] == GUN_TYPE_GBT)
|
|
|
{
|
|
|
- //tempIndex = ((gun_index==2) ? 1: 0);
|
|
|
+ if(ShmSysConfigAndInfo->SysConfig.ModelName[8] != '0')
|
|
|
+ {
|
|
|
+ tempIndex = ((gun_index==2) ? 1: 0);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ tempIndex = gun_index;
|
|
|
+ }
|
|
|
|
|
|
for (int index = 0; index < GB_QUANTITY; index++)
|
|
|
{
|
|
|
if (ShmSysConfigAndInfo->SysInfo.GbChargingData[index].Index == tempIndex)
|
|
|
{
|
|
|
- ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[5].value = ShmSysConfigAndInfo->SysInfo.GbChargingData[index].EvBatterySoc;
|
|
|
+ //ShmSysConfigAndInfo->SysInfo.GbChargingData[index].PresentChargingPower = 100.0;
|
|
|
+ ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[10].value = (uint16_t) (ShmSysConfigAndInfo->SysInfo.GbChargingData[index].AvailableChargingCurrent/10);;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
else if(gunType[gun_index] == GUN_TYPE_DO)
|
|
|
{
|
|
|
- //tempIndex = ((gun_index==2) ? 1: 0);
|
|
|
+ tempIndex = gun_index;
|
|
|
|
|
|
for (int index = 0; index < GENERAL_GUN_QUANTITY; index++)
|
|
|
{
|
|
|
if (ShmSysConfigAndInfo->SysInfo.ConnectorInfo[index].GeneralChargingData.Index == tempIndex)
|
|
|
{
|
|
|
- ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[5].value = ShmSysConfigAndInfo->SysInfo.ConnectorInfo[index].GeneralChargingData.EvBatterySoc;
|
|
|
+ //ShmSysConfigAndInfo->SysInfo.GbChargingData[index].PresentChargingPower = 100.0;
|
|
|
+ ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[10].value = (uint16_t) (ShmSysConfigAndInfo->SysInfo.ConnectorInfo[index].GeneralChargingData.AvailableChargingCurrent/10);;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[5].context, ReadingContextEnumTypeStr[dataType]);
|
|
|
- strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[5].measurand, MeasurandEnumTypeStr[MeasurandEnumType_SoC]);
|
|
|
- strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[5].phase, PhaseEnumTypeStr[PhaseEnumType_L3_N]);
|
|
|
- strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[5].location, LocationEnumTypeStr[LocationEnumType_EV]);
|
|
|
- strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[5].unitOfMeasure.uint , "Percent");
|
|
|
- ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[5].unitOfMeasure.multiplier = 0;
|
|
|
- }
|
|
|
-
|
|
|
- //********************************(7)Current.Import L2************************************************/
|
|
|
- // Only for AC 3 phase
|
|
|
- if((gunType[gun_index] == GUN_TYPE_AC) && ((ShmSysConfigAndInfo->SysConfig.ModelName[2] == 'Y') || (ShmSysConfigAndInfo->SysConfig.ModelName[2] == 'W') || (ShmSysConfigAndInfo->SysConfig.ModelName[2] == 'D')))
|
|
|
- {
|
|
|
- if(ShmSysConfigAndInfo->SysConfig.ModelName[0]=='D')
|
|
|
- {
|
|
|
- tempIndex = 2;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- tempIndex = gun_index;
|
|
|
- }
|
|
|
+ if(ShmSysConfigAndInfo->SysConfig.ModelName[0]=='D')
|
|
|
+ {
|
|
|
+ tempIndex = 2;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ tempIndex = gun_index;
|
|
|
+ }
|
|
|
|
|
|
- for (int index = 0; index < AC_QUANTITY; index++)
|
|
|
- {
|
|
|
- if (ShmSysConfigAndInfo->SysInfo.AcChargingData[index].Index == tempIndex)
|
|
|
+ for (int index = 0; index < AC_QUANTITY; index++)
|
|
|
{
|
|
|
- ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[6].value = ShmSysConfigAndInfo->SysInfo.AcChargingData[index].PresentChargingCurrentL2;
|
|
|
+ if (ShmSysConfigAndInfo->SysInfo.AcChargingData[index].Index == tempIndex)
|
|
|
+ {
|
|
|
+ uint16_t currentOffer;
|
|
|
+ if(ShmSysConfigAndInfo->SysConfig.MaxChargingCurrent == 0)
|
|
|
+ {
|
|
|
+ currentOffer = ShmSysConfigAndInfo->SysConfig.RatingCurrent;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ currentOffer = ((ShmSysConfigAndInfo->SysConfig.MaxChargingCurrent>ShmSysConfigAndInfo->SysConfig.RatingCurrent)?ShmSysConfigAndInfo->SysConfig.RatingCurrent:ShmSysConfigAndInfo->SysConfig.MaxChargingCurrent);
|
|
|
+ }
|
|
|
+ ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[10].value = currentOffer;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
- strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[6].phase, PhaseEnumTypeStr[PhaseEnumType_L2_N]);
|
|
|
+
|
|
|
+ strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[10].context, ReadingContextEnumTypeStr[dataType]);
|
|
|
+ strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[10].measurand, MeasurandEnumTypeStr[MeasurandEnumType_Current_Offered]);
|
|
|
+ strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[10].location, LocationEnumTypeStr[LocationEnumType_Outlet]);
|
|
|
+ strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[10].unitOfMeasure.uint , "A");
|
|
|
+ ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[10].unitOfMeasure.multiplier = 0;
|
|
|
}
|
|
|
- strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[6].context, ReadingContextEnumTypeStr[dataType]);
|
|
|
- strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[6].measurand, MeasurandEnumTypeStr[MeasurandEnumType_Current_Import]);
|
|
|
- strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[6].location, LocationEnumTypeStr[LocationEnumType_Outlet]);
|
|
|
- strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[6].unitOfMeasure.uint , "A");
|
|
|
- ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[6].unitOfMeasure.multiplier = 0;
|
|
|
|
|
|
- //********************************(8)Current.Import L3************************************************/
|
|
|
- // Only for AC 3 phase
|
|
|
- if( (gunType[gun_index] == GUN_TYPE_AC) && ((ShmSysConfigAndInfo->SysConfig.ModelName[2] == 'Y') || (ShmSysConfigAndInfo->SysConfig.ModelName[2] == 'W') || (ShmSysConfigAndInfo->SysConfig.ModelName[2] == 'D')))
|
|
|
+ //***********************************************(12)Power.Offered******************************************************/
|
|
|
+ if(((dataType == ReadingContextEnumType_Sample_Clock) && (strstr((char*)ShmOCPP20Data->ControllerComponentVariable[AlignedDataCtrlr_Measurands].variableAttribute[0].value, MeasurandEnumTypeStr[MeasurandEnumType_Power_Offered]) != NULL)) ||
|
|
|
+ ((dataType == ReadingContextEnumType_Sample_Periodic) && (strstr((char*)ShmOCPP20Data->ControllerComponentVariable[SampledDataCtrlr_TxUpdatedMeasurands].variableAttribute[0].value, MeasurandEnumTypeStr[MeasurandEnumType_Power_Offered]) != NULL)) ||
|
|
|
+ (dataType == ReadingContextEnumType_Trigger))
|
|
|
{
|
|
|
- if(ShmSysConfigAndInfo->SysConfig.ModelName[0]=='D')
|
|
|
- {
|
|
|
- tempIndex = 2;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- tempIndex = gun_index;
|
|
|
- }
|
|
|
-
|
|
|
- for (int index = 0; index < AC_QUANTITY; index++)
|
|
|
+ //J : CHAdeMO U: CCS1 combo E: CCS2 combo G: GBT DC
|
|
|
+ if(gunType[gun_index] == GUN_TYPE_CHAdeMO)
|
|
|
{
|
|
|
- if (ShmSysConfigAndInfo->SysInfo.AcChargingData[index].Index == tempIndex)
|
|
|
+ if(ShmSysConfigAndInfo->SysConfig.ModelName[8] != '0')
|
|
|
{
|
|
|
- ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[7].value = ShmSysConfigAndInfo->SysInfo.AcChargingData[index].PresentChargingCurrentL3;
|
|
|
+ tempIndex = ((gun_index==2) ? 1: 0);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ tempIndex = gun_index;
|
|
|
}
|
|
|
- }
|
|
|
- strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[7].phase, PhaseEnumTypeStr[PhaseEnumType_L3_N]);
|
|
|
- }
|
|
|
- strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[7].context, ReadingContextEnumTypeStr[dataType]);
|
|
|
- strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[7].measurand, MeasurandEnumTypeStr[MeasurandEnumType_Current_Import]);
|
|
|
- strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[7].location, LocationEnumTypeStr[LocationEnumType_Outlet]);
|
|
|
- strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[7].unitOfMeasure.uint , "A");
|
|
|
- ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[7].unitOfMeasure.multiplier = 0;
|
|
|
|
|
|
- //***********************************************(9)VOLTAGE L2******************************************************/
|
|
|
- if( (gunType[gun_index] == GUN_TYPE_AC) && ((ShmSysConfigAndInfo->SysConfig.ModelName[2] == 'Y') || (ShmSysConfigAndInfo->SysConfig.ModelName[2] == 'W') || (ShmSysConfigAndInfo->SysConfig.ModelName[2] == 'D')))
|
|
|
- {
|
|
|
- if(ShmSysConfigAndInfo->SysConfig.ModelName[0]=='D')
|
|
|
- {
|
|
|
- tempIndex = 2;
|
|
|
+ for (int index = 0; index < CHAdeMO_QUANTITY; index++)
|
|
|
+ {
|
|
|
+ if (ShmSysConfigAndInfo->SysInfo.ChademoChargingData[index].Index == tempIndex)
|
|
|
+ {
|
|
|
+ ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[11].value = (uint16_t) (ShmSysConfigAndInfo->SysInfo.ChademoChargingData[index].AvailableChargingPower*10);
|
|
|
+ }
|
|
|
+ } // END OF FOR
|
|
|
}
|
|
|
- else
|
|
|
+ else if(gunType[gun_index] == GUN_TYPE_CCS)
|
|
|
{
|
|
|
- tempIndex = gun_index;
|
|
|
- }
|
|
|
+ if(ShmSysConfigAndInfo->SysConfig.ModelName[8] != '0')
|
|
|
+ {
|
|
|
+ tempIndex = ((gun_index==2) ? 1: 0);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ tempIndex = gun_index;
|
|
|
+ }
|
|
|
|
|
|
- for (int index = 0; index < AC_QUANTITY; index++)
|
|
|
- {
|
|
|
- if (ShmSysConfigAndInfo->SysInfo.AcChargingData[index].Index == tempIndex)
|
|
|
+ for (int index = 0; index < CCS_QUANTITY; index++)
|
|
|
{
|
|
|
- ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[8].value = ShmSysConfigAndInfo->SysInfo.AcChargingData[index].PresentChargingVoltageL2;
|
|
|
+ if (ShmSysConfigAndInfo->SysInfo.CcsChargingData[index].Index == tempIndex)
|
|
|
+ {
|
|
|
+ ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[11].value = (uint16_t) (ShmSysConfigAndInfo->SysInfo.CcsChargingData[index].AvailableChargingPower*10);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[8].phase, PhaseEnumTypeStr[PhaseEnumType_L2_N]);
|
|
|
- }
|
|
|
-
|
|
|
- strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[8].context, ReadingContextEnumTypeStr[dataType]);
|
|
|
- strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[8].measurand, MeasurandEnumTypeStr[MeasurandEnumType_Voltage]);
|
|
|
- strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[8].location, LocationEnumTypeStr[LocationEnumType_Outlet]);
|
|
|
- strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[8].unitOfMeasure.uint , "V");
|
|
|
- ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[8].unitOfMeasure.multiplier = 0;
|
|
|
-
|
|
|
- //***********************************************(10)VOLTAGE L3******************************************************/
|
|
|
- if((gunType[gun_index] == GUN_TYPE_AC) && ((ShmSysConfigAndInfo->SysConfig.ModelName[2] == 'Y') || (ShmSysConfigAndInfo->SysConfig.ModelName[2] == 'W') || (ShmSysConfigAndInfo->SysConfig.ModelName[2] == 'D')))
|
|
|
- {
|
|
|
- if(ShmSysConfigAndInfo->SysConfig.ModelName[0]=='D')
|
|
|
+ else if(gunType[gun_index] == GUN_TYPE_GBT)
|
|
|
{
|
|
|
- tempIndex = 2;
|
|
|
+ if(ShmSysConfigAndInfo->SysConfig.ModelName[8] != '0')
|
|
|
+ {
|
|
|
+ tempIndex = ((gun_index==2) ? 1: 0);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ tempIndex = gun_index;
|
|
|
+ }
|
|
|
+
|
|
|
+ for (int index = 0; index < GB_QUANTITY; index++)
|
|
|
+ {
|
|
|
+ if (ShmSysConfigAndInfo->SysInfo.GbChargingData[index].Index == tempIndex)
|
|
|
+ {
|
|
|
+ //ShmSysConfigAndInfo->SysInfo.GbChargingData[index].PresentChargingPower = 100.0;
|
|
|
+ ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[11].value = (uint16_t) (ShmSysConfigAndInfo->SysInfo.GbChargingData[index].AvailableChargingPower*10);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
- else
|
|
|
+ else if(gunType[gun_index] == GUN_TYPE_DO)
|
|
|
{
|
|
|
tempIndex = gun_index;
|
|
|
- }
|
|
|
|
|
|
- for (int index = 0; index < AC_QUANTITY; index++)
|
|
|
- {
|
|
|
- if (ShmSysConfigAndInfo->SysInfo.AcChargingData[index].Index == tempIndex)
|
|
|
+ for (int index = 0; index < GENERAL_GUN_QUANTITY; index++)
|
|
|
{
|
|
|
- ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[9].value = ShmSysConfigAndInfo->SysInfo.AcChargingData[index].PresentChargingVoltageL3;
|
|
|
+ if (ShmSysConfigAndInfo->SysInfo.ConnectorInfo[index].GeneralChargingData.Index == tempIndex)
|
|
|
+ {
|
|
|
+ //ShmSysConfigAndInfo->SysInfo.GbChargingData[index].PresentChargingPower = 100.0;
|
|
|
+ ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[11].value = (uint16_t) (ShmSysConfigAndInfo->SysInfo.ConnectorInfo[index].GeneralChargingData.AvailableChargingPower*10);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[9].phase, PhaseEnumTypeStr[PhaseEnumType_L3_N]);
|
|
|
+ strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[11].context, ReadingContextEnumTypeStr[dataType]);
|
|
|
+ strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[11].measurand, MeasurandEnumTypeStr[MeasurandEnumType_Power_Offered]);
|
|
|
+ strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[11].location, LocationEnumTypeStr[LocationEnumType_Outlet]);
|
|
|
+ strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[11].unitOfMeasure.uint , "W");
|
|
|
+ ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[11].unitOfMeasure.multiplier = 0;
|
|
|
}
|
|
|
|
|
|
- strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[9].context, ReadingContextEnumTypeStr[dataType]);
|
|
|
- strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[9].measurand, MeasurandEnumTypeStr[MeasurandEnumType_Voltage]);
|
|
|
- strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[9].location, LocationEnumTypeStr[LocationEnumType_Outlet]);
|
|
|
- strcpy((char *)ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[9].unitOfMeasure.uint , "V");
|
|
|
- ShmOCPP20Data->MeterValues[gun_index].meterValue[0].sampledValue[9].unitOfMeasure.multiplier = 0;
|
|
|
-
|
|
|
// Message create ====================================================================================================
|
|
|
random_uuid(guid);
|
|
|
|