瀏覽代碼

2023-02-22 / ct_chen

Actions:
1. Webservice add "isEnable15118","isEnableR2R"

Files:
1. EVSE/Modularization/WebService.c
   EVSE/rootfs/var/www/set_charging.php
   EVSE/rootfs/var/www/set_charging_action.php
ct_chen 2 年之前
父節點
當前提交
ac8e0f197d
共有 3 個文件被更改,包括 49 次插入1 次删除
  1. 16 0
      EVSE/Modularization/WebService.c
  2. 27 1
      EVSE/rootfs/var/www/set_charging.php
  3. 6 0
      EVSE/rootfs/var/www/set_charging_action.php

+ 16 - 0
EVSE/Modularization/WebService.c

@@ -735,6 +735,8 @@ int main(int argc, char *argv[]) {
 			int MaxChargingSoc = 0;
 			int StopChargingByButton = 0;
 			int FanControlPolicy = 0;
+			int isEnable15118 = 0;
+			int isEnableR2R = 0;
 			char *LocalWhiteCard0 = NULL;
 			char *LocalWhiteCard1 = NULL;
 			char *LocalWhiteCard2 = NULL;
@@ -808,6 +810,14 @@ int main(int argc, char *argv[]) {
 				FanControlPolicy = json_object_get_int(val_obj);
 				ShmSysConfigAndInfo->SysConfig.FanControlPolicy = FanControlPolicy;
 			}
+			if( json_object_object_get_ex(jobj, "isEnable15118", &val_obj) ) {
+				isEnable15118 = json_object_get_int(val_obj);
+				ShmSysConfigAndInfo->SysConfig.isEnable15118 = isEnable15118;
+			}
+			if( json_object_object_get_ex(jobj, "isEnableR2R", &val_obj) ) {
+				isEnableR2R = json_object_get_int(val_obj);
+				ShmSysConfigAndInfo->SysConfig.isEnableR2R = isEnableR2R;
+			}
 			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);
@@ -1978,6 +1988,8 @@ int main(int argc, char *argv[]) {
 		struct json_object *V2GPrivateKey;
 		struct json_object *V2GRootCertificate;
 		struct json_object *V2GCertificateChain;
+		struct json_object *isEnable15118;
+		struct json_object *isEnableR2R;
 		/* for DO & DD*/
 		struct json_object *DDChargingInfo1;
 		struct json_object *DDChargingInfo2;
@@ -2235,6 +2247,8 @@ int main(int argc, char *argv[]) {
 		MaxChargingSoc = json_object_new_int(ShmSysConfigAndInfo->SysConfig.MaxChargingSoc);
 		StopChargingByButton = json_object_new_int(ShmSysConfigAndInfo->SysConfig.StopChargingByButton);
 		FanControlPolicy = json_object_new_int(ShmSysConfigAndInfo->SysConfig.FanControlPolicy);
+		isEnable15118 = json_object_new_int(ShmSysConfigAndInfo->SysConfig.isEnable15118);
+		isEnableR2R = json_object_new_int(ShmSysConfigAndInfo->SysConfig.isEnableR2R);
 		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]);
@@ -3030,6 +3044,8 @@ int main(int argc, char *argv[]) {
 		json_object_object_add(jobj2,"MaxChargingSoc",MaxChargingSoc);
 		json_object_object_add(jobj2,"StopChargingByButton",StopChargingByButton);
 		json_object_object_add(jobj2,"FanControlPolicy",FanControlPolicy);
+		json_object_object_add(jobj2,"isEnable15118",isEnable15118);
+		json_object_object_add(jobj2,"isEnableR2R",isEnableR2R);
 		json_object_array_add(LocalWhiteCardArr,LocalWhiteCard[0]);
 		json_object_array_add(LocalWhiteCardArr,LocalWhiteCard[1]);
 		json_object_array_add(LocalWhiteCardArr,LocalWhiteCard[2]);

+ 27 - 1
EVSE/rootfs/var/www/set_charging.php

@@ -785,6 +785,24 @@ CORE STYLES ABOVE - NO TOUCHY
 											<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>
+<?php if(substr($ModelName,0,2)=="AX" || substr($ModelName,0,1)=="D"){?>
+										<div class="form-group">
+											<label>15118</label>
+											<select class="form-control" id="isEnable15118" name="isEnable15118">
+												<option value="0" <?php echo $obj['isEnable15118']=="0"?"selected":""?>>Disable</option>
+												<option value="1" <?php echo $obj['isEnable15118']=="1"?"selected":""?>>Enable</option>
+											</select>
+										</div>
+<?php } ?>
+<?php if(substr($ModelName,0,2)=="DS" || substr($ModelName,0,2)=="DM" || substr($ModelName,0,2)=="DW"){?>
+										<div class="form-group">
+											<label>R2R</label>
+											<select class="form-control" id="isEnableR2R" name="isEnableR2R">
+												<option value="0" <?php echo $obj['isEnableR2R']=="0"?"selected":""?>>Disable</option>
+												<option value="1" <?php echo $obj['isEnableR2R']=="1"?"selected":""?>>Enable</option>
+											</select>
+										</div>
+<?php } ?>
 										<div class="form-group"  id="isBillingDiv">
 											<label>
 											<input type="checkbox" id="isBilling" name="isBilling" <?php echo $obj['isBilling']==1?"checked":"";?> onclick="isBilling_clicked()">
@@ -2277,7 +2295,9 @@ CORE STYLES ABOVE - NO TOUCHY
 			formData.append("MaxChargingEnergy", document.getElementById("MaxChargingEnergy").value);
 			formData.append("MaxChargingPower", document.getElementById("MaxChargingPower").value);
 			formData.append("MaxChargingCurrent", document.getElementById("MaxChargingCurrent").value);
-<?php if(substr($ModelName,-2)=="PS"){?>formData.append("MaxChargingVoltage", document.getElementById("MaxChargingVoltage").value);<?php } ?>
+<?php if(substr($ModelName,-2)=="PS"){?>
+			formData.append("MaxChargingVoltage", document.getElementById("MaxChargingVoltage").value);
+<?php } ?>
 			formData.append("AcMaxChargingCurrent", document.getElementById("AcMaxChargingCurrent").value);
 			formData.append("MaxChargingDuration", document.getElementById("MaxChargingDuration").value);
 			formData.append("MaxChargingSoc", document.getElementById("MaxChargingSoc").value);
@@ -2293,6 +2313,12 @@ CORE STYLES ABOVE - NO TOUCHY
 			formData.append("LocalWhiteCard7", escapeHtml(document.getElementById("LocalWhiteCard7").value));
 			formData.append("LocalWhiteCard8", escapeHtml(document.getElementById("LocalWhiteCard8").value));
 			formData.append("LocalWhiteCard9", escapeHtml(document.getElementById("LocalWhiteCard9").value));
+<?php if(substr($ModelName,0,2)=="AX"||substr($ModelName,0,1)=="D"){?>
+			formData.append("isEnable15118", (document.getElementById("isEnable15118").value));
+<?php } ?>
+<?php if(substr($ModelName,0,2)=="DS"||substr($ModelName,0,2)=="DM"||substr($ModelName,0,2)=="DW"){?>
+			formData.append("isEnableR2R", (document.getElementById("isEnableR2R").value));
+<?php } ?>
 			formData.append("isBilling", (document.getElementById("isBilling").checked?"1":"0"));
 			formData.append("Currency", document.getElementById("Currency").value);
 			formData.append("Fee0", document.getElementById("Fee0").value);

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

@@ -97,6 +97,12 @@
 		if(isset($_POST['LocalWhiteCard9'])){
 			$json['LocalWhiteCard9']			= isset($_POST['LocalWhiteCard9'])?$_POST['LocalWhiteCard9']:"";
 		}
+		if(isset($_POST['isEnable15118'])){
+			$json['isEnable15118']				= (int)$_POST['isEnable15118'];
+		}
+		if(isset($_POST['isEnableR2R'])){
+			$json['isEnableR2R']				= (int)$_POST['isEnableR2R'];
+		}
 		if(isset($_POST['isBilling'])){
 			$json['isBilling']					= (int)$_POST['isBilling'];
 		}