| | |
| | | <script type="text/javascript" src="../static/js/common.js"></script> |
| | | <script type="text/javascript" src="../static/js/layer/layer.js"></script> |
| | | <style> |
| | | .demoBtn { |
| | | vertical-align: middle; |
| | | width: 20%; |
| | | height: 25px; |
| | | left: 0; |
| | | top: 0; |
| | | text-shadow: inherit; |
| | | font-size: 15px; |
| | | margin-left: 5px; |
| | | margin-right: 5px; |
| | | display: inline-block; |
| | | background-color: #FF5722; |
| | | border: none; |
| | | color: #FFF; |
| | | box-shadow: 1px 1px 5px #B6B6B6; |
| | | border-radius: 3px; |
| | | cursor: pointer; |
| | | } |
| | | |
| | | .demoBtn:hover { |
| | | opacity: 0.8 |
| | | } |
| | | .demoBtn:focus { |
| | | outline: 0; |
| | | } |
| | | </style> |
| | | </head> |
| | | <body> |
| | | <!-- 日志监控板 --> |
| | | <div class="log-board"> |
| | | <!-- 执行命令 --> |
| | | |
| | | <!-- 执行命令 --> |
| | | <div class="command-log"> |
| | | <h2>执行中的命令</h2> |
| | | <div class="crn-command-item"> |
| | | <label>1#</label> |
| | | <span> </span> |
| | | <button id="demoBtn-1" class="demoBtn" onclick="demoSwitch(this.id)"> - </button> |
| | | <!-- <span> </span>--> |
| | | <input id="crn1" disabled="disabled"> |
| | | </div> |
| | | <!-- <div class="crn-command-item">--> |
| | | <!-- <label>2#</label>--> |
| | | <!-- <span> </span>--> |
| | | <!-- <input id="crn2" disabled="disabled">--> |
| | | <!-- </div>--> |
| | | <div class="crn-command-item"> |
| | | <label>2#</label> |
| | | <button id="demoBtn-2" class="demoBtn" onclick="demoSwitch(this.id)"> - </button> |
| | | <!-- <span> </span>--> |
| | | <input id="crn2" disabled="disabled"> |
| | | </div> |
| | | </div> |
| | | <!-- 堆垛机状态位信息 --> |
| | | <div class="crn-state"> |
| | |
| | | <thead> |
| | | <tr> |
| | | <th>堆垛机</th> |
| | | <th>任务号</th> |
| | | <th>模式</th> |
| | | <th>状态</th> |
| | | <th>报警</th> |
| | | <th>有物</th> |
| | | <th>列</th> |
| | | <th>层</th> |
| | | <th>伸位高低</th> |
| | | <th>站台高低</th> |
| | | <th>货叉位置</th> |
| | | <th>载货台位置</th> |
| | | <th>垂直故障</th> |
| | | <th>水平故障</th> |
| | | <th>叉牙故障</th> |
| | | <th>状态故障</th> |
| | | </tr> |
| | | </thead> |
| | | <tbody> |
| | |
| | | <th>目标站</th> |
| | | <th>源库位</th> |
| | | <th>目标库位</th> |
| | | <th>走行速度(m/min)</th> |
| | | <th>升降速度(m/min)</th> |
| | | <th>叉牙速度(m/min)</th> |
| | | <th>走行距离(m)</th> |
| | | <th>升降距离(m)</th> |
| | | <th>走行时长(s)</th> |
| | | <th>升降时长(s)</th> |
| | | </tr> |
| | | </thead> |
| | | <tbody> |
| | |
| | | </div> |
| | | <div class="select-container-item"> |
| | | <span>排</span> |
| | | <label><input id="sourceRow" type="number" name="points" min="0" style="background-color: #a9eeff" /></label> |
| | | <label><input id="sourceRow" type="number" name="points" min="1" style="background-color: #a9eeff" value="1" /></label> |
| | | </div> |
| | | <div class="select-container-item"> |
| | | <span>列</span> |
| | | <label><input id="sourceBay" type="number" name="points" min="0" style="background-color: #a9eeff" /></label> |
| | | <label><input id="sourceBay" type="number" name="points" min="0" style="background-color: #a9eeff" value="0" /></label> |
| | | </div> |
| | | <div class="select-container-item"> |
| | | <span>层</span> |
| | | <label><input id="sourceLev" type="number" name="points" min="0" style="background-color: #a9eeff" /></label> |
| | | <label><input id="sourceLev" type="number" name="points" min="1" style="background-color: #a9eeff" value="1" /></label> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | </div> |
| | | <div class="select-container-item"> |
| | | <span>排</span> |
| | | <label><input id="row" type="number" name="points" min="0" style="background-color: #a9eeff" /></label> |
| | | <label><input id="row" type="number" name="points" min="1" style="background-color: #a9eeff" value="1" /></label> |
| | | </div> |
| | | <div class="select-container-item"> |
| | | <span>列</span> |
| | | <label><input id="bay" type="number" name="points" min="0" style="background-color: #a9eeff" /></label> |
| | | <label><input id="bay" type="number" name="points" min="0" style="background-color: #a9eeff" value="0" /></label> |
| | | </div> |
| | | <div class="select-container-item"> |
| | | <span>层</span> |
| | | <label><input id="lev" type="number" name="points" min="0" style="background-color: #a9eeff" /></label> |
| | | <label><input id="lev" type="number" name="points" min="1" style="background-color: #a9eeff" value="1" /></label> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | <button class="item" onclick="take()">出库</button> |
| | | <button class="item" onclick="stockMove()">库位转移</button> |
| | | <button class="item" onclick="siteMove()">站到站</button> |
| | | <button class="item" onclick="coorMove()">坐标移动</button> |
| | | <button class="item" onclick="bacOrigin()">回原点</button> |
| | | <button class="item" onclick="reverseOrigin()">反原点</button> |
| | | <!-- <button class="item" onclick="bacOrigin()">回原点</button>--> |
| | | <!-- <button class="item" onclick="reverseOrigin()">反原点</button>--> |
| | | <!-- <button class="item" onclick="coorMove()">坐标移行</button>--> |
| | | <button class="item" onclick="taskComplete()">任务完成</button> |
| | | <!-- <button class="item" onclick="pause()">暂停</button>--> |
| | | <!-- <button class="item" onclick="boot()">启动</button>--> |
| | |
| | | getCommandLog(); |
| | | },1000); |
| | | setInterval(function () { |
| | | getSiteOutput(); |
| | | getCrnOutput(); |
| | | operatorBlockShow(); |
| | | initDemo(); |
| | | },500); |
| | | |
| | | // 判断手动操作模块是否可用 |
| | |
| | | } else if (res.code === 403) { |
| | | window.location.href = baseUrl + "/login"; |
| | | } else { |
| | | alert(res.msg); |
| | | console.log(res.msg); |
| | | } |
| | | } |
| | | }) |
| | |
| | | for (var i=1;i<=table.length;i++){ |
| | | var tr = tableEl.find("tr").eq(i); |
| | | setVal(tr.children("td").eq(0), table[i-1].crnNo); |
| | | setVal(tr.children("td").eq(1), table[i-1].workNo); |
| | | setVal(tr.children("td").eq(2), table[i-1].statusType); |
| | | setVal(tr.children("td").eq(3), table[i-1].status); |
| | | setVal(tr.children("td").eq(4), table[i-1].warn); |
| | | setVal(tr.children("td").eq(5), table[i-1].loading); |
| | | setVal(tr.children("td").eq(6), table[i-1].bay); |
| | | setVal(tr.children("td").eq(7), table[i-1].lev); |
| | | setVal(tr.children("td").eq(1), table[i-1].statusType); |
| | | setVal(tr.children("td").eq(2), table[i-1].status); |
| | | setVal(tr.children("td").eq(3), table[i-1].loading); |
| | | setVal(tr.children("td").eq(4), table[i-1].bay); |
| | | setVal(tr.children("td").eq(5), table[i-1].lev); |
| | | setVal(tr.children("td").eq(6), table[i-1].liftPos); |
| | | setVal(tr.children("td").eq(7), table[i-1].sitePos); |
| | | setVal(tr.children("td").eq(8), table[i-1].forkOffset); |
| | | setVal(tr.children("td").eq(9), table[i-1].liftPos); |
| | | setVal(tr.children("td").eq(9), table[i-1].alarm1); |
| | | setVal(tr.children("td").eq(10), table[i-1].alarm2); |
| | | setVal(tr.children("td").eq(11), table[i-1].alarm3); |
| | | setVal(tr.children("td").eq(12), table[i-1].alarm4); |
| | | } |
| | | } else if (res.code === 403){ |
| | | window.location.href = baseUrl+"/login"; |
| | | } else { |
| | | alert(res.msg); |
| | | console.log(res.msg); |
| | | } |
| | | } |
| | | }); |
| | |
| | | setVal(tr.children("td").eq(4), table[i-1].staNo); |
| | | setVal(tr.children("td").eq(5), table[i-1].sourceLocNo); |
| | | setVal(tr.children("td").eq(6), table[i-1].locNo); |
| | | setVal(tr.children("td").eq(7), table[i-1].xspeed); |
| | | setVal(tr.children("td").eq(8), table[i-1].yspeed); |
| | | setVal(tr.children("td").eq(9), table[i-1].zspeed); |
| | | setVal(tr.children("td").eq(10), table[i-1].xdistance); |
| | | setVal(tr.children("td").eq(11), table[i-1].ydistance); |
| | | setVal(tr.children("td").eq(12), table[i-1].xduration); |
| | | setVal(tr.children("td").eq(13), table[i-1].yduration); |
| | | } |
| | | } else if (res.code === 403){ |
| | | window.location.href = baseUrl+"/login"; |
| | | } else { |
| | | alert(res.msg); |
| | | console.log(res.msg); |
| | | } |
| | | } |
| | | }); |
| | |
| | | |
| | | // 手动复位 |
| | | function handleReset() { |
| | | http.post(baseUrl+"/crn/operator/clearCommand", getReqParam(), function (res) { |
| | | http.post(baseUrl+"/crn/operator/handleReset", getReqParam(), function (res) { |
| | | layer.msg(res.msg); |
| | | }); |
| | | } |
| | | |
| | | // 输送设备日志输出 ----------------------------------------------------------------------- |
| | | function getSiteOutput() { |
| | | function getCrnOutput() { |
| | | $.ajax({ |
| | | url: baseUrl + "/crn/output/site", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | |
| | | } else if (res.code === 403) { |
| | | window.location.href = baseUrl + "/login"; |
| | | } else { |
| | | alert(res.msg); |
| | | console.log(res.msg); |
| | | } |
| | | } |
| | | }) |
| | |
| | | var html = ""; |
| | | for (var i = 0; i < line; i ++){ |
| | | html += " <tr>\n" + |
| | | " <td></td>\n" + |
| | | " <td></td>\n" + |
| | | " <td></td>\n" + |
| | | " <td></td>\n" + |
| | | " <td></td>\n" + |
| | | " <td></td>\n" + |
| | |
| | | " <td></td>\n" + |
| | | " <td></td>\n" + |
| | | " <td></td>\n" + |
| | | " <td></td>\n" + |
| | | " <td></td>\n" + |
| | | " <td></td>\n" + |
| | | " <td></td>\n" + |
| | | " <td></td>\n" + |
| | | " <td></td>\n" + |
| | | " <td></td>\n" + |
| | | " </tr>\n"; |
| | | } |
| | | $('#crn-msg-table tbody').after(html); |
| | |
| | | crnOutputDom.scrollTop = crnOutputDom.scrollHeight; |
| | | } |
| | | |
| | | |
| | | var crnDemoData; |
| | | function initDemo() { |
| | | $.ajax({ |
| | | url: baseUrl+"/crn/demo/status", |
| | | async: false, |
| | | method: 'GET', |
| | | success: function (res) { |
| | | if (res.code === 200) { |
| | | crnDemoData = res.data; |
| | | crnDemoData.forEach(function (e) { |
| | | $("#demoBtn-"+e.crnNo).html(e.demo?'停止':'演示'); |
| | | }) |
| | | } else if (res.code === 403){ |
| | | parent.location.href = baseUrl+"/login"; |
| | | } else { |
| | | layer.msg(res.msg, {icon: 2}); |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | |
| | | function demoSwitch(el) { |
| | | var crnId = el.split("-")[1]; |
| | | var opt; |
| | | if (crnDemoData == null) { |
| | | initDemo(); |
| | | } |
| | | for (var i = 0; i<crnDemoData.length; i++) { |
| | | if (Number(crnDemoData[i].crnNo) === Number(crnId)) { |
| | | opt = !crnDemoData[i].demo; |
| | | } |
| | | } |
| | | layer.confirm(crnId + ' 号堆垛机确定'+ (opt?'开始':'停止') + '演示吗?', function(){ |
| | | doDemo(crnId, 'root', opt); // 停止wcs系统 |
| | | }); |
| | | } |
| | | |
| | | function doDemo(crnId, password, opt) { |
| | | // 加载tips |
| | | var index = layer.load(1, { |
| | | shade: [0.1,'#fff'] |
| | | }); |
| | | $.ajax({ |
| | | url: baseUrl+ "/crn/demo/switch", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | // async: false, |
| | | data: { |
| | | crnId: Number(crnId), |
| | | password: password, |
| | | opt: opt |
| | | }, |
| | | method: 'POST', |
| | | success: function (res) { |
| | | layer.close(index); |
| | | if (res.code === 200){ |
| | | layer.msg(res.msg, {icon: 1}); |
| | | } else if (res.code === 403){ |
| | | window.location.href = baseUrl+"/login"; |
| | | } else { |
| | | layer.msg(res.msg, {icon: 2}); |
| | | } |
| | | } |
| | | }); |
| | | |
| | | } |
| | | |
| | | </script> |
| | | </html> |