From 0289e2c5349f6b2e8cf41126be7ff31381b3f1d5 Mon Sep 17 00:00:00 2001
From: jinpengyong <jpy123456>
Date: Mon, 19 Oct 2020 14:35:10 +0800
Subject: [PATCH] 多设备单因子数据及其平均值对比
---
src/main/webapp/js/newmoralmap.js | 128 +++++++++++++++++++++++++-----------------
1 files changed, 75 insertions(+), 53 deletions(-)
diff --git a/src/main/webapp/js/newmoralmap.js b/src/main/webapp/js/newmoralmap.js
index b8e706f..bcb1e24 100644
--- a/src/main/webapp/js/newmoralmap.js
+++ b/src/main/webapp/js/newmoralmap.js
@@ -218,7 +218,7 @@
var longitude = 106.638135;
var latitude = 29.709625;
point = new BMap.Point(longitude, latitude);
- }else if("���������" == regoinNames[2]){
+ } else if ("���������" == regoinNames[2]) {
var longitude = 120.332826;
var latitude = 33.772274;
point = new BMap.Point(longitude, latitude);
@@ -399,7 +399,7 @@
var timer = setTimeout(function () {
baiduMap.closeInfoWindow.apply(baiduMap, arguments);
moralMap["_closeInfoWinTimer"] = null;
- }, 1200);
+ }, 500);
moralMap["_closeInfoWinTimer"] = timer;
}
moralMap.clearOverlays = function () {
@@ -948,56 +948,47 @@
}
var mouseOverHandle = option['mouseover'];
moralMarker.addEventListener("mouseover", function () {
- var obj = {};
- obj['methodName'] = 'deliverMac';
- obj['mac'] = option['mac'];
- var objStr = JSON.stringify(obj);
- if (!!window['external'] && !!window['external']['callWin']) {
- window['external'].callWin(objStr);
- } else {
- alert(objStr);
- }
-
moralMap.showSensors = function (jsonData) {
- /* var deviceSensors = jsonData;
- var mac = deviceSensors["mac"];
- if (mac == option['mac']) {*/
+ var deviceSensors = jsonData;
+ var mac = deviceSensors["mac"];
if (!jsonData.hasOwnProperty('mac')) {
infoWindow.setContent("");
infoWindow.redraw();
} else {
- var adressOutHtml = '<div style="min-height:20px;overflow:auto;max-height:480px;font-size: 12px;" onmouseover="moralMap.clearCloseInfoWindow()" onmouseout="moralMap.closeInfoWindow()">';
- var y, m, d, h, mm, s;
- var date = new Date($.now());
- y = 1900 + date.getYear();
- m = "0" + (date.getMonth() + 1);
- d = "0" + date.getDate();
- h = "0" + date.getHours();
- mm = "0" + date.getMinutes();
- s = "0" + date.getSeconds();
- date = y + "-" + m.substring(m.length - 2, m.length) + "-" + d.substring(d.length - 2, d.length) + " " + h.substring(h.length - 2, h.length) + ":" + mm.substring(mm.length - 2, mm.length) + ":" + s.substring(s.length - 2, s.length);
- adressOutHtml += '<p style="height: 18px;line-height: 18px">' + "��������� " + date + " </p>";
- for (var prop in jsonData) {
- if (jsonData.hasOwnProperty(prop) && prop != 'ver' && prop != 'methodName' && prop != 'mac' && prop != 'time') {
- for (var key in sensorsDescriptionMap) {
- if (prop == key) {
- var sensorsDescription = sensorsDescriptionMap[key];
- }
- }
- for (var key in sensorsUnitMap) {
- if (prop == key) {
- var sensorsUnit = sensorsUnitMap[key];
- if (sensorsUnit == null) {
- sensorsUnit = "";
+ if (mac == option['mac']) {
+ var adressOutHtml = '<div style="min-height:20px;overflow:auto;max-height:480px;font-size: 12px;" onmouseover="moralMap.clearCloseInfoWindow()" onmouseout="moralMap.closeInfoWindow()">';
+ var y, m, d, h, mm, s;
+ var date = new Date($.now());
+ y = 1900 + date.getYear();
+ m = "0" + (date.getMonth() + 1);
+ d = "0" + date.getDate();
+ h = "0" + date.getHours();
+ mm = "0" + date.getMinutes();
+ s = "0" + date.getSeconds();
+ date = y + "-" + m.substring(m.length - 2, m.length) + "-" + d.substring(d.length - 2, d.length) + " " + h.substring(h.length - 2, h.length) + ":" + mm.substring(mm.length - 2, mm.length) + ":" + s.substring(s.length - 2, s.length);
+ adressOutHtml += '<p style="height: 18px;line-height: 18px">' + "��������� " + date + " </p>";
+ for (var prop in jsonData) {
+ if (jsonData.hasOwnProperty(prop) && prop != 'ver' && prop != 'methodName' && prop != 'mac' && prop != 'time') {
+ for (var key in sensorsDescriptionMap) {
+ if (prop == key) {
+ var sensorsDescription = sensorsDescriptionMap[key];
}
}
+ for (var key in sensorsUnitMap) {
+ if (prop == key) {
+ var sensorsUnit = sensorsUnitMap[key];
+ if (sensorsUnit == null) {
+ sensorsUnit = "";
+ }
+ }
+ }
+ adressOutHtml += ('<p style="height: 18px;line-height: 18px">' + sensorsDescription + "���" + jsonData[prop] + sensorsUnit + "</p>");
}
- adressOutHtml += ('<p style="height: 18px;line-height: 18px">' + sensorsDescription + "���" + jsonData[prop] + sensorsUnit + "</p>");
}
+ adressOutHtml += "</div>";
+ infoWindow.setContent(adressOutHtml);
+ infoWindow.redraw();
}
- adressOutHtml += "</div>";
- infoWindow.setContent(adressOutHtml);
- infoWindow.redraw();
}
}
// }
@@ -1008,14 +999,6 @@
});
moralMarker.addEventListener("mouseout", function () {
- var obj = {};
- obj['methodName'] = 'stopDeliverMac';
- var objStr = JSON.stringify(obj);
- if (!!window['external'] && !!window['external']['callWin']) {
- window['external'].callWin(objStr);
- } else {
- alert(objStr);
- }
moralMap.closeInfoWindow();
});
@@ -1122,15 +1105,15 @@
if (longitude < bounds.northeastLng && longitude > bounds.southwestLng && latitude < bounds.northeastLat && latitude > bounds.southwestLat) {
markers.push(oldmarker);
}
- if("���������"===option["monitorPoint"]["description"]){
+ if ("���������" === option["monitorPoint"]["description"]) {
var icon05 = new BMap.Icon("/img/ico05.png", new BMap.Size(50, 50));
var mark05 = new BMap.Marker(new BMap.Point(option["monitorPoint"]["longitude"], option["monitorPoint"]["latitude"]), {icon: icon05});
markers.push(mark05);
- }else if("���������"===option["monitorPoint"]["description"]){
+ } else if ("���������" === option["monitorPoint"]["description"]) {
var icon06 = new BMap.Icon("/img/ico06.png", new BMap.Size(50, 50));
var mark06 = new BMap.Marker(new BMap.Point(option["monitorPoint"]["longitude"], option["monitorPoint"]["latitude"]), {icon: icon06});
markers.push(mark06);
- }else if("���������"===option["monitorPoint"]["description"]){
+ } else if ("���������" === option["monitorPoint"]["description"]) {
var icon08 = new BMap.Icon("/img/ico08.png", new BMap.Size(50, 50));
var mark08 = new BMap.Marker(new BMap.Point(option["monitorPoint"]["longitude"], option["monitorPoint"]["latitude"]), {icon: icon08});
markers.push(mark08);
@@ -1250,6 +1233,45 @@
}
}
+
+ moralMap.getRoad=function(data,regionCode){
+
+ var wind =data["e23"];
+ var mac=data["mac"];
+ var windSpeed=data["e18"] ;
+ var speedLevel;
+ if (windSpeed >= 0 && windSpeed <= 0.2) {
+ speedLevel = 0;
+ } else if (windSpeed > 0.2 && windSpeed <= 1.5) {
+ speedLevel = 1;
+ } else if (windSpeed > 1.5 && windSpeed <= 3.3) {
+ speedLevel = 2;
+ } else if (windSpeed > 3.3 && windSpeed <= 5.4) {
+ speedLevel = 3;
+ } else if (windSpeed > 5.4 && windSpeed <= 7.9) {
+ speedLevel = 4;
+ } else if (windSpeed > 7.9 && windSpeed <= 10.7) {
+ speedLevel = 5;
+ } else if (windSpeed > 10.7 && windSpeed <= 13.8) {
+ speedLevel = 6;
+ } else if (windSpeed > 13.8 && windSpeed <= 17.1) {
+ speedLevel = 7;
+ } else if (windSpeed > 17.1) {
+ speedLevel = 8;
+ }
+
+ $.ajax({
+ url: "/screen/getAlarm",
+ type: "get",
+ dataType: "json",
+ data:{"windData":wind,"code":regionCode,"mac":mac,"speedLevel":speedLevel},
+ success: function (info) {
+ console.log("---------------"+info);
+ },
+
+ })
+ }
+
moralMap.refreshWindDir = function (devicesInfo) {
var deviceInfo = devicesInfo;
var mac = deviceInfo["mac"];
--
Gitblit v1.8.0