Commit c5b7e788 authored by 史余彬's avatar 史余彬

环境监测大屏显示, 实时数据接口

parent 78c22011
...@@ -180,7 +180,7 @@ ...@@ -180,7 +180,7 @@
var layer = '50'; var layer = '50';
var kqid = 1; var kqid = 1;
$.getJSON('http://192.168.1.3:8080/MineJSON/vzigbee.action?type=8&param=' $.getJSON('http://192.168.1.11:8080/MineJSON/vzigbee.action?type=8&param='
+ rowData.personcode+ '-' + rowData.personcode+ '-'
+ (Date.parse(new Date(starttime)) / 1000)+ '-' + (Date.parse(new Date(starttime)) / 1000)+ '-'
+ (Date.parse(new Date(endtime)) / 1000) + (Date.parse(new Date(endtime)) / 1000)
......
<script type="text/javascript" charset="utf-8"> <script type="text/javascript" charset="utf-8">
window.location.href="http://192.168.1.3:8081/MineEM/tubiao/co2jiance.jsp" window.location.href="http://192.168.1.11:8081/MineEM/tubiao/co2jiance.jsp"
</script> </script>
...@@ -34,6 +34,10 @@ ...@@ -34,6 +34,10 @@
field : 'zduan', field : 'zduan',
width : 50, width : 50,
},{
title : '设备名称',
field : 'zkname',
width : 50,
}, { }, {
title : '站点编号', title : '站点编号',
field : 'sensorname', field : 'sensorname',
......
<script type="text/javascript" charset="utf-8"> <script type="text/javascript" charset="utf-8">
window.location.href="http://192.168.1.3:8081/MineEM/tubiao/cojiance.jsp" window.location.href="http://192.168.1.11:8081/MineEM/tubiao/cojiance.jsp"
</script> </script>
<script type="text/javascript" charset="utf-8"> <script type="text/javascript" charset="utf-8">
window.location.href="http://192.168.1.3:8081/MineEM/tubiao/fengsu.jsp" window.location.href="http://192.168.1.11:8081/MineEM/tubiao/fengsu.jsp"
//window.location.href="http://localhost:8080/MineTRS/tubiao/fengsu.jsp" //window.location.href="http://localhost:8080/MineTRS/tubiao/fengsu.jsp"
</script> </script>
<script type="text/javascript" charset="utf-8"> <script type="text/javascript" charset="utf-8">
window.location.href="http://192.168.1.3:8081/MineEM/tubiao/fengya.jsp" window.location.href="http://192.168.1.11:8081/MineEM/tubiao/fengya.jsp"
//window.location.href="http://localhost:8080/MineTRS/tubiao/fengya.jsp" //window.location.href="http://localhost:8080/MineTRS/tubiao/fengya.jsp"
</script> </script>
<script type="text/javascript" charset="utf-8"> <script type="text/javascript" charset="utf-8">
window.location.href="http://192.168.1.3:8081/MineEM/tubiao/o2jiance.jsp" window.location.href="http://192.168.1.11:8081/MineEM/tubiao/o2jiance.jsp"
</script> </script>
<script type="text/javascript" charset="utf-8"> <script type="text/javascript" charset="utf-8">
window.location.href="http://192.168.1.3:8081/MineEM/tubiao/shidu.jsp" window.location.href="http://192.168.1.11:8081/MineEM/tubiao/shidu.jsp"
//window.location.href="http://localhost:8080/MineTRS/tubiao/fengya.jsp" //window.location.href="http://localhost:8080/MineTRS/tubiao/fengya.jsp"
</script> </script>
<script type="text/javascript" charset="utf-8"> <script type="text/javascript" charset="utf-8">
window.location.href="http://192.168.1.3:8081/MineEM/tubiao/wendu.jsp" window.location.href="http://192.168.1.11:8081/MineEM/tubiao/wendu.jsp"
//window.location.href="http://localhost:8080/MineTRS/tubiao/fengya.jsp" //window.location.href="http://localhost:8080/MineTRS/tubiao/fengya.jsp"
</script> </script>
<!DOCTYPE html>
<html>
<title>环境监测大屏</title>
<head>
<%--<script>window.location.href='http://192.168.1.11:8080/MineTT/jinda/index.html';</script>--%>
<script type="text/javascript" src="${pageContext.request.contextPath}/jslib/jquery-1.8.2.min.js" charset="utf-8"></script>
<script type="text/javascript" charset="utf-8">
$(function() {
window.open("http://192.168.1.11:8080/MineTT/jinda/disscreen.jsp",'top');
})
</script>
</head>
<body>
</body>
</html>
...@@ -2,12 +2,12 @@ ...@@ -2,12 +2,12 @@
<html> <html>
<title>三维动画</title> <title>三维动画</title>
<head> <head>
<%--<script>window.location.href='http://192.168.1.3:8080/MineTT/jinda/index.html';</script>--%> <%--<script>window.location.href='http://192.168.1.11:8080/MineTT/jinda/index.html';</script>--%>
<script type="text/javascript" src="${pageContext.request.contextPath}/jslib/jquery-1.8.2.min.js" charset="utf-8"></script> <script type="text/javascript" src="${pageContext.request.contextPath}/jslib/jquery-1.8.2.min.js" charset="utf-8"></script>
<script type="text/javascript" charset="utf-8"> <script type="text/javascript" charset="utf-8">
$(function() { $(function() {
window.open("http://192.168.1.3:8080/MineTT/jinda/index.html",'top'); window.open("http://192.168.1.11:8080/MineTT/jinda/index.html",'top');
}) })
</script> </script>
......
<xml> <xml>
<InterLink ip="192.168.1.3:8080"> <InterLink ip="192.168.1.11:8080">
</InterLink> </InterLink>
<MachineList> <MachineList>
<machine id="572283213433474205D4FF37" zkname="定位" name="人员定位基站0-1" position="1.22,123.27,13.63" rotation="90,180,0" scale="10,10,10" type="Zigbee" layer="0"/> <machine id="572283213433474205D4FF37" zkname="定位" name="人员定位基站0-1" position="1.22,123.27,13.63" rotation="90,180,0" scale="10,10,10" type="Zigbee" layer="0"/>
...@@ -9,21 +9,25 @@ ...@@ -9,21 +9,25 @@
<machine id="571368313137474205D7FF30" zkname="开停2" name="开停传感器2-2" position="-643.53,-138.4,1184.56" rotation="0,50,0" type="Onoff" scale="100,100,100" layer="2"/> <machine id="571368313137474205D7FF30" zkname="开停2" name="开停传感器2-2" position="-643.53,-138.4,1184.56" rotation="0,50,0" type="Onoff" scale="100,100,100" layer="2"/>
<machine id="571368313137474205D7FF30" zkname="风速" name="风速传感器2-1" position="-753.2,-144.78,1230.19" rotation="0,0,0" type="Fengsu" scale="20,20,20" layer="2"/> <machine id="571368313137474205D7FF30" zkname="风速" name="风速传感器2-1" position="-753.2,-144.78,1230.19" rotation="0,0,0" type="Fengsu" scale="20,20,20" layer="2"/>
<machine id="571368313137474205D7FF30" zkname="压力" name="负压传感器2-1" position="-770.43,-142.28,1225.95" rotation="90,158.4,0" type="Fuya" scale="100,100,100" layer="2"/> <machine id="571368313137474205D7FF30" zkname="压力" name="负压传感器2-1" position="-770.43,-142.28,1225.95" rotation="90,158.4,0" type="Fuya" scale="100,100,100" layer="2"/>
<machine id="571368313137474205D7FF30" zkname="压力" name="负压传感器2-1" position="-763.322,-141.8,1227.975" rotation="90,163.221,0" type="Fuya" scale="10,10,10" layer="2"/>
<machine id="571368313137474205D7FF30" zkname="co-2-1" name="一氧化碳传感器2-1" position="-627.345,-139.9625,1179.59" rotation="90,-42.78363,0" type="Fuya" scale="10,10,10" layer="2"/>
<machine id="572276213433474205D6FF37" zkname="定位" name="人员定位基站4-1" position="105.3,-366,-10.63" rotation="90,0,0" scale="10,10,10" type="Zigbee" layer="4"/> <machine id="572276213433474205D6FF37" zkname="定位" name="人员定位基站4-1" position="105.3,-366,-10.63" rotation="90,0,0" scale="10,10,10" type="Zigbee" layer="4"/>
<machine id="571365313137474205D8FF30" zkname="co" name="一氧化碳传感器4-1" position="263.65,-366.06,-441.41" rotation="90,-79.6,0" type="Co" scale="10,10,10" layer="4"/> <machine id="571365313137474205D8FF30" zkname="co-4-1" name="一氧化碳传感器4-1" position="263.65,-366.06,-441.41" rotation="90,-79.6,0" type="Co" scale="10,10,10" layer="4"/>
<machine id="571365313137474205D8FF30" zkname="co-4-2" name="一氧化碳传感器4-2" position="260.471,-365.886,-501.9611" rotation="90,-98.6,0" type="Co" scale="10,10,10" layer="4"/>
<machine id="572289203433474205D6FF37" zkname="定位" name="人员定位基站5-1" position="108.55,-633.9,-10.71" rotation="90,0,0" scale="10,10,10" type="Zigbee" layer="5"/> <machine id="572289203433474205D6FF37" zkname="定位" name="人员定位基站5-1" position="108.55,-633.9,-10.71" rotation="90,0,0" scale="10,10,10" type="Zigbee" layer="5"/>
<machine id="572253213433474205D5FF37" zkname="定位" name="人员定位基站5-2" position="181.46,-633.87,-804.65" rotation="90,180,0" type="Zigbee" scale="10,10,10" layer="5"/> <machine id="572253213433474205D5FF37" zkname="定位" name="人员定位基站5-2" position="181.46,-633.87,-804.65" rotation="90,180,0" type="Zigbee" scale="10,10,10" layer="5"/>
<machine id="572268433137474205D9FF30" zkname="co" name="一氧化碳传感器5-1" position="281.85,-632.74,-385.03" rotation="90,-90,0" type="Co" scale="10,10,10" layer="5"/> <machine id="572268433137474205D9FF30" zkname="co-5-3" name="一氧化碳传感器5-3" position="281.85,-632.74,-385.03" rotation="90,-90,0" type="Co" scale="10,10,10" layer="5"/>
<machine id="571364313137474205D7FF30" zkname="风速" name="风速传感器5-1" position="197.45,-637.3,-902.05" rotation="0,107,0" type="Fengsu" scale="20,20,20" layer="5"/> <machine id="571364313137474205D7FF30" zkname="风速" name="风速传感器5-1" position="197.45,-637.3,-902.05" rotation="0,107,0" type="Fengsu" scale="20,20,20" layer="5"/>
<machine id="571364313137474205D7FF30" zkname="co" name="一氧化碳传感器5-2" position="186.04,-633.8,-805.03" rotation="90,-180,0" type="Co" scale="10,10,10" layer="5"/> <machine id="571364313137474205D7FF30" zkname="co-5-1" name="一氧化碳传感器5-1" position="186.04,-633.8,-805.03" rotation="90,-180,0" type="Co" scale="10,10,10" layer="5"/>
<machine id="571364313137474205D7FF30" zkname="co2" name="二氧化碳传感器5-1" position="189.781,-633.32,-805.207" rotation="0,-159,0" type="Co2" scale="1,1,1" layer="5"/> <machine id="571364313137474205D7FF30" zkname="co2" name="二氧化碳传感器5-1" position="189.781,-633.32,-805.207" rotation="0,-159,0" type="Co2" scale="1,1,1" layer="5"/>
<machine id="571364313137474205D7FF30" zkname="温度" name="温湿度传感器5-1" position="178.69,-633.6,-805" rotation="0,172.4,0" type="Wendu" scale="1,1,1" layer="5"/> <machine id="571364313137474205D7FF30" zkname="温度" name="温湿度传感器5-1" position="178.69,-633.6,-805" rotation="0,172.4,0" type="Wendu" scale="1,1,1" layer="5"/>
<machine id="571364313137474205D7FF30" zkname="湿度" name="温湿度传感器5-1" position="175.6,-633.6,-806.259" rotation="0,144.6,0" type="Shidu" scale="1,1,1" layer="5"/> <machine id="571364313137474205D7FF30" zkname="湿度" name="温湿度传感器5-1" position="175.6,-633.6,-806.259" rotation="0,144.6,0" type="Shidu" scale="1,1,1" layer="5"/>
<machine id="571364313137474205D7FF30" zkname="o2" name="氧气传感器5-1" position="173.84,-633.73,-809.05" rotation="-90,90,0" type="O2" scale="2,2,2" layer="5"/> <machine id="571364313137474205D7FF30" zkname="o2" name="氧气传感器5-1" position="173.84,-633.73,-809.05" rotation="-90,90,0" type="O2" scale="2,2,2" layer="5"/>
<machine id="571364313137474205D7FF30" zkname="压力" name="气压传感器5-1" position="191.88,-633.07,-808.52" rotation="90,-93.2,0" type="Qiya" scale="100,100,100" layer="5"/> <machine id="571364313137474205D7FF30" zkname="压力" name="气压传感器5-1" position="191.88,-633.07,-808.52" rotation="90,-93.2,0" type="Qiya" scale="100,100,100" layer="5"/>
<machine id="571364313137474205D7FF30" zkname="co-5-2" name="一氧化碳传感器5-2" position="180.48,-633.8,-873.936" rotation="90,3.64,0" type="Co" scale="10,10,10" layer="5"/>
</MachineList> </MachineList>
<BirthPos> <BirthPos>
<pos id="1" machineid="572283213433474205D4FF37" name="地面井口" position="2.6,118.17,-3.5" layer="0"/> <pos id="1" machineid="572283213433474205D4FF37" name="地面井口" position="2.6,118.17,-3.5" layer="0"/>
......
...@@ -5,18 +5,20 @@ ...@@ -5,18 +5,20 @@
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>大屏显示</title> <title>大屏显示</title>
<style type="text/css"> <style type="text/css">
</style> </style>
<link rel="stylesheet" type="text/css" href="../themes/themes/default/easyui.css"> <link rel="stylesheet" type="text/css" href="../themes/themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="../themes/icon.css"> <link rel="stylesheet" type="text/css" href="../themes/icon.css">
<script type="text/javascript" src="../js/jquery-1.7.1.js"></script> <script type="text/javascript" src="../js/jquery-1.7.1.js"></script>
<script type="text/javascript" src="../js/jquery-ui-1.8.20.custom.min.js"></script> <script type="text/javascript" src="../js/jquery-ui-1.8.20.custom.min.js"></script>
<script type="text/javascript" src="../js/highcharts.js"></script> <script type="text/javascript" src="../js/highcharts.js"></script>
<script type="text/javascript" src="../js/highcharts-more.js"></script>
<script type="text/javascript" src="../js/jquery.easyui.min.js"></script> <script type="text/javascript" src="../js/jquery.easyui.min.js"></script>
<script> <script>
/** /**
* 表格数据初始化 * 表格数据初始化
*/ */
function initpolygon1(polygon,title,value1,name) { function initpolygon1(polygon,title,value1,name,min, max) {
$('#'+polygon).highcharts({ $('#'+polygon).highcharts({
chart: { chart: {
type: 'gauge', type: 'gauge',
...@@ -34,7 +36,8 @@ ...@@ -34,7 +36,8 @@
}, },
title: { title: {
text: name+'号传感器实时温度图' text: name+'(传感器)',
style: { "color": "", "fontSize": "18px" }
}, },
pane: [{ pane: [{
...@@ -46,8 +49,8 @@ ...@@ -46,8 +49,8 @@
}], }],
yAxis: [{ yAxis: [{
min: 0, min: min,
max: 85, max: max,
minorTickPosition: 'outside', minorTickPosition: 'outside',
tickPosition: 'outside', tickPosition: 'outside',
labels: { labels: {
...@@ -60,14 +63,14 @@ ...@@ -60,14 +63,14 @@
}], }],
pane: 0, pane: 0,
title: { title: {
text: '<span style="font-size:8px">温度 '+value1.toFixed(2)+'</span><br/>℃', text: '<span style="font-size:8px">' + name + ":" + value1.toFixed(2)+'</span><br/>℃',
y: -40 y: -40
} }
}], }],
tooltip: { tooltip: {
enabled: true, enabled: true,
formatter: function () { formatter: function () {
return '温度' +value1.toFixed(2)+'' return name + '' +value1.toFixed(2)+''
} }
}, },
plotOptions: { plotOptions: {
...@@ -85,7 +88,6 @@ ...@@ -85,7 +88,6 @@
}] }]
}, },
function(chart) { function(chart) {
setInterval(function() { setInterval(function() {
var left = chart.series[0].points[0], var left = chart.series[0].points[0],
...@@ -106,17 +108,85 @@ ...@@ -106,17 +108,85 @@
// 页面加载初始化 // 页面加载初始化
$(function() { $(function() {
$('#tt').tabs({
border: false,
onSelect: function (title) {
$.ajax({ $.ajax({
url: "/MineTT/online!EnvironmentRealTimeData.do?token=laowangzhuanyong", url: "/MineTT/online!EnvironmentRealTimeData.do?token=laowangzhuanyong",
type: "get", type: "get",
success: function(data) { success: function(data) {
console.log(data) changeCharts(title, data)
}
})
}
})
})
/**
* 根据不同的传感器调整图表
*/
function changeCharts(sensorname, data) {
var deviceType = '';
var measureMax;
var measureMin;
if ("氧气" === sensorname) {
deviceType = 'yq';
measureMin = 0;
measureMax = 25;
} else if ("一氧化碳" === sensorname) {
deviceType = 'yyht';
measureMin = 0;
measureMax = 1000;
} else if ("二氧化碳" === sensorname) {
deviceType = 'eyht';
measureMin = 0;
measureMax = 0.5;
} else if ("温度" === sensorname) {
deviceType = 'wd';
measureMin = 0;
measureMax = 80;
} else if ("湿度" === sensorname) {
deviceType = 'sd';
measureMin = 0;
measureMax = 95;
} else if ("压力" === sensorname) {
deviceType = 'yl';
measureMin = 0;
measureMax = 5;
} else if ("风速" === sensorname) {
deviceType = 'fs';
measureMin = 0.4;
measureMax = 15;
}
$("#"+deviceType).empty()
const arrAll = JSON.parse(data);
$.each(arrAll, function(key, val) {
if (sensorname === key) {
$.each(val, function(index, val) {
var ifbj = '';
var color = '';
if (val.ifbj === '0') {
ifbj = '正常'
color = 'black'
} else {
ifbj = '报警'
color = 'red'
} }
$("#"+deviceType).append("<div class='a' style='width: 430px ; height: 49%; float: left;margin-top: 20px; margin-left: 20px; border:1px solid #5896f3'>" +
"<div id='" + deviceType + index + "' style='width: 98%;height: 49%' class='chart1'>正在刷新 ,请稍后.." +
"<img alt='请稍候' src='../themes/azure/images/progressBar/progressBar_l.gif'>" +
"</div> </br>" +
"<p style='font-size: 15px; margin-left: 10px; margin-top: -10px'>设备号: " + val.sensorname +"</p></br>" +
"<p style='font-size: 15px; margin-left: 10px; margin-top: -10px'>中断: " + val.zduan +"</p></br>" +
"<p style='font-size: 15px; margin-left: 10px; margin-top: -10px'>时间: " + val.jctime +"</p></br>" +
"<p style='font-size: 15px; margin-left: 10px; margin-top: -10px';color: " + color + "'>报警: " + ifbj + "</p></br>" +
"</div>")
initpolygon1(deviceType+index, sensorname, val.value2, sensorname, measureMin, measureMax)
}) })
for (var i = 0 ; i < 10 ; i++) {
$("#wd").append("<div style='width: 400px; height: 200px; float: left;margin-top: 20px; margin-left: 20px; border:1px solid #5896f3'></div>")
} }
}) })
}
</script> </script>
</head> </head>
...@@ -124,26 +194,26 @@ ...@@ -124,26 +194,26 @@
<body> <body>
<div id="tt" class="easyui-tabs" style="width:auto;height:auto;"> <div id="tt" class="easyui-tabs" style="width:auto;height:auto;">
<div id="wd" title="温度" style="padding:20px;"> <div id="yq" title="氧气" data-options="iconCls:'icon-reload',closable:true" style="padding:20px">
</div> </div>
<div title="湿度" data-options="closable:true" style="overflow:auto;padding:20px;display:none;"> <div id="yyht" title="一氧化碳" data-options="iconCls:'icon-reload',closable:true" style="padding:20px;">
湿度
</div> </div>
<div title="风速" data-options="iconCls:'icon-reload',closable:true" style="padding:20px;display:none;"> <div id="eyht" title="二氧化碳" data-options="iconCls:'icon-reload',closable:true" style="padding:20px;">
风速
</div> </div>
<div title="压力" data-options="iconCls:'icon-reload',closable:true" style="padding:20px;display:none;"> <div id="wd" title="温度" data-options="iconCls:'icon-reload',closable:true" style="padding:20px;">
压力
</div> </div>
<div title="一氧化碳" data-options="iconCls:'icon-reload',closable:true" style="padding:20px;display:none;"> <div id="sd" title="湿度" data-options="iconCls:'icon-reload',closable:true" style="padding:20px;">
一氧化碳
</div> </div>
<div title="二氧化碳" data-options="iconCls:'icon-reload',closable:true" style="padding:20px;display:none;"> <div id="fs" title="风速" data-options="iconCls:'icon-reload',closable:true" style="padding:20px;">
二氧化碳
</div> </div>
<div title="氧气" data-options="iconCls:'icon-reload',closable:true" style="padding:20px;display:none;"> <div id="yl" title="压力" data-options="iconCls:'icon-reload',closable:true" style="padding:20px;">
氧气
</div> </div>
</div> </div>
......
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment