|
@@ -3555,6 +3555,9 @@ int InitShareMemory()
|
|
|
|
|
|
int ProcessShareMemory()
|
|
|
{
|
|
|
+ int result = PASS;
|
|
|
+ ParsingRatedCur modelnameInfo={0};
|
|
|
+
|
|
|
if(InitShareMemory() == FAIL)
|
|
|
{
|
|
|
DEBUG_ERROR("InitShareMemory NG\n");
|
|
@@ -3563,10 +3566,87 @@ int ProcessShareMemory()
|
|
|
{
|
|
|
ShmStatusCodeData->AlarmCode.AlarmEvents.bits.FailToCreateShareMemory=1;
|
|
|
}
|
|
|
- sleep(5);
|
|
|
- return FAIL;
|
|
|
+
|
|
|
+ result = FAIL;
|
|
|
+ }
|
|
|
+
|
|
|
+ // Model name parsing
|
|
|
+ if(RatedCurrentParsing((char*)ShmSysConfigAndInfo->SysConfig.ModelName, &modelnameInfo) != -1)
|
|
|
+ {
|
|
|
+ if((ShmSysConfigAndInfo->SysConfig.ModelName[0]=='D') &&
|
|
|
+ ((ShmSysConfigAndInfo->SysConfig.ModelName[1]=='B') ||
|
|
|
+ (ShmSysConfigAndInfo->SysConfig.ModelName[1]=='K') ||
|
|
|
+ (ShmSysConfigAndInfo->SysConfig.ModelName[1]=='O'))
|
|
|
+ ) // 'D' means DC
|
|
|
+ {
|
|
|
+ // DO series
|
|
|
+ for(int gun_index=0; gun_index<GENERAL_GUN_QUANTITY ; gun_index++)
|
|
|
+ {
|
|
|
+ SystemInitial += 1;
|
|
|
+ gunTotalNumber += 1;
|
|
|
+ gunType[gun_index] = GUN_TYPE_DO;
|
|
|
+
|
|
|
+ switch(modelnameInfo.ParsingInfo[gun_index].GunType)
|
|
|
+ {
|
|
|
+ case Gun_Type_Chademo:
|
|
|
+ DEBUG_INFO("Gun-%02d type: Cabinet CHAdeMO\n", gun_index);
|
|
|
+ break;
|
|
|
+ case Gun_Type_CCS_2:
|
|
|
+ DEBUG_INFO("Gun-%02d type: Cabinet CCS\n", gun_index);
|
|
|
+ break;
|
|
|
+ case Gun_Type_GB:
|
|
|
+ DEBUG_INFO("Gun-%02d type: Cabinet GBT\n", gun_index);
|
|
|
+ break;
|
|
|
+ case Gun_Type_AC:
|
|
|
+ DEBUG_INFO("Gun-%02d type: Cabinet AC\n", gun_index);
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ DEBUG_WARN("Gun-%02d type: Cabinet unknown\n", gun_index);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ for(int gun_index=0;gun_index<modelnameInfo.GetGunCount;gun_index++)
|
|
|
+ {
|
|
|
+ SystemInitial += 1;
|
|
|
+ gunTotalNumber += 1;
|
|
|
+
|
|
|
+ switch(modelnameInfo.ParsingInfo[gun_index].GunType)
|
|
|
+ {
|
|
|
+ case Gun_Type_Chademo:
|
|
|
+ gunType[gun_index] = GUN_TYPE_CHAdeMO;
|
|
|
+ DEBUG_INFO("Gun-%02d type: CHAdeMO\n", gun_index);
|
|
|
+ break;
|
|
|
+ case Gun_Type_CCS_2:
|
|
|
+ gunType[gun_index] = GUN_TYPE_CCS;
|
|
|
+ DEBUG_INFO("Gun-%02d type: CCS\n", gun_index);
|
|
|
+ break;
|
|
|
+ case Gun_Type_GB:
|
|
|
+ gunType[gun_index] = GUN_TYPE_GBT;
|
|
|
+ DEBUG_INFO("Gun-%02d type: GBT\n", gun_index);
|
|
|
+ break;
|
|
|
+ case Gun_Type_AC:
|
|
|
+ gunType[gun_index] = GUN_TYPE_AC;
|
|
|
+ DEBUG_INFO("Gun-%02d type: AC\n", gun_index);
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ DEBUG_WARN("Gun-%02d type: Unknown\n", gun_index);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
- return PASS;
|
|
|
+ else
|
|
|
+ {
|
|
|
+ DEBUG_ERROR("Model name parsing fail.\n");
|
|
|
+ result = FAIL;
|
|
|
+ }
|
|
|
+
|
|
|
+ if(result != PASS)sleep(5);
|
|
|
+
|
|
|
+ return result;
|
|
|
}
|
|
|
|
|
|
void CheckSystemValue(void)
|
|
@@ -18771,8 +18851,6 @@ void refreshProcDogTimer()
|
|
|
|
|
|
void InitialSystemValue(void)
|
|
|
{
|
|
|
- int connectorIndex = 0;
|
|
|
- //int valueASCII = 0;
|
|
|
server_cycle_Status = atoi((char*)ShmOCPP16DataPH->ConfigurationTable.CoreProfile[MinimumStatusDuration].ItemData);
|
|
|
gunTotalNumber=0;
|
|
|
SystemInitial = 0;
|
|
@@ -18802,97 +18880,6 @@ void InitialSystemValue(void)
|
|
|
memset(AcPreviousConnectorPlugIn, 0, ARRAY_SIZE(AcPreviousConnectorPlugIn));
|
|
|
memset(gunType, 0, ARRAY_SIZE(gunType));
|
|
|
|
|
|
- if(ShmSysConfigAndInfo->SysConfig.ModelName[0]=='D') // 'D' means DC
|
|
|
- {
|
|
|
- if((ShmSysConfigAndInfo->SysConfig.ModelName[1]=='B') ||
|
|
|
- (ShmSysConfigAndInfo->SysConfig.ModelName[1]=='K') ||
|
|
|
- (ShmSysConfigAndInfo->SysConfig.ModelName[1]=='O'))
|
|
|
- {
|
|
|
- // DO series
|
|
|
- for(int index=0; index<GENERAL_GUN_QUANTITY ; index++)
|
|
|
- {
|
|
|
- SystemInitial = SystemInitial + 1;
|
|
|
- gunTotalNumber = gunTotalNumber + 1;
|
|
|
- gunType[connectorIndex] = GUN_TYPE_DO;
|
|
|
- connectorIndex = connectorIndex + 1;
|
|
|
- }
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- // DM, DW, DS series
|
|
|
- //check connector / socket type (index: 8, 9, 10)
|
|
|
- for(int index=7; index <10 ; index++)
|
|
|
- {
|
|
|
- if(index != 8)
|
|
|
- {
|
|
|
- // DC Connector
|
|
|
- if ((ShmSysConfigAndInfo->SysConfig.ModelName[index] == 'J'))
|
|
|
- {
|
|
|
- SystemInitial = SystemInitial + 1;
|
|
|
- gunTotalNumber = gunTotalNumber + 1;
|
|
|
- gunType[connectorIndex] = GUN_TYPE_CHAdeMO;
|
|
|
- connectorIndex = connectorIndex + 1;
|
|
|
- }
|
|
|
- else if ((ShmSysConfigAndInfo->SysConfig.ModelName[index] == 'D') ||
|
|
|
- (ShmSysConfigAndInfo->SysConfig.ModelName[index] == 'E') ||
|
|
|
- (ShmSysConfigAndInfo->SysConfig.ModelName[index] == 'F') ||
|
|
|
- (ShmSysConfigAndInfo->SysConfig.ModelName[index] == 'U') ||
|
|
|
- (ShmSysConfigAndInfo->SysConfig.ModelName[index] == 'T') ||
|
|
|
- (ShmSysConfigAndInfo->SysConfig.ModelName[index] == 'V'))
|
|
|
- {
|
|
|
- SystemInitial = SystemInitial + 1;
|
|
|
- gunTotalNumber = gunTotalNumber + 1;
|
|
|
- gunType[connectorIndex] = GUN_TYPE_CCS;
|
|
|
- connectorIndex = connectorIndex + 1;
|
|
|
- }
|
|
|
- else if ((ShmSysConfigAndInfo->SysConfig.ModelName[index] == 'G'))
|
|
|
- {
|
|
|
- SystemInitial = SystemInitial + 1;
|
|
|
- gunTotalNumber = gunTotalNumber + 1;
|
|
|
- gunType[connectorIndex] = GUN_TYPE_GBT;
|
|
|
- connectorIndex = connectorIndex + 1;
|
|
|
- }
|
|
|
- else if ((ShmSysConfigAndInfo->SysConfig.ModelName[index] == 'O'))
|
|
|
- {
|
|
|
- SystemInitial = SystemInitial + 1;
|
|
|
- gunTotalNumber = gunTotalNumber + 1;
|
|
|
- gunType[connectorIndex] = GUN_TYPE_DO;
|
|
|
- connectorIndex = connectorIndex + 1;
|
|
|
- }
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- // AC Connector
|
|
|
- if ((ShmSysConfigAndInfo->SysConfig.ModelName[index] > '0') && (ShmSysConfigAndInfo->SysConfig.ModelName[index] <= '9'))
|
|
|
- {
|
|
|
- SystemInitial = SystemInitial + 1;
|
|
|
- gunTotalNumber = gunTotalNumber + 1;
|
|
|
- gunType[connectorIndex] = GUN_TYPE_AC;
|
|
|
- connectorIndex = connectorIndex + 1;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- //DEBUG_INFO("DC ...\n");
|
|
|
- }
|
|
|
- else if (ShmSysConfigAndInfo->SysConfig.ModelName[0]=='A') //'A' means AC
|
|
|
- {
|
|
|
- //check connector / socket type (index: 8, 9, 10)
|
|
|
- for(int index=7; index <10 ; index++)
|
|
|
- {
|
|
|
- if ((ShmSysConfigAndInfo->SysConfig.ModelName[index] > '0') && (ShmSysConfigAndInfo->SysConfig.ModelName[index] <= '9'))
|
|
|
- {
|
|
|
- SystemInitial = SystemInitial + 1;
|
|
|
- gunTotalNumber = gunTotalNumber + 1;
|
|
|
- gunType[connectorIndex] = GUN_TYPE_AC;
|
|
|
- connectorIndex = connectorIndex + 1;
|
|
|
-
|
|
|
- //DEBUG_INFO("AC: %d, %c\n", index, ShmSysConfigAndInfo->SysConfig.ModelName[index]);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
//Status && ConnectorPlugIn Setting
|
|
|
for (int index = 0; index < CHAdeMO_QUANTITY; index++)
|
|
|
{
|