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

2022-04-15 / ct_chen

Actions:
1. fix bug of credit card option for noodoe
2. modify isEnableLocalPowerSharging for AX series

Files:
1. EVSE/rootfs/var/www/set_system.php
2. EVSE/Modularization/WebService.c
   EVSE/rootfs/var/www/set_backend.php
   EVSE/rootfs/var/www/set_backend_action.php
ct_chen 2 жил өмнө
parent
commit
7146e299cb

+ 8 - 0
EVSE/Modularization/WebService.c

@@ -1063,6 +1063,7 @@ int main(int argc, char *argv[]) {
 			char *OcppSecurityPassword=NULL;
 			char *MaintainServerSecurityPassword=NULL;
 			int isEnableLocalPowerSharging=0;
+			char *PowerSharingServerIP=NULL;
 			char *OcppReceiptrURL=NULL;
 			char *MaintainServerURL=NULL;
 			/*for TTIA*/
@@ -1123,6 +1124,10 @@ int main(int argc, char *argv[]) {
 				isEnableLocalPowerSharging = json_object_get_int(val_obj);
 				ShmSysConfigAndInfo->SysConfig.isEnableLocalPowerSharing = isEnableLocalPowerSharging;
 			}
+			if( json_object_object_get_ex(jobj, "PowerSharingServerIP", &val_obj) ) {
+				PowerSharingServerIP = (char*)json_object_get_string(val_obj);
+				strcpy((char *)&ShmSysConfigAndInfo->SysConfig.PowerSharingServerIP,PowerSharingServerIP);
+			}
 			if( json_object_object_get_ex(jobj, "OcppReceiptrURL", &val_obj) ) {
 				OcppReceiptrURL = (char*)json_object_get_string(val_obj);
 				strcpy((char *)&ShmSysConfigAndInfo->SysConfig.OcppReceiptrURL,OcppReceiptrURL);
@@ -1857,6 +1862,7 @@ int main(int argc, char *argv[]) {
 		struct json_object *MaintainServerSecurityProfile;
 		struct json_object *MaintainServerSecurityPassword;
 		struct json_object *isEnableLocalPowerSharging;
+		struct json_object *PowerSharingServerIP;
 		struct json_object *OcppReceiptrURL;
 		struct json_object *MaintainServerURL;
 		/*for TTIA*/
@@ -2542,6 +2548,7 @@ int main(int argc, char *argv[]) {
 		MaintainServerURL = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.MaintainServerURL);
 		if(strcmp(IsDO, "AX") == 0 ){
 			isEnableLocalPowerSharging = json_object_new_int(ShmSysConfigAndInfo->SysConfig.isEnableLocalPowerSharing);
+			PowerSharingServerIP = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.PowerSharingServerIP);
 		}
 		if(strcmp(IsDO, "AX") == 0|| strcmp(IsAcDc, "D") == 0){
 			OcppReceiptrURL = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.OcppReceiptrURL);
@@ -2971,6 +2978,7 @@ int main(int argc, char *argv[]) {
 		json_object_object_add(jobj4,"MaintainServerURL",MaintainServerURL);
 		if(strcmp(IsDO, "AX") == 0){
 			json_object_object_add(jobj4,"isEnableLocalPowerSharging",isEnableLocalPowerSharging);
+			json_object_object_add(jobj4,"PowerSharingServerIP",PowerSharingServerIP);
 		}
 		if(strcmp(IsDO, "AX") == 0 || strcmp(IsAcDc, "D") == 0){
 			json_object_object_add(jobj4,"OcppReceiptrURL",OcppReceiptrURL);

+ 14 - 2
EVSE/rootfs/var/www/set_backend.php

@@ -267,9 +267,14 @@ CORE STYLES ABOVE - NO TOUCHY
 											<label>Local Loading Balance</label>
 											<select class="form-control" id="isEnableLocalPowerSharging" name="isEnableLocalPowerSharging" onChange="isEnableLocalPowerSharging_changed()">
 												<option value="0" <?php echo $obj->{'isEnableLocalPowerSharging'}=="0"?"selected":""?>>disable</option>
-												<option value="1" <?php echo $obj->{'isEnableLocalPowerSharging'}=="1"?"selected":""?>>enable</option>
+												<option value="1" <?php echo $obj->{'isEnableLocalPowerSharging'}=="1"?"selected":""?>>master</option>
+												<option value="2" <?php echo $obj->{'isEnableLocalPowerSharging'}=="2"?"selected":""?>>slave</option>
 											</select>
 										</div>
+										<div id="PowerSharingServerIPDiv" class="form-group" style="display:<?php echo $am101;?>">
+											<label>Power Sharing Server Ip</label>
+											<input type="text" name="PowerSharingServerIP" id="PowerSharingServerIP" class="form-control" value="<?php echo $obj->{'PowerSharingServerIP'};?>">
+										</div>
 <?php } ?>
 										<div class="form-group" style="display:<?php echo $am101;?>">
 											<label>Maintain Server Connection Status</label>
@@ -393,6 +398,7 @@ CORE STYLES ABOVE - NO TOUCHY
 						"&MaintainServerSecurityPassword=" + escape(document.getElementById("MaintainServerSecurityPassword").value);
 <?php if(substr($ModelName,0,2)=="AX"){?>
 				data += "&isEnableLocalPowerSharging=" + document.getElementById("isEnableLocalPowerSharging").value;
+				data += "&PowerSharingServerIP=" + document.getElementById("PowerSharingServerIP").value;
 <?php } if(substr($ModelName,0,2)=="AX" || substr($ModelName,0,1)=="D"){?>
 				data += "&OcppReceiptrURL=" + document.getElementById("OcppReceiptrURL").value;
 <?php } ?>
@@ -533,7 +539,7 @@ CORE STYLES ABOVE - NO TOUCHY
 
 <?php if(substr($ModelName,0,2)=="AX"){?>
 	function isEnableLocalPowerSharging_changed(){
-		if(document.getElementById("isEnableLocalPowerSharging").selectedIndex==1){
+		if(document.getElementById("isEnableLocalPowerSharging").selectedIndex!=0){
 			document.getElementById("OcppServerURL").setAttribute("readOnly","true");
 			document.getElementById("MaintainServerURL").setAttribute("readOnly","true");
 			document.getElementById("ChargeBoxId").setAttribute("readOnly","true");
@@ -545,6 +551,12 @@ CORE STYLES ABOVE - NO TOUCHY
 			document.getElementById("ChargeBoxId").removeAttribute("readOnly");
 			document.getElementById("chargePointVendor").removeAttribute("readOnly");
 		}
+		if(document.getElementById("isEnableLocalPowerSharging").selectedIndex==2){
+			document.getElementById("PowerSharingServerIPDiv").style.display="block";
+		}
+		else{
+			document.getElementById("PowerSharingServerIPDiv").style.display="none";
+		}
 	}
 <?php } ?>
 <?php if(substr($ModelName,0,1)=="D" && substr($ModelName,3,1)=="C"){?>

+ 3 - 0
EVSE/rootfs/var/www/set_backend_action.php

@@ -74,6 +74,9 @@
 			checkValue("isEnableLocalPowerSharging");
 			$json['isEnableLocalPowerSharging']	= (int)$_REQUEST['isEnableLocalPowerSharging'];
 		}
+		if(isset($_REQUEST['PowerSharingServerIP'])){
+			$json['PowerSharingServerIP']	= str_replace("&amp;","&",str_replace("&quot;",'"',str_replace("&#039;","'",str_replace("&lt;","<",str_replace("&gt;",">",$_REQUEST['PowerSharingServerIP'])))));
+		}
 		if(isset($_REQUEST['OcppReceiptrURL'])){
 			$json['OcppReceiptrURL']			= str_replace("&amp;","&",str_replace("&quot;",'"',str_replace("&#039;","'",str_replace("&lt;","<",str_replace("&gt;",">",$_REQUEST['OcppReceiptrURL'])))));
 		}

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

@@ -510,7 +510,7 @@ img {
 				document.getElementById("startMode").style.display="block";
 				isQRCode_clicked();
 			}
-			if((document.getElementById("ModelName").value.substr(0,1) == "D" || document.getElementById("ModelName").value.substr(0,2) == "AX") && document.getElementById("AuthorisationMode").value == "0" && !document.getElementById("isAPP").checked && !document.getElementById("isRFID").checked && !document.getElementById("isQRCode").checked){
+			if((document.getElementById("ModelName").value.substr(0,1) == "D" || document.getElementById("ModelName").value.substr(0,2) == "AX") && document.getElementById("AuthorisationMode").value == "0" && !document.getElementById("isAPP").checked && !document.getElementById("isRFID").checked && !document.getElementById("isQRCode").checked && (document.getElementById("ModelName").value.substr(12,2) != "N0" && document.getElementById("ModelName").value.substr(12,2) != "N1")){
 				alert("Please choose one of 'APP、QR code、RFID'");
 				document.getElementById("isAPP").checked=true;
 				document.getElementById("isQRCode").checked=true;
@@ -538,7 +538,7 @@ img {
 		else{
 			document.getElementById("QRCodeMadeModeDiv").style.display="none";
 			document.getElementById("QRCodeContentDiv").style.display="none";
-			if((document.getElementById("ModelName").value.substr(0,1) == "D" ||document.getElementById("ModelName").value.substr(0,2) == "AX") && document.getElementById("AuthorisationMode").value == "0" && !document.getElementById("isAPP").checked && !document.getElementById("isRFID").checked){
+			if((document.getElementById("ModelName").value.substr(0,1) == "D" ||document.getElementById("ModelName").value.substr(0,2) == "AX") && document.getElementById("AuthorisationMode").value == "0" && !document.getElementById("isAPP").checked && !document.getElementById("isRFID").checked && (document.getElementById("ModelName").value.substr(12,2) != "N0" && document.getElementById("ModelName").value.substr(12,2) != "N1")){
 				alert("Please choose one of 'APP、QR code、RFID'");
 				document.getElementById("isQRCode").checked=true;
 			}
@@ -546,14 +546,14 @@ img {
 	}
 
 	function isAPP_clicked(){
-		if((document.getElementById("ModelName").value.substr(0,1) == "D" || document.getElementById("ModelName").value.substr(0,2) == "AX") && document.getElementById("AuthorisationMode").value == "0" && !document.getElementById("isQRCode").checked && !document.getElementById("isAPP").checked && !document.getElementById("isRFID").checked){
+		if((document.getElementById("ModelName").value.substr(0,1) == "D" || document.getElementById("ModelName").value.substr(0,2) == "AX") && document.getElementById("AuthorisationMode").value == "0" && !document.getElementById("isQRCode").checked && !document.getElementById("isAPP").checked && !document.getElementById("isRFID").checked && (document.getElementById("ModelName").value.substr(12,2) != "N0" && document.getElementById("ModelName").value.substr(12,2) != "N1")){
 			alert("Please choose one of 'APP、QR code、RFID'");
 			document.getElementById("isAPP").checked=true;
 		}
 	}
 
 	function isRFID_clicked(){
-		if((document.getElementById("ModelName").value.substr(0,1) == "D" || document.getElementById("ModelName").value.substr(0,2) == "AX") && document.getElementById("AuthorisationMode").value == "0" && !document.getElementById("isQRCode").checked && !document.getElementById("isAPP").checked && !document.getElementById("isRFID").checked){
+		if((document.getElementById("ModelName").value.substr(0,1) == "D" || document.getElementById("ModelName").value.substr(0,2) == "AX") && document.getElementById("AuthorisationMode").value == "0" && !document.getElementById("isQRCode").checked && !document.getElementById("isAPP").checked && !document.getElementById("isRFID").checked && (document.getElementById("ModelName").value.substr(12,2) != "N0" && document.getElementById("ModelName").value.substr(12,2) != "N1")){
 			alert("Please choose one of 'APP、QR code、RFID'");
 			document.getElementById("isRFID").checked=true;
 		}

+ 0 - 1
board-support/linux-4.9.59+gitAUTOINC+a75d8e9305-ga75d8e9305/lib/.crc7.ko.cmd

@@ -1 +0,0 @@
-cmd_lib/crc7.ko := /opt/ti-processor-sdk-linux-am335x-evm-04.02.00.09/linux-devkit/sysroots/x86_64-arago-linux/usr/bin/arm-linux-gnueabihf-ld -EL -r  -T ./scripts/module-common.lds --build-id  -o lib/crc7.ko lib/crc7.o lib/crc7.mod.o ;  true

+ 0 - 37
board-support/linux-4.9.59+gitAUTOINC+a75d8e9305-ga75d8e9305/lib/.gen_crc32table.cmd

@@ -1,37 +0,0 @@
-cmd_lib/gen_crc32table := gcc -Wp,-MD,lib/.gen_crc32table.d -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer -std=gnu89     -o lib/gen_crc32table lib/gen_crc32table.c  
-
-source_lib/gen_crc32table := lib/gen_crc32table.c
-
-deps_lib/gen_crc32table := \
-  /usr/include/stdc-predef.h \
-  /usr/include/stdio.h \
-  /usr/include/features.h \
-  /usr/include/x86_64-linux-gnu/sys/cdefs.h \
-  /usr/include/x86_64-linux-gnu/bits/wordsize.h \
-  /usr/include/x86_64-linux-gnu/gnu/stubs.h \
-  /usr/include/x86_64-linux-gnu/gnu/stubs-64.h \
-  /usr/lib/gcc/x86_64-linux-gnu/5/include/stddef.h \
-  /usr/include/x86_64-linux-gnu/bits/types.h \
-  /usr/include/x86_64-linux-gnu/bits/typesizes.h \
-  /usr/include/libio.h \
-  /usr/include/_G_config.h \
-  /usr/include/wchar.h \
-  /usr/lib/gcc/x86_64-linux-gnu/5/include/stdarg.h \
-  /usr/include/x86_64-linux-gnu/bits/stdio_lim.h \
-  /usr/include/x86_64-linux-gnu/bits/sys_errlist.h \
-  /usr/include/x86_64-linux-gnu/bits/stdio.h \
-  /usr/include/x86_64-linux-gnu/bits/stdio2.h \
-  lib/crc32defs.h \
-    $(wildcard include/config/crc32/sliceby8.h) \
-    $(wildcard include/config/crc32/sliceby4.h) \
-    $(wildcard include/config/crc32/sarwate.h) \
-    $(wildcard include/config/crc32/bit.h) \
-    $(wildcard include/config/64bit.h) \
-  /usr/include/inttypes.h \
-  /usr/lib/gcc/x86_64-linux-gnu/5/include/stdint.h \
-  /usr/include/stdint.h \
-  /usr/include/x86_64-linux-gnu/bits/wchar.h \
-
-lib/gen_crc32table: $(deps_lib/gen_crc32table)
-
-$(deps_lib/gen_crc32table):