|
|
@@ -152,10 +152,6 @@
|
|
|
<button type="button" class="mui-btn mui-btn-primary mui-btn-block mui-hidden"
|
|
|
id="Call"></button>
|
|
|
</div>
|
|
|
- <div id="Caches" class="mui-col mui-col-xs-12 client mui-hidden" style="padding-top:10px">
|
|
|
- <button type="button" class="mui-btn mui-btn-primary mui-btn-block"
|
|
|
- id="Cache">缓存工位</button>
|
|
|
- </div>
|
|
|
<div class="mui-col mui-col-xs-12 client" style="padding-top:10px">
|
|
|
<button type="button" class="mui-btn mui-btn-success mui-btn-block mui-hidden"
|
|
|
id="Finish">完成</button>
|
|
|
@@ -205,12 +201,6 @@
|
|
|
site = localStorage.getItem("site");
|
|
|
$("#Call").removeClass("mui-hidden");
|
|
|
$("#Call").html(site);
|
|
|
- if (site == "下料工位") {
|
|
|
- // 缓存工位按钮
|
|
|
- $("#Caches").removeClass("mui-hidden")
|
|
|
- } else {
|
|
|
- $("#Caches").addClass("mui-hidden")
|
|
|
- }
|
|
|
}
|
|
|
AcceptId = localStorage.getItem("AcceptId")
|
|
|
$("#Finish").attr("disabled", true);
|
|
|
@@ -227,35 +217,15 @@
|
|
|
DoneTermTask(agvid, AcceptId, function(d) {
|
|
|
if (d == "ok") {
|
|
|
mui.toast("任务发送成功...")
|
|
|
+ } else if (d == "lock") {
|
|
|
+ mui.toast("任务执行中,请稍后重试...")
|
|
|
} else {
|
|
|
- if (d == "") {
|
|
|
- if (msgAcceptId === AcceptId) {
|
|
|
- mui.toast("当前工位任务执行中...")
|
|
|
- }
|
|
|
- if (msgAcceptId == (AcceptId - 1)) {
|
|
|
- mui.toast("前序工位任务执行中...")
|
|
|
- }
|
|
|
- }
|
|
|
mui.toast("请稍后重试...")
|
|
|
}
|
|
|
})
|
|
|
})
|
|
|
-
|
|
|
- //缓存工位
|
|
|
- $("#Cache").click(function() {
|
|
|
- let from, to;
|
|
|
- from = 3;
|
|
|
- to = 4;
|
|
|
- AddTermTask(agvid, AcceptId, from, to, function(d) {
|
|
|
- if (d == "ok") {
|
|
|
- mui.toast("任务发送成功...")
|
|
|
- } else {
|
|
|
- mui.toast("请稍后重试...")
|
|
|
- }
|
|
|
- })
|
|
|
- });
|
|
|
-
|
|
|
- //上下箱工位、清扫工位、下料工位
|
|
|
+
|
|
|
+ //上下箱工位、清扫工位、下料工位、缓存工位
|
|
|
$("#Call").click(function() {
|
|
|
let from, to;
|
|
|
if (site === "上下箱工位") {
|
|
|
@@ -270,11 +240,16 @@
|
|
|
from = 2;
|
|
|
to = 3;
|
|
|
}
|
|
|
+ if (site === "缓存工位") {
|
|
|
+ from = 3;
|
|
|
+ to = 4;
|
|
|
+ }
|
|
|
AddTermTask(agvid, AcceptId, from, to, function(d) {
|
|
|
if (d == "ok") {
|
|
|
mui.toast("任务发送成功...")
|
|
|
+ } else if (d == "lock") {
|
|
|
+ mui.toast("任务执行中,请稍后重试...")
|
|
|
} else {
|
|
|
-
|
|
|
mui.toast("请稍后重试...")
|
|
|
}
|
|
|
})
|
|
|
@@ -324,12 +299,12 @@
|
|
|
$("#Finish").attr("disabled", true);
|
|
|
}
|
|
|
if ((msgAcceptId == 1 && AcceptId == 2) || (msgAcceptId == 2 && AcceptId == 3) || (msgAcceptId ==
|
|
|
- 3 && AcceptId == 1)) {
|
|
|
+ 3 && AcceptId == 4) || (msgAcceptId == 4 && AcceptId == 1)) {
|
|
|
$("#status").html("工作中", +msgAcceptId);
|
|
|
- document.getElementById("workstatus").style.backgroundColor = "red"; // "#9C9C9C" ;// ;
|
|
|
+ document.getElementById("workstatus").style.backgroundColor = "red"; // "#9C9C9C" ;
|
|
|
} else {
|
|
|
$("#status").html("未工作");
|
|
|
- document.getElementById("workstatus").style.backgroundColor = "green"; // "#9C9C9C" ;//
|
|
|
+ document.getElementById("workstatus").style.backgroundColor = "green"; // "#9C9C9C" ;
|
|
|
}
|
|
|
break;
|
|
|
//读取设置状态,可以获得电池伏数
|