Przeglądaj źródła

2020-02-10 / ct_chen

Actions:
1. Webservice set_system 頁 AcPhaseCount 由可設定單相或三相,改為純顯示; set_charging 配合 define.h 修改 SystemStatus 19 由 single run 變更為 update

Files:
1. 如列表
ct_chen 5 lat temu
rodzic
commit
03bfa44746

+ 6 - 6
EVSE/Modularization/WebService.c

@@ -335,7 +335,7 @@ int main(int argc, char *argv[]) {
 			json_object *val_obj = NULL;
 			char *SystemId=NULL;
 			char *SystemDateTime = NULL;
-			int AcPhaseCount = 0;
+//			int AcPhaseCount = 0;
 			int FactoryConfiguration = 0;
 			int AuthorisationMode = 0;
 			int DefaultLanguage = 0;
@@ -348,9 +348,9 @@ int main(int argc, char *argv[]) {
 			if( json_object_object_get_ex(jobj, "SystemDateTime", &val_obj) ) {
 				SystemDateTime = (char*)json_object_get_string(val_obj);
 			}
-			if( json_object_object_get_ex(jobj, "AcPhaseCount", &val_obj) ) {
-				AcPhaseCount = json_object_get_int(val_obj);
-			}
+//			if( json_object_object_get_ex(jobj, "AcPhaseCount", &val_obj) ) {
+//				AcPhaseCount = json_object_get_int(val_obj);
+//			}
 			if( json_object_object_get_ex(jobj, "FactoryConfiguration", &val_obj) ) {
 				FactoryConfiguration = json_object_get_int(val_obj);
 			}
@@ -367,7 +367,7 @@ int main(int argc, char *argv[]) {
 				PsuAcInputType = json_object_get_int(val_obj);
 			}
 			strcpy((char *)&ShmSysConfigAndInfo->SysConfig.SystemId,SystemId);
-			ShmSysConfigAndInfo->SysConfig.AcPhaseCount = AcPhaseCount;
+//			ShmSysConfigAndInfo->SysConfig.AcPhaseCount = AcPhaseCount;
 			ShmSysConfigAndInfo->SysInfo.FactoryConfiguration = FactoryConfiguration;
 			ShmSysConfigAndInfo->SysConfig.AuthorisationMode = AuthorisationMode;
 			ShmSysConfigAndInfo->SysConfig.DefaultLanguage = DefaultLanguage;
@@ -637,7 +637,7 @@ int main(int argc, char *argv[]) {
 		if (strcmp(argv[1], "aaa") == 0) {
 			//struct SysConfigData 	SysConfig;
 		//system
-		strcpy((char *)&ShmSysConfigAndInfo->SysConfig.ModelName, "DWLU770100T1P0D");
+		strcpy((char *)&ShmSysConfigAndInfo->SysConfig.ModelName, "DWLU770111T1P0D");
 		strcpy((char *)&ShmSysConfigAndInfo->SysConfig.SerialNumber, "SerialNumber");
 		strcpy((char *)&ShmSysConfigAndInfo->SysConfig.SystemId, "1234567890");
 		strcpy((char *)&ShmSysConfigAndInfo->SysConfig.SystemDateTime, "2019-12-31 23:59:59");

+ 3 - 3
EVSE/rootfs/var/www/set_charging.php

@@ -69,7 +69,7 @@
 				$SystemStatus1='precharge step 1';
 				break;
 			case 19:
-				$SystemStatus1='single run';
+				$SystemStatus1='update';
 				break;
 			default:
 				$SystemStatus1='unknown';
@@ -136,7 +136,7 @@
 				$SystemStatus2='precharge step 1';
 				break;
 			case 19:
-				$SystemStatus2='single run';
+				$SystemStatus2='update';
 				break;
 			default:
 				$SystemStatus2='unknown';
@@ -203,7 +203,7 @@
 				$SystemStatus3='precharge step 1';
 				break;
 			case 19:
-				$SystemStatus3='single run';
+				$SystemStatus3='update';
 				break;
 			default:
 				$SystemStatus3='unknown';

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

@@ -3,6 +3,18 @@
 	$tag_header = 'set';
 	include 'head.php';
 	$obj = json_decode(trim($output[0]));//var_dump($obj);
+	$AcPhaseCount='';
+	switch ($obj->{'AcPhaseCount'}){
+		case 1:
+			$AcPhaseCount='one phase';
+			break;
+		case 3:
+			$AcPhaseCount='three phase';
+			break;
+		default:
+			$AcPhaseCount='unknown';
+			break;
+	}
 ?>
 <style>
 img {
@@ -66,12 +78,16 @@ img {
 											</div>
 											<!--<input type="hidden" name="SystemDateTime" id="SystemDateTime" value="<?php echo $obj->{'SystemDateTime'};?>">-->
 										</div>
-										<div class="form-group" style="display:<?php echo $am111;?>">
+<?php /*										<div class="form-group" style="display:<?php echo $am111;?>">
 											<label>AcPhaseCount</label>
 											<select class="form-control" id="AcPhaseCount" name="AcPhaseCount">
 												<option value="1" <?php echo $obj->{'AcPhaseCount'}=="1"?"selected":""?>>One phase</option>
 												<option value="3" <?php echo $obj->{'AcPhaseCount'}=="3"?"selected":""?>>Three phase</option>
 											</select>
+										</div>*/?>
+										<div class="form-group" style="display:<?php echo $am111;?>">
+											<label>AcPhaseCount</label>
+											<input type="text" readonly class="form-control" placeholder="<?php echo $AcPhaseCount;?>">
 										</div>
 										<div class="form-group" style="display:<?php echo $am111;?>">
 											<label>Factory Configuration</label>
@@ -360,7 +376,7 @@ img {
 			// POST 參數須使用 send() 發送
 			var data =  "SystemId=" + document.getElementById("SystemId").value+
 						"&SystemDateTime=" + document.getElementById("SystemDateTime").value+
-						"&AcPhaseCount=" + document.getElementById("AcPhaseCount").value+
+//						"&AcPhaseCount=" + document.getElementById("AcPhaseCount").value+
 						"&FactoryConfiguration=" + document.getElementById("FactoryConfiguration").value+
 						"&AuthorisationMode=" + document.getElementById("AuthorisationMode").value+
 						"&DefaultLanguage=" + document.getElementById("DefaultLanguage").value+

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

@@ -20,7 +20,7 @@
 			return false;
 			}
 		}
-		checkValue("AcPhaseCount",1);
+//		checkValue("AcPhaseCount",1);
 		checkValue("FactoryConfiguration",1);
 		checkValue("AuthorisationMode",1);
 		checkValue("DefaultLanguage",2);
@@ -29,7 +29,7 @@
 //		$json = json_decode(file_get_contents("system.txt"), true);
 		$json['SystemId']				= $_POST["SystemId"];
 		$json['SystemDateTime'] 		= $_POST['SystemDateTime'];
-		$json['AcPhaseCount'] 			= $_POST['AcPhaseCount'];
+//		$json['AcPhaseCount'] 			= $_POST['AcPhaseCount'];
 		$json['FactoryConfiguration']	= $_POST['FactoryConfiguration'];
 		$json['AuthorisationMode']	 	= $_POST['AuthorisationMode'];
 		$json['DefaultLanguage']		= $_POST['DefaultLanguage'];