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

[Added][AW-Regular][Module_ConfigTools.c]
2022-07-27 / EASON YANG
Action:
1. Added: Local power sharing setting.
2. Added: Power sharing capacity setting.
3. Added: Power sharing server IP setting.

File:
1. Module_ConfigTools.c
Action 1
Action 2
Action 3

FIRMWARE VERSION: V0.71.XX.XXXX.PX

8009 2 жил өмнө
parent
commit
6a9d14afbb

+ 69 - 10
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 **************************************************");
@@ -513,22 +523,71 @@ 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)
 			{