Selaa lähdekoodia

Merge branch 'master' into DD360Audi

Simon Xue 2 vuotta sitten
vanhempi
commit
fb1894224a

+ 775 - 127
EVSE/Modularization/DcMeter/Module_DcMeter.c

@@ -1,15 +1,23 @@
 /*
- * Module_DcMeter.c
+ * Module_DcMeter.c 
  *
- *  Created on: 2021/5/31
+ *  Created on: 2021/5/31 
  *      Author: foluswen
  */
 #include "Module_DcMeter.h"
 #include "meterComm.h"
 #include "Module_RatedCurrent.h"
 
+#define _DEBUG_ 1
+
+#if _DEBUG_
+#define PR(...) printf(__VA_ARGS__)
+#else
+#define PR(...)
+#endif
+
 /**
- * Initial share memory
+ * Initial share memory  
  * @return
  */
 int InitShareMemory()
@@ -64,18 +72,32 @@ int InitShareMemory()
     return result;
 }
 
+
+
+
+
+
 //==========================================
 // Main loop
 //==========================================
 int main(void)
 {
+	printf("main start\n");
 	ParsingRatedCur modelnameInfo = {0};
 	Meter_Info meter_info[4];
-	uint8_t pollingIndex = 0;
-	uint8_t	meterIndex = 0;
+	Meter_Status_Info meter_status_info[4];
+	Meter_transaction_Action meter_read_transaction_record[4];
+	Meter_transaction_Action meter_transaction_Action[4];
+	Meter_transaction_Result meter_transaction_Result[4];
 	uint8_t failCount[4];
+	uint8_t startTransactionFailCount[4];
+	uint8_t stopTransactionFailCount[4];
+	uint8_t getTransactionOcmfFailCount[4];
+	uint8_t meterSyncTimeFailCount[4];
+	uint16_t RecordLogTimerCount = 0;
 
 #ifndef DEBUG_STANDALONG
+
 	// Initialize share memory
 	if(InitShareMemory() == FAIL)
 	{
@@ -88,11 +110,19 @@ int main(void)
 		sleep(5);
 		return -1;
 	}
+	
+	/*
+	for(;;)
+	{
+		printf("ActionCmd : %d \n", ShmSysConfigAndInfo->SysInfo.DcMeterTransactionAction[0].ActionCmd);
+		sleep(1);
+	}
+	*/
 
 	RatedCurrentParsing((char*)ShmSysConfigAndInfo->SysConfig.ModelName, &modelnameInfo);
 
 #else
-	modelnameInfo.GetGunCount = 4;
+	modelnameInfo.GetGunCount = 1;
 
 #endif//DEBUG_STANDALONG
 
@@ -105,163 +135,781 @@ int main(void)
 	meterInitialize(METER_MODEL_LEM_L18005A);
 	
 	
+	//DEBUG_INFO("modelnameInfo.GetGunCount : %d \n", modelnameInfo.GetGunCount);
+	#ifndef DEBUG_STANDALONG
+	//if Power up and DC meter is runing (need stop)
+	for(uint8_t gun_index=0;gun_index<modelnameInfo.GetGunCount;gun_index++){
+		
+		readMeterStatusInfo(gun_index,&meter_status_info[gun_index]);
+		if(meter_status_info[gun_index].MeterStatusFlag.bits.transactionIsOnGoing == 1)
+		{
+			ShmSysConfigAndInfo->SysInfo.DcMeterTransactionAction[gun_index].ActionCmd = 2;
+			readMeterLegal(gun_index,&meter_transaction_Action[gun_index]);
+			strcpy((char*)ShmSysConfigAndInfo->SysInfo.DcMeterTransactionAction[gun_index].head.transactionId,(char*)meter_transaction_Action[gun_index].head.transactionId);
+		}
+	}
+	
+		printf("shm ");
+	DEBUG_INFO("shm ");
+	#endif
+	
+	printf("modelnameInfo.GetGunCount : %d \n", modelnameInfo.GetGunCount);
 	DEBUG_INFO("modelnameInfo.GetGunCount : %d \n", modelnameInfo.GetGunCount);
+	
 
+	
+	//uint8_t gun_index=0;
+	//meter_transaction_Action[0].ActionCmd = 2;
+	//strcpy(meter_transaction_Action[0].head.transactionId, "ddd5002");	
+
+	//strcpy(ShmSysConfigAndInfo->SysInfo.DcMeterReadTransactionRecord[0].head.transactionId, "12345678" );
+	//ShmSysConfigAndInfo->SysInfo.DcMeterReadTransactionRecord[0].ActionCmd = 1;
+	
 	// Main loop
 	for(;;)
 	{
 		for(uint8_t gun_index=0;gun_index<modelnameInfo.GetGunCount;gun_index++)
 		{
-			if(gun_index == 0)
-				meterIndex = 0;
-			meterIndex = gun_index;
 
 			if(modelnameInfo.ParsingInfo[gun_index].GunType != Gun_Type_AC)
 			{
-				meterApiAssign(meterIndex);
-				
-				for(pollingIndex=0;pollingIndex<4;pollingIndex++)
-				{
-					switch(pollingIndex)
+					#ifndef DEBUG_STANDALONG
+					meter_transaction_Action[gun_index].ActionCmd = ShmSysConfigAndInfo->SysInfo.DcMeterTransactionAction[gun_index].ActionCmd;
+					meter_read_transaction_record[gun_index].ActionCmd = ShmSysConfigAndInfo->SysInfo.DcMeterReadTransactionRecord[gun_index].ActionCmd;
+					meter_read_transaction_record[gun_index].OcmfInfoReady = ShmSysConfigAndInfo->SysInfo.DcMeterReadTransactionRecord[gun_index].OcmfInfoReady;
+					meter_transaction_Action[gun_index].OcmfInfoReady = ShmSysConfigAndInfo->SysInfo.DcMeterTransactionAction[gun_index].OcmfInfoReady;
+					#endif
+					
+					
+					
+					PR("for index : %d \n", gun_index);
+					//if Transaction Cmd				
+					if(meter_transaction_Action[gun_index].ActionCmd || meter_read_transaction_record[gun_index].ActionCmd)
 					{
-						case 0:
-							if(readCurrent(&meter_info[meterIndex]) != FAIL)
-							{
-								#ifndef DEBUG_STANDALONG
-								/*
-								 *	TODO:
-								 *		1. Synchronize data to share memory
-								 */
-								 
-								 ShmSysConfigAndInfo->SysInfo.DcMeterInfo[meterIndex].presentCurrent = meter_info[meterIndex].presentCurrent;
-								 #ifdef DEBUG_SHAREMEM_LOG
-								 DEBUG_INFO("shm Output current %d : %.3f A\n", meterIndex, ShmSysConfigAndInfo->SysInfo.DcMeterInfo[meterIndex].presentCurrent);
-								 #endif
-								 
-								#else
-								DEBUG_INFO("Output current %d : %.3f A\n", meterIndex, meter_info[meterIndex].presentCurrent);
-								#endif//DEBUG_STANDALONG
-								//pollingIndex++;
-								failCount[meterIndex] = 0;
-							}
-							else
+							//if start Transaction record
+							if(meter_transaction_Action[gun_index].ActionCmd == 1)
 							{
-								if(failCount[meterIndex] < 10)
-									failCount[meterIndex]++;
+									PR("<<<<<<<<<  meter_sync_time : %d  >>>>>>>>>\n", gun_index);
+									//first sync sys time
+									if(configure_meter_time(gun_index) != FAIL)
+									{
+											
+											//update transaction content
+											#ifndef DEBUG_STANDALONG											
+											strcpy((char*)meter_transaction_Action[gun_index].head.evseId, (char*)ShmSysConfigAndInfo->SysInfo.DcMeterTransactionAction[gun_index].head.evseId);
+											strcpy((char*)meter_transaction_Action[gun_index].head.transactionId,  (char*)ShmSysConfigAndInfo->SysInfo.DcMeterTransactionAction[gun_index].head.transactionId);
+											strcpy((char*)meter_transaction_Action[gun_index].head.clientId,  (char*)ShmSysConfigAndInfo->SysInfo.DcMeterTransactionAction[gun_index].head.clientId);
+											meter_transaction_Action[gun_index].head.tariffId =  ShmSysConfigAndInfo->SysInfo.DcMeterTransactionAction[gun_index].head.tariffId;
+											meter_transaction_Action[gun_index].head.cableId = ShmSysConfigAndInfo->SysInfo.DcMeterTransactionAction[gun_index].head.cableId;
+											strcpy((char*)meter_transaction_Action[gun_index].head.userData,  (char*)ShmSysConfigAndInfo->SysInfo.DcMeterTransactionAction[gun_index].head.userData);
+											#else
+											strcpy(meter_transaction_Action[gun_index].head.evseId, "evse45");
+											strcpy(meter_transaction_Action[gun_index].head.transactionId, "ddd5002");
+											strcpy(meter_transaction_Action[gun_index].head.clientId, "client1");
+											meter_transaction_Action[gun_index].head.tariffId = 2;
+											meter_transaction_Action[gun_index].head.cableId =3;
+											strcpy(meter_transaction_Action[gun_index].head.userData, "Phihong12");
+											#endif
+
+											PR(" ****** evseId : %s\n",meter_transaction_Action[gun_index].head.evseId);	
+											PR(" ****** transactionId : %s\n",meter_transaction_Action[gun_index].head.transactionId);	
+											PR(" ****** clientId : %s\n",meter_transaction_Action[gun_index].head.clientId);	
+											PR(" ****** tariffId : %d\n",meter_transaction_Action[gun_index].head.tariffId);
+											PR(" ****** clientId : %d\n",meter_transaction_Action[gun_index].head.cableId);
+											PR(" ****** userData : %s\n",meter_transaction_Action[gun_index].head.userData);
+																						
+																						
+											meterSyncTimeFailCount[gun_index] = 0;
+											#ifndef DEBUG_STANDALONG
+											ShmStatusCodeData->AlarmCode.AlarmEvents.bits.MeterSyncTimeError = OFF;
+											#endif 
+											
+											PR("<<<<<<<<<  meter_transaction_Action : %d  >>>>>>>>>\n", gun_index);
+											//start Transaction
+											if(startMeterTransaction(gun_index,&meter_transaction_Action[gun_index]) != FAIL)
+											{
+														#ifndef DEBUG_STANDALONG
+														/*
+														 *	TODO:
+														 *		1. Synchronize data to share memory
+														 */
+														//clear ocmf value
+														strcpy((char *) meter_transaction_Action[gun_index].transactionOCMF, "");
+														sprintf((char*)&ShmSysConfigAndInfo->SysInfo.DcMeterTransactionAction[gun_index].transactionOCMF,
+															"%s",meter_transaction_Action[gun_index].transactionOCMF);
+															
+														 #ifdef DEBUG_SHAREMEM_TRANSACTION_START_LOG
+
+														 #endif
+														 
+														#else
+
+														#endif//DEBUG_STANDALONG
+														
+														//clear OCMF info flag
+														meter_transaction_Action[gun_index].OcmfInfoReady = 0;
+							
+														failCount[gun_index] = 0;
+														startTransactionFailCount[gun_index] = 0;														
+														#ifndef DEBUG_STANDALONG
+														ShmStatusCodeData->AlarmCode.AlarmEvents.bits.MetertStartTransactionError = OFF;
+														#endif
+
+														//clear need action cmd
+														meter_transaction_Action[gun_index].ActionCmd = 0;
+														
+											}
+											else
+											{
+														if(failCount[gun_index] < 5){
+															failCount[gun_index]++;
+														}
+														
+														if(startTransactionFailCount[gun_index] < 5){
+															startTransactionFailCount[gun_index]++;
+														}else{
+															meter_transaction_Action[gun_index].ActionCmd = 0;
+															#ifndef DEBUG_STANDALONG
+															ShmStatusCodeData->AlarmCode.AlarmEvents.bits.MetertStartTransactionError = ON;
+															#endif
+														}
+											}
+										}
+										else
+										{
+												if(failCount[gun_index] < 5){
+													failCount[gun_index]++;
+												}
+												
+												if(meterSyncTimeFailCount[gun_index] < 5){
+													meterSyncTimeFailCount[gun_index]++;
+												}else{
+													meter_transaction_Action[gun_index].ActionCmd = 0;
+													#ifndef DEBUG_STANDALONG
+													ShmStatusCodeData->AlarmCode.AlarmEvents.bits.MeterSyncTimeError = ON;
+													#endif 
+														
+												}
+										}							
 							}
-							break;
-						case 1:
-							if(readVoltage(&meter_info[meterIndex]) != FAIL)
+
+							//if stop Transaction and record
+							if(meter_transaction_Action[gun_index].ActionCmd == 2)
 							{
-								#ifndef DEBUG_STANDALONG
-								/*
-								 *	TODO:
-								 *		1. Synchronize data to share memory
-								 */
-								 
-								ShmSysConfigAndInfo->SysInfo.DcMeterInfo[meterIndex].presetVoltage = meter_info[meterIndex].presetVoltage;
-								#ifdef DEBUG_SHAREMEM_LOG
-								DEBUG_INFO("shm Output voltage %d : %.3f V\n", meterIndex, ShmSysConfigAndInfo->SysInfo.DcMeterInfo[meterIndex].presetVoltage);
-								#endif
-								#else
-								DEBUG_INFO("Output voltage %d : %.3f V\n", meterIndex, meter_info[meterIndex].presetVoltage);
-								#endif//DEBUG_STANDALONG
-								//pollingIndex++;
-								failCount[meterIndex] = 0;
+									PR("<<<<<<<<<  stopMeterTransaction : %d >>>>>>>>>\n", gun_index);
+									if(stopMeterTransaction(gun_index,&meter_transaction_Action[gun_index],&meter_transaction_Result[gun_index]) != FAIL)
+									{
+												#ifndef DEBUG_STANDALONG
+												/*
+												 *	TODO:
+												 *		1. Synchronize data to share memory
+												 */
+												 
+												 ShmSysConfigAndInfo->SysInfo.DcMeterTransactionResult[gun_index].paginationCounter = 
+												 meter_transaction_Result[gun_index].paginationCounter;
+												 
+												sprintf((char*)&ShmSysConfigAndInfo->SysInfo.DcMeterTransactionResult[gun_index].head.transactionId,
+												"%s",meter_transaction_Result[gun_index].head.transactionId);										 
+												 
+												sprintf((char*)&ShmSysConfigAndInfo->SysInfo.DcMeterTransactionResult[gun_index].head.evseId,
+												"%s",meter_transaction_Result[gun_index].head.evseId);										 
+
+												sprintf((char*)&ShmSysConfigAndInfo->SysInfo.DcMeterTransactionResult[gun_index].head.clientId,
+												"%s",meter_transaction_Result[gun_index].head.clientId);										 
+												 
+												ShmSysConfigAndInfo->SysInfo.DcMeterTransactionResult[gun_index].head.tariffId = 
+												meter_transaction_Result[gun_index].head.tariffId;	
+												
+												ShmSysConfigAndInfo->SysInfo.DcMeterTransactionResult[gun_index].head.cableId = 
+												meter_transaction_Result[gun_index].head.cableId;	
+
+												sprintf((char*)&ShmSysConfigAndInfo->SysInfo.DcMeterTransactionResult[gun_index].head.userData,
+												"%s",meter_transaction_Result[gun_index].head.userData);										 
+												 
+												sprintf((char*)&ShmSysConfigAndInfo->SysInfo.DcMeterTransactionResult[gun_index].timestampStart,
+												"%s",meter_transaction_Result[gun_index].timestampStart);
+												
+												sprintf((char*)&ShmSysConfigAndInfo->SysInfo.DcMeterTransactionResult[gun_index].timestampStop,
+												"%s",meter_transaction_Result[gun_index].timestampStop);
+												
+												 ShmSysConfigAndInfo->SysInfo.DcMeterTransactionResult[gun_index].transactionDuration = 
+												 meter_transaction_Result[gun_index].transactionDuration;
+												
+												 ShmSysConfigAndInfo->SysInfo.DcMeterTransactionResult[gun_index].transactionStatus = 
+												 meter_transaction_Result[gun_index].transactionStatus;
+												
+												sprintf((char*)&ShmSysConfigAndInfo->SysInfo.DcMeterTransactionResult[gun_index].energyUnit,
+												"%s",meter_transaction_Result[gun_index].energyUnit);
+												
+												 ShmSysConfigAndInfo->SysInfo.DcMeterTransactionResult[gun_index].energyImport = 
+												 meter_transaction_Result[gun_index].energyImport;
+
+												 ShmSysConfigAndInfo->SysInfo.DcMeterTransactionResult[gun_index].energyImportTotalStart = 
+												 meter_transaction_Result[gun_index].energyImportTotalStart;										
+
+												 ShmSysConfigAndInfo->SysInfo.DcMeterTransactionResult[gun_index].energyImportTotalStop = 
+												 meter_transaction_Result[gun_index].energyImportTotalStop;
+
+												 ShmSysConfigAndInfo->SysInfo.DcMeterTransactionResult[gun_index].energyExport = 
+												 meter_transaction_Result[gun_index].energyExport;
+												 
+												 ShmSysConfigAndInfo->SysInfo.DcMeterTransactionResult[gun_index].energyExportTotalStart = 
+												 meter_transaction_Result[gun_index].energyExportTotalStart;
+
+												 ShmSysConfigAndInfo->SysInfo.DcMeterTransactionResult[gun_index].energyExportTotalStop = 
+												 meter_transaction_Result[gun_index].energyExportTotalStop;
+												 
+												sprintf((char*)&ShmSysConfigAndInfo->SysInfo.DcMeterTransactionResult[gun_index].signature,
+												"%s",meter_transaction_Result[gun_index].signature);										 
+												 
+			
+														#ifdef DEBUG_SHAREMEM_TRANSACTION_RESULT_LOG
+														DEBUG_INFO(" ================================= ShareMem Transaction Result : %d ================================= \n",gun_index);
+														DEBUG_INFO(" %-26s : %d\n", "paginationCounter", ShmSysConfigAndInfo->SysInfo.DcMeterTransactionResult[gun_index].paginationCounter);										
+														DEBUG_INFO(" %-26s : %s\n", "transactionId", ShmSysConfigAndInfo->SysInfo.DcMeterTransactionResult[gun_index].head.transactionId);										
+														DEBUG_INFO(" %-26s : %s\n", "evseId", ShmSysConfigAndInfo->SysInfo.DcMeterTransactionResult[gun_index].head.evseId);										
+														DEBUG_INFO(" %-26s : %s\n", "clientId", ShmSysConfigAndInfo->SysInfo.DcMeterTransactionResult[gun_index].head.clientId);										
+														DEBUG_INFO(" %-26s : %d\n", "tariffId", ShmSysConfigAndInfo->SysInfo.DcMeterTransactionResult[gun_index].head.tariffId);
+														DEBUG_INFO(" %-26s : %d\n", "cableId", ShmSysConfigAndInfo->SysInfo.DcMeterTransactionResult[gun_index].head.cableId);
+														DEBUG_INFO(" %-26s : %s\n", "userData", ShmSysConfigAndInfo->SysInfo.DcMeterTransactionResult[gun_index].head.userData);										
+														DEBUG_INFO(" %-26s : %s\n", "timestampStart", ShmSysConfigAndInfo->SysInfo.DcMeterTransactionResult[gun_index].timestampStart);
+														DEBUG_INFO(" %-26s : %s\n", "timestampStop", ShmSysConfigAndInfo->SysInfo.DcMeterTransactionResult[gun_index].timestampStop);
+														DEBUG_INFO(" %-26s : %d\n", "transactionDuration", ShmSysConfigAndInfo->SysInfo.DcMeterTransactionResult[gun_index].transactionDuration);
+														DEBUG_INFO(" %-26s : %d\n", "transactionStatus", ShmSysConfigAndInfo->SysInfo.DcMeterTransactionResult[gun_index].transactionStatus);
+														DEBUG_INFO(" %-26s : %s\n", "energyUnit", ShmSysConfigAndInfo->SysInfo.DcMeterTransactionResult[gun_index].energyUnit);
+														DEBUG_INFO(" %-26s : %.3f\n", "energyImport", ShmSysConfigAndInfo->SysInfo.DcMeterTransactionResult[gun_index].energyImport);
+														DEBUG_INFO(" %-26s : %.3f\n", "energyImportTotalStart", ShmSysConfigAndInfo->SysInfo.DcMeterTransactionResult[gun_index].energyImportTotalStart);
+														DEBUG_INFO(" %-26s : %.3f\n", "energyImportTotalStop", ShmSysConfigAndInfo->SysInfo.DcMeterTransactionResult[gun_index].energyImportTotalStop);
+														DEBUG_INFO(" %-26s : %.3f\n", "energyExport", ShmSysConfigAndInfo->SysInfo.DcMeterTransactionResult[gun_index].energyExport);
+														DEBUG_INFO(" %-26s : %.3f\n", "energyExportTotalStart", ShmSysConfigAndInfo->SysInfo.DcMeterTransactionResult[gun_index].energyExportTotalStart);
+														DEBUG_INFO(" %-26s : %.3f\n", "energyExportTotalStop", ShmSysConfigAndInfo->SysInfo.DcMeterTransactionResult[gun_index].energyExportTotalStop);
+														DEBUG_INFO(" %-26s : %s\n\n\n\n\n\n", "signature", ShmSysConfigAndInfo->SysInfo.DcMeterTransactionResult[gun_index].signature);												
+														#endif
+												 
+												#else
+														#ifdef DEBUG_STANDALONE_TRANSACTION_RESULT_LOG
+														DEBUG_INFO(" ================================= Standalone Transaction Result : %d ================================= \n",gun_index);
+														DEBUG_INFO(" %-26s : %d\n", "paginationCounter", meter_transaction_Result[gun_index].paginationCounter);										
+														DEBUG_INFO(" %-26s : %s\n", "transactionId", meter_transaction_Result[gun_index].head.transactionId);										
+														DEBUG_INFO(" %-26s : %s\n", "evseId", meter_transaction_Result[gun_index].head.evseId);										
+														DEBUG_INFO(" %-26s : %s\n", "clientId", meter_transaction_Result[gun_index].head.clientId);										
+														DEBUG_INFO(" %-26s : %d\n", "tariffId", meter_transaction_Result[gun_index].head.tariffId);
+														DEBUG_INFO(" %-26s : %d\n", "cableId", meter_transaction_Result[gun_index].head.cableId);
+														DEBUG_INFO(" %-26s : %s\n", "userData", meter_transaction_Result[gun_index].head.userData);										
+														DEBUG_INFO(" %-26s : %s\n", "timestampStart", meter_transaction_Result[gun_index].timestampStart);
+														DEBUG_INFO(" %-26s : %s\n", "timestampStop", meter_transaction_Result[gun_index].timestampStop);
+														DEBUG_INFO(" %-26s : %d\n", "transactionDuration", meter_transaction_Result[gun_index].transactionDuration);
+														DEBUG_INFO(" %-26s : %d\n", "transactionStatus", meter_transaction_Result[gun_index].transactionStatus);
+														DEBUG_INFO(" %-26s : %s\n", "energyUnit", meter_transaction_Result[gun_index].energyUnit);
+														DEBUG_INFO(" %-26s : %.3f\n", "energyImport", meter_transaction_Result[gun_index].energyImport);
+														DEBUG_INFO(" %-26s : %.3f\n", "energyImportTotalStart", meter_transaction_Result[gun_index].energyImportTotalStart);
+														DEBUG_INFO(" %-26s : %.3f\n", "energyImportTotalStop", meter_transaction_Result[gun_index].energyImportTotalStop);
+														DEBUG_INFO(" %-26s : %.3f\n", "energyExport", meter_transaction_Result[gun_index].energyExport);
+														DEBUG_INFO(" %-26s : %.3f\n", "energyExportTotalStart", meter_transaction_Result[gun_index].energyExportTotalStart);
+														DEBUG_INFO(" %-26s : %.3f\n", "energyExportTotalStop", gun_index, meter_transaction_Result[gun_index].energyExportTotalStop);
+														DEBUG_INFO(" %-26s : %s\n\n\n\n\n\n", "signature", meter_transaction_Result[gun_index].signature);
+														#endif
+												#endif//DEBUG_STANDALONG
+					
+												failCount[gun_index] = 0;
+												stopTransactionFailCount[gun_index] = 0;
+												#ifndef DEBUG_STANDALONG
+												ShmStatusCodeData->AlarmCode.AlarmEvents.bits.MetertStopTransactionError = OFF;
+												#endif 
+													
+												PR("<<<<<<<<<  Get Transaction OCMF : %d >>>>>>>>>\n", gun_index);
+												//auto OCMF
+												if(readMeterTransactionOCMF(gun_index,&meter_transaction_Action[gun_index]) != FAIL)
+												{
+															#ifndef DEBUG_STANDALONG
+															/*
+															 *	TODO:
+															 *		1. Synchronize data to share memory
+															 */
+															 
+														
+															sprintf((char*)&ShmSysConfigAndInfo->SysInfo.DcMeterTransactionAction[gun_index].transactionOCMF,
+															"%s",meter_transaction_Action[gun_index].transactionOCMF);
+															
+															PR("OCMF : %s , %s\n", ShmSysConfigAndInfo->SysInfo.DcMeterTransactionAction[gun_index].transactionOCMF,
+																				   meter_transaction_Action[gun_index].transactionOCMF);
+															
+																	#ifdef DEBUG_SHAREMEM_TRANSACTION_RESULT_LOG
+																	DEBUG_INFO("shm transactionOCMF %d : %s\n", gun_index, ShmSysConfigAndInfo->SysInfo.DcMeterTransactionAction[gun_index].transactionOCMF);															
+																	#endif
+															 
+															#else
+															
+																PR("OCMF : %s\n",meter_transaction_Action[gun_index].transactionOCMF);
+																				   
+																	#ifdef DEBUG_STANDALONE_TRANSACTION_RESULT_LOG
+																	DEBUG_INFO("transactionOCMF %d : %s\n", gun_index, meter_transaction_Action[gun_index].transactionOCMF);
+																	#endif													
+															#endif//DEBUG_STANDALONG	
+															
+															meter_transaction_Action[gun_index].OcmfInfoReady = 1;
+					
+															failCount[gun_index] = 0;
+															getTransactionOcmfFailCount[gun_index] = 0;
+															meter_transaction_Action[gun_index].ActionCmd = 0;
+															#ifndef DEBUG_STANDALONG
+															ShmStatusCodeData->AlarmCode.AlarmEvents.bits.MetertGetTransactionOcmfError = OFF;
+															#endif 
+												}
+												else
+												{
+													
+															meter_transaction_Action[gun_index].OcmfInfoReady = 0;
+															
+															if(failCount[gun_index] < 5){
+																failCount[gun_index]++;
+															}
+															
+															if(getTransactionOcmfFailCount[gun_index] < 5){
+																getTransactionOcmfFailCount[gun_index]++;
+															}else{
+																meter_transaction_Action[gun_index].ActionCmd = 0;
+																#ifndef DEBUG_STANDALONG
+																ShmStatusCodeData->AlarmCode.AlarmEvents.bits.MetertGetTransactionOcmfError = ON;
+																#endif 																	
+															}
+												}				
+									}
+									else
+									{
+												if(failCount[gun_index] < 5){
+													failCount[gun_index]++;
+												}
+												
+												if(stopTransactionFailCount[gun_index] < 5){
+													stopTransactionFailCount[gun_index]++;
+												}else{
+													meter_transaction_Action[gun_index].ActionCmd = 0;
+													#ifndef DEBUG_STANDALONG
+													ShmStatusCodeData->AlarmCode.AlarmEvents.bits.MetertStopTransactionError = ON;
+													#endif 
+														
+												}
+									}
 							}
-							else
+
+
+							//if stop Transaction and record
+							if(meter_read_transaction_record[gun_index].ActionCmd == 1)
 							{
-								if(failCount[meterIndex] < 10)
-									failCount[meterIndex]++;
+												meter_read_transaction_record[gun_index].OcmfInfoReady = 0;
+												
+												#ifndef DEBUG_STANDALONG
+												strcpy((char*)meter_read_transaction_record[gun_index].head.transactionId,  (char*)ShmSysConfigAndInfo->SysInfo.DcMeterReadTransactionRecord[gun_index].head.transactionId);
+												#endif
+												
+												PR("<<<<<<<<<  Get Record Transaction OCMF : %d - ID : %s>>>>>>>>>\n", gun_index,meter_read_transaction_record[gun_index].head.transactionId);
+												//auto OCMF
+												if(readMeterTransactionOCMF(gun_index,&meter_read_transaction_record[gun_index]) != FAIL)
+												{
+															#ifndef DEBUG_STANDALONG
+															/*
+															 *	TODO:
+															 *		1. Synchronize data to share memory
+															 */
+															 
+														
+															sprintf((char*)&ShmSysConfigAndInfo->SysInfo.DcMeterReadTransactionRecord[gun_index].transactionOCMF,
+															"%s",meter_read_transaction_record[gun_index].transactionOCMF);
+															
+															PR("OCMF : %s ,%s\n", ShmSysConfigAndInfo->SysInfo.DcMeterReadTransactionRecord[gun_index].transactionOCMF,
+																	      	   	  meter_read_transaction_record[gun_index].transactionOCMF);
+
+															
+																	#ifdef DEBUG_SHAREMEM_TRANSACTION_RESULT_LOG
+																	DEBUG_INFO("shm transactionOCMF %d : %s\n", gun_index, ShmSysConfigAndInfo->SysInfo.DcMeterReadTransactionRecord[gun_index].transactionOCMF);															
+																	#endif
+																	 
+																	#else
+																			#ifdef DEBUG_STANDALONE_TRANSACTION_RESULT_LOG
+																			DEBUG_INFO("transactionOCMF %d : %s\n", gun_index, meter_read_transaction_record[gun_index].transactionOCMF);
+																			#endif													
+																	#endif//DEBUG_STANDALONG	
+																	
+																	meter_read_transaction_record[gun_index].OcmfInfoReady = 1;
+							
+																	failCount[gun_index] = 0;
+																	getTransactionOcmfFailCount[gun_index] = 0;
+																	meter_read_transaction_record[gun_index].ActionCmd = 0;
+																	#ifndef DEBUG_STANDALONG
+																	ShmStatusCodeData->AlarmCode.AlarmEvents.bits.MetertGetTransactionOcmfError = OFF;
+																	#endif 
+												}
+												else
+												{
+													
+															meter_read_transaction_record[gun_index].OcmfInfoReady = 0;
+															
+															if(failCount[gun_index] < 5){
+																failCount[gun_index]++;
+															}
+															
+															if(getTransactionOcmfFailCount[gun_index] < 5){
+																getTransactionOcmfFailCount[gun_index]++;
+															}else{
+																meter_read_transaction_record[gun_index].ActionCmd = 0;
+																getTransactionOcmfFailCount[gun_index] = 0;
+																#ifndef DEBUG_STANDALONG
+																meter_read_transaction_record[gun_index].OcmfInfoReady = 2;
+																//ShmStatusCodeData->AlarmCode.AlarmEvents.bits.MetertGetTransactionOcmfError = ON;
+																#endif 																	
+															}
+												}	
+
+
+								
 							}
-							break;
-						case 2:
-							if(readPower(&meter_info[meterIndex]) != FAIL)
+														
+							#ifndef DEBUG_STANDALONG
+							ShmSysConfigAndInfo->SysInfo.DcMeterReadTransactionRecord[gun_index].ActionCmd = meter_read_transaction_record[gun_index].ActionCmd;
+							ShmSysConfigAndInfo->SysInfo.DcMeterTransactionAction[gun_index].ActionCmd = meter_transaction_Action[gun_index].ActionCmd;
+							ShmSysConfigAndInfo->SysInfo.DcMeterReadTransactionRecord[gun_index].OcmfInfoReady = meter_read_transaction_record[gun_index].OcmfInfoReady;
+							ShmSysConfigAndInfo->SysInfo.DcMeterTransactionAction[gun_index].OcmfInfoReady = meter_transaction_Action[gun_index].OcmfInfoReady;
+							#endif
+						
+					}					
+					else
+					{		
+
+							if(readMeterLivemeasure(gun_index,&meter_info[gun_index]) != FAIL)
 							{
-								#ifndef DEBUG_STANDALONG
-								/*
-								 *	TODO:
-								 *		1. Synchronize data to share memory
-								 */
-								 
-								ShmSysConfigAndInfo->SysInfo.DcMeterInfo[meterIndex].presentPower = meter_info[meterIndex].presentPower;
-								#ifdef DEBUG_SHAREMEM_LOG
-								DEBUG_INFO("shm Output power %d : %.3f kw\n", meterIndex, ShmSysConfigAndInfo->SysInfo.DcMeterInfo[meterIndex].presentPower);
-								#endif
-								#else
-								DEBUG_INFO("Output power %d : %.3f kw\n", meterIndex, meter_info[meterIndex].presentPower);
-								#endif//DEBUG_STANDALONG
-								//pollingIndex++;
-								failCount[meterIndex] = 0;
+										#ifndef DEBUG_STANDALONG
+										/*
+										 *	TODO:
+										 *		1. Synchronize data to share memory
+										 */
+										ShmSysConfigAndInfo->SysInfo.DcMeterInfo[gun_index].presetVoltage = meter_info[gun_index].presetVoltage;
+										ShmSysConfigAndInfo->SysInfo.DcMeterInfo[gun_index].presentCurrent = meter_info[gun_index].presentCurrent;
+										ShmSysConfigAndInfo->SysInfo.DcMeterInfo[gun_index].presentPower = meter_info[gun_index].presentPower;
+										ShmSysConfigAndInfo->SysInfo.DcMeterInfo[gun_index].totlizeImportEnergy = meter_info[gun_index].totlizeImportEnergy;
+										ShmSysConfigAndInfo->SysInfo.DcMeterInfo[gun_index].totlizeExportEnergy = meter_info[gun_index].totlizeExportEnergy;
+										sprintf((char*)&ShmSysConfigAndInfo->SysInfo.DcMeterInfo[gun_index].timestamp, "%s",meter_info[gun_index].timestamp);
+										 
+											#ifdef DEBUG_SHAREMEM_LIVEMEASURE_LOG
+											//evern 60s record 1s
+											if((RecordLogTimerCount % 60 == 0)
+											{
+											DEBUG_INFO(" ================================= ShareMem Livemeasure : %d ================================= \n",gun_index);
+											DEBUG_INFO(" %-26s : %.3f V\n", "Output voltage", ShmSysConfigAndInfo->SysInfo.DcMeterInfo[gun_index].presetVoltage);
+											DEBUG_INFO(" %-26s : %.3f A\n", "Output current", ShmSysConfigAndInfo->SysInfo.DcMeterInfo[gun_index].presentCurrent);
+											DEBUG_INFO(" %-26s : %.3f kw\n", "Output power", ShmSysConfigAndInfo->SysInfo.DcMeterInfo[gun_index].presentPower);
+											DEBUG_INFO(" %-26s : %.3f kwh\n", "Totalize import energy", ShmSysConfigAndInfo->SysInfo.DcMeterInfo[gun_index].totlizeImportEnergy);
+											DEBUG_INFO(" %-26s : %.3f kwh\n", "Totalize export energy", ShmSysConfigAndInfo->SysInfo.DcMeterInfo[gun_index].totlizeExportEnergy);
+											DEBUG_INFO(" %-26s : %s\n\n\n\n\n\n", "timestamp", ShmSysConfigAndInfo->SysInfo.DcMeterInfo[gun_index].timestamp);
+											}
+											#endif
+										 
+										#else
+										
+											#ifdef DEBUG_STANDALONE_LIVEMEASURE_LOG
+											DEBUG_INFO(" ================================= Standalone Livemeasure : %d ================================= \n",gun_index);
+											DEBUG_INFO(" %-26s : %.3f V\n", "Output voltage", meter_info[gun_index].presetVoltage);
+											DEBUG_INFO(" %-26s : %.3f A\n", "Output current", meter_info[gun_index].presentCurrent);
+											DEBUG_INFO(" %-26s : %.3f kw\n", "Output power", meter_info[gun_index].presentPower);
+											DEBUG_INFO(" %-26s : %.3f kwh\n", "Totalize import energy", meter_info[gun_index].totlizeImportEnergy);   
+											DEBUG_INFO(" %-26s : %.3f kwh\n", "Totalize export energy", meter_info[gun_index].totlizeExportEnergy);
+											DEBUG_INFO(" %-26s : %s\n\n\n\n\n\n", "timestamp", meter_info[gun_index].timestamp);
+											#endif
+											
+										#endif//DEBUG_STANDALONG
+			
+										failCount[gun_index] = 0;
 							}
 							else
 							{
-								if(failCount[meterIndex] < 10)
-									failCount[meterIndex]++;
+										PR("read Livemeasure fail : %d \n", gun_index);
+										if(failCount[gun_index] < 5)
+											failCount[gun_index]++;
 							}
-							break;
-						case 3:
-							if(readEnergy(&meter_info[meterIndex]) != FAIL)
+
+
+							if(readMeterStatusInfo(gun_index,&meter_status_info[gun_index]) != FAIL)
 							{
-								#ifndef DEBUG_STANDALONG
-								/*
-								 *	TODO:
-								 *		1. Synchronize data to share memory
-								 */
-								 
-								ShmSysConfigAndInfo->SysInfo.DcMeterInfo[meterIndex].totlizeImportEnergy = meter_info[meterIndex].totlizeImportEnergy;
-								#ifdef DEBUG_SHAREMEM_LOG
-								DEBUG_INFO("shm Totalize import energy %d : %.3f kwh\n", meterIndex, ShmSysConfigAndInfo->SysInfo.DcMeterInfo[meterIndex].totlizeImportEnergy);
-								#endif
-								ShmSysConfigAndInfo->SysInfo.DcMeterInfo[meterIndex].totlizeExportEnergy = meter_info[meterIndex].totlizeExportEnergy;
-								#ifdef DEBUG_SHAREMEM_LOG
-								DEBUG_INFO("shm Totalize export energy %d : %.3f kwh\n", meterIndex, ShmSysConfigAndInfo->SysInfo.DcMeterInfo[meterIndex].totlizeExportEnergy);
-								#endif
-								#else
-								DEBUG_INFO("Totalize import energy %d : %.3f kwh\n", meterIndex, meter_info[meterIndex].totlizeImportEnergy);   
-								DEBUG_INFO("Totalize export energy %d : %.3f kwh\n", meterIndex, meter_info[meterIndex].totlizeExportEnergy);
-								#endif//DEBUG_STANDALONG
-								//pollingIndex++;
-								failCount[meterIndex] = 0;
+										//PR("run readMeterStatusInfo : %d \n", gun_index);
+										#ifndef DEBUG_STANDALONG
+										/*
+										 *	TODO:
+										 *		1. Synchronize data to share memory
+										 */
+										ShmSysConfigAndInfo->SysInfo.DcMeterStatusInfo[gun_index].StatusValue = meter_status_info[gun_index].StatusValue;
+										 
+										ShmSysConfigAndInfo->SysInfo.DcMeterStatusInfo[gun_index].MeterStatusFlag.bits.suLinkStatusIsOk = 
+										meter_status_info[gun_index].MeterStatusFlag.bits.suLinkStatusIsOk;
+
+										ShmSysConfigAndInfo->SysInfo.DcMeterStatusInfo[gun_index].MeterStatusFlag.bits.muFatalErrorOccured = 
+										meter_status_info[gun_index].MeterStatusFlag.bits.muFatalErrorOccured;
+										 
+										ShmSysConfigAndInfo->SysInfo.DcMeterStatusInfo[gun_index].MeterStatusFlag.bits.transactionIsOnGoing = 
+										meter_status_info[gun_index].MeterStatusFlag.bits.transactionIsOnGoing;
+
+										ShmSysConfigAndInfo->SysInfo.DcMeterStatusInfo[gun_index].MeterStatusFlag.bits.tamperingIsDetected = 
+										meter_status_info[gun_index].MeterStatusFlag.bits.tamperingIsDetected;
+
+										ShmSysConfigAndInfo->SysInfo.DcMeterStatusInfo[gun_index].MeterStatusFlag.bits.timeSyncStatusIsOk = 
+										meter_status_info[gun_index].MeterStatusFlag.bits.timeSyncStatusIsOk;
+										 
+										ShmSysConfigAndInfo->SysInfo.DcMeterStatusInfo[gun_index].MeterStatusFlag.bits.overTemperatureIsDetected = 
+										meter_status_info[gun_index].MeterStatusFlag.bits.overTemperatureIsDetected;
+										 
+										ShmSysConfigAndInfo->SysInfo.DcMeterStatusInfo[gun_index].MeterStatusFlag.bits.reversedVoltage = 
+										meter_status_info[gun_index].MeterStatusFlag.bits.reversedVoltage;
+										 
+										ShmSysConfigAndInfo->SysInfo.DcMeterStatusInfo[gun_index].MeterStatusFlag.bits.suMeasureFailureOccurred = 
+										meter_status_info[gun_index].MeterStatusFlag.bits.suMeasureFailureOccurred;
+										 								 
+										sprintf((char*)&ShmSysConfigAndInfo->SysInfo.DcMeterStatusInfo[gun_index].applicationFirmwareVersion,
+										"%s",meter_status_info[gun_index].applicationFirmwareVersion);
+										  
+										sprintf((char*)&ShmSysConfigAndInfo->SysInfo.DcMeterStatusInfo[gun_index].applicationFirmwareAuthTag,
+										"%s",meter_status_info[gun_index].applicationFirmwareAuthTag);
+										 
+										sprintf((char*)&ShmSysConfigAndInfo->SysInfo.DcMeterStatusInfo[gun_index].legalFirmwareVersion,
+										"%s",meter_status_info[gun_index].legalFirmwareVersion);
+										
+										sprintf((char*)&ShmSysConfigAndInfo->SysInfo.DcMeterStatusInfo[gun_index].legalFirmwareAuthTag,
+										"%s",meter_status_info[gun_index].legalFirmwareAuthTag);
+										 
+										sprintf((char*)&ShmSysConfigAndInfo->SysInfo.DcMeterStatusInfo[gun_index].sensorFirmwareVersion,
+										"%s",meter_status_info[gun_index].sensorFirmwareVersion);								
+
+										sprintf((char*)&ShmSysConfigAndInfo->SysInfo.DcMeterStatusInfo[gun_index].sensorFirmwareCrc,
+										"%s",meter_status_info[gun_index].sensorFirmwareCrc);
+										
+										sprintf((char*)&ShmSysConfigAndInfo->SysInfo.DcMeterStatusInfo[gun_index].ipAddress,
+										"%s",meter_status_info[gun_index].ipAddress);
+										 
+										sprintf((char*)&ShmSysConfigAndInfo->SysInfo.DcMeterStatusInfo[gun_index].meterId,
+										"%s",meter_status_info[gun_index].meterId);
+										
+										ShmSysConfigAndInfo->SysInfo.DcMeterStatusInfo[gun_index].MeterErrorFlag.bits.muInitIsFailed = 
+										meter_status_info[gun_index].MeterErrorFlag.bits.muInitIsFailed;
+
+										ShmSysConfigAndInfo->SysInfo.DcMeterStatusInfo[gun_index].MeterErrorFlag.bits.suStateIsInvalid = 
+										meter_status_info[gun_index].MeterErrorFlag.bits.suStateIsInvalid;
+										 
+										ShmSysConfigAndInfo->SysInfo.DcMeterStatusInfo[gun_index].MeterErrorFlag.bits.versionCheckIsFailed = 
+										meter_status_info[gun_index].MeterErrorFlag.bits.versionCheckIsFailed;
+
+										ShmSysConfigAndInfo->SysInfo.DcMeterStatusInfo[gun_index].MeterErrorFlag.bits.muRngInitIsFailed = 
+										meter_status_info[gun_index].MeterErrorFlag.bits.muRngInitIsFailed;
+
+										ShmSysConfigAndInfo->SysInfo.DcMeterStatusInfo[gun_index].MeterErrorFlag.bits.muDataIntegrityIsFailed = 
+										meter_status_info[gun_index].MeterErrorFlag.bits.muDataIntegrityIsFailed;
+										 
+										ShmSysConfigAndInfo->SysInfo.DcMeterStatusInfo[gun_index].MeterErrorFlag.bits.muFwIntegrityIsFailed = 
+										meter_status_info[gun_index].MeterErrorFlag.bits.muFwIntegrityIsFailed;
+																		
+										ShmSysConfigAndInfo->SysInfo.DcMeterStatusInfo[gun_index].MeterErrorFlag.bits.suIntegrityIsFailed = 
+										meter_status_info[gun_index].MeterErrorFlag.bits.suIntegrityIsFailed;
+
+										ShmSysConfigAndInfo->SysInfo.DcMeterStatusInfo[gun_index].MeterErrorFlag.bits.logbookIntegrityIsFailed = 
+										meter_status_info[gun_index].MeterErrorFlag.bits.logbookIntegrityIsFailed;
+										 
+										ShmSysConfigAndInfo->SysInfo.DcMeterStatusInfo[gun_index].MeterErrorFlag.bits.logbookIsFull = 
+										meter_status_info[gun_index].MeterErrorFlag.bits.logbookIsFull;								
+										
+										ShmSysConfigAndInfo->SysInfo.DcMeterStatusInfo[gun_index].MeterErrorFlag.bits.memoryAccessIsFailed = 
+										meter_status_info[gun_index].MeterErrorFlag.bits.memoryAccessIsFailed;
+										 
+										ShmSysConfigAndInfo->SysInfo.DcMeterStatusInfo[gun_index].MeterErrorFlag.bits.muStateIsFailed = 
+										meter_status_info[gun_index].MeterErrorFlag.bits.muStateIsFailed;
+										
+										sprintf((char*)&ShmSysConfigAndInfo->SysInfo.DcMeterStatusInfo[gun_index].publicKey,
+										"%s",meter_status_info[gun_index].publicKey);
+										 
+										sprintf((char*)&ShmSysConfigAndInfo->SysInfo.DcMeterStatusInfo[gun_index].publicKeyOcmf,
+										"%s",meter_status_info[gun_index].publicKeyOcmf);								
+										
+										ShmSysConfigAndInfo->SysInfo.DcMeterStatusInfo[gun_index].indexOfLastTransaction = meter_status_info[gun_index].indexOfLastTransaction;
+										ShmSysConfigAndInfo->SysInfo.DcMeterStatusInfo[gun_index].numberOfStoredTransactions = meter_status_info[gun_index].numberOfStoredTransactions;							
+
+												#ifdef DEBUG_SHAREMEM_STATUS_INFO_LOG	
+												//evern 60s record 1s
+												if((RecordLogTimerCount % 60 == 0)
+												{
+												DEBUG_INFO(" ================================= ShareMem Status info : %d ================================= \n",gun_index);
+												DEBUG_INFO(" %-26s : %d \n", "status-value",ShmSysConfigAndInfo->SysInfo.DcMeterStatusInfo[gun_index].StatusValue);
+												DEBUG_INFO(" %-26s : %d \n", "b-suLinkStatusIsOk",ShmSysConfigAndInfo->SysInfo.DcMeterStatusInfo[gun_index].MeterStatusFlag.bits.suLinkStatusIsOk);
+												DEBUG_INFO(" %-26s : %d \n", "b-muFatalErrorOccured",ShmSysConfigAndInfo->SysInfo.DcMeterStatusInfo[gun_index].MeterStatusFlag.bits.muFatalErrorOccured);
+												DEBUG_INFO(" %-26s : %d \n", "b-transactionIsOnGoing",ShmSysConfigAndInfo->SysInfo.DcMeterStatusInfo[gun_index].MeterStatusFlag.bits.transactionIsOnGoing);
+												DEBUG_INFO(" %-26s : %d \n", "b-tamperingIsDetected",ShmSysConfigAndInfo->SysInfo.DcMeterStatusInfo[gun_index].MeterStatusFlag.bits.tamperingIsDetected);
+												DEBUG_INFO(" %-26s : %d \n", "b-timeSyncStatusIsOk",ShmSysConfigAndInfo->SysInfo.DcMeterStatusInfo[gun_index].MeterStatusFlag.bits.timeSyncStatusIsOk);
+												DEBUG_INFO(" %-26s : %d \n", "b-overTemperatureIsDetected",ShmSysConfigAndInfo->SysInfo.DcMeterStatusInfo[gun_index].MeterStatusFlag.bits.overTemperatureIsDetected);
+												DEBUG_INFO(" %-26s : %d \n", "b-reversedVoltage",ShmSysConfigAndInfo->SysInfo.DcMeterStatusInfo[gun_index].MeterStatusFlag.bits.reversedVoltage);
+												DEBUG_INFO(" %-26s : %d \n", "b-suMeasureFailureOccurred",ShmSysConfigAndInfo->SysInfo.DcMeterStatusInfo[gun_index].MeterStatusFlag.bits.suMeasureFailureOccurred);
+												DEBUG_INFO(" %-26s : %s \n", "applicationFirmwareVersion",ShmSysConfigAndInfo->SysInfo.DcMeterStatusInfo[gun_index].applicationFirmwareVersion);
+												DEBUG_INFO(" %-26s : %s \n", "applicationFirmwareAuthTag",ShmSysConfigAndInfo->SysInfo.DcMeterStatusInfo[gun_index].applicationFirmwareAuthTag);
+												DEBUG_INFO(" %-26s : %s \n", "legalFirmwareVersion",ShmSysConfigAndInfo->SysInfo.DcMeterStatusInfo[gun_index].legalFirmwareVersion);
+												DEBUG_INFO(" %-26s : %s \n", "applicationFirmwareAuthTag",ShmSysConfigAndInfo->SysInfo.DcMeterStatusInfo[gun_index].legalFirmwareAuthTag);
+												DEBUG_INFO(" %-26s : %s \n", "sensorFirmwareVersion",ShmSysConfigAndInfo->SysInfo.DcMeterStatusInfo[gun_index].sensorFirmwareVersion);
+												DEBUG_INFO(" %-26s : %s \n", "sensorFirmwareCrc",ShmSysConfigAndInfo->SysInfo.DcMeterStatusInfo[gun_index].sensorFirmwareCrc);
+												DEBUG_INFO(" %-26s : %s \n", "ipAddress",ShmSysConfigAndInfo->SysInfo.DcMeterStatusInfo[gun_index].ipAddress);
+												DEBUG_INFO(" %-26s : %s \n", "meterId",ShmSysConfigAndInfo->SysInfo.DcMeterStatusInfo[gun_index].meterId);
+												DEBUG_INFO(" %-26s : %d \n", "b-muInitIsFailed",ShmSysConfigAndInfo->SysInfo.DcMeterStatusInfo[gun_index].MeterErrorFlag.bits.muInitIsFailed);
+												DEBUG_INFO(" %-26s : %d \n", "b-suStateIsInvalid",ShmSysConfigAndInfo->SysInfo.DcMeterStatusInfo[gun_index].MeterErrorFlag.bits.suStateIsInvalid);
+												DEBUG_INFO(" %-26s : %d \n", "b-versionCheckIsFailed",ShmSysConfigAndInfo->SysInfo.DcMeterStatusInfo[gun_index].MeterErrorFlag.bits.versionCheckIsFailed);
+												DEBUG_INFO(" %-26s : %d \n", "b-muRngInitIsFailed",ShmSysConfigAndInfo->SysInfo.DcMeterStatusInfo[gun_index].MeterErrorFlag.bits.muRngInitIsFailed);
+												DEBUG_INFO(" %-26s : %d \n", "b-muDataIntegrityIsFailed",ShmSysConfigAndInfo->SysInfo.DcMeterStatusInfo[gun_index].MeterErrorFlag.bits.muDataIntegrityIsFailed);
+												DEBUG_INFO(" %-26s : %d \n", "b-muFwIntegrityIsFailed",ShmSysConfigAndInfo->SysInfo.DcMeterStatusInfo[gun_index].MeterErrorFlag.bits.muFwIntegrityIsFailed);
+												DEBUG_INFO(" %-26s : %d \n", "b-suIntegrityIsFailed",ShmSysConfigAndInfo->SysInfo.DcMeterStatusInfo[gun_index].MeterErrorFlag.bits.suIntegrityIsFailed);
+												DEBUG_INFO(" %-26s : %d \n", "b-logbookIntegrityIsFailed",ShmSysConfigAndInfo->SysInfo.DcMeterStatusInfo[gun_index].MeterErrorFlag.bits.logbookIntegrityIsFailed);
+												DEBUG_INFO(" %-26s : %d \n", "b-logbookIsFull",ShmSysConfigAndInfo->SysInfo.DcMeterStatusInfo[gun_index].MeterErrorFlag.bits.logbookIsFull);
+												DEBUG_INFO(" %-26s : %d \n", "b-memoryAccessIsFailed",ShmSysConfigAndInfo->SysInfo.DcMeterStatusInfo[gun_index].MeterErrorFlag.bits.memoryAccessIsFailed);
+												DEBUG_INFO(" %-26s : %d \n", "b-muStateIsFailed",ShmSysConfigAndInfo->SysInfo.DcMeterStatusInfo[gun_index].MeterErrorFlag.bits.muStateIsFailed);
+												DEBUG_INFO(" %-26s : %s \n", "publicKey",ShmSysConfigAndInfo->SysInfo.DcMeterStatusInfo[gun_index].publicKey);
+												DEBUG_INFO(" %-26s : %s \n", "publicKeyOcmf",ShmSysConfigAndInfo->SysInfo.DcMeterStatusInfo[gun_index].publicKeyOcmf);
+												DEBUG_INFO(" %-26s : %d \n", "indexOfLastTransaction",ShmSysConfigAndInfo->SysInfo.DcMeterStatusInfo[gun_index].indexOfLastTransaction);
+												DEBUG_INFO(" %-26s : %d \n\n\n\n\n\n", "numberOfStoredTransactions",ShmSysConfigAndInfo->SysInfo.DcMeterStatusInfo[gun_index].numberOfStoredTransactions);
+												}
+												#endif
+										 
+										#else
+												#ifdef DEBUG_STANDALONG_STATUS_INFO_LOG	
+												DEBUG_INFO(" =================================  Standalong Status info : %d ================================= \n",gun_index);
+												DEBUG_INFO(" %-26s : %d \n", "status-value",meter_status_info[gun_index].StatusValue);
+												DEBUG_INFO(" %-26s : %d \n", "b-suLinkStatusIsOk",meter_status_info[gun_index].MeterStatusFlag.bits.suLinkStatusIsOk);
+												DEBUG_INFO(" %-26s : %d \n", "b-muFatalErrorOccured",meter_status_info[gun_index].MeterStatusFlag.bits.muFatalErrorOccured);
+												DEBUG_INFO(" %-26s : %d \n", "b-transactionIsOnGoing",meter_status_info[gun_index].MeterStatusFlag.bits.transactionIsOnGoing);
+												DEBUG_INFO(" %-26s : %d \n", "b-tamperingIsDetected",meter_status_info[gun_index].MeterStatusFlag.bits.tamperingIsDetected);
+												DEBUG_INFO(" %-26s : %d \n", "b-timeSyncStatusIsOk",meter_status_info[gun_index].MeterStatusFlag.bits.timeSyncStatusIsOk);
+												DEBUG_INFO(" %-26s : %d \n", "b-overTemperatureIsDetected",meter_status_info[gun_index].MeterStatusFlag.bits.overTemperatureIsDetected);
+												DEBUG_INFO(" %-26s : %d \n", "b-reversedVoltage",meter_status_info[gun_index].MeterStatusFlag.bits.reversedVoltage);
+												DEBUG_INFO(" %-26s : %d \n", "b-suMeasureFailureOccurred",meter_status_info[gun_index].MeterStatusFlag.bits.suMeasureFailureOccurred);
+												DEBUG_INFO(" %-26s : %s \n", "applicationFirmwareVersion",meter_status_info[gun_index].applicationFirmwareVersion);
+												DEBUG_INFO(" %-26s : %s \n", "applicationFirmwareAuthTag",meter_status_info[gun_index].applicationFirmwareAuthTag);
+												DEBUG_INFO(" %-26s : %s \n", "legalFirmwareVersion",meter_status_info[gun_index].legalFirmwareVersion);
+												DEBUG_INFO(" %-26s : %s \n", "applicationFirmwareAuthTag",meter_status_info[gun_index].legalFirmwareAuthTag);
+												DEBUG_INFO(" %-26s : %s \n", "sensorFirmwareVersion",meter_status_info[gun_index].sensorFirmwareVersion);
+												DEBUG_INFO(" %-26s : %s \n", "sensorFirmwareCrc",meter_status_info[gun_index].sensorFirmwareCrc);
+												DEBUG_INFO(" %-26s : %s \n", "ipAddress",meter_status_info[gun_index].ipAddress);
+												DEBUG_INFO(" %-26s : %s \n", "meterId",meter_status_info[gun_index].meterId);
+												DEBUG_INFO(" %-26s : %d \n", "b-muInitIsFailed",meter_status_info[gun_index].MeterErrorFlag.bits.muInitIsFailed);
+												DEBUG_INFO(" %-26s : %d \n", "b-suStateIsInvalid",meter_status_info[gun_index].MeterErrorFlag.bits.suStateIsInvalid);
+												DEBUG_INFO(" %-26s : %d \n", "b-versionCheckIsFailed",meter_status_info[gun_index].MeterErrorFlag.bits.versionCheckIsFailed);
+												DEBUG_INFO(" %-26s : %d \n", "b-muRngInitIsFailed",meter_status_info[gun_index].MeterErrorFlag.bits.muRngInitIsFailed);
+												DEBUG_INFO(" %-26s : %d \n", "b-muDataIntegrityIsFailed",meter_status_info[gun_index].MeterErrorFlag.bits.muDataIntegrityIsFailed);
+												DEBUG_INFO(" %-26s : %d \n", "b-muFwIntegrityIsFailed",meter_status_info[gun_index].MeterErrorFlag.bits.muFwIntegrityIsFailed);
+												DEBUG_INFO(" %-26s : %d \n", "b-suIntegrityIsFailed",meter_status_info[gun_index].MeterErrorFlag.bits.suIntegrityIsFailed);
+												DEBUG_INFO(" %-26s : %d \n", "b-logbookIntegrityIsFailed",meter_status_info[gun_index].MeterErrorFlag.bits.logbookIntegrityIsFailed);
+												DEBUG_INFO(" %-26s : %d \n", "b-logbookIsFull",meter_status_info[gun_index].MeterErrorFlag.bits.logbookIsFull);
+												DEBUG_INFO(" %-26s : %d \n", "bits-memoryAccessIsFailed",meter_status_info[gun_index].MeterErrorFlag.bits.memoryAccessIsFailed);
+												DEBUG_INFO(" %-26s : %d \n", "bits-muStateIsFailed",meter_status_info[gun_index].MeterErrorFlag.bits.muStateIsFailed);
+												DEBUG_INFO(" %-26s : %s \n", "publicKey",meter_status_info[gun_index].publicKey);
+												DEBUG_INFO(" %-26s : %s \n", "publicKeyOcmf",meter_status_info[gun_index].publicKeyOcmf);
+												DEBUG_INFO(" %-26s : %d \n", "indexOfLastTransaction",meter_status_info[gun_index].indexOfLastTransaction);
+												DEBUG_INFO(" %-26s : %d \n\n\n\n\n\n", "numberOfStoredTransactions",meter_status_info[gun_index].numberOfStoredTransactions);
+												#endif
+										#endif//DEBUG_STANDALONG
+
+										//sync meter systime
+										if(meter_status_info[gun_index].MeterStatusFlag.bits.suLinkStatusIsOk == 1 && 
+												meter_status_info[gun_index].MeterStatusFlag.bits.timeSyncStatusIsOk == 0)
+										{
+												configure_meter_time(gun_index);											
+										}
+										
+										failCount[gun_index] = 0;
 							}
 							else
 							{
-								if(failCount[meterIndex] < 10)
-									failCount[meterIndex]++;
+										PR("read status fail : %d \n", gun_index);
+										if(failCount[gun_index] < 5)
+											failCount[gun_index]++;
 							}
-							break;
-						default:
-							pollingIndex = 0;
-							break;
 					}
-				}
 
-				//meterIndex++;
-			}
 
-			
-			if(failCount[meterIndex] >= 8)
-			{
-				//if(ShmStatusCodeData->AlarmCode.AlarmEvents.bits.MeterCommTimeout)
-				//{
-					DEBUG_ERROR("Meter communication timeout");
-					ShmSysConfigAndInfo->SysInfo.DcMeterInfo[meterIndex].LinkStatus = 2;
-					ShmStatusCodeData->AlarmCode.AlarmEvents.bits.MeterCommTimeout = ON;
-				//}
+					if(failCount[gun_index] >= 5)
+					{
+							//if(ShmStatusCodeData->AlarmCode.AlarmEvents.bits.MeterCommTimeout)
+							//{
+							DEBUG_ERROR("Meter %d communication timeout",gun_index);
+							#ifndef DEBUG_STANDALONG
+							ShmSysConfigAndInfo->SysInfo.DcMeterInfo[gun_index].LinkStatus = 3;
+							ShmStatusCodeData->AlarmCode.AlarmEvents.bits.MeterCommTimeout = ON;
+							#else
+							meter_info[gun_index].LinkStatus = 3;
+							#endif
+							//}
+							PR("failconut fail : %d \n", gun_index);
+					}
+					else
+					{
+						
+							if(meter_status_info[gun_index].MeterStatusFlag.bits.timeSyncStatusIsOk == 1 && 
+						  	meter_status_info[gun_index].MeterStatusFlag.bits.suLinkStatusIsOk == 1)
+							{
+									meter_info[gun_index].LinkStatus = 2;
+							}else{
+									meter_info[gun_index].LinkStatus = 1;
+							}
+							
+							#ifndef DEBUG_STANDALONG							
+							ShmSysConfigAndInfo->SysInfo.DcMeterInfo[gun_index].LinkStatus = meter_info[gun_index].LinkStatus;							
+							ShmStatusCodeData->AlarmCode.AlarmEvents.bits.MeterCommTimeout = OFF;							
+							//linkstatus 1 = los meter slave, 2 is can to be Transaction
+						  if(ShmSysConfigAndInfo->SysInfo.DcMeterInfo[gun_index].LinkStatus == 1)
+							{															
+									ShmStatusCodeData->AlarmCode.AlarmEvents.bits.MeterSlaveLosLink = ON;										
+							}else{
+									ShmStatusCodeData->AlarmCode.AlarmEvents.bits.MeterSlaveLosLink = OFF;
+							}	
+							#endif
+							//PR("failconut pass : %d \n", gun_index);
+					}
 			}
-			else
-			{
-				ShmSysConfigAndInfo->SysInfo.DcMeterInfo[meterIndex].LinkStatus = 1; 
-				ShmStatusCodeData->AlarmCode.AlarmEvents.bits.MeterCommTimeout = OFF;
+				
+			#ifndef DEBUG_STANDALONG
+			DEBUG_INFO("shm Meter %d - LinkStatus %d :  failCount: %d   ActionCmd: %d  OcmpInfoReady: %d\n RecordActionCmd: %d RecordOcmpInfoReady: %d", gun_index, 
+			meter_info[gun_index].LinkStatus,failCount[gun_index] ,
+			ShmSysConfigAndInfo->SysInfo.DcMeterTransactionAction[gun_index].ActionCmd ,
+			ShmSysConfigAndInfo->SysInfo.DcMeterTransactionAction[gun_index].OcmfInfoReady,
+			ShmSysConfigAndInfo->SysInfo.DcMeterReadTransactionRecord[gun_index].ActionCmd ,
+			ShmSysConfigAndInfo->SysInfo.DcMeterReadTransactionRecord[gun_index].OcmfInfoReady);
+			PR ("===================   ModelName %s\n", ShmSysConfigAndInfo->SysConfig.ModelName);
+			PR("end : %d  ActionCmd : %d OcmfInfoReady : %d RecordActionCmd: %d RecordOcmpInfoReady: %d \n", gun_index,ShmSysConfigAndInfo->SysInfo.DcMeterTransactionAction[gun_index].ActionCmd, 
+			ShmSysConfigAndInfo->SysInfo.DcMeterTransactionAction[gun_index].OcmfInfoReady,
+			ShmSysConfigAndInfo->SysInfo.DcMeterReadTransactionRecord[gun_index].ActionCmd,
+			ShmSysConfigAndInfo->SysInfo.DcMeterReadTransactionRecord[gun_index].OcmfInfoReady);
+			PR("shm bits-suLinkStatusIsOk %d : %d \n", gun_index,ShmSysConfigAndInfo->SysInfo.DcMeterStatusInfo[gun_index].MeterStatusFlag.bits.suLinkStatusIsOk);
+			PR("shm bits-transactionIsOnGoing %d : %d \n", gun_index,ShmSysConfigAndInfo->SysInfo.DcMeterStatusInfo[gun_index].MeterStatusFlag.bits.transactionIsOnGoing);
+			PR("shm bits-timeSyncStatusIsOk %d : %d \n", gun_index,ShmSysConfigAndInfo->SysInfo.DcMeterStatusInfo[gun_index].MeterStatusFlag.bits.timeSyncStatusIsOk);
+			
+			
+			#else
+			DEBUG_INFO("Meter %d - LinkStatus %d :  failCount: %d  ActionCmd: %d  OcmpInfoReady: %d RecordActionCmd: %d RecordOcmpInfoReady: %d\n", gun_index,
+			meter_info[gun_index].LinkStatus,failCount[gun_index] ,
+			meter_transaction_Action[gun_index].ActionCmd ,
+			meter_transaction_Action[gun_index].OcmfInfoReady,
+			meter_read_transaction_record[gun_index].ActionCmd ,
+			meter_read_transaction_record[gun_index].OcmfInfoReady);
+			
+			PR ("===================   STAND ALONE\n");
+			PR("end : %d  ActionCmd : %d OcmfInfoReady : %d RecordActionCmd: %d RecordOcmpInfoReady: %d \n", gun_index,meter_transaction_Action[gun_index].ActionCmd, 
+			meter_transaction_Action[gun_index].OcmfInfoReady,
+			meter_read_transaction_record[gun_index].ActionCmd,
+			meter_read_transaction_record[gun_index].OcmfInfoReady);
+			PR("shm bits-suLinkStatusIsOk %d : %d \n", gun_index,meter_status_info[gun_index].MeterStatusFlag.bits.suLinkStatusIsOk);
+			PR("shm bits-transactionIsOnGoing %d : %d \n", gun_index,meter_status_info[gun_index].MeterStatusFlag.bits.transactionIsOnGoing);
+			PR("shm bits-timeSyncStatusIsOk %d : %d \n", gun_index,meter_status_info[gun_index].MeterStatusFlag.bits.timeSyncStatusIsOk);			
+			
+			#endif
+			
+			usleep(1000000/modelnameInfo.GetGunCount);
+			if(gun_index == modelnameInfo.GetGunCount){
+					RecordLogTimerCount++;
 			}
 			
-			DEBUG_INFO("Meter %d - LinkStatus %d :  failCount: %d \n", meterIndex, ShmSysConfigAndInfo->SysInfo.DcMeterInfo[meterIndex].LinkStatus,failCount[meterIndex]);
-			usleep(200000);
+			//PR("end : %d  ActionCmd : %d \n", gun_index,ShmSysConfigAndInfo->SysInfo.DcMeterTransactionAction[gun_index].ActionCmd);
+			
 		}
 				
 	}
 
-
-
 	return -1;
 }

+ 12 - 0
EVSE/Modularization/DcMeter/Module_DcMeter.h

@@ -40,7 +40,19 @@
 #include 	"SystemLogMessage.h"
 
 //#define	DEBUG_STANDALONG
+//#define ConsloePrintLog
+#ifndef DEBUG_STANDALONG
+//#define DEBUG_STANDALONG_STATUS_INFO_LOG
+//#define DEBUG_STANDALONG_LIVEMEASURE_LOG
+//#define DEBUG_STANDALONG_TRANSACTION_START_LOG
+//#define DEBUG_STANDALONG_TRANSACTION_RESULT_LOG
+#else
 //#define DEBUG_SHAREMEM_LOG
+//#define DEBUG_SHAREMEM_STATUS_INFO_LOG
+//#define DEBUG_SHAREMEM_LIVEMEASURE_LOG
+//#define DEBUG_SHAREMEM_TRANSACTION_START_LOG
+#define DEBUG_SHAREMEM_TRANSACTION_RESULT_LOG
+#endif
 
 #define ARRAY_SIZE(A)				(sizeof(A) / sizeof(A[0]))
 #define PASS						1

+ 63 - 27
EVSE/Modularization/DcMeter/curlApi.c

@@ -42,6 +42,7 @@ struct MemoryStruct
 {
   uint8_t memory[4096];
   size_t size;
+  uint16_t index;
 };
 
 struct MemoryStruct chunk;
@@ -58,11 +59,9 @@ static size_t WriteMemoryCallback(void *contents, size_t size, size_t nmemb, voi
 	size_t realsize = size*nmemb;
 	struct MemoryStruct *mem = (struct MemoryStruct *)userp;
 
-	mem->size = realsize;;
-
-	memset(mem->memory, 0x00, ARRAY_SIZE(mem->memory));
-	chunk.size = realsize;
-	memcpy(mem->memory, contents, realsize);
+	mem->size += realsize;;
+	memcpy(mem->memory + mem->index, contents, realsize);
+	mem->index += realsize;
 
 	return realsize;
 }
@@ -82,6 +81,8 @@ int httpGet(uint8_t *url, uint8_t *responseData)
 	curl_global_init(CURL_GLOBAL_ALL);
 	curl = curl_easy_init();
 
+	memset(&chunk, 0x00, sizeof(struct MemoryStruct));
+
 	if(curl)
 	{
 		 curl_easy_setopt(curl, CURLOPT_URL, (char*)url);
@@ -93,10 +94,21 @@ int httpGet(uint8_t *url, uint8_t *responseData)
 		 //curl_easy_setopt(curl, CURLOPT_HTTPAUTH, (long)CURLAUTH_ANY);
 		 //curl_easy_setopt(curl, CURLOPT_USERPWD, "user:password");
 		 curl_easy_setopt(curl, CURLOPT_TIMEOUT_MS, 2500L);
+		 struct curl_slist *headers = NULL;
+		 headers = curl_slist_append(headers, "Accept: application/json");
+		 headers = curl_slist_append(headers, "Content-Type: application/json");
+		 headers = curl_slist_append(headers, "charset: utf-8");
+		 curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "GET");
+		headers = curl_slist_append(headers, "length: 20");
+		headers = curl_slist_append(headers, "numbers: true");
+
+		 curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
 
 		 res = curl_easy_perform(curl);
+		 long http_code = 0;
+		 curl_easy_getinfo (curl, CURLINFO_RESPONSE_CODE, &http_code);
 
-		 if(res != CURLE_OK)
+		 if(res != CURLE_OK || http_code != 200)
 		 {
 			 DEBUG_ERROR("curl_easy_perform() failed: %s\n", curl_easy_strerror(res));
 		 }
@@ -131,6 +143,11 @@ int httpPost(uint8_t *url, uint8_t *postData, uint8_t *responseData)
 
 	curl_global_init(CURL_GLOBAL_ALL);
 	curl = curl_easy_init();
+	
+	printf("post url  : %s\n", url);
+	printf("post data : %s\n", postData);
+	
+	memset(&chunk, 0x00, sizeof(struct MemoryStruct));
 
 	if(curl)
 	{
@@ -174,7 +191,8 @@ int httpPost(uint8_t *url, uint8_t *postData, uint8_t *responseData)
  * @param postData
  * @return
  */
-int httpPut(uint8_t *url, uint8_t *postData)
+
+int httpPut(uint8_t *url, uint8_t *postData, uint8_t *responseData)
 {
 	int result = FAIL;
 	CURL *curl;
@@ -184,30 +202,48 @@ int httpPut(uint8_t *url, uint8_t *postData)
 	curl = curl_easy_init();
 
 	if(curl)
-	{
-		struct curl_slist *headers = NULL;
-		headers = curl_slist_append(headers, "Content-Type: literature/classic");
-		curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
-		curl_easy_setopt(curl, CURLOPT_URL, (char*)url);
-		curl_easy_setopt(curl, CURLOPT_POSTFIELDS, (char*)postData);
+	{	struct curl_slist*        headerlist    = NULL;
+		struct curl_httppost*    formpost    = NULL;
+		struct curl_httppost*    lastptr        = NULL;
 		curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "PUT");
-		curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, FALSE);
-		//curl_easy_setopt(curl, CURLOPT_HTTPAUTH, (long)CURLAUTH_ANY);
-		//curl_easy_setopt(curl, CURLOPT_USERPWD, "user:password");
-		curl_easy_setopt(curl, CURLOPT_TIMEOUT_MS, 2500L);
 
-		res = curl_easy_perform(curl);
+		// 设置表头,表头内容可能不同
+		//headerlist = curl_slist_append(headerlist, "Content-Type:application/x-www-form-urlencoded");
+		headerlist = curl_slist_append(headerlist, "Content-Type:application/json");
+		curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headerlist);
 
-		if(res != CURLE_OK)
-		{
+		// 设置URL
+		curl_easy_setopt(curl, CURLOPT_URL, "http://postit.example.com/moo.cgi");
+		 curl_easy_setopt(curl, CURLOPT_URL, (char*)url);
+		 curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, WriteMemoryCallback);
+		 curl_easy_setopt(curl, CURLOPT_WRITEDATA, (void *)&chunk);
+		 //curl_easy_setopt(curl, CURLOPT_USERAGENT, "libcurl-agent/1.0");
+		 curl_easy_setopt(curl, CURLOPT_POSTFIELDS, (char*)postData);
+		 //curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, (long)strlen((char*)postData));
+		 curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0);
+		 curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0);
+		 //curl_easy_setopt(curl, CURLOPT_HTTPAUTH, (long)CURLAUTH_ANY);
+		 //curl_easy_setopt(curl, CURLOPT_USERPWD, "user:password");
+//		 curl_easy_setopt(curl, CURLOPT_TIMEOUT_MS, 2500L);
+		 curl_easy_setopt(curl, CURLOPT_TIMEOUT, 20L);
+
+		 res = curl_easy_perform(curl);
+
+		 if(res != CURLE_OK)
+		 {
 			 DEBUG_ERROR("curl_easy_perform() failed: %s\n", curl_easy_strerror(res));
-		}
-		else
-		{
-			result = PASS;
-		}
-		curl_easy_cleanup(curl);
-		curl_slist_free_all(headers);
+		 }
+		 else
+		 {
+			 if(chunk.size > 0)
+			 {
+				 DEBUG_INFO("Response content: %s\n", chunk.memory);
+				 memcpy(responseData, chunk.memory, ARRAY_SIZE(chunk.memory));
+			 }
+
+			 result = PASS;
+		 }
+		 curl_easy_cleanup(curl);
 	}
 	curl_global_cleanup();
 

+ 1 - 1
EVSE/Modularization/DcMeter/curlApi.h

@@ -20,7 +20,7 @@
 
 extern int httpGet(uint8_t *url, uint8_t *responseData);
 extern int httpPost(uint8_t *url, uint8_t *postData, uint8_t *responseData);
-extern int httpPut(uint8_t *url, uint8_t *postData);
+extern int httpPut(uint8_t *url, uint8_t *postData, uint8_t *responseData);
 extern int curlDownload(uint8_t *url, uint8_t *filename);
 extern int httpUpload(uint8_t *url, uint8_t *filename);
 extern int ftpUpload(uint8_t *url, uint8_t *filename);

+ 575 - 93
EVSE/Modularization/DcMeter/meterComm.c

@@ -6,11 +6,20 @@
  */
 #include 	"meterComm.h"
 #include 	"curlApi.h"
-#include 	"SystemLogMessage.h"
+#include 	"SystemLogMessage.h" 
 #include	"json-c/json.h"
 
 #define is_error(ptr) 			((unsigned long)ptr > (unsigned long)-4000L)
 
+
+#define _DEBUG_ 0
+
+#if _DEBUG_
+#define PR(...) printf(__VA_ARGS__)
+#else
+#define PR(...)
+#endif
+
 unsigned char 	meterModel = 0;
 char			meterApiAddress[128];
 
@@ -24,66 +33,59 @@ void meterInitialize(uint8_t model)
 	meterModel = model;
 }
 
-/**
- * Meter api address assign
- * @param meterIndex
- */
-void meterApiAssign(uint8_t meterIndex)
-{
-	switch(meterModel)
-	{
-		case METER_MODEL_LEM_L18005A:
-		default:
-			/*
-			 * TODO:
-			 * 	1. Check meter actual API address.
-			 */
-			sprintf(meterApiAddress, "http://192.168.0.%d/v1/livemeasure", (31 + meterIndex));
-			//sprintf(meterApiAddress, "http://192.168.0.31/livemeasure");
-			//sprintf(meterApiAddress, "https://foluswen.com/tmate/livemeasure.php"); // Simulator by web server
-
-			break;
-	}
-}
-
 /**
  * Output voltage read
  * @param meter_info
  * @return
  */
-int readVoltage(Meter_Info *meter_info)
+int readMeterLivemeasure(uint8_t meterIndex, Meter_Info *meter_info)
 {
 	int result = FAIL;
+	char host[128]="";
 	uint8_t	data[4096];
 
+	sprintf(host, "http://192.168.0.%d/v1/livemeasure", (31 + meterIndex));
+	
 	switch(meterModel)
 	{
 
 		case METER_MODEL_LEM_L18005A:
 		default:
-			if(httpGet((uint8_t*)meterApiAddress, data) != FAIL)
+			if(httpGet((uint8_t*)host, data) != FAIL)
 			{
-				//printf("data: %s\n", data);
-				//printf("meterApiAddress: %s\n", meterApiAddress);
+				//PR("data: %s\n", data);
+				//PR("meterApiAddress: %s\n", meterApiAddress);
 				json_object *livemeasure;
 				livemeasure = json_tokener_parse((char*)data);
 				if(!is_error(livemeasure))
 				{
 					if(json_object_object_get(livemeasure, "voltage") != NULL)
 						meter_info->presetVoltage = json_object_get_double(json_object_object_get(livemeasure, "voltage"));
+						PR("Output voltage %d : %.3f V\n", meter_info->presetVoltage);
 
 					if(json_object_object_get(livemeasure, "current") != NULL)
 						meter_info->presentCurrent = json_object_get_double(json_object_object_get(livemeasure, "current"));
+						PR("Output current %d : %.3f V\n", meter_info->presentCurrent);
 
 					if(json_object_object_get(livemeasure, "power") != NULL)
 						meter_info->presentPower = json_object_get_double(json_object_object_get(livemeasure, "power"));
+						PR("Output power %d : %.3f V\n", meter_info->presentPower);
 
 					if(json_object_object_get(livemeasure, "energyImportTotal") != NULL)
 						meter_info->totlizeImportEnergy = json_object_get_double(json_object_object_get(livemeasure, "energyImportTotal"));
+						PR("Totalize import energy %d : %.3f V\n", meter_info->totlizeImportEnergy);
 
 					if(json_object_object_get(livemeasure, "energyExportTotal") != NULL)
 						meter_info->totlizeExportEnergy = json_object_get_double(json_object_object_get(livemeasure, "energyExportTotal"));
-
+						PR("Totalize export energy %d : %.3f V\n", meter_info->totlizeExportEnergy);
+
+					if(json_object_object_get(livemeasure, "timestamp") != NULL){						
+						sprintf((char*)&meter_info->timestamp, "%s", json_object_get_string(json_object_object_get(livemeasure, "timestamp")));
+						PR("timestamp : %s\n",meter_info->timestamp);	
+					}
+					
+					PR("\n\n\n\n\n\n\n\n");
+						
 					result = PASS;
 				}
 				json_object_put(livemeasure);
@@ -96,137 +98,617 @@ int readVoltage(Meter_Info *meter_info)
 }
 
 /**
- * Output current read
+ * Export & import totalize energy read
  * @param meter_info
  * @return
  */
-int readCurrent(Meter_Info *meter_info)
+int readMeterStatusInfo(uint8_t meterIndex, Meter_Status_Info *meter_status_info)
 {
 	int result = FAIL;
+	char host[128]="";
 	uint8_t	data[4096];
-
+	
+	sprintf(host, "http://192.168.0.%d/v1/status", (31 + meterIndex));
+	
 	switch(meterModel)
 	{
 		case METER_MODEL_LEM_L18005A:
 		default:
-			if(httpGet((uint8_t*)meterApiAddress, data) != FAIL)
+			//if(httpGet((uint8_t*)meterApiAddress, data) != FAIL)
+			if(httpGet((uint8_t*)host,data)!= FAIL)	
 			{
 				json_object *livemeasure;
 				livemeasure = json_tokener_parse((char*)data);
+				
+				//PR("Get %s\n",data);
+				
 				if(!is_error(livemeasure))
 				{
-					if(json_object_object_get(livemeasure, "voltage") != NULL)
-						meter_info->presetVoltage = json_object_get_double(json_object_object_get(livemeasure, "voltage"));
-
-					if(json_object_object_get(livemeasure, "current") != NULL)
-						meter_info->presentCurrent = json_object_get_double(json_object_object_get(livemeasure, "current"));
-
-					if(json_object_object_get(livemeasure, "power") != NULL)
-						meter_info->presentPower = json_object_get_double(json_object_object_get(livemeasure, "power"));
-
-					if(json_object_object_get(livemeasure, "energyImportTotal") != NULL)
-						meter_info->totlizeImportEnergy = json_object_get_double(json_object_object_get(livemeasure, "energyImportTotal"));
-
-					if(json_object_object_get(livemeasure, "energyExportTotal") != NULL)
-						meter_info->totlizeExportEnergy = json_object_get_double(json_object_object_get(livemeasure, "energyExportTotal"));
+						if(json_object_object_get(json_object_object_get(livemeasure, "status"), "value") != NULL)
+						{
+							meter_status_info->StatusValue = json_object_get_int(json_object_object_get(json_object_object_get(livemeasure, "status"), "value"));
+							PR("status-value : %d \n",meter_status_info->StatusValue);
+						}
+						
+						//ststus bit
+						if(json_object_object_get(json_object_object_get(json_object_object_get(livemeasure, "status"), "bits"), "suLinkStatusIsOk") != NULL)
+						{
+							meter_status_info->MeterStatusFlag.bits.suLinkStatusIsOk = json_object_get_boolean(json_object_object_get(json_object_object_get
+							(json_object_object_get(livemeasure, "status"), "bits"), "suLinkStatusIsOk"));
+							PR("bits-suLinkStatusIsOk : %d \n",meter_status_info->MeterStatusFlag.bits.suLinkStatusIsOk);
+						}
+
+						if(json_object_object_get(json_object_object_get(json_object_object_get(livemeasure, "status"), "bits"), "muFatalErrorOccured") != NULL)
+						{
+							meter_status_info->MeterStatusFlag.bits.muFatalErrorOccured = json_object_get_boolean(json_object_object_get(json_object_object_get
+							(json_object_object_get(livemeasure, "status"), "bits"), "muFatalErrorOccured"));
+							PR("bits-muFatalErrorOccured : %d \n",meter_status_info->MeterStatusFlag.bits.muFatalErrorOccured);
+						}
+										
+						if(json_object_object_get(json_object_object_get(json_object_object_get(livemeasure, "status"), "bits"), "transactionIsOnGoing") != NULL)
+						{
+							meter_status_info->MeterStatusFlag.bits.transactionIsOnGoing = json_object_get_boolean(json_object_object_get(json_object_object_get
+							(json_object_object_get(livemeasure, "status"), "bits"), "transactionIsOnGoing"));
+							PR("bits-transactionIsOnGoing : %d \n",meter_status_info->MeterStatusFlag.bits.transactionIsOnGoing);
+						}
+
+						if(json_object_object_get(json_object_object_get(json_object_object_get(livemeasure, "status"), "bits"), "tamperingIsDetected") != NULL)
+						{
+							meter_status_info->MeterStatusFlag.bits.tamperingIsDetected = json_object_get_boolean(json_object_object_get(json_object_object_get
+							(json_object_object_get(livemeasure, "status"), "bits"), "tamperingIsDetected"));
+							PR("bits-tamperingIsDetected : %d \n",meter_status_info->MeterStatusFlag.bits.tamperingIsDetected);
+						}
+						
+						if(json_object_object_get(json_object_object_get(json_object_object_get(livemeasure, "status"), "bits"), "timeSyncStatusIsOk") != NULL)
+						{
+							meter_status_info->MeterStatusFlag.bits.timeSyncStatusIsOk = json_object_get_boolean(json_object_object_get(json_object_object_get
+							(json_object_object_get(livemeasure, "status"), "bits"), "timeSyncStatusIsOk"));
+							PR("bits-timeSyncStatusIsOk : %d \n",meter_status_info->MeterStatusFlag.bits.timeSyncStatusIsOk);
+						}
+						
+						if(json_object_object_get(json_object_object_get(json_object_object_get(livemeasure, "status"), "bits"), "overTemperatureIsDetected") != NULL)
+						{
+							meter_status_info->MeterStatusFlag.bits.overTemperatureIsDetected = json_object_get_boolean(json_object_object_get(json_object_object_get
+							(json_object_object_get(livemeasure, "status"), "bits"), "overTemperatureIsDetected"));
+							PR("bits-overTemperatureIsDetected : %d \n",meter_status_info->MeterStatusFlag.bits.overTemperatureIsDetected);
+						}
+						
+						if(json_object_object_get(json_object_object_get(json_object_object_get(livemeasure, "status"), "bits"), "reversedVoltage") != NULL)
+						{
+							meter_status_info->MeterStatusFlag.bits.reversedVoltage = json_object_get_boolean(json_object_object_get(json_object_object_get
+							(json_object_object_get(livemeasure, "status"), "bits"), "reversedVoltage"));
+							PR("bits-reversedVoltage : %d \n",meter_status_info->MeterStatusFlag.bits.reversedVoltage);
+						}
+						
+						if(json_object_object_get(json_object_object_get(json_object_object_get(livemeasure, "status"), "bits"), "suMeasureFailureOccurred") != NULL)
+						{
+							meter_status_info->MeterStatusFlag.bits.suMeasureFailureOccurred = json_object_get_boolean(json_object_object_get(json_object_object_get
+							(json_object_object_get(livemeasure, "status"), "bits"), "suMeasureFailureOccurred"));
+							PR("bits-suMeasureFailureOccurred : %d \n",meter_status_info->MeterStatusFlag.bits.suMeasureFailureOccurred);
+						}
+				
+		
+						if(json_object_object_get(json_object_object_get(livemeasure, "version"), "applicationFirmwareVersion") != NULL)
+						{
+								sprintf((char*)&meter_status_info->applicationFirmwareVersion, "%s", json_object_get_string(json_object_object_get
+								(json_object_object_get(livemeasure, "version"), "applicationFirmwareVersion")));
+								PR("applicationFirmwareVersion : %s\n",meter_status_info->applicationFirmwareVersion);
+						}
+
+						if(json_object_object_get(json_object_object_get(livemeasure, "version"), "applicationFirmwareAuthTag") != NULL)
+						{
+								sprintf((char*)&meter_status_info->applicationFirmwareAuthTag, "%s", json_object_get_string(json_object_object_get
+								(json_object_object_get(livemeasure, "version"), "applicationFirmwareAuthTag")));
+								PR("applicationFirmwareAuthTag : %s\n",meter_status_info->applicationFirmwareAuthTag);
+						}
+						
+						if(json_object_object_get(json_object_object_get(livemeasure, "version"), "legalFirmwareVersion") != NULL)
+						{
+								sprintf((char*)&meter_status_info->legalFirmwareVersion, "%s", json_object_get_string(json_object_object_get
+								(json_object_object_get(livemeasure, "version"), "legalFirmwareVersion")));
+								PR("applicationFirmwareAuthTag : %s\n",meter_status_info->legalFirmwareVersion);
+						}
+						
+						if(json_object_object_get(json_object_object_get(livemeasure, "version"), "legalFirmwareAuthTag") != NULL)
+						{
+								sprintf((char*)&meter_status_info->legalFirmwareAuthTag, "%s", json_object_get_string(json_object_object_get
+								(json_object_object_get(livemeasure, "version"), "legalFirmwareAuthTag")));
+								PR("applicationFirmwareAuthTag : %s\n",meter_status_info->legalFirmwareAuthTag);
+						}
+						
+						if(json_object_object_get(json_object_object_get(livemeasure, "version"), "sensorFirmwareVersion") != NULL)
+						{
+								sprintf((char*)&meter_status_info->sensorFirmwareVersion, "%s", json_object_get_string(json_object_object_get
+								(json_object_object_get(livemeasure, "version"), "sensorFirmwareVersion")));
+								PR("applicationFirmwareAuthTag : %s\n",meter_status_info->sensorFirmwareVersion);
+						}
+
+						if(json_object_object_get(json_object_object_get(livemeasure, "version"), "sensorFirmwareCrc") != NULL)
+						{
+								sprintf((char*)&meter_status_info->sensorFirmwareCrc, "%s", json_object_get_string(json_object_object_get
+								(json_object_object_get(livemeasure, "version"), "sensorFirmwareCrc")));
+								PR("applicationFirmwareAuthTag : %s\n",meter_status_info->sensorFirmwareCrc);
+						}
+						
+						if(json_object_object_get(livemeasure, "ipAddress") != NULL)
+						{
+								sprintf((char*)&meter_status_info->ipAddress, "%s", json_object_get_string(json_object_object_get(livemeasure, "ipAddress")));
+								PR("ipAddress : %s\n",meter_status_info->ipAddress);
+						}
+
+						if(json_object_object_get(livemeasure, "meterId") != NULL)
+						{
+								sprintf((char*)&meter_status_info->meterId, "%s", json_object_get_string(json_object_object_get(livemeasure, "meterId")));
+								PR("meterId : %s\n",meter_status_info->meterId);
+						}
+
+						//error bit
+						if(json_object_object_get(json_object_object_get(json_object_object_get(livemeasure, "errors"), "bits"), "muInitIsFailed") != NULL)
+						{
+							meter_status_info->MeterErrorFlag.bits.muInitIsFailed = json_object_get_boolean(json_object_object_get(json_object_object_get
+							(json_object_object_get(livemeasure, "errors"), "bits"), "muInitIsFailed"));
+							PR("bits-muInitIsFailed : %d \n",meter_status_info->MeterErrorFlag.bits.muInitIsFailed);
+						}
+
+						if(json_object_object_get(json_object_object_get(json_object_object_get(livemeasure, "errors"), "bits"), "suStateIsInvalid") != NULL)
+						{
+							meter_status_info->MeterErrorFlag.bits.suStateIsInvalid = json_object_get_boolean(json_object_object_get(json_object_object_get
+							(json_object_object_get(livemeasure, "errors"), "bits"), "suStateIsInvalid"));
+							PR("bits-suStateIsInvalid : %d \n",meter_status_info->MeterErrorFlag.bits.suStateIsInvalid);
+						}
+										
+						if(json_object_object_get(json_object_object_get(json_object_object_get(livemeasure, "errors"), "bits"), "versionCheckIsFailed") != NULL)
+						{
+							meter_status_info->MeterErrorFlag.bits.versionCheckIsFailed = json_object_get_boolean(json_object_object_get(json_object_object_get
+							(json_object_object_get(livemeasure, "errors"), "bits"), "versionCheckIsFailed"));
+							PR("bits-versionCheckIsFailed : %d \n",meter_status_info->MeterErrorFlag.bits.versionCheckIsFailed);
+						}
+
+						if(json_object_object_get(json_object_object_get(json_object_object_get(livemeasure, "errors"), "bits"), "muRngInitIsFailed") != NULL)
+						{
+							meter_status_info->MeterErrorFlag.bits.muRngInitIsFailed = json_object_get_boolean(json_object_object_get(json_object_object_get
+							(json_object_object_get(livemeasure, "errors"), "bits"), "muRngInitIsFailed"));
+							PR("bits-muRngInitIsFailed : %d \n",meter_status_info->MeterErrorFlag.bits.muRngInitIsFailed);
+						}
+						
+						if(json_object_object_get(json_object_object_get(json_object_object_get(livemeasure, "errors"), "bits"), "muDataIntegrityIsFailed") != NULL)
+						{
+							meter_status_info->MeterErrorFlag.bits.muDataIntegrityIsFailed = json_object_get_boolean(json_object_object_get(json_object_object_get
+							(json_object_object_get(livemeasure, "errors"), "bits"), "muDataIntegrityIsFailed"));
+							PR("bits-muDataIntegrityIsFailed : %d \n",meter_status_info->MeterErrorFlag.bits.muDataIntegrityIsFailed);
+						}
+						
+						if(json_object_object_get(json_object_object_get(json_object_object_get(livemeasure, "errors"), "bits"), "muFwIntegrityIsFailed") != NULL)
+						{
+							meter_status_info->MeterErrorFlag.bits.muFwIntegrityIsFailed = json_object_get_boolean(json_object_object_get(json_object_object_get
+							(json_object_object_get(livemeasure, "errors"), "bits"), "muFwIntegrityIsFailed"));
+							PR("bits-muFwIntegrityIsFailed : %d \n",meter_status_info->MeterErrorFlag.bits.muFwIntegrityIsFailed);
+						}
+						
+						if(json_object_object_get(json_object_object_get(json_object_object_get(livemeasure, "errors"), "bits"), "suIntegrityIsFailed") != NULL)
+						{
+							meter_status_info->MeterErrorFlag.bits.suIntegrityIsFailed = json_object_get_boolean(json_object_object_get(json_object_object_get
+							(json_object_object_get(livemeasure, "errors"), "bits"), "suIntegrityIsFailed"));
+							PR("bits-suIntegrityIsFailed : %d \n",meter_status_info->MeterErrorFlag.bits.suIntegrityIsFailed);
+						}
+						
+						if(json_object_object_get(json_object_object_get(json_object_object_get(livemeasure, "errors"), "bits"), "logbookIntegrityIsFailed") != NULL)
+						{
+							meter_status_info->MeterErrorFlag.bits.logbookIntegrityIsFailed = json_object_get_boolean(json_object_object_get(json_object_object_get
+							(json_object_object_get(livemeasure, "errors"), "bits"), "logbookIntegrityIsFailed"));
+							PR("bits-logbookIntegrityIsFailed : %d \n",meter_status_info->MeterErrorFlag.bits.logbookIntegrityIsFailed);
+						}					
+						
+						if(json_object_object_get(json_object_object_get(json_object_object_get(livemeasure, "errors"), "bits"), "logbookIsFull") != NULL)
+						{
+							meter_status_info->MeterErrorFlag.bits.logbookIsFull = json_object_get_boolean(json_object_object_get(json_object_object_get
+							(json_object_object_get(livemeasure, "errors"), "bits"), "logbookIsFull"));
+							PR("bits-logbookIsFull : %d \n",meter_status_info->MeterErrorFlag.bits.logbookIsFull);
+						}
+						
+						if(json_object_object_get(json_object_object_get(json_object_object_get(livemeasure, "errors"), "bits"), "memoryAccessIsFailed") != NULL)
+						{
+							meter_status_info->MeterErrorFlag.bits.memoryAccessIsFailed = json_object_get_boolean(json_object_object_get(json_object_object_get
+							(json_object_object_get(livemeasure, "errors"), "bits"), "memoryAccessIsFailed"));
+							PR("bits-memoryAccessIsFailed : %d \n",meter_status_info->MeterErrorFlag.bits.memoryAccessIsFailed);
+						}
+						
+						if(json_object_object_get(json_object_object_get(json_object_object_get(livemeasure, "errors"), "bits"), "muStateIsFailed") != NULL)
+						{
+							meter_status_info->MeterErrorFlag.bits.muStateIsFailed = json_object_get_boolean(json_object_object_get(json_object_object_get
+							(json_object_object_get(livemeasure, "errors"), "bits"), "muStateIsFailed"));
+							PR("bits-muStateIsFailed : %d \n",meter_status_info->MeterErrorFlag.bits.muStateIsFailed);
+						}	
+
+							
+						if(json_object_object_get(livemeasure, "publicKey") != NULL)
+						{
+								sprintf((char*)&meter_status_info->publicKey, "%s", json_object_get_string(json_object_object_get(livemeasure, "publicKey")));
+								PR("publicKey : %s\n",meter_status_info->publicKey);
+						}
+
+						if(json_object_object_get(livemeasure, "publicKeyOcmf") != NULL)
+						{
+								sprintf((char*)&meter_status_info->publicKeyOcmf, "%s", json_object_get_string(json_object_object_get(livemeasure, "publicKeyOcmf")));
+								PR("publicKeyOcmf : %s\n",meter_status_info->publicKeyOcmf);
+						}
+
+						if(json_object_object_get(livemeasure, "indexOfLastTransaction") != NULL)
+						{
+								meter_status_info->indexOfLastTransaction = json_object_get_int(json_object_object_get(livemeasure, "indexOfLastTransaction"));
+								PR("indexOfLastTransaction : %d \n",meter_status_info->indexOfLastTransaction);
+						}
+						
+						if(json_object_object_get(livemeasure, "numberOfStoredTransactions") != NULL)
+						{
+								meter_status_info->numberOfStoredTransactions = json_object_get_int(json_object_object_get(livemeasure, "numberOfStoredTransactions"));
+								PR("numberOfStoredTransactions : %d \n",meter_status_info->numberOfStoredTransactions);
+						}
+						
+						PR("\n\n\n\n\n\n\n\n");
 
 					result = PASS;
 				}
+				
 				json_object_put(livemeasure);
 			}
 			break;
 	}
-
+	
 	return result;
 }
 
-/**
- * Output power read
- * @param meter_info
- * @return
- */
-int readPower(Meter_Info *meter_info)
+
+int startMeterTransaction(uint8_t meterIndex, Meter_transaction_Action *meter_transaction_Action)
 {
 	int result = FAIL;
-	uint8_t	data[4096];
-
+	char host[128]="";
+	uint8_t data[4096];
+	uint8_t tmp[4096];
+
+	json_object *TransactionStartData = json_object_new_object();	
+	json_object_object_add(TransactionStartData, "evseId", json_object_new_string((char*)meter_transaction_Action->head.evseId));
+	json_object_object_add(TransactionStartData, "transactionId", json_object_new_string((char*)meter_transaction_Action->head.transactionId));
+	json_object_object_add(TransactionStartData, "clientId", json_object_new_string((char*)meter_transaction_Action->head.clientId));
+	json_object_object_add(TransactionStartData, "tariffId", json_object_new_int(meter_transaction_Action->head.tariffId));
+	json_object_object_add(TransactionStartData, "cableId", json_object_new_int(meter_transaction_Action->head.cableId));
+	json_object_object_add(TransactionStartData, "userData", json_object_new_string((char*)meter_transaction_Action->head.userData));
+
+	sprintf((char*)tmp, "%s",  json_object_to_json_string_ext(TransactionStartData, JSON_C_TO_STRING_PLAIN));
+
+	sprintf(host, "http://192.168.0.%d/v1/legal", (31 + meterIndex));
+		 
 	switch(meterModel)
 	{
 		case METER_MODEL_LEM_L18005A:
 		default:
-			if(httpGet((uint8_t*)meterApiAddress, data) != FAIL)
+ 
+     
+			if(httpPost((uint8_t*)host,tmp,data)!= FAIL)
 			{
 				json_object *livemeasure;
 				livemeasure = json_tokener_parse((char*)data);
+				
 				if(!is_error(livemeasure))
-				{
-					if(json_object_object_get(livemeasure, "voltage") != NULL)
-						meter_info->presetVoltage = json_object_get_double(json_object_object_get(livemeasure, "voltage"));
-
-					if(json_object_object_get(livemeasure, "current") != NULL)
-						meter_info->presentCurrent = json_object_get_double(json_object_object_get(livemeasure, "current"));
+				{							
+					PR("PostStartGet %s\n",data);
+				 result = PASS;
+				}
+				json_object_put(livemeasure);
+				json_object_put(TransactionStartData);
+			}
 
-					if(json_object_object_get(livemeasure, "power") != NULL)
-						meter_info->presentPower = json_object_get_double(json_object_object_get(livemeasure, "power"));
+			break;
+	}
+					
+	return result;
+	
+}
 
-					if(json_object_object_get(livemeasure, "energyImportTotal") != NULL)
-						meter_info->totlizeImportEnergy = json_object_get_double(json_object_object_get(livemeasure, "energyImportTotal"));
 
-					if(json_object_object_get(livemeasure, "energyExportTotal") != NULL)
-						meter_info->totlizeExportEnergy = json_object_get_double(json_object_object_get(livemeasure, "energyExportTotal"));
+int stopMeterTransaction(uint8_t meterIndex, Meter_transaction_Action *meter_transaction_Action,Meter_transaction_Result *meter_transaction_Result)
+{
+	int result = FAIL;
+	char host[128]="";
+	uint8_t data[4096];
+	uint8_t tmp[4096];
+
+	sprintf(host, "http://192.168.0.%d/v1/legal?transactionId=%s",(31 + meterIndex), meter_transaction_Action->head.transactionId);
+           
+	json_object *TransactionStopData = json_object_new_object();
+	json_object_object_add(TransactionStopData, "running", json_object_new_boolean(0));
+	sprintf((char*)tmp, "%s", json_object_to_json_string_ext(TransactionStopData, JSON_C_TO_STRING_PLAIN));
+	
+	switch(meterModel)
+	{
+		case METER_MODEL_LEM_L18005A:
+		default:
 
-					result = PASS;
+			if(httpPut((uint8_t*)host,tmp,data)!= FAIL)
+			//if(httpGet(host,data)!= FAIL)	
+			{
+				json_object *livemeasure;
+				livemeasure = json_tokener_parse((char*)data);
+				
+				if(!is_error(livemeasure))
+				{							
+					PR("PutStopGet %s\n",data);
+					
+					
+						if(json_object_object_get(livemeasure, "paginationCounter") != NULL)
+						{
+								meter_transaction_Result->paginationCounter = json_object_get_int(json_object_object_get(livemeasure, "paginationCounter"));
+								PR("paginationCounter : %d\n",meter_transaction_Result->paginationCounter);										
+						}
+
+						if(json_object_object_get(livemeasure, "transactionId") != NULL)
+						{
+								sprintf((char*)&meter_transaction_Result->head.transactionId, "%s", json_object_get_string(json_object_object_get(livemeasure, "transactionId")));
+								PR("transactionId : %s\n",meter_transaction_Result->head.transactionId);										
+						}
+
+						if(json_object_object_get(livemeasure, "evseId") != NULL)
+						{
+								sprintf((char*)&meter_transaction_Result->head.evseId, "%s", json_object_get_string(json_object_object_get(livemeasure, "evseId")));
+								PR("evseId : %s\n",meter_transaction_Result->head.evseId);										
+						}
+												
+
+						if(json_object_object_get(livemeasure, "clientId") != NULL)
+						{
+								sprintf((char*)&meter_transaction_Result->head.clientId, "%s", json_object_get_string(json_object_object_get(livemeasure, "clientId")));
+								PR("clientId : %s\n",meter_transaction_Result->head.clientId);										
+						}
+
+						if(json_object_object_get(livemeasure, "tariffId") != NULL)
+						{
+								meter_transaction_Result->head.tariffId = json_object_get_int(json_object_object_get(livemeasure, "tariffId"));
+								PR("tariffId : %d\n",meter_transaction_Result->head.tariffId);
+						}					
+
+						if(json_object_object_get(livemeasure, "userData") != NULL)
+						{
+								sprintf((char*)&meter_transaction_Result->head.userData, "%s", json_object_get_string(json_object_object_get(livemeasure, "userData")));
+								PR("clientId : %s\n",meter_transaction_Result->head.userData);										
+						}					
+
+						if(json_object_object_get(json_object_object_get(livemeasure, "meterValue"), "timestampStart") != NULL)
+						{
+								sprintf((char*)&meter_transaction_Result->timestampStart, "%s", json_object_get_string(json_object_object_get
+								(json_object_object_get(livemeasure, "meterValue"), "timestampStart")));
+								PR("timestampStart : %s\n",meter_transaction_Result->timestampStart);
+						}
+
+						if(json_object_object_get(json_object_object_get(livemeasure, "meterValue"), "timestampStop") != NULL)
+						{
+								sprintf((char*)&meter_transaction_Result->timestampStop, "%s", json_object_get_string(json_object_object_get
+								(json_object_object_get(livemeasure, "meterValue"), "timestampStop")));
+								PR("timestampStop : %s\n",meter_transaction_Result->timestampStop);
+						}
+
+						if(json_object_object_get(json_object_object_get(livemeasure, "meterValue"), "transactionDuration") != NULL)
+						{
+								meter_transaction_Result->transactionDuration = json_object_get_int(json_object_object_get
+								(json_object_object_get(livemeasure, "meterValue"), "transactionDuration"));
+								PR("transactionDuration : %d\n",meter_transaction_Result->transactionDuration);
+						}
+
+						if(json_object_object_get(json_object_object_get(livemeasure, "meterValue"), "transactionStatus") != NULL)
+						{
+								meter_transaction_Result->transactionStatus = json_object_get_int(json_object_object_get
+								(json_object_object_get(livemeasure, "meterValue"), "transactionStatus"));
+								PR("transactionStatus : %d\n",meter_transaction_Result->transactionStatus);
+						}
+
+						if(json_object_object_get(json_object_object_get(json_object_object_get(livemeasure, "meterValue"), "sampleValue"), "energyUnit") != NULL)
+						{
+							strcpy((char*)meter_transaction_Result->energyUnit, json_object_get_string(json_object_object_get(json_object_object_get(json_object_object_get
+							(livemeasure, "meterValue"), "sampleValue"), "energyUnit")));
+							PR("energyUnit : %s\n",meter_transaction_Result->energyUnit);
+						}
+						
+						if(json_object_object_get(json_object_object_get(json_object_object_get(livemeasure, "meterValue"), "sampleValue"), "energyImport") != NULL)
+						{
+							meter_transaction_Result->energyImport = json_object_get_double(json_object_object_get(json_object_object_get(json_object_object_get
+							(livemeasure, "meterValue"), "sampleValue"), "energyImport"));
+							PR("energyImport : %.3f\n",meter_transaction_Result->energyImport);
+						}
+						
+						if(json_object_object_get(json_object_object_get(json_object_object_get(livemeasure, "meterValue"), "sampleValue"), "energyImportTotalStart") != NULL)
+						{
+							meter_transaction_Result->energyImportTotalStart = json_object_get_double(json_object_object_get(json_object_object_get(json_object_object_get
+							(livemeasure, "meterValue"), "sampleValue"), "energyImportTotalStart"));
+							PR("energyImportTotalStart : %.3f\n",meter_transaction_Result->energyImportTotalStart);
+						}
+
+						if(json_object_object_get(json_object_object_get(json_object_object_get(livemeasure, "meterValue"), "sampleValue"), "energyImportTotalStop") != NULL)
+						{
+							meter_transaction_Result->energyImportTotalStop = json_object_get_double(json_object_object_get(json_object_object_get(json_object_object_get
+							(livemeasure, "meterValue"), "sampleValue"), "energyImportTotalStop"));
+							PR("energyImportTotalStop : %.3f\n",meter_transaction_Result->energyImportTotalStop);
+						}
+
+
+						if(json_object_object_get(json_object_object_get(json_object_object_get(livemeasure, "meterValue"), "sampleValue"), "energyExport") != NULL)
+						{
+							meter_transaction_Result->energyExport = json_object_get_double(json_object_object_get(json_object_object_get(json_object_object_get
+							(livemeasure, "meterValue"), "sampleValue"), "energyExport"));
+							PR("energyExport : %.3f\n",meter_transaction_Result->energyExport);
+						}
+
+						if(json_object_object_get(json_object_object_get(json_object_object_get(livemeasure, "meterValue"), "sampleValue"), "energyExportTotalStart") != NULL)
+						{
+							meter_transaction_Result->energyExportTotalStart = json_object_get_double(json_object_object_get(json_object_object_get(json_object_object_get
+							(livemeasure, "meterValue"), "sampleValue"), "energyExportTotalStart"));
+							PR("energyExportTotalStart : %.3f\n",meter_transaction_Result->energyExportTotalStart);
+						}
+
+						if(json_object_object_get(json_object_object_get(json_object_object_get(livemeasure, "meterValue"), "sampleValue"), "energyExportTotalStop") != NULL)
+						{
+							meter_transaction_Result->energyExportTotalStop = json_object_get_double(json_object_object_get(json_object_object_get(json_object_object_get
+							(livemeasure, "meterValue"), "sampleValue"), "energyExportTotalStop"));
+							PR("energyExportTotalStop : %.3f\n",meter_transaction_Result->energyExportTotalStop);
+						}
+						
+						if(json_object_object_get(livemeasure, "signature") != NULL)
+						{
+								sprintf((char*)&meter_transaction_Result->signature, "%s", json_object_get_string(json_object_object_get(livemeasure, "signature")));
+								PR("signature : %s\n",meter_transaction_Result->signature);										
+						}
+						
+						PR("\n\n\n\n\n\n\n\n");
+											
+				 	result = PASS;
 				}
-				json_object_put(livemeasure);
+			json_object_put(livemeasure);
+			json_object_put(TransactionStopData);		
+				
 			}
 			break;
 	}
-
+					
+	
+	
 	return result;
+	
 }
 
-/**
- * Export & import totalize energy read
- * @param meter_info
- * @return
- */
-int readEnergy(Meter_Info *meter_info)
+
+int readMeterTransactionOCMF(uint8_t meterIndex, Meter_transaction_Action *meter_transaction_Action)
 {
 	int result = FAIL;
-	uint8_t	data[4096];
-
+	char host[128]="";
+	uint8_t data[4096];
+		
+	sprintf(host, "http://192.168.0.%d/v1/ocmf?transactionId=%s",(31 + meterIndex),meter_transaction_Action->head.transactionId);
+ 	//printf ("host : %s\n",host);
+	
 	switch(meterModel)
 	{
 		case METER_MODEL_LEM_L18005A:
 		default:
-			if(httpGet((uint8_t*)meterApiAddress, data) != FAIL)
+
+			if(httpGet((uint8_t*)host,data)!= FAIL)	
 			{
+				
+				PR("Get %s\n",data);
+				sprintf((char*)&meter_transaction_Action->transactionOCMF, "%s", data);
+				//printf("GETOCMF %s\n",meter_transaction_Result->transactionOCMF);
 				json_object *livemeasure;
 				livemeasure = json_tokener_parse((char*)data);
+				
 				if(!is_error(livemeasure))
-				{
-					if(json_object_object_get(livemeasure, "voltage") != NULL)
-						meter_info->presetVoltage = json_object_get_double(json_object_object_get(livemeasure, "voltage"));
-
-					if(json_object_object_get(livemeasure, "current") != NULL)
-						meter_info->presentCurrent = json_object_get_double(json_object_object_get(livemeasure, "current"));
+				{							
+					result = PASS;
+				}
+				
+				json_object_put(livemeasure);
+				
+			}
+			break;
+	}
+					
+	
+	
+	return result;
+	
+}
 
-					if(json_object_object_get(livemeasure, "power") != NULL)
-						meter_info->presentPower = json_object_get_double(json_object_object_get(livemeasure, "power"));
 
-					if(json_object_object_get(livemeasure, "energyImportTotal") != NULL)
-						meter_info->totlizeImportEnergy = json_object_get_double(json_object_object_get(livemeasure, "energyImportTotal"));
-
-					if(json_object_object_get(livemeasure, "energyExportTotal") != NULL)
-						meter_info->totlizeExportEnergy = json_object_get_double(json_object_object_get(livemeasure, "energyExportTotal"));
+int readMeterLegal(uint8_t meterIndex, Meter_transaction_Action *meter_transaction_Action)
+{
+	int result = FAIL;
+	char host[128]="";
+	uint8_t data[4096];
+		
+	sprintf(host, "http://192.168.0.%d/v1/legal",(31 + meterIndex));
+ 	//printf ("host : %s\n",host);
+	
+	switch(meterModel)
+	{
+		case METER_MODEL_LEM_L18005A:
+		default:
 
+			if(httpGet((uint8_t*)host,data)!= FAIL)	
+			{
+				
+				json_object *livemeasure;
+				livemeasure = json_tokener_parse((char*)data);
+				
+				if(!is_error(livemeasure))
+				{	
+					if(json_object_object_get(livemeasure, "transactionId") != NULL)
+					{
+								sprintf((char*)&meter_transaction_Action->head.transactionId, "%s", json_object_get_string(json_object_object_get(livemeasure, "transactionId")));
+								PR("transactionId : %s\n",meter_transaction_Action->head.transactionId);										
+					}
 					result = PASS;
 				}
+				
 				json_object_put(livemeasure);
+				
 			}
 			break;
 	}
+					
+	
+	
+	return result;
+	
+}
 
+
+int configure_meter_time(uint8_t meterIndex)
+{
+	int result = FAIL;
+	
+	char host[256]="";
+	uint8_t	postdata[256];
+	uint8_t data[4096];
+		
+	time_t tmi;
+	struct tm* utcTime;
+
+	time(&tmi);
+	utcTime = gmtime(&tmi);
+	
+  //{"time": { "utc":"2022-06-29T13:09:26Z" }}
+	sprintf(host,"http://192.168.0.%d/v1/settings",(31 + meterIndex));
+	memset(postdata, 0, sizeof(postdata));
+	sprintf((char*)postdata,"{\"time\": { \"utc\":\"%d-%d-%dT%02d:%02d:%02dZ\" }}", (utcTime->tm_year+1900), (utcTime->tm_mon+1), (utcTime->tm_mday), (utcTime->tm_hour) % 24, utcTime->tm_min, utcTime->tm_sec);
+	//sprintf(postdata,"{\"time\": { \"utc\":\"%d-%d-%dT%02d:%02d:%02dZ\" }}", 2021, (utcTime->tm_mon+1), (utcTime->tm_mday), (utcTime->tm_hour) % 24, utcTime->tm_min, utcTime->tm_sec); 
+	
+		PR("Local time and date: %s\n", postdata);
+	
+	switch(meterModel)
+	{
+		case METER_MODEL_LEM_L18005A:
+		default:
+
+			if(httpPut((uint8_t*)host,postdata, data)!= FAIL)
+			{
+				json_object *livemeasure;
+				livemeasure = json_tokener_parse((char*)data);
+				
+				if(!is_error(livemeasure))
+				{							
+					PR("PutConfingTimeGet %s\n",data);
+					PR("\n\n\n\n\n\n\n\n");
+					
+					if(json_object_object_get(livemeasure, "result") != NULL)
+					{
+						PR("configure_meter_time resul: %d \n",json_object_get_int(json_object_object_get(livemeasure, "result")));
+					}
+				 	
+				 	result = PASS;
+				}
+			json_object_put(livemeasure);
+				
+			}
+			break;
+	}
+	
 	return result;
+	
 }
 

+ 129 - 6
EVSE/Modularization/DcMeter/meterComm.h

@@ -44,20 +44,143 @@ typedef struct METER_INFO
 	double presentPower;						// resolution: 1.000kw
 	double totlizeImportEnergy;			// resolution: 1.000kwh
 	double totlizeExportEnergy;			// resolution: 1.000kwh
-	uint8_t LinkStatus;								// 0 = unknow ,1 = link , 2 miss link
+	unsigned char timestamp[32];
+	unsigned char LinkStatus;								// 0 = unknow ,1 = link , 2 miss link
 }Meter_Info;
 
+
+typedef union
+{
+				unsigned char Status;
+        struct
+        {
+	    			unsigned char suLinkStatusIsOk:1;
+            unsigned char muFatalErrorOccured:1;
+            unsigned char transactionIsOnGoing:1;
+            unsigned char tamperingIsDetected:1;
+            unsigned char timeSyncStatusIsOk:1;
+            unsigned char overTemperatureIsDetected:1;
+            unsigned char reversedVoltage:1;
+            unsigned char suMeasureFailureOccurred:1;
+        }bits;
+        
+}StatusFlag;
+
+typedef union
+{
+        unsigned char Errors;
+        struct
+        {
+            unsigned char muInitIsFailed:1;
+            unsigned char suStateIsInvalid:1;
+            unsigned char versionCheckIsFailed:1;
+            unsigned char muRngInitIsFailed:1;
+            unsigned char muDataIntegrityIsFailed:1;
+            unsigned char muFwIntegrityIsFailed:1;
+            unsigned char suIntegrityIsFailed:1;
+            unsigned char logbookIntegrityIsFailed:1;
+            unsigned char logbookIsFull:1;
+            unsigned char memoryAccessIsFailed:1;
+            unsigned char muStateIsFailed:1;
+            unsigned char res:5;
+        }bits;
+        
+}ErrorFlag;
+   
+typedef struct METER_STATUS_INFO
+{
+	 	unsigned short StatusValue;
+		StatusFlag MeterStatusFlag;
+    
+		unsigned char applicationFirmwareVersion[16];
+    unsigned char applicationFirmwareAuthTag[32];
+    unsigned char legalFirmwareVersion[16];
+    unsigned char legalFirmwareAuthTag[32];
+    unsigned char sensorFirmwareVersion[16];
+    unsigned char sensorFirmwareCrc[4];
+
+    unsigned char Systime[32];
+    unsigned char ipAddress[32];
+    unsigned char meterId[32];
+
+		unsigned short ErrorValue;
+ 		ErrorFlag MeterErrorFlag;
+   
+   unsigned char publicKey[140];
+   unsigned char publicKeyOcmf[200];
+   unsigned short indexOfLastTransaction;
+   unsigned short numberOfStoredTransactions;
+}Meter_Status_Info;
+
+typedef struct METER_TRANSACTION_HEAD
+{
+    unsigned char evseId[32];
+    unsigned char transactionId[32];
+    unsigned char clientId[32];
+    unsigned short tariffId;
+    unsigned short cableId;
+    unsigned short userData[32];
+    
+}Meter_transaction_Head;
+
+
+typedef struct METER_TRANSACTION_ACTION
+{
+		Meter_transaction_Head head;
+		unsigned char transactionOCMF[512];
+		unsigned char OcmfInfoReady;               // 0 = nothing, 1 = ocmp info ready
+    unsigned char ActionCmd;                   //  0 = nothing ,1 = transaction Start , 2 transaction Stop , sync time
+    
+}Meter_transaction_Action;
+
+
+typedef union
+{
+				unsigned char Status;
+        struct
+        {
+	    			unsigned char intermediateRead:1;
+            unsigned char res:7;
+        }bits;
+        
+}TransactionReadlevel;
+
+typedef struct METER_TRANSACTION_RESULT
+{
+		unsigned short paginationCounter;
+		Meter_transaction_Head head;
+    unsigned char timestampStart[32];
+    unsigned char timestampStop[32];
+    unsigned int transactionDuration;
+    TransactionReadlevel intermediateRead;
+    unsigned int  transactionStatus;
+    unsigned char energyUnit[8];
+    double energyImport;
+    double energyImportTotalStart;
+    double energyImportTotalStop;
+    double energyExport;
+    double energyExportTotalStart;
+    double energyExportTotalStop;
+    unsigned char signature[140];
+    //unsigned char transactionOCMF[512];
+}Meter_transaction_Result;
+
+
+
 enum METER_MODEL
 {
 	METER_MODEL_LEM_L18005A=0,
 };
 
 extern void meterInitialize(uint8_t model);
-extern void meterApiAssign(uint8_t meterIndex);
-extern int readVoltage(Meter_Info *meter_info);
-extern int readCurrent(Meter_Info *meter_info);
-extern int readPower(Meter_Info *meter_info);
-extern int readEnergy(Meter_Info *meter_info);
+extern int readMeterLivemeasure(uint8_t meterIndex, Meter_Info *meter_info);
+extern int readMeterStatusInfo(uint8_t meterIndex, Meter_Status_Info *meter_status_info);
+extern int startMeterTransaction(uint8_t meterIndex, Meter_transaction_Action *meter_transaction_Action);
+extern int stopMeterTransaction(uint8_t meterIndex, Meter_transaction_Action *meter_transaction_Action,Meter_transaction_Result *meter_transaction_Result);
+extern int readMeterTransactionOCMF(uint8_t meterIndex, Meter_transaction_Action *meter_transaction_Action);
+extern int readMeterLegal(uint8_t meterIndex, Meter_transaction_Action *meter_transaction_Action);
+extern int configure_meter_time(uint8_t meterIndex);
+
 
 extern unsigned char 	meterModel;
 extern char				meterApiAddress[];

+ 50 - 6
EVSE/Modularization/Module_4g.c

@@ -112,7 +112,7 @@ void substr(char *dest, const char* src, unsigned int start, unsigned int cnt);
 
 char *portName[3] 				= {"/dev/ttyUSB2", "/dev/ttyACM2", "/dev/ttyACM2"};
 char *valid_Internet[2] 		= {"8.8.8.8", "180.76.76.76"};
-char *Version_And_Date[2]		= {"V0.13","2022-04-21"};
+char *Version_And_Date[2]		= {"V0.14","2022-09-12"};
 pid_t	pid;
 
 struct dongle_info
@@ -644,6 +644,7 @@ int isReadInfo(int connectStep)
 							if(sscanf(rx, "%*[^:]:%*[^,],%d,%*[^,],%*[^,],%*[^,],%*[^,],%[^,]", &Dongle.channel, Dongle.operator) == 2)
 							{
 								Dongle.MODE = NET_MODE_GSM_WCDMA;
+
 								memset(Dongle.band, 0x00, ARRAY_SIZE(Dongle.band));
 								memset(Dongle.act, 0x00, ARRAY_SIZE(Dongle.act));
 							}
@@ -1362,7 +1363,47 @@ void configNetworkMode(uint8_t actReq)
 	}
 	else if(Dongle.Model == DONGLE_THALES)
 	{
-		system("cp /root/ppp/ppp-on-dialer-org /root/ppp/ppp-on-dialer");
+		while (fgets(str, ARRAY_SIZE(str), fpOrg) != NULL)
+		{
+			fprintf(fpDst,"%s", str);
+
+			if(strstr(str, "ATE1") != NULL)
+			{
+				switch(actReq)
+				{
+					case NETWORK_MODE_GSM:
+						fprintf(fpDst, "	OK		\"AT\\^SCFG=\\\"Radio\\/Band\\/2G\\\",\\\"0000000f\\\"\"	\\\n");
+						fprintf(fpDst, "	OK		\\\\d\\\\d\\\\d				\\\n");
+						fprintf(fpDst, "	\"\"	\"AT\\^SCFG=\\\"Radio\\/Band\\/3G\\\",\\\"0\\\"\"	\\\n");
+						fprintf(fpDst, "	OK		\\\\d\\\\d\\\\d				\\\n");
+						fprintf(fpDst, "	\"\"	\"AT\\^SCFG=\\\"Radio\\/Band\\/4G\\\",\\\"0\\\",\\\"0\\\"\"	\\\n");
+						break;
+					case NETWORK_MODE_UMTS:
+						fprintf(fpDst, "	OK		\"AT\\^SCFG=\\\"Radio\\/Band\\/2G\\\",\\\"0\\\"\"	\\\n");
+						fprintf(fpDst, "	OK		\\\\d\\\\d\\\\d				\\\n");
+						fprintf(fpDst, "	\"\"	\"AT\\^SCFG=\\\"Radio\\/Band\\/3G\\\",\\\"000400bf\\\"\"	\\\n");
+						fprintf(fpDst, "	OK		\\\\d\\\\d\\\\d				\\\n");
+						fprintf(fpDst, "	\"\"	\"AT\\^SCFG=\\\"Radio\\/Band\\/4G\\\",\\\"0\\\",\\\"0\\\"\"	\\\n");
+						break;
+					case NETWORK_MODE_LTE:
+						fprintf(fpDst, "	OK		\"AT\\^SCFG=\\\"Radio\\/Band\\/2G\\\",\\\"0\\\"\"	\\\n");
+						fprintf(fpDst, "	OK		\\\\d\\\\d\\\\d				\\\n");
+						fprintf(fpDst, "	\"\"	\"AT\\^SCFG=\\\"Radio\\/Band\\/3G\\\",\\\"0\\\"\"	\\\n");
+						fprintf(fpDst, "	OK		\\\\d\\\\d\\\\d				\\\n");
+						fprintf(fpDst, "	\"\"	\"AT\\^SCFG=\\\"Radio\\/Band\\/4G\\\",\\\"0a0e18df\\\",\\\"00000002000001a0\\\"\"	\\\n");
+						break;
+					case NETWORK_MODE_AUTO:
+						fprintf(fpDst, "	OK		\"AT\\^SCFG=\\\"Radio\\/Band\\/2G\\\",\\\"0000000f\\\"\"	\\\n");
+						fprintf(fpDst, "	OK		\\\\d\\\\d\\\\d				\\\n");
+						fprintf(fpDst, "	\"\"	\"AT\\^SCFG=\\\"Radio\\/Band\\/3G\\\",\\\"000400bf\\\"\"	\\\n");
+						fprintf(fpDst, "	OK		\\\\d\\\\d\\\\d				\\\n");
+						fprintf(fpDst, "	\"\"	\"AT\\^SCFG=\\\"Radio\\/Band\\/4G\\\",\\\"0a0e18df\\\",\\\"00000002000001a0\\\"\"	\\\n");
+					default:
+						break;
+				}
+			}
+			memset(str, 0x00, ARRAY_SIZE(str));
+		}
 	}
 
 	fclose(fpOrg);
@@ -1672,10 +1713,13 @@ int main(void)
 						DEBUG_INFO("Device Channel: %d\n", Dongle.channel);
 					}
 
-					DEBUG_INFO("TX counter: %d bytes\n", Dongle.bytesTx);
-					DEBUG_INFO("RX counter: %d bytes\n", Dongle.bytesRx);
-					DEBUG_INFO("Delta counter: %d bytes\n", (Dongle.bytesTx+Dongle.bytesRx)-Dongle.lastCounter);
-					Dongle.lastCounter = (Dongle.bytesTx+Dongle.bytesRx);
+					if(Dongle.Model == DONGLE_QUECTEL)
+					{
+						DEBUG_INFO("TX counter: %d bytes\n", Dongle.bytesTx);
+						DEBUG_INFO("RX counter: %d bytes\n", Dongle.bytesRx);
+						DEBUG_INFO("Delta counter: %d bytes\n", (Dongle.bytesTx+Dongle.bytesRx)-Dongle.lastCounter);
+						Dongle.lastCounter = (Dongle.bytesTx+Dongle.bytesRx);
+					}
 					DEBUG_INFO("++++++++++++++++++++++++++++++++++++++++\n");
 
 					break;

+ 15 - 16
EVSE/Modularization/Module_PowerSharing.c

@@ -14,9 +14,11 @@
 //#define MODPS_FW_VER_NUM	(1)    //V/T0.01
 //#define MODPS_FW_DATE		("20220730")
 
-#define MODPS_FW_VER_NUM	(2)    //V/T0.02
-#define MODPS_FW_DATE		("20220815")
+//#define MODPS_FW_VER_NUM	(2)    //V/T0.02
+//#define MODPS_FW_DATE		("20220815")
 
+#define MODPS_FW_VER_NUM	(3)    //V/T0.03
+#define MODPS_FW_DATE		("20220908")
 
 //-----------------------------------------------------------------------------
 #if (MODPS_FW_VER_NUM >= 1)
@@ -28,10 +30,11 @@
 #define MODIFY_MODPS_LET_ON_HAND_ALL_USED
 #define MODIFY_MODPS_REDUCE_DEBUG_LOG
 #define FUNC_MODPS_WATCH_MODE
-#define FIX_MODPS_CONN_UPDATE_STATUS_LOOP_INDEX_INIT_VAL
 #endif
 //-----------------------------------------------------------------------------
-
+#if (MODPS_FW_VER_NUM >= 3)
+//Fix: Variable used by DC Model (PresentChargingPower), unit of it is kW, not W
+#endif
 //-----------------------------------------------------------------------------
 
 #define HTK_USE_XPRINT
@@ -743,11 +746,7 @@ int conn_update_status(int socketFd, Connector_Info *connectorInfo, uint8_t conn
 		if(ShmPowerSharing->Connection_Info[idx].socketFd == socketFd)
 		{
 			ShmPowerSharing->Connection_Info[idx].connectorCount = connectorCount;
-#ifdef FIX_MODPS_CONN_UPDATE_STATUS_LOOP_INDEX_INIT_VAL
 			for(uint8_t gun_index=0;gun_index<connectorCount;gun_index++)
-#else
-			for(uint8_t gun_index;gun_index<connectorCount;gun_index++)
-#endif
 			{
 				if(!ShmPowerSharing->Connection_Info[idx].connectorInfo[gun_index].isGunConnected && connectorInfo[gun_index].isGunConnected)
 				{
@@ -1185,8 +1184,8 @@ int tcpSocketClient(void)
 											output.buffer[4+(gun_index*6)+1] = ShmSysConfigAndInfo->SysInfo.ChademoChargingData[tempIndex].ConnectorPlugIn;
 											output.buffer[4+(gun_index*6)+2] = (ShmSysConfigAndInfo->SysInfo.localSharingInfo.AvailableShargingCurrent[gun_index]>>8)&0xff;
 											output.buffer[4+(gun_index*6)+3] = (ShmSysConfigAndInfo->SysInfo.localSharingInfo.AvailableShargingCurrent[gun_index]>>0)&0xff;
-											output.buffer[4+(gun_index*6)+4] = ((int)(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[gun_index].PresentChargingPower/220)>>8)&0xff;
-											output.buffer[4+(gun_index*6)+5] = ((int)(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[gun_index].PresentChargingPower/220)>>0)&0xff;
+											output.buffer[4+(gun_index*6)+4] = ((int)(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[gun_index].PresentChargingPower*1000/220)>>8)&0xff;
+											output.buffer[4+(gun_index*6)+5] = ((int)(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[gun_index].PresentChargingPower*1000/220)>>0)&0xff;
 										}
 									}
 									break;
@@ -1208,8 +1207,8 @@ int tcpSocketClient(void)
 											output.buffer[4+(gun_index*6)+1] = ShmSysConfigAndInfo->SysInfo.CcsChargingData[tempIndex].ConnectorPlugIn;
 											output.buffer[4+(gun_index*6)+2] = (ShmSysConfigAndInfo->SysInfo.localSharingInfo.AvailableShargingCurrent[gun_index]>>8)&0xff;
 											output.buffer[4+(gun_index*6)+3] = (ShmSysConfigAndInfo->SysInfo.localSharingInfo.AvailableShargingCurrent[gun_index]>>0)&0xff;
-											output.buffer[4+(gun_index*6)+4] = ((int)(ShmSysConfigAndInfo->SysInfo.CcsChargingData[gun_index].PresentChargingPower/220)>>8)&0xff;
-											output.buffer[4+(gun_index*6)+5] = ((int)(ShmSysConfigAndInfo->SysInfo.CcsChargingData[gun_index].PresentChargingPower/220)>>0)&0xff;
+											output.buffer[4+(gun_index*6)+4] = ((int)(ShmSysConfigAndInfo->SysInfo.CcsChargingData[gun_index].PresentChargingPower*1000/220)>>8)&0xff;
+											output.buffer[4+(gun_index*6)+5] = ((int)(ShmSysConfigAndInfo->SysInfo.CcsChargingData[gun_index].PresentChargingPower*1000/220)>>0)&0xff;
 										}
 									}
 									break;
@@ -1231,8 +1230,8 @@ int tcpSocketClient(void)
 											output.buffer[4+(gun_index*6)+1] = ShmSysConfigAndInfo->SysInfo.GbChargingData[tempIndex].ConnectorPlugIn;
 											output.buffer[4+(gun_index*6)+2] = (ShmSysConfigAndInfo->SysInfo.localSharingInfo.AvailableShargingCurrent[gun_index]>>8)&0xff;
 											output.buffer[4+(gun_index*6)+3] = (ShmSysConfigAndInfo->SysInfo.localSharingInfo.AvailableShargingCurrent[gun_index]>>0)&0xff;
-											output.buffer[4+(gun_index*6)+4] = ((int)(ShmSysConfigAndInfo->SysInfo.GbChargingData[gun_index].PresentChargingPower/220)>>8)&0xff;
-											output.buffer[4+(gun_index*6)+5] = ((int)(ShmSysConfigAndInfo->SysInfo.GbChargingData[gun_index].PresentChargingPower/220)>>0)&0xff;
+											output.buffer[4+(gun_index*6)+4] = ((int)(ShmSysConfigAndInfo->SysInfo.GbChargingData[gun_index].PresentChargingPower*1000/220)>>8)&0xff;
+											output.buffer[4+(gun_index*6)+5] = ((int)(ShmSysConfigAndInfo->SysInfo.GbChargingData[gun_index].PresentChargingPower*1000/220)>>0)&0xff;
 										}
 									}
 									break;
@@ -1247,8 +1246,8 @@ int tcpSocketClient(void)
 											output.buffer[4+(gun_index*6)+1] = ShmSysConfigAndInfo->SysInfo.ConnectorInfo[tempIndex].GeneralChargingData.ConnectorPlugIn;
 											output.buffer[4+(gun_index*6)+2] = (ShmSysConfigAndInfo->SysInfo.localSharingInfo.AvailableShargingCurrent[gun_index]>>8)&0xff;
 											output.buffer[4+(gun_index*6)+3] = (ShmSysConfigAndInfo->SysInfo.localSharingInfo.AvailableShargingCurrent[gun_index]>>0)&0xff;
-											output.buffer[4+(gun_index*6)+4] = ((int)(ShmSysConfigAndInfo->SysInfo.ConnectorInfo[gun_index].GeneralChargingData.PresentChargingPower/220)>>8)&0xff;
-											output.buffer[4+(gun_index*6)+5] = ((int)(ShmSysConfigAndInfo->SysInfo.ConnectorInfo[gun_index].GeneralChargingData.PresentChargingPower/220)>>0)&0xff;
+											output.buffer[4+(gun_index*6)+4] = ((int)(ShmSysConfigAndInfo->SysInfo.ConnectorInfo[gun_index].GeneralChargingData.PresentChargingPower*1000/220)>>8)&0xff;
+											output.buffer[4+(gun_index*6)+5] = ((int)(ShmSysConfigAndInfo->SysInfo.ConnectorInfo[gun_index].GeneralChargingData.PresentChargingPower*1000/220)>>0)&0xff;
 										}
 									}
 									break;

+ 91 - 23
EVSE/Modularization/Module_Systex.c

@@ -31,26 +31,26 @@
 //==================================
 // HOST ID, offset = 0, length = 2 bytes , 
 //==================================
-unsigned char HOST_ID_Auto[] = {0x30, 0x30};//信用卡/ 電子票證/ 掃碼支付
-unsigned char HOST_ID_CreditCard[] = {0x31, 0x30};//信用卡
-unsigned char HOST_ID_eTicket_Polling[] = {0x35, 0x30};//電子票證
+unsigned char HOST_ID_Auto[] = {0x30, 0x30};//靽∠鍂��/ �餃�蟡刻�/ ��Ⅳ�臭�
+unsigned char HOST_ID_CreditCard[] = {0x31, 0x30};//靽∠鍂��
+unsigned char HOST_ID_eTicket_Polling[] = {0x35, 0x30};//�餃�蟡刻�
 
 
 //==================================
 // Transaction Type, offset = 2, length = 2 bytes , 
 //==================================
-//-------------尋卡---------------
-unsigned char TRANS_TYPE_Search[] = {0x37, 0x32};	//讀取卡片卡號 or 條碼資料
-//--------------信用卡一般消費---------------
-unsigned char TRANS_TYPE_Sale[] = {0x31, 0x31};	//消費交易 : 信用卡,票證,掃碼支付
-unsigned char TRANS_TYPE_Void[] = {0x30, 0x35};//取消交易 : 信用卡,
-unsigned char TRANS_TYPE_Refund[] = {0x31, 0x32};//退貨交易 : 信用卡,票證,掃碼支付
-//--------------信用卡預授權---------------
-unsigned char TRANS_TYPE_Pre_Auth[] = {0x31, 0x33};	//預授權交易 : 信用卡
-unsigned char TRANS_TYPE_Pre_Auth_Complete[] = {0x33, 0x31};	//預授權完成交易 : 信用卡 
-unsigned char TRANS_TYPE_Pre_Auth_Cancel[] = {0x33, 0x32};	//取消預授權交易 : 信用卡 
-//--------------連動結帳---------------
-unsigned char TRANS_TYPE_UnionSettlement[] = {0x35, 0x41};	//連動結帳請款
+//-------------撠见㨃---------------
+unsigned char TRANS_TYPE_Search[] = {0x37, 0x32};	//霈��硋㨃��㨃�� or 璇萘Ⅳ鞈��
+//--------------靽∠鍂�∩��祆�鞎�---------------
+unsigned char TRANS_TYPE_Sale[] = {0x31, 0x31};	//瘨�祥鈭斗� : 靽∠鍂��,蟡刻�,��Ⅳ�臭�
+unsigned char TRANS_TYPE_Void[] = {0x30, 0x35};//�𡝗�鈭斗� : 靽∠鍂��,
+unsigned char TRANS_TYPE_Refund[] = {0x31, 0x32};//��鞎其漱�� : 靽∠鍂��,蟡刻�,��Ⅳ�臭�
+//--------------靽∠鍂�⊿����---------------
+unsigned char TRANS_TYPE_Pre_Auth[] = {0x31, 0x33};	//�鞉�甈𠹺漱�� : 靽∠鍂��
+unsigned char TRANS_TYPE_Pre_Auth_Complete[] = {0x33, 0x31};	//�鞉�甈𠰴��𣂷漱�� : 靽∠鍂�� 
+unsigned char TRANS_TYPE_Pre_Auth_Cancel[] = {0x33, 0x32};	//�𡝗��鞉�甈𠹺漱�� : 靽∠鍂�� 
+//--------------���蝯𣂼董---------------
+unsigned char TRANS_TYPE_UnionSettlement[] = {0x35, 0x41};	//���蝯𣂼董隢𧢲狡
 
 
 //==================================
@@ -240,7 +240,7 @@ reRecv:
 			}
 			else
 			{
-				if((time(NULL)-StartTime)>40)//卡機30 seconds timeout
+				if((time(NULL)-StartTime)>33)//�⊥�30 seconds timeout
 				{	
 					DEBUG_INFO_1("RecvResponse: read fail (%d / %d)\n", TotalRtn,len);
 					return -1;
@@ -311,13 +311,13 @@ int CreditCardSearch(int Fd,unsigned char *EVSEID, struct TransInfo *TransInfoRe
 //==========================================
 // CreditCardPreAuth
 // Input :
-//		PreCost : 預扣金額*100, e.g., $1234 = 123400, $1234.56=123456
+//		PreCost : �鞉緍�煾�*100, e.g., $1234 = 123400, $1234.56=123456
 //		EVSEID: EVSE ID, max length is 18
 // Output :
-//		ApprovalNo : EDC簽單調閱編號或授權碼[信用卡退貨交易, max length is 12
-//		RRN : 信用卡交易序號, max length is 12
-//		CardNum: 卡號,max length is 20
-//		VemData : 無人自助設備交易資訊 交易別31/32 (預授權完成/預授權取消) 必要欄位 資訊來源為交易別13 (預授權)的回傳, max length is 64
+//		ApprovalNo : EDC蝪賢鱓隤輸鰐蝺刻��𡝗�甈羓Ⅳ[靽∠鍂�⊿��鞎其漱��, max length is 12
+//		RRN : 靽∠鍂�∩漱�枏���, max length is 12
+//		CardNum: �∟�,max length is 20
+//		VemData : �∩犖�芸𨭌閮剖�鈭斗�鞈�� 鈭斗���31/32 (�鞉�甈𠰴���/�鞉�甈𠰴�瘨�) 敹��甈�� 鞈��靘���箔漱�枏ê̌13 (�鞉�甈�)�����, max length is 64
 //==========================================
 int CreditCardPreAuth(int Fd, int PreCost,unsigned char *EVSEID, struct TransInfo *TransInfoReturn)
 {
@@ -375,10 +375,78 @@ int CreditCardPreAuth(int Fd, int PreCost,unsigned char *EVSEID, struct TransInf
 	}	
 }
 
+
+//==========================================
+// CreditCardSale
+// Input :
+//		Cost : 瘨�祥�煾�*100, e.g., $1234 = 123400, $1234.56=123456
+//		EVSEID: EVSE ID, max length is 18
+// Output :
+//		ApprovalNo : EDC蝪賢鱓隤輸鰐蝺刻��𡝗�甈羓Ⅳ[靽∠鍂�⊿��鞎其漱��, max length is 12
+//		RRN : 靽∠鍂�∩漱�枏���, max length is 12
+//		CardNum: �∟�,max length is 20
+//		VemData : �∩犖�芸𨭌閮剖�鈭斗�鞈�� 鈭斗���31/32 (�鞉�甈𠰴���/�鞉�甈𠰴�瘨�) 敹��甈�� 鞈��靘���箔漱�枏ê̌13 (�鞉�甈�)�����, max length is 64
+//==========================================
+int CreditCardSale(int Fd, int Cost,unsigned char *EVSEID, struct TransInfo *TransInfoReturn)
+{
+	unsigned char Buffer[RequestLength], *ptr, tmpbuf[12];
+	
+	memset(Buffer,0x20,RequestLength);
+	ptr=Buffer;
+	strncpy((char *)ptr,(char *)HOST_ID_CreditCard,2);//Host ID
+	ptr+=2;
+	strncpy((char *)ptr,(char *)TRANS_TYPE_Sale,2);//Transaction type
+	ptr+=2;
+	memset(tmpbuf,0,sizeof(tmpbuf));
+	sprintf((char *)tmpbuf,"%d", Cost);
+	if(strlen((char *)tmpbuf)>12)
+	{
+		DEBUG_INFO_1("CreditCardSale: Wrong Cost (Cost=%d)\n", Cost);
+		return -1;
+	}	
+	memset(ptr,0x30,12);
+	strncpy((char *)ptr+12-(strlen((char *)tmpbuf)+2),(char *)tmpbuf,strlen((char *)tmpbuf));//Trans Amount
+	ptr+=12;//Trans Amount
+	ptr+=12;//Approval No
+	ptr+=20;//Card No
+	strncpy((char *)ptr,(char *)EVSEID, strlen((char *)EVSEID));
+	ptr+=18;//Store Id	
+	//ptr+=2;//Period
+	if(SendRequest(Fd, Buffer, RequestLength)>0)
+	{
+		memset(Buffer,0,RequestLength);
+		if(RecvResponse(Fd,Buffer)>0)
+		{
+			//for(int i=0;i<RequestLength;i++)
+				//printf("%x, ",Buffer[i] );
+			strncpy((char *)TransInfoReturn->TransAmount,(char *)Buffer+44,12);
+			strncpy((char *)TransInfoReturn->TransDate,(char *)Buffer+56,6);
+			strncpy((char *)TransInfoReturn->TransTime,(char *)Buffer+62,6);
+			strncpy((char *)TransInfoReturn->StoreId,(char *)Buffer+97,18);
+			strncpy((char *)TransInfoReturn->ROC,(char *)Buffer+12,12);
+			strncpy((char *)TransInfoReturn->ApprovalNo,(char *)Buffer+115,9);
+			strncpy((char *)TransInfoReturn->RRN,(char *)Buffer+124,12);
+			strncpy((char *)TransInfoReturn->CardNo,(char *)Buffer+24,20);
+			strncpy((char *)TransInfoReturn->VemData,(char *)Buffer+246,64);
+			return 1;
+		}	
+		else
+		{
+			DEBUG_INFO_1("CreditCardSale: RecvResponse failed\n");
+			return -1;
+		}	
+	}	
+	else
+	{
+		DEBUG_INFO_1("CreditCardSale: SendRequest failed\n");
+		return -1;
+	}	
+}
+
 //==========================================
 // CreditCardAuthComplete
 // Input :
-//		PreCost : 扣金額*100, e.g., $1234 = 123400, $1234.56=123456
+//		PreCost : ���憿�*100, e.g., $1234 = 123400, $1234.56=123456
 //		EVSEID: EVSE ID, max length is 18
 //		VemData : the VEM data from CreditCardPreAuth, max length is 64
 // Output :
@@ -441,7 +509,7 @@ int CreditCardPreAuthComplete(int Fd, int PreCost,unsigned char *EVSEID, unsigne
 //==========================================
 // CreditCardPreAuthCancel
 // Input :
-//		PreCost : 預扣金額*100, e.g., $1234 = 123400, $1234.56=123456
+//		PreCost : �鞉緍�煾�*100, e.g., $1234 = 123400, $1234.56=123456
 //		EVSEID: EVSE ID, max length is 18
 //		ApprovalNo: max length is 12
 //		CardNum :  max length is 20

+ 15 - 10
EVSE/Modularization/Module_Systex.h

@@ -51,21 +51,26 @@
 
 struct TransInfo
 {
-	unsigned char TransDate[6];	//交易日期
-	unsigned char TransTime[6];	//交易時間
-	unsigned char ROC[12];		//EDC簽單調閱編號 (左靠右補空白)
-	unsigned char ApprovalNo[9];		//授權碼[信用卡退貨交易] (左靠右補空白)
-	unsigned char StoreId[18];		//櫃號,機號,發票號碼(左靠右補空白)
-	unsigned char RRN[12];		//信用卡交易序號
-	unsigned char CardNo[20];		//卡號(左靠右補空白),卡號部份隱藏
-	unsigned char TransAmount[12];		//交易金額
-	unsigned char VemData[64];		//無人自助設備交易資訊 交易別31/32 (預授權完成/預授權取消) 必要欄位 資訊來源為交易別13 (預授權)的回傳
+	unsigned char TransDate[6];	//鈭斗��交�
+	unsigned char TransTime[6];	//鈭斗����
+	unsigned char ROC[12];		//EDC蝪賢鱓隤輸鰐蝺刻� (撌阡��唾�蝛箇蒾)
+	unsigned char ApprovalNo[9];		//���蝣墩靽∠鍂�⊿��鞎其漱�𨩇 (撌阡��唾�蝛箇蒾)
+	unsigned char StoreId[18];		//瑹��,璈蠘�,�潛巨�毺Ⅳ(撌阡��唾�蝛箇蒾)
+	unsigned char RRN[12];		//靽∠鍂�∩漱�枏���
+	unsigned char CardNo[20];		//�∟�(撌阡��唾�蝛箇蒾),�∟��其遢�梯�
+	unsigned char TransAmount[12];		//鈭斗��煾�
+	unsigned char VemData[64];		//�∩犖�芸𨭌閮剖�鈭斗�鞈�� 鈭斗���31/32 (�鞉�甈𠰴���/�鞉�甈𠰴�瘨�) 敹��甈�� 鞈��靘���箔漱�枏ê̌13 (�鞉�甈�)�����
+};
+enum CreditCardResult {
+	_CREDITCARD_FAIL,
+	_CREDITCARD_PASS,
+	_CREDITCARD_NOCARD,
 };
-
 int CreditCardSearch(int Fd,unsigned char *EVSEID, struct TransInfo *TransInfoReturn);
 int CreditCardPreAuth(int Fd, int PreCost,unsigned char *EVSEID, struct TransInfo *TransInfoReturn);
 int CreditCardPreAuthComplete(int Fd, int PreCost,unsigned char *EVSEID, unsigned char *VemData,struct TransInfo *TransInfoReturn);
 int CreditCardPreAuthCancel(int Fd, int PreCost,unsigned char *EVSEID, unsigned char *ApprovalNo, unsigned char *CardNum,unsigned char *VemData);
 int CreditCardUnionSettlement(int Fd,unsigned char *EVSEID,struct TransInfo *TransInfoReturn);
+int CreditCardSale(int Fd, int Cost,unsigned char *EVSEID, struct TransInfo *TransInfoReturn);
 
 #endif

+ 44 - 2
EVSE/Modularization/WebService.c

@@ -200,13 +200,13 @@ int ConnectorType(char* connector){
 	if(strcmp(connector, "0") == 0){
 		result= 0;
 	}
-	else if(strcmp(connector, "U") == 0 || strcmp(connector, "V") == 0 || strcmp(connector, "E") == 0 || strcmp(connector, "F") == 0 || strcmp(connector, "T") == 0 || strcmp(connector, "D") == 0 || strcmp(connector, "M") == 0 || strcmp(connector, "N") == 0 || strcmp(connector, "P") == 0 || strcmp(connector, "R") == 0 || strcmp(connector, "Y") == 0 || strcmp(connector, "Z") == 0){
+	else if(strcmp(connector, "U") == 0 || strcmp(connector, "V") == 0 || strcmp(connector, "E") == 0 || strcmp(connector, "F") == 0 || strcmp(connector, "T") == 0 || strcmp(connector, "D") == 0 || strcmp(connector, "M") == 0 || strcmp(connector, "N") == 0 || strcmp(connector, "P") == 0 || strcmp(connector, "R") == 0 || strcmp(connector, "Y") == 0 || strcmp(connector, "Z") == 0 || strcmp(connector, "I") == 0 || strcmp(connector, "Q") == 0){
 		result= 1;//CCS
 	}
 	else if(strcmp(connector, "G") == 0 || strcmp(connector, "B") == 0){
 		result= 2;//GB
 	}
-	else if(strcmp(connector, "J") == 0 || strcmp(connector, "K") == 0 || strcmp(connector, "L") == 0 || strcmp(connector, "S") == 0){
+	else if(strcmp(connector, "J") == 0 || strcmp(connector, "K") == 0 || strcmp(connector, "L") == 0 || strcmp(connector, "S") == 0 || strcmp(connector, "O") == 0){
 		result= 3;//CHAdeMO
 	}
 	else if(strcmp(connector, "1") == 0 || strcmp(connector, "2") == 0 || strcmp(connector, "3") == 0 || strcmp(connector, "4") == 0 || strcmp(connector, "5") == 0 || strcmp(connector, "6") == 0 || strcmp(connector, "7") == 0 || strcmp(connector, "8") == 0){
@@ -733,6 +733,7 @@ int main(int argc, char *argv[]) {
 			int MaxChargingDuration = 0;
 			int MaxChargingSoc = 0;
 			int StopChargingByButton = 0;
+			int FanControlPolicy = 0;
 			char *LocalWhiteCard0 = NULL;
 			char *LocalWhiteCard1 = NULL;
 			char *LocalWhiteCard2 = NULL;
@@ -798,6 +799,10 @@ int main(int argc, char *argv[]) {
 				StopChargingByButton = json_object_get_int(val_obj);
 				ShmSysConfigAndInfo->SysConfig.StopChargingByButton = StopChargingByButton;
 			}
+			if( json_object_object_get_ex(jobj, "FanControlPolicy", &val_obj) ) {
+				FanControlPolicy = json_object_get_int(val_obj);
+				ShmSysConfigAndInfo->SysConfig.FanControlPolicy = FanControlPolicy;
+			}
 			if( json_object_object_get_ex(jobj, "LocalWhiteCard0", &val_obj) ) {
 				LocalWhiteCard0 = (char*)json_object_get_string(val_obj);
 				strcpy((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[0],LocalWhiteCard0);
@@ -1832,6 +1837,7 @@ int main(int argc, char *argv[]) {
 		struct json_object *MaxChargingDuration;
 		struct json_object *MaxChargingSoc;
 		struct json_object *StopChargingByButton;
+		struct json_object *FanControlPolicy;
 		struct json_object *LocalWhiteCard[10];
 		struct json_object *LocalWhiteCardArr= json_object_new_array();
 		struct json_object *isBilling;
@@ -1956,6 +1962,8 @@ int main(int argc, char *argv[]) {
 		struct json_object *PowerSharingServerIP;
 		struct json_object *OcppReceiptrURL;
 		struct json_object *MaintainServerURL;
+		struct json_object *Private_Key;
+		struct json_object *Certificate;
 		/*for TTIA*/
 		struct json_object *isEnableTTIA;
 		struct json_object *server_addr;
@@ -2119,6 +2127,7 @@ int main(int argc, char *argv[]) {
 		MaxChargingDuration = json_object_new_int(ShmSysConfigAndInfo->SysConfig.MaxChargingDuration);
 		MaxChargingSoc = json_object_new_int(ShmSysConfigAndInfo->SysConfig.MaxChargingSoc);
 		StopChargingByButton = json_object_new_int(ShmSysConfigAndInfo->SysConfig.StopChargingByButton);
+		FanControlPolicy = json_object_new_int(ShmSysConfigAndInfo->SysConfig.FanControlPolicy);
 		LocalWhiteCard[0] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[0]);
 		LocalWhiteCard[1] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[1]);
 		LocalWhiteCard[2] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[2]);
@@ -2642,6 +2651,36 @@ int main(int argc, char *argv[]) {
 		MaintainServerSecurityPassword = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.MaintainServerSecurityPassword);
 		chargePointVendor = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.chargePointVendor);
 		MaintainServerURL = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.MaintainServerURL);
+		FILE *file;
+		char line[0];
+		Private_Key = json_object_new_string("");
+		file = popen("sha256sum /Storage/OCPP/certCP.key", "r");
+		if (NULL != file)
+		{
+			int i=0;
+			while (fgets(line, 65, file) != NULL)
+			{
+				if(i==0){
+					Private_Key = json_object_new_string(line);
+				}
+				i++;
+			}
+		}
+		pclose(file);
+		Certificate = json_object_new_string("");
+		file = popen("sha256sum /Storage/OCPP/certCP.pem", "r");
+		if (NULL != file)
+		{
+			int i=0;
+			while (fgets(line, 65, file) != NULL)
+			{
+				if(i==0){
+					Certificate = json_object_new_string(line);
+				}
+				i++;
+			}
+		}
+		pclose(file);
 		if(strcmp(IsDO, "AX") == 0 || strcmp(IsDO, "AW") == 0 || strcmp(IsAcDc, "D") == 0){
 			isEnableLocalPowerSharging = json_object_new_int(ShmSysConfigAndInfo->SysConfig.isEnableLocalPowerSharing);
 			PowerSharingCapacity = json_object_new_int(ShmSysConfigAndInfo->SysConfig.PowerSharingCapacityPower);
@@ -2772,6 +2811,7 @@ int main(int argc, char *argv[]) {
 		json_object_object_add(jobj2,"MaxChargingDuration",MaxChargingDuration);
 		json_object_object_add(jobj2,"MaxChargingSoc",MaxChargingSoc);
 		json_object_object_add(jobj2,"StopChargingByButton",StopChargingByButton);
+		json_object_object_add(jobj2,"FanControlPolicy",FanControlPolicy);
 		json_object_array_add(LocalWhiteCardArr,LocalWhiteCard[0]);
 		json_object_array_add(LocalWhiteCardArr,LocalWhiteCard[1]);
 		json_object_array_add(LocalWhiteCardArr,LocalWhiteCard[2]);
@@ -3076,6 +3116,8 @@ int main(int argc, char *argv[]) {
 		json_object_object_add(jobj4,"MaintainServerSecurityProfile",MaintainServerSecurityProfile);
 		json_object_object_add(jobj4,"MaintainServerSecurityPassword",MaintainServerSecurityPassword);
 		json_object_object_add(jobj4,"MaintainServerURL",MaintainServerURL);
+		json_object_object_add(jobj4,"Private_Key",Private_Key);
+		json_object_object_add(jobj4,"Certificate",Certificate);
 		if(strcmp(IsDO, "AX") == 0 || strcmp(IsDO, "AW") == 0 || strcmp(IsAcDc, "D") == 0){
 			json_object_object_add(jobj4,"isEnableLocalPowerSharging",isEnableLocalPowerSharging);
 			json_object_object_add(jobj4,"PowerSharingCapacity",PowerSharingCapacity);

+ 243 - 281
EVSE/Modularization/ocppfiles/MessageHandler.c

@@ -58,7 +58,7 @@ static int authorizeRetryTimes 		= 0;  //number of  Retry times
 // OCPP other variables
 //===============================
 static int HeartBeatWaitTime 						= 10;
-static int FirstHeartBeat 							= 0;
+static int FirstHeartBeat 							= FALSE;
 static int FirmwareStatusNotificationStatus 		= FIRMWARE_STATUS_IDLE;  // Idle
 static int DiagnosticsStatusNotificationStatus 		= DIAGNOSTIC_STATUS_IDLE; // Idle
 static char CurrentChargingProfileScheduleStr[30]	= {0};
@@ -1454,7 +1454,7 @@ void reportReaderStatus(int gun_index)
 	json_object_object_add(dataBuf, "creditNo", json_object_new_string((char*)ShmOCPP16Data->TcciCustomData.ReaderStatus[gun_index].creditNo));
 	json_object_object_add(dataBuf, "VEMData", json_object_new_string((char*)ShmOCPP16Data->TcciCustomData.VEMData[gun_index]));
 
-	sprintf((char*)ShmOCPP16Data->DataTransfer[0].Data, "%s", json_object_to_json_string_ext(dataBuf, JSON_C_TO_STRING_PLAIN));
+	sprintf((char*)ShmOCPP16Data->DataTransfer[gun_index].Data, "%s", json_object_to_json_string_ext(dataBuf, JSON_C_TO_STRING_PLAIN));
 	json_object_put(dataBuf);
 
 	ShmOCPP16Data->CsMsg.bits[gun_index].DataTransferReq = 1;
@@ -1618,6 +1618,144 @@ int syncDateTimeRTC(uint8_t *data)
 	return result.result;
 }
 
+//==========================================
+// Parse certificate content
+//==========================================
+int parseCertInfo(char *certPath, int parseType, char *data)
+{
+	int result = FAIL;
+	memset(data, 0, ARRAY_SIZE(data));
+	if(access(certPath,F_OK) != -1)
+	{
+		char temp[512] = {0};
+		char capturedData[256] = {0};
+		char hashType[10] = "SHA256";
+		FILE *fp;
+
+		// Need to get hash type first
+		sprintf(temp ,"openssl x509 -noout -text -in %s", certPath);
+		fp = popen(temp, "r");
+		if(fp)
+		{
+			while(fgets(temp, sizeof(temp), fp) != NULL)
+			{
+				if(strstr(temp, "Signature Algorithm:") != NULL)
+				{
+					result = PASS;
+					if(strstr(temp, "sha256") != NULL || strstr(temp, "SHA256") != NULL)
+						sprintf((char*)hashType, "SHA256");
+					else if(strstr(temp, "sha384") != NULL || strstr(temp, "SHA384") != NULL)
+						sprintf((char*)hashType, "SHA384");
+					else if(strstr(temp, "sha512") != NULL || strstr(temp, "SHA512") != NULL)
+						sprintf((char*)hashType, "SHA512");
+					else
+					{
+						DEBUG_INFO("Error: hashAlgorithm is illegal or missing.\n");
+						result = FAIL;
+					}
+					break;
+				}
+			}
+		}
+
+		switch(parseType)
+		{
+		case CERT_PARSE_HashAlgorithm:
+			sprintf((char*)data, hashType);
+			DEBUG_INFO("hashAlgorithm: %s\n", hashType);
+			break;
+
+		case CERT_PARSE_SerialNumber:
+			sprintf(temp ,"openssl x509 -noout -serial -in %s", certPath);
+			fp = popen(temp, "r");
+			if(fp)
+			{
+				while(fgets(temp, sizeof(temp), fp) != NULL)
+				{
+					if(strstr(temp, "serial=") != NULL)
+					{
+						sscanf(temp, "%*[^=]=%s", capturedData);
+						result = PASS;
+						break;
+					}
+				}
+				DEBUG_INFO("serialNumber: %s\n", capturedData);
+				sprintf((char*)data, capturedData);
+			}
+			break;
+
+		case CERT_PARSE_IssuerNameHash:
+			sprintf(temp ,"openssl x509 -noout -issuer -in %s | openssl dgst -%s", certPath, (char*)hashType);
+			fp = popen(temp, "r");
+			if(fp)
+			{
+				while(fgets(temp, sizeof(temp), fp) != NULL)
+				{
+					if(strstr(temp, "(stdin)=") != NULL)
+					{
+						sscanf(temp, "%*[^=]=%s", capturedData);
+						result = PASS;
+						break;
+					}
+				}
+				stringtrimspace(capturedData);
+				DEBUG_INFO("issuerNameHash: %s\n", capturedData);
+				sprintf((char*)data, capturedData);
+			}
+			break;
+
+		case CERT_PARSE_IssuerKeyHash:
+			sprintf(temp ,"openssl x509 -noout -pubkey -in %s | openssl dgst -%s", certPath, (char*)hashType);
+			fp = popen(temp, "r");
+			if(fp)
+			{
+				while(fgets(temp, sizeof(temp), fp) != NULL)
+				{
+					if(strstr(temp, "(stdin)=") != NULL)
+					{
+						sscanf(temp, "%*[^=]=%s", capturedData);
+						result = PASS;
+						break;
+					}
+				}
+				stringtrimspace(capturedData);
+				DEBUG_INFO("issuerKeyHash: %s\n", capturedData);
+				sprintf((char*)data, capturedData);
+			}
+			break;
+
+		case CERT_PARSE_OcspUrl:
+			//sprintf(temp ,"openssl x509 -noout -ocsp_uri -in %s", certPath);
+			sprintf(temp ,"openssl crl2pkcs7 -nocrl -certfile %s | openssl pkcs7 -print_certs -text -noout", certPath);
+			fp = popen(temp, "r");
+			if(fp)
+			{
+				while(fgets(temp, sizeof(temp), fp) != NULL)
+				{
+					if(strstr(temp, "OCSP - URI:") != NULL)
+					{
+						//strcpy((char*)data, temp);
+						sscanf(temp, "%*[^:]:%s", capturedData);
+						sprintf((char*)data, capturedData);
+						DEBUG_INFO("OCSP_URI: %s\n", data);
+						result = PASS;
+						break;
+					}
+				}
+			}
+			break;
+
+		default:
+			DEBUG_INFO("Parse type is invalid.\n");
+			break;
+		}
+
+		pclose(fp);
+	}
+
+	return result;
+}
+
 //==========================================
 // GetCompositeSchedule logic related function
 //==========================================
@@ -5753,21 +5891,55 @@ void CheckSystemValue(void)
 		if(isWebsocketSendable && (server_sign == TRUE) && (ShmOCPP16Data->v2g_extend.AuthorizeReq == 1))
 		{
 			memset(&ShmOCPP16Data->v2g_extend.Authorize.Response_idTokenInfo,0,sizeof(struct IdTokenInfoType));
+			int parseCertResult = FAIL;
 
 			json_object *data = json_object_new_object();
 			json_object *idToken = json_object_new_object();
 			json_object *iso15118CertificateHashData = json_object_new_array();
 
+			// Read CERTIFICATE_PnCAuth file content
+			if(access(CERTIFICATE_PnCAuth,F_OK) != -1)
+			{
+				memset(ShmOCPP16Data->v2g_extend.Authorize.certificate, 0x00, ARRAY_SIZE(ShmOCPP16Data->v2g_extend.Authorize.certificate));
+				FILE *fp=fopen(CERTIFICATE_PnCAuth,"r");
+				char *line = NULL;
+				size_t len = 0;
+
+				while(getline(&line, &len, fp) != -1)
+				{
+					//memcpy(&ShmOCPP16Data->v2g_extend.Authorize.certificate[strlen((char*)ShmOCPP16Data->v2g_extend.Authorize.certificate)], line, (strlen(line)-1));
+
+					strcat((char *)ShmOCPP16Data->v2g_extend.Authorize.certificate, line);
+				}
+				fclose(fp);
+			}
+
 			if(strlen((char*)ShmOCPP16Data->v2g_extend.Authorize.certificate) > 0)
 				json_object_object_add(data, "certificate", json_object_new_string((char*)ShmOCPP16Data->v2g_extend.Authorize.certificate));
 
-			strcpy((char *)ShmOCPP16Data->v2g_extend.Authorize.idToken.idToken, (const char *)ShmSysConfigAndInfo->SysConfig.UserId);
+			//strcpy((char *)ShmOCPP16Data->v2g_extend.Authorize.idToken.idToken, (const char *)ShmSysConfigAndInfo->SysConfig.UserId);
 			json_object_object_add(idToken, "idToken", json_object_new_string((char*)ShmOCPP16Data->v2g_extend.Authorize.idToken.idToken));
 			json_object_object_add(data, "idToken", idToken);
 
+			char parseData[512] = {0};
+			if(parseCertInfo(CERTIFICATE_PnCAuth, CERT_PARSE_HashAlgorithm, parseData) == PASS)
+				sprintf((char*)ShmOCPP16Data->v2g_extend.Authorize.iso15118CertificateHashData[0].hashAlgorithm, parseData);
+
+			if(parseCertInfo(CERTIFICATE_PnCAuth, CERT_PARSE_SerialNumber, parseData) == PASS)
+				sprintf((char*)ShmOCPP16Data->v2g_extend.Authorize.iso15118CertificateHashData[0].serialNumber, parseData);
+
+			if(parseCertInfo(CERTIFICATE_PnCAuth, CERT_PARSE_IssuerNameHash, parseData) == PASS)
+				sprintf((char*)ShmOCPP16Data->v2g_extend.Authorize.iso15118CertificateHashData[0].issuerNameHash, parseData);
+
+			if(parseCertInfo(CERTIFICATE_PnCAuth, CERT_PARSE_IssuerKeyHash, parseData) == PASS)
+				sprintf((char*)ShmOCPP16Data->v2g_extend.Authorize.iso15118CertificateHashData[0].issuerKeyHash, parseData);
+
+			if(parseCertInfo(CERTIFICATE_PnCAuth, CERT_PARSE_OcspUrl, parseData) == PASS && strlen((char*)parseData) >= 7)
+				strcpy((char*)ShmOCPP16Data->v2g_extend.Authorize.iso15118CertificateHashData[0].responderURL, parseData);
+
 			for(int idx=0; idx < 4; idx++)
 			{
-				if(strlen((char*)ShmOCPP16Data->v2g_extend.Authorize.iso15118CertificateHashData[idx].responderURL) >= 7)
+				if(strlen((char*)ShmOCPP16Data->v2g_extend.Authorize.iso15118CertificateHashData[idx].hashAlgorithm) > 0)
 				{
 					json_object *OCSPRequestDataType = json_object_new_object();
 					json_object_object_add(OCSPRequestDataType, "hashAlgorithm", json_object_new_string((char*)ShmOCPP16Data->v2g_extend.Authorize.iso15118CertificateHashData[idx].hashAlgorithm));
@@ -5777,17 +5949,28 @@ void CheckSystemValue(void)
 					json_object_object_add(OCSPRequestDataType, "responderURL", json_object_new_string((char*)ShmOCPP16Data->v2g_extend.Authorize.iso15118CertificateHashData[idx].responderURL));
 
 					json_object_array_add(iso15118CertificateHashData, OCSPRequestDataType);
+					parseCertResult = PASS;
 				}
 			}
-			json_object_object_add(data, "iso15118CertificateHashData", iso15118CertificateHashData);
 
-			sprintf((char*)ShmOCPP16Data->DataTransfer[0].VendorId, "org.openchargealliance.iso15118pnc");
-			sprintf((char*)ShmOCPP16Data->DataTransfer[0].MessageId,"Authorize");
-			sprintf((char*)ShmOCPP16Data->DataTransfer[0].Data, "%s", json_object_to_json_string_ext(data, JSON_C_TO_STRING_PLAIN));
-			json_object_put(data);
+			if(parseCertResult == PASS)
+			{
+				json_object_object_add(data, "iso15118CertificateHashData", iso15118CertificateHashData);
 
-			ShmOCPP16Data->CsMsg.bits[0].DataTransferReq = 1;
-			ShmOCPP16Data->v2g_extend.AuthorizeReq = 0;
+				sprintf((char*)ShmOCPP16Data->DataTransfer[0].VendorId, "org.openchargealliance.iso15118pnc");
+				sprintf((char*)ShmOCPP16Data->DataTransfer[0].MessageId,"Authorize");
+				sprintf((char*)ShmOCPP16Data->DataTransfer[0].Data, "%s", json_object_to_json_string_ext(data, JSON_C_TO_STRING_PLAIN));
+				json_object_put(data);
+
+				ShmOCPP16Data->CsMsg.bits[0].DataTransferReq = 1;
+				ShmOCPP16Data->v2g_extend.AuthorizeReq = 0;
+			}
+			else
+			{
+				sprintf((char*)ShmOCPP16Data->v2g_extend.Authorize.Response_certificateStatus, "NoCertificateAvailable");
+				sprintf((char*)ShmOCPP16Data->v2g_extend.Authorize.Response_idTokenInfo.status, "Invalid");
+				ShmOCPP16Data->v2g_extend.AuthorizeConf = 1;
+			}
 		}
 
 		if(isWebsocketSendable && (server_sign == TRUE) && (ShmOCPP16Data->v2g_extend.Get15118EVCertificateReq == 1))
@@ -6001,7 +6184,7 @@ int sendDataTransferRequest(int gun_index)
 	json_object_put(DataTransfer);
 
 	LWS_Send(message);
-	sprintf(tempdata, "DataTransfer,%d", (gun_index + 1));
+	sprintf(tempdata, "DataTransfer,%d", gun_index);
 	if(hashmap_operation(HASH_OP_ADD, guid, tempdata) == 1)
 	{
 		result = PASS;
@@ -6071,7 +6254,7 @@ int sendOcmfByDataTransferRequest(int gun_index)
 
 	json_object_put(DataTransfer);
 
-	sprintf(tempdata, "DataTransfer,%d", (gun_index + 1));
+	sprintf(tempdata, "DataTransfer,%d", gun_index );
 	if(hashmap_operation(HASH_OP_ADD, guid, tempdata) == 1)
 	{
 		result = PASS;
@@ -12034,13 +12217,17 @@ int handleDataTransferRequest(char *uuid, char *payload)
 		{
 			json_object *data;
 			data = json_tokener_parse(tempdata);
-
+			DEBUG_INFO("DeleteCertificate processing...\n");
 			if(!is_error(data))
 			{
-				sprintf((char*)ShmOCPP16Data->v2g_extend.DeleteCertificate.certificateHashData.hashAlgorithm, "%s", json_object_get_string(json_object_object_get(json_object_object_get(data, "certificateHashData"), "hashAlgorithm")));
-				sprintf((char*)ShmOCPP16Data->v2g_extend.DeleteCertificate.certificateHashData.issuerNameHash, "%s", json_object_get_string(json_object_object_get(json_object_object_get(data, "certificateHashData"), "issuerNameHash")));
-				sprintf((char*)ShmOCPP16Data->v2g_extend.DeleteCertificate.certificateHashData.issuerKeyHash, "%s", json_object_get_string(json_object_object_get(json_object_object_get(data, "certificateHashData"), "issuerKeyHash")));
-				sprintf((char*)ShmOCPP16Data->v2g_extend.DeleteCertificate.certificateHashData.serialNumber, "%s", json_object_get_string(json_object_object_get(json_object_object_get(data, "certificateHashData"), "serialNumber")));
+				if(json_object_object_get(json_object_object_get(data, "certificateHashData"), "hashAlgorithm") != NULL)
+					sprintf((char*)ShmOCPP16Data->v2g_extend.DeleteCertificate.certificateHashData.hashAlgorithm, "%s", json_object_get_string(json_object_object_get(json_object_object_get(data, "certificateHashData"), "hashAlgorithm")));
+				if(json_object_object_get(json_object_object_get(data, "certificateHashData"), "issuerNameHash") != NULL)
+					sprintf((char*)ShmOCPP16Data->v2g_extend.DeleteCertificate.certificateHashData.issuerNameHash, "%s", json_object_get_string(json_object_object_get(json_object_object_get(data, "certificateHashData"), "issuerNameHash")));
+				if(json_object_object_get(json_object_object_get(data, "certificateHashData"), "issuerKeyHash") != NULL)
+					sprintf((char*)ShmOCPP16Data->v2g_extend.DeleteCertificate.certificateHashData.issuerKeyHash, "%s", json_object_get_string(json_object_object_get(json_object_object_get(data, "certificateHashData"), "issuerKeyHash")));
+				if(json_object_object_get(json_object_object_get(data, "certificateHashData"), "serialNumber") != NULL)
+					sprintf((char*)ShmOCPP16Data->v2g_extend.DeleteCertificate.certificateHashData.serialNumber, "%s", json_object_get_string(json_object_object_get(json_object_object_get(data, "certificateHashData"), "serialNumber")));
 
 				DEBUG_INFO("hashAlgorithm: %s\n", ShmOCPP16Data->v2g_extend.DeleteCertificate.certificateHashData.hashAlgorithm);
 				DEBUG_INFO("issuerNameHash: %s\n", ShmOCPP16Data->v2g_extend.DeleteCertificate.certificateHashData.issuerNameHash);
@@ -12050,58 +12237,25 @@ int handleDataTransferRequest(char *uuid, char *payload)
 				char temp[256] = {0};
 				char compareData[256] = {0};
 				int  isMatch = TRUE;
-				FILE *fp;
 
 				// Check certV2G
 				if(access(CERTIFICATE_V2G,F_OK) != -1)
 				{
-					isMatch = FALSE;
-					sprintf(temp ,"openssl x509 -noout -serial -in %s", CERTIFICATE_V2G);
-					fp = popen(temp, "r");
-					if(fp)
-					{
-						while(fgets(temp, sizeof(temp), fp) != NULL)
-						{
-							if(strstr(temp, "serial=") != NULL)
-							{
-								DEBUG_INFO("Certificate enddate info: %s\n", temp);
-								sscanf(temp, "%*[^=]=%s", compareData);
-								break;
-							}
-						}
-					}
-					if(strcmp(compareData, (char*)ShmOCPP16Data->DeleteCertificate.certificateHashData.serialNumber) != 0)
+					parseCertInfo(CERTIFICATE_V2G, CERT_PARSE_SerialNumber, compareData);
+					if(strcmp(compareData, (char*)ShmOCPP16Data->v2g_extend.DeleteCertificate.certificateHashData.serialNumber) != 0)
 						isMatch = FALSE;
 
 					if(isMatch == TRUE)
 					{
-						memset(compareData, 0, ARRAY_SIZE(compareData));
-						sprintf(temp ,"openssl x509 -noout -issuer -in %s | openssl dgst -%s", CERTIFICATE_V2G, (char*)ShmOCPP16Data->DeleteCertificate.certificateHashData.hashAlgorithm);
-						fp = popen(temp, "r");
-						if(fp)
-						{
-							while(fgets(temp, sizeof(temp), fp) != NULL)
-							{
-								strcat(compareData, temp);
-							}
-						}
-						if(strstr(compareData, (char*)ShmOCPP16Data->DeleteCertificate.certificateHashData.serialNumber) == NULL)
+						parseCertInfo(CERTIFICATE_V2G, CERT_PARSE_IssuerNameHash, compareData);
+						if(strstr(compareData, (char*)ShmOCPP16Data->v2g_extend.DeleteCertificate.certificateHashData.issuerNameHash) == NULL)
 							isMatch = FALSE;
 					}
 
 					if(isMatch == TRUE)
 					{
-						memset(compareData, 0, ARRAY_SIZE(compareData));
-						sprintf(temp ,"openssl x509 -noout -pubkey -in %s | openssl dgst -%s", CERTIFICATE_V2G, (char*)ShmOCPP16Data->DeleteCertificate.certificateHashData.hashAlgorithm);
-						fp = popen(temp, "r");
-						if(fp)
-						{
-							while(fgets(temp, sizeof(temp), fp) != NULL)
-							{
-								strcat(compareData, temp);
-							}
-						}
-						if(strstr(compareData, (char*)ShmOCPP16Data->DeleteCertificate.certificateHashData.issuerKeyHash) == NULL)
+						parseCertInfo(CERTIFICATE_V2G, CERT_PARSE_IssuerKeyHash, compareData);
+						if(strstr(compareData, (char*)ShmOCPP16Data->v2g_extend.DeleteCertificate.certificateHashData.issuerKeyHash) == NULL)
 							isMatch = FALSE;
 					}
 
@@ -12181,7 +12335,9 @@ int handleDataTransferRequest(char *uuid, char *payload)
 			{
 				char tempCert[] = "/Storage/OCPP/tempInstallCertificate.pem";
 
-				sprintf((char*)ShmOCPP16Data->v2g_extend.InstallCertificate.certificateType, "%s", json_object_get_string(json_object_object_get(data, "certificateType")));
+				if(json_object_object_get(data, "certificateType") != NULL)
+					sprintf((char*)ShmOCPP16Data->v2g_extend.InstallCertificate.certificateType, "%s", json_object_get_string(json_object_object_get(data, "certificateType")));
+				if(json_object_object_get(data, "certificate") != NULL)
 				sprintf((char*)ShmOCPP16Data->v2g_extend.InstallCertificate.certificate, "%s", json_object_get_string(json_object_object_get(data, "certificate")));
 				DEBUG_INFO("certificateType: %s\n", (char*)ShmOCPP16Data->v2g_extend.InstallCertificate.certificateType);
 				DEBUG_INFO("certificate: %s\n", (char*)ShmOCPP16Data->v2g_extend.InstallCertificate.certificate);
@@ -15832,51 +15988,20 @@ int handleDeleteCertificateRequest(char *uuid, char *payload)
 		{
 			// Check CentralSystemRootCertificate
 			DEBUG_INFO("Checking CentralSystemRootCertificate...\n");
-			sprintf(temp ,"openssl x509 -noout -serial -in %s", ROOTCA_CS);
-			fp = popen(temp, "r");
-			if(fp)
-			{
-				while(fgets(temp, sizeof(temp), fp) != NULL)
-				{
-					if(strstr(temp, "serial=") != NULL)
-					{
-						sscanf(temp, "%*[^=]=%s", compareData);
-						break;
-					}
-				}
-				DEBUG_INFO("SerialNumber= %s...\n", compareData);
-			}
+			parseCertInfo(ROOTCA_CS, CERT_PARSE_SerialNumber, compareData);
 			if(strcmp(compareData, (char*)ShmOCPP16Data->DeleteCertificate.certificateHashData.serialNumber) != 0)
 				isMatch = FALSE;
 
 			if(isMatch == TRUE)
 			{
-				memset(compareData, 0, ARRAY_SIZE(compareData));
-				sprintf(temp ,"openssl x509 -noout -issuer -in %s | openssl dgst -%s", ROOTCA_CS, (char*)ShmOCPP16Data->DeleteCertificate.certificateHashData.hashAlgorithm);
-				fp = popen(temp, "r");
-				if(fp)
-				{
-					while(fgets(temp, sizeof(temp), fp) != NULL)
-					{
-						strcat(compareData, temp);
-					}
-				}
-				if(strstr(compareData, (char*)ShmOCPP16Data->DeleteCertificate.certificateHashData.serialNumber) == NULL)
+				parseCertInfo(ROOTCA_CS, CERT_PARSE_IssuerNameHash, compareData);
+				if(strstr(compareData, (char*)ShmOCPP16Data->DeleteCertificate.certificateHashData.issuerNameHash) == NULL)
 					isMatch = FALSE;
 			}
 
 			if(isMatch == TRUE)
 			{
-				memset(compareData, 0, ARRAY_SIZE(compareData));
-				sprintf(temp ,"openssl x509 -noout -pubkey -in %s | openssl dgst -%s", ROOTCA_CS, (char*)ShmOCPP16Data->DeleteCertificate.certificateHashData.hashAlgorithm);
-				fp = popen(temp, "r");
-				if(fp)
-				{
-					while(fgets(temp, sizeof(temp), fp) != NULL)
-					{
-						strcat(compareData, temp);
-					}
-				}
+				parseCertInfo(ROOTCA_CS, CERT_PARSE_IssuerKeyHash, compareData);
 				if(strstr(compareData, (char*)ShmOCPP16Data->DeleteCertificate.certificateHashData.issuerKeyHash) == NULL)
 					isMatch = FALSE;
 			}
@@ -15893,52 +16018,21 @@ int handleDeleteCertificateRequest(char *uuid, char *payload)
 		// Check ManufacturerRootCertificate
 		if(access(ROOTCA_MFG,F_OK) != -1)
 		{
-			isMatch = FALSE;
-			sprintf(temp ,"openssl x509 -noout -serial -in %s", ROOTCA_MFG);
-			fp = popen(temp, "r");
-			if(fp)
-			{
-				while(fgets(temp, sizeof(temp), fp) != NULL)
-				{
-					if(strstr(temp, "serial=") != NULL)
-					{
-						DEBUG_INFO("Certificate enddate info: %s\n", temp);
-						sscanf(temp, "%*[^=]=%s", compareData);
-						break;
-					}
-				}
-			}
+			isMatch = TRUE;
+			parseCertInfo(ROOTCA_MFG, CERT_PARSE_SerialNumber, compareData);
 			if(strcmp(compareData, (char*)ShmOCPP16Data->DeleteCertificate.certificateHashData.serialNumber) != 0)
 				isMatch = FALSE;
 
 			if(isMatch == TRUE)
 			{
-				memset(compareData, 0, ARRAY_SIZE(compareData));
-				sprintf(temp ,"openssl x509 -noout -issuer -in %s | openssl dgst -%s", ROOTCA_MFG, (char*)ShmOCPP16Data->DeleteCertificate.certificateHashData.hashAlgorithm);
-				fp = popen(temp, "r");
-				if(fp)
-				{
-					while(fgets(temp, sizeof(temp), fp) != NULL)
-					{
-						strcat(compareData, temp);
-					}
-				}
-				if(strstr(compareData, (char*)ShmOCPP16Data->DeleteCertificate.certificateHashData.serialNumber) == NULL)
+				parseCertInfo(ROOTCA_MFG, CERT_PARSE_IssuerNameHash, compareData);
+				if(strstr(compareData, (char*)ShmOCPP16Data->DeleteCertificate.certificateHashData.issuerNameHash) == NULL)
 					isMatch = FALSE;
 			}
 
 			if(isMatch == TRUE)
 			{
-				memset(compareData, 0, ARRAY_SIZE(compareData));
-				sprintf(temp ,"openssl x509 -noout -pubkey -in %s | openssl dgst -%s", ROOTCA_MFG, (char*)ShmOCPP16Data->DeleteCertificate.certificateHashData.hashAlgorithm);
-				fp = popen(temp, "r");
-				if(fp)
-				{
-					while(fgets(temp, sizeof(temp), fp) != NULL)
-					{
-						strcat(compareData, temp);
-					}
-				}
+				parseCertInfo(ROOTCA_MFG, CERT_PARSE_IssuerKeyHash, compareData);
 				if(strstr(compareData, (char*)ShmOCPP16Data->DeleteCertificate.certificateHashData.issuerKeyHash) == NULL)
 					isMatch = FALSE;
 			}
@@ -16159,89 +16253,21 @@ int handleGetInstalledCertificateIdsRequest(char *uuid, char *payload)
 		DEBUG_INFO("Requested Certificate: %s\n", (char*)ShmOCPP16Data->GetInstalledCertificateIds.certificateType);
 		sprintf((char*)ShmOCPP16Data->GetInstalledCertificateIds.Response_status, "Accepted");
 
-		char temp[512] = {0};
-		char capturedData[256] = {0};
-		char hashType[10] = {0};
-		FILE *fp;
-
 		// Check CentralSystemRootCertificate
 		if((strstr((char*)ShmOCPP16Data->GetInstalledCertificateIds.certificateType, "CentralSystemRootCertificate")!= NULL) && (access(ROOTCA_CS,F_OK) != -1))
 		{
-			memset(hashType, 0, ARRAY_SIZE(hashType));
-			sprintf(temp ,"openssl x509 -noout -text -in %s", ROOTCA_CS);
-			fp = popen(temp, "r");
-			if(fp)
-			{
-				while(fgets(temp, sizeof(temp), fp) != NULL)
-				{
-					if(strstr(temp, "Signature Algorithm:") != NULL)
-					{
-						if(strstr(temp, "sha256") != NULL)
-							sprintf((char*)hashType, "SHA256");
-						if(strstr(temp, "sha384") != NULL)
-							sprintf((char*)hashType, "SHA384");
-						if(strstr(temp, "sha512") != NULL)
-							sprintf((char*)hashType, "SHA512");
+			char parseData[512] = {0};
+			if(parseCertInfo(ROOTCA_MFG, CERT_PARSE_HashAlgorithm, parseData) == PASS)
+				sprintf((char*)ShmOCPP16Data->GetInstalledCertificateIds.Response_certificateHashData[0].hashAlgorithm, parseData);
 
-						break;
-					}
-				}
-				DEBUG_INFO("hashAlgorithm: %s\n", hashType);
-				sprintf((char*)ShmOCPP16Data->GetInstalledCertificateIds.Response_certificateHashData[0].hashAlgorithm, hashType);
-			}
+			if(parseCertInfo(ROOTCA_MFG, CERT_PARSE_SerialNumber, parseData) == PASS)
+				sprintf((char*)ShmOCPP16Data->GetInstalledCertificateIds.Response_certificateHashData[0].serialNumber, parseData);
 
-			memset(capturedData, 0, ARRAY_SIZE(capturedData));
-			sprintf(temp ,"openssl x509 -noout -serial -in %s", ROOTCA_CS);
-			fp = popen(temp, "r");
-			if(fp)
-			{
-				while(fgets(temp, sizeof(temp), fp) != NULL)
-				{
-					if(strstr(temp, "serial=") != NULL)
-					{
-						sscanf(temp, "%*[^=]=%s", capturedData);
-						break;
-					}
-				}
-				DEBUG_INFO("serialNumber: %s\n", capturedData);
-				sprintf((char*)ShmOCPP16Data->GetInstalledCertificateIds.Response_certificateHashData[0].serialNumber, capturedData);
-			}
-
-			memset(capturedData, 0, ARRAY_SIZE(capturedData));
-			sprintf(temp ,"openssl x509 -noout -issuer -in %s | openssl dgst -%s", ROOTCA_CS, (char*)hashType);
-			fp = popen(temp, "r");
-			if(fp)
-			{
-				while(fgets(temp, sizeof(temp), fp) != NULL)
-				{
-					if(strstr(temp, "(stdin)=") != NULL)
-					{
-						sscanf(temp, "%*[^=]=%s", capturedData);
-						break;
-					}
-				}
-				stringtrimspace(capturedData);
-				DEBUG_INFO("issuerNameHash: %s\n", capturedData);
-				sprintf((char*)ShmOCPP16Data->GetInstalledCertificateIds.Response_certificateHashData[0].issuerNameHash, capturedData);
-			}
+			if(parseCertInfo(ROOTCA_MFG, CERT_PARSE_IssuerNameHash, parseData) == PASS)
+				sprintf((char*)ShmOCPP16Data->GetInstalledCertificateIds.Response_certificateHashData[0].issuerNameHash, parseData);
 
-			memset(capturedData, 0, ARRAY_SIZE(capturedData));
-			sprintf(temp ,"openssl x509 -noout -pubkey -in %s | openssl dgst -%s", ROOTCA_CS, (char*)hashType);
-			fp = popen(temp, "r");
-			if(fp)
-			{
-				while(fgets(temp, sizeof(temp), fp) != NULL)
-				{
-					if(strstr(temp, "(stdin)=") != NULL)
-					{
-						sscanf(temp, "%*[^=]=%s", capturedData);
-						break;
-					}
-				}
-				stringtrimspace(capturedData);
-				DEBUG_INFO("issuerKeyHash: %s\n", capturedData);
-				sprintf((char*)ShmOCPP16Data->GetInstalledCertificateIds.Response_certificateHashData[0].issuerKeyHash, capturedData);
-			}
+			if(parseCertInfo(ROOTCA_MFG, CERT_PARSE_IssuerKeyHash, parseData) == PASS)
+				sprintf((char*)ShmOCPP16Data->GetInstalledCertificateIds.Response_certificateHashData[0].issuerKeyHash, parseData);
 		}
 		else
 		{
@@ -16252,81 +16278,18 @@ int handleGetInstalledCertificateIdsRequest(char *uuid, char *payload)
 		// Check ManufacturerRootCertificate
 		if((strstr((char*)ShmOCPP16Data->GetInstalledCertificateIds.certificateType, "ManufacturerRootCertificate") != NULL) && (access(ROOTCA_MFG,F_OK) != -1))
 		{
-			memset(hashType, 0, ARRAY_SIZE(hashType));
-			sprintf(temp ,"openssl x509 -noout -text -in %s", ROOTCA_MFG);
-			fp = popen(temp, "r");
-			if(fp)
-			{
-				while(fgets(temp, sizeof(temp), fp) != NULL)
-				{
-					if(strstr(temp, "Signature Algorithm:") != NULL)
-					{
-						if(strstr(temp, "sha256") != NULL)
-							sprintf((char*)hashType, "SHA256");
-						if(strstr(temp, "sha384") != NULL)
-							sprintf((char*)hashType, "SHA384");
-						if(strstr(temp, "sha512") != NULL)
-							sprintf((char*)hashType, "SHA512");
+			char parseData[512] = {0};
+			if(parseCertInfo(ROOTCA_MFG, 1, parseData) == PASS)
+				sprintf((char*)ShmOCPP16Data->GetInstalledCertificateIds.Response_certificateHashData[0].hashAlgorithm, parseData);
 
-						break;
-					}
-				}
-				DEBUG_INFO("hashAlgorithm: %s\n", hashType);
-				sprintf((char*)ShmOCPP16Data->GetInstalledCertificateIds.Response_certificateHashData[0].hashAlgorithm, hashType);
-			}
+			if(parseCertInfo(ROOTCA_MFG, 1, parseData) == PASS)
+				sprintf((char*)ShmOCPP16Data->GetInstalledCertificateIds.Response_certificateHashData[0].serialNumber, parseData);
 
-			memset(capturedData, 0, ARRAY_SIZE(capturedData));
-			sprintf(temp ,"openssl x509 -noout -serial -in %s", ROOTCA_MFG);
-			fp = popen(temp, "r");
-			if(fp)
-			{
-				while(fgets(temp, sizeof(temp), fp) != NULL)
-				{
-					if(strstr(temp, "serial=") != NULL)
-					{
-						sscanf(temp, "%*[^=]=%s", capturedData);
-						break;
-					}
-				}
-				DEBUG_INFO("serialNumber: %s\n", capturedData);
-				sprintf((char*)ShmOCPP16Data->GetInstalledCertificateIds.Response_certificateHashData[0].serialNumber, capturedData);
-			}
+			if(parseCertInfo(ROOTCA_MFG, 1, parseData) == PASS)
+				sprintf((char*)ShmOCPP16Data->GetInstalledCertificateIds.Response_certificateHashData[0].issuerNameHash, parseData);
 
-			memset(capturedData, 0, ARRAY_SIZE(capturedData));
-			sprintf(temp ,"openssl x509 -noout -issuer -in %s | openssl dgst -%s", ROOTCA_MFG, (char*)hashType);
-			fp = popen(temp, "r");
-			if(fp)
-			{
-				while(fgets(temp, sizeof(temp), fp) != NULL)
-				{
-					if(strstr(temp, "(stdin)=") != NULL)
-					{
-						sscanf(temp, "%*[^=]=%s", capturedData);
-						break;
-					}
-				}
-				stringtrimspace(capturedData);
-				DEBUG_INFO("issuerNameHash: %s\n", capturedData);
-				sprintf((char*)ShmOCPP16Data->GetInstalledCertificateIds.Response_certificateHashData[0].issuerNameHash, capturedData);
-			}
-
-			memset(capturedData, 0, ARRAY_SIZE(capturedData));
-			sprintf(temp ,"openssl x509 -noout -pubkey -in %s | openssl dgst -%s", ROOTCA_MFG, (char*)hashType);
-			fp = popen(temp, "r");
-			if(fp)
-			{
-				while(fgets(temp, sizeof(temp), fp) != NULL)
-				{
-					if(strstr(temp, "(stdin)=") != NULL)
-					{
-						sscanf(temp, "%*[^=]=%s", capturedData);
-						break;
-					}
-				}
-				stringtrimspace(capturedData);
-				DEBUG_INFO("issuerKeyHash: %s\n", capturedData);
-				sprintf((char*)ShmOCPP16Data->GetInstalledCertificateIds.Response_certificateHashData[0].issuerKeyHash, capturedData);
-			}
+			if(parseCertInfo(ROOTCA_MFG, 1, parseData) == PASS)
+				sprintf((char*)ShmOCPP16Data->GetInstalledCertificateIds.Response_certificateHashData[0].issuerKeyHash, parseData);
 		}
 		else
 		{
@@ -16739,6 +16702,7 @@ int handleInstallCertificateRequest(char *uuid, char *payload)
 					if(strstr(temp, "://") != NULL)
 					{
 						strcpy(ocspUrl, temp);
+						break;
 					}
 				}
 			}
@@ -17331,7 +17295,7 @@ void handleBootNotificationResponse(char *payload, int gun_index)
 void handleDataTransferResponse(char *payload, int gun_index)
 {
 	json_object *DataTransfer = json_tokener_parse(payload);
-
+	DEBUG_INFO("Corresponding gun-%d MessageId: %s\n", gun_index, ShmOCPP16Data->DataTransfer[gun_index].MessageId);
 	if(!is_error(DataTransfer))
 	{
 		// Required data
@@ -17361,7 +17325,6 @@ void handleDataTransferResponse(char *payload, int gun_index)
 							sprintf((char*)ShmOCPP16Data->v2g_extend.Authorize.Response_idTokenInfo.cacheExpiryDateTime, "%s", json_object_get_string(json_object_object_get(json_object_object_get(Data, "certificateStatus"), "cacheExpiryDateTime")));
 						}
 					}
-
 					ShmOCPP16Data->v2g_extend.AuthorizeConf = 1;
 				}
 				else if(strstr((char*)ShmOCPP16Data->DataTransfer[gun_index].MessageId, "Get15118EVCertificate") != NULL)
@@ -17548,7 +17511,6 @@ void handleStatusNotificationResponse(char *payload, int gun_index)
 	//cpinitateMsg.bits[gun_index].TriggerStatusNotificationReq = 0;
 	//cpinitateMsg.bits[gun_index].StatusNotificationReq = 0;
 	cpinitateMsg.bits[gun_index].StatusNotificationConf = 1;
-
 }
 
 void handleStopTransactionnResponse(char *payload, int gun_index)

+ 9 - 0
EVSE/Modularization/ocppfiles/MessageHandler.h

@@ -442,6 +442,15 @@ enum DIAGNOSTIC_NOTIFICATION_STATUS
 	DIAGNOSTIC_STATUS_UPLOADING =3
 };
 
+enum CERTIFICATE_PARSE_TYPE
+{
+	CERT_PARSE_HashAlgorithm = 0,
+	CERT_PARSE_SerialNumber = 1,
+	CERT_PARSE_IssuerNameHash = 2,
+	CERT_PARSE_IssuerKeyHash = 3,
+	CERT_PARSE_OcspUrl = 4
+};
+
 struct StructPeriod
 {
 	int		StartPeriod;

+ 1 - 1
EVSE/Modularization/ocppfiles/Module_OcppBackend.c

@@ -1361,7 +1361,7 @@ int main(void)
 	queueOpInfo.TransactionMessageResend = 0;
 
 	DEBUG_INFO("Module_OcppBackend task initialization...\n");
-	DEBUG_INFO("Git update date: 2022/09/02 \n");
+	DEBUG_INFO("Git update date: 2022/09/07 \n");
 	//lws_set_log_level(LLL_PARSER | LLL_HEADER | LLL_ERR | LLL_WARN | LLL_NOTICE | LLL_INFO | LLL_DEBUG | LLL_EXT | LLL_CLIENT | LLL_LATENCY  , NULL);
 
 	if(ProcessShareMemory()== FAIL)

+ 1 - 0
EVSE/Modularization/ocppfiles/Module_OcppBackend.h

@@ -56,6 +56,7 @@
 
 #define		CERTIFICATE_CP			"/Storage/OCPP/certCP.pem"							// for security profile 3
 #define		CERTIFICATE_V2G			"/Storage/OCPP/certV2G.pem"							// for 15118
+#define		CERTIFICATE_PnCAuth		"/Storage/OCPP/certPnCAuth.pem"						// for PnC authorization
 
 #define		PRIVATE_KEY_CP			"/Storage/OCPP/certCP.key"							// for security profile 3
 #define		PRIVATE_KEY_V2G			"/Storage/OCPP/certV2G.key"							// for 15118

BIN
EVSE/Projects/AW-CCS/Apps/CCS/CsuComm


BIN
EVSE/Projects/AW-CCS/Apps/CCS/SeccComm


BIN
EVSE/Projects/AW-CCS/Images/FactoryDefaultConfig.bin


BIN
EVSE/Projects/AW-CCS/Images/ramdisk.gz


+ 135 - 10
EVSE/Projects/define.h

@@ -610,7 +610,8 @@ struct SysConfigData
     unsigned char           MaintainServerSecurityPassword[41]; // Maintain server AuthorizationKey for security profile
     unsigned char           PowerSharingServerIP[512];          // Local power sharing server ip address
     unsigned int            PowerSharingCapacityPower;          // Local power sharing capacity power
-    unsigned char           MaxChargingSoc;                     //0: unlimit, 1 ~ 100 percent
+    unsigned char           MaxChargingSoc;                     // 0: unlimit, 1 ~ 100 percent
+    unsigned char			FanControlPolicy;					// 0: Auto mode		1: Quite mode
 };
 
 struct DERATING_BY_OTP
@@ -925,12 +926,126 @@ typedef union
 
 struct DC_METER_INFO
 {
-    double presetVoltage;                       // resolution: 1.000v
-    double presentCurrent;                      // resolution: 1.000a
-    double presentPower;                        // resolution: 1.000kw
-    double totlizeImportEnergy;                 // resolution: 1.000kwh
-    double totlizeExportEnergy;                 // resolution: 1.000kwh
-    unsigned char LinkStatus;                   // 0 = unknow ,1 = link , 2 miss link
+    double presetVoltage;						// resolution: 1.000v
+	double presentCurrent;					// resolution: 1.000a
+	double presentPower;						// resolution: 1.000kw
+	double totlizeImportEnergy;			// resolution: 1.000kwh
+	double totlizeExportEnergy;			// resolution: 1.000kwh
+	unsigned char timestamp[32];
+	unsigned char LinkStatus;								// 0 = unknow ,1 = link , 2 miss link
+};
+
+typedef union
+{
+		unsigned char Status;
+        struct
+        {
+	    			unsigned char suLinkStatusIsOk:1;
+            unsigned char muFatalErrorOccured:1;
+            unsigned char transactionIsOnGoing:1;
+            unsigned char tamperingIsDetected:1;
+            unsigned char timeSyncStatusIsOk:1;
+            unsigned char overTemperatureIsDetected:1;
+            unsigned char reversedVoltage:1;
+            unsigned char suMeasureFailureOccurred:1;
+        }bits;
+        
+}DcmbStatusFlag;
+
+typedef union
+{
+        unsigned char Errors;
+        struct
+        {
+            unsigned char muInitIsFailed:1;
+            unsigned char suStateIsInvalid:1;
+            unsigned char versionCheckIsFailed:1;
+            unsigned char muRngInitIsFailed:1;
+            unsigned char muDataIntegrityIsFailed:1;
+            unsigned char muFwIntegrityIsFailed:1;
+            unsigned char suIntegrityIsFailed:1;
+            unsigned char logbookIntegrityIsFailed:1;
+            unsigned char logbookIsFull:1;
+            unsigned char memoryAccessIsFailed:1;
+            unsigned char muStateIsFailed:1;
+            unsigned char res:5;
+        }bits;
+        
+}DcmbErrorFlag;
+   
+struct DC_METER_STATUS_INFO
+{
+	unsigned short StatusValue;
+	DcmbStatusFlag MeterStatusFlag;
+    
+	unsigned char applicationFirmwareVersion[16];
+    unsigned char applicationFirmwareAuthTag[32];
+    unsigned char legalFirmwareVersion[16];
+    unsigned char legalFirmwareAuthTag[32];
+    unsigned char sensorFirmwareVersion[16];
+    unsigned char sensorFirmwareCrc[4];
+
+    unsigned char Systime[32];
+    unsigned char ipAddress[32];
+    unsigned char meterId[32];
+
+	unsigned short ErrorValue;
+ 	DcmbErrorFlag MeterErrorFlag;
+   
+    unsigned char publicKey[140];
+    unsigned char publicKeyOcmf[200];
+    unsigned short indexOfLastTransaction;
+    unsigned short numberOfStoredTransactions;
+};
+
+struct DC_METER_TRANSACTION_HEAD
+{
+    unsigned char evseId[32];
+    unsigned char transactionId[32];
+    unsigned char clientId[32];
+    unsigned short tariffId;
+    unsigned short cableId;
+    unsigned short userData[32];
+    
+};
+
+struct DC_METER_TRANSACTION_ACTION
+{
+	struct DC_METER_TRANSACTION_HEAD head;
+	unsigned char transactionOCMF[512];
+	unsigned char OcmfInfoReady;                // 0 = nothing, 1 = ocmp info ready
+	unsigned char ActionCmd;                   // 1 = transaction Start, 2 transaction Stop, sync time
+};
+
+typedef union
+{
+				unsigned char Status;
+        struct
+        {
+	    			unsigned char intermediateRead:1;
+            unsigned char res:7;
+        }bits;
+        
+}DcmbTransactionReadlevel;
+
+struct DC_METER_TRANSACTION_RESULT
+{
+	unsigned short paginationCounter;
+	struct DC_METER_TRANSACTION_HEAD head;
+    unsigned char timestampStart[32];
+    unsigned char timestampStop[32];
+    unsigned int transactionDuration;
+    DcmbTransactionReadlevel intermediateRead;
+    unsigned int  transactionStatus;
+    unsigned char energyUnit[8];
+    double energyImport;
+    double energyImportTotalStart;
+    double energyImportTotalStop;
+    double energyExport;
+    double energyExportTotalStart;
+    double energyExportTotalStop;
+    unsigned char signature[140];
+    //unsigned char transactionOCMF[512];
 };
 
 typedef struct Bazel8Command
@@ -1081,6 +1196,10 @@ struct SysInfoData
     CabinetSettingFlag      CabinetSetting;
     struct LocalSharingInfo localSharingInfo;           // Local power sharing info structure
     struct DC_METER_INFO    DcMeterInfo[4];
+    struct DC_METER_STATUS_INFO DcMeterStatusInfo[4];
+    struct DC_METER_TRANSACTION_ACTION DcMeterReadTransactionRecord[4];
+    struct DC_METER_TRANSACTION_ACTION DcMeterTransactionAction[4];
+    struct DC_METER_TRANSACTION_RESULT DcMeterTransactionResult[4];
     unsigned char           OTPTemp;                    // OTP Temperature
     unsigned char           OTPTempR;                   // OTP Recovery Temperature
     struct LCD_OVERRIDE     LcdOveride;                 // LCD override info (no use anymore)
@@ -1414,7 +1533,7 @@ char AlarmStatusCode[160][6]=
     "012340",   // reserved
     "012341",   // reserved
     "012342",   // reserved
-    "012343",   // reserved
+    "012343",   // Tilt sensor self-test failed
     "012344",   // AC: Meter IC communication timeout
     "012345",   // AC: Pilot negative error
     "012346",   // Psu Communication error with CSU
@@ -1593,7 +1712,8 @@ struct AlarmCodeData
             unsigned char PsuPhaseOvp:1;                            //bit 5
             unsigned char :2;                                       //reserved bit 6 ~ bit 7
             //AlarmVal[17]
-            unsigned char :8;                                       //reserved bit 0 ~ bit 7
+            unsigned char :7;                                       //reserved bit 0 ~ bit 6
+            unsigned char TiltSensorStestFail:1;                    //reserved bit 7
             //AlarmVal[18]
             unsigned char MeterIcCommTimeout:1;                     //bit 0
             unsigned char PilotNegativeError:1;                     //bit 1
@@ -1603,7 +1723,12 @@ struct AlarmCodeData
 			unsigned char :3;                                       //reserved bit 4 ~ bit 7
             //AlarmVal[19]
             unsigned char PaymentCommTimeout:1;                     //Payment system communication timeout
-            unsigned char :7;                                       //reserved bit 1 ~ bit 7
+           	unsigned char MeterSlaveLosLink:1;                     	//DCMB meter slave module los link
+            unsigned char MeterSyncTimeError:1;            					//DCMB meter Sync Time Error
+            unsigned char MetertStartTransactionError:1;            //DCMB meter Start Transaction Error
+            unsigned char MetertStopTransactionError:1;             //DCMB meter Stop Transaction Error
+            unsigned char MetertGetTransactionOcmfError:1;          //DCMB meter Get OCMF Error        	
+            unsigned char :2;                                       //reserved bit 1 ~ bit 7
 		}bits;
 	}AlarmEvents;
 };

+ 4 - 2
EVSE/rootfs/root/ppp/ppp-on-dialer-org

@@ -39,7 +39,8 @@ exec /root/ppp/chat -v						\
 	""              "ATZ" 				\
 	OK              "ATE1" 				\
 	OK              "AT+CGDCONT=1,\"IP\",\"$APN\" " \
-        OK              "AT+CFUN=1"                     \
+	OK              \\d\\d\\d                       \
+        ""              "AT+CFUN=1"                     \
         OK              "AT+CGDATA=\"ppp\",1"         	\
 	TIMEOUT         22                              \
 	OK             	\\d\\d\\d			\
@@ -71,7 +72,8 @@ exec /root/ppp/chat -v						\
 	""              "ATZ" 				\
 	OK              "ATE1" 				\
 	OK              "AT+CGDCONT=1,\"IP\",\"$APN\" " \
-	OK              "AT+CFUN=1"                     \
+	OK              \\d\\d\\d                       \
+	""              "AT+CFUN=1"                     \
         OK              "AT+CGDATA=\"ppp\",1"         	\
         TIMEOUT         22                              \
 	OK             	\\d\\d\\d			\

+ 1 - 1
EVSE/rootfs/var/www/css/main.css

@@ -3610,7 +3610,7 @@ ul.envor-property-options li .fa {
 	width: 100%;
 }
 
-.envor-toggle article div {
+.envor-toggle article div:not(.file-upload):not(.file-input):not(.file-caption-main):not(.clearfix):not(.kv-fileinput-caption):not(.input-group-btn):not(.btn-file){
 /*	background-color: #f2f2f2;*/
 	padding: 10px;
     margin-bottom: 30px;

BIN
EVSE/rootfs/var/www/lang.db


+ 71 - 32
EVSE/rootfs/var/www/set_backend.php

@@ -239,11 +239,11 @@ CORE STYLES ABOVE - NO TOUCHY
 										</div>
 										<div class="form-group" style="display:<?php echo $am101;?>">
 											<label>Charge Box Id</label>
-											<input type="text" name="ChargeBoxId" id="ChargeBoxId" class="form-control" value="<?php echo $obj->{'ChargeBoxId'};?>">
+											<input type="text" name="ChargeBoxId" id="ChargeBoxId" class="form-control" value="<?php echo htmlspecialchars($obj->{'ChargeBoxId'});?>">
 										</div>
 										<div class="form-group" style="display:<?php echo $am101;?>">
 											<label><?php echo $lang->showWord("charge_point_vendor"); ?></label>
-											<input type="text" name="chargePointVendor" id="chargePointVendor" class="form-control" value="<?php echo $obj->{'chargePointVendor'};?>">
+											<input type="text" name="chargePointVendor" id="chargePointVendor" class="form-control" value="<?php echo htmlspecialchars($obj->{'chargePointVendor'});?>">
 										</div>
 										<div class="form-group" style="display:<?php echo $am101;?>">
 											<label><?php echo $lang->showWord("ocpp_security_profile"); ?></label>
@@ -256,7 +256,21 @@ CORE STYLES ABOVE - NO TOUCHY
 										</div>
 										<div id="OcppSecurityPasswordDiv" class="form-group" style="display:<?php echo $am101;?>">
 											<label><?php echo $lang->showWord("ocpp_security_password"); ?></label>
-											<input type="text" name="OcppSecurityPassword" id="OcppSecurityPassword" class="form-control" value="<?php echo $obj->{'OcppSecurityPassword'};?>">
+											<input type="text" name="OcppSecurityPassword" id="OcppSecurityPassword" class="form-control" value="<?php echo htmlspecialchars($obj->{'OcppSecurityPassword'});?>">
+										</div>
+										<div id="TLSwithClientSideCertificatesDiv" class="form-group file-upload" style="display:<?php echo $am101;?>">
+											<div class="file-upload">
+												<label><?php echo $lang->showWord("private_key_file"); ?> sha256 hash: <font color="#ff0000">(<?php echo strlen($obj->{'Private_Key'})>0?$obj->{'Private_Key'}:'File not found'?>)</font></label>
+												<div class="file-loading">
+													<input name="private_key" id="private_key" type="file" class="file" data-show-preview="false" data-show-upload="false">
+												</div>
+											</div>
+											<div class="file-upload">
+												<label><?php echo $lang->showWord("certificate_file"); ?> sha256 hash: <font color="#ff0000">(<?php echo strlen($obj->{'Certificate'})>0?$obj->{'Certificate'}:"File not found"?>)</font></label>
+												<div class="file-loading">
+													<input name="certificate" id="certificate" type="file" class="file" data-show-preview="false" data-show-upload="false">
+												</div>
+											</div>
 										</div>
 <?php if(substr($ModelName,0,2)=="AX" || substr($ModelName,0,2)=="AW" || substr($ModelName,0,1)=="D"){?>
 										<div class="form-group" style="display:block">
@@ -298,12 +312,12 @@ CORE STYLES ABOVE - NO TOUCHY
 												<option value="0" <?php echo $obj->{'MaintainServerSecurityProfile'}=="0"?"selected":""?>><?php echo $lang->showWord("none_security"); ?></option>
 												<option value="1" <?php echo $obj->{'MaintainServerSecurityProfile'}=="1"?"selected":""?>><?php echo $lang->showWord("unsecured_transport_with_basic_atuentication"); ?></option>
 												<option value="2" <?php echo $obj->{'MaintainServerSecurityProfile'}=="2"?"selected":""?>><?php echo $lang->showWord("tls_with_basic_authentication"); ?></option>
-												<option value="3" <?php echo $obj->{'MaintainServerSecurityProfile'}=="3"?"selected":""?>><?php echo $lang->showWord("tls_with_client_side_certificates"); ?></option>
+												<!--<option value="3" <?php echo $obj->{'MaintainServerSecurityProfile'}=="3"?"selected":""?>><?php echo $lang->showWord("tls_with_client_side_certificates"); ?></option>-->
 											</select>
 										</div>
 										<div id="MaintainServerSecurityPasswordDiv" class="form-group" style="display:<?php echo $am101;?>">
 											<label><?php echo $lang->showWord("maintain_server_security_password"); ?></label>
-											<input type="text" name="MaintainServerSecurityPassword" id="MaintainServerSecurityPassword" class="form-control" value="<?php echo $obj->{'MaintainServerSecurityPassword'};?>">
+											<input type="text" name="MaintainServerSecurityPassword" id="MaintainServerSecurityPassword" class="form-control" value="<?php echo htmlspecialchars($obj->{'MaintainServerSecurityPassword'});?>">
 										</div>
 									</section>
 								</article>
@@ -390,38 +404,46 @@ CORE STYLES ABOVE - NO TOUCHY
 			request.open("POST", "set_backend_action.php");
 
 			// POST 參數須使用 send() 發送
-			var data =  "BackendConnTimeout=" + document.getElementById("BackendConnTimeout").value +
-						"&OfflinePolicy=" + document.getElementById("OfflinePolicy").value +
-						"&OfflineMaxChargeEnergy=" + document.getElementById("OfflineMaxChargeEnergy").value+
-						"&OfflineMaxChargeDuration=" + document.getElementById("OfflineMaxChargeDuration").value+
-//						"&OcppConnStatus=" + document.getElementById("OcppConnStatus").value+
-						"&OcppServerURL=" + escape(document.getElementById("OcppServerURL").value)+
-						"&MaintainServerURL=" + escape(document.getElementById("MaintainServerURL").value)+
-						"&ChargeBoxId=" + escape(document.getElementById("ChargeBoxId").value)+
-						"&chargePointVendor=" + escape(document.getElementById("chargePointVendor").value)+
-						"&OcppSecurityProfile=" + document.getElementById("OcppSecurityProfile").value+
-						"&OcppSecurityPassword=" + escape(document.getElementById("OcppSecurityPassword").value)+
-						"&MaintainServerSecurityProfile=" + document.getElementById("MaintainServerSecurityProfile").value+
-						"&MaintainServerSecurityPassword=" + escape(document.getElementById("MaintainServerSecurityPassword").value);
+			var formData = new FormData();
+			var fileInput = document.getElementById('private_key');
+			var file = fileInput.files[0];
+			formData.append("private_key", file);
+			var fileInput = document.getElementById('certificate');
+			var file = fileInput.files[0];
+			formData.append("certificate", file);
+			formData.append("BackendConnTimeout", document.getElementById("BackendConnTimeout").value);
+			formData.append("OfflinePolicy", document.getElementById("OfflinePolicy").value);
+			formData.append("OfflineMaxChargeEnergy", document.getElementById("OfflineMaxChargeEnergy").value);
+			formData.append("OfflineMaxChargeDuration", document.getElementById("OfflineMaxChargeDuration").value);
+			formData.append("OcppServerURL", escapeHtml(document.getElementById("OcppServerURL").value));
+			formData.append("MaintainServerURL", escapeHtml(document.getElementById("MaintainServerURL").value));
+			formData.append("ChargeBoxId", escapeHtml(document.getElementById("ChargeBoxId").value));
+			formData.append("chargePointVendor", escapeHtml(document.getElementById("chargePointVendor").value));
+			formData.append("OcppSecurityProfile", document.getElementById("OcppSecurityProfile").value);
+			formData.append("OcppSecurityPassword", escapeHtml(document.getElementById("OcppSecurityPassword").value));
+			//formData.append("file", file);
+			formData.append("MaintainServerSecurityProfile", document.getElementById("MaintainServerSecurityProfile").value);
+			formData.append("MaintainServerSecurityPassword", escapeHtml(document.getElementById("MaintainServerSecurityPassword").value));
 <?php if(substr($ModelName,0,2)=="AX" || substr($ModelName,0,2)=="AW" || substr($ModelName,0,1)=="D"){?>
-				data += "&isEnableLocalPowerSharging=" + document.getElementById("isEnableLocalPowerSharging").value;
-				data += "&PowerSharingServerIP=" + document.getElementById("PowerSharingServerIP").value;
-				data += "&PowerSharingCapacity=" + document.getElementById("PowerSharingCapacity").value;
-				data += "&OcppReceiptrURL=" + document.getElementById("OcppReceiptrURL").value;
+			formData.append("isEnableLocalPowerSharging", document.getElementById("isEnableLocalPowerSharging").value);
+			formData.append("PowerSharingServerIP", document.getElementById("PowerSharingServerIP").value);
+			formData.append("PowerSharingCapacity", document.getElementById("PowerSharingCapacity").value);
+			formData.append("OcppReceiptrURL", escapeHtml(document.getElementById("OcppReceiptrURL").value));
 <?php } ?>
 <?php if(substr($ModelName,0,1)=="D" && substr($ModelName,3,1)=="C"){?>
-				data += "&isEnableTTIA=" + (document.getElementById("isEnableTTIA").checked?"1":"0")+
-						"&server_addr=" + document.getElementById("server_addr").value+
-						"&server_port=" + document.getElementById("server_port").value+
-						"&busVenderId=" + document.getElementById("busVenderId").value+
-						"&EquipmentProvider=" + document.getElementById("EquipmentProvider").value+
-						"&TransportationCompanyNo=" + document.getElementById("TransportationCompanyNo").value+
-						"&TTIAChargeBoxId=" + document.getElementById("TTIAChargeBoxId").value+
-						"&evseStation=" + document.getElementById("evseStation").value;
+			formData.append("isEnableTTIA", (document.getElementById("isEnableTTIA").checked?"1":"0"));
+			formData.append("server_addr", document.getElementById("server_addr").value);
+			formData.append("server_port", document.getElementById("server_port").value);
+			formData.append("busVenderId", document.getElementById("busVenderId").value);
+			formData.append("EquipmentProvider", document.getElementById("EquipmentProvider").value);
+			formData.append("TransportationCompanyNo", document.getElementById("TransportationCompanyNo").value);
+			formData.append("TTIAChargeBoxId", document.getElementById("TTIAChargeBoxId").value);
+			formData.append("evseStation", document.getElementById("evseStation").value);
 <?php } ?>
+
 			// POST 請求必須設置表頭在 open() 下面,send() 上面
-			request.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
-			request.send(data);
+//			request.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
+			request.send(formData);
 
 			request.onreadystatechange = function() {
 				// 伺服器請求完成
@@ -530,9 +552,16 @@ CORE STYLES ABOVE - NO TOUCHY
 	function OcppSecurityProfile_changed(){
 		if(document.getElementById("OcppSecurityProfile").value == "1" || document.getElementById("OcppSecurityProfile").value == "2" || document.getElementById("OcppSecurityProfile").value == "3"){
 			document.getElementById("OcppSecurityPasswordDiv").style.display="block";
+			if(document.getElementById("OcppSecurityProfile").value == "3"){
+				document.getElementById("TLSwithClientSideCertificatesDiv").style.display="block";
+			}
+			else{
+				document.getElementById("TLSwithClientSideCertificatesDiv").style.display="none";
+			}
 		}
 		else{
 			document.getElementById("OcppSecurityPasswordDiv").style.display="none";
+			document.getElementById("TLSwithClientSideCertificatesDiv").style.display="none";
 		}
 	}
 	function MaintainServerSecurityProfile_changed(){
@@ -613,6 +642,16 @@ CORE STYLES ABOVE - NO TOUCHY
 		len = str.replace(/%[A-F\d]{2}/g, 'U').length;
 		return len;
 	}
+	function escapeHtml(text) {
+		var map = {
+			'&': '&amp;',
+			'<': '&lt;',
+			'>': '&gt;',
+			'"': '&quot;',
+			"'": '&#039;'
+		};
+		return text.replace(/[&<>"']/g, function(m) { return map[m]; });
+	}
 </script>
 
 

+ 23 - 2
EVSE/rootfs/var/www/set_backend_action.php

@@ -14,7 +14,8 @@
 	function create() {
 		$pattern="/^(ws|wss):\/\/((([0-9]{1,3}\.){3}[0-9]{1,3})|(([a-zA-Z0-9]+(([\-]?[a-zA-Z0-9]+)*\.)+)*[a-zA-Z]{2,}))+/";
 		if($_REQUEST['OcppServerURL']!=""){
-			if(!preg_match($pattern, $_REQUEST['OcppServerURL'])){
+			$json['OcppServerURL']				= str_replace("&amp;","&",str_replace("&quot;",'"',str_replace("&#039;","'",str_replace("&lt;","<",str_replace("&gt;",">",$_REQUEST['OcppServerURL'])))));
+			if(!preg_match($pattern, $json['OcppServerURL'])){
 				$jsone['result'] = "Fail";
 				$jsone['message'] = "OcppServerURL format error, fill it with 'ws://' or 'wss://'";
 				echo json_encode($jsone);
@@ -22,7 +23,8 @@
 			}
 		}
 		if($_REQUEST['MaintainServerURL']!=""){
-			if(!preg_match($pattern, $_REQUEST['MaintainServerURL'])){
+			$json['MaintainServerURL']			= str_replace("&amp;","&",str_replace("&quot;",'"',str_replace("&#039;","'",str_replace("&lt;","<",str_replace("&gt;",">",$_REQUEST['MaintainServerURL'])))));
+			if(!preg_match($pattern, $json['MaintainServerURL'])){
 				$jsone['result'] = "Fail";
 				$jsone['message'] = "MaintainServerURL format error, fill it with 'ws://' or 'wss://'";
 				echo json_encode($jsone);
@@ -114,6 +116,25 @@
 			checkLength("evseStation",15);
 			$json['evseStation']				= str_replace("&amp;","&",str_replace("&quot;",'"',str_replace("&#039;","'",str_replace("&lt;","<",str_replace("&gt;",">",$_REQUEST['evseStation'])))));
 		}
+		$fCount = count($_FILES['private_key']['name']);
+		if($fCount>0){
+			if ($_FILES["private_key"]["error"] > 0)
+			{
+				echo "Return Code: " . $_FILES["private_key"]["error"] . "<br />";
+			}
+			sleep(1);
+			move_uploaded_file($_FILES["private_key"]["tmp_name"],"/Storage/OCPP/certCP.key");
+		}
+		$fCount = count($_FILES['certificate']['name']);
+		if($fCount>0){
+			if ($_FILES["certificate"]["error"] > 0)
+			{
+				echo "Return Code: " . $_FILES["certificate"]["error"] . "<br />";
+			}
+			sleep(1);
+			move_uploaded_file($_FILES["certificate"]["tmp_name"],"/Storage/OCPP/certCP.pem");
+		}
+
 //		ob_start();
 		
 		shell_exec('sync;sync;sync');

+ 2537 - 2529
EVSE/rootfs/var/www/set_charging.php

@@ -1,2529 +1,2537 @@
-<?php
-	ini_set('error_reporting', E_ALL | E_STRICT);
-	$tag_header = 'set';
-	include 'head.php';
-	$obj = json_decode(trim($output[1]),true);//var_dump($obj);
-	$system = json_decode(trim($output[0]),true);//var_dump($obj);
-	$RatingCurrent = $system['RatingCurrent'];
-	$AcRatingCurrent = $system['AcRatingCurrent'];
-	$ModelName = $system['ModelName'];
-	$RatingPower = substr($ModelName,4,2)*pow(10,-1+substr($ModelName,6,1));
-	$Connector1=substr($ModelName,7,1);
-	$Connector2=substr($ModelName,9,1);
-	$Connector3=substr($ModelName,8,1);
-	if(substr($ModelName,0,2)!="DO" && substr($ModelName,0,2)!="DK" && substr($ModelName,0,2)!="DB"){
-		$connectorType1=ConnectorType($Connector1);
-		$connectorType2=ConnectorType($Connector2);
-		$connectorType3=ConnectorType($Connector3);
-	}
-	$idx=0;
-	if($obj['ChargingInfo1']){
-		switch ($obj['ChargingInfo1']['SystemStatus']){
-			case 0:
-				$SystemStatus1='booting';
-				break;
-			case 1:
-				$SystemStatus1='idle';
-				break;
-			case 2:
-				$SystemStatus1='authorizing';
-				break;
-			case 3:
-				$SystemStatus1='reassign check';
-				break;
-			case 4:
-				$SystemStatus1='reassign';
-				break;
-			case 5:
-				$SystemStatus1='preparing';
-				break;
-			case 6:
-				$SystemStatus1='preparing for EV';
-				break;
-			case 7:
-				$SystemStatus1='preparing for evse';
-				break;
-			case 8:
-				$SystemStatus1='charging';
-				break;
-			case 9:
-				$SystemStatus1='terminating';
-				break;
-			case 10:
-				$SystemStatus1='complete';
-				break;
-			case 11:
-				$SystemStatus1='alarm';
-				break;
-			case 12:
-				$SystemStatus1='fault';
-				break;
-			case 13:
-				$SystemStatus1='reservation';
-				break;
-			case 14:
-				$SystemStatus1='booking';
-				break;
-			case 15:
-				$SystemStatus1='maintain';
-				break;
-			case 16:
-				$SystemStatus1='debug';
-				break;
-			case 17:
-				$SystemStatus1='precharge step 0';
-				break;
-			case 18:
-				$SystemStatus1='precharge step 1';
-				break;
-			case 19:
-				$SystemStatus1='update';
-				break;
-			default:
-				$SystemStatus1='unknown';
-				break;
-		}
-	}
-	if($obj['ChargingInfo2']){
-		switch ($obj['ChargingInfo2']['SystemStatus']){
-			case 0:
-				$SystemStatus2='booting';
-				break;
-			case 1:
-				$SystemStatus2='idle';
-				break;
-			case 2:
-				$SystemStatus2='authorizing';
-				break;
-			case 3:
-				$SystemStatus2='reassign check';
-				break;
-			case 4:
-				$SystemStatus2='reassign';
-				break;
-			case 5:
-				$SystemStatus2='preparing';
-				break;
-			case 6:
-				$SystemStatus2='preparing for EV';
-				break;
-			case 7:
-				$SystemStatus2='preparing for evse';
-				break;
-			case 8:
-				$SystemStatus2='charging';
-				break;
-			case 9:
-				$SystemStatus2='terminating';
-				break;
-			case 10:
-				$SystemStatus2='complete';
-				break;
-			case 11:
-				$SystemStatus2='alarm';
-				break;
-			case 12:
-				$SystemStatus2='fault';
-				break;
-			case 13:
-				$SystemStatus2='reservation';
-				break;
-			case 14:
-				$SystemStatus2='booking';
-				break;
-			case 15:
-				$SystemStatus2='maintain';
-				break;
-			case 16:
-				$SystemStatus2='debug';
-				break;
-			case 17:
-				$SystemStatus2='precharge step 0';
-				break;
-			case 18:
-				$SystemStatus2='precharge step 1';
-				break;
-			case 19:
-				$SystemStatus2='update';
-				break;
-			default:
-				$SystemStatus2='unknown';
-				break;
-		}
-	}
-	if($obj['ChargingInfo3']){
-		switch ($obj['ChargingInfo3']['SystemStatus']){
-			case 0:
-				$SystemStatus3='booting';
-				break;
-			case 1:
-				$SystemStatus3='idle';
-				break;
-			case 2:
-				$SystemStatus3='authorizing';
-				break;
-			case 3:
-				$SystemStatus3='reassign check';
-				break;
-			case 4:
-				$SystemStatus3='reassign';
-				break;
-			case 5:
-				$SystemStatus3='preparing';
-				break;
-			case 6:
-				$SystemStatus3='preparing for EV';
-				break;
-			case 7:
-				$SystemStatus3='preparing for evse';
-				break;
-			case 8:
-				$SystemStatus3='charging';
-				break;
-			case 9:
-				$SystemStatus3='terminating';
-				break;
-			case 10:
-				$SystemStatus3='complete';
-				break;
-			case 11:
-				$SystemStatus3='alarm';
-				break;
-			case 12:
-				$SystemStatus3='fault';
-				break;
-			case 13:
-				$SystemStatus3='reservation';
-				break;
-			case 14:
-				$SystemStatus3='booking';
-				break;
-			case 15:
-				$SystemStatus3='maintain';
-				break;
-			case 16:
-				$SystemStatus3='debug';
-				break;
-			case 17:
-				$SystemStatus3='precharge step 0';
-				break;
-			case 18:
-				$SystemStatus3='precharge step 1';
-				break;
-			case 19:
-				$SystemStatus3='update';
-				break;
-			default:
-				$SystemStatus3='unknown';
-				break;
-		}
-	}
-	if($obj['DDChargingInfo1']){
-		switch ($obj['DDChargingInfo1']['SystemStatus']){
-			case 0:
-				$DDSystemStatus1='booting';
-				break;
-			case 1:
-				$DDSystemStatus1='idle';
-				break;
-			case 2:
-				$DDSystemStatus1='authorizing';
-				break;
-			case 3:
-				$DDSystemStatus1='reassign check';
-				break;
-			case 4:
-				$DDSystemStatus1='reassign';
-				break;
-			case 5:
-				$DDSystemStatus1='preparing';
-				break;
-			case 6:
-				$DDSystemStatus1='preparing for EV';
-				break;
-			case 7:
-				$DDSystemStatus1='preparing for evse';
-				break;
-			case 8:
-				$DDSystemStatus1='charging';
-				break;
-			case 9:
-				$DDSystemStatus1='terminating';
-				break;
-			case 10:
-				$DDSystemStatus1='complete';
-				break;
-			case 11:
-				$DDSystemStatus1='alarm';
-				break;
-			case 12:
-				$DDSystemStatus1='fault';
-				break;
-			case 13:
-				$DDSystemStatus1='reservation';
-				break;
-			case 14:
-				$DDSystemStatus1='booking';
-				break;
-			case 15:
-				$DDSystemStatus1='maintain';
-				break;
-			case 16:
-				$DDSystemStatus1='debug';
-				break;
-			case 17:
-				$DDSystemStatus1='precharge step 0';
-				break;
-			case 18:
-				$DDSystemStatus1='precharge step 1';
-				break;
-			case 19:
-				$DDSystemStatus1='update';
-				break;
-			default:
-				$DDSystemStatus1='unknown';
-				break;
-		}
-	}
-	if($obj['DDChargingInfo2']){
-		switch ($obj['DDChargingInfo2']['SystemStatus']){
-			case 0:
-				$DDSystemStatus2='booting';
-				break;
-			case 1:
-				$DDSystemStatus2='idle';
-				break;
-			case 2:
-				$DDSystemStatus2='authorizing';
-				break;
-			case 3:
-				$DDSystemStatus2='reassign check';
-				break;
-			case 4:
-				$DDSystemStatus2='reassign';
-				break;
-			case 5:
-				$DDSystemStatus2='preparing';
-				break;
-			case 6:
-				$DDSystemStatus2='preparing for EV';
-				break;
-			case 7:
-				$DDSystemStatus2='preparing for evse';
-				break;
-			case 8:
-				$DDSystemStatus2='charging';
-				break;
-			case 9:
-				$DDSystemStatus2='terminating';
-				break;
-			case 10:
-				$DDSystemStatus2='complete';
-				break;
-			case 11:
-				$DDSystemStatus2='alarm';
-				break;
-			case 12:
-				$DDSystemStatus2='fault';
-				break;
-			case 13:
-				$DDSystemStatus2='reservation';
-				break;
-			case 14:
-				$DDSystemStatus2='booking';
-				break;
-			case 15:
-				$DDSystemStatus2='maintain';
-				break;
-			case 16:
-				$DDSystemStatus2='debug';
-				break;
-			case 17:
-				$DDSystemStatus2='precharge step 0';
-				break;
-			case 18:
-				$DDSystemStatus2='precharge step 1';
-				break;
-			case 19:
-				$DDSystemStatus2='update';
-				break;
-			default:
-				$DDSystemStatus2='unknown';
-				break;
-		}
-	}
-	if($obj['DDChargingInfo3']){
-		switch ($obj['DDChargingInfo3']['SystemStatus']){
-			case 0:
-				$DDSystemStatus3='booting';
-				break;
-			case 1:
-				$DDSystemStatus3='idle';
-				break;
-			case 2:
-				$DDSystemStatus3='authorizing';
-				break;
-			case 3:
-				$DDSystemStatus3='reassign check';
-				break;
-			case 4:
-				$DDSystemStatus3='reassign';
-				break;
-			case 5:
-				$DDSystemStatus3='preparing';
-				break;
-			case 6:
-				$DDSystemStatus3='preparing for EV';
-				break;
-			case 7:
-				$DDSystemStatus3='preparing for evse';
-				break;
-			case 8:
-				$DDSystemStatus3='charging';
-				break;
-			case 9:
-				$DDSystemStatus3='terminating';
-				break;
-			case 10:
-				$DDSystemStatus3='complete';
-				break;
-			case 11:
-				$DDSystemStatus3='alarm';
-				break;
-			case 12:
-				$DDSystemStatus3='fault';
-				break;
-			case 13:
-				$DDSystemStatus3='reservation';
-				break;
-			case 14:
-				$DDSystemStatus3='booking';
-				break;
-			case 15:
-				$DDSystemStatus3='maintain';
-				break;
-			case 16:
-				$DDSystemStatus3='debug';
-				break;
-			case 17:
-				$DDSystemStatus3='precharge step 0';
-				break;
-			case 18:
-				$DDSystemStatus3='precharge step 1';
-				break;
-			case 19:
-				$DDSystemStatus3='update';
-				break;
-			default:
-				$DDSystemStatus3='unknown';
-				break;
-		}
-	}
-	if($obj['DDChargingInfo4']){
-		switch ($obj['DDChargingInfo4']['SystemStatus']){
-			case 0:
-				$DDSystemStatus4='booting';
-				break;
-			case 1:
-				$DDSystemStatus4='idle';
-				break;
-			case 2:
-				$DDSystemStatus4='authorizing';
-				break;
-			case 3:
-				$DDSystemStatus4='reassign check';
-				break;
-			case 4:
-				$DDSystemStatus4='reassign';
-				break;
-			case 5:
-				$DDSystemStatus4='preparing';
-				break;
-			case 6:
-				$DDSystemStatus4='preparing for EV';
-				break;
-			case 7:
-				$DDSystemStatus4='preparing for evse';
-				break;
-			case 8:
-				$DDSystemStatus4='charging';
-				break;
-			case 9:
-				$DDSystemStatus4='terminating';
-				break;
-			case 10:
-				$DDSystemStatus4='complete';
-				break;
-			case 11:
-				$DDSystemStatus4='alarm';
-				break;
-			case 12:
-				$DDSystemStatus4='fault';
-				break;
-			case 13:
-				$DDSystemStatus4='reservation';
-				break;
-			case 14:
-				$DDSystemStatus4='booking';
-				break;
-			case 15:
-				$DDSystemStatus4='maintain';
-				break;
-			case 16:
-				$DDSystemStatus4='debug';
-				break;
-			case 17:
-				$DDSystemStatus4='precharge step 0';
-				break;
-			case 18:
-				$DDSystemStatus4='precharge step 1';
-				break;
-			case 19:
-				$DDSystemStatus4='update';
-				break;
-			default:
-				$DDSystemStatus4='unknown';
-				break;
-		}
-	}
-	
-	function ConnectorType($connector){
-		$result="";
-		if($connector == "0"){
-			$result= "";
-		}
-		else if($connector == "U" || $connector == "V" || $connector == "E" || $connector == "F" || $connector == "T" || $connector == "D" || $connector == "M" || $connector == "N" || $connector == "P" || $connector == "R" || $connector == "Y" || $connector == "Z"){
-			$result= "CCS";
-		}
-		else if($connector == "G" || $connector == "B" || $connector == "H" || $connector == "A"){
-			$result= "GB";
-		}
-		else if($connector == "J" || $connector == "K" || $connector == "L" || $connector == "S"){
-			$result= "CHAdeMO";
-		}
-		else if($connector == "1" || $connector == "2" || $connector == "3" || $connector == "4" || $connector == "5" || $connector == "6" || $connector == "7" || $connector == "8"){
-			$result= "AC";
-		}
-		else{
-			$result= "";
-		}
-		return $result;
-	}
-
-?>
-<style>
-img {
-  display: block;
-  margin-left: auto;
-  margin-right: auto;
-}
-<?php if(substr($ModelName,0,2)=="AX"){?>
-/* Colors: Default (blue) */
-.toggle-switchy {color:#fff;}
-.toggle-switchy > input + .toggle:before {content:'Calibrated';}
-.toggle-switchy > input + .toggle:after {content:'Default';}
-.toggle-switchy > input + .toggle > .switch {background:#fff;}
-.toggle-switchy > input + .toggle + .label {color:#000;}
-.toggle-switchy > input:checked + .toggle {background:#3498db;}
-.toggle-switchy > input:not(:checked) + .toggle {background:#ccc;}
-.toggle-switchy > input:checked + .toggle > .switch {border:3px solid #3498db;}
-.toggle-switchy > input:not(:checked) + .toggle > .switch {border:3px solid #ccc;}
-.toggle-switchy > input:focus + .toggle,
-.toggle-switchy > input:active + .toggle {box-shadow:0 0 5px 3px rgba(0, 119, 200, 0.50);}
-
-/* Rounded switch corners */
-.toggle-switchy > input + .toggle {border-radius:4px;}
-.toggle-switchy > input + .toggle .switch {border-radius:6px;}
-
-/* //////////////////////////
-CORE STYLES BELOW - NO TOUCHY
-////////////////////////// */
-.toggle-switchy {display:inline-flex; align-items:center; user-select:none; position:relative;}
-.toggle-switchy:hover {cursor:pointer;}
-.toggle-switchy > input {position:absolute; opacity:0;}
-.toggle-switchy > input + .toggle {align-items:center; position:relative;}
-.toggle-switchy > input + .toggle {overflow:hidden; position:relative; flex-shrink:0;}
-.toggle-switchy > input[disabled] + .toggle {opacity:0.5;}
-.toggle-switchy > input[disabled] + .toggle:hover {cursor:not-allowed;}
-.toggle-switchy > input + .toggle {width:100%; height:100%; margin:0; cursor:pointer;}
-.toggle-switchy > input + .toggle > .switch {display:block; height:100%; position:absolute; right:0; z-index:3;}
-
-/* Labels */
-.toggle-switchy > input + .toggle:before,
-.toggle-switchy > input + .toggle:after {display:flex; align-items:center; position:absolute; z-index:2; height:100%;}
-.toggle-switchy > input + .toggle:before {right:55%;}
-.toggle-switchy > input + .toggle:after {left:50%;}
-.toggle-switchy > input + .toggle + .label {margin-left:10px;}
-.toggle-switchy[data-label='left'] > input + .toggle {order:2;}
-.toggle-switchy[data-label='left'] > input + .toggle + .label {order:1; margin-left:0; margin-right:10px;}
-
-/* Show / Hide */
-.toggle-switchy > input + .toggle:before {opacity:0;}
-.toggle-switchy > input:checked + .toggle:before {opacity:1;}
-.toggle-switchy > input:checked + .toggle:after {opacity:0;}
-
-/* Transitions */
-.toggle-switchy > input + .toggle {transition:background 200ms linear, box-shadow 200ms linear;}
-.toggle-switchy > input + .toggle:before,
-.toggle-switchy > input + .toggle:after {transition:all 200ms linear;}
-.toggle-switchy > input + .toggle > .switch {transition:right 200ms linear, border-color 200ms linear;}
-/* //////////////////////////
-CORE STYLES ABOVE - NO TOUCHY
-////////////////////////// */
-
-/* Size: Extra Large */
-.toggle-switchy[data-size='xl'] > input + .toggle							{width:85px; height:40px;}
-.toggle-switchy[data-size='xl'] > input + .toggle > .switch					{width:40px;}
-.toggle-switchy[data-size='xl'] > input + .toggle:before,
-.toggle-switchy[data-size='xl'] > input + .toggle:after						{font-size:1.2rem;}
-.toggle-switchy[data-size='xl'] > input:not(:checked) + .toggle > .switch	{right:calc(100% - 40px);}
-
-/* Size: Large */
-.toggle-switchy[data-size='lg'] > input + .toggle							{width:75px; height:35px;}
-.toggle-switchy[data-size='lg'] > input + .toggle > .switch					{width:35px;}
-.toggle-switchy[data-size='lg'] > input + .toggle:before,
-.toggle-switchy[data-size='lg'] > input + .toggle:after						{font-size:1rem;}
-.toggle-switchy[data-size='lg'] > input:not(:checked) + .toggle > .switch	{right:calc(100% - 35px);}
-
-/* Size: Default (Medium) */
-.toggle-switchy > input + .toggle											{width:100px; height:30px;}
-.toggle-switchy > input + .toggle	> .switch								{width:30px;}
-.toggle-switchy > input + .toggle:before,
-.toggle-switchy > input + .toggle:after										{font-size:0.8rem;}
-.toggle-switchy > input:not(:checked) + .toggle > .switch					{right:calc(100% - 30px);}
-
-/* Size: Small */
-.toggle-switchy[data-size='sm'] > input + .toggle							{width:55px; height:25px;}
-.toggle-switchy[data-size='sm'] > input + .toggle > .switch					{width:25px;}
-.toggle-switchy[data-size='sm'] > input + .toggle:before,
-.toggle-switchy[data-size='sm'] > input + .toggle:after						{font-size:0.7rem;}
-.toggle-switchy[data-size='sm'] > input:not(:checked) + .toggle > .switch	{right:calc(100% - 25px);}
-
-/* Size: Extra Small */
-.toggle-switchy[data-size='xs'] > input + .toggle							{width:45px; height:20px;}
-.toggle-switchy[data-size='xs'] > input + .toggle > .switch					{width:20px;}
-.toggle-switchy[data-size='xs'] > input + .toggle:before,
-.toggle-switchy[data-size='xs'] > input + .toggle:after						{font-size:0.5rem;}
-.toggle-switchy[data-size='xs'] > input:not(:checked) + .toggle > .switch	{right:calc(100% - 20px);}
-
-/* Style: Rounded */
-.toggle-switchy[data-style='rounded'] > input + .toggle,
-.toggle-switchy[data-style='rounded'] > input + .toggle > .switch			{border-radius:50px;}
-.toggle-switchy[data-style='rounded'] > input + .toggle:before				{right:30%;}
-.toggle-switchy[data-style='rounded'] > input + .toggle:after				{left:40%;}
-
-/* Style: Square */
-.toggle-switchy[data-style='square'] > input + .toggle						{border-radius:0;}
-.toggle-switchy[data-style='square'] > input + .toggle .switch				{border-radius:0;}
-
-/* Text: Off */
-.toggle-switchy[data-text='false'] > input + .toggle:before,
-.toggle-switchy[data-text='false'] > input + .toggle:after					{content:'';}
-.toggle-switchy[data-text='false'][data-size='xl'] > input + .toggle		{width:80px;}
-.toggle-switchy[data-text='false'][data-size='lg'] > input + .toggle		{width:70px;}
-.toggle-switchy[data-text='false'] > input + .toggle						{width:60px;}
-.toggle-switchy[data-text='false'][data-size='sm'] > input + .toggle		{width:50px;}
-.toggle-switchy[data-text='false'][data-size='xs'] > input + .toggle		{width:40px;}
-
-/* Color: Red */
-.toggle-switchy[data-color='red'] > input:checked + .toggle					{background:#e74c3c;}
-.toggle-switchy[data-color='red'] > input:checked + .toggle > .switch		{border-color:#e74c3c;}
-
-/* Color: Orange */
-.toggle-switchy[data-color='orange'] > input:checked + .toggle				{background:#e67e22;}
-.toggle-switchy[data-color='orange'] > input:checked + .toggle > .switch	{border-color:#e67e22;}
- 
- /* Color: Yellow */
-.toggle-switchy[data-color='yellow'] > input:checked + .toggle				{background:#f1c40f;}
-.toggle-switchy[data-color='yellow'] > input:checked + .toggle > .switch	{border-color:#f1c40f;}
-
-/* Color: Green */
-.toggle-switchy[data-color='green'] > input:checked + .toggle				{background:#2ecc71;}
-.toggle-switchy[data-color='green'] > input:checked + .toggle > .switch		{border-color:#2ecc71;}
-
-/* Color: Blue */
-.toggle-switchy[data-color='blue'] > input:checked + .toggle				{background:#3498db;}
-.toggle-switchy[data-color='blue'] > input:checked + .toggle > .switch		{border-color:#3498db;}
-
-/* Color: Purple */
-.toggle-switchy[data-color='purple'] > input:checked + .toggle				{background:#9b59b6;}
-.toggle-switchy[data-color='purple'] > input:checked + .toggle > .switch	{border-color:#9b59b6;}
-
-/* Color: Gray */
-.toggle-switchy[data-color='gray'] > input:checked + .toggle				{background:#555;}
-.toggle-switchy[data-color='gray'] > input:checked + .toggle > .switch		{border-color:#555;}
-<?php } ?>
-</style>
-	<div class="envor-content">
-		<!--
-		Page Title start
-		//-->
-		<section class="envor-page-title-1" data-stellar-background-ratio="0.5">
-			<div class="container">
-				<div class="row">
-					<div class="col-lg-9 col-md-9 col-sm-9">
-						<h1><?php echo $lang->showWord("charging"); ?></h1>
-					</div>
-				</div>
-			</div>
-		<!--
-		Page Title end
-		//-->
-		</section>
-		<!--
-		Main Content start
-		//-->
-		<a id="loadinghref"><div id="loading" style="display:none;"><input type="hidden" name="ModelName" id="ModelName" value="<?php echo $ModelName;?>"><img src="img/giphy.gif"/></div></a>
-		<section class="envor-section">
-			<div class="container">
-				<div class="row">
-					<div class="col-lg-12">         
-						<div class="envor-sorting" id="faq-sorting">
-							<div class="envor-toggle">
-								<!--Charging relevant parameters-->
-								<article class="envor-sorting-item css">
-									<header><?php echo $lang->showWord("charging_relevant_parameters"); ?><i class="fa fa-plus"></i></header>
-									<section>
-										<div class="form-group" style="display:<?php echo $am111;?>">
-											<label id="MaxChargingEnergyLbl">Max Charging Energy</label>
-											<small class="form-text text-muted-red">kWh</small>
-											<input type="text" name="MaxChargingEnergy" id="MaxChargingEnergy" class="form-control" value="<?php echo $obj['MaxChargingEnergy'];?>" placeholder="<?php echo ($obj['MaxChargingEnergy']==0||$obj['MaxChargingEnergy']=="")?"'0' means unlimit":"";?>" title="'0' means unlimit">
-											<small class="form-text text-muted-red"><label id="MaxChargingEnergyText" style="display:none;">'0' means unlimit</label></small>
-										</div>
-										<div class="form-group" style="display:<?php echo $am001;?>">
-											<label id="MaxChargingPowerLbl">Max Charging Power</label>
-											<small class="form-text text-muted-red">kW</small>
-											<input type="text" name="MaxChargingPower" id="MaxChargingPower" class="form-control" value="<?php echo $obj['MaxChargingPower'];?>" placeholder="<?php echo ($obj['MaxChargingPower']==0||$obj['MaxChargingPower']=="")?"'0' means unlimit":"";?>" title="'0' means unlimit">
-											<input type="hidden" name="RatingPower" id="RatingPower" value="<?php echo $RatingPower;?>">
-											<small class="form-text text-muted-red"><label id="MaxChargingPowerText" style="display:none;">'0' means unlimit</label></small>
-										</div>
-										<div class="form-group" style="display:<?php echo $am111;?>">
-											<label id="MaxChargingCurrentLbl">Max Charging Current</label>
-											<small class="form-text text-muted-red">amp</small>
-											<input type="text" name="MaxChargingCurrent" id="MaxChargingCurrent" class="form-control" value="<?php echo $obj['MaxChargingCurrent'];?>" placeholder="<?php echo ($obj['MaxChargingCurrent']==0||$obj['MaxChargingCurrent']=="")?"'0' means unlimit":"";?>" title="'0' means unlimit">
-											<input type="hidden" name="RatingCurrent" id="RatingCurrent" value="<?php echo $RatingCurrent;?>">
-											<small class="form-text text-muted-red"><label id="MaxChargingCurrentText" style="display:none;">'0' means unlimit</label></small>
-										</div>
-										<div class="form-group" style="display:<?php echo $am111;?>">
-											<label id="MaxChargingDurationLbl">Max Charging Duration</label>
-											<small class="form-text text-muted-red">minutes</small>
-											<input type="text" name="MaxChargingDuration" id="MaxChargingDuration" class="form-control" value="<?php echo $obj['MaxChargingDuration'];?>" placeholder="<?php echo ($obj['MaxChargingDuration']==0||$obj['MaxChargingDuration']=="")?"'0' means unlimit":"";?>" title="'0' means unlimit">
-											<small class="form-text text-muted-red"><label id="MaxChargingDurationText" style="display:none;">'0' means unlimit</label></small>
-										</div>
-										<div class="form-group" style="display:<?php echo $am001;?>">
-											<label id="MaxChargingSocLbl">Max Charging Soc</label>
-											<small class="form-text text-muted-red">percent</small>
-											<input type="text" name="MaxChargingSoc" id="MaxChargingSoc" class="form-control" value="<?php echo $obj['MaxChargingSoc'];?>" placeholder="<?php echo ($obj['MaxChargingSoc']==0||$obj['MaxChargingSoc']=="")?"'0' means unlimit":"";?>" title="'0' means unlimit">
-											<small class="form-text text-muted-red"><label id="MaxChargingSocText" style="display:none;">'0' means unlimit</label></small>
-										</div>
-										<div class="form-group" style="display:<?php echo $am001;?>">
-											<label>Stop Charging By Button</label>
-											<select class="form-control" id="StopChargingByButton" name="StopChargingByButton">
-												<option value="0" <?php echo $obj['StopChargingByButton']=="0"?"selected":""?>>Disable</option>
-												<option value="1" <?php echo $obj['StopChargingByButton']=="1"?"selected":""?>>Enable</option>
-											</select>
-										</div>
-										<div class="form-group" id="AcMaxChargingCurrentDiv">
-											<label>AC Max Charging Current</label>
-											<small class="form-text text-muted-red">amp</small>
-											<input type="text" name="AcMaxChargingCurrent" id="AcMaxChargingCurrent" class="form-control" value="<?php echo $obj['AcMaxChargingCurrent'];?>" placeholder="<?php echo ($obj['AcMaxChargingCurrent']==0||$obj['AcMaxChargingCurrent']=="")?"'0' means unlimit":"";?>" title="'0' means unlimit">
-											<input type="hidden" name="AcRatingCurrent" id="AcRatingCurrent" value="<?php echo $AcRatingCurrent;?>">
-											<small class="form-text text-muted-red"><label id="AcMaxChargingCurrentText" style="display:none;">'0' means unlimit</label></small>
-										</div>
-										<div class="form-group" style="display:<?php echo $am111;?>">
-											<label><?php echo $lang->showWord("local_white_card"); ?>0</label>
-											<input type="text" name="LocalWhiteCard0" id="LocalWhiteCard0" class="form-control" value="<?php echo $obj['LocalWhiteCard'][0];?>">
-										</div>
-										<div class="form-group" style="display:<?php echo $am111;?>">
-											<label><?php echo $lang->showWord("local_white_card"); ?>1</label>
-											<input type="text" name="LocalWhiteCard1" id="LocalWhiteCard1" class="form-control" value="<?php echo $obj['LocalWhiteCard'][1];?>">
-										</div>
-										<div class="form-group" style="display:<?php echo $am111;?>">
-											<label><?php echo $lang->showWord("local_white_card"); ?>2</label>
-											<input type="text" name="LocalWhiteCard2" id="LocalWhiteCard2" class="form-control" value="<?php echo $obj['LocalWhiteCard'][2];?>">
-										</div>
-										<div class="form-group" style="display:<?php echo $am111;?>">
-											<label><?php echo $lang->showWord("local_white_card"); ?>3</label>
-											<input type="text" name="LocalWhiteCard3" id="LocalWhiteCard3" class="form-control" value="<?php echo $obj['LocalWhiteCard'][3];?>">
-										</div>
-										<div class="form-group" style="display:<?php echo $am111;?>">
-											<label><?php echo $lang->showWord("local_white_card"); ?>4</label>
-											<input type="text" name="LocalWhiteCard4" id="LocalWhiteCard4" class="form-control" value="<?php echo $obj['LocalWhiteCard'][4];?>">
-										</div>
-										<div class="form-group" style="display:<?php echo $am111;?>">
-											<label><?php echo $lang->showWord("local_white_card"); ?>5</label>
-											<input type="text" name="LocalWhiteCard5" id="LocalWhiteCard5" class="form-control" value="<?php echo $obj['LocalWhiteCard'][5];?>">
-										</div>
-										<div class="form-group" style="display:<?php echo $am111;?>">
-											<label><?php echo $lang->showWord("local_white_card"); ?>6</label>
-											<input type="text" name="LocalWhiteCard6" id="LocalWhiteCard6" class="form-control" value="<?php echo $obj['LocalWhiteCard'][6];?>">
-										</div>
-										<div class="form-group" style="display:<?php echo $am111;?>">
-											<label><?php echo $lang->showWord("local_white_card"); ?>7</label>
-											<input type="text" name="LocalWhiteCard7" id="LocalWhiteCard7" class="form-control" value="<?php echo $obj['LocalWhiteCard'][7];?>">
-										</div>
-										<div class="form-group" style="display:<?php echo $am111;?>">
-											<label><?php echo $lang->showWord("local_white_card"); ?>8</label>
-											<input type="text" name="LocalWhiteCard8" id="LocalWhiteCard8" class="form-control" value="<?php echo $obj['LocalWhiteCard'][8];?>">
-										</div>
-										<div class="form-group" style="display:<?php echo $am111;?>">
-											<label><?php echo $lang->showWord("local_white_card"); ?>9</label>
-											<input type="text" name="LocalWhiteCard9" id="LocalWhiteCard9" class="form-control" value="<?php echo $obj['LocalWhiteCard'][9];?>">
-										</div>
-										<div class="form-group"  id="isBillingDiv">
-											<label>
-											<input type="checkbox" id="isBilling" name="isBilling" <?php echo $obj['isBilling']==1?"checked":"";?> onclick="isBilling_clicked()">
-											<?php echo $lang->showWord("billing"); ?></label>
-										</div>
-										<div class="form-group" id="CurrencyDiv">
-											<label><?php echo $lang->showWord("currency"); ?></label>
-											<select class="form-control" id="Currency" name="Currency">
-												<option value="0" <?php echo $obj['Currency']=="0"?"selected":""?>>AED - Emirati Dirham</option>
-												<option value="1" <?php echo $obj['Currency']=="1"?"selected":""?>>ARS - Argentine Peso</option>
-												<option value="2" <?php echo $obj['Currency']=="2"?"selected":""?>>AUD - Australian Dollar</option>
-												<option value="3" <?php echo $obj['Currency']=="3"?"selected":""?>>BGN - Bulgarian Lev</option>
-												<option value="4" <?php echo $obj['Currency']=="4"?"selected":""?>>BHD - Bahraini Dinar</option>
-												<option value="5" <?php echo $obj['Currency']=="5"?"selected":""?>>BND - Bruneian Dollar</option>
-												<option value="6" <?php echo $obj['Currency']=="6"?"selected":""?>>BRL - Brazilian Real</option>
-												<option value="7" <?php echo $obj['Currency']=="7"?"selected":""?>>BWP - Botswana Pula</option>
-												<option value="8" <?php echo $obj['Currency']=="8"?"selected":""?>>CAD - Canadian Dollar</option>
-												<option value="9" <?php echo $obj['Currency']=="9"?"selected":""?>>CHF - Swiss Franc</option>
-												<option value="10" <?php echo $obj['Currency']=="10"?"selected":""?>>CLP - Chilean Peso</option>
-												<option value="11" <?php echo $obj['Currency']=="11"?"selected":""?>>CNY - Chinese Yuan Renminbi</option>
-												<option value="12" <?php echo $obj['Currency']=="12"?"selected":""?>>COP - Colombian Peso</option>
-												<option value="13" <?php echo $obj['Currency']=="13"?"selected":""?>>CZK - Czech Koruna</option>
-												<option value="14" <?php echo $obj['Currency']=="14"?"selected":""?>>DKK - Danish Krone</option>
-												<option value="15" <?php echo $obj['Currency']=="15"?"selected":""?>>EUR - Euro</option>
-												<option value="16" <?php echo $obj['Currency']=="16"?"selected":""?>>GBP - British Pound</option>
-												<option value="17" <?php echo $obj['Currency']=="17"?"selected":""?>>HKD - Hong Kong Dollar</option>
-												<option value="18" <?php echo $obj['Currency']=="18"?"selected":""?>>HRK - Croatian Kuna</option>
-												<option value="19" <?php echo $obj['Currency']=="19"?"selected":""?>>HUF - Hungarian Forint</option>
-												<option value="20" <?php echo $obj['Currency']=="20"?"selected":""?>>IDR - Indonesian Rupiah</option>
-												<option value="21" <?php echo $obj['Currency']=="21"?"selected":""?>>ILS - Israeli Shekel</option>
-												<option value="22" <?php echo $obj['Currency']=="22"?"selected":""?>>INR - Indian Rupee</option>
-												<option value="23" <?php echo $obj['Currency']=="23"?"selected":""?>>IRR - Iranian Rial</option>
-												<option value="24" <?php echo $obj['Currency']=="24"?"selected":""?>>ISK - Icelandic Krona</option>
-												<option value="25" <?php echo $obj['Currency']=="25"?"selected":""?>>JPY - Japanese Yen</option>
-												<option value="26" <?php echo $obj['Currency']=="26"?"selected":""?>>KRW - South Korean Won</option>
-												<option value="27" <?php echo $obj['Currency']=="27"?"selected":""?>>KWD - Kuwaiti Dinar</option>
-												<option value="28" <?php echo $obj['Currency']=="28"?"selected":""?>>KZT - Kazakhstani Tenge</option>
-												<option value="29" <?php echo $obj['Currency']=="29"?"selected":""?>>LKR - Sri Lankan Rupee</option>
-												<option value="30" <?php echo $obj['Currency']=="30"?"selected":""?>>LYD - Libyan Dinar</option>
-												<option value="31" <?php echo $obj['Currency']=="31"?"selected":""?>>MUR - Mauritian Rupee</option>
-												<option value="32" <?php echo $obj['Currency']=="32"?"selected":""?>>MXN - Mexican Peso</option>
-												<option value="33" <?php echo $obj['Currency']=="33"?"selected":""?>>MYR - Malaysian Ringgit</option>
-												<option value="34" <?php echo $obj['Currency']=="34"?"selected":""?>>NOK - Norwegian Krone</option>
-												<option value="35" <?php echo $obj['Currency']=="35"?"selected":""?>>NPR - Nepalese Rupee</option>
-												<option value="36" <?php echo $obj['Currency']=="36"?"selected":""?>>NZD - New Zealand Dollar</option>
-												<option value="37" <?php echo $obj['Currency']=="37"?"selected":""?>>OMR - Omani Rial</option>
-												<option value="38" <?php echo $obj['Currency']=="38"?"selected":""?>>PHP - Philippine Peso</option>
-												<option value="39" <?php echo $obj['Currency']=="39"?"selected":""?>>PKR - Pakistani Rupee</option>
-												<option value="40" <?php echo $obj['Currency']=="40"?"selected":""?>>PLN - Polish Zloty</option>
-												<option value="41" <?php echo $obj['Currency']=="41"?"selected":""?>>QAR - Qatari Riyal</option>
-												<option value="42" <?php echo $obj['Currency']=="42"?"selected":""?>>RON - Romanian New Leu</option>
-												<option value="43" <?php echo $obj['Currency']=="43"?"selected":""?>>RUB - Russian Ruble</option>
-												<option value="44" <?php echo $obj['Currency']=="44"?"selected":""?>>SAR - Saudi Arabian Riyal</option>
-												<option value="45" <?php echo $obj['Currency']=="45"?"selected":""?>>SEK - Swedish Krona</option>
-												<option value="46" <?php echo $obj['Currency']=="46"?"selected":""?>>SGD - Singapore Dollar</option>
-												<option value="47" <?php echo $obj['Currency']=="47"?"selected":""?>>THB - Thai Baht</option>
-												<option value="48" <?php echo $obj['Currency']=="48"?"selected":""?>>TRY - Turkish Lira</option>
-												<option value="49" <?php echo $obj['Currency']=="49"?"selected":""?>>TTD - Trinidadian Dollar</option>
-												<option value="50" <?php echo $obj['Currency']=="50"?"selected":""?>>TWD - Taiwan New Dollar</option>
-												<option value="51" <?php echo $obj['Currency']=="51"?"selected":""?>>USD - US Dollar</option>
-												<option value="52" <?php echo $obj['Currency']=="52"?"selected":""?>>VEF - Venezuelan Bolivar</option>
-												<option value="53" <?php echo $obj['Currency']=="53"?"selected":""?>>ZAR - South African Rand</option>
-											</select>
-										</div>
-										<div class="form-group" id="FeeDiv">
-											<div class="form-group">
-												<label><?php echo $lang->showWord("fee"); ?> 00:00~00:59</label>
-												<input type="text" name="Fee0" id="Fee0" class="form-control" value="<?php echo round($obj['Fee'][0],2);?>">
-											</div>
-											<div class="form-group">
-												<label><?php echo $lang->showWord("fee"); ?> 01:00~01:59</label>
-												<input type="text" name="Fee0" id="Fee1" class="form-control" value="<?php echo round($obj['Fee'][1],2);?>">
-											</div>
-											<div class="form-group">
-												<label><?php echo $lang->showWord("fee"); ?> 02:00~02:59</label>
-												<input type="text" name="Fee2" id="Fee2" class="form-control" value="<?php echo round($obj['Fee'][2],2);?>">
-											</div>
-											<div class="form-group">
-												<label><?php echo $lang->showWord("fee"); ?> 03:00~03:59</label>
-												<input type="text" name="Fee3" id="Fee3" class="form-control" value="<?php echo round($obj['Fee'][3],2);?>">
-											</div>
-											<div class="form-group">
-												<label><?php echo $lang->showWord("fee"); ?> 04:00~04:59</label>
-												<input type="text" name="Fee4" id="Fee4" class="form-control" value="<?php echo round($obj['Fee'][4],2);?>">
-											</div>
-											<div class="form-group">
-												<label><?php echo $lang->showWord("fee"); ?> 05:00~05:59</label>
-												<input type="text" name="Fee5" id="Fee5" class="form-control" value="<?php echo round($obj['Fee'][5],2);?>">
-											</div>
-											<div class="form-group">
-												<label><?php echo $lang->showWord("fee"); ?> 06:00~06:59</label>
-												<input type="text" name="Fee6" id="Fee6" class="form-control" value="<?php echo round($obj['Fee'][6],2);?>">
-											</div>
-											<div class="form-group">
-												<label><?php echo $lang->showWord("fee"); ?> 07:00~07:59</label>
-												<input type="text" name="Fee7" id="Fee7" class="form-control" value="<?php echo round($obj['Fee'][7],2);?>">
-											</div>
-											<div class="form-group">
-												<label><?php echo $lang->showWord("fee"); ?> 08:00~08:59</label>
-												<input type="text" name="Fee8" id="Fee8" class="form-control" value="<?php echo round($obj['Fee'][8],2);?>">
-											</div>
-											<div class="form-group">
-												<label><?php echo $lang->showWord("fee"); ?> 09:00~09:59</label>
-												<input type="text" name="Fee9" id="Fee9" class="form-control" value="<?php echo round($obj['Fee'][9],2);?>">
-											</div>
-											<div class="form-group">
-												<label><?php echo $lang->showWord("fee"); ?> 10:00~10:59</label>
-												<input type="text" name="Fee10" id="Fee10" class="form-control" value="<?php echo round($obj['Fee'][10],2);?>">
-											</div>
-											<div class="form-group">
-												<label><?php echo $lang->showWord("fee"); ?> 11:00~11:59</label>
-												<input type="text" name="Fee11" id="Fee11" class="form-control" value="<?php echo round($obj['Fee'][11],2);?>">
-											</div>
-											<div class="form-group">
-												<label><?php echo $lang->showWord("fee"); ?> 12:00~12:59</label>
-												<input type="text" name="Fee12" id="Fee12" class="form-control" value="<?php echo round($obj['Fee'][12],2);?>">
-											</div>
-											<div class="form-group">
-												<label><?php echo $lang->showWord("fee"); ?> 13:00~13:59</label>
-												<input type="text" name="Fee13" id="Fee13" class="form-control" value="<?php echo round($obj['Fee'][13],2);?>">
-											</div>
-											<div class="form-group">
-												<label><?php echo $lang->showWord("fee"); ?> 14:00~14:59</label>
-												<input type="text" name="Fee14" id="Fee14" class="form-control" value="<?php echo round($obj['Fee'][14],2);?>">
-											</div>
-											<div class="form-group">
-												<label><?php echo $lang->showWord("fee"); ?> 15:00~15:59</label>
-												<input type="text" name="Fee15" id="Fee15" class="form-control" value="<?php echo round($obj['Fee'][15],2);?>">
-											</div>
-											<div class="form-group">
-												<label><?php echo $lang->showWord("fee"); ?> 16:00~16:59</label>
-												<input type="text" name="Fee16" id="Fee16" class="form-control" value="<?php echo round($obj['Fee'][16],2);?>">
-											</div>
-											<div class="form-group">
-												<label><?php echo $lang->showWord("fee"); ?> 17:00~17:59</label>
-												<input type="text" name="Fee17" id="Fee17" class="form-control" value="<?php echo round($obj['Fee'][17],2);?>">
-											</div>
-											<div class="form-group">
-												<label><?php echo $lang->showWord("fee"); ?> 18:00~18:59</label>
-												<input type="text" name="Fee18" id="Fee18" class="form-control" value="<?php echo round($obj['Fee'][18],2);?>">
-											</div>
-											<div class="form-group">
-												<label><?php echo $lang->showWord("fee"); ?> 19:00~19:59</label>
-												<input type="text" name="Fee19" id="Fee19" class="form-control" value="<?php echo round($obj['Fee'][19],2);?>">
-											</div>
-											<div class="form-group">
-												<label><?php echo $lang->showWord("fee"); ?> 20:00~20:59</label>
-												<input type="text" name="Fee20" id="Fee20" class="form-control" value="<?php echo round($obj['Fee'][20],2);?>">
-											</div>
-											<div class="form-group">
-												<label><?php echo $lang->showWord("fee"); ?> 21:00~21:59</label>
-												<input type="text" name="Fee21" id="Fee21" class="form-control" value="<?php echo round($obj['Fee'][21],2);?>">
-											</div>
-											<div class="form-group">
-												<label><?php echo $lang->showWord("fee"); ?> 22:00~22:59</label>
-												<input type="text" name="Fee22" id="Fee22" class="form-control" value="<?php echo round($obj['Fee'][22],2);?>">
-											</div>
-											<div class="form-group">
-												<label><?php echo $lang->showWord("fee"); ?> 23:00~23:59</label>
-												<input type="text" name="Fee23" id="Fee23" class="form-control" value="<?php echo round($obj['Fee'][23],2);?>">
-											</div>
-										</div>
-<?php /*										<div class="form-group" style="display:<?php echo $am111;?>">
-											<label>CcsAuthentication</label>
-											<select class="form-control" id="CcsAuthentication" name="CcsAuthentication">
-												<option value="0" <?php echo $obj['CcsAuthentication']==0?"selected":""?>>EIM</option>
-												<option value="1" <?php echo $obj['CcsAuthentication']==1?"selected":""?>>EIM&PnC mixed</option>
-											</select>
-										</div>
-										<div class="form-group" style="display:<?php echo $am111;?>">
-											<label>AcCcsChargingModel</label>
-											<select class="form-control" id="AcCcsChargingModel" name="AcCcsChargingModel">
-												<option value="0" <?php echo $obj['AcCcsChargingModel']==0?"selected":""?>>BC (PWM) only</option>
-												<option value="1" <?php echo $obj['AcCcsChargingModel']==0?"selected":""?>>BC&PLC mixed</option>
-											</select>
-										</div>*/?>
-									</section>
-								</article>
-<?php if(substr($ModelName,0,2)=="DO" || substr($ModelName,0,2)=="DK" || substr($ModelName,0,2)=="DB"){?>
-<?php if($obj['DDChargingInfo1']){ $idx++;?>
-								<!--Charging Information-->
-								<article class="envor-sorting-item css">
-									<header><?php echo "connector".$idx." ".$lang->showWord("charging_information"); ?><i class="fa fa-plus"></i></header>
-									<section>
-										<div class="form-group" style="display:<?php echo $am111;?>">
-											<label><?php echo $lang->showWord("user_id"); ?></label>
-											<input type="text" readonly class="form-control" value="<?php echo $obj['DDChargingInfo1']['StartUserId'];?>">
-										</div>
-										<div class="form-group" style="display:<?php echo $am111;?>">
-											<label><?php echo $lang->showWord("start_date_time"); ?></label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['DDChargingInfo1']['StartDateTime'];?>">
-										</div>
-										<div class="form-group" style="display:<?php echo $am111;?>">
-											<label><?php echo $lang->showWord("stop_date_time"); ?></label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['DDChargingInfo1']['StopDateTime'];?>">
-										</div>
-<?php /*										<div class="form-group" style="display:<?php echo $am111;?>">
-											<label>StartMethod</label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['DDChargingInfo1']['StartMethod'];?>">
-										</div>*/?>
-										<div class="form-group" style="display:<?php echo $am111;?>">
-											<label><?php echo $lang->showWord("system_status"); ?></label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo $DDSystemStatus1;?>">
-										</div>
-										<div class="form-group" style="display:<?php echo $am111;?>">
-											<label><?php echo $lang->showWord("connector_temperature"); ?></label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['DDChargingInfo1']['ConnectorTemp']!=255?$obj['DDChargingInfo1']['ConnectorTemp']." ℃":"not supported";?>">
-										</div>
-										<div class="form-group ChillerTemp">
-											<label>Chiller Temperature</label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['DDChargingInfo1']['ChillerTemp']!=255?$obj['DDChargingInfo1']['ChillerTemp']." ℃":"not supported";?>">
-										</div>
-										<div class="form-group" style="display:<?php echo $am001;?>">
-											<label><?php echo $lang->showWord("present_charging_voltage"); ?></label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo round($obj['DDChargingInfo1']['PresentChargingVoltage'],2);?> volt">
-										</div>
-										<div class="form-group" style="display:<?php echo $am111;?>">
-											<label><?php echo $lang->showWord("present_charging_current"); ?></label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo round($obj['DDChargingInfo1']['PresentChargingCurrent'],2);?> amp">
-										</div>
-										<div class="form-group" style="display:<?php echo $am111;?>">
-											<label><?php echo $lang->showWord("present_charging_power"); ?></label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo round($obj['DDChargingInfo1']['PresentChargingPower'],2);?> kW">
-										</div>
-										<div class="form-group" style="display:<?php echo $am111;?>">
-											<label><?php echo $lang->showWord("present_charging_energy"); ?></label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo number_format(round($obj['DDChargingInfo1']['PresentChargedEnergy'],4), 4, ".", " ");?> kWh">
-										</div>
-										<div class="form-group" style="display:<?php echo $am111;?>">
-											<label><?php echo $lang->showWord("present_charging_duration"); ?></label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['DDChargingInfo1']['PresentChargedDuration'];?> seconds">
-										</div>
-										<div class="form-group" style="display:<?php echo $am001;?>">
-											<label>Remain Charging Time</label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['DDChargingInfo1']['RemainChargingDuration'];?> seconds">
-										</div>
-										<div class="form-group" style="display:<?php echo $am001;?>">
-											<label>EV Battery Max Voltage</label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo round($obj['DDChargingInfo1']['EvBatteryMaxVoltage'],2);?> volt">
-										</div>
-										<div class="form-group" style="display:<?php echo $am001;?>">
-											<label>EV Battery Target Voltage</label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo round($obj['DDChargingInfo1']['EvBatterytargetVoltage'],2);?> volt">
-										</div>
-										<div class="form-group" style="display:<?php echo $am001;?>">
-											<label>EV Battery Soc</label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['DDChargingInfo1']['EvBatterySoc'];?>">
-										</div>
-										<div class="form-group" style="display:<?php echo $am111;?>">
-											<label><?php echo $lang->showWord("totalize_power_consumption"); ?></label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo number_format(round($obj['DDChargingInfo1']['PowerConsumption'],4), 4, ".", " ");?> kWh">
-										</div>
-									</section>
-								</article>
-<?php }?>
-<?php if($obj['DDChargingInfo2']){ $idx++;?>
-								<!--Charging Information-->
-								<article class="envor-sorting-item css">
-									<header><?php echo "connector".$idx." ".$lang->showWord("charging_information"); ?><i class="fa fa-plus"></i></header>
-									<section>
-										<div class="form-group" style="display:<?php echo $am111;?>">
-											<label><?php echo $lang->showWord("user_id"); ?></label>
-											<input type="text" readonly class="form-control" value="<?php echo $obj['DDChargingInfo2']['StartUserId'];?>">
-										</div>
-										<div class="form-group" style="display:<?php echo $am111;?>">
-											<label><?php echo $lang->showWord("start_date_time"); ?></label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['DDChargingInfo2']['StartDateTime'];?>">
-										</div>
-										<div class="form-group" style="display:<?php echo $am111;?>">
-											<label><?php echo $lang->showWord("stop_date_time"); ?></label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['DDChargingInfo2']['StopDateTime'];?>">
-										</div>
-<?php /*										<div class="form-group" style="display:<?php echo $am111;?>">
-											<label>StartMethod</label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['DDChargingInfo2']['StartMethod'];?>">
-										</div>*/?>
-										<div class="form-group" style="display:<?php echo $am111;?>">
-											<label><?php echo $lang->showWord("system_status"); ?></label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo $DDSystemStatus2;?>">
-										</div>
-										<div class="form-group" style="display:<?php echo $am111;?>">
-											<label><?php echo $lang->showWord("connector_temperature"); ?></label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['DDChargingInfo2']['ConnectorTemp']!=255?$obj['DDChargingInfo2']['ConnectorTemp']." ℃":"not supported";?>">
-										</div>
-										<div class="form-group ChillerTemp">
-											<label>Chiller Temperature</label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['DDChargingInfo2']['ChillerTemp']!=255?$obj['DDChargingInfo2']['ChillerTemp']." ℃":"not supported";?>">
-										</div>
-										<div class="form-group" style="display:<?php echo $am001;?>">
-											<label><?php echo $lang->showWord("present_charging_voltage"); ?></label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo round($obj['DDChargingInfo2']['PresentChargingVoltage'],2);?> volt">
-										</div>
-										<div class="form-group" style="display:<?php echo $am111;?>">
-											<label><?php echo $lang->showWord("present_charging_current"); ?></label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo round($obj['DDChargingInfo2']['PresentChargingCurrent'],2);?> amp">
-										</div>
-										<div class="form-group" style="display:<?php echo $am111;?>">
-											<label><?php echo $lang->showWord("present_charging_power"); ?></label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo round($obj['DDChargingInfo2']['PresentChargingPower'],2);?> kW">
-										</div>
-										<div class="form-group" style="display:<?php echo $am111;?>">
-											<label><?php echo $lang->showWord("present_charging_energy"); ?></label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo number_format(round($obj['DDChargingInfo2']['PresentChargedEnergy'],4), 4, ".", " ");?> kWh">
-										</div>
-										<div class="form-group" style="display:<?php echo $am111;?>">
-											<label><?php echo $lang->showWord("present_charging_duration"); ?></label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['DDChargingInfo2']['PresentChargedDuration'];?> seconds">
-										</div>
-										<div class="form-group" style="display:<?php echo $am001;?>">
-											<label>Remain Charging Time</label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['DDChargingInfo2']['RemainChargingDuration'];?> seconds">
-										</div>
-										<div class="form-group" style="display:<?php echo $am001;?>">
-											<label>EV Battery Max Voltage</label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo round($obj['DDChargingInfo2']['EvBatteryMaxVoltage'],2);?> volt">
-										</div>
-										<div class="form-group" style="display:<?php echo $am001;?>">
-											<label>EV Battery Target Voltage</label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo round($obj['DDChargingInfo2']['EvBatterytargetVoltage'],2);?> volt">
-										</div>
-										<div class="form-group" style="display:<?php echo $am001;?>">
-											<label>EV Battery Soc</label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['DDChargingInfo2']['EvBatterySoc'];?>">
-										</div>
-										<div class="form-group" style="display:<?php echo $am111;?>">
-											<label><?php echo $lang->showWord("totalize_power_consumption"); ?></label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo number_format(round($obj['DDChargingInfo2']['PowerConsumption'],4), 4, ".", " ");?> kWh">
-										</div>
-									</section>
-								</article>
-<?php }?>
-<?php if($obj['DDChargingInfo3']){ $idx++;?>
-								<!--Charging Information-->
-								<article class="envor-sorting-item css">
-									<header><?php echo "connector".$idx." ".$lang->showWord("charging_information"); ?><i class="fa fa-plus"></i></header>
-									<section>
-										<div class="form-group" style="display:<?php echo $am111;?>">
-											<label><?php echo $lang->showWord("user_id"); ?></label>
-											<input type="text" readonly class="form-control" value="<?php echo $obj['DDChargingInfo3']['StartUserId'];?>">
-										</div>
-										<div class="form-group" style="display:<?php echo $am111;?>">
-											<label><?php echo $lang->showWord("start_date_time"); ?></label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['DDChargingInfo3']['StartDateTime'];?>">
-										</div>
-										<div class="form-group" style="display:<?php echo $am111;?>">
-											<label><?php echo $lang->showWord("stop_date_time"); ?></label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['DDChargingInfo3']['StopDateTime'];?>">
-										</div>
-<?php /*										<div class="form-group" style="display:<?php echo $am111;?>">
-											<label>StartMethod</label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['DDChargingInfo3']['StartMethod'];?>">
-										</div>*/?>
-										<div class="form-group" style="display:<?php echo $am111;?>">
-											<label><?php echo $lang->showWord("system_status"); ?></label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo $DDSystemStatus3;?>">
-										</div>
-										<div class="form-group" style="display:<?php echo $am111;?>">
-											<label><?php echo $lang->showWord("connector_temperature"); ?></label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['DDChargingInfo3']['ConnectorTemp']!=255?$obj['DDChargingInfo3']['ConnectorTemp']." ℃":"not supported";?>">
-										</div>
-										<div class="form-group ChillerTemp">
-											<label>Chiller Temperature</label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['DDChargingInfo3']['ChillerTemp']!=255?$obj['DDChargingInfo3']['ChillerTemp']." ℃":"not supported";?>">
-										</div>
-										<div class="form-group" style="display:<?php echo $am001;?>">
-											<label><?php echo $lang->showWord("present_charging_voltage"); ?></label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo round($obj['DDChargingInfo3']['PresentChargingVoltage'],2);?> volt">
-										</div>
-										<div class="form-group" style="display:<?php echo $am111;?>">
-											<label><?php echo $lang->showWord("present_charging_current"); ?></label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo round($obj['DDChargingInfo3']['PresentChargingCurrent'],2);?> amp">
-										</div>
-										<div class="form-group" style="display:<?php echo $am111;?>">
-											<label><?php echo $lang->showWord("present_charging_power"); ?></label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo round($obj['DDChargingInfo3']['PresentChargingPower'],2);?> kW">
-										</div>
-										<div class="form-group" style="display:<?php echo $am111;?>">
-											<label><?php echo $lang->showWord("present_charging_energy"); ?></label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo number_format(round($obj['DDChargingInfo3']['PresentChargedEnergy'],4), 4, ".", " ");?> kWh">
-										</div>
-										<div class="form-group" style="display:<?php echo $am111;?>">
-											<label><?php echo $lang->showWord("present_charging_duration"); ?></label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['DDChargingInfo3']['PresentChargedDuration'];?> seconds">
-										</div>
-										<div class="form-group" style="display:<?php echo $am001;?>">
-											<label>Remain Charging Time</label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['DDChargingInfo3']['RemainChargingDuration'];?> seconds">
-										</div>
-										<div class="form-group" style="display:<?php echo $am001;?>">
-											<label>EV Battery Max Voltage</label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo round($obj['DDChargingInfo3']['EvBatteryMaxVoltage'],2);?> volt">
-										</div>
-										<div class="form-group" style="display:<?php echo $am001;?>">
-											<label>EV Battery Target Voltage</label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo round($obj['DDChargingInfo3']['EvBatterytargetVoltage'],2);?> volt">
-										</div>
-										<div class="form-group" style="display:<?php echo $am001;?>">
-											<label>EV Battery Soc</label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['DDChargingInfo3']['EvBatterySoc'];?>">
-										</div>
-										<div class="form-group" style="display:<?php echo $am111;?>">
-											<label><?php echo $lang->showWord("totalize_power_consumption"); ?></label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo number_format(round($obj['DDChargingInfo3']['PowerConsumption'],4), 4, ".", " ");?> kWh">
-										</div>
-									</section>
-								</article>
-<?php }?>
-<?php if($obj['DDChargingInfo4']){ $idx++;?>
-								<!--Charging Information-->
-								<article class="envor-sorting-item css">
-									<header><?php echo "connector".$idx." ".$lang->showWord("charging_information"); ?><i class="fa fa-plus"></i></header>
-									<section>
-										<div class="form-group" style="display:<?php echo $am111;?>">
-											<label><?php echo $lang->showWord("user_id"); ?></label>
-											<input type="text" readonly class="form-control" value="<?php echo $obj['DDChargingInfo4']['StartUserId'];?>">
-										</div>
-										<div class="form-group" style="display:<?php echo $am111;?>">
-											<label><?php echo $lang->showWord("start_date_time"); ?></label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['DDChargingInfo4']['StartDateTime'];?>">
-										</div>
-										<div class="form-group" style="display:<?php echo $am111;?>">
-											<label><?php echo $lang->showWord("stop_date_time"); ?></label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['DDChargingInfo4']['StopDateTime'];?>">
-										</div>
-<?php /*										<div class="form-group" style="display:<?php echo $am111;?>">
-											<label>StartMethod</label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['DDChargingInfo4']['StartMethod'];?>">
-										</div>*/?>
-										<div class="form-group" style="display:<?php echo $am111;?>">
-											<label><?php echo $lang->showWord("system_status"); ?></label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo $DDSystemStatus4;?>">
-										</div>
-										<div class="form-group" style="display:<?php echo $am111;?>">
-											<label><?php echo $lang->showWord("connector_temperature"); ?></label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['DDChargingInfo4']['ConnectorTemp']!=255?$obj['DDChargingInfo4']['ConnectorTemp']." ℃":"not supported";?>">
-										</div>
-										<div class="form-group ChillerTemp">
-											<label>Chiller Temperature</label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['DDChargingInfo4']['ChillerTemp']!=255?$obj['DDChargingInfo4']['ChillerTemp']." ℃":"not supported";?>">
-										</div>
-										<div class="form-group" style="display:<?php echo $am001;?>">
-											<label><?php echo $lang->showWord("present_charging_voltage"); ?></label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo round($obj['DDChargingInfo4']['PresentChargingVoltage'],2);?> volt">
-										</div>
-										<div class="form-group" style="display:<?php echo $am111;?>">
-											<label><?php echo $lang->showWord("present_charging_current"); ?></label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo round($obj['DDChargingInfo4']['PresentChargingCurrent'],2);?> amp">
-										</div>
-										<div class="form-group" style="display:<?php echo $am111;?>">
-											<label><?php echo $lang->showWord("present_charging_power"); ?></label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo round($obj['DDChargingInfo4']['PresentChargingPower'],2);?> kW">
-										</div>
-										<div class="form-group" style="display:<?php echo $am111;?>">
-											<label><?php echo $lang->showWord("present_charging_energy"); ?></label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo number_format(round($obj['DDChargingInfo4']['PresentChargedEnergy'],4), 4, ".", " ");?> kWh">
-										</div>
-										<div class="form-group" style="display:<?php echo $am111;?>">
-											<label><?php echo $lang->showWord("present_charging_duration"); ?></label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['DDChargingInfo4']['PresentChargedDuration'];?> seconds">
-										</div>
-										<div class="form-group" style="display:<?php echo $am001;?>">
-											<label>Remain Charging Time</label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['DDChargingInfo4']['RemainChargingDuration'];?> seconds">
-										</div>
-										<div class="form-group" style="display:<?php echo $am001;?>">
-											<label>EV Battery Max Voltage</label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo round($obj['DDChargingInfo4']['EvBatteryMaxVoltage'],2);?> volt">
-										</div>
-										<div class="form-group" style="display:<?php echo $am001;?>">
-											<label>EV Battery Target Voltage</label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo round($obj['DDChargingInfo4']['EvBatterytargetVoltage'],2);?> volt">
-										</div>
-										<div class="form-group" style="display:<?php echo $am001;?>">
-											<label>EV Battery Soc</label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['DDChargingInfo4']['EvBatterySoc'];?>">
-										</div>
-										<div class="form-group" style="display:<?php echo $am111;?>">
-											<label><?php echo $lang->showWord("totalize_power_consumption"); ?></label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo number_format(round($obj['DDChargingInfo4']['PowerConsumption'],4), 4, ".", " ");?> kWh">
-										</div>
-									</section>
-								</article>
-<?php }?>
-<?php } else { ?>
-<?php if($obj['ChargingInfo1']){ $idx++;?>
-								<!--Charging Information-->
-								<article class="envor-sorting-item css">
-									<header><?php echo "connector".$idx." ".$lang->showWord("charging_information")."(".$connectorType1.")"; ?><i class="fa fa-plus"></i></header>
-									<section>
-										<div class="form-group" style="display:<?php echo $am111;?>">
-											<label><?php echo $lang->showWord("user_id"); ?></label>
-											<input type="text" readonly class="form-control" value="<?php echo $obj['ChargingInfo1']['StartUserId'];?>">
-											<input type="hidden" name="UserId1" id="UserId1" value="<?php echo $obj['ChargingInfo1']['StartUserId'];?>">
-										</div>
-										<div class="form-group" style="display:<?php echo $am111;?>">
-											<label><?php echo $lang->showWord("start_date_time"); ?></label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo1']['StartDateTime'];?>">
-											<input type="hidden" name="StartDateTime1" id="StartDateTime1" value="<?php echo $obj['ChargingInfo1']['StartDateTime'];?>">
-										</div>
-										<div class="form-group" style="display:<?php echo $am111;?>">
-											<label><?php echo $lang->showWord("stop_date_time"); ?></label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo1']['StopDateTime'];?>">
-											<input type="hidden" name="StopDateTime1" id="StopDateTime1" value="<?php echo $obj['ChargingInfo1']['StopDateTime'];?>">
-										</div>
-<?php /*										<div class="form-group" style="display:<?php echo $am111;?>">
-											<label>StartMethod</label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo1']['StartMethod'];?>">
-											<input type="hidden" name="StartMethod1" id="StartMethod1" value="<?php echo $obj['ChargingInfo1']['StartMethod'];?>">
-										</div>*/?>
-										<div class="form-group" style="display:<?php echo $am111;?>">
-											<label><?php echo $lang->showWord("system_status"); ?></label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo $SystemStatus1;?>">
-											<input type="hidden" name="SystemStatus1" id="SystemStatus1" value="<?php echo $obj['ChargingInfo1']['SystemStatus'];?>">
-										</div>
-										<div class="form-group" style="display:<?php echo $am111;?>">
-											<label><?php echo $lang->showWord("connector_temperature"); ?></label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo1']['ConnectorTemp']!=255?$obj['ChargingInfo1']['ConnectorTemp']." ℃":"not supported";?>">
-											<input type="hidden" name="ConnectorTemp1" id="ConnectorTemp1" value="<?php echo $obj['ChargingInfo1']['ConnectorTemp'];?>">
-										</div>
-										<div class="form-group" id="ChillerTemp1">
-											<label>Chiller Temperature</label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo1']['ChillerTemp']!=255?$obj['ChargingInfo1']['ChillerTemp']." ℃":"not supported";?>">
-										</div>
-										<div class="form-group" style="display:<?php echo $am001;?>">
-											<label><?php echo $lang->showWord("present_charging_voltage"); ?></label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo round($obj['ChargingInfo1']['PresentChargingVoltage'],2);?> volt">
-											<input type="hidden" name="PresentChargingVoltage1" id="PresentChargingVoltage1" value="<?php echo $obj['ChargingInfo1']['PresentChargingVoltage'];?>">
-										</div>
-										<div class="form-group" style="display:<?php echo $am111;?>">
-											<label><?php echo $lang->showWord("present_charging_current"); ?></label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo round($obj['ChargingInfo1']['PresentChargingCurrent'],2);?> amp">
-											<input type="hidden" name="PresentChargingCurrent1" id="PresentChargingCurrent1" value="<?php echo $obj['ChargingInfo1']['PresentChargingCurrent'];?>">
-										</div>
-										<div class="form-group" style="display:<?php echo $am111;?>">
-											<label><?php echo $lang->showWord("present_charging_power"); ?></label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo round($obj['ChargingInfo1']['PresentChargingPower'],2);?> kW">
-											<input type="hidden" name="PresentChargingPower1" id="PresentChargingPower1" value="<?php echo $obj['ChargingInfo1']['PresentChargingPower'];?>">
-										</div>
-										<div class="form-group" style="display:<?php echo $am111;?>">
-											<label><?php echo $lang->showWord("present_charging_energy"); ?></label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo number_format(round($obj['ChargingInfo1']['PresentChargedEnergy'],4), 4, ".", " ");?> kWh">
-											<input type="hidden" name="PresentChargedEnergy1" id="PresentChargedEnergy1" value="<?php echo $obj['ChargingInfo1']['PresentChargedEnergy'];?>">
-										</div>
-										<div class="form-group" style="display:<?php echo $am111;?>">
-											<label><?php echo $lang->showWord("present_charging_duration"); ?></label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo1']['PresentChargedDuration'];?> seconds">
-											<input type="hidden" name="PresentChargedDuration1" id="PresentChargedDuration1" value="<?php echo $obj['ChargingInfo1']['PresentChargedDuration'];?>">
-										</div>
-										<div class="form-group" style="display:<?php echo $am001;?>">
-											<label>Remain Charging Time</label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo1']['RemainChargingDuration'];?> seconds">
-											<input type="hidden" name="RemainChargingDuration1" id="RemainChargingDuration1" value="<?php echo $obj['ChargingInfo1']['RemainChargingDuration'];?>">
-										</div>
-										<div class="form-group" style="display:<?php echo $am001;?>">
-											<label>EV Battery Max Voltage</label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo round($obj['ChargingInfo1']['EvBatteryMaxVoltage'],2);?> volt">
-											<input type="hidden" name="EvBatteryMaxVoltage1" id="EvBatteryMaxVoltage1" value="<?php echo $obj['ChargingInfo1']['EvBatteryMaxVoltage'];?>">
-										</div>
-										<div class="form-group" style="display:<?php echo $am001;?>">
-											<label>EV Battery Target Voltage</label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo round($obj['ChargingInfo1']['EvBatterytargetVoltage'],2);?> volt">
-											<input type="hidden" name="EvBatterytargetVoltage1" id="EvBatterytargetVoltage1" value="<?php echo $obj['ChargingInfo1']['EvBatterytargetVoltage'];?>">
-										</div>
-										<div class="form-group" style="display:<?php echo $am001;?>">
-											<label>EV Battery Soc</label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo1']['EvBatterySoc'];?>">
-											<input type="hidden" name="EvBatterySoc1" id="EvBatterySoc1" value="<?php echo $obj['ChargingInfo1']['EvBatterySoc'];?>">
-										</div>
-										<div class="form-group" style="display:<?php echo $am111;?>">
-											<label><?php echo $lang->showWord("totalize_power_consumption"); ?></label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo number_format(round($obj['ChargingInfo1']['PowerConsumption'],4), 4, ".", " ");?> kWh">
-										</div>
-<?php if(substr($ModelName,0,2)=="AX"){?>
-										<div class="form-group" style="display:block">
-											<label><?php echo $lang->showWord("meter_ic_calibration_status"); ?></label>
-											<span style="display:block">
-												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
-													<label>VaGain</label>
-												</span>
-												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
-													<label class="toggle-switchy" for="VaGain" data-size="" data-style="rounded">
-														<input disabled type="checkbox" id="VaGain" <?php echo $obj['ChargingInfo1']['isCalibratedVaGain']==1?"checked":"";?>>
-														<span class="toggle">
-														  <span class="switch"></span>
-														</span>
-													</label>
-												</span>
-												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
-													<label>VbGain</label>
-												</span>
-												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
-													<label class="toggle-switchy" for="VbGain" data-size="" data-style="rounded">
-														<input  disabled type="checkbox" id="VbGain" <?php echo $obj['ChargingInfo1']['isCalibratedVbGain']==1?"checked":"";?>>
-														<span class="toggle">
-														  <span class="switch"></span>
-														</span>
-													</label>
-												</span>
-												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
-													<label>VcGain</label>
-												</span>
-												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
-													<label class="toggle-switchy" for="VcGain" data-size="" data-style="rounded">
-														<input disabled type="checkbox" id="VcGain" <?php echo $obj['ChargingInfo1']['isCalibratedVcGain']==1?"checked":"";?>>
-														<span class="toggle">
-														  <span class="switch"></span>
-														</span>
-													</label>
-												</span>
-											</span>
-											<span class="" style="display:block">
-												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
-													<label>VaOffset</label>
-												</span>
-												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
-													<label class="toggle-switchy" for="VaOffset" data-size="" data-style="rounded">
-														<input disabled type="checkbox" id="VaOffset" <?php echo $obj['ChargingInfo1']['isCalibratedVaOffset']==1?"checked":"";?>>
-														<span class="toggle">
-														  <span class="switch"></span>
-														</span>
-													</label>
-												</span>
-												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
-													<label>VbOffset</label>
-												</span>
-												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
-													<label class="toggle-switchy" for="VbOffset" data-size="" data-style="rounded">
-														<input disabled type="checkbox" id="VbOffset" <?php echo $obj['ChargingInfo1']['isCalibratedVbOffset']==1?"checked":"";?>>
-														<span class="toggle">
-														  <span class="switch"></span>
-														</span>
-													</label>
-												</span>
-												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
-													<label>VcOffset</label>
-												</span>
-												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
-													<label class="toggle-switchy" for="VcOffset" data-size="" data-style="rounded">
-														<input disabled type="checkbox" id="VcOffset" <?php echo $obj['ChargingInfo1']['isCalibratedVcOffset']==1?"checked":"";?>>
-														<span class="toggle">
-														  <span class="switch"></span>
-														</span>
-													</label>
-												</span>
-											</span>
-											<span class="" style="display:block">
-												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
-													<label>CaGain</label>
-												</span>
-												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
-													<label class="toggle-switchy" for="CaGain" data-size="" data-style="rounded">
-														<input disabled type="checkbox" id="CaGain" <?php echo $obj['ChargingInfo1']['isCalibratedCaGain']==1?"checked":"";?>>
-														<span class="toggle">
-														  <span class="switch"></span>
-														</span>
-													</label>
-												</span>
-												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
-													<label>CbGain</label>
-												</span>
-												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
-													<label class="toggle-switchy" for="CbGain" data-size="" data-style="rounded">
-														<input disabled type="checkbox" id="CbGain" <?php echo $obj['ChargingInfo1']['isCalibratedCbGain']==1?"checked":"";?>>
-														<span class="toggle">
-														  <span class="switch"></span>
-														</span>
-													</label>
-												</span>
-												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
-													<label>CcGain</label>
-												</span>
-												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
-													<label class="toggle-switchy" for="CcGain" data-size="" data-style="rounded">
-														<input disabled type="checkbox" id="CcGain" <?php echo $obj['ChargingInfo1']['isCalibratedCcGain']==1?"checked":"";?>>
-														<span class="toggle">
-														  <span class="switch"></span>
-														</span>
-													</label>
-												</span>
-											</span>
-											<span class="" style="display:block">
-												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
-													<label>CaOffset</label>
-												</span>
-												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
-													<label class="toggle-switchy" for="CaOffset" data-size="" data-style="rounded">
-														<input disabled type="checkbox" id="CaOffset" <?php echo $obj['ChargingInfo1']['isCalibratedCaOffset']==1?"checked":"";?>>
-														<span class="toggle">
-														  <span class="switch"></span>
-														</span>
-													</label>
-												</span>
-												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
-													<label>CbOffset</label>
-												</span>
-												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
-													<label class="toggle-switchy" for="CbOffset" data-size="" data-style="rounded">
-														<input disabled type="checkbox" id="CbOffset" <?php echo $obj['ChargingInfo1']['isCalibratedCbOffset']==1?"checked":"";?>>
-														<span class="toggle">
-														  <span class="switch"></span>
-														</span>
-													</label>
-												</span>
-												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
-													<label>CcOffset</label>
-												</span>
-												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
-													<label class="toggle-switchy" for="CcOffset" data-size="" data-style="rounded">
-														<input disabled type="checkbox" id="CcOffset" <?php echo $obj['ChargingInfo1']['isCalibratedCcOffset']==1?"checked":"";?>>
-														<span class="toggle">
-														  <span class="switch"></span>
-														</span>
-													</label>
-												</span>
-											</span>
-											<span class="" style="display:block">
-												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
-													<label>Pa</label>
-												</span>
-												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
-													<label class="toggle-switchy" for="Pa" data-size="" data-style="rounded">
-														<input disabled type="checkbox" id="Pa" <?php echo $obj['ChargingInfo1']['isCalibratedPa']==1?"checked":"";?>>
-														<span class="toggle">
-														  <span class="switch"></span>
-														</span>
-													</label>
-												</span>
-												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
-													<label>Pb</label>
-												</span>
-												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
-													<label class="toggle-switchy" for="Pb" data-size="" data-style="rounded">
-														<input disabled type="checkbox" id="Pb" <?php echo $obj['ChargingInfo1']['isCalibratedPb']==1?"checked":"";?>>
-														<span class="toggle">
-														  <span class="switch"></span>
-														</span>
-													</label>
-												</span>
-												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
-													<label>Pc</label>
-												</span>
-												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
-													<label class="toggle-switchy" for="Pc" data-size="" data-style="rounded">
-														<input disabled type="checkbox" id="Pc" <?php echo $obj['ChargingInfo1']['isCalibratedPc']==1?"checked":"";?>>
-														<span class="toggle">
-														  <span class="switch"></span>
-														</span>
-													</label>
-												</span>
-											</span>
-										</div>
-<?php } ?>
-									</section>
-								</article>
-<?php }?>
-<?php if($obj['ChargingInfo2']){ $idx++;?>
-								<!--Charging Information-->
-								<article class="envor-sorting-item css">
-									<header><?php echo "connector".$idx." ".$lang->showWord("charging_information")."(".$connectorType2.")"; ?><i class="fa fa-plus"></i></header>
-									<section>
-										<div class="form-group" style="display:<?php echo $am111;?>">
-											<label><?php echo $lang->showWord("user_id"); ?></label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo2']['StartUserId'];?>">
-											<input type="hidden" name="UserId2" id="UserId2" value="<?php echo $obj['ChargingInfo2']['StartUserId'];?>">
-										</div>
-										<div class="form-group" style="display:<?php echo $am111;?>">
-											<label><?php echo $lang->showWord("start_date_time"); ?></label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo2']['StartDateTime'];?>">
-											<input type="hidden" name="StartDateTime2" id="StartDateTime2" value="<?php echo $obj['ChargingInfo2']['StartDateTime'];?>">
-										</div>
-										<div class="form-group" style="display:<?php echo $am111;?>">
-											<label><?php echo $lang->showWord("stop_date_time"); ?></label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo2']['StopDateTime'];?>">
-											<input type="hidden" name="StopDateTime2" id="StopDateTime2" value="<?php echo $obj['ChargingInfo2']['StopDateTime'];?>">
-										</div>
-<?php /*										<div class="form-group" style="display:<?php echo $am111;?>">
-											<label>StartMethod</label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo2']['StartMethod'];?>">
-											<input type="hidden" name="StartMethod2" id="StartMethod2" value="<?php echo $obj['ChargingInfo2']['StartMethod'];?>">
-										</div>*/?>
-										<div class="form-group" style="display:<?php echo $am111;?>">
-											<label><?php echo $lang->showWord("system_status"); ?></label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo $SystemStatus2;?>">
-											<input type="hidden" name="SystemStatus2" id="SystemStatus2" value="<?php echo $obj['ChargingInfo2']['SystemStatus'];?>">
-										</div>
-										<div class="form-group" style="display:<?php echo $am111;?>">
-											<label><?php echo $lang->showWord("connector_temperature"); ?></label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo2']['ConnectorTemp']!=255?$obj['ChargingInfo2']['ConnectorTemp']." ℃":"not supported";?>">
-											<input type="hidden" name="ConnectorTemp2" id="ConnectorTemp2" value="<?php echo $obj['ChargingInfo2']['ConnectorTemp'];?>">
-										</div>
-										<div class="form-group" id="ChillerTemp2">
-											<label>Chiller Temperature</label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo2']['ChillerTemp']!=255?$obj['ChargingInfo2']['ChillerTemp']." ℃":"not supported";?>">
-										</div>
-										<div class="form-group" style="display:<?php echo $am001;?>">
-											<label><?php echo $lang->showWord("present_charging_voltage"); ?></label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo round($obj['ChargingInfo2']['PresentChargingVoltage'],2);?> volt">
-											<input type="hidden" name="PresentChargingVoltage2" id="PresentChargingVoltage2" value="<?php echo $obj['ChargingInfo2']['PresentChargingVoltage'];?>">
-										</div>
-										<div class="form-group" style="display:<?php echo $am111;?>">
-											<label><?php echo $lang->showWord("present_charging_current"); ?></label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo round($obj['ChargingInfo2']['PresentChargingCurrent'],2);?> amp">
-											<input type="hidden" name="PresentChargingCurrent2" id="PresentChargingCurrent2" value="<?php echo $obj['ChargingInfo2']['PresentChargingCurrent'];?>">
-										</div>
-										<div class="form-group" style="display:<?php echo $am111;?>">
-											<label><?php echo $lang->showWord("present_charging_power"); ?></label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo round($obj['ChargingInfo2']['PresentChargingPower'],2);?> kW">
-											<input type="hidden" name="PresentChargingPower2" id="PresentChargingPower2" value="<?php echo $obj['ChargingInfo2']['PresentChargingPower'];?>">
-										</div>
-										<div class="form-group" style="display:<?php echo $am111;?>">
-											<label><?php echo $lang->showWord("present_charging_energy"); ?></label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo number_format(round($obj['ChargingInfo2']['PresentChargedEnergy'],4), 4, ".", " ");?> kWh">
-											<input type="hidden" name="PresentChargedEnergy2" id="PresentChargedEnergy2" value="<?php echo $obj['ChargingInfo2']['PresentChargedEnergy'];?>">
-										</div>
-										<div class="form-group" style="display:<?php echo $am111;?>">
-											<label><?php echo $lang->showWord("present_charging_duration"); ?></label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo2']['PresentChargedDuration'];?> seconds">
-											<input type="hidden" name="PresentChargedDuration2" id="PresentChargedDuration2" value="<?php echo $obj['ChargingInfo2']['PresentChargedDuration'];?>">
-										</div>
-										<div class="form-group" style="display:<?php echo $am001;?>">
-											<label>Remain Charging Time</label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo2']['RemainChargingDuration'];?> seconds">
-											<input type="hidden" name="RemainChargingDuration2" id="RemainChargingDuration2" value="<?php echo $obj['ChargingInfo2']['RemainChargingDuration'];?>">
-										</div>
-										<div class="form-group" style="display:<?php echo $am001;?>">
-											<label>EV Battery Max Voltage</label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo round($obj['ChargingInfo2']['EvBatteryMaxVoltage'],2);?> volt">
-											<input type="hidden" name="EvBatteryMaxVoltage2" id="EvBatteryMaxVoltage2" value="<?php echo $obj['ChargingInfo2']['EvBatteryMaxVoltage'];?>">
-										</div>
-										<div class="form-group" style="display:<?php echo $am001;?>">
-											<label>EV Battery Target Voltage</label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo round($obj['ChargingInfo2']['EvBatterytargetVoltage'],2);?> volt">
-											<input type="hidden" name="EvBatterytargetVoltage2" id="EvBatterytargetVoltage2" value="<?php echo $obj['ChargingInfo2']['EvBatterytargetVoltage'];?>">
-										</div>
-										<div class="form-group" style="display:<?php echo $am001;?>">
-											<label>EV Battery Soc</label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo2']['EvBatterySoc'];?>">
-											<input type="hidden" name="EvBatterySoc2" id="EvBatterySoc2" value="<?php echo $obj['ChargingInfo2']['EvBatterySoc'];?>">
-										</div>
-										<div class="form-group" style="display:<?php echo $am111;?>">
-											<label><?php echo $lang->showWord("totalize_power_consumption"); ?></label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo number_format(round($obj['ChargingInfo2']['PowerConsumption'],4), 4, ".", " ");?> kWh">
-										</div>
-<?php if(substr($ModelName,0,2)=="AX"){?>
-										<div class="form-group" style="display:block">
-											<label><?php echo $lang->showWord("meter_ic_calibration_status"); ?></label>
-											<span style="display:block">
-												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
-													<label>VaGain</label>
-												</span>
-												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
-													<label class="toggle-switchy" for="VaGain" data-size="" data-style="rounded">
-														<input disabled type="checkbox" id="VaGain" <?php echo $obj['ChargingInfo2']['isCalibratedVaGain']==1?"checked":"";?>>
-														<span class="toggle">
-														  <span class="switch"></span>
-														</span>
-													</label>
-												</span>
-												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
-													<label>VbGain</label>
-												</span>
-												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
-													<label class="toggle-switchy" for="VbGain" data-size="" data-style="rounded">
-														<input  disabled type="checkbox" id="VbGain" <?php echo $obj['ChargingInfo2']['isCalibratedVbGain']==1?"checked":"";?>>
-														<span class="toggle">
-														  <span class="switch"></span>
-														</span>
-													</label>
-												</span>
-												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
-													<label>VcGain</label>
-												</span>
-												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
-													<label class="toggle-switchy" for="VcGain" data-size="" data-style="rounded">
-														<input disabled type="checkbox" id="VcGain" <?php echo $obj['ChargingInfo2']['isCalibratedVcGain']==1?"checked":"";?>>
-														<span class="toggle">
-														  <span class="switch"></span>
-														</span>
-													</label>
-												</span>
-											</span>
-											<span class="" style="display:block">
-												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
-													<label>VaOffset</label>
-												</span>
-												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
-													<label class="toggle-switchy" for="VaOffset" data-size="" data-style="rounded">
-														<input disabled type="checkbox" id="VaOffset" <?php echo $obj['ChargingInfo2']['isCalibratedVaOffset']==1?"checked":"";?>>
-														<span class="toggle">
-														  <span class="switch"></span>
-														</span>
-													</label>
-												</span>
-												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
-													<label>VbOffset</label>
-												</span>
-												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
-													<label class="toggle-switchy" for="VbOffset" data-size="" data-style="rounded">
-														<input disabled type="checkbox" id="VbOffset" <?php echo $obj['ChargingInfo2']['isCalibratedVbOffset']==1?"checked":"";?>>
-														<span class="toggle">
-														  <span class="switch"></span>
-														</span>
-													</label>
-												</span>
-												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
-													<label>VcOffset</label>
-												</span>
-												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
-													<label class="toggle-switchy" for="VcOffset" data-size="" data-style="rounded">
-														<input disabled type="checkbox" id="VcOffset" <?php echo $obj['ChargingInfo2']['isCalibratedVcOffset']==1?"checked":"";?>>
-														<span class="toggle">
-														  <span class="switch"></span>
-														</span>
-													</label>
-												</span>
-											</span>
-											<span class="" style="display:block">
-												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
-													<label>CaGain</label>
-												</span>
-												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
-													<label class="toggle-switchy" for="CaGain" data-size="" data-style="rounded">
-														<input disabled type="checkbox" id="CaGain" <?php echo $obj['ChargingInfo2']['isCalibratedCaGain']==1?"checked":"";?>>
-														<span class="toggle">
-														  <span class="switch"></span>
-														</span>
-													</label>
-												</span>
-												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
-													<label>CbGain</label>
-												</span>
-												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
-													<label class="toggle-switchy" for="CbGain" data-size="" data-style="rounded">
-														<input disabled type="checkbox" id="CbGain" <?php echo $obj['ChargingInfo2']['isCalibratedCbGain']==1?"checked":"";?>>
-														<span class="toggle">
-														  <span class="switch"></span>
-														</span>
-													</label>
-												</span>
-												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
-													<label>CcGain</label>
-												</span>
-												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
-													<label class="toggle-switchy" for="CcGain" data-size="" data-style="rounded">
-														<input disabled type="checkbox" id="CcGain" <?php echo $obj['ChargingInfo2']['isCalibratedCcGain']==1?"checked":"";?>>
-														<span class="toggle">
-														  <span class="switch"></span>
-														</span>
-													</label>
-												</span>
-											</span>
-											<span class="" style="display:block">
-												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
-													<label>CaOffset</label>
-												</span>
-												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
-													<label class="toggle-switchy" for="CaOffset" data-size="" data-style="rounded">
-														<input disabled type="checkbox" id="CaOffset" <?php echo $obj['ChargingInfo2']['isCalibratedCaOffset']==1?"checked":"";?>>
-														<span class="toggle">
-														  <span class="switch"></span>
-														</span>
-													</label>
-												</span>
-												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
-													<label>CbOffset</label>
-												</span>
-												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
-													<label class="toggle-switchy" for="CbOffset" data-size="" data-style="rounded">
-														<input disabled type="checkbox" id="CbOffset" <?php echo $obj['ChargingInfo2']['isCalibratedCbOffset']==1?"checked":"";?>>
-														<span class="toggle">
-														  <span class="switch"></span>
-														</span>
-													</label>
-												</span>
-												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
-													<label>CcOffset</label>
-												</span>
-												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
-													<label class="toggle-switchy" for="CcOffset" data-size="" data-style="rounded">
-														<input disabled type="checkbox" id="CcOffset" <?php echo $obj['ChargingInfo2']['isCalibratedCcOffset']==1?"checked":"";?>>
-														<span class="toggle">
-														  <span class="switch"></span>
-														</span>
-													</label>
-												</span>
-											</span>
-											<span class="" style="display:block">
-												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
-													<label>Pa</label>
-												</span>
-												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
-													<label class="toggle-switchy" for="Pa" data-size="" data-style="rounded">
-														<input disabled type="checkbox" id="Pa" <?php echo $obj['ChargingInfo2']['isCalibratedPa']==1?"checked":"";?>>
-														<span class="toggle">
-														  <span class="switch"></span>
-														</span>
-													</label>
-												</span>
-												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
-													<label>Pb</label>
-												</span>
-												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
-													<label class="toggle-switchy" for="Pb" data-size="" data-style="rounded">
-														<input disabled type="checkbox" id="Pb" <?php echo $obj['ChargingInfo2']['isCalibratedPb']==1?"checked":"";?>>
-														<span class="toggle">
-														  <span class="switch"></span>
-														</span>
-													</label>
-												</span>
-												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
-													<label>Pc</label>
-												</span>
-												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
-													<label class="toggle-switchy" for="Pc" data-size="" data-style="rounded">
-														<input disabled type="checkbox" id="Pc" <?php echo $obj['ChargingInfo2']['isCalibratedPc']==1?"checked":"";?>>
-														<span class="toggle">
-														  <span class="switch"></span>
-														</span>
-													</label>
-												</span>
-											</span>
-										</div>
-<?php } ?>
-									</section>
-								</article>
-<?php }?>
-<?php if($obj['ChargingInfo3']){ $idx++;?>
-								<!--Charging Information-->
-								<article class="envor-sorting-item css">
-									<header><?php echo "connector".$idx." ".$lang->showWord("charging_information")."(".$connectorType3.")"; ?><i class="fa fa-plus"></i></header>
-									<section>
-										<div class="form-group" style="display:<?php echo $am111;?>">
-											<label><?php echo $lang->showWord("user_id"); ?></label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo3']['StartUserId'];?>">
-											<input type="hidden" name="UserId3" id="UserId3" value="<?php echo $obj['ChargingInfo3']['StartUserId'];?>">
-										</div>
-										<div class="form-group" style="display:<?php echo $am111;?>">
-											<label><?php echo $lang->showWord("start_date_time"); ?></label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo3']['StartDateTime'];?>">
-											<input type="hidden" name="StartDateTime3" id="StartDateTime3" value="<?php echo $obj['ChargingInfo3']['StartDateTime'];?>">
-										</div>
-										<div class="form-group" style="display:<?php echo $am111;?>">
-											<label><?php echo $lang->showWord("stop_date_time"); ?></label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo3']['StopDateTime'];?>">
-											<input type="hidden" name="StopDateTime3" id="StopDateTime3" value="<?php echo $obj['ChargingInfo3']['StopDateTime'];?>">
-										</div>
-<?php /*										<div class="form-group" style="display:<?php echo $am111;?>">
-											<label>StartMethod</label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo3']['StartMethod'];?>">
-											<input type="hidden" name="StartMethod3" id="StartMethod3" value="<?php echo $obj['ChargingInfo3']['StartMethod'];?>">
-										</div>*/?>
-										<div class="form-group" style="display:<?php echo $am111;?>">
-											<label><?php echo $lang->showWord("system_status"); ?></label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo $SystemStatus3;?>">
-											<input type="hidden" name="SystemStatus3" id="SystemStatus3" value="<?php echo $obj['ChargingInfo3']['SystemStatus'];?>">
-										</div>
-										<div class="form-group" style="display:<?php echo $am111;?>">
-											<label><?php echo $lang->showWord("connector_temperature"); ?></label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo3']['ConnectorTemp']!=255?$obj['ChargingInfo3']['ConnectorTemp']." ℃":"not supported";?>">
-											<input type="hidden" name="ConnectorTemp3" id="ConnectorTemp3" value="<?php echo $obj['ChargingInfo3']['ConnectorTemp'];?>">
-										</div>
-										<div class="form-group" id="ChillerTemp3">
-											<label>Chiller Temperature</label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo3']['ChillerTemp']!=255?$obj['ChargingInfo3']['ChillerTemp']." ℃":"not supported";?>">
-										</div>
-										<div class="form-group" style="display:<?php echo $am001;?>">
-											<label><?php echo $lang->showWord("present_charging_voltage"); ?></label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo round($obj['ChargingInfo3']['PresentChargingVoltage'],2);?> volt">
-											<input type="hidden" name="PresentChargingVoltage3" id="PresentChargingVoltage3" value="<?php echo $obj['ChargingInfo3']['PresentChargingVoltage'];?>">
-										</div>
-										<div class="form-group" style="display:<?php echo $am111;?>">
-											<label><?php echo $lang->showWord("present_charging_current"); ?></label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo round($obj['ChargingInfo3']['PresentChargingCurrent'],2);?> amp">
-											<input type="hidden" name="PresentChargingCurrent3" id="PresentChargingCurrent3" value="<?php echo $obj['ChargingInfo3']['PresentChargingCurrent'];?>">
-										</div>
-										<div class="form-group" style="display:<?php echo $am111;?>">
-											<label><?php echo $lang->showWord("present_charging_power"); ?></label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo round($obj['ChargingInfo3']['PresentChargingPower'],2);?> kW">
-											<input type="hidden" name="PresentChargingPower3" id="PresentChargingPower3" value="<?php echo $obj['ChargingInfo3']['PresentChargingPower'];?>">
-										</div>
-										<div class="form-group" style="display:<?php echo $am111;?>">
-											<label><?php echo $lang->showWord("present_charging_energy"); ?></label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo number_format(round($obj['ChargingInfo3']['PresentChargedEnergy'],4), 4, ".", " ");?> kWh">
-											<input type="hidden" name="PresentChargedEnergy3" id="PresentChargedEnergy3" value="<?php echo $obj['ChargingInfo3']['PresentChargedEnergy'];?>">
-										</div>
-										<div class="form-group" style="display:<?php echo $am111;?>">
-											<label><?php echo $lang->showWord("present_charging_duration"); ?></label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo3']['PresentChargedDuration'];?> seconds">
-											<input type="hidden" name="PresentChargedDuration3" id="PresentChargedDuration3" value="<?php echo $obj['ChargingInfo3']['PresentChargedDuration'];?>">
-										</div>
-										<div class="form-group" style="display:<?php echo $am001;?>">
-											<label>Remain Charging Time</label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo3']['RemainChargingDuration'];?> seconds">
-											<input type="hidden" name="RemainChargingDuration3" id="RemainChargingDuration3" value="<?php echo $obj['ChargingInfo3']['RemainChargingDuration'];?>">
-										</div>
-										<div class="form-group" style="display:<?php echo $am001;?>">
-											<label>EV Battery Max Voltage</label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo round($obj['ChargingInfo3']['EvBatteryMaxVoltage'],2);?> volt">
-											<input type="hidden" name="EvBatteryMaxVoltage3" id="EvBatteryMaxVoltage3" value="<?php echo $obj['ChargingInfo3']['EvBatteryMaxVoltage'];?>">
-										</div>
-										<div class="form-group" style="display:<?php echo $am001;?>">
-											<label>EV Battery Target Voltage</label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo round($obj['ChargingInfo3']['EvBatterytargetVoltage'],2);?> volt">
-											<input type="hidden" name="EvBatterytargetVoltage3" id="EvBatterytargetVoltage3" value="<?php echo $obj['ChargingInfo3']['EvBatterytargetVoltage'];?>">
-										</div>
-										<div class="form-group" style="display:<?php echo $am001;?>">
-											<label>EV Battery Soc</label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo3']['EvBatterySoc'];?>">
-											<input type="hidden" name="EvBatterySoc3" id="EvBatterySoc3" value="<?php echo $obj['ChargingInfo3']['EvBatterySoc'];?>">
-										</div>
-										<div class="form-group" style="display:<?php echo $am111;?>">
-											<label><?php echo $lang->showWord("totalize_power_consumption"); ?></label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo number_format(round($obj['ChargingInfo3']['PowerConsumption'],4), 4, ".", " ");?> kWh">
-										</div>
-<?php if(substr($ModelName,0,2)=="AX"){?>
-										<div class="form-group" style="display:block">
-											<label><?php echo $lang->showWord("meter_ic_calibration_status"); ?></label>
-											<span style="display:block">
-												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
-													<label>VaGain</label>
-												</span>
-												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
-													<label class="toggle-switchy" for="VaGain" data-size="" data-style="rounded">
-														<input disabled type="checkbox" id="VaGain" <?php echo $obj['ChargingInfo3']['isCalibratedVaGain']==1?"checked":"";?>>
-														<span class="toggle">
-														  <span class="switch"></span>
-														</span>
-													</label>
-												</span>
-												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
-													<label>VbGain</label>
-												</span>
-												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
-													<label class="toggle-switchy" for="VbGain" data-size="" data-style="rounded">
-														<input  disabled type="checkbox" id="VbGain" <?php echo $obj['ChargingInfo3']['isCalibratedVbGain']==1?"checked":"";?>>
-														<span class="toggle">
-														  <span class="switch"></span>
-														</span>
-													</label>
-												</span>
-												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
-													<label>VcGain</label>
-												</span>
-												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
-													<label class="toggle-switchy" for="VcGain" data-size="" data-style="rounded">
-														<input disabled type="checkbox" id="VcGain" <?php echo $obj['ChargingInfo3']['isCalibratedVcGain']==1?"checked":"";?>>
-														<span class="toggle">
-														  <span class="switch"></span>
-														</span>
-													</label>
-												</span>
-											</span>
-											<span class="" style="display:block">
-												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
-													<label>VaOffset</label>
-												</span>
-												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
-													<label class="toggle-switchy" for="VaOffset" data-size="" data-style="rounded">
-														<input disabled type="checkbox" id="VaOffset" <?php echo $obj['ChargingInfo3']['isCalibratedVaOffset']==1?"checked":"";?>>
-														<span class="toggle">
-														  <span class="switch"></span>
-														</span>
-													</label>
-												</span>
-												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
-													<label>VbOffset</label>
-												</span>
-												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
-													<label class="toggle-switchy" for="VbOffset" data-size="" data-style="rounded">
-														<input disabled type="checkbox" id="VbOffset" <?php echo $obj['ChargingInfo3']['isCalibratedVbOffset']==1?"checked":"";?>>
-														<span class="toggle">
-														  <span class="switch"></span>
-														</span>
-													</label>
-												</span>
-												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
-													<label>VcOffset</label>
-												</span>
-												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
-													<label class="toggle-switchy" for="VcOffset" data-size="" data-style="rounded">
-														<input disabled type="checkbox" id="VcOffset" <?php echo $obj['ChargingInfo3']['isCalibratedVcOffset']==1?"checked":"";?>>
-														<span class="toggle">
-														  <span class="switch"></span>
-														</span>
-													</label>
-												</span>
-											</span>
-											<span class="" style="display:block">
-												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
-													<label>CaGain</label>
-												</span>
-												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
-													<label class="toggle-switchy" for="CaGain" data-size="" data-style="rounded">
-														<input disabled type="checkbox" id="CaGain" <?php echo $obj['ChargingInfo3']['isCalibratedCaGain']==1?"checked":"";?>>
-														<span class="toggle">
-														  <span class="switch"></span>
-														</span>
-													</label>
-												</span>
-												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
-													<label>CbGain</label>
-												</span>
-												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
-													<label class="toggle-switchy" for="CbGain" data-size="" data-style="rounded">
-														<input disabled type="checkbox" id="CbGain" <?php echo $obj['ChargingInfo3']['isCalibratedCbGain']==1?"checked":"";?>>
-														<span class="toggle">
-														  <span class="switch"></span>
-														</span>
-													</label>
-												</span>
-												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
-													<label>CcGain</label>
-												</span>
-												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
-													<label class="toggle-switchy" for="CcGain" data-size="" data-style="rounded">
-														<input disabled type="checkbox" id="CcGain" <?php echo $obj['ChargingInfo3']['isCalibratedCcGain']==1?"checked":"";?>>
-														<span class="toggle">
-														  <span class="switch"></span>
-														</span>
-													</label>
-												</span>
-											</span>
-											<span class="" style="display:block">
-												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
-													<label>CaOffset</label>
-												</span>
-												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
-													<label class="toggle-switchy" for="CaOffset" data-size="" data-style="rounded">
-														<input disabled type="checkbox" id="CaOffset" <?php echo $obj['ChargingInfo3']['isCalibratedCaOffset']==1?"checked":"";?>>
-														<span class="toggle">
-														  <span class="switch"></span>
-														</span>
-													</label>
-												</span>
-												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
-													<label>CbOffset</label>
-												</span>
-												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
-													<label class="toggle-switchy" for="CbOffset" data-size="" data-style="rounded">
-														<input disabled type="checkbox" id="CbOffset" <?php echo $obj['ChargingInfo3']['isCalibratedCbOffset']==1?"checked":"";?>>
-														<span class="toggle">
-														  <span class="switch"></span>
-														</span>
-													</label>
-												</span>
-												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
-													<label>CcOffset</label>
-												</span>
-												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
-													<label class="toggle-switchy" for="CcOffset" data-size="" data-style="rounded">
-														<input disabled type="checkbox" id="CcOffset" <?php echo $obj['ChargingInfo3']['isCalibratedCcOffset']==1?"checked":"";?>>
-														<span class="toggle">
-														  <span class="switch"></span>
-														</span>
-													</label>
-												</span>
-											</span>
-											<span class="" style="display:block">
-												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
-													<label>Pa</label>
-												</span>
-												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
-													<label class="toggle-switchy" for="Pa" data-size="" data-style="rounded">
-														<input disabled type="checkbox" id="Pa" <?php echo $obj['ChargingInfo3']['isCalibratedPa']==1?"checked":"";?>>
-														<span class="toggle">
-														  <span class="switch"></span>
-														</span>
-													</label>
-												</span>
-												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
-													<label>Pb</label>
-												</span>
-												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
-													<label class="toggle-switchy" for="Pb" data-size="" data-style="rounded">
-														<input disabled type="checkbox" id="Pb" <?php echo $obj['ChargingInfo3']['isCalibratedPb']==1?"checked":"";?>>
-														<span class="toggle">
-														  <span class="switch"></span>
-														</span>
-													</label>
-												</span>
-												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
-													<label>Pc</label>
-												</span>
-												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
-													<label class="toggle-switchy" for="Pc" data-size="" data-style="rounded">
-														<input disabled type="checkbox" id="Pc" <?php echo $obj['ChargingInfo3']['isCalibratedPc']==1?"checked":"";?>>
-														<span class="toggle">
-														  <span class="switch"></span>
-														</span>
-													</label>
-												</span>
-											</span>
-										</div>
-<?php } ?>
-									</section>
-								</article>
-<?php }?>
-<?php } ?>
-								<article class="envor-sorting-item css">
-									<div align="center"><button id="save"><?php echo $lang->showWord("set")?></button></div>
-								</article>
-							</div>
-						</div>
-					</div>
-				</div>
-			</div>
-		</section>
-	</div>
-
-<?php
-	include 'foot.php';
-?>
-
-<script type="text/JavaScript">
-	$(document).ready(function(){
-		if(document.getElementById("MaxChargingEnergy").value=="0" || document.getElementById("MaxChargingEnergy").value==""){
-			document.getElementById("MaxChargingEnergyText").style.display="block";
-		}
-		if(document.getElementById("MaxChargingPower").value=="0" || document.getElementById("MaxChargingPower").value==""){
-			document.getElementById("MaxChargingPowerText").style.display="block";
-		}
-		if(document.getElementById("MaxChargingCurrent").value=="0" || document.getElementById("MaxChargingCurrent").value==""){
-			document.getElementById("MaxChargingCurrentText").style.display="block";
-		}
-		if(document.getElementById("MaxChargingDuration").value=="0" || document.getElementById("MaxChargingDuration").value==""){
-			document.getElementById("MaxChargingDurationText").style.display="block";
-		}
-		if(document.getElementById("MaxChargingSoc").value=="0" || document.getElementById("MaxChargingSoc").value==""){
-			document.getElementById("MaxChargingSocText").style.display="block";
-		}
-		if(document.getElementById("ModelName").value.substr(8,1) != "0"){
-			document.getElementById("AcMaxChargingCurrentDiv").style.display="block";
-			if(document.getElementById("AcMaxChargingCurrent").value=="0" || document.getElementById("AcMaxChargingCurrent").value==""){
-				document.getElementById("AcMaxChargingCurrentText").style.display="block";
-			}
-			document.getElementById("MaxChargingEnergyLbl").innerHTML="DC MaxCharging Energy";
-			document.getElementById("MaxChargingPowerLbl").innerHTML="DC MaxCharging Power";
-			document.getElementById("MaxChargingCurrentLbl").innerHTML="DC MaxCharging Current";
-			document.getElementById("MaxChargingDurationLbl").innerHTML="DC MaxCharging Duration";
-			document.getElementById("MaxChargingSocLbl").innerHTML="DC MaxCharging Soc";
-		}
-		else{
-			document.getElementById("AcMaxChargingCurrentDiv").style.display="none";
-		}
-		isBilling_clicked();
-		document.getElementById("MaxChargingEnergy").addEventListener("change", function() {
-			if(document.getElementById(this.id).value == "0" || document.getElementById(this.id).value == ""){
-				document.getElementById(this.id+"Text").style.display="block";
-			}
-			else{
-				document.getElementById(this.id+"Text").style.display="none";
-			}
-		});
-		document.getElementById("MaxChargingPower").addEventListener("change", function() {
-			if(document.getElementById(this.id).value == "0" || document.getElementById(this.id).value == ""){
-				document.getElementById(this.id+"Text").style.display="block";
-			}
-			else{
-				document.getElementById(this.id+"Text").style.display="none";
-			}
-		});
-		document.getElementById("MaxChargingCurrent").addEventListener("change", function() {
-			if(document.getElementById(this.id).value == "0" || document.getElementById(this.id).value == ""){
-				document.getElementById(this.id+"Text").style.display="block";
-			}
-			else{
-				document.getElementById(this.id+"Text").style.display="none";
-			}
-		});
-		document.getElementById("MaxChargingDuration").addEventListener("change", function() {
-			if(document.getElementById(this.id).value == "0" || document.getElementById(this.id).value == ""){
-				document.getElementById(this.id+"Text").style.display="block";
-			}
-			else{
-				document.getElementById(this.id+"Text").style.display="none";
-			}
-		});
-		document.getElementById("MaxChargingSoc").addEventListener("change", function() {
-			if(document.getElementById(this.id).value == "0" || document.getElementById(this.id).value == ""){
-				document.getElementById(this.id+"Text").style.display="block";
-			}
-			else{
-				document.getElementById(this.id+"Text").style.display="none";
-			}
-		});
-		document.getElementById("AcMaxChargingCurrent").addEventListener("change", function() {
-			if(document.getElementById(this.id).value == "0" || document.getElementById(this.id).value == ""){
-				document.getElementById(this.id+"Text").style.display="block";
-			}
-			else{
-				document.getElementById(this.id+"Text").style.display="none";
-			}
-		});
-		if(document.getElementById("ModelName").value.substr(7,1)!=0){
-			if(document.getElementById("ModelName").value.substr(7,1) == "V" || document.getElementById("ModelName").value.substr(7,1) == "F" || document.getElementById("ModelName").value.substr(7,1) == "P" || document.getElementById("ModelName").value.substr(7,1) == "R"){
-				document.getElementById("ChillerTemp1").style.display="block";
-			}
-			else{
-				document.getElementById("ChillerTemp1").style.display="none";
-			}
-		}
-		if(document.getElementById("ModelName").value.substr(9,1)!=0){
-			if(document.getElementById("ModelName").value.substr(9,1) == "V" || document.getElementById("ModelName").value.substr(9,1) == "F" || document.getElementById("ModelName").value.substr(9,1) == "P" || document.getElementById("ModelName").value.substr(9,1) == "R"){
-				document.getElementById("ChillerTemp2").style.display="block";
-			}
-			else{
-				document.getElementById("ChillerTemp2").style.display="none";
-			}
-		}
-		if(document.getElementById("ModelName").value.substr(8,1)!=0){
-			if(document.getElementById("ModelName").value.substr(8,1) == "V" || document.getElementById("ModelName").value.substr(8,1) == "F" || document.getElementById("ModelName").value.substr(8,1) == "P" || document.getElementById("ModelName").value.substr(8,1) == "R"){
-				document.getElementById("ChillerTemp3").style.display="block";
-			}
-			else{
-				document.getElementById("ChillerTemp3").style.display="none";
-			}
-		}
-	});
-
-	document.getElementById("save").onclick = function() {
-		if(formCheck())
-		{
-			window.location="#loadinghref";
-			document.getElementById("loading").style.display="block";
-			// 發送 Ajax 查詢請求並處理
-			var request = new XMLHttpRequest();
-			request.open("POST", "set_charging_action.php");
-
-			// POST 參數須使用 send() 發送
-			var data =  "MaxChargingEnergy=" + document.getElementById("MaxChargingEnergy").value +
-						"&MaxChargingPower=" + document.getElementById("MaxChargingPower").value +
-						"&MaxChargingCurrent=" + document.getElementById("MaxChargingCurrent").value+
-						"&AcMaxChargingCurrent=" + document.getElementById("AcMaxChargingCurrent").value+
-						"&MaxChargingDuration=" + document.getElementById("MaxChargingDuration").value+
-						"&MaxChargingSoc=" + document.getElementById("MaxChargingSoc").value+
-						"&StopChargingByButton=" + document.getElementById("StopChargingByButton").value+
-						"&LocalWhiteCard0=" + document.getElementById("LocalWhiteCard0").value+
-						"&LocalWhiteCard1=" + document.getElementById("LocalWhiteCard1").value+
-						"&LocalWhiteCard2=" + document.getElementById("LocalWhiteCard2").value+
-						"&LocalWhiteCard3=" + document.getElementById("LocalWhiteCard3").value+
-						"&LocalWhiteCard4=" + document.getElementById("LocalWhiteCard4").value+
-						"&LocalWhiteCard5=" + document.getElementById("LocalWhiteCard5").value+
-						"&LocalWhiteCard6=" + document.getElementById("LocalWhiteCard6").value+
-						"&LocalWhiteCard7=" + document.getElementById("LocalWhiteCard7").value+
-						"&LocalWhiteCard8=" + document.getElementById("LocalWhiteCard8").value+
-						"&LocalWhiteCard9=" + document.getElementById("LocalWhiteCard9").value+
-						"&isBilling=" + (document.getElementById("isBilling").checked?1:0)+
-						"&Currency=" + document.getElementById("Currency").value+
-						"&Fee0=" + document.getElementById("Fee0").value+
-						"&Fee1=" + document.getElementById("Fee1").value+
-						"&Fee2=" + document.getElementById("Fee2").value+
-						"&Fee3=" + document.getElementById("Fee3").value+
-						"&Fee4=" + document.getElementById("Fee4").value+
-						"&Fee5=" + document.getElementById("Fee5").value+
-						"&Fee6=" + document.getElementById("Fee6").value+
-						"&Fee7=" + document.getElementById("Fee7").value+
-						"&Fee8=" + document.getElementById("Fee8").value+
-						"&Fee9=" + document.getElementById("Fee9").value+
-						"&Fee10=" + document.getElementById("Fee10").value+
-						"&Fee11=" + document.getElementById("Fee11").value+
-						"&Fee12=" + document.getElementById("Fee12").value+
-						"&Fee13=" + document.getElementById("Fee13").value+
-						"&Fee14=" + document.getElementById("Fee14").value+
-						"&Fee15=" + document.getElementById("Fee15").value+
-						"&Fee16=" + document.getElementById("Fee16").value+
-						"&Fee17=" + document.getElementById("Fee17").value+
-						"&Fee18=" + document.getElementById("Fee18").value+
-						"&Fee19=" + document.getElementById("Fee19").value+
-						"&Fee20=" + document.getElementById("Fee20").value+
-						"&Fee21=" + document.getElementById("Fee21").value+
-						"&Fee22=" + document.getElementById("Fee22").value+
-						"&Fee23=" + document.getElementById("Fee23").value;
-			
-			// POST 請求必須設置表頭在 open() 下面,send() 上面
-			request.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
-			request.send(data);
-
-			request.onreadystatechange = function() {
-				// 伺服器請求完成
-				if (request.readyState == 4) {
-					 document.getElementById("loading").style.display="none";
-					// 伺服器回應成功
-					if (request.status == 200 && JSON.parse(request.responseText).result=="Success") {
-						alert("<?php echo $lang->showWord("done")?>");
-						location.href="set_charging.php";
-					} else {
-						alert(JSON.parse(request.responseText).message);
-					}
-					request = null;
-				}
-			}
-		}
-	}
-	
-	function formCheck()
-	{
-		var LocalWhiteCard0 = document.getElementById("LocalWhiteCard0").value;
-		var LocalWhiteCard1 = document.getElementById("LocalWhiteCard1").value;
-		var LocalWhiteCard2 = document.getElementById("LocalWhiteCard2").value;
-		var LocalWhiteCard3 = document.getElementById("LocalWhiteCard3").value;
-		var LocalWhiteCard4 = document.getElementById("LocalWhiteCard4").value;
-		var LocalWhiteCard5 = document.getElementById("LocalWhiteCard5").value;
-		var LocalWhiteCard6 = document.getElementById("LocalWhiteCard6").value;
-		var LocalWhiteCard7 = document.getElementById("LocalWhiteCard7").value;
-		var LocalWhiteCard8 = document.getElementById("LocalWhiteCard8").value;
-		var LocalWhiteCard9 = document.getElementById("LocalWhiteCard9").value;
-		var RatingCurrent = document.getElementById("RatingCurrent").value;
-		var RatingPower = document.getElementById("RatingPower").value;
-		var MaxChargingEnergy = document.getElementById("MaxChargingEnergy").value;
-		var MaxChargingPower = document.getElementById("MaxChargingPower").value;
-		var MaxChargingCurrent = document.getElementById("MaxChargingCurrent").value;
-		var AcMaxChargingCurrent = document.getElementById("AcMaxChargingCurrent").value;
-		var MaxChargingDuration = document.getElementById("MaxChargingDuration").value;
-		var MaxChargingSoc = document.getElementById("MaxChargingSoc").value;
-		
-		if(LocalWhiteCard0 != ""){
-			if(LocalWhiteCard0.length>32){
-				alert("Local White Card0 must be less than 32 bytes!");
-				document.getElementById("LocalWhiteCard0").focus();
-				return false;
-			}
-		}
-		if(LocalWhiteCard1 != ""){
-			if(LocalWhiteCard1.length>32){
-				alert("Local White Card1 must be less than 32 bytes!");
-				document.getElementById("LocalWhiteCard1").focus();
-				return false;
-			}
-		}
-		if(LocalWhiteCard2 != ""){
-			if(LocalWhiteCard2.length>32){
-				alert("Local White Card2 must be less than 32 bytes!");
-				document.getElementById("LocalWhiteCard2").focus();
-				return false;
-			}
-		}
-		if(LocalWhiteCard3 != ""){
-			if(LocalWhiteCard3.length>32){
-				alert("Local White Card3 must be less than 32 bytes!");
-				document.getElementById("LocalWhiteCard3").focus();
-				return false;
-			}
-		}
-		if(LocalWhiteCard4 != ""){
-			if(LocalWhiteCard4.length>32){
-				alert("Local White Card4 must be less than 32 bytes!");
-				document.getElementById("LocalWhiteCard4").focus();
-				return false;
-			}
-		}
-		if(LocalWhiteCard5 != ""){
-			if(LocalWhiteCard5.length>32){
-				alert("Local White Card5 must be less than 32 bytes!");
-				document.getElementById("LocalWhiteCard5").focus();
-				return false;
-			}
-		}
-		if(LocalWhiteCard6 != ""){
-			if(LocalWhiteCard6.length>32){
-				alert("Local White Card6 must be less than 32 bytes!");
-				document.getElementById("LocalWhiteCard6").focus();
-				return false;
-			}
-		}
-		if(LocalWhiteCard7 != ""){
-			if(LocalWhiteCard7.length>32){
-				alert("Local White Card7 must be less than 32 bytes!");
-				document.getElementById("LocalWhiteCard7").focus();
-				return false;
-			}
-		}
-		if(LocalWhiteCard8 != ""){
-			if(LocalWhiteCard8.length>32){
-				alert("Local White Card8 must be less than 32 bytes!");
-				document.getElementById("LocalWhiteCard8").focus();
-				return false;
-			}
-		}
-		if(LocalWhiteCard9 != ""){
-			if(LocalWhiteCard9.length>32){
-				alert("Local White Card9 must be less than 32 bytes!");
-				document.getElementById("LocalWhiteCard9").focus();
-				return false;
-			}
-		}
-		if(MaxChargingEnergy =="")
-		{
-			alert("Fill Max Charging Energy !");
-			document.getElementById("MaxChargingEnergy").focus();
-			return false;
-		}
-		if(MaxChargingEnergy >65535)
-		{
-			alert("Max Charging Energy must <= 65535!");
-			document.getElementById("MaxChargingEnergy").focus();
-			return false;
-		}
-		if(MaxChargingEnergy < 0)
-		{
-			alert("Max Charging Energy must >= 0!");
-			document.getElementById("MaxChargingEnergy").focus();
-			return false;
-		}
-		if(MaxChargingPower =="")
-		{
-			alert("Fill Max Charging Power !");
-			document.getElementById("MaxChargingPower").focus();
-			return false;
-		}
-		if(RatingPower!="" && RatingPower!=0){
-			if(parseFloat(MaxChargingPower) > parseFloat(RatingPower))
-			{
-				alert("Max Charging Power must be less than RatingPower("+RatingPower+")!");
-				document.getElementById("MaxChargingPower").focus();
-				return false;
-			}
-		}
-		else{
-			if(MaxChargingPower >65535)
-			{
-				alert("Max Charging Power must <= 65535!");
-				document.getElementById("MaxChargingPower").focus();
-				return false;
-			}
-		}
-		if(MaxChargingCurrent =="")
-		{
-			alert("Fill Max Charging Current !");
-			document.getElementById("MaxChargingCurrent").focus();
-			return false;
-		}
-		if(RatingCurrent!="" && RatingCurrent!=0){
-			if(parseFloat(MaxChargingCurrent) > parseFloat(RatingCurrent))
-			{
-				alert("Max Charging Current must be less than RatingCurrent("+RatingCurrent+")!");
-				document.getElementById("MaxChargingCurrent").focus();
-				return false;
-			}
-		}
-		else{
-			if(MaxChargingCurrent >65535)
-			{
-				alert("Max Charging Current must <= 65535!");
-				document.getElementById("MaxChargingCurrent").focus();
-				return false;
-			}
-		}
-		if(document.getElementById("ModelName").value.substr(8,1)!= "0" && AcMaxChargingCurrent =="")
-		{
-			alert("Fill AC Max Charging Current !");
-			document.getElementById("AcMaxChargingCurrent").focus();
-			return false;
-		}
-		if(AcRatingCurrent!="" && AcRatingCurrent!=0){
-			if(parseFloat(AcMaxChargingCurrent) > parseFloat(AcRatingCurrent))
-			{
-				alert("Ac Max Charging Current must be less than Ac Rating Current("+AcRatingCurrent+")!");
-				document.getElementById("AcMaxChargingCurrent").focus();
-				return false;
-			}
-		}
-		else{
-			if(AcMaxChargingCurrent >65535)
-			{
-				alert("Ac Max Charging Current must <= 65535!");
-				document.getElementById("AcMaxChargingCurrent").focus();
-				return false;
-			}
-			if(AcMaxChargingCurrent < 0)
-			{
-				alert("Ac Max Charging Current must >= 0!");
-				document.getElementById("AcMaxChargingCurrent").focus();
-				return false;
-			}
-		}
-		if(MaxChargingCurrent =="")
-		{
-			alert("Fill Max Charging Current !");
-			document.getElementById("MaxChargingCurrent").focus();
-			return false;
-		}
-		if(MaxChargingCurrent < 0)
-		{
-			alert("MaxChargingCurrent must >= 0!");
-			document.getElementById("MaxChargingCurrent").focus();
-			return false;
-		}
-		if(MaxChargingDuration >65535)
-		{
-			alert("MaxChargingDuration must <= 65535!");
-			document.getElementById("MaxChargingDuration").focus();
-			return false;
-		}
-		if(MaxChargingDuration =="")
-		{
-			alert("Fill Max Charging Duration !");
-			document.getElementById("MaxChargingDuration").focus();
-			return false;
-		}
-		if(MaxChargingDuration < 0)
-		{
-			alert("MaxChargingDuration must >= 0!");
-			document.getElementById("MaxChargingDuration").focus();
-			return false;
-		}
-		if((document.getElementById("ModelName").value.substr(0,1)=="D") && (MaxChargingSoc > 100))
-		{
-			alert("MaxChargingSoc must <= 100!");
-			document.getElementById("MaxChargingSoc").focus();
-			return false;
-		}
-		if((document.getElementById("ModelName").value.substr(0,1)=="D") && (MaxChargingSoc == ""))
-		{
-			alert("Fill Max Charging Soc !");
-			document.getElementById("MaxChargingSoc").focus();
-			return false;
-		}
-		if((document.getElementById("ModelName").value.substr(0,1)=="D") && (MaxChargingSoc < 0))
-		{
-			alert("MaxChargingSoc must >= 0!");
-			document.getElementById("MaxChargingSoc").focus();
-			return false;
-		}
-		
-		if(document.getElementById("ModelName").value.substr(0,1)=="A" && MaxChargingCurrent < 6 && MaxChargingCurrent !=0)
-		{
-			alert("MaxChargingCurrent must > 6!");
-			document.getElementById("MaxChargingCurrent").focus();
-			return false;
-		}
-		return true;
-	}
-	function isBilling_clicked(){
-		if(document.getElementById("isBilling").checked){
-			document.getElementById("CurrencyDiv").style.display="block";
-			document.getElementById("FeeDiv").style.display="block";
-		}
-		else{
-			document.getElementById("CurrencyDiv").style.display="none";
-			document.getElementById("FeeDiv").style.display="none";
-		}
-	}
-
-	function isNumberKey(evt)
-	{
-		var charCode = (evt.which) ? evt.which : event.keyCode
-		
-		if (charCode > 31 && (charCode < 48 || charCode > 57) && (charCode != 46))
-			return false;
-		
-		return true;
-	}
-	
-</script>
-
-
-</html>
+<?php
+	ini_set('error_reporting', E_ALL | E_STRICT);
+	$tag_header = 'set';
+	include 'head.php';
+	$obj = json_decode(trim($output[1]),true);//var_dump($obj);
+	$system = json_decode(trim($output[0]),true);//var_dump($obj);
+	$RatingCurrent = $system['RatingCurrent'];
+	$AcRatingCurrent = $system['AcRatingCurrent'];
+	$ModelName = $system['ModelName'];
+	$RatingPower = substr($ModelName,4,2)*pow(10,-1+substr($ModelName,6,1));
+	$Connector1=substr($ModelName,7,1);
+	$Connector2=substr($ModelName,9,1);
+	$Connector3=substr($ModelName,8,1);
+	if(substr($ModelName,0,2)!="DO" && substr($ModelName,0,2)!="DK" && substr($ModelName,0,2)!="DB"){
+		$connectorType1=ConnectorType($Connector1);
+		$connectorType2=ConnectorType($Connector2);
+		$connectorType3=ConnectorType($Connector3);
+	}
+	$idx=0;
+	if($obj['ChargingInfo1']){
+		switch ($obj['ChargingInfo1']['SystemStatus']){
+			case 0:
+				$SystemStatus1='booting';
+				break;
+			case 1:
+				$SystemStatus1='idle';
+				break;
+			case 2:
+				$SystemStatus1='authorizing';
+				break;
+			case 3:
+				$SystemStatus1='reassign check';
+				break;
+			case 4:
+				$SystemStatus1='reassign';
+				break;
+			case 5:
+				$SystemStatus1='preparing';
+				break;
+			case 6:
+				$SystemStatus1='preparing for EV';
+				break;
+			case 7:
+				$SystemStatus1='preparing for evse';
+				break;
+			case 8:
+				$SystemStatus1='charging';
+				break;
+			case 9:
+				$SystemStatus1='terminating';
+				break;
+			case 10:
+				$SystemStatus1='complete';
+				break;
+			case 11:
+				$SystemStatus1='alarm';
+				break;
+			case 12:
+				$SystemStatus1='fault';
+				break;
+			case 13:
+				$SystemStatus1='reservation';
+				break;
+			case 14:
+				$SystemStatus1='booking';
+				break;
+			case 15:
+				$SystemStatus1='maintain';
+				break;
+			case 16:
+				$SystemStatus1='debug';
+				break;
+			case 17:
+				$SystemStatus1='precharge step 0';
+				break;
+			case 18:
+				$SystemStatus1='precharge step 1';
+				break;
+			case 19:
+				$SystemStatus1='update';
+				break;
+			default:
+				$SystemStatus1='unknown';
+				break;
+		}
+	}
+	if($obj['ChargingInfo2']){
+		switch ($obj['ChargingInfo2']['SystemStatus']){
+			case 0:
+				$SystemStatus2='booting';
+				break;
+			case 1:
+				$SystemStatus2='idle';
+				break;
+			case 2:
+				$SystemStatus2='authorizing';
+				break;
+			case 3:
+				$SystemStatus2='reassign check';
+				break;
+			case 4:
+				$SystemStatus2='reassign';
+				break;
+			case 5:
+				$SystemStatus2='preparing';
+				break;
+			case 6:
+				$SystemStatus2='preparing for EV';
+				break;
+			case 7:
+				$SystemStatus2='preparing for evse';
+				break;
+			case 8:
+				$SystemStatus2='charging';
+				break;
+			case 9:
+				$SystemStatus2='terminating';
+				break;
+			case 10:
+				$SystemStatus2='complete';
+				break;
+			case 11:
+				$SystemStatus2='alarm';
+				break;
+			case 12:
+				$SystemStatus2='fault';
+				break;
+			case 13:
+				$SystemStatus2='reservation';
+				break;
+			case 14:
+				$SystemStatus2='booking';
+				break;
+			case 15:
+				$SystemStatus2='maintain';
+				break;
+			case 16:
+				$SystemStatus2='debug';
+				break;
+			case 17:
+				$SystemStatus2='precharge step 0';
+				break;
+			case 18:
+				$SystemStatus2='precharge step 1';
+				break;
+			case 19:
+				$SystemStatus2='update';
+				break;
+			default:
+				$SystemStatus2='unknown';
+				break;
+		}
+	}
+	if($obj['ChargingInfo3']){
+		switch ($obj['ChargingInfo3']['SystemStatus']){
+			case 0:
+				$SystemStatus3='booting';
+				break;
+			case 1:
+				$SystemStatus3='idle';
+				break;
+			case 2:
+				$SystemStatus3='authorizing';
+				break;
+			case 3:
+				$SystemStatus3='reassign check';
+				break;
+			case 4:
+				$SystemStatus3='reassign';
+				break;
+			case 5:
+				$SystemStatus3='preparing';
+				break;
+			case 6:
+				$SystemStatus3='preparing for EV';
+				break;
+			case 7:
+				$SystemStatus3='preparing for evse';
+				break;
+			case 8:
+				$SystemStatus3='charging';
+				break;
+			case 9:
+				$SystemStatus3='terminating';
+				break;
+			case 10:
+				$SystemStatus3='complete';
+				break;
+			case 11:
+				$SystemStatus3='alarm';
+				break;
+			case 12:
+				$SystemStatus3='fault';
+				break;
+			case 13:
+				$SystemStatus3='reservation';
+				break;
+			case 14:
+				$SystemStatus3='booking';
+				break;
+			case 15:
+				$SystemStatus3='maintain';
+				break;
+			case 16:
+				$SystemStatus3='debug';
+				break;
+			case 17:
+				$SystemStatus3='precharge step 0';
+				break;
+			case 18:
+				$SystemStatus3='precharge step 1';
+				break;
+			case 19:
+				$SystemStatus3='update';
+				break;
+			default:
+				$SystemStatus3='unknown';
+				break;
+		}
+	}
+	if($obj['DDChargingInfo1']){
+		switch ($obj['DDChargingInfo1']['SystemStatus']){
+			case 0:
+				$DDSystemStatus1='booting';
+				break;
+			case 1:
+				$DDSystemStatus1='idle';
+				break;
+			case 2:
+				$DDSystemStatus1='authorizing';
+				break;
+			case 3:
+				$DDSystemStatus1='reassign check';
+				break;
+			case 4:
+				$DDSystemStatus1='reassign';
+				break;
+			case 5:
+				$DDSystemStatus1='preparing';
+				break;
+			case 6:
+				$DDSystemStatus1='preparing for EV';
+				break;
+			case 7:
+				$DDSystemStatus1='preparing for evse';
+				break;
+			case 8:
+				$DDSystemStatus1='charging';
+				break;
+			case 9:
+				$DDSystemStatus1='terminating';
+				break;
+			case 10:
+				$DDSystemStatus1='complete';
+				break;
+			case 11:
+				$DDSystemStatus1='alarm';
+				break;
+			case 12:
+				$DDSystemStatus1='fault';
+				break;
+			case 13:
+				$DDSystemStatus1='reservation';
+				break;
+			case 14:
+				$DDSystemStatus1='booking';
+				break;
+			case 15:
+				$DDSystemStatus1='maintain';
+				break;
+			case 16:
+				$DDSystemStatus1='debug';
+				break;
+			case 17:
+				$DDSystemStatus1='precharge step 0';
+				break;
+			case 18:
+				$DDSystemStatus1='precharge step 1';
+				break;
+			case 19:
+				$DDSystemStatus1='update';
+				break;
+			default:
+				$DDSystemStatus1='unknown';
+				break;
+		}
+	}
+	if($obj['DDChargingInfo2']){
+		switch ($obj['DDChargingInfo2']['SystemStatus']){
+			case 0:
+				$DDSystemStatus2='booting';
+				break;
+			case 1:
+				$DDSystemStatus2='idle';
+				break;
+			case 2:
+				$DDSystemStatus2='authorizing';
+				break;
+			case 3:
+				$DDSystemStatus2='reassign check';
+				break;
+			case 4:
+				$DDSystemStatus2='reassign';
+				break;
+			case 5:
+				$DDSystemStatus2='preparing';
+				break;
+			case 6:
+				$DDSystemStatus2='preparing for EV';
+				break;
+			case 7:
+				$DDSystemStatus2='preparing for evse';
+				break;
+			case 8:
+				$DDSystemStatus2='charging';
+				break;
+			case 9:
+				$DDSystemStatus2='terminating';
+				break;
+			case 10:
+				$DDSystemStatus2='complete';
+				break;
+			case 11:
+				$DDSystemStatus2='alarm';
+				break;
+			case 12:
+				$DDSystemStatus2='fault';
+				break;
+			case 13:
+				$DDSystemStatus2='reservation';
+				break;
+			case 14:
+				$DDSystemStatus2='booking';
+				break;
+			case 15:
+				$DDSystemStatus2='maintain';
+				break;
+			case 16:
+				$DDSystemStatus2='debug';
+				break;
+			case 17:
+				$DDSystemStatus2='precharge step 0';
+				break;
+			case 18:
+				$DDSystemStatus2='precharge step 1';
+				break;
+			case 19:
+				$DDSystemStatus2='update';
+				break;
+			default:
+				$DDSystemStatus2='unknown';
+				break;
+		}
+	}
+	if($obj['DDChargingInfo3']){
+		switch ($obj['DDChargingInfo3']['SystemStatus']){
+			case 0:
+				$DDSystemStatus3='booting';
+				break;
+			case 1:
+				$DDSystemStatus3='idle';
+				break;
+			case 2:
+				$DDSystemStatus3='authorizing';
+				break;
+			case 3:
+				$DDSystemStatus3='reassign check';
+				break;
+			case 4:
+				$DDSystemStatus3='reassign';
+				break;
+			case 5:
+				$DDSystemStatus3='preparing';
+				break;
+			case 6:
+				$DDSystemStatus3='preparing for EV';
+				break;
+			case 7:
+				$DDSystemStatus3='preparing for evse';
+				break;
+			case 8:
+				$DDSystemStatus3='charging';
+				break;
+			case 9:
+				$DDSystemStatus3='terminating';
+				break;
+			case 10:
+				$DDSystemStatus3='complete';
+				break;
+			case 11:
+				$DDSystemStatus3='alarm';
+				break;
+			case 12:
+				$DDSystemStatus3='fault';
+				break;
+			case 13:
+				$DDSystemStatus3='reservation';
+				break;
+			case 14:
+				$DDSystemStatus3='booking';
+				break;
+			case 15:
+				$DDSystemStatus3='maintain';
+				break;
+			case 16:
+				$DDSystemStatus3='debug';
+				break;
+			case 17:
+				$DDSystemStatus3='precharge step 0';
+				break;
+			case 18:
+				$DDSystemStatus3='precharge step 1';
+				break;
+			case 19:
+				$DDSystemStatus3='update';
+				break;
+			default:
+				$DDSystemStatus3='unknown';
+				break;
+		}
+	}
+	if($obj['DDChargingInfo4']){
+		switch ($obj['DDChargingInfo4']['SystemStatus']){
+			case 0:
+				$DDSystemStatus4='booting';
+				break;
+			case 1:
+				$DDSystemStatus4='idle';
+				break;
+			case 2:
+				$DDSystemStatus4='authorizing';
+				break;
+			case 3:
+				$DDSystemStatus4='reassign check';
+				break;
+			case 4:
+				$DDSystemStatus4='reassign';
+				break;
+			case 5:
+				$DDSystemStatus4='preparing';
+				break;
+			case 6:
+				$DDSystemStatus4='preparing for EV';
+				break;
+			case 7:
+				$DDSystemStatus4='preparing for evse';
+				break;
+			case 8:
+				$DDSystemStatus4='charging';
+				break;
+			case 9:
+				$DDSystemStatus4='terminating';
+				break;
+			case 10:
+				$DDSystemStatus4='complete';
+				break;
+			case 11:
+				$DDSystemStatus4='alarm';
+				break;
+			case 12:
+				$DDSystemStatus4='fault';
+				break;
+			case 13:
+				$DDSystemStatus4='reservation';
+				break;
+			case 14:
+				$DDSystemStatus4='booking';
+				break;
+			case 15:
+				$DDSystemStatus4='maintain';
+				break;
+			case 16:
+				$DDSystemStatus4='debug';
+				break;
+			case 17:
+				$DDSystemStatus4='precharge step 0';
+				break;
+			case 18:
+				$DDSystemStatus4='precharge step 1';
+				break;
+			case 19:
+				$DDSystemStatus4='update';
+				break;
+			default:
+				$DDSystemStatus4='unknown';
+				break;
+		}
+	}
+	
+	function ConnectorType($connector){
+		$result="";
+		if($connector == "0"){
+			$result= "";
+		}
+		else if($connector == "U" || $connector == "V" || $connector == "E" || $connector == "F" || $connector == "T" || $connector == "D" || $connector == "M" || $connector == "N" || $connector == "P" || $connector == "R" || $connector == "Y" || $connector == "Z" || $connector == "I" || $connector == "Q"){
+			$result= "CCS";
+		}
+		else if($connector == "G" || $connector == "B" || $connector == "H" || $connector == "A"){
+			$result= "GB";
+		}
+		else if($connector == "J" || $connector == "K" || $connector == "L" || $connector == "S" || $connector == "O"){
+			$result= "CHAdeMO";
+		}
+		else if($connector == "1" || $connector == "2" || $connector == "3" || $connector == "4" || $connector == "5" || $connector == "6" || $connector == "7" || $connector == "8"){
+			$result= "AC";
+		}
+		else{
+			$result= "";
+		}
+		return $result;
+	}
+
+?>
+<style>
+img {
+  display: block;
+  margin-left: auto;
+  margin-right: auto;
+}
+<?php if(substr($ModelName,0,2)=="AX"){?>
+/* Colors: Default (blue) */
+.toggle-switchy {color:#fff;}
+.toggle-switchy > input + .toggle:before {content:'Calibrated';}
+.toggle-switchy > input + .toggle:after {content:'Default';}
+.toggle-switchy > input + .toggle > .switch {background:#fff;}
+.toggle-switchy > input + .toggle + .label {color:#000;}
+.toggle-switchy > input:checked + .toggle {background:#3498db;}
+.toggle-switchy > input:not(:checked) + .toggle {background:#ccc;}
+.toggle-switchy > input:checked + .toggle > .switch {border:3px solid #3498db;}
+.toggle-switchy > input:not(:checked) + .toggle > .switch {border:3px solid #ccc;}
+.toggle-switchy > input:focus + .toggle,
+.toggle-switchy > input:active + .toggle {box-shadow:0 0 5px 3px rgba(0, 119, 200, 0.50);}
+
+/* Rounded switch corners */
+.toggle-switchy > input + .toggle {border-radius:4px;}
+.toggle-switchy > input + .toggle .switch {border-radius:6px;}
+
+/* //////////////////////////
+CORE STYLES BELOW - NO TOUCHY
+////////////////////////// */
+.toggle-switchy {display:inline-flex; align-items:center; user-select:none; position:relative;}
+.toggle-switchy:hover {cursor:pointer;}
+.toggle-switchy > input {position:absolute; opacity:0;}
+.toggle-switchy > input + .toggle {align-items:center; position:relative;}
+.toggle-switchy > input + .toggle {overflow:hidden; position:relative; flex-shrink:0;}
+.toggle-switchy > input[disabled] + .toggle {opacity:0.5;}
+.toggle-switchy > input[disabled] + .toggle:hover {cursor:not-allowed;}
+.toggle-switchy > input + .toggle {width:100%; height:100%; margin:0; cursor:pointer;}
+.toggle-switchy > input + .toggle > .switch {display:block; height:100%; position:absolute; right:0; z-index:3;}
+
+/* Labels */
+.toggle-switchy > input + .toggle:before,
+.toggle-switchy > input + .toggle:after {display:flex; align-items:center; position:absolute; z-index:2; height:100%;}
+.toggle-switchy > input + .toggle:before {right:55%;}
+.toggle-switchy > input + .toggle:after {left:50%;}
+.toggle-switchy > input + .toggle + .label {margin-left:10px;}
+.toggle-switchy[data-label='left'] > input + .toggle {order:2;}
+.toggle-switchy[data-label='left'] > input + .toggle + .label {order:1; margin-left:0; margin-right:10px;}
+
+/* Show / Hide */
+.toggle-switchy > input + .toggle:before {opacity:0;}
+.toggle-switchy > input:checked + .toggle:before {opacity:1;}
+.toggle-switchy > input:checked + .toggle:after {opacity:0;}
+
+/* Transitions */
+.toggle-switchy > input + .toggle {transition:background 200ms linear, box-shadow 200ms linear;}
+.toggle-switchy > input + .toggle:before,
+.toggle-switchy > input + .toggle:after {transition:all 200ms linear;}
+.toggle-switchy > input + .toggle > .switch {transition:right 200ms linear, border-color 200ms linear;}
+/* //////////////////////////
+CORE STYLES ABOVE - NO TOUCHY
+////////////////////////// */
+
+/* Size: Extra Large */
+.toggle-switchy[data-size='xl'] > input + .toggle							{width:85px; height:40px;}
+.toggle-switchy[data-size='xl'] > input + .toggle > .switch					{width:40px;}
+.toggle-switchy[data-size='xl'] > input + .toggle:before,
+.toggle-switchy[data-size='xl'] > input + .toggle:after						{font-size:1.2rem;}
+.toggle-switchy[data-size='xl'] > input:not(:checked) + .toggle > .switch	{right:calc(100% - 40px);}
+
+/* Size: Large */
+.toggle-switchy[data-size='lg'] > input + .toggle							{width:75px; height:35px;}
+.toggle-switchy[data-size='lg'] > input + .toggle > .switch					{width:35px;}
+.toggle-switchy[data-size='lg'] > input + .toggle:before,
+.toggle-switchy[data-size='lg'] > input + .toggle:after						{font-size:1rem;}
+.toggle-switchy[data-size='lg'] > input:not(:checked) + .toggle > .switch	{right:calc(100% - 35px);}
+
+/* Size: Default (Medium) */
+.toggle-switchy > input + .toggle											{width:100px; height:30px;}
+.toggle-switchy > input + .toggle	> .switch								{width:30px;}
+.toggle-switchy > input + .toggle:before,
+.toggle-switchy > input + .toggle:after										{font-size:0.8rem;}
+.toggle-switchy > input:not(:checked) + .toggle > .switch					{right:calc(100% - 30px);}
+
+/* Size: Small */
+.toggle-switchy[data-size='sm'] > input + .toggle							{width:55px; height:25px;}
+.toggle-switchy[data-size='sm'] > input + .toggle > .switch					{width:25px;}
+.toggle-switchy[data-size='sm'] > input + .toggle:before,
+.toggle-switchy[data-size='sm'] > input + .toggle:after						{font-size:0.7rem;}
+.toggle-switchy[data-size='sm'] > input:not(:checked) + .toggle > .switch	{right:calc(100% - 25px);}
+
+/* Size: Extra Small */
+.toggle-switchy[data-size='xs'] > input + .toggle							{width:45px; height:20px;}
+.toggle-switchy[data-size='xs'] > input + .toggle > .switch					{width:20px;}
+.toggle-switchy[data-size='xs'] > input + .toggle:before,
+.toggle-switchy[data-size='xs'] > input + .toggle:after						{font-size:0.5rem;}
+.toggle-switchy[data-size='xs'] > input:not(:checked) + .toggle > .switch	{right:calc(100% - 20px);}
+
+/* Style: Rounded */
+.toggle-switchy[data-style='rounded'] > input + .toggle,
+.toggle-switchy[data-style='rounded'] > input + .toggle > .switch			{border-radius:50px;}
+.toggle-switchy[data-style='rounded'] > input + .toggle:before				{right:30%;}
+.toggle-switchy[data-style='rounded'] > input + .toggle:after				{left:40%;}
+
+/* Style: Square */
+.toggle-switchy[data-style='square'] > input + .toggle						{border-radius:0;}
+.toggle-switchy[data-style='square'] > input + .toggle .switch				{border-radius:0;}
+
+/* Text: Off */
+.toggle-switchy[data-text='false'] > input + .toggle:before,
+.toggle-switchy[data-text='false'] > input + .toggle:after					{content:'';}
+.toggle-switchy[data-text='false'][data-size='xl'] > input + .toggle		{width:80px;}
+.toggle-switchy[data-text='false'][data-size='lg'] > input + .toggle		{width:70px;}
+.toggle-switchy[data-text='false'] > input + .toggle						{width:60px;}
+.toggle-switchy[data-text='false'][data-size='sm'] > input + .toggle		{width:50px;}
+.toggle-switchy[data-text='false'][data-size='xs'] > input + .toggle		{width:40px;}
+
+/* Color: Red */
+.toggle-switchy[data-color='red'] > input:checked + .toggle					{background:#e74c3c;}
+.toggle-switchy[data-color='red'] > input:checked + .toggle > .switch		{border-color:#e74c3c;}
+
+/* Color: Orange */
+.toggle-switchy[data-color='orange'] > input:checked + .toggle				{background:#e67e22;}
+.toggle-switchy[data-color='orange'] > input:checked + .toggle > .switch	{border-color:#e67e22;}
+ 
+ /* Color: Yellow */
+.toggle-switchy[data-color='yellow'] > input:checked + .toggle				{background:#f1c40f;}
+.toggle-switchy[data-color='yellow'] > input:checked + .toggle > .switch	{border-color:#f1c40f;}
+
+/* Color: Green */
+.toggle-switchy[data-color='green'] > input:checked + .toggle				{background:#2ecc71;}
+.toggle-switchy[data-color='green'] > input:checked + .toggle > .switch		{border-color:#2ecc71;}
+
+/* Color: Blue */
+.toggle-switchy[data-color='blue'] > input:checked + .toggle				{background:#3498db;}
+.toggle-switchy[data-color='blue'] > input:checked + .toggle > .switch		{border-color:#3498db;}
+
+/* Color: Purple */
+.toggle-switchy[data-color='purple'] > input:checked + .toggle				{background:#9b59b6;}
+.toggle-switchy[data-color='purple'] > input:checked + .toggle > .switch	{border-color:#9b59b6;}
+
+/* Color: Gray */
+.toggle-switchy[data-color='gray'] > input:checked + .toggle				{background:#555;}
+.toggle-switchy[data-color='gray'] > input:checked + .toggle > .switch		{border-color:#555;}
+<?php } ?>
+</style>
+	<div class="envor-content">
+		<!--
+		Page Title start
+		//-->
+		<section class="envor-page-title-1" data-stellar-background-ratio="0.5">
+			<div class="container">
+				<div class="row">
+					<div class="col-lg-9 col-md-9 col-sm-9">
+						<h1><?php echo $lang->showWord("charging"); ?></h1>
+					</div>
+				</div>
+			</div>
+		<!--
+		Page Title end
+		//-->
+		</section>
+		<!--
+		Main Content start
+		//-->
+		<a id="loadinghref"><div id="loading" style="display:none;"><input type="hidden" name="ModelName" id="ModelName" value="<?php echo $ModelName;?>"><img src="img/giphy.gif"/></div></a>
+		<section class="envor-section">
+			<div class="container">
+				<div class="row">
+					<div class="col-lg-12">         
+						<div class="envor-sorting" id="faq-sorting">
+							<div class="envor-toggle">
+								<!--Charging relevant parameters-->
+								<article class="envor-sorting-item css">
+									<header><?php echo $lang->showWord("charging_relevant_parameters"); ?><i class="fa fa-plus"></i></header>
+									<section>
+										<div class="form-group" style="display:<?php echo $am111;?>">
+											<label id="MaxChargingEnergyLbl">Max Charging Energy</label>
+											<small class="form-text text-muted-red">kWh</small>
+											<input type="text" name="MaxChargingEnergy" id="MaxChargingEnergy" class="form-control" value="<?php echo $obj['MaxChargingEnergy'];?>" placeholder="<?php echo ($obj['MaxChargingEnergy']==0||$obj['MaxChargingEnergy']=="")?"'0' means unlimit":"";?>" title="'0' means unlimit">
+											<small class="form-text text-muted-red"><label id="MaxChargingEnergyText" style="display:none;">'0' means unlimit</label></small>
+										</div>
+										<div class="form-group" style="display:<?php echo $am001;?>">
+											<label id="MaxChargingPowerLbl">Max Charging Power</label>
+											<small class="form-text text-muted-red">kW</small>
+											<input type="text" name="MaxChargingPower" id="MaxChargingPower" class="form-control" value="<?php echo $obj['MaxChargingPower'];?>" placeholder="<?php echo ($obj['MaxChargingPower']==0||$obj['MaxChargingPower']=="")?"'0' means unlimit":"";?>" title="'0' means unlimit">
+											<input type="hidden" name="RatingPower" id="RatingPower" value="<?php echo $RatingPower;?>">
+											<small class="form-text text-muted-red"><label id="MaxChargingPowerText" style="display:none;">'0' means unlimit</label></small>
+										</div>
+										<div class="form-group" style="display:<?php echo $am111;?>">
+											<label id="MaxChargingCurrentLbl">Max Charging Current</label>
+											<small class="form-text text-muted-red">amp</small>
+											<input type="text" name="MaxChargingCurrent" id="MaxChargingCurrent" class="form-control" value="<?php echo $obj['MaxChargingCurrent'];?>" placeholder="<?php echo ($obj['MaxChargingCurrent']==0||$obj['MaxChargingCurrent']=="")?"'0' means unlimit":"";?>" title="'0' means unlimit">
+											<input type="hidden" name="RatingCurrent" id="RatingCurrent" value="<?php echo $RatingCurrent;?>">
+											<small class="form-text text-muted-red"><label id="MaxChargingCurrentText" style="display:none;">'0' means unlimit</label></small>
+										</div>
+										<div class="form-group" style="display:<?php echo $am111;?>">
+											<label id="MaxChargingDurationLbl">Max Charging Duration</label>
+											<small class="form-text text-muted-red">minutes</small>
+											<input type="text" name="MaxChargingDuration" id="MaxChargingDuration" class="form-control" value="<?php echo $obj['MaxChargingDuration'];?>" placeholder="<?php echo ($obj['MaxChargingDuration']==0||$obj['MaxChargingDuration']=="")?"'0' means unlimit":"";?>" title="'0' means unlimit">
+											<small class="form-text text-muted-red"><label id="MaxChargingDurationText" style="display:none;">'0' means unlimit</label></small>
+										</div>
+										<div class="form-group" style="display:<?php echo $am001;?>">
+											<label id="MaxChargingSocLbl">Max Charging Soc</label>
+											<small class="form-text text-muted-red">percent</small>
+											<input type="text" name="MaxChargingSoc" id="MaxChargingSoc" class="form-control" value="<?php echo $obj['MaxChargingSoc'];?>" placeholder="<?php echo ($obj['MaxChargingSoc']==0||$obj['MaxChargingSoc']=="")?"'0' means unlimit":"";?>" title="'0' means unlimit">
+											<small class="form-text text-muted-red"><label id="MaxChargingSocText" style="display:none;">'0' means unlimit</label></small>
+										</div>
+										<div class="form-group" style="display:<?php echo $am001;?>">
+											<label>Stop Charging By Button</label>
+											<select class="form-control" id="StopChargingByButton" name="StopChargingByButton">
+												<option value="0" <?php echo $obj['StopChargingByButton']=="0"?"selected":""?>>Disable</option>
+												<option value="1" <?php echo $obj['StopChargingByButton']=="1"?"selected":""?>>Enable</option>
+											</select>
+										</div>
+										<div class="form-group" style="display:<?php echo $am001;?>">
+											<label>Fan Control Policy</label>
+											<select class="form-control" id="FanControlPolicy" name="FanControlPolicy">
+												<option value="0" <?php echo $obj['FanControlPolicy']=="0"?"selected":""?>>Auto</option>
+												<option value="1" <?php echo $obj['FanControlPolicy']=="1"?"selected":""?>>Quiet mode</option>
+											</select>
+										</div>
+										<div class="form-group" id="AcMaxChargingCurrentDiv">
+											<label>AC Max Charging Current</label>
+											<small class="form-text text-muted-red">amp</small>
+											<input type="text" name="AcMaxChargingCurrent" id="AcMaxChargingCurrent" class="form-control" value="<?php echo $obj['AcMaxChargingCurrent'];?>" placeholder="<?php echo ($obj['AcMaxChargingCurrent']==0||$obj['AcMaxChargingCurrent']=="")?"'0' means unlimit":"";?>" title="'0' means unlimit">
+											<input type="hidden" name="AcRatingCurrent" id="AcRatingCurrent" value="<?php echo $AcRatingCurrent;?>">
+											<small class="form-text text-muted-red"><label id="AcMaxChargingCurrentText" style="display:none;">'0' means unlimit</label></small>
+										</div>
+										<div class="form-group" style="display:<?php echo $am111;?>">
+											<label><?php echo $lang->showWord("local_white_card"); ?>0</label>
+											<input type="text" name="LocalWhiteCard0" id="LocalWhiteCard0" class="form-control" value="<?php echo $obj['LocalWhiteCard'][0];?>">
+										</div>
+										<div class="form-group" style="display:<?php echo $am111;?>">
+											<label><?php echo $lang->showWord("local_white_card"); ?>1</label>
+											<input type="text" name="LocalWhiteCard1" id="LocalWhiteCard1" class="form-control" value="<?php echo $obj['LocalWhiteCard'][1];?>">
+										</div>
+										<div class="form-group" style="display:<?php echo $am111;?>">
+											<label><?php echo $lang->showWord("local_white_card"); ?>2</label>
+											<input type="text" name="LocalWhiteCard2" id="LocalWhiteCard2" class="form-control" value="<?php echo $obj['LocalWhiteCard'][2];?>">
+										</div>
+										<div class="form-group" style="display:<?php echo $am111;?>">
+											<label><?php echo $lang->showWord("local_white_card"); ?>3</label>
+											<input type="text" name="LocalWhiteCard3" id="LocalWhiteCard3" class="form-control" value="<?php echo $obj['LocalWhiteCard'][3];?>">
+										</div>
+										<div class="form-group" style="display:<?php echo $am111;?>">
+											<label><?php echo $lang->showWord("local_white_card"); ?>4</label>
+											<input type="text" name="LocalWhiteCard4" id="LocalWhiteCard4" class="form-control" value="<?php echo $obj['LocalWhiteCard'][4];?>">
+										</div>
+										<div class="form-group" style="display:<?php echo $am111;?>">
+											<label><?php echo $lang->showWord("local_white_card"); ?>5</label>
+											<input type="text" name="LocalWhiteCard5" id="LocalWhiteCard5" class="form-control" value="<?php echo $obj['LocalWhiteCard'][5];?>">
+										</div>
+										<div class="form-group" style="display:<?php echo $am111;?>">
+											<label><?php echo $lang->showWord("local_white_card"); ?>6</label>
+											<input type="text" name="LocalWhiteCard6" id="LocalWhiteCard6" class="form-control" value="<?php echo $obj['LocalWhiteCard'][6];?>">
+										</div>
+										<div class="form-group" style="display:<?php echo $am111;?>">
+											<label><?php echo $lang->showWord("local_white_card"); ?>7</label>
+											<input type="text" name="LocalWhiteCard7" id="LocalWhiteCard7" class="form-control" value="<?php echo $obj['LocalWhiteCard'][7];?>">
+										</div>
+										<div class="form-group" style="display:<?php echo $am111;?>">
+											<label><?php echo $lang->showWord("local_white_card"); ?>8</label>
+											<input type="text" name="LocalWhiteCard8" id="LocalWhiteCard8" class="form-control" value="<?php echo $obj['LocalWhiteCard'][8];?>">
+										</div>
+										<div class="form-group" style="display:<?php echo $am111;?>">
+											<label><?php echo $lang->showWord("local_white_card"); ?>9</label>
+											<input type="text" name="LocalWhiteCard9" id="LocalWhiteCard9" class="form-control" value="<?php echo $obj['LocalWhiteCard'][9];?>">
+										</div>
+										<div class="form-group"  id="isBillingDiv">
+											<label>
+											<input type="checkbox" id="isBilling" name="isBilling" <?php echo $obj['isBilling']==1?"checked":"";?> onclick="isBilling_clicked()">
+											<?php echo $lang->showWord("billing"); ?></label>
+										</div>
+										<div class="form-group" id="CurrencyDiv">
+											<label><?php echo $lang->showWord("currency"); ?></label>
+											<select class="form-control" id="Currency" name="Currency">
+												<option value="0" <?php echo $obj['Currency']=="0"?"selected":""?>>AED - Emirati Dirham</option>
+												<option value="1" <?php echo $obj['Currency']=="1"?"selected":""?>>ARS - Argentine Peso</option>
+												<option value="2" <?php echo $obj['Currency']=="2"?"selected":""?>>AUD - Australian Dollar</option>
+												<option value="3" <?php echo $obj['Currency']=="3"?"selected":""?>>BGN - Bulgarian Lev</option>
+												<option value="4" <?php echo $obj['Currency']=="4"?"selected":""?>>BHD - Bahraini Dinar</option>
+												<option value="5" <?php echo $obj['Currency']=="5"?"selected":""?>>BND - Bruneian Dollar</option>
+												<option value="6" <?php echo $obj['Currency']=="6"?"selected":""?>>BRL - Brazilian Real</option>
+												<option value="7" <?php echo $obj['Currency']=="7"?"selected":""?>>BWP - Botswana Pula</option>
+												<option value="8" <?php echo $obj['Currency']=="8"?"selected":""?>>CAD - Canadian Dollar</option>
+												<option value="9" <?php echo $obj['Currency']=="9"?"selected":""?>>CHF - Swiss Franc</option>
+												<option value="10" <?php echo $obj['Currency']=="10"?"selected":""?>>CLP - Chilean Peso</option>
+												<option value="11" <?php echo $obj['Currency']=="11"?"selected":""?>>CNY - Chinese Yuan Renminbi</option>
+												<option value="12" <?php echo $obj['Currency']=="12"?"selected":""?>>COP - Colombian Peso</option>
+												<option value="13" <?php echo $obj['Currency']=="13"?"selected":""?>>CZK - Czech Koruna</option>
+												<option value="14" <?php echo $obj['Currency']=="14"?"selected":""?>>DKK - Danish Krone</option>
+												<option value="15" <?php echo $obj['Currency']=="15"?"selected":""?>>EUR - Euro</option>
+												<option value="16" <?php echo $obj['Currency']=="16"?"selected":""?>>GBP - British Pound</option>
+												<option value="17" <?php echo $obj['Currency']=="17"?"selected":""?>>HKD - Hong Kong Dollar</option>
+												<option value="18" <?php echo $obj['Currency']=="18"?"selected":""?>>HRK - Croatian Kuna</option>
+												<option value="19" <?php echo $obj['Currency']=="19"?"selected":""?>>HUF - Hungarian Forint</option>
+												<option value="20" <?php echo $obj['Currency']=="20"?"selected":""?>>IDR - Indonesian Rupiah</option>
+												<option value="21" <?php echo $obj['Currency']=="21"?"selected":""?>>ILS - Israeli Shekel</option>
+												<option value="22" <?php echo $obj['Currency']=="22"?"selected":""?>>INR - Indian Rupee</option>
+												<option value="23" <?php echo $obj['Currency']=="23"?"selected":""?>>IRR - Iranian Rial</option>
+												<option value="24" <?php echo $obj['Currency']=="24"?"selected":""?>>ISK - Icelandic Krona</option>
+												<option value="25" <?php echo $obj['Currency']=="25"?"selected":""?>>JPY - Japanese Yen</option>
+												<option value="26" <?php echo $obj['Currency']=="26"?"selected":""?>>KRW - South Korean Won</option>
+												<option value="27" <?php echo $obj['Currency']=="27"?"selected":""?>>KWD - Kuwaiti Dinar</option>
+												<option value="28" <?php echo $obj['Currency']=="28"?"selected":""?>>KZT - Kazakhstani Tenge</option>
+												<option value="29" <?php echo $obj['Currency']=="29"?"selected":""?>>LKR - Sri Lankan Rupee</option>
+												<option value="30" <?php echo $obj['Currency']=="30"?"selected":""?>>LYD - Libyan Dinar</option>
+												<option value="31" <?php echo $obj['Currency']=="31"?"selected":""?>>MUR - Mauritian Rupee</option>
+												<option value="32" <?php echo $obj['Currency']=="32"?"selected":""?>>MXN - Mexican Peso</option>
+												<option value="33" <?php echo $obj['Currency']=="33"?"selected":""?>>MYR - Malaysian Ringgit</option>
+												<option value="34" <?php echo $obj['Currency']=="34"?"selected":""?>>NOK - Norwegian Krone</option>
+												<option value="35" <?php echo $obj['Currency']=="35"?"selected":""?>>NPR - Nepalese Rupee</option>
+												<option value="36" <?php echo $obj['Currency']=="36"?"selected":""?>>NZD - New Zealand Dollar</option>
+												<option value="37" <?php echo $obj['Currency']=="37"?"selected":""?>>OMR - Omani Rial</option>
+												<option value="38" <?php echo $obj['Currency']=="38"?"selected":""?>>PHP - Philippine Peso</option>
+												<option value="39" <?php echo $obj['Currency']=="39"?"selected":""?>>PKR - Pakistani Rupee</option>
+												<option value="40" <?php echo $obj['Currency']=="40"?"selected":""?>>PLN - Polish Zloty</option>
+												<option value="41" <?php echo $obj['Currency']=="41"?"selected":""?>>QAR - Qatari Riyal</option>
+												<option value="42" <?php echo $obj['Currency']=="42"?"selected":""?>>RON - Romanian New Leu</option>
+												<option value="43" <?php echo $obj['Currency']=="43"?"selected":""?>>RUB - Russian Ruble</option>
+												<option value="44" <?php echo $obj['Currency']=="44"?"selected":""?>>SAR - Saudi Arabian Riyal</option>
+												<option value="45" <?php echo $obj['Currency']=="45"?"selected":""?>>SEK - Swedish Krona</option>
+												<option value="46" <?php echo $obj['Currency']=="46"?"selected":""?>>SGD - Singapore Dollar</option>
+												<option value="47" <?php echo $obj['Currency']=="47"?"selected":""?>>THB - Thai Baht</option>
+												<option value="48" <?php echo $obj['Currency']=="48"?"selected":""?>>TRY - Turkish Lira</option>
+												<option value="49" <?php echo $obj['Currency']=="49"?"selected":""?>>TTD - Trinidadian Dollar</option>
+												<option value="50" <?php echo $obj['Currency']=="50"?"selected":""?>>TWD - Taiwan New Dollar</option>
+												<option value="51" <?php echo $obj['Currency']=="51"?"selected":""?>>USD - US Dollar</option>
+												<option value="52" <?php echo $obj['Currency']=="52"?"selected":""?>>VEF - Venezuelan Bolivar</option>
+												<option value="53" <?php echo $obj['Currency']=="53"?"selected":""?>>ZAR - South African Rand</option>
+											</select>
+										</div>
+										<div class="form-group" id="FeeDiv">
+											<div class="form-group">
+												<label><?php echo $lang->showWord("fee"); ?> 00:00~00:59</label>
+												<input type="text" name="Fee0" id="Fee0" class="form-control" value="<?php echo round($obj['Fee'][0],2);?>">
+											</div>
+											<div class="form-group">
+												<label><?php echo $lang->showWord("fee"); ?> 01:00~01:59</label>
+												<input type="text" name="Fee0" id="Fee1" class="form-control" value="<?php echo round($obj['Fee'][1],2);?>">
+											</div>
+											<div class="form-group">
+												<label><?php echo $lang->showWord("fee"); ?> 02:00~02:59</label>
+												<input type="text" name="Fee2" id="Fee2" class="form-control" value="<?php echo round($obj['Fee'][2],2);?>">
+											</div>
+											<div class="form-group">
+												<label><?php echo $lang->showWord("fee"); ?> 03:00~03:59</label>
+												<input type="text" name="Fee3" id="Fee3" class="form-control" value="<?php echo round($obj['Fee'][3],2);?>">
+											</div>
+											<div class="form-group">
+												<label><?php echo $lang->showWord("fee"); ?> 04:00~04:59</label>
+												<input type="text" name="Fee4" id="Fee4" class="form-control" value="<?php echo round($obj['Fee'][4],2);?>">
+											</div>
+											<div class="form-group">
+												<label><?php echo $lang->showWord("fee"); ?> 05:00~05:59</label>
+												<input type="text" name="Fee5" id="Fee5" class="form-control" value="<?php echo round($obj['Fee'][5],2);?>">
+											</div>
+											<div class="form-group">
+												<label><?php echo $lang->showWord("fee"); ?> 06:00~06:59</label>
+												<input type="text" name="Fee6" id="Fee6" class="form-control" value="<?php echo round($obj['Fee'][6],2);?>">
+											</div>
+											<div class="form-group">
+												<label><?php echo $lang->showWord("fee"); ?> 07:00~07:59</label>
+												<input type="text" name="Fee7" id="Fee7" class="form-control" value="<?php echo round($obj['Fee'][7],2);?>">
+											</div>
+											<div class="form-group">
+												<label><?php echo $lang->showWord("fee"); ?> 08:00~08:59</label>
+												<input type="text" name="Fee8" id="Fee8" class="form-control" value="<?php echo round($obj['Fee'][8],2);?>">
+											</div>
+											<div class="form-group">
+												<label><?php echo $lang->showWord("fee"); ?> 09:00~09:59</label>
+												<input type="text" name="Fee9" id="Fee9" class="form-control" value="<?php echo round($obj['Fee'][9],2);?>">
+											</div>
+											<div class="form-group">
+												<label><?php echo $lang->showWord("fee"); ?> 10:00~10:59</label>
+												<input type="text" name="Fee10" id="Fee10" class="form-control" value="<?php echo round($obj['Fee'][10],2);?>">
+											</div>
+											<div class="form-group">
+												<label><?php echo $lang->showWord("fee"); ?> 11:00~11:59</label>
+												<input type="text" name="Fee11" id="Fee11" class="form-control" value="<?php echo round($obj['Fee'][11],2);?>">
+											</div>
+											<div class="form-group">
+												<label><?php echo $lang->showWord("fee"); ?> 12:00~12:59</label>
+												<input type="text" name="Fee12" id="Fee12" class="form-control" value="<?php echo round($obj['Fee'][12],2);?>">
+											</div>
+											<div class="form-group">
+												<label><?php echo $lang->showWord("fee"); ?> 13:00~13:59</label>
+												<input type="text" name="Fee13" id="Fee13" class="form-control" value="<?php echo round($obj['Fee'][13],2);?>">
+											</div>
+											<div class="form-group">
+												<label><?php echo $lang->showWord("fee"); ?> 14:00~14:59</label>
+												<input type="text" name="Fee14" id="Fee14" class="form-control" value="<?php echo round($obj['Fee'][14],2);?>">
+											</div>
+											<div class="form-group">
+												<label><?php echo $lang->showWord("fee"); ?> 15:00~15:59</label>
+												<input type="text" name="Fee15" id="Fee15" class="form-control" value="<?php echo round($obj['Fee'][15],2);?>">
+											</div>
+											<div class="form-group">
+												<label><?php echo $lang->showWord("fee"); ?> 16:00~16:59</label>
+												<input type="text" name="Fee16" id="Fee16" class="form-control" value="<?php echo round($obj['Fee'][16],2);?>">
+											</div>
+											<div class="form-group">
+												<label><?php echo $lang->showWord("fee"); ?> 17:00~17:59</label>
+												<input type="text" name="Fee17" id="Fee17" class="form-control" value="<?php echo round($obj['Fee'][17],2);?>">
+											</div>
+											<div class="form-group">
+												<label><?php echo $lang->showWord("fee"); ?> 18:00~18:59</label>
+												<input type="text" name="Fee18" id="Fee18" class="form-control" value="<?php echo round($obj['Fee'][18],2);?>">
+											</div>
+											<div class="form-group">
+												<label><?php echo $lang->showWord("fee"); ?> 19:00~19:59</label>
+												<input type="text" name="Fee19" id="Fee19" class="form-control" value="<?php echo round($obj['Fee'][19],2);?>">
+											</div>
+											<div class="form-group">
+												<label><?php echo $lang->showWord("fee"); ?> 20:00~20:59</label>
+												<input type="text" name="Fee20" id="Fee20" class="form-control" value="<?php echo round($obj['Fee'][20],2);?>">
+											</div>
+											<div class="form-group">
+												<label><?php echo $lang->showWord("fee"); ?> 21:00~21:59</label>
+												<input type="text" name="Fee21" id="Fee21" class="form-control" value="<?php echo round($obj['Fee'][21],2);?>">
+											</div>
+											<div class="form-group">
+												<label><?php echo $lang->showWord("fee"); ?> 22:00~22:59</label>
+												<input type="text" name="Fee22" id="Fee22" class="form-control" value="<?php echo round($obj['Fee'][22],2);?>">
+											</div>
+											<div class="form-group">
+												<label><?php echo $lang->showWord("fee"); ?> 23:00~23:59</label>
+												<input type="text" name="Fee23" id="Fee23" class="form-control" value="<?php echo round($obj['Fee'][23],2);?>">
+											</div>
+										</div>
+<?php /*										<div class="form-group" style="display:<?php echo $am111;?>">
+											<label>CcsAuthentication</label>
+											<select class="form-control" id="CcsAuthentication" name="CcsAuthentication">
+												<option value="0" <?php echo $obj['CcsAuthentication']==0?"selected":""?>>EIM</option>
+												<option value="1" <?php echo $obj['CcsAuthentication']==1?"selected":""?>>EIM&PnC mixed</option>
+											</select>
+										</div>
+										<div class="form-group" style="display:<?php echo $am111;?>">
+											<label>AcCcsChargingModel</label>
+											<select class="form-control" id="AcCcsChargingModel" name="AcCcsChargingModel">
+												<option value="0" <?php echo $obj['AcCcsChargingModel']==0?"selected":""?>>BC (PWM) only</option>
+												<option value="1" <?php echo $obj['AcCcsChargingModel']==0?"selected":""?>>BC&PLC mixed</option>
+											</select>
+										</div>*/?>
+									</section>
+								</article>
+<?php if(substr($ModelName,0,2)=="DO" || substr($ModelName,0,2)=="DK" || substr($ModelName,0,2)=="DB"){?>
+<?php if($obj['DDChargingInfo1']){ $idx++;?>
+								<!--Charging Information-->
+								<article class="envor-sorting-item css">
+									<header><?php echo "connector".$idx." ".$lang->showWord("charging_information"); ?><i class="fa fa-plus"></i></header>
+									<section>
+										<div class="form-group" style="display:<?php echo $am111;?>">
+											<label><?php echo $lang->showWord("user_id"); ?></label>
+											<input type="text" readonly class="form-control" value="<?php echo $obj['DDChargingInfo1']['StartUserId'];?>">
+										</div>
+										<div class="form-group" style="display:<?php echo $am111;?>">
+											<label><?php echo $lang->showWord("start_date_time"); ?></label>
+											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['DDChargingInfo1']['StartDateTime'];?>">
+										</div>
+										<div class="form-group" style="display:<?php echo $am111;?>">
+											<label><?php echo $lang->showWord("stop_date_time"); ?></label>
+											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['DDChargingInfo1']['StopDateTime'];?>">
+										</div>
+<?php /*										<div class="form-group" style="display:<?php echo $am111;?>">
+											<label>StartMethod</label>
+											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['DDChargingInfo1']['StartMethod'];?>">
+										</div>*/?>
+										<div class="form-group" style="display:<?php echo $am111;?>">
+											<label><?php echo $lang->showWord("system_status"); ?></label>
+											<input type="text" readonly class="form-control" placeholder="<?php echo $DDSystemStatus1;?>">
+										</div>
+										<div class="form-group" style="display:<?php echo $am111;?>">
+											<label><?php echo $lang->showWord("connector_temperature"); ?></label>
+											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['DDChargingInfo1']['ConnectorTemp']!=255?$obj['DDChargingInfo1']['ConnectorTemp']." ℃":"not supported";?>">
+										</div>
+										<div class="form-group ChillerTemp">
+											<label>Chiller Temperature</label>
+											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['DDChargingInfo1']['ChillerTemp']!=255?$obj['DDChargingInfo1']['ChillerTemp']." ℃":"not supported";?>">
+										</div>
+										<div class="form-group" style="display:<?php echo $am001;?>">
+											<label><?php echo $lang->showWord("present_charging_voltage"); ?></label>
+											<input type="text" readonly class="form-control" placeholder="<?php echo round($obj['DDChargingInfo1']['PresentChargingVoltage'],2);?> volt">
+										</div>
+										<div class="form-group" style="display:<?php echo $am111;?>">
+											<label><?php echo $lang->showWord("present_charging_current"); ?></label>
+											<input type="text" readonly class="form-control" placeholder="<?php echo round($obj['DDChargingInfo1']['PresentChargingCurrent'],2);?> amp">
+										</div>
+										<div class="form-group" style="display:<?php echo $am111;?>">
+											<label><?php echo $lang->showWord("present_charging_power"); ?></label>
+											<input type="text" readonly class="form-control" placeholder="<?php echo round($obj['DDChargingInfo1']['PresentChargingPower'],2);?> kW">
+										</div>
+										<div class="form-group" style="display:<?php echo $am111;?>">
+											<label><?php echo $lang->showWord("present_charging_energy"); ?></label>
+											<input type="text" readonly class="form-control" placeholder="<?php echo number_format(round($obj['DDChargingInfo1']['PresentChargedEnergy'],4), 4, ".", " ");?> kWh">
+										</div>
+										<div class="form-group" style="display:<?php echo $am111;?>">
+											<label><?php echo $lang->showWord("present_charging_duration"); ?></label>
+											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['DDChargingInfo1']['PresentChargedDuration'];?> seconds">
+										</div>
+										<div class="form-group" style="display:<?php echo $am001;?>">
+											<label>Remain Charging Time</label>
+											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['DDChargingInfo1']['RemainChargingDuration'];?> seconds">
+										</div>
+										<div class="form-group" style="display:<?php echo $am001;?>">
+											<label>EV Battery Max Voltage</label>
+											<input type="text" readonly class="form-control" placeholder="<?php echo round($obj['DDChargingInfo1']['EvBatteryMaxVoltage'],2);?> volt">
+										</div>
+										<div class="form-group" style="display:<?php echo $am001;?>">
+											<label>EV Battery Target Voltage</label>
+											<input type="text" readonly class="form-control" placeholder="<?php echo round($obj['DDChargingInfo1']['EvBatterytargetVoltage'],2);?> volt">
+										</div>
+										<div class="form-group" style="display:<?php echo $am001;?>">
+											<label>EV Battery Soc</label>
+											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['DDChargingInfo1']['EvBatterySoc'];?>">
+										</div>
+										<div class="form-group" style="display:<?php echo $am111;?>">
+											<label><?php echo $lang->showWord("totalize_power_consumption"); ?></label>
+											<input type="text" readonly class="form-control" placeholder="<?php echo number_format(round($obj['DDChargingInfo1']['PowerConsumption'],4), 4, ".", " ");?> kWh">
+										</div>
+									</section>
+								</article>
+<?php }?>
+<?php if($obj['DDChargingInfo2']){ $idx++;?>
+								<!--Charging Information-->
+								<article class="envor-sorting-item css">
+									<header><?php echo "connector".$idx." ".$lang->showWord("charging_information"); ?><i class="fa fa-plus"></i></header>
+									<section>
+										<div class="form-group" style="display:<?php echo $am111;?>">
+											<label><?php echo $lang->showWord("user_id"); ?></label>
+											<input type="text" readonly class="form-control" value="<?php echo $obj['DDChargingInfo2']['StartUserId'];?>">
+										</div>
+										<div class="form-group" style="display:<?php echo $am111;?>">
+											<label><?php echo $lang->showWord("start_date_time"); ?></label>
+											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['DDChargingInfo2']['StartDateTime'];?>">
+										</div>
+										<div class="form-group" style="display:<?php echo $am111;?>">
+											<label><?php echo $lang->showWord("stop_date_time"); ?></label>
+											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['DDChargingInfo2']['StopDateTime'];?>">
+										</div>
+<?php /*										<div class="form-group" style="display:<?php echo $am111;?>">
+											<label>StartMethod</label>
+											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['DDChargingInfo2']['StartMethod'];?>">
+										</div>*/?>
+										<div class="form-group" style="display:<?php echo $am111;?>">
+											<label><?php echo $lang->showWord("system_status"); ?></label>
+											<input type="text" readonly class="form-control" placeholder="<?php echo $DDSystemStatus2;?>">
+										</div>
+										<div class="form-group" style="display:<?php echo $am111;?>">
+											<label><?php echo $lang->showWord("connector_temperature"); ?></label>
+											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['DDChargingInfo2']['ConnectorTemp']!=255?$obj['DDChargingInfo2']['ConnectorTemp']." ℃":"not supported";?>">
+										</div>
+										<div class="form-group ChillerTemp">
+											<label>Chiller Temperature</label>
+											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['DDChargingInfo2']['ChillerTemp']!=255?$obj['DDChargingInfo2']['ChillerTemp']." ℃":"not supported";?>">
+										</div>
+										<div class="form-group" style="display:<?php echo $am001;?>">
+											<label><?php echo $lang->showWord("present_charging_voltage"); ?></label>
+											<input type="text" readonly class="form-control" placeholder="<?php echo round($obj['DDChargingInfo2']['PresentChargingVoltage'],2);?> volt">
+										</div>
+										<div class="form-group" style="display:<?php echo $am111;?>">
+											<label><?php echo $lang->showWord("present_charging_current"); ?></label>
+											<input type="text" readonly class="form-control" placeholder="<?php echo round($obj['DDChargingInfo2']['PresentChargingCurrent'],2);?> amp">
+										</div>
+										<div class="form-group" style="display:<?php echo $am111;?>">
+											<label><?php echo $lang->showWord("present_charging_power"); ?></label>
+											<input type="text" readonly class="form-control" placeholder="<?php echo round($obj['DDChargingInfo2']['PresentChargingPower'],2);?> kW">
+										</div>
+										<div class="form-group" style="display:<?php echo $am111;?>">
+											<label><?php echo $lang->showWord("present_charging_energy"); ?></label>
+											<input type="text" readonly class="form-control" placeholder="<?php echo number_format(round($obj['DDChargingInfo2']['PresentChargedEnergy'],4), 4, ".", " ");?> kWh">
+										</div>
+										<div class="form-group" style="display:<?php echo $am111;?>">
+											<label><?php echo $lang->showWord("present_charging_duration"); ?></label>
+											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['DDChargingInfo2']['PresentChargedDuration'];?> seconds">
+										</div>
+										<div class="form-group" style="display:<?php echo $am001;?>">
+											<label>Remain Charging Time</label>
+											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['DDChargingInfo2']['RemainChargingDuration'];?> seconds">
+										</div>
+										<div class="form-group" style="display:<?php echo $am001;?>">
+											<label>EV Battery Max Voltage</label>
+											<input type="text" readonly class="form-control" placeholder="<?php echo round($obj['DDChargingInfo2']['EvBatteryMaxVoltage'],2);?> volt">
+										</div>
+										<div class="form-group" style="display:<?php echo $am001;?>">
+											<label>EV Battery Target Voltage</label>
+											<input type="text" readonly class="form-control" placeholder="<?php echo round($obj['DDChargingInfo2']['EvBatterytargetVoltage'],2);?> volt">
+										</div>
+										<div class="form-group" style="display:<?php echo $am001;?>">
+											<label>EV Battery Soc</label>
+											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['DDChargingInfo2']['EvBatterySoc'];?>">
+										</div>
+										<div class="form-group" style="display:<?php echo $am111;?>">
+											<label><?php echo $lang->showWord("totalize_power_consumption"); ?></label>
+											<input type="text" readonly class="form-control" placeholder="<?php echo number_format(round($obj['DDChargingInfo2']['PowerConsumption'],4), 4, ".", " ");?> kWh">
+										</div>
+									</section>
+								</article>
+<?php }?>
+<?php if($obj['DDChargingInfo3']){ $idx++;?>
+								<!--Charging Information-->
+								<article class="envor-sorting-item css">
+									<header><?php echo "connector".$idx." ".$lang->showWord("charging_information"); ?><i class="fa fa-plus"></i></header>
+									<section>
+										<div class="form-group" style="display:<?php echo $am111;?>">
+											<label><?php echo $lang->showWord("user_id"); ?></label>
+											<input type="text" readonly class="form-control" value="<?php echo $obj['DDChargingInfo3']['StartUserId'];?>">
+										</div>
+										<div class="form-group" style="display:<?php echo $am111;?>">
+											<label><?php echo $lang->showWord("start_date_time"); ?></label>
+											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['DDChargingInfo3']['StartDateTime'];?>">
+										</div>
+										<div class="form-group" style="display:<?php echo $am111;?>">
+											<label><?php echo $lang->showWord("stop_date_time"); ?></label>
+											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['DDChargingInfo3']['StopDateTime'];?>">
+										</div>
+<?php /*										<div class="form-group" style="display:<?php echo $am111;?>">
+											<label>StartMethod</label>
+											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['DDChargingInfo3']['StartMethod'];?>">
+										</div>*/?>
+										<div class="form-group" style="display:<?php echo $am111;?>">
+											<label><?php echo $lang->showWord("system_status"); ?></label>
+											<input type="text" readonly class="form-control" placeholder="<?php echo $DDSystemStatus3;?>">
+										</div>
+										<div class="form-group" style="display:<?php echo $am111;?>">
+											<label><?php echo $lang->showWord("connector_temperature"); ?></label>
+											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['DDChargingInfo3']['ConnectorTemp']!=255?$obj['DDChargingInfo3']['ConnectorTemp']." ℃":"not supported";?>">
+										</div>
+										<div class="form-group ChillerTemp">
+											<label>Chiller Temperature</label>
+											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['DDChargingInfo3']['ChillerTemp']!=255?$obj['DDChargingInfo3']['ChillerTemp']." ℃":"not supported";?>">
+										</div>
+										<div class="form-group" style="display:<?php echo $am001;?>">
+											<label><?php echo $lang->showWord("present_charging_voltage"); ?></label>
+											<input type="text" readonly class="form-control" placeholder="<?php echo round($obj['DDChargingInfo3']['PresentChargingVoltage'],2);?> volt">
+										</div>
+										<div class="form-group" style="display:<?php echo $am111;?>">
+											<label><?php echo $lang->showWord("present_charging_current"); ?></label>
+											<input type="text" readonly class="form-control" placeholder="<?php echo round($obj['DDChargingInfo3']['PresentChargingCurrent'],2);?> amp">
+										</div>
+										<div class="form-group" style="display:<?php echo $am111;?>">
+											<label><?php echo $lang->showWord("present_charging_power"); ?></label>
+											<input type="text" readonly class="form-control" placeholder="<?php echo round($obj['DDChargingInfo3']['PresentChargingPower'],2);?> kW">
+										</div>
+										<div class="form-group" style="display:<?php echo $am111;?>">
+											<label><?php echo $lang->showWord("present_charging_energy"); ?></label>
+											<input type="text" readonly class="form-control" placeholder="<?php echo number_format(round($obj['DDChargingInfo3']['PresentChargedEnergy'],4), 4, ".", " ");?> kWh">
+										</div>
+										<div class="form-group" style="display:<?php echo $am111;?>">
+											<label><?php echo $lang->showWord("present_charging_duration"); ?></label>
+											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['DDChargingInfo3']['PresentChargedDuration'];?> seconds">
+										</div>
+										<div class="form-group" style="display:<?php echo $am001;?>">
+											<label>Remain Charging Time</label>
+											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['DDChargingInfo3']['RemainChargingDuration'];?> seconds">
+										</div>
+										<div class="form-group" style="display:<?php echo $am001;?>">
+											<label>EV Battery Max Voltage</label>
+											<input type="text" readonly class="form-control" placeholder="<?php echo round($obj['DDChargingInfo3']['EvBatteryMaxVoltage'],2);?> volt">
+										</div>
+										<div class="form-group" style="display:<?php echo $am001;?>">
+											<label>EV Battery Target Voltage</label>
+											<input type="text" readonly class="form-control" placeholder="<?php echo round($obj['DDChargingInfo3']['EvBatterytargetVoltage'],2);?> volt">
+										</div>
+										<div class="form-group" style="display:<?php echo $am001;?>">
+											<label>EV Battery Soc</label>
+											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['DDChargingInfo3']['EvBatterySoc'];?>">
+										</div>
+										<div class="form-group" style="display:<?php echo $am111;?>">
+											<label><?php echo $lang->showWord("totalize_power_consumption"); ?></label>
+											<input type="text" readonly class="form-control" placeholder="<?php echo number_format(round($obj['DDChargingInfo3']['PowerConsumption'],4), 4, ".", " ");?> kWh">
+										</div>
+									</section>
+								</article>
+<?php }?>
+<?php if($obj['DDChargingInfo4']){ $idx++;?>
+								<!--Charging Information-->
+								<article class="envor-sorting-item css">
+									<header><?php echo "connector".$idx." ".$lang->showWord("charging_information"); ?><i class="fa fa-plus"></i></header>
+									<section>
+										<div class="form-group" style="display:<?php echo $am111;?>">
+											<label><?php echo $lang->showWord("user_id"); ?></label>
+											<input type="text" readonly class="form-control" value="<?php echo $obj['DDChargingInfo4']['StartUserId'];?>">
+										</div>
+										<div class="form-group" style="display:<?php echo $am111;?>">
+											<label><?php echo $lang->showWord("start_date_time"); ?></label>
+											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['DDChargingInfo4']['StartDateTime'];?>">
+										</div>
+										<div class="form-group" style="display:<?php echo $am111;?>">
+											<label><?php echo $lang->showWord("stop_date_time"); ?></label>
+											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['DDChargingInfo4']['StopDateTime'];?>">
+										</div>
+<?php /*										<div class="form-group" style="display:<?php echo $am111;?>">
+											<label>StartMethod</label>
+											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['DDChargingInfo4']['StartMethod'];?>">
+										</div>*/?>
+										<div class="form-group" style="display:<?php echo $am111;?>">
+											<label><?php echo $lang->showWord("system_status"); ?></label>
+											<input type="text" readonly class="form-control" placeholder="<?php echo $DDSystemStatus4;?>">
+										</div>
+										<div class="form-group" style="display:<?php echo $am111;?>">
+											<label><?php echo $lang->showWord("connector_temperature"); ?></label>
+											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['DDChargingInfo4']['ConnectorTemp']!=255?$obj['DDChargingInfo4']['ConnectorTemp']." ℃":"not supported";?>">
+										</div>
+										<div class="form-group ChillerTemp">
+											<label>Chiller Temperature</label>
+											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['DDChargingInfo4']['ChillerTemp']!=255?$obj['DDChargingInfo4']['ChillerTemp']." ℃":"not supported";?>">
+										</div>
+										<div class="form-group" style="display:<?php echo $am001;?>">
+											<label><?php echo $lang->showWord("present_charging_voltage"); ?></label>
+											<input type="text" readonly class="form-control" placeholder="<?php echo round($obj['DDChargingInfo4']['PresentChargingVoltage'],2);?> volt">
+										</div>
+										<div class="form-group" style="display:<?php echo $am111;?>">
+											<label><?php echo $lang->showWord("present_charging_current"); ?></label>
+											<input type="text" readonly class="form-control" placeholder="<?php echo round($obj['DDChargingInfo4']['PresentChargingCurrent'],2);?> amp">
+										</div>
+										<div class="form-group" style="display:<?php echo $am111;?>">
+											<label><?php echo $lang->showWord("present_charging_power"); ?></label>
+											<input type="text" readonly class="form-control" placeholder="<?php echo round($obj['DDChargingInfo4']['PresentChargingPower'],2);?> kW">
+										</div>
+										<div class="form-group" style="display:<?php echo $am111;?>">
+											<label><?php echo $lang->showWord("present_charging_energy"); ?></label>
+											<input type="text" readonly class="form-control" placeholder="<?php echo number_format(round($obj['DDChargingInfo4']['PresentChargedEnergy'],4), 4, ".", " ");?> kWh">
+										</div>
+										<div class="form-group" style="display:<?php echo $am111;?>">
+											<label><?php echo $lang->showWord("present_charging_duration"); ?></label>
+											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['DDChargingInfo4']['PresentChargedDuration'];?> seconds">
+										</div>
+										<div class="form-group" style="display:<?php echo $am001;?>">
+											<label>Remain Charging Time</label>
+											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['DDChargingInfo4']['RemainChargingDuration'];?> seconds">
+										</div>
+										<div class="form-group" style="display:<?php echo $am001;?>">
+											<label>EV Battery Max Voltage</label>
+											<input type="text" readonly class="form-control" placeholder="<?php echo round($obj['DDChargingInfo4']['EvBatteryMaxVoltage'],2);?> volt">
+										</div>
+										<div class="form-group" style="display:<?php echo $am001;?>">
+											<label>EV Battery Target Voltage</label>
+											<input type="text" readonly class="form-control" placeholder="<?php echo round($obj['DDChargingInfo4']['EvBatterytargetVoltage'],2);?> volt">
+										</div>
+										<div class="form-group" style="display:<?php echo $am001;?>">
+											<label>EV Battery Soc</label>
+											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['DDChargingInfo4']['EvBatterySoc'];?>">
+										</div>
+										<div class="form-group" style="display:<?php echo $am111;?>">
+											<label><?php echo $lang->showWord("totalize_power_consumption"); ?></label>
+											<input type="text" readonly class="form-control" placeholder="<?php echo number_format(round($obj['DDChargingInfo4']['PowerConsumption'],4), 4, ".", " ");?> kWh">
+										</div>
+									</section>
+								</article>
+<?php }?>
+<?php } else { ?>
+<?php if($obj['ChargingInfo1']){ $idx++;?>
+								<!--Charging Information-->
+								<article class="envor-sorting-item css">
+									<header><?php echo "connector".$idx." ".$lang->showWord("charging_information")."(".$connectorType1.")"; ?><i class="fa fa-plus"></i></header>
+									<section>
+										<div class="form-group" style="display:<?php echo $am111;?>">
+											<label><?php echo $lang->showWord("user_id"); ?></label>
+											<input type="text" readonly class="form-control" value="<?php echo $obj['ChargingInfo1']['StartUserId'];?>">
+											<input type="hidden" name="UserId1" id="UserId1" value="<?php echo $obj['ChargingInfo1']['StartUserId'];?>">
+										</div>
+										<div class="form-group" style="display:<?php echo $am111;?>">
+											<label><?php echo $lang->showWord("start_date_time"); ?></label>
+											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo1']['StartDateTime'];?>">
+											<input type="hidden" name="StartDateTime1" id="StartDateTime1" value="<?php echo $obj['ChargingInfo1']['StartDateTime'];?>">
+										</div>
+										<div class="form-group" style="display:<?php echo $am111;?>">
+											<label><?php echo $lang->showWord("stop_date_time"); ?></label>
+											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo1']['StopDateTime'];?>">
+											<input type="hidden" name="StopDateTime1" id="StopDateTime1" value="<?php echo $obj['ChargingInfo1']['StopDateTime'];?>">
+										</div>
+<?php /*										<div class="form-group" style="display:<?php echo $am111;?>">
+											<label>StartMethod</label>
+											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo1']['StartMethod'];?>">
+											<input type="hidden" name="StartMethod1" id="StartMethod1" value="<?php echo $obj['ChargingInfo1']['StartMethod'];?>">
+										</div>*/?>
+										<div class="form-group" style="display:<?php echo $am111;?>">
+											<label><?php echo $lang->showWord("system_status"); ?></label>
+											<input type="text" readonly class="form-control" placeholder="<?php echo $SystemStatus1;?>">
+											<input type="hidden" name="SystemStatus1" id="SystemStatus1" value="<?php echo $obj['ChargingInfo1']['SystemStatus'];?>">
+										</div>
+										<div class="form-group" style="display:<?php echo $am111;?>">
+											<label><?php echo $lang->showWord("connector_temperature"); ?></label>
+											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo1']['ConnectorTemp']!=255?$obj['ChargingInfo1']['ConnectorTemp']." ℃":"not supported";?>">
+											<input type="hidden" name="ConnectorTemp1" id="ConnectorTemp1" value="<?php echo $obj['ChargingInfo1']['ConnectorTemp'];?>">
+										</div>
+										<div class="form-group" id="ChillerTemp1">
+											<label>Chiller Temperature</label>
+											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo1']['ChillerTemp']!=255?$obj['ChargingInfo1']['ChillerTemp']." ℃":"not supported";?>">
+										</div>
+										<div class="form-group" style="display:<?php echo $am001;?>">
+											<label><?php echo $lang->showWord("present_charging_voltage"); ?></label>
+											<input type="text" readonly class="form-control" placeholder="<?php echo round($obj['ChargingInfo1']['PresentChargingVoltage'],2);?> volt">
+											<input type="hidden" name="PresentChargingVoltage1" id="PresentChargingVoltage1" value="<?php echo $obj['ChargingInfo1']['PresentChargingVoltage'];?>">
+										</div>
+										<div class="form-group" style="display:<?php echo $am111;?>">
+											<label><?php echo $lang->showWord("present_charging_current"); ?></label>
+											<input type="text" readonly class="form-control" placeholder="<?php echo round($obj['ChargingInfo1']['PresentChargingCurrent'],2);?> amp">
+											<input type="hidden" name="PresentChargingCurrent1" id="PresentChargingCurrent1" value="<?php echo $obj['ChargingInfo1']['PresentChargingCurrent'];?>">
+										</div>
+										<div class="form-group" style="display:<?php echo $am111;?>">
+											<label><?php echo $lang->showWord("present_charging_power"); ?></label>
+											<input type="text" readonly class="form-control" placeholder="<?php echo round($obj['ChargingInfo1']['PresentChargingPower'],2);?> kW">
+											<input type="hidden" name="PresentChargingPower1" id="PresentChargingPower1" value="<?php echo $obj['ChargingInfo1']['PresentChargingPower'];?>">
+										</div>
+										<div class="form-group" style="display:<?php echo $am111;?>">
+											<label><?php echo $lang->showWord("present_charging_energy"); ?></label>
+											<input type="text" readonly class="form-control" placeholder="<?php echo number_format(round($obj['ChargingInfo1']['PresentChargedEnergy'],4), 4, ".", " ");?> kWh">
+											<input type="hidden" name="PresentChargedEnergy1" id="PresentChargedEnergy1" value="<?php echo $obj['ChargingInfo1']['PresentChargedEnergy'];?>">
+										</div>
+										<div class="form-group" style="display:<?php echo $am111;?>">
+											<label><?php echo $lang->showWord("present_charging_duration"); ?></label>
+											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo1']['PresentChargedDuration'];?> seconds">
+											<input type="hidden" name="PresentChargedDuration1" id="PresentChargedDuration1" value="<?php echo $obj['ChargingInfo1']['PresentChargedDuration'];?>">
+										</div>
+										<div class="form-group" style="display:<?php echo $am001;?>">
+											<label>Remain Charging Time</label>
+											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo1']['RemainChargingDuration'];?> seconds">
+											<input type="hidden" name="RemainChargingDuration1" id="RemainChargingDuration1" value="<?php echo $obj['ChargingInfo1']['RemainChargingDuration'];?>">
+										</div>
+										<div class="form-group" style="display:<?php echo $am001;?>">
+											<label>EV Battery Max Voltage</label>
+											<input type="text" readonly class="form-control" placeholder="<?php echo round($obj['ChargingInfo1']['EvBatteryMaxVoltage'],2);?> volt">
+											<input type="hidden" name="EvBatteryMaxVoltage1" id="EvBatteryMaxVoltage1" value="<?php echo $obj['ChargingInfo1']['EvBatteryMaxVoltage'];?>">
+										</div>
+										<div class="form-group" style="display:<?php echo $am001;?>">
+											<label>EV Battery Target Voltage</label>
+											<input type="text" readonly class="form-control" placeholder="<?php echo round($obj['ChargingInfo1']['EvBatterytargetVoltage'],2);?> volt">
+											<input type="hidden" name="EvBatterytargetVoltage1" id="EvBatterytargetVoltage1" value="<?php echo $obj['ChargingInfo1']['EvBatterytargetVoltage'];?>">
+										</div>
+										<div class="form-group" style="display:<?php echo $am001;?>">
+											<label>EV Battery Soc</label>
+											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo1']['EvBatterySoc'];?>">
+											<input type="hidden" name="EvBatterySoc1" id="EvBatterySoc1" value="<?php echo $obj['ChargingInfo1']['EvBatterySoc'];?>">
+										</div>
+										<div class="form-group" style="display:<?php echo $am111;?>">
+											<label><?php echo $lang->showWord("totalize_power_consumption"); ?></label>
+											<input type="text" readonly class="form-control" placeholder="<?php echo number_format(round($obj['ChargingInfo1']['PowerConsumption'],4), 4, ".", " ");?> kWh">
+										</div>
+<?php if(substr($ModelName,0,2)=="AX"){?>
+										<div class="form-group" style="display:block">
+											<label><?php echo $lang->showWord("meter_ic_calibration_status"); ?></label>
+											<span style="display:block">
+												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
+													<label>VaGain</label>
+												</span>
+												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
+													<label class="toggle-switchy" for="VaGain" data-size="" data-style="rounded">
+														<input disabled type="checkbox" id="VaGain" <?php echo $obj['ChargingInfo1']['isCalibratedVaGain']==1?"checked":"";?>>
+														<span class="toggle">
+														  <span class="switch"></span>
+														</span>
+													</label>
+												</span>
+												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
+													<label>VbGain</label>
+												</span>
+												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
+													<label class="toggle-switchy" for="VbGain" data-size="" data-style="rounded">
+														<input  disabled type="checkbox" id="VbGain" <?php echo $obj['ChargingInfo1']['isCalibratedVbGain']==1?"checked":"";?>>
+														<span class="toggle">
+														  <span class="switch"></span>
+														</span>
+													</label>
+												</span>
+												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
+													<label>VcGain</label>
+												</span>
+												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
+													<label class="toggle-switchy" for="VcGain" data-size="" data-style="rounded">
+														<input disabled type="checkbox" id="VcGain" <?php echo $obj['ChargingInfo1']['isCalibratedVcGain']==1?"checked":"";?>>
+														<span class="toggle">
+														  <span class="switch"></span>
+														</span>
+													</label>
+												</span>
+											</span>
+											<span class="" style="display:block">
+												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
+													<label>VaOffset</label>
+												</span>
+												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
+													<label class="toggle-switchy" for="VaOffset" data-size="" data-style="rounded">
+														<input disabled type="checkbox" id="VaOffset" <?php echo $obj['ChargingInfo1']['isCalibratedVaOffset']==1?"checked":"";?>>
+														<span class="toggle">
+														  <span class="switch"></span>
+														</span>
+													</label>
+												</span>
+												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
+													<label>VbOffset</label>
+												</span>
+												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
+													<label class="toggle-switchy" for="VbOffset" data-size="" data-style="rounded">
+														<input disabled type="checkbox" id="VbOffset" <?php echo $obj['ChargingInfo1']['isCalibratedVbOffset']==1?"checked":"";?>>
+														<span class="toggle">
+														  <span class="switch"></span>
+														</span>
+													</label>
+												</span>
+												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
+													<label>VcOffset</label>
+												</span>
+												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
+													<label class="toggle-switchy" for="VcOffset" data-size="" data-style="rounded">
+														<input disabled type="checkbox" id="VcOffset" <?php echo $obj['ChargingInfo1']['isCalibratedVcOffset']==1?"checked":"";?>>
+														<span class="toggle">
+														  <span class="switch"></span>
+														</span>
+													</label>
+												</span>
+											</span>
+											<span class="" style="display:block">
+												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
+													<label>CaGain</label>
+												</span>
+												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
+													<label class="toggle-switchy" for="CaGain" data-size="" data-style="rounded">
+														<input disabled type="checkbox" id="CaGain" <?php echo $obj['ChargingInfo1']['isCalibratedCaGain']==1?"checked":"";?>>
+														<span class="toggle">
+														  <span class="switch"></span>
+														</span>
+													</label>
+												</span>
+												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
+													<label>CbGain</label>
+												</span>
+												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
+													<label class="toggle-switchy" for="CbGain" data-size="" data-style="rounded">
+														<input disabled type="checkbox" id="CbGain" <?php echo $obj['ChargingInfo1']['isCalibratedCbGain']==1?"checked":"";?>>
+														<span class="toggle">
+														  <span class="switch"></span>
+														</span>
+													</label>
+												</span>
+												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
+													<label>CcGain</label>
+												</span>
+												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
+													<label class="toggle-switchy" for="CcGain" data-size="" data-style="rounded">
+														<input disabled type="checkbox" id="CcGain" <?php echo $obj['ChargingInfo1']['isCalibratedCcGain']==1?"checked":"";?>>
+														<span class="toggle">
+														  <span class="switch"></span>
+														</span>
+													</label>
+												</span>
+											</span>
+											<span class="" style="display:block">
+												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
+													<label>CaOffset</label>
+												</span>
+												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
+													<label class="toggle-switchy" for="CaOffset" data-size="" data-style="rounded">
+														<input disabled type="checkbox" id="CaOffset" <?php echo $obj['ChargingInfo1']['isCalibratedCaOffset']==1?"checked":"";?>>
+														<span class="toggle">
+														  <span class="switch"></span>
+														</span>
+													</label>
+												</span>
+												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
+													<label>CbOffset</label>
+												</span>
+												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
+													<label class="toggle-switchy" for="CbOffset" data-size="" data-style="rounded">
+														<input disabled type="checkbox" id="CbOffset" <?php echo $obj['ChargingInfo1']['isCalibratedCbOffset']==1?"checked":"";?>>
+														<span class="toggle">
+														  <span class="switch"></span>
+														</span>
+													</label>
+												</span>
+												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
+													<label>CcOffset</label>
+												</span>
+												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
+													<label class="toggle-switchy" for="CcOffset" data-size="" data-style="rounded">
+														<input disabled type="checkbox" id="CcOffset" <?php echo $obj['ChargingInfo1']['isCalibratedCcOffset']==1?"checked":"";?>>
+														<span class="toggle">
+														  <span class="switch"></span>
+														</span>
+													</label>
+												</span>
+											</span>
+											<span class="" style="display:block">
+												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
+													<label>Pa</label>
+												</span>
+												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
+													<label class="toggle-switchy" for="Pa" data-size="" data-style="rounded">
+														<input disabled type="checkbox" id="Pa" <?php echo $obj['ChargingInfo1']['isCalibratedPa']==1?"checked":"";?>>
+														<span class="toggle">
+														  <span class="switch"></span>
+														</span>
+													</label>
+												</span>
+												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
+													<label>Pb</label>
+												</span>
+												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
+													<label class="toggle-switchy" for="Pb" data-size="" data-style="rounded">
+														<input disabled type="checkbox" id="Pb" <?php echo $obj['ChargingInfo1']['isCalibratedPb']==1?"checked":"";?>>
+														<span class="toggle">
+														  <span class="switch"></span>
+														</span>
+													</label>
+												</span>
+												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
+													<label>Pc</label>
+												</span>
+												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
+													<label class="toggle-switchy" for="Pc" data-size="" data-style="rounded">
+														<input disabled type="checkbox" id="Pc" <?php echo $obj['ChargingInfo1']['isCalibratedPc']==1?"checked":"";?>>
+														<span class="toggle">
+														  <span class="switch"></span>
+														</span>
+													</label>
+												</span>
+											</span>
+										</div>
+<?php } ?>
+									</section>
+								</article>
+<?php }?>
+<?php if($obj['ChargingInfo2']){ $idx++;?>
+								<!--Charging Information-->
+								<article class="envor-sorting-item css">
+									<header><?php echo "connector".$idx." ".$lang->showWord("charging_information")."(".$connectorType2.")"; ?><i class="fa fa-plus"></i></header>
+									<section>
+										<div class="form-group" style="display:<?php echo $am111;?>">
+											<label><?php echo $lang->showWord("user_id"); ?></label>
+											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo2']['StartUserId'];?>">
+											<input type="hidden" name="UserId2" id="UserId2" value="<?php echo $obj['ChargingInfo2']['StartUserId'];?>">
+										</div>
+										<div class="form-group" style="display:<?php echo $am111;?>">
+											<label><?php echo $lang->showWord("start_date_time"); ?></label>
+											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo2']['StartDateTime'];?>">
+											<input type="hidden" name="StartDateTime2" id="StartDateTime2" value="<?php echo $obj['ChargingInfo2']['StartDateTime'];?>">
+										</div>
+										<div class="form-group" style="display:<?php echo $am111;?>">
+											<label><?php echo $lang->showWord("stop_date_time"); ?></label>
+											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo2']['StopDateTime'];?>">
+											<input type="hidden" name="StopDateTime2" id="StopDateTime2" value="<?php echo $obj['ChargingInfo2']['StopDateTime'];?>">
+										</div>
+<?php /*										<div class="form-group" style="display:<?php echo $am111;?>">
+											<label>StartMethod</label>
+											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo2']['StartMethod'];?>">
+											<input type="hidden" name="StartMethod2" id="StartMethod2" value="<?php echo $obj['ChargingInfo2']['StartMethod'];?>">
+										</div>*/?>
+										<div class="form-group" style="display:<?php echo $am111;?>">
+											<label><?php echo $lang->showWord("system_status"); ?></label>
+											<input type="text" readonly class="form-control" placeholder="<?php echo $SystemStatus2;?>">
+											<input type="hidden" name="SystemStatus2" id="SystemStatus2" value="<?php echo $obj['ChargingInfo2']['SystemStatus'];?>">
+										</div>
+										<div class="form-group" style="display:<?php echo $am111;?>">
+											<label><?php echo $lang->showWord("connector_temperature"); ?></label>
+											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo2']['ConnectorTemp']!=255?$obj['ChargingInfo2']['ConnectorTemp']." ℃":"not supported";?>">
+											<input type="hidden" name="ConnectorTemp2" id="ConnectorTemp2" value="<?php echo $obj['ChargingInfo2']['ConnectorTemp'];?>">
+										</div>
+										<div class="form-group" id="ChillerTemp2">
+											<label>Chiller Temperature</label>
+											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo2']['ChillerTemp']!=255?$obj['ChargingInfo2']['ChillerTemp']." ℃":"not supported";?>">
+										</div>
+										<div class="form-group" style="display:<?php echo $am001;?>">
+											<label><?php echo $lang->showWord("present_charging_voltage"); ?></label>
+											<input type="text" readonly class="form-control" placeholder="<?php echo round($obj['ChargingInfo2']['PresentChargingVoltage'],2);?> volt">
+											<input type="hidden" name="PresentChargingVoltage2" id="PresentChargingVoltage2" value="<?php echo $obj['ChargingInfo2']['PresentChargingVoltage'];?>">
+										</div>
+										<div class="form-group" style="display:<?php echo $am111;?>">
+											<label><?php echo $lang->showWord("present_charging_current"); ?></label>
+											<input type="text" readonly class="form-control" placeholder="<?php echo round($obj['ChargingInfo2']['PresentChargingCurrent'],2);?> amp">
+											<input type="hidden" name="PresentChargingCurrent2" id="PresentChargingCurrent2" value="<?php echo $obj['ChargingInfo2']['PresentChargingCurrent'];?>">
+										</div>
+										<div class="form-group" style="display:<?php echo $am111;?>">
+											<label><?php echo $lang->showWord("present_charging_power"); ?></label>
+											<input type="text" readonly class="form-control" placeholder="<?php echo round($obj['ChargingInfo2']['PresentChargingPower'],2);?> kW">
+											<input type="hidden" name="PresentChargingPower2" id="PresentChargingPower2" value="<?php echo $obj['ChargingInfo2']['PresentChargingPower'];?>">
+										</div>
+										<div class="form-group" style="display:<?php echo $am111;?>">
+											<label><?php echo $lang->showWord("present_charging_energy"); ?></label>
+											<input type="text" readonly class="form-control" placeholder="<?php echo number_format(round($obj['ChargingInfo2']['PresentChargedEnergy'],4), 4, ".", " ");?> kWh">
+											<input type="hidden" name="PresentChargedEnergy2" id="PresentChargedEnergy2" value="<?php echo $obj['ChargingInfo2']['PresentChargedEnergy'];?>">
+										</div>
+										<div class="form-group" style="display:<?php echo $am111;?>">
+											<label><?php echo $lang->showWord("present_charging_duration"); ?></label>
+											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo2']['PresentChargedDuration'];?> seconds">
+											<input type="hidden" name="PresentChargedDuration2" id="PresentChargedDuration2" value="<?php echo $obj['ChargingInfo2']['PresentChargedDuration'];?>">
+										</div>
+										<div class="form-group" style="display:<?php echo $am001;?>">
+											<label>Remain Charging Time</label>
+											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo2']['RemainChargingDuration'];?> seconds">
+											<input type="hidden" name="RemainChargingDuration2" id="RemainChargingDuration2" value="<?php echo $obj['ChargingInfo2']['RemainChargingDuration'];?>">
+										</div>
+										<div class="form-group" style="display:<?php echo $am001;?>">
+											<label>EV Battery Max Voltage</label>
+											<input type="text" readonly class="form-control" placeholder="<?php echo round($obj['ChargingInfo2']['EvBatteryMaxVoltage'],2);?> volt">
+											<input type="hidden" name="EvBatteryMaxVoltage2" id="EvBatteryMaxVoltage2" value="<?php echo $obj['ChargingInfo2']['EvBatteryMaxVoltage'];?>">
+										</div>
+										<div class="form-group" style="display:<?php echo $am001;?>">
+											<label>EV Battery Target Voltage</label>
+											<input type="text" readonly class="form-control" placeholder="<?php echo round($obj['ChargingInfo2']['EvBatterytargetVoltage'],2);?> volt">
+											<input type="hidden" name="EvBatterytargetVoltage2" id="EvBatterytargetVoltage2" value="<?php echo $obj['ChargingInfo2']['EvBatterytargetVoltage'];?>">
+										</div>
+										<div class="form-group" style="display:<?php echo $am001;?>">
+											<label>EV Battery Soc</label>
+											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo2']['EvBatterySoc'];?>">
+											<input type="hidden" name="EvBatterySoc2" id="EvBatterySoc2" value="<?php echo $obj['ChargingInfo2']['EvBatterySoc'];?>">
+										</div>
+										<div class="form-group" style="display:<?php echo $am111;?>">
+											<label><?php echo $lang->showWord("totalize_power_consumption"); ?></label>
+											<input type="text" readonly class="form-control" placeholder="<?php echo number_format(round($obj['ChargingInfo2']['PowerConsumption'],4), 4, ".", " ");?> kWh">
+										</div>
+<?php if(substr($ModelName,0,2)=="AX"){?>
+										<div class="form-group" style="display:block">
+											<label><?php echo $lang->showWord("meter_ic_calibration_status"); ?></label>
+											<span style="display:block">
+												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
+													<label>VaGain</label>
+												</span>
+												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
+													<label class="toggle-switchy" for="VaGain" data-size="" data-style="rounded">
+														<input disabled type="checkbox" id="VaGain" <?php echo $obj['ChargingInfo2']['isCalibratedVaGain']==1?"checked":"";?>>
+														<span class="toggle">
+														  <span class="switch"></span>
+														</span>
+													</label>
+												</span>
+												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
+													<label>VbGain</label>
+												</span>
+												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
+													<label class="toggle-switchy" for="VbGain" data-size="" data-style="rounded">
+														<input  disabled type="checkbox" id="VbGain" <?php echo $obj['ChargingInfo2']['isCalibratedVbGain']==1?"checked":"";?>>
+														<span class="toggle">
+														  <span class="switch"></span>
+														</span>
+													</label>
+												</span>
+												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
+													<label>VcGain</label>
+												</span>
+												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
+													<label class="toggle-switchy" for="VcGain" data-size="" data-style="rounded">
+														<input disabled type="checkbox" id="VcGain" <?php echo $obj['ChargingInfo2']['isCalibratedVcGain']==1?"checked":"";?>>
+														<span class="toggle">
+														  <span class="switch"></span>
+														</span>
+													</label>
+												</span>
+											</span>
+											<span class="" style="display:block">
+												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
+													<label>VaOffset</label>
+												</span>
+												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
+													<label class="toggle-switchy" for="VaOffset" data-size="" data-style="rounded">
+														<input disabled type="checkbox" id="VaOffset" <?php echo $obj['ChargingInfo2']['isCalibratedVaOffset']==1?"checked":"";?>>
+														<span class="toggle">
+														  <span class="switch"></span>
+														</span>
+													</label>
+												</span>
+												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
+													<label>VbOffset</label>
+												</span>
+												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
+													<label class="toggle-switchy" for="VbOffset" data-size="" data-style="rounded">
+														<input disabled type="checkbox" id="VbOffset" <?php echo $obj['ChargingInfo2']['isCalibratedVbOffset']==1?"checked":"";?>>
+														<span class="toggle">
+														  <span class="switch"></span>
+														</span>
+													</label>
+												</span>
+												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
+													<label>VcOffset</label>
+												</span>
+												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
+													<label class="toggle-switchy" for="VcOffset" data-size="" data-style="rounded">
+														<input disabled type="checkbox" id="VcOffset" <?php echo $obj['ChargingInfo2']['isCalibratedVcOffset']==1?"checked":"";?>>
+														<span class="toggle">
+														  <span class="switch"></span>
+														</span>
+													</label>
+												</span>
+											</span>
+											<span class="" style="display:block">
+												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
+													<label>CaGain</label>
+												</span>
+												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
+													<label class="toggle-switchy" for="CaGain" data-size="" data-style="rounded">
+														<input disabled type="checkbox" id="CaGain" <?php echo $obj['ChargingInfo2']['isCalibratedCaGain']==1?"checked":"";?>>
+														<span class="toggle">
+														  <span class="switch"></span>
+														</span>
+													</label>
+												</span>
+												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
+													<label>CbGain</label>
+												</span>
+												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
+													<label class="toggle-switchy" for="CbGain" data-size="" data-style="rounded">
+														<input disabled type="checkbox" id="CbGain" <?php echo $obj['ChargingInfo2']['isCalibratedCbGain']==1?"checked":"";?>>
+														<span class="toggle">
+														  <span class="switch"></span>
+														</span>
+													</label>
+												</span>
+												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
+													<label>CcGain</label>
+												</span>
+												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
+													<label class="toggle-switchy" for="CcGain" data-size="" data-style="rounded">
+														<input disabled type="checkbox" id="CcGain" <?php echo $obj['ChargingInfo2']['isCalibratedCcGain']==1?"checked":"";?>>
+														<span class="toggle">
+														  <span class="switch"></span>
+														</span>
+													</label>
+												</span>
+											</span>
+											<span class="" style="display:block">
+												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
+													<label>CaOffset</label>
+												</span>
+												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
+													<label class="toggle-switchy" for="CaOffset" data-size="" data-style="rounded">
+														<input disabled type="checkbox" id="CaOffset" <?php echo $obj['ChargingInfo2']['isCalibratedCaOffset']==1?"checked":"";?>>
+														<span class="toggle">
+														  <span class="switch"></span>
+														</span>
+													</label>
+												</span>
+												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
+													<label>CbOffset</label>
+												</span>
+												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
+													<label class="toggle-switchy" for="CbOffset" data-size="" data-style="rounded">
+														<input disabled type="checkbox" id="CbOffset" <?php echo $obj['ChargingInfo2']['isCalibratedCbOffset']==1?"checked":"";?>>
+														<span class="toggle">
+														  <span class="switch"></span>
+														</span>
+													</label>
+												</span>
+												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
+													<label>CcOffset</label>
+												</span>
+												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
+													<label class="toggle-switchy" for="CcOffset" data-size="" data-style="rounded">
+														<input disabled type="checkbox" id="CcOffset" <?php echo $obj['ChargingInfo2']['isCalibratedCcOffset']==1?"checked":"";?>>
+														<span class="toggle">
+														  <span class="switch"></span>
+														</span>
+													</label>
+												</span>
+											</span>
+											<span class="" style="display:block">
+												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
+													<label>Pa</label>
+												</span>
+												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
+													<label class="toggle-switchy" for="Pa" data-size="" data-style="rounded">
+														<input disabled type="checkbox" id="Pa" <?php echo $obj['ChargingInfo2']['isCalibratedPa']==1?"checked":"";?>>
+														<span class="toggle">
+														  <span class="switch"></span>
+														</span>
+													</label>
+												</span>
+												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
+													<label>Pb</label>
+												</span>
+												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
+													<label class="toggle-switchy" for="Pb" data-size="" data-style="rounded">
+														<input disabled type="checkbox" id="Pb" <?php echo $obj['ChargingInfo2']['isCalibratedPb']==1?"checked":"";?>>
+														<span class="toggle">
+														  <span class="switch"></span>
+														</span>
+													</label>
+												</span>
+												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
+													<label>Pc</label>
+												</span>
+												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
+													<label class="toggle-switchy" for="Pc" data-size="" data-style="rounded">
+														<input disabled type="checkbox" id="Pc" <?php echo $obj['ChargingInfo2']['isCalibratedPc']==1?"checked":"";?>>
+														<span class="toggle">
+														  <span class="switch"></span>
+														</span>
+													</label>
+												</span>
+											</span>
+										</div>
+<?php } ?>
+									</section>
+								</article>
+<?php }?>
+<?php if($obj['ChargingInfo3']){ $idx++;?>
+								<!--Charging Information-->
+								<article class="envor-sorting-item css">
+									<header><?php echo "connector".$idx." ".$lang->showWord("charging_information")."(".$connectorType3.")"; ?><i class="fa fa-plus"></i></header>
+									<section>
+										<div class="form-group" style="display:<?php echo $am111;?>">
+											<label><?php echo $lang->showWord("user_id"); ?></label>
+											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo3']['StartUserId'];?>">
+											<input type="hidden" name="UserId3" id="UserId3" value="<?php echo $obj['ChargingInfo3']['StartUserId'];?>">
+										</div>
+										<div class="form-group" style="display:<?php echo $am111;?>">
+											<label><?php echo $lang->showWord("start_date_time"); ?></label>
+											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo3']['StartDateTime'];?>">
+											<input type="hidden" name="StartDateTime3" id="StartDateTime3" value="<?php echo $obj['ChargingInfo3']['StartDateTime'];?>">
+										</div>
+										<div class="form-group" style="display:<?php echo $am111;?>">
+											<label><?php echo $lang->showWord("stop_date_time"); ?></label>
+											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo3']['StopDateTime'];?>">
+											<input type="hidden" name="StopDateTime3" id="StopDateTime3" value="<?php echo $obj['ChargingInfo3']['StopDateTime'];?>">
+										</div>
+<?php /*										<div class="form-group" style="display:<?php echo $am111;?>">
+											<label>StartMethod</label>
+											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo3']['StartMethod'];?>">
+											<input type="hidden" name="StartMethod3" id="StartMethod3" value="<?php echo $obj['ChargingInfo3']['StartMethod'];?>">
+										</div>*/?>
+										<div class="form-group" style="display:<?php echo $am111;?>">
+											<label><?php echo $lang->showWord("system_status"); ?></label>
+											<input type="text" readonly class="form-control" placeholder="<?php echo $SystemStatus3;?>">
+											<input type="hidden" name="SystemStatus3" id="SystemStatus3" value="<?php echo $obj['ChargingInfo3']['SystemStatus'];?>">
+										</div>
+										<div class="form-group" style="display:<?php echo $am111;?>">
+											<label><?php echo $lang->showWord("connector_temperature"); ?></label>
+											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo3']['ConnectorTemp']!=255?$obj['ChargingInfo3']['ConnectorTemp']." ℃":"not supported";?>">
+											<input type="hidden" name="ConnectorTemp3" id="ConnectorTemp3" value="<?php echo $obj['ChargingInfo3']['ConnectorTemp'];?>">
+										</div>
+										<div class="form-group" id="ChillerTemp3">
+											<label>Chiller Temperature</label>
+											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo3']['ChillerTemp']!=255?$obj['ChargingInfo3']['ChillerTemp']." ℃":"not supported";?>">
+										</div>
+										<div class="form-group" style="display:<?php echo $am001;?>">
+											<label><?php echo $lang->showWord("present_charging_voltage"); ?></label>
+											<input type="text" readonly class="form-control" placeholder="<?php echo round($obj['ChargingInfo3']['PresentChargingVoltage'],2);?> volt">
+											<input type="hidden" name="PresentChargingVoltage3" id="PresentChargingVoltage3" value="<?php echo $obj['ChargingInfo3']['PresentChargingVoltage'];?>">
+										</div>
+										<div class="form-group" style="display:<?php echo $am111;?>">
+											<label><?php echo $lang->showWord("present_charging_current"); ?></label>
+											<input type="text" readonly class="form-control" placeholder="<?php echo round($obj['ChargingInfo3']['PresentChargingCurrent'],2);?> amp">
+											<input type="hidden" name="PresentChargingCurrent3" id="PresentChargingCurrent3" value="<?php echo $obj['ChargingInfo3']['PresentChargingCurrent'];?>">
+										</div>
+										<div class="form-group" style="display:<?php echo $am111;?>">
+											<label><?php echo $lang->showWord("present_charging_power"); ?></label>
+											<input type="text" readonly class="form-control" placeholder="<?php echo round($obj['ChargingInfo3']['PresentChargingPower'],2);?> kW">
+											<input type="hidden" name="PresentChargingPower3" id="PresentChargingPower3" value="<?php echo $obj['ChargingInfo3']['PresentChargingPower'];?>">
+										</div>
+										<div class="form-group" style="display:<?php echo $am111;?>">
+											<label><?php echo $lang->showWord("present_charging_energy"); ?></label>
+											<input type="text" readonly class="form-control" placeholder="<?php echo number_format(round($obj['ChargingInfo3']['PresentChargedEnergy'],4), 4, ".", " ");?> kWh">
+											<input type="hidden" name="PresentChargedEnergy3" id="PresentChargedEnergy3" value="<?php echo $obj['ChargingInfo3']['PresentChargedEnergy'];?>">
+										</div>
+										<div class="form-group" style="display:<?php echo $am111;?>">
+											<label><?php echo $lang->showWord("present_charging_duration"); ?></label>
+											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo3']['PresentChargedDuration'];?> seconds">
+											<input type="hidden" name="PresentChargedDuration3" id="PresentChargedDuration3" value="<?php echo $obj['ChargingInfo3']['PresentChargedDuration'];?>">
+										</div>
+										<div class="form-group" style="display:<?php echo $am001;?>">
+											<label>Remain Charging Time</label>
+											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo3']['RemainChargingDuration'];?> seconds">
+											<input type="hidden" name="RemainChargingDuration3" id="RemainChargingDuration3" value="<?php echo $obj['ChargingInfo3']['RemainChargingDuration'];?>">
+										</div>
+										<div class="form-group" style="display:<?php echo $am001;?>">
+											<label>EV Battery Max Voltage</label>
+											<input type="text" readonly class="form-control" placeholder="<?php echo round($obj['ChargingInfo3']['EvBatteryMaxVoltage'],2);?> volt">
+											<input type="hidden" name="EvBatteryMaxVoltage3" id="EvBatteryMaxVoltage3" value="<?php echo $obj['ChargingInfo3']['EvBatteryMaxVoltage'];?>">
+										</div>
+										<div class="form-group" style="display:<?php echo $am001;?>">
+											<label>EV Battery Target Voltage</label>
+											<input type="text" readonly class="form-control" placeholder="<?php echo round($obj['ChargingInfo3']['EvBatterytargetVoltage'],2);?> volt">
+											<input type="hidden" name="EvBatterytargetVoltage3" id="EvBatterytargetVoltage3" value="<?php echo $obj['ChargingInfo3']['EvBatterytargetVoltage'];?>">
+										</div>
+										<div class="form-group" style="display:<?php echo $am001;?>">
+											<label>EV Battery Soc</label>
+											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo3']['EvBatterySoc'];?>">
+											<input type="hidden" name="EvBatterySoc3" id="EvBatterySoc3" value="<?php echo $obj['ChargingInfo3']['EvBatterySoc'];?>">
+										</div>
+										<div class="form-group" style="display:<?php echo $am111;?>">
+											<label><?php echo $lang->showWord("totalize_power_consumption"); ?></label>
+											<input type="text" readonly class="form-control" placeholder="<?php echo number_format(round($obj['ChargingInfo3']['PowerConsumption'],4), 4, ".", " ");?> kWh">
+										</div>
+<?php if(substr($ModelName,0,2)=="AX"){?>
+										<div class="form-group" style="display:block">
+											<label><?php echo $lang->showWord("meter_ic_calibration_status"); ?></label>
+											<span style="display:block">
+												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
+													<label>VaGain</label>
+												</span>
+												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
+													<label class="toggle-switchy" for="VaGain" data-size="" data-style="rounded">
+														<input disabled type="checkbox" id="VaGain" <?php echo $obj['ChargingInfo3']['isCalibratedVaGain']==1?"checked":"";?>>
+														<span class="toggle">
+														  <span class="switch"></span>
+														</span>
+													</label>
+												</span>
+												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
+													<label>VbGain</label>
+												</span>
+												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
+													<label class="toggle-switchy" for="VbGain" data-size="" data-style="rounded">
+														<input  disabled type="checkbox" id="VbGain" <?php echo $obj['ChargingInfo3']['isCalibratedVbGain']==1?"checked":"";?>>
+														<span class="toggle">
+														  <span class="switch"></span>
+														</span>
+													</label>
+												</span>
+												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
+													<label>VcGain</label>
+												</span>
+												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
+													<label class="toggle-switchy" for="VcGain" data-size="" data-style="rounded">
+														<input disabled type="checkbox" id="VcGain" <?php echo $obj['ChargingInfo3']['isCalibratedVcGain']==1?"checked":"";?>>
+														<span class="toggle">
+														  <span class="switch"></span>
+														</span>
+													</label>
+												</span>
+											</span>
+											<span class="" style="display:block">
+												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
+													<label>VaOffset</label>
+												</span>
+												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
+													<label class="toggle-switchy" for="VaOffset" data-size="" data-style="rounded">
+														<input disabled type="checkbox" id="VaOffset" <?php echo $obj['ChargingInfo3']['isCalibratedVaOffset']==1?"checked":"";?>>
+														<span class="toggle">
+														  <span class="switch"></span>
+														</span>
+													</label>
+												</span>
+												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
+													<label>VbOffset</label>
+												</span>
+												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
+													<label class="toggle-switchy" for="VbOffset" data-size="" data-style="rounded">
+														<input disabled type="checkbox" id="VbOffset" <?php echo $obj['ChargingInfo3']['isCalibratedVbOffset']==1?"checked":"";?>>
+														<span class="toggle">
+														  <span class="switch"></span>
+														</span>
+													</label>
+												</span>
+												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
+													<label>VcOffset</label>
+												</span>
+												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
+													<label class="toggle-switchy" for="VcOffset" data-size="" data-style="rounded">
+														<input disabled type="checkbox" id="VcOffset" <?php echo $obj['ChargingInfo3']['isCalibratedVcOffset']==1?"checked":"";?>>
+														<span class="toggle">
+														  <span class="switch"></span>
+														</span>
+													</label>
+												</span>
+											</span>
+											<span class="" style="display:block">
+												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
+													<label>CaGain</label>
+												</span>
+												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
+													<label class="toggle-switchy" for="CaGain" data-size="" data-style="rounded">
+														<input disabled type="checkbox" id="CaGain" <?php echo $obj['ChargingInfo3']['isCalibratedCaGain']==1?"checked":"";?>>
+														<span class="toggle">
+														  <span class="switch"></span>
+														</span>
+													</label>
+												</span>
+												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
+													<label>CbGain</label>
+												</span>
+												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
+													<label class="toggle-switchy" for="CbGain" data-size="" data-style="rounded">
+														<input disabled type="checkbox" id="CbGain" <?php echo $obj['ChargingInfo3']['isCalibratedCbGain']==1?"checked":"";?>>
+														<span class="toggle">
+														  <span class="switch"></span>
+														</span>
+													</label>
+												</span>
+												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
+													<label>CcGain</label>
+												</span>
+												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
+													<label class="toggle-switchy" for="CcGain" data-size="" data-style="rounded">
+														<input disabled type="checkbox" id="CcGain" <?php echo $obj['ChargingInfo3']['isCalibratedCcGain']==1?"checked":"";?>>
+														<span class="toggle">
+														  <span class="switch"></span>
+														</span>
+													</label>
+												</span>
+											</span>
+											<span class="" style="display:block">
+												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
+													<label>CaOffset</label>
+												</span>
+												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
+													<label class="toggle-switchy" for="CaOffset" data-size="" data-style="rounded">
+														<input disabled type="checkbox" id="CaOffset" <?php echo $obj['ChargingInfo3']['isCalibratedCaOffset']==1?"checked":"";?>>
+														<span class="toggle">
+														  <span class="switch"></span>
+														</span>
+													</label>
+												</span>
+												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
+													<label>CbOffset</label>
+												</span>
+												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
+													<label class="toggle-switchy" for="CbOffset" data-size="" data-style="rounded">
+														<input disabled type="checkbox" id="CbOffset" <?php echo $obj['ChargingInfo3']['isCalibratedCbOffset']==1?"checked":"";?>>
+														<span class="toggle">
+														  <span class="switch"></span>
+														</span>
+													</label>
+												</span>
+												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
+													<label>CcOffset</label>
+												</span>
+												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
+													<label class="toggle-switchy" for="CcOffset" data-size="" data-style="rounded">
+														<input disabled type="checkbox" id="CcOffset" <?php echo $obj['ChargingInfo3']['isCalibratedCcOffset']==1?"checked":"";?>>
+														<span class="toggle">
+														  <span class="switch"></span>
+														</span>
+													</label>
+												</span>
+											</span>
+											<span class="" style="display:block">
+												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
+													<label>Pa</label>
+												</span>
+												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
+													<label class="toggle-switchy" for="Pa" data-size="" data-style="rounded">
+														<input disabled type="checkbox" id="Pa" <?php echo $obj['ChargingInfo3']['isCalibratedPa']==1?"checked":"";?>>
+														<span class="toggle">
+														  <span class="switch"></span>
+														</span>
+													</label>
+												</span>
+												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
+													<label>Pb</label>
+												</span>
+												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
+													<label class="toggle-switchy" for="Pb" data-size="" data-style="rounded">
+														<input disabled type="checkbox" id="Pb" <?php echo $obj['ChargingInfo3']['isCalibratedPb']==1?"checked":"";?>>
+														<span class="toggle">
+														  <span class="switch"></span>
+														</span>
+													</label>
+												</span>
+												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
+													<label>Pc</label>
+												</span>
+												<span class="col-lg-2 col-md-2 col-sm-6 col-xs-6">
+													<label class="toggle-switchy" for="Pc" data-size="" data-style="rounded">
+														<input disabled type="checkbox" id="Pc" <?php echo $obj['ChargingInfo3']['isCalibratedPc']==1?"checked":"";?>>
+														<span class="toggle">
+														  <span class="switch"></span>
+														</span>
+													</label>
+												</span>
+											</span>
+										</div>
+<?php } ?>
+									</section>
+								</article>
+<?php }?>
+<?php } ?>
+								<article class="envor-sorting-item css">
+									<div align="center"><button id="save"><?php echo $lang->showWord("set")?></button></div>
+								</article>
+							</div>
+						</div>
+					</div>
+				</div>
+			</div>
+		</section>
+	</div>
+
+<?php
+	include 'foot.php';
+?>
+
+<script type="text/JavaScript">
+	$(document).ready(function(){
+		if(document.getElementById("MaxChargingEnergy").value=="0" || document.getElementById("MaxChargingEnergy").value==""){
+			document.getElementById("MaxChargingEnergyText").style.display="block";
+		}
+		if(document.getElementById("MaxChargingPower").value=="0" || document.getElementById("MaxChargingPower").value==""){
+			document.getElementById("MaxChargingPowerText").style.display="block";
+		}
+		if(document.getElementById("MaxChargingCurrent").value=="0" || document.getElementById("MaxChargingCurrent").value==""){
+			document.getElementById("MaxChargingCurrentText").style.display="block";
+		}
+		if(document.getElementById("MaxChargingDuration").value=="0" || document.getElementById("MaxChargingDuration").value==""){
+			document.getElementById("MaxChargingDurationText").style.display="block";
+		}
+		if(document.getElementById("MaxChargingSoc").value=="0" || document.getElementById("MaxChargingSoc").value==""){
+			document.getElementById("MaxChargingSocText").style.display="block";
+		}
+		if(document.getElementById("ModelName").value.substr(8,1) != "0"){
+			document.getElementById("AcMaxChargingCurrentDiv").style.display="block";
+			if(document.getElementById("AcMaxChargingCurrent").value=="0" || document.getElementById("AcMaxChargingCurrent").value==""){
+				document.getElementById("AcMaxChargingCurrentText").style.display="block";
+			}
+			document.getElementById("MaxChargingEnergyLbl").innerHTML="DC MaxCharging Energy";
+			document.getElementById("MaxChargingPowerLbl").innerHTML="DC MaxCharging Power";
+			document.getElementById("MaxChargingCurrentLbl").innerHTML="DC MaxCharging Current";
+			document.getElementById("MaxChargingDurationLbl").innerHTML="DC MaxCharging Duration";
+			document.getElementById("MaxChargingSocLbl").innerHTML="DC MaxCharging Soc";
+		}
+		else{
+			document.getElementById("AcMaxChargingCurrentDiv").style.display="none";
+		}
+		isBilling_clicked();
+		document.getElementById("MaxChargingEnergy").addEventListener("change", function() {
+			if(document.getElementById(this.id).value == "0" || document.getElementById(this.id).value == ""){
+				document.getElementById(this.id+"Text").style.display="block";
+			}
+			else{
+				document.getElementById(this.id+"Text").style.display="none";
+			}
+		});
+		document.getElementById("MaxChargingPower").addEventListener("change", function() {
+			if(document.getElementById(this.id).value == "0" || document.getElementById(this.id).value == ""){
+				document.getElementById(this.id+"Text").style.display="block";
+			}
+			else{
+				document.getElementById(this.id+"Text").style.display="none";
+			}
+		});
+		document.getElementById("MaxChargingCurrent").addEventListener("change", function() {
+			if(document.getElementById(this.id).value == "0" || document.getElementById(this.id).value == ""){
+				document.getElementById(this.id+"Text").style.display="block";
+			}
+			else{
+				document.getElementById(this.id+"Text").style.display="none";
+			}
+		});
+		document.getElementById("MaxChargingDuration").addEventListener("change", function() {
+			if(document.getElementById(this.id).value == "0" || document.getElementById(this.id).value == ""){
+				document.getElementById(this.id+"Text").style.display="block";
+			}
+			else{
+				document.getElementById(this.id+"Text").style.display="none";
+			}
+		});
+		document.getElementById("MaxChargingSoc").addEventListener("change", function() {
+			if(document.getElementById(this.id).value == "0" || document.getElementById(this.id).value == ""){
+				document.getElementById(this.id+"Text").style.display="block";
+			}
+			else{
+				document.getElementById(this.id+"Text").style.display="none";
+			}
+		});
+		document.getElementById("AcMaxChargingCurrent").addEventListener("change", function() {
+			if(document.getElementById(this.id).value == "0" || document.getElementById(this.id).value == ""){
+				document.getElementById(this.id+"Text").style.display="block";
+			}
+			else{
+				document.getElementById(this.id+"Text").style.display="none";
+			}
+		});
+		if(document.getElementById("ModelName").value.substr(7,1)!=0){
+			if(document.getElementById("ModelName").value.substr(7,1) == "V" || document.getElementById("ModelName").value.substr(7,1) == "F" || document.getElementById("ModelName").value.substr(7,1) == "P" || document.getElementById("ModelName").value.substr(7,1) == "R"){
+				document.getElementById("ChillerTemp1").style.display="block";
+			}
+			else{
+				document.getElementById("ChillerTemp1").style.display="none";
+			}
+		}
+		if(document.getElementById("ModelName").value.substr(9,1)!=0){
+			if(document.getElementById("ModelName").value.substr(9,1) == "V" || document.getElementById("ModelName").value.substr(9,1) == "F" || document.getElementById("ModelName").value.substr(9,1) == "P" || document.getElementById("ModelName").value.substr(9,1) == "R"){
+				document.getElementById("ChillerTemp2").style.display="block";
+			}
+			else{
+				document.getElementById("ChillerTemp2").style.display="none";
+			}
+		}
+		if(document.getElementById("ModelName").value.substr(8,1)!=0){
+			if(document.getElementById("ModelName").value.substr(8,1) == "V" || document.getElementById("ModelName").value.substr(8,1) == "F" || document.getElementById("ModelName").value.substr(8,1) == "P" || document.getElementById("ModelName").value.substr(8,1) == "R"){
+				document.getElementById("ChillerTemp3").style.display="block";
+			}
+			else{
+				document.getElementById("ChillerTemp3").style.display="none";
+			}
+		}
+	});
+
+	document.getElementById("save").onclick = function() {
+		if(formCheck())
+		{
+			window.location="#loadinghref";
+			document.getElementById("loading").style.display="block";
+			// 發送 Ajax 查詢請求並處理
+			var request = new XMLHttpRequest();
+			request.open("POST", "set_charging_action.php");
+
+			// POST 參數須使用 send() 發送
+			var data =  "MaxChargingEnergy=" + document.getElementById("MaxChargingEnergy").value +
+						"&MaxChargingPower=" + document.getElementById("MaxChargingPower").value +
+						"&MaxChargingCurrent=" + document.getElementById("MaxChargingCurrent").value+
+						"&AcMaxChargingCurrent=" + document.getElementById("AcMaxChargingCurrent").value+
+						"&MaxChargingDuration=" + document.getElementById("MaxChargingDuration").value+
+						"&MaxChargingSoc=" + document.getElementById("MaxChargingSoc").value+
+						"&StopChargingByButton=" + document.getElementById("StopChargingByButton").value+
+						"&FanControlPolicy=" + document.getElementById("FanControlPolicy").value+
+						"&LocalWhiteCard0=" + document.getElementById("LocalWhiteCard0").value+
+						"&LocalWhiteCard1=" + document.getElementById("LocalWhiteCard1").value+
+						"&LocalWhiteCard2=" + document.getElementById("LocalWhiteCard2").value+
+						"&LocalWhiteCard3=" + document.getElementById("LocalWhiteCard3").value+
+						"&LocalWhiteCard4=" + document.getElementById("LocalWhiteCard4").value+
+						"&LocalWhiteCard5=" + document.getElementById("LocalWhiteCard5").value+
+						"&LocalWhiteCard6=" + document.getElementById("LocalWhiteCard6").value+
+						"&LocalWhiteCard7=" + document.getElementById("LocalWhiteCard7").value+
+						"&LocalWhiteCard8=" + document.getElementById("LocalWhiteCard8").value+
+						"&LocalWhiteCard9=" + document.getElementById("LocalWhiteCard9").value+
+						"&isBilling=" + (document.getElementById("isBilling").checked?1:0)+
+						"&Currency=" + document.getElementById("Currency").value+
+						"&Fee0=" + document.getElementById("Fee0").value+
+						"&Fee1=" + document.getElementById("Fee1").value+
+						"&Fee2=" + document.getElementById("Fee2").value+
+						"&Fee3=" + document.getElementById("Fee3").value+
+						"&Fee4=" + document.getElementById("Fee4").value+
+						"&Fee5=" + document.getElementById("Fee5").value+
+						"&Fee6=" + document.getElementById("Fee6").value+
+						"&Fee7=" + document.getElementById("Fee7").value+
+						"&Fee8=" + document.getElementById("Fee8").value+
+						"&Fee9=" + document.getElementById("Fee9").value+
+						"&Fee10=" + document.getElementById("Fee10").value+
+						"&Fee11=" + document.getElementById("Fee11").value+
+						"&Fee12=" + document.getElementById("Fee12").value+
+						"&Fee13=" + document.getElementById("Fee13").value+
+						"&Fee14=" + document.getElementById("Fee14").value+
+						"&Fee15=" + document.getElementById("Fee15").value+
+						"&Fee16=" + document.getElementById("Fee16").value+
+						"&Fee17=" + document.getElementById("Fee17").value+
+						"&Fee18=" + document.getElementById("Fee18").value+
+						"&Fee19=" + document.getElementById("Fee19").value+
+						"&Fee20=" + document.getElementById("Fee20").value+
+						"&Fee21=" + document.getElementById("Fee21").value+
+						"&Fee22=" + document.getElementById("Fee22").value+
+						"&Fee23=" + document.getElementById("Fee23").value;
+			
+			// POST 請求必須設置表頭在 open() 下面,send() 上面
+			request.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
+			request.send(data);
+
+			request.onreadystatechange = function() {
+				// 伺服器請求完成
+				if (request.readyState == 4) {
+					 document.getElementById("loading").style.display="none";
+					// 伺服器回應成功
+					if (request.status == 200 && JSON.parse(request.responseText).result=="Success") {
+						alert("<?php echo $lang->showWord("done")?>");
+						location.href="set_charging.php";
+					} else {
+						alert(JSON.parse(request.responseText).message);
+					}
+					request = null;
+				}
+			}
+		}
+	}
+	
+	function formCheck()
+	{
+		var LocalWhiteCard0 = document.getElementById("LocalWhiteCard0").value;
+		var LocalWhiteCard1 = document.getElementById("LocalWhiteCard1").value;
+		var LocalWhiteCard2 = document.getElementById("LocalWhiteCard2").value;
+		var LocalWhiteCard3 = document.getElementById("LocalWhiteCard3").value;
+		var LocalWhiteCard4 = document.getElementById("LocalWhiteCard4").value;
+		var LocalWhiteCard5 = document.getElementById("LocalWhiteCard5").value;
+		var LocalWhiteCard6 = document.getElementById("LocalWhiteCard6").value;
+		var LocalWhiteCard7 = document.getElementById("LocalWhiteCard7").value;
+		var LocalWhiteCard8 = document.getElementById("LocalWhiteCard8").value;
+		var LocalWhiteCard9 = document.getElementById("LocalWhiteCard9").value;
+		var RatingCurrent = document.getElementById("RatingCurrent").value;
+		var RatingPower = document.getElementById("RatingPower").value;
+		var MaxChargingEnergy = document.getElementById("MaxChargingEnergy").value;
+		var MaxChargingPower = document.getElementById("MaxChargingPower").value;
+		var MaxChargingCurrent = document.getElementById("MaxChargingCurrent").value;
+		var AcMaxChargingCurrent = document.getElementById("AcMaxChargingCurrent").value;
+		var MaxChargingDuration = document.getElementById("MaxChargingDuration").value;
+		var MaxChargingSoc = document.getElementById("MaxChargingSoc").value;
+		
+		if(LocalWhiteCard0 != ""){
+			if(LocalWhiteCard0.length>32){
+				alert("Local White Card0 must be less than 32 bytes!");
+				document.getElementById("LocalWhiteCard0").focus();
+				return false;
+			}
+		}
+		if(LocalWhiteCard1 != ""){
+			if(LocalWhiteCard1.length>32){
+				alert("Local White Card1 must be less than 32 bytes!");
+				document.getElementById("LocalWhiteCard1").focus();
+				return false;
+			}
+		}
+		if(LocalWhiteCard2 != ""){
+			if(LocalWhiteCard2.length>32){
+				alert("Local White Card2 must be less than 32 bytes!");
+				document.getElementById("LocalWhiteCard2").focus();
+				return false;
+			}
+		}
+		if(LocalWhiteCard3 != ""){
+			if(LocalWhiteCard3.length>32){
+				alert("Local White Card3 must be less than 32 bytes!");
+				document.getElementById("LocalWhiteCard3").focus();
+				return false;
+			}
+		}
+		if(LocalWhiteCard4 != ""){
+			if(LocalWhiteCard4.length>32){
+				alert("Local White Card4 must be less than 32 bytes!");
+				document.getElementById("LocalWhiteCard4").focus();
+				return false;
+			}
+		}
+		if(LocalWhiteCard5 != ""){
+			if(LocalWhiteCard5.length>32){
+				alert("Local White Card5 must be less than 32 bytes!");
+				document.getElementById("LocalWhiteCard5").focus();
+				return false;
+			}
+		}
+		if(LocalWhiteCard6 != ""){
+			if(LocalWhiteCard6.length>32){
+				alert("Local White Card6 must be less than 32 bytes!");
+				document.getElementById("LocalWhiteCard6").focus();
+				return false;
+			}
+		}
+		if(LocalWhiteCard7 != ""){
+			if(LocalWhiteCard7.length>32){
+				alert("Local White Card7 must be less than 32 bytes!");
+				document.getElementById("LocalWhiteCard7").focus();
+				return false;
+			}
+		}
+		if(LocalWhiteCard8 != ""){
+			if(LocalWhiteCard8.length>32){
+				alert("Local White Card8 must be less than 32 bytes!");
+				document.getElementById("LocalWhiteCard8").focus();
+				return false;
+			}
+		}
+		if(LocalWhiteCard9 != ""){
+			if(LocalWhiteCard9.length>32){
+				alert("Local White Card9 must be less than 32 bytes!");
+				document.getElementById("LocalWhiteCard9").focus();
+				return false;
+			}
+		}
+		if(MaxChargingEnergy =="")
+		{
+			alert("Fill Max Charging Energy !");
+			document.getElementById("MaxChargingEnergy").focus();
+			return false;
+		}
+		if(MaxChargingEnergy >65535)
+		{
+			alert("Max Charging Energy must <= 65535!");
+			document.getElementById("MaxChargingEnergy").focus();
+			return false;
+		}
+		if(MaxChargingEnergy < 0)
+		{
+			alert("Max Charging Energy must >= 0!");
+			document.getElementById("MaxChargingEnergy").focus();
+			return false;
+		}
+		if(MaxChargingPower =="")
+		{
+			alert("Fill Max Charging Power !");
+			document.getElementById("MaxChargingPower").focus();
+			return false;
+		}
+		if(RatingPower!="" && RatingPower!=0){
+			if(parseFloat(MaxChargingPower) > parseFloat(RatingPower))
+			{
+				alert("Max Charging Power must be less than RatingPower("+RatingPower+")!");
+				document.getElementById("MaxChargingPower").focus();
+				return false;
+			}
+		}
+		else{
+			if(MaxChargingPower >65535)
+			{
+				alert("Max Charging Power must <= 65535!");
+				document.getElementById("MaxChargingPower").focus();
+				return false;
+			}
+		}
+		if(MaxChargingCurrent =="")
+		{
+			alert("Fill Max Charging Current !");
+			document.getElementById("MaxChargingCurrent").focus();
+			return false;
+		}
+		if(RatingCurrent!="" && RatingCurrent!=0){
+			if(parseFloat(MaxChargingCurrent) > parseFloat(RatingCurrent))
+			{
+				alert("Max Charging Current must be less than RatingCurrent("+RatingCurrent+")!");
+				document.getElementById("MaxChargingCurrent").focus();
+				return false;
+			}
+		}
+		else{
+			if(MaxChargingCurrent >65535)
+			{
+				alert("Max Charging Current must <= 65535!");
+				document.getElementById("MaxChargingCurrent").focus();
+				return false;
+			}
+		}
+		if(document.getElementById("ModelName").value.substr(8,1)!= "0" && AcMaxChargingCurrent =="")
+		{
+			alert("Fill AC Max Charging Current !");
+			document.getElementById("AcMaxChargingCurrent").focus();
+			return false;
+		}
+		if(AcRatingCurrent!="" && AcRatingCurrent!=0){
+			if(parseFloat(AcMaxChargingCurrent) > parseFloat(AcRatingCurrent))
+			{
+				alert("Ac Max Charging Current must be less than Ac Rating Current("+AcRatingCurrent+")!");
+				document.getElementById("AcMaxChargingCurrent").focus();
+				return false;
+			}
+		}
+		else{
+			if(AcMaxChargingCurrent >65535)
+			{
+				alert("Ac Max Charging Current must <= 65535!");
+				document.getElementById("AcMaxChargingCurrent").focus();
+				return false;
+			}
+			if(AcMaxChargingCurrent < 0)
+			{
+				alert("Ac Max Charging Current must >= 0!");
+				document.getElementById("AcMaxChargingCurrent").focus();
+				return false;
+			}
+		}
+		if(MaxChargingCurrent =="")
+		{
+			alert("Fill Max Charging Current !");
+			document.getElementById("MaxChargingCurrent").focus();
+			return false;
+		}
+		if(MaxChargingCurrent < 0)
+		{
+			alert("MaxChargingCurrent must >= 0!");
+			document.getElementById("MaxChargingCurrent").focus();
+			return false;
+		}
+		if(MaxChargingDuration >65535)
+		{
+			alert("MaxChargingDuration must <= 65535!");
+			document.getElementById("MaxChargingDuration").focus();
+			return false;
+		}
+		if(MaxChargingDuration =="")
+		{
+			alert("Fill Max Charging Duration !");
+			document.getElementById("MaxChargingDuration").focus();
+			return false;
+		}
+		if(MaxChargingDuration < 0)
+		{
+			alert("MaxChargingDuration must >= 0!");
+			document.getElementById("MaxChargingDuration").focus();
+			return false;
+		}
+		if((document.getElementById("ModelName").value.substr(0,1)=="D") && (MaxChargingSoc > 100))
+		{
+			alert("MaxChargingSoc must <= 100!");
+			document.getElementById("MaxChargingSoc").focus();
+			return false;
+		}
+		if((document.getElementById("ModelName").value.substr(0,1)=="D") && (MaxChargingSoc == ""))
+		{
+			alert("Fill Max Charging Soc !");
+			document.getElementById("MaxChargingSoc").focus();
+			return false;
+		}
+		if((document.getElementById("ModelName").value.substr(0,1)=="D") && (MaxChargingSoc < 0))
+		{
+			alert("MaxChargingSoc must >= 0!");
+			document.getElementById("MaxChargingSoc").focus();
+			return false;
+		}
+		
+		if(document.getElementById("ModelName").value.substr(0,1)=="A" && MaxChargingCurrent < 6 && MaxChargingCurrent !=0)
+		{
+			alert("MaxChargingCurrent must > 6!");
+			document.getElementById("MaxChargingCurrent").focus();
+			return false;
+		}
+		return true;
+	}
+	function isBilling_clicked(){
+		if(document.getElementById("isBilling").checked){
+			document.getElementById("CurrencyDiv").style.display="block";
+			document.getElementById("FeeDiv").style.display="block";
+		}
+		else{
+			document.getElementById("CurrencyDiv").style.display="none";
+			document.getElementById("FeeDiv").style.display="none";
+		}
+	}
+
+	function isNumberKey(evt)
+	{
+		var charCode = (evt.which) ? evt.which : event.keyCode
+		
+		if (charCode > 31 && (charCode < 48 || charCode > 57) && (charCode != 46))
+			return false;
+		
+		return true;
+	}
+	
+</script>
+
+
+</html>

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

@@ -29,6 +29,7 @@
 		checkMaxValue("MaxChargingDuration");
 		checkMaxValue("MaxChargingSoc");
 		checkValue("StopChargingByButton");
+		checkValue("FanControlPolicy");
 		if(substr($_POST['ModelName'],0,1)=="A" && $_POST['MaxChargingCurrent']<6 && $_POST['MaxChargingCurrent']!=0){
 			$jsone['result'] = "Fail";
 			$jsone['message'] = "MaxChargingCurrent must > 6";
@@ -57,6 +58,9 @@
 		if(isset($_POST['StopChargingByButton'])){
 			$json['StopChargingByButton'] 		= (int)$_POST['StopChargingByButton'];
 		}
+		if(isset($_POST['FanControlPolicy'])){
+			$json['FanControlPolicy'] 		= (int)$_POST['FanControlPolicy'];
+		}
 		if(isset($_POST['LocalWhiteCard0'])){
 			$json['LocalWhiteCard0']			= isset($_POST['LocalWhiteCard0'])?$_POST['LocalWhiteCard0']:"";
 		}

+ 2 - 2
EVSE/rootfs/var/www/set_system.php

@@ -46,13 +46,13 @@
 		if($connector == "0"){
 			$result= "";
 		}
-		else if($connector == "U" || $connector == "V" || $connector == "E" || $connector == "F" || $connector == "T" || $connector == "D" || $connector == "M" || $connector == "N" || $connector == "P" || $connector == "R" || $connector == "Y" || $connector == "Z"){
+		else if($connector == "U" || $connector == "V" || $connector == "E" || $connector == "F" || $connector == "T" || $connector == "D" || $connector == "M" || $connector == "N" || $connector == "P" || $connector == "R" || $connector == "Y" || $connector == "Z" || $connector == "I" || $connector == "Q"){
 			$result= "CCS";
 		}
 		else if($connector == "G" || $connector == "B" || $connector == "H" || $connector == "A"){
 			$result= "GB";
 		}
-		else if($connector == "J" || $connector == "K" || $connector == "L" || $connector == "S"){
+		else if($connector == "J" || $connector == "K" || $connector == "L" || $connector == "S" || $connector == "O"){
 			$result= "CHAdeMO";
 		}
 		else if($connector == "1" || $connector == "2" || $connector == "3" || $connector == "4" || $connector == "5" || $connector == "6" || $connector == "7" || $connector == "8"){