浏览代码

2021-09-24 / ct_chen

Actions:
1. MaxChargingCurrent of AC must >= 6; add gun type "H" & "A" into GBT; add "DB" series following "DO"; fix version of gun type in "DO" series

Files:
1. EVSE/Modularization/WebService.c
   EVSE/rootfs/var/www/set_charging.php
   EVSE/rootfs/var/www/set_charging_action.php
   EVSE/rootfs/var/www/set_system.php
ct_chen 3 年之前
父节点
当前提交
e2fffecf64

+ 5 - 5
EVSE/Modularization/WebService.c

@@ -1399,7 +1399,7 @@ int main(int argc, char *argv[]) {
 				PsuQuantity = RatedPower/30;
 			}
 		}
-		if(strcmp(IsDO, "DO") == 0 || strcmp(IsDO, "DK") == 0){
+		if(strcmp(IsDO, "DO") == 0 || strcmp(IsDO, "DK") == 0 || strcmp(IsDO, "DB") == 0){
 		}
 		
 		struct json_object *jobj1;
@@ -1726,7 +1726,7 @@ int main(int argc, char *argv[]) {
 				json_object_array_add(FwSecondVersionArr,FwSecondVersion[i]);
 			}
 		}
-		if(strcmp(IsDO, "DO") == 0 || strcmp(IsDO, "DK") == 0){
+		if(strcmp(IsDO, "DO") == 0 || strcmp(IsDO, "DK") == 0 || strcmp(IsDO, "DB") == 0){
 			if(ShmSysConfigAndInfo->SysInfo.DispenserInfo.DispenserQuantity>4 || ShmSysConfigAndInfo->SysInfo.DispenserInfo.DispenserQuantity<0)ShmSysConfigAndInfo->SysInfo.DispenserInfo.DispenserQuantity=0;
 			DispenserQuantity = json_object_new_int(ShmSysConfigAndInfo->SysInfo.DispenserInfo.DispenserQuantity);
 			TotalConnectorQuantity = json_object_new_int(ShmSysConfigAndInfo->SysInfo.DispenserInfo.TotalConnectorQuantity);
@@ -2235,7 +2235,7 @@ int main(int argc, char *argv[]) {
 				AcGunQty++;
 			}
 		}
-		if(strcmp(IsDO, "DO") == 0 || strcmp(IsDO, "DK") == 0){
+		if(strcmp(IsDO, "DO") == 0 || strcmp(IsDO, "DK") == 0 || strcmp(IsDO, "DB") == 0){
 			if(ShmSysConfigAndInfo->SysInfo.DispenserInfo.TotalConnectorQuantity>4 || ShmSysConfigAndInfo->SysInfo.DispenserInfo.TotalConnectorQuantity<0)ShmSysConfigAndInfo->SysInfo.DispenserInfo.TotalConnectorQuantity=0;
 			int DDTotalConnectorQuantity = ShmSysConfigAndInfo->SysInfo.DispenserInfo.TotalConnectorQuantity;
 			for(int i=0;i<DDTotalConnectorQuantity;i++){
@@ -2394,7 +2394,7 @@ int main(int argc, char *argv[]) {
 			json_object_object_add(jobj1,"FwPrimaryVersion",FwPrimaryVersionArr);
 			json_object_object_add(jobj1,"FwSecondVersion",FwSecondVersionArr);
 		}
-		if(strcmp(IsDO, "DO") == 0 || strcmp(IsDO, "DK") == 0){
+		if(strcmp(IsDO, "DO") == 0 || strcmp(IsDO, "DK") == 0 || strcmp(IsDO, "DB") == 0){
 			json_object_object_add(jobj1,"DispenserQuantity",DispenserQuantity);
 			json_object_object_add(jobj1,"TotalConnectorQuantity",TotalConnectorQuantity);
 			json_object_object_add(jobj1,"DDModelName",DDModelNameArr);
@@ -2587,7 +2587,7 @@ int main(int argc, char *argv[]) {
 			}
 			json_object_object_add(jobj2,"ChargingInfo3",ChargingInfo3);
 		}
-		if(strcmp(IsDO, "DO") == 0 || strcmp(IsDO, "DK") == 0){
+		if(strcmp(IsDO, "DO") == 0 || strcmp(IsDO, "DK") == 0 || strcmp(IsDO, "DB") == 0){
 			if(ShmSysConfigAndInfo->SysInfo.DispenserInfo.TotalConnectorQuantity>4|| ShmSysConfigAndInfo->SysInfo.DispenserInfo.TotalConnectorQuantity<0)ShmSysConfigAndInfo->SysInfo.DispenserInfo.TotalConnectorQuantity=0;
 			int DDTotalConnectorQuantity = ShmSysConfigAndInfo->SysInfo.DispenserInfo.TotalConnectorQuantity;
 			DDChargingInfo1=json_object_new_object();

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

@@ -11,7 +11,7 @@
 	$Connector1=substr($ModelName,7,1);
 	$Connector2=substr($ModelName,9,1);
 	$Connector3=substr($ModelName,8,1);
-	if(substr($ModelName,0,2)!="DO" && substr($ModelName,0,2)!="DK"){
+	if(substr($ModelName,0,2)!="DO" && substr($ModelName,0,2)!="DK" && substr($ModelName,0,2)!="DB"){
 		$connectorType1=ConnectorType($Connector1);
 		$connectorType2=ConnectorType($Connector2);
 		$connectorType3=ConnectorType($Connector3);
@@ -495,7 +495,7 @@
 		else if($connector == "U" || $connector == "V" || $connector == "E" || $connector == "F" || $connector == "T" || $connector == "D" || $connector == "M" || $connector == "N" || $connector == "P" || $connector == "R"){
 			$result= "CCS";
 		}
-		else if($connector == "G" || $connector == "B"){
+		else if($connector == "G" || $connector == "B" || $connector == "H" || $connector == "A"){
 			$result= "GB";
 		}
 		else if($connector == "J" || $connector == "K"){
@@ -942,7 +942,7 @@ CORE STYLES ABOVE - NO TOUCHY
 										</div>*/?>
 									</section>
 								</article>
-<?php if(substr($ModelName,0,2)=="DO" || substr($ModelName,0,2)=="DK"){?>
+<?php if(substr($ModelName,0,2)=="DO" || substr($ModelName,0,2)=="DK" || substr($ModelName,0,2)=="DB"){?>
 <?php if($obj['DDChargingInfo1']){ $idx++;?>
 								<!--Charging Information-->
 								<article class="envor-sorting-item css">
@@ -2456,6 +2456,12 @@ CORE STYLES ABOVE - NO TOUCHY
 			return false;
 		}
 		
+		if(document.getElementById("ModelName").value.substr(0,1)=="A" && MaxChargingCurrent < 6)
+		{
+			alert("MaxChargingCurrent must > 6!");
+			document.getElementById("MaxChargingCurrent").focus();
+			return false;
+		}
 		return true;
 	}
 	function isBilling_clicked(){

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

@@ -28,6 +28,13 @@
 		checkMaxValue("AcMaxChargingCurrent");
 		checkMaxValue("MaxChargingDuration");
 		checkValue("StopChargingByButton");
+		if(substr($_POST['ModelName'],0,1)=="A" && $_POST['MaxChargingCurrent']<6){
+			$jsone['result'] = "Fail";
+			$jsone['message'] = "MaxChargingCurrent must > 6";
+			echo json_encode($jsone);
+			exit;
+		}
+
 		if(isset($_POST['MaxChargingEnergy'])){
 			$json['MaxChargingEnergy']			= (int)$_POST['MaxChargingEnergy'];
 		}

+ 13 - 7
EVSE/rootfs/var/www/set_system.php

@@ -23,6 +23,12 @@
 	$connectorType1=ConnectorType($Connector1);
 	$connectorType2=ConnectorType($Connector2);
 	$connectorType3=ConnectorType($Connector3);
+	if(substr($ModelName,0,2)=="DO" || substr($ModelName,0,2)=="DK" || substr($ModelName,0,2)=="DB"){
+		for($idx=0;$idx<$obj->{'DispenserQuantity'};$idx++){
+			$DDconnectorType1[$idx]=ConnectorType(substr($obj->{'DDModelName'}[$idx],7,1));
+			$DDconnectorType2[$idx]=ConnectorType(substr($obj->{'DDModelName'}[$idx],9,1));
+		}
+	}
 	$IsAcDc = substr($ModelName,0,1);
 	$PsuQuantity = 0;
 	if($IsAcDc == "D"){
@@ -38,7 +44,7 @@
 		else if($connector == "U" || $connector == "V" || $connector == "E" || $connector == "F" || $connector == "T" || $connector == "D" || $connector == "M" || $connector == "N" || $connector == "P" || $connector == "R"){
 			$result= "CCS";
 		}
-		else if($connector == "G" || $connector == "B"){
+		else if($connector == "G" || $connector == "B" || $connector == "H" || $connector == "A"){
 			$result= "GB";
 		}
 		else if($connector == "J" || $connector == "K"){
@@ -214,7 +220,7 @@ img {
 												<option value="2" <?php echo $obj->{'Intensity'}=="2"?"selected":""?>>Brightest</option>
 											</select>
 										</div>
-<?php if(substr($ModelName,0,2)=="DO" || substr($ModelName,0,2)=="DK"){?>
+<?php if(substr($ModelName,0,2)=="DO" || substr($ModelName,0,2)=="DK" || substr($ModelName,0,2)=="DB"){?>
 										<div class="form-group">
 											<label>Dispenser Quantity</label>
 											<input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'DispenserQuantity'};?>">
@@ -273,7 +279,7 @@ img {
 											<input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'RelayModuleFwRev'};?>">
 											<input type="hidden" name="RelayModuleFwRev" id="RelayModuleFwRev" value="<?php echo $obj->{'RelayModuleFwRev'};?>">
 										</div>
-<?php if(substr($ModelName,0,2)=="DO" || substr($ModelName,0,2)=="DK"){?>
+<?php if(substr($ModelName,0,2)=="DO" || substr($ModelName,0,2)=="DK" || substr($ModelName,0,2)=="DB"){?>
 										<div class="form-group" style="display:<?php echo $am001;?>">
 											<label>Relay2 Module Fw Rev</label>
 											<input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'Relay2ModuleFwRev'};?>">
@@ -302,7 +308,7 @@ img {
 										</div>
 									</section>
 								</article>
-<?php if(substr($ModelName,0,2)=="DO" || substr($ModelName,0,2)=="DK"){?>
+<?php if(substr($ModelName,0,2)=="DO" || substr($ModelName,0,2)=="DK" || substr($ModelName,0,2)=="DB"){?>
 <?php for($idx=0;$idx<$obj->{'DispenserQuantity'};$idx++){ $idx2=$idx+1;?>
 								<article class="envor-sorting-item css">
 									<header><?php echo $lang->showWord("system_information"); ?> Dispenser <?php echo $idx2;?><i class="fa fa-plus"></i></header>
@@ -354,11 +360,11 @@ img {
 											<input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'DDTelcomModemFwRev'}[$idx];?>">
 										</div>
 										<div class="form-group">
-											<label>Connector1(<?php echo $DDconnectorType1;?>) Fw Rev</label>
+											<label>Connector1(<?php echo $DDconnectorType1[$idx];?>) Fw Rev</label>
 											<input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'DDConnector1FwRev'}[$idx];?>">
 										</div>
 										<div class="form-group" id="DDConnector2FwRevDiv">
-											<label>Connector2(<?php echo $DDconnectorType2;?>) Fw Rev</label>
+											<label>Connector2(<?php echo $DDconnectorType2[$idx];?>) Fw Rev</label>
 											<input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'DDConnector2FwRev'}[$idx];?>">
 										</div>
 										<div class="form-group">
@@ -436,7 +442,7 @@ img {
 						"&RfidCardNumEndian=" + document.getElementById("RfidCardNumEndian").value+
 						"&PsuAcInputType=" + document.getElementById("PsuAcInputType").value;
 
-<?php if(substr($ModelName,0,2)=="DO" || substr($ModelName,0,2)=="DK"){?>
+<?php if(substr($ModelName,0,2)=="DO" || substr($ModelName,0,2)=="DK" || substr($ModelName,0,2)=="DB"){?>
 <?php for($idx=0;$idx<$obj->{'DispenserQuantity'};$idx++){ $idx2=$idx+1;?>
 				data +=  "&DDSystemId<?php echo $idx2; ?>=" + document.getElementById("DDSystemId<?php echo $idx2; ?>").value;
 <?php }} ?>