| | |
| | | * 根据mac地址获取version |
| | | */ |
| | | // moralMap.getVersion = function(mac){ |
| | | // var version = null; |
| | | // $.ajax({ |
| | | // type:"get", |
| | | // url:"getversion?mac="+mac, |
| | | // async:false, |
| | | // success:function(jsonData){ |
| | | // if(jsonData!=null&&typeof jsonData=='object'){ |
| | | // version = jsonData['version']; |
| | | // } |
| | | // } |
| | | // }); |
| | | // return version; |
| | | // var version = null; |
| | | // $.ajax({ |
| | | // type:"get", |
| | | // url:"getversion?mac="+mac, |
| | | // async:false, |
| | | // success:function(jsonData){ |
| | | // if(jsonData!=null&&typeof jsonData=='object'){ |
| | | // version = jsonData['version']; |
| | | // } |
| | | // } |
| | | // }); |
| | | // return version; |
| | | // } |
| | | /* |
| | | * 百度地图初始化 |
| | |
| | | moralMap.mapInit = function () { |
| | | var defaultParam = { |
| | | minZoom: 12, |
| | | maxZoom: 20 |
| | | maxZoom: 20, |
| | | enableMapClick: false |
| | | }; |
| | | if (!!arguments[1]) { |
| | | $.extend(defaultParam, arguments[1]); |
| | |
| | | var address = arguments[0]; |
| | | var regoinNames = address.split(" "); |
| | | var cityName = regoinNames.length > 1 ? regoinNames[1] : regoinNames[0]; |
| | | if (cityName == "市辖区" || cityName == "县" || cityName == "省直辖县级行政区划") { |
| | | cityName = regoinNames[2]; |
| | | } |
| | | map.setCurrentCity(cityName); |
| | | // 将地址解析结果显示在地图上,并调整地图视野 |
| | | // 创建地址解析器实例 |
| | | var myGeo = new BMap.Geocoder(); |
| | | myGeo.getPoint(address, function (point) { |
| | | if (point) { |
| | | if ("大同市" == cityName) { |
| | | var longitude = 113.30640743; |
| | | var latitude = 40.08256467; |
| | | point = new BMap.Point(longitude, latitude); |
| | | } else if ("阿拉善盟" == cityName) { |
| | | var longitude = 105.733648; |
| | | var latitude = 38.858951; |
| | | point = new BMap.Point(longitude, latitude); |
| | | } else if ("乌兰察布市" == cityName) { |
| | | var longitude = 113.136019; |
| | | var latitude = 41.001403; |
| | | point = new BMap.Point(longitude, latitude); |
| | | } else if ("宜宾市" == cityName) { |
| | | var longitude = 104.647678; |
| | | var latitude = 28.758767; |
| | | point = new BMap.Point(longitude, latitude); |
| | | } else if ("那曲地区" == cityName) { |
| | | var longitude = 92.056768; |
| | | var latitude = 31.482684; |
| | | point = new BMap.Point(longitude, latitude); |
| | | } else if ("永川区" == cityName) { |
| | | var longitude = 105.930055; |
| | | var latitude = 29.363305; |
| | | point = new BMap.Point(longitude, latitude); |
| | | } else if ("大足区" == cityName) { |
| | | var longitude = 105.727253; |
| | | var latitude = 29.714369; |
| | | point = new BMap.Point(longitude, latitude); |
| | | } else if ("铜梁区" == cityName) { |
| | | var longitude = 106.061728; |
| | | var latitude = 29.852264; |
| | | point = new BMap.Point(longitude, latitude); |
| | | } else if ("綦江区" == cityName) { |
| | | var longitude = 106.654609; |
| | | var latitude = 29.035883; |
| | | point = new BMap.Point(longitude, latitude); |
| | | } else if ("万盛区" == cityName) { |
| | | var longitude = 106.889359; |
| | | var latitude = 28.907664; |
| | | point = new BMap.Point(longitude, latitude); |
| | | } else if ("丰都县" == cityName) { |
| | | var longitude = 107.735181; |
| | | var latitude = 29.869663; |
| | | point = new BMap.Point(longitude, latitude); |
| | | } else if ("垫江县" == cityName) { |
| | | var longitude = 107.336118; |
| | | var latitude = 30.334042; |
| | | point = new BMap.Point(longitude, latitude); |
| | | } else if ("忠县" == cityName) { |
| | | var longitude = 108.04224; |
| | | var latitude = 30.30452; |
| | | point = new BMap.Point(longitude, latitude); |
| | | } else if ("城口县" == cityName) { |
| | | var longitude = 108.671036; |
| | | var latitude = 31.953145; |
| | | point = new BMap.Point(longitude, latitude); |
| | | } else if ("巫溪县" == cityName) { |
| | | var longitude = 109.576402; |
| | | var latitude = 31.40266; |
| | | point = new BMap.Point(longitude, latitude); |
| | | } else if ("巫山县" == cityName) { |
| | | var longitude = 109.879221; |
| | | var latitude = 31.087199; |
| | | point = new BMap.Point(longitude, latitude); |
| | | } else if ("奉节县" == cityName) { |
| | | var longitude = 109.468749; |
| | | var latitude = 31.024849; |
| | | point = new BMap.Point(longitude, latitude); |
| | | } else if ("石柱土家族自治县" == cityName) { |
| | | var longitude = 108.118685; |
| | | var latitude = 30.006859; |
| | | point = new BMap.Point(longitude, latitude); |
| | | } else if ("彭水苗族土家族自治县" == cityName) { |
| | | var longitude = 108.17085; |
| | | var latitude = 29.301729; |
| | | point = new BMap.Point(longitude, latitude); |
| | | } else if ("酉阳土家族苗族自治县" == cityName) { |
| | | var longitude = 108.774583; |
| | | var latitude = 28.848811; |
| | | point = new BMap.Point(longitude, latitude); |
| | | } else if ("秀山土家族苗族自治县" == cityName) { |
| | | var longitude = 109.011853; |
| | | var latitude = 28.454209; |
| | | point = new BMap.Point(longitude, latitude); |
| | | } else if ("东方市" == cityName) { |
| | | var longitude = 108.656267; |
| | | var latitude = 19.101378; |
| | | point = new BMap.Point(longitude, latitude); |
| | | } else if ("万宁市" == cityName) { |
| | | var longitude = 110.397709; |
| | | var latitude = 18.799833; |
| | | point = new BMap.Point(longitude, latitude); |
| | | } else if ("五指山市" == cityName) { |
| | | var longitude = 109.522965; |
| | | var latitude = 18.782911; |
| | | point = new BMap.Point(longitude, latitude); |
| | | } else if ("琼海市" == cityName) { |
| | | var longitude = 110.47882; |
| | | var latitude = 19.265073; |
| | | point = new BMap.Point(longitude, latitude); |
| | | } else if ("屯昌县" == cityName) { |
| | | var longitude = 110.105702; |
| | | var latitude = 19.358194; |
| | | point = new BMap.Point(longitude, latitude); |
| | | } else if ("定安县" == cityName) { |
| | | var longitude = 110.363233; |
| | | var latitude = 19.686848; |
| | | point = new BMap.Point(longitude, latitude); |
| | | } else if ("文昌市" == cityName) { |
| | | var longitude = 110.803934; |
| | | var latitude = 19.549335; |
| | | point = new BMap.Point(longitude, latitude); |
| | | } else if ("澄迈县" == cityName) { |
| | | var longitude = 110.010636; |
| | | var latitude = 19.745166; |
| | | point = new BMap.Point(longitude, latitude); |
| | | } else if ("临高县" == cityName) { |
| | | var longitude = 109.693419; |
| | | var latitude = 19.920291; |
| | | point = new BMap.Point(longitude, latitude); |
| | | } else if ("保亭黎族苗族自治县" == cityName) { |
| | | var longitude = 109.702907; |
| | | var latitude = 18.647732; |
| | | point = new BMap.Point(longitude, latitude); |
| | | } else if ("陵水黎族自治县" == cityName) { |
| | | var longitude = 110.045039; |
| | | var latitude = 18.513155; |
| | | point = new BMap.Point(longitude, latitude); |
| | | } else if ("琼中黎族苗族自治县" == cityName) { |
| | | var longitude = 109.842786; |
| | | var latitude = 19.041625; |
| | | point = new BMap.Point(longitude, latitude); |
| | | } else if ("昌江黎族自治县" == cityName) { |
| | | var longitude = 109.060164; |
| | | var latitude = 19.304817; |
| | | point = new BMap.Point(longitude, latitude); |
| | | } else if ("白沙黎族自治县" == cityName) { |
| | | var longitude = 109.453447; |
| | | var latitude = 19.232744; |
| | | point = new BMap.Point(longitude, latitude); |
| | | } else if ("儋州市" == cityName) { |
| | | var longitude = 109.588035; |
| | | var latitude = 19.526327; |
| | | point = new BMap.Point(longitude, latitude); |
| | | } else if ("红河哈尼族彝族自治州" == cityName) { |
| | | var longitude = 103.380977; |
| | | var latitude = 23.380877; |
| | | point = new BMap.Point(longitude, latitude); |
| | | } else if ("西双版纳傣族自治州" == cityName) { |
| | | var longitude = 100.800568; |
| | | var latitude = 22.023519; |
| | | point = new BMap.Point(longitude, latitude); |
| | | } else if ("普洱市" == cityName) { |
| | | var longitude = 100.972567; |
| | | var latitude = 22.830712; |
| | | point = new BMap.Point(longitude, latitude); |
| | | } else if ("渝北区" == cityName) { |
| | | var longitude = 106.638135; |
| | | var latitude = 29.709625; |
| | | point = new BMap.Point(longitude, latitude); |
| | | }else if("射阳县" == regoinNames[2]){ |
| | | var longitude = 120.332826; |
| | | var latitude = 33.772274; |
| | | point = new BMap.Point(longitude, latitude); |
| | | } |
| | | map.centerAndZoom(point, showZoom); |
| | | } else { |
| | | alert("您选择地址没有解析到结果!"); |
| | |
| | | var endZoom = baiduMap.getZoom(); |
| | | var startZoom = moralMap.startZoom(); |
| | | //刷新key防止延迟加载 |
| | | // var key = moralMap.lazyKeyer(); |
| | | // var key = moralMap.lazyKeyer(); |
| | | var confine = moralMap.getZoomConfine(); |
| | | if (endZoom > startZoom) { |
| | | //放大超过边界 |
| | |
| | | return; |
| | | } |
| | | var equ = { |
| | | methodName: 'chart' == select ? 'showChart' : 'showDeviceMonitor', |
| | | methodName: 'showVoc' == select ? 'showVoc' : 'showDeviceMonitor', |
| | | name: row['name'], |
| | | mac: (row['mac']).toLowerCase(), |
| | | longitude: row['longitude'], |
| | | latitude: row['latitude'], |
| | | monitorPointId: row['monitorPointId'], |
| | | version: row['deviceVersion']['version'] |
| | | version: row['deviceVersion']['version'], |
| | | provinceCode: row['monitorPoint']['provinceCode'] |
| | | }; |
| | | !!select ? equ['monitorPointId'] = row["monitorPointId"] : null; |
| | | var equStr = JSON.stringify(equ); |
| | | if (window["console"] != undefined) { |
| | | console.log(equStr); |
| | | // console.log(equStr); |
| | | } |
| | | if (!!window['external'] && !!window['external']['callWin']) { |
| | | window['external'].callWin(equStr); |
| | | } else { |
| | | if (!!select && select === 'chart' && !!window['external'] && !!window['external']['showChartInfo']) { |
| | | if (!!select && select === 'showVoc' && !!window['external'] && !!window['external']['showVocInfo']) { |
| | | window['external'].showChartInfo(equStr); |
| | | } else if (!!window['external'] && !!window['external']['showMonitorInfo']) { |
| | | window['external'].showMonitorInfo(equStr); |
| | | } else { |
| | | alert(equStr); |
| | | } |
| | |
| | | break; |
| | | case 4: |
| | | state = 'state04'; |
| | | stateName = '维保'; |
| | | stateName = '离线'; |
| | | break; |
| | | } |
| | | return { |
| | |
| | | var url = option['url']; |
| | | url += "&pageNo=" + pageNo; |
| | | url += "&pageSize=" + pageSize; |
| | | console.log(url); |
| | | // console.log(url); |
| | | $.ajax({ |
| | | type: "get", |
| | | cache: false, |
| | |
| | | var state = 'state01'; |
| | | var stateName = ''; |
| | | var s = e['state'] == undefined ? 0 : e['state']; |
| | | if (deviceStates) { |
| | | for (var j in deviceStates) { |
| | | var deviceState = deviceStates[j]; |
| | | if (deviceState.mac == e['mac']) { |
| | | s = deviceState.state; |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | var stateObj = _getStateMap(s); |
| | | state = stateObj["state"]; |
| | | stateName = stateObj["stateName"]; |
| | |
| | | } |
| | | name = name.substring(0, stop1) + "..." + name.substring(stop2, name.length); |
| | | } |
| | | var li = "<li id='listview_item_" + e['mac'] + "'><span class='list-chart-span' onclick=moralMap.onItermClick(\"" + i + "\",'chart')><img src='/img/chart.png'></span>" |
| | | var li = "<li id='listview_item_" + e['mac'] + "'><span class='list-chart-span' onclick=moralMap.onItermClick(\"" + i + "\",'showVoc')><img src='/img/list.png' width='20px'></span>" |
| | | + "<span id='listview_state_" + e['mac'] + "'class='" + state + "'>" + stateName + "</span>" + |
| | | "<div style='cursor: pointer;' onclick=moralMap.onItermClick(\"" + i + "\")>" + name + "</div></li>"; |
| | | "<div>" + name + "</div></li>"; |
| | | outHtml += li; |
| | | } |
| | | outHtml += "</ul>"; |
| | |
| | | icon["height"] = 50; |
| | | option["icon"] = icon; |
| | | var moralMarker = new moralMap.MoralMarker(option); |
| | | // var mark =new BMap.Marker(pointObj,{icon:iconObj}); |
| | | // var mark =new BMap.Marker(pointObj,{icon:iconObj}); |
| | | //==================infoWindow-start============================ |
| | | var infoWindow = (function () { |
| | | //生成信息框 |
| | | var winOpts = { |
| | | width: 110, // 信息窗口宽度 |
| | | height: 80, // 信息窗口高度 |
| | | title: getTitleOutHtml(), // 信息窗口标题 |
| | | offset: new BMap.Size(-8, -5) //设置信息窗偏移 |
| | | } |
| | | |
| | | function getTitleOutHtml() { |
| | | //title太长用引号... |
| | | var title = (option["name"] == null) ? "" : option["name"]; |
| | | if (title.length > 13) { |
| | | title = title.slice(0, 13) + "..."; |
| | | } |
| | | var titleOutHtml = ""; |
| | | titleOutHtml += "<p style='width:210px;font:bold 14px/16px arial,sans-serif;margin:0;color:#cc5522;white-space:nowrap;overflow:hidden'" |
| | | titleOutHtml += "title='" + option["name"] + "'>"; |
| | | titleOutHtml += title + "</p>"; |
| | | return titleOutHtml; |
| | | } |
| | | |
| | | function getAdressOutHtml() { |
| | | var address = (option["address"] == null) ? "" : option["address"]; |
| | | if (address.length > 18) { |
| | | address = address.slice(0, 18) + "..."; |
| | | } |
| | | var adressOutHtml = ""; |
| | | adressOutHtml += "<div onmouseover='moralMap.clearCloseInfoWindow()'"; |
| | | adressOutHtml += "onmouseout='moralMap.closeInfoWindow()'"; |
| | | adressOutHtml += " style='font:12px arial,sans-serif;margin-top:12px'><table cellspacing='0' style='overflow:hidden;table-layout:fixed;width:100%;font:12px arial,sans-serif'>"; |
| | | adressOutHtml += "<tbody><tr><td style='vertical-align:top;width:38px;white-space:nowrap;word-break:keep-all'>地址: </td><td style='line-height:16px'>"; |
| | | adressOutHtml += address + " "; |
| | | adressOutHtml += "</td></tr>"; |
| | | //adressOutHtml += "<tr><td style='width:98%;padding-top:10px;'colspan='2'><a href='javascript:void(0);' style='display:block;position: relative;float: right;' onclick='moralMap.showPointMonitor("+option.id+")'>实时数据>></a></td></tr>"; |
| | | adressOutHtml += "</tbody></table></div>"; |
| | | return adressOutHtml; |
| | | } |
| | | |
| | | return new BMap.InfoWindow(getAdressOutHtml(), winOpts); |
| | | })(); |
| | | var infoWindow; |
| | | if (moralMarker["infoWindow"] == undefined) { |
| | | moralMarker["infoWindow"] = infoWindow; |
| | | } |
| | | |
| | | //弹窗打开和关闭 |
| | | moralMarker.addEventListener("mouseover", function () { |
| | | moralMarker.addEventListener("click", function () { |
| | | var winOpts = { |
| | | width: 250, // 信息窗口宽度 |
| | | height: 160, // 信息窗口高度 |
| | | // title: getTitleOutHtml(), // 信息窗口标题 |
| | | offset: new BMap.Size(-8, -5) //设置信息窗偏移 |
| | | } |
| | | var winfowText = "<div style='width:250px'>"; |
| | | var title = (option["name"] == null) ? "" : option["name"]; |
| | | if (title.length > 13) { |
| | | title = title.slice(0, 13) + "..."; |
| | | } |
| | | winfowText += "<p style='width:210px;font:bold 14px/16px arial,sans-serif;margin:0;color:#cc5522;white-space:nowrap;overflow:hidden'" |
| | | winfowText += "title='" + option["name"] + "'>"; |
| | | winfowText += title + "</p>"; |
| | | var listText = '<div id="equ_list" class="listview" style="min-height:50px;overflow:auto;max-height:140px;" ></div>'; |
| | | winfowText = winfowText + listText + "</div>"; |
| | | var infoWindow = new BMap.InfoWindow(winfowText, winOpts); |
| | | moralMap.openInfoWindow(infoWindow, this._point); //开启信息窗口 |
| | | }); |
| | | |
| | | moralMarker.addEventListener("mouseout", function () { |
| | | moralMap.closeInfoWindow(); |
| | | // moralMap.closeInfoWindow(); |
| | | }); |
| | | //==================infoWindow-end============================ |
| | | //储存监控点 |
| | |
| | | } |
| | | |
| | | } |
| | | |
| | | //设备以mac为key储存 |
| | | //监控点对象 包装MoralMark对象 |
| | | moralMap.Equipment = function (option) { |
| | | var sensorsMap; |
| | | var sensorsDescriptionMap; |
| | | var sensorsUnitMap; |
| | | $.ajax({ |
| | | url: "getSensorsMap?mac=" + option['mac'], |
| | | type: "get", |
| | | dataType: "json", |
| | | success: function (data) { |
| | | sensorsMap = data.data; |
| | | } |
| | | }); |
| | | |
| | | $.ajax({ |
| | | url: "getSensorsUnitMap?mac=" + option['mac'], |
| | | type: "get", |
| | | dataType: "json", |
| | | success: function (data) { |
| | | sensorsUnitMap = data.data; |
| | | sensorsDescriptionMap = data[0]; |
| | | sensorsUnitMap = data[1]; |
| | | } |
| | | }); |
| | | |
| | |
| | | option["online_width"] = 355; |
| | | option["online_height"] = 385; |
| | | var moralMarker = new moralMap.MoralMarker(option); |
| | | // var mark =new BMap.Marker(pointObj,{icon:iconObj}); |
| | | // var mark =new BMap.Marker(pointObj,{icon:iconObj}); |
| | | //==================infoWindow-start============================ |
| | | var infoWindow = (function () { |
| | | //生成信息框 |
| | |
| | | var name = sensorNames[key][0]; |
| | | var unit = sensorNames[key][1]; |
| | | var itme_state = dataHandle._getSensorState(data, key); |
| | | // var itme_name_mac_key = "item-name-" + mac + "-" + key; |
| | | // var itme_name_mac_key = "item-name-" + mac + "-" + key; |
| | | var itme_data_mac_key = "item-data-" + mac + "-" + key; |
| | | var item = "<li>"; |
| | | item += "<p>"+name+"</p>"; |
| | |
| | | } |
| | | |
| | | moralMap.showSensors = function (jsonData) { |
| | | var address = (option["address"] == null) ? "" : option["address"]; |
| | | if (address.length > 18) { |
| | | address = address.slice(0, 18) + "..."; |
| | | } |
| | | var adressOutHtml = '<div style="min-height:20px;overflow:auto;max-height:400px;font-size: 12px;" onmouseover="moralMap.clearCloseInfoWindow()" onmouseout="moralMap.closeInfoWindow()">'; |
| | | var y, m, d, h, mm, s; |
| | | var date = new Date(jsonData['time']); |
| | | 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 sensorsMap) { |
| | | if (prop == key) { |
| | | var sensorsDescription = sensorsMap[key]; |
| | | if (!jsonData.hasOwnProperty('mac')) { |
| | | infoWindow.setContent(""); |
| | | infoWindow.redraw(); |
| | | } else { |
| | | var adressOutHtml = '<div style="min-height:20px;overflow:auto;max-height:400px;font-size: 12px;" onmouseover="moralMap.clearCloseInfoWindow()" onmouseout="moralMap.closeInfoWindow()">'; |
| | | var y, m, d, h, mm, s; |
| | | var date = new Date(jsonData['time']); |
| | | 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]; |
| | | 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(); |
| | | } |
| | | /* if (!$.isEmptyObject(sensorInfo)) { |
| | | moralMap.openInfoWindow(infoWindow, this._point); //开启信息窗口 |
| | |
| | | var deviceStates; |
| | | var monitorPointStates; |
| | | moralMap.refreshState = function (states) { |
| | | if (!monitorPointStates) { |
| | | monitorPointStates = states; |
| | | deviceStates = []; |
| | | for (var i in states) { |
| | | var state = states[i]; |
| | | for (var j in state.devices) { |
| | | var device = state.devices[j]; |
| | | deviceStates.push(device); |
| | | } |
| | | monitorPointStates = states; |
| | | deviceStates = []; |
| | | for (var i in states) { |
| | | var state = states[i]; |
| | | for (var j in state.devices) { |
| | | var device = state.devices[j]; |
| | | deviceStates.push(device); |
| | | } |
| | | } |
| | | listView.refreshState(deviceStates); |
| | | for (var i in states) { |
| | | var state = states[i]; |
| | | var mpoint = moralMap.getMpoint(state.id); |