浏览代码

Merge branch 'AW-Regular' of https://git.phihong.com.tw:30000/System_Integration/CSU3_AM335x into AW-Regular

FolusWen 2 年之前
父节点
当前提交
50a110b595
共有 1 个文件被更改,包括 72 次插入13 次删除
  1. 72 13
      EVSE/Projects/AW-Regular/Apps/Module_ConfigTools.c

+ 72 - 13
EVSE/Projects/AW-Regular/Apps/Module_ConfigTools.c

@@ -378,7 +378,17 @@ int main(void)
 			printf("\n  cboxid: Charger box id.");
 			printf("\n  vender: Charger point vender.");
 			printf("\n  offlinepolicy: Charger off line policy.");
-			printf("\n  localloadbalance: Charger local load balance.");
+			printf("\n  localpowersharing: Charger local load balance.");
+			if(ShmSysConfigAndInfo->SysConfig.isEnableLocalPowerSharing == 1)
+			{
+				printf("\n  powersharingcapacity: Power Sharing Capacity.");
+			}
+			else if(ShmSysConfigAndInfo->SysConfig.isEnableLocalPowerSharing == 2)
+			{
+				printf("\n  powersharingserverip: Power Sharing Server IP.");
+			}
+			else
+			{}
 			printf("\n  maintainurl: Maintain server url.");
 			printf("\n  maintainsecurity: Maintain server security profile.");
 			printf("\n **************************************************");
@@ -409,7 +419,7 @@ int main(void)
 			if(strcmp(cmd, "mtserverurl") == 0)
 			{
 				memset(cmd, 0x00, ARRAY_SIZE(cmd));
-				printf("\n ***** mtserverurl *********************************");
+				printf("\n ***** mtserverurl ********************************");
 				printf("\n  Current maintain server url: %s", ShmSysConfigAndInfo->SysConfig.MaintainServerURL);
 				printf("\n  0: Keep current config.");
 				printf("\n  1: Input new ocpp url.");
@@ -513,27 +523,76 @@ int main(void)
 						break;
 				}
 			}
-			else if(strcmp(cmd, "localloadbalance") == 0)
+			else if(strcmp(cmd, "localpowersharing") == 0)
 			{
 				memset(cmd, 0x00, ARRAY_SIZE(cmd));
-				printf("\n ***** localloadbalance ***************************");
-				printf("\n  Current local loading balance: %d", ShmSysConfigAndInfo->SysConfig.isEnableLocalPowerSharing);
+				printf("\n ***** localpowersharing **************************");
+				printf("\n  Current local power sharing: %d", ShmSysConfigAndInfo->SysConfig.isEnableLocalPowerSharing);
 				printf("\n  0: Disable.");
-				printf("\n  1: Enable.");
+				printf("\n  1: Master.");
+				printf("\n  2: Slave.");
 				printf("\n **************************************************");
 				printf("\n  Please input local load balance mode: ");
 				scanf("%s", &cmd[0]);
 
-				ShmSysConfigAndInfo->SysConfig.isEnableLocalPowerSharing = ((0<=atoi(cmd))&&(atoi(cmd)<=1)?atoi(cmd):0);
-				if(ShmSysConfigAndInfo->SysConfig.RfidCardNumEndian)
-					DEBUG_INFO("Local loading balance: Enable\n");
-				else
-					DEBUG_INFO("Local loading balance: Disable\n");
+				ShmSysConfigAndInfo->SysConfig.isEnableLocalPowerSharing = ((0<=atoi(cmd))&&(atoi(cmd)<=2)?atoi(cmd):0);
+
+				switch(ShmSysConfigAndInfo->SysConfig.isEnableLocalPowerSharing)
+				{
+					case 0:
+						DEBUG_INFO("Local loading balance: Disable\n");
+						break;
+					case 1:
+						DEBUG_INFO("Local loading balance: Master\n");
+						break;
+					case 2:
+						DEBUG_INFO("Local loading balance: Slave\n");
+						break;
+				}
+			}
+			else if(strcmp(cmd, "powersharingcapacity") == 0)
+			{
+				memset(cmd, 0x00, ARRAY_SIZE(cmd));
+				printf("\n ***** powersharingcapacity ***********************");
+				printf("\n  Current local power sharing capacity: %d", ShmSysConfigAndInfo->SysConfig.PowerSharingCapacityPower);
+				printf("\n  0: Keep current config.");
+				printf("\n  1: Input new capacity(W).");
+				printf("\n **************************************************");
+				printf("\n  Please input operation item: ");
+				scanf("%s", &cmd[0]);
+
+				if(atoi(cmd) == 1)
+				{
+					printf("\n Please input capacity(W): ");
+					scanf("%s", &cmd[0]);
+					ShmSysConfigAndInfo->SysConfig.PowerSharingCapacityPower = ((0<=atoi(cmd))?atoi(cmd):0);
+				}
+			}
+			else if(strcmp(cmd, "powersharingserverip") == 0)
+			{
+				memset(cmd, 0x00, ARRAY_SIZE(cmd));
+				printf("\n ***** powersharingserverip ***********************");
+				printf("\n  Current power sharing server IP: %s", ShmSysConfigAndInfo->SysConfig.PowerSharingServerIP);
+				printf("\n  0: Keep current config.");
+				printf("\n  1: Input new server IP address.");
+				printf("\n **************************************************");
+				printf("\n  Please input operation item: ");
+				scanf("%s", &cmd[0]);
+				
+				if(atoi(cmd) == 1)
+				{
+					printf("\n Please input power sharing server IP address: ");
+					scanf("%s", &cmd[0]);
+
+					memset(&ShmSysConfigAndInfo->SysConfig.PowerSharingServerIP[0], 0x00, ARRAY_SIZE(ShmSysConfigAndInfo->SysConfig.PowerSharingServerIP));
+					strcpy((char*)&ShmSysConfigAndInfo->SysConfig.PowerSharingServerIP[0], (char*)&cmd[0]);
+					DEBUG_INFO("Input server IP address: %s\n", ShmSysConfigAndInfo->SysConfig.PowerSharingServerIP);
+				}
 			}
 			else if(strcmp(cmd, "maintainurl") == 0)
 			{
 				memset(cmd, 0x00, ARRAY_SIZE(cmd));
-				printf("\n ***** maintainurl *********************************");
+				printf("\n ***** maintainurl ********************************");
 				printf("\n  Current maintain url: %s", ShmSysConfigAndInfo->SysConfig.MaintainServerURL);
 				printf("\n  0: Keep current config.");
 				printf("\n  1: Input new maintain url.");
@@ -554,7 +613,7 @@ int main(void)
 			else if(strcmp(cmd, "maintainsecurity") == 0)
 			{
 				memset(cmd, 0x00, ARRAY_SIZE(cmd));
-				printf("\n ***** maintainsecurity ****************************");
+				printf("\n ***** maintainsecurity ***************************");
 				printf("\n  Current maintain security profile: %d", ShmSysConfigAndInfo->SysConfig.MaintainServerSecurityProfile);
 				printf("\n  0: Profile-0.");
 				printf("\n  1: Profile-1.");