<%@ page contentType="text/html;charset=UTF-8"%>
|
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
|
<%@ taglib prefix="tags" tagdir="/WEB-INF/tags"%>
|
|
<c:set var="ctx" value="${pageContext.request.contextPath}" />
|
<html>
|
<head>
|
<title>玻璃识别</title>
|
<script type="text/javascript" src="${ctx}/static/AdminLTE/bower_components/jquery/dist/jquery.min.js"></script>
|
<script type="text/javascript">
|
$(function() {
|
//websocket-------------------------start
|
var websocket = null;
|
|
if ('WebSocket' in window) {
|
websocket = new WebSocket("ws://localhost:8080/gmms2/celiangWebsocket");
|
}else {
|
alert('Current Browser Not support websocket')
|
}
|
|
websocket.onerror = function() {
|
console.error('websocket error!');
|
}
|
|
websocket.onopen = function () {
|
console.info('websocket connected!');
|
}
|
|
websocket.onmessage = function (event) {
|
console.log(event.data);
|
if (event.data=="SENDING_GLASS") {
|
window.location.reload();
|
var machineId = $(".state").attr("name");
|
$.ajax({
|
dataType:"json",
|
url : '${ctx}/celiangMachine/getReturnHtml/' + machineId,
|
type:"GET",
|
success : function(returnData){
|
/* var pId = returnData.pId;
|
var pActualLength = returnData.pActualLength;
|
var pActualWidth = returnData.pActualWidth;
|
var pState = returnData.pState;
|
var allCompletePieces = returnData.allCompletePieces;
|
var totolPieces = returnData.totolPieces;
|
var process = returnData.process;
|
//当processGlass为空时,下面的值都为空
|
var cBatch = returnData.cBatch;
|
var cCompletePieces = returnData.cCompletePieces;
|
var cPieces = returnData.cPieces;
|
var pColor = returnData.pColor;
|
var pGlassLength = returnData.pGlassLength;
|
var pGlassWidth = returnData.pGlassWidth;
|
//每当发送一次刷新请求,这些字段都有可能变化,所以就让他们异步刷新
|
$('#table_td_p').text(pState);
|
$('#pActualLength').text(pActualLength);
|
$('#pActualWidth').text(pActualWidth);
|
$('#pGlassLength').text(pGlassLength);
|
$('#pGlassWidth').text(pGlassWidth);
|
$('#process').attr('style','width:process;'); */
|
}
|
})
|
}
|
}
|
|
websocket.onclose = function () {
|
console.info('websocket closed!')
|
}
|
|
function closeWebSocket() {
|
websocket.close();
|
}
|
|
window.onbeforeunload = function () {
|
closeWebSocket();
|
}
|
|
//websocket------------------------end
|
|
|
/* var interval = setInterval('refreshStatus()', 1500); */
|
// 设备页面自动刷新
|
function refreshStatus() {
|
window.location.reload();
|
}
|
|
// 停止页面自动刷新
|
/* function disableAutoRefresh() {
|
clearInterval(interval);
|
} */
|
|
function setRange() {
|
disableAutoRefresh();
|
$('#modifyRangeModal').modal('toggle');
|
}
|
|
function setdata() {
|
disableAutoRefresh();
|
$('#modifyRangeModal1').modal('toggle');
|
}
|
|
var $state = $(".state").val();
|
var $machineId = $(".state").attr("name");
|
if ($state.trim() == "true") {
|
$.messager
|
.alert(
|
"警告信息",
|
"当前玻璃长度大于2500mm!",
|
"warning",
|
function() {
|
//发送ajax请求
|
$.ajax({
|
url : '${ctx}/identifymachine/warn?ajax=true&machineId='
|
+ $machineId,
|
success : function(data) {
|
}
|
});
|
});
|
}
|
|
var tiemer = "";
|
var time = 4000;//每次点击四秒后才能再次点击
|
var fun = function bClick(){
|
$("#finish").unbind("click");
|
tiemer = setTimeout(function(){
|
$("#finish").click(fun);
|
},time);
|
};
|
$("#finish").click(fun);
|
})
|
</script>
|
</head>
|
<body>
|
<div class="content-wrapper">
|
<fieldset>
|
<legend>${identifyMachineHtml}</legend>
|
${identifymodifyhtml}
|
<input type="hidden" class="state" name="${machineId}">
|
<table class="table table-bordered table-hover">
|
<tr>
|
<td>
|
<table class="table table-bordered table-hover">
|
<tr>
|
<th width="15%">测量进度<br>
|
<a href="${ctx}/celiangMachine/detail/${machineId}">查看详情</a>
|
</th>
|
<td>
|
<div class="progress progress-striped active">
|
<div id="process" class="bar" style="width: ${progress};"></div>
|
</div>
|
</td>
|
</tr>
|
</table>
|
</td>
|
</tr>
|
<tr>
|
<td>
|
<table class="table table-bordered table-hover">
|
<tbody>
|
<tr class="info">
|
<th width="15%">批次编号</th>
|
<td width="35%" style="font-size: 25px;">${manufactureBatchNumber}</td>
|
<th width="15%">当前玻璃状态</th>
|
<td width="35%" style="font-size: 40px;" ><p id="table_td_p">${preprocessingGlass.state}</p></td>
|
</tr>
|
<tr class="info">
|
<th width="15%">玻璃颜色</th>
|
<td>${color}</td>
|
<th width="15%">玻璃厚度(mm)</th>
|
<td>${thickness}</td>
|
</tr>
|
<tr class="info">
|
<th width="15%">总数量</th>
|
<td style="font-size: 40px;">${totalPieces}</td>
|
<th colspan="2"></th>
|
</tr>
|
<tr class="info">
|
<th width="15%">已测数量</th>
|
<td style="font-size: 40px;"><p id="cCompletePieces">${completePieces}</p></td>
|
<th width="15%">剩余数量</th>
|
<td style="font-size: 40px;"><p id="cPieces">${leftPieces}</p></td>
|
</tr>
|
</tbody>
|
</table>
|
</td>
|
</tr>
|
<tr>
|
<td>
|
<table class="table table-bordered table-hover">
|
<tbody>
|
<tr class="info">
|
<th colspan="4">匹配尺寸</th>
|
</tr>
|
<%-- <tr class="info">
|
<th width="15%">相同规格完成数量</th>
|
<td width="35%" style="font-size: 40px;">${sumCompletePieces}</td>
|
<th width="15%">相同规格总数量</th>
|
<td width="35%" style="font-size: 40px;">${sumPieces}</td>
|
</tr> --%>
|
<tr class="info">
|
<th width="15%">长(mm)</th>
|
<td width="35%" style="font-size: 40px;"><p id="pGlassLength">${matchLength}</p></td>
|
<th width="15%">宽(mm)</th>
|
<td width="35%" style="font-size: 40px;"><p id="pGlassWidth">${matchWidth}</p></td>
|
</tr>
|
<tr class="info">
|
<th colspan="4">实测尺寸</th>
|
</tr>
|
<tr class="info">
|
<th width="15%">长(mm)</th>
|
<td style="font-size: 40px;"><p id="pActualWidth">${preprocessingGlass.actualWidth}</p></td>
|
<th width="15%">宽(mm)</th>
|
<td style="font-size: 40px;"><p id="pActualLength">${preprocessingGlass.actualLength}</p></td>
|
</tr>
|
<!-- <tr class="info">
|
<th>误差范围(mm)</th>
|
<td><a href="#" class="btn" onclick="setRange()">设置</a></td>
|
<th colspan="2"></th>
|
</tr> -->
|
<tr class="info">
|
<th width="15%">测量结果</th>
|
<td colspan="3">${identifyResultHtml}</td>
|
</tr>
|
</tbody>
|
</table>
|
</td>
|
</tr>
|
</table>
|
</fieldset>
|
</div>
|
</body>
|
</html>
|