Browse Source

页面更新

wcs 5 years ago
parent
commit
a6509aefc4
2 changed files with 34 additions and 21 deletions
  1. BIN
      images/battery-0.png
  2. 34 21
      index.html

BIN
images/battery-0.png


+ 34 - 21
index.html

@@ -58,7 +58,7 @@
 					<div id="run" style="width: 28%;height: 40px;line-height:40px;float: left;margin-left: 5px;background: url(img/btn4_bg.png);color: #FFFFFF;text-align: center;">运行</div>
 					<div id="warning" style="width: 28%;height: 40px;line-height:40px;float: left;margin-left: 5px;background: url(img/btn4_bg.png);color: #FFFFFF;text-align: center;">注意</div>
 				</div>
-				<div id="info" style="width: 87%;height: 30px;margin-left: 25px;color:#ccc;font-size:4px;line-height: 30px;background-color: #0b6d78;border-radius: 3px;text-align: left;padding-left: 5px;"></div>
+				<div id="info" style="width: 87%;height: 30px;margin-left: 25px;color:#fff;font-size:15px;line-height: 30px;background-color: #0b6d78;border-radius: 3px;text-align: center;padding-left: 5px;"></div>
 				<div class="mui-content-padded" style="background: url(img/btlist5_bg.png) no-repeat 10px 0;margin-top: 15px;width: 100%;height: auto;">
 					<div class="mui-row">
 						<div class="mui-col mui-col-xs-12" id="btlist" style="padding-top:10px;min-height:195px;overflow-y:auto;max-height:195px"></div>
@@ -199,7 +199,7 @@
 			$("div[id='btlist']").find(".up").each(function(evt){
 			    to = parseInt(($(this).context).id);
 			});
-			SendCmd(AgvId, msgTypeToStation, {"Stn":to}, function(d) {
+			SendCmd(agvid, msgTypeToStation, {"Stn":to}, function(d) {
 			    console.log("AddTransTask", d);
 				 Reset()
 			})
@@ -213,24 +213,24 @@
 			$("div[id='btlist']").find(".down").each(function(evt) {
 				bt_value.push($(this).val());
 			});
-			AddTransTask(AgvId, bt_value[0], bt_value[1], function(d) {
+			AddTransTask(agvid, bt_value[0], bt_value[1], function(d) {
 		        //console.log("AddTransTask", d);
 		        Reset()
 		    })
 		});
 		
-		function AddTransTask(agvId, from, to, callback){
+		function AddTransTask(agvid, from, to, callback){
 		    $.post(url+"/task", {
-		        id:agvId,
+		        id:agvid,
 		        from: from,
 		        to: to
 		    }, callback);
 		};
-		function SendCmd(agvId, cmd, opt, func) {
+		function SendCmd(agvid, cmd, opt, func) {
 		    let param = {"t":cmd};
 		    opt = _.extend(param, opt);
 		    //console.log("param", opt);
-		    $.post(url+"/agv/SendString/" + agvId,
+		    $.post(url+"/agv/SendString/" + agvid,
 		        JSON.stringify(opt),
 		        func
 		    );
@@ -341,23 +341,34 @@
 				}
 				//停止运行注意按钮及信息提示框
 				if (k == "Status") {
+					if (v == "0") {
+						$("#info").text("未设置");
+					}
 					if (v == "1") {
-						$("#info").text("未设置状态");
+						$("#info").text("就绪");
 					}
 					if (v == "2") {
+							$("#info").text("运行");
 						document.getElementById("run").style.backgroundImage = "url('img/btn2_bg.png')";
+					} else {
+						document.getElementById("run").style.backgroundImage = "url('img/btn4_bg.png')";
 					}
 					if (v == "3" || v == "4" || v == "9") {
 						if (v == "3") {
-							$("#info").text("停止状态");
+							$("#info").text("停止");
 						}
 						if (v == "4") {
-							$("#info").text("急停按钮急停状态");
+							$("#info").text("急停");
+						}
+						if (v == "5") {
+							$("#info").text("刹车");
 						}
 						if (v == "9") {
-							$("#info").text("手动控制状态");
+							$("#info").text("手动控制");
 						}
 						document.getElementById("stop").style.backgroundImage = "url('img/btn3_bg.png')";
+					} else {
+						document.getElementById("stop").style.backgroundImage = "url('img/btn4_bg.png')";
 					}
 					if (v == "6") {
 						$("#info").text("驱动器错误");
@@ -370,36 +381,38 @@
 					}
 					if (v == "11" || v == "22") {
 						if (v == "11") {
-							$("#info").text("遇到障碍物停止");
+							$("#info").text("前方障碍");
 						}
 						if (v == "22") {
-							$("#info").text("车辆遇到障碍物靠近");
+							$("#info").text("障碍减速");
 						}
 						document.getElementById("warning").style.backgroundImage = "url('img/btn1_bg.png')";
+					} else {
+						document.getElementById("warning").style.backgroundImage = "url('img/btn4_bg.png')";
 					}
 					if (v == "12") {
-						$("#info").text("防撞条紧急停止");
+						$("#info").text("防撞停止");
 					}
 					if (v == "15") {
-						$("#info").text("电压低");
+						$("#info").text("低电压停止");
 					}
 					if (v == "21") {
-						$("#info").text("车辆低电压运行");
+						$("#info").text("低电压运行");
 					}
 					if (v == "31") {
-						$("#info").text("正方向磁导航脱线");
+						$("#info").text("前磁导脱航");
 					}
 					if (v == "32") {
-						$("#info").text("反方向磁导航脱线");
+						$("#info").text("反磁导航");
 					}
 					if (v == "33") {
-						$("#info").text("正方向磁导航脱线");
+						$("#info").text("左磁导脱航");
 					}
 					if (v == "34") {
-						$("#info").text("反方向磁导航脱线");
+						$("#info").text("右磁导脱航");
 					}
 					if (v == "71" || v == "72" || v == "73") {
-						$("#info").text("取货物时举升不为空");
+						$("#info").text("取货失败");
 					}
 				}
 			}