| | |
| | | });
|
| | | }
|
| | |
|
| | | //查询最近30内的设备和电池告警并播报语音
|
| | | function searchRecentlyAlarm(){
|
| | | $.ajax({ |
| | | type: "post", |
| | | url: "Battalarm_dataAction!serchIn30", |
| | | async:true, |
| | | dataType:'json',
|
| | | data:null, |
| | | success: function(data){ |
| | | //console.info(data);
|
| | | var model = eval("("+data.result+")");
|
| | | //console.info(model);
|
| | | if(model.code == 1){
|
| | | var alarm_str = "";
|
| | | for(var i=0;i<model.data.length;i++){
|
| | | var obj = model.data[i];
|
| | | alarm_str += obj.note+";";
|
| | | }
|
| | | voice.play(alarm_str,searchRecentlyAlarm);
|
| | | }else{ |
| | | setTimeout(searchRecentlyAlarm, 5000);
|
| | | }
|
| | | },
|
| | | error:function() {
|
| | | setTimeout(searchRecentlyAlarm, 5000);
|
| | | } |
| | | });
|
| | | }
|
| | | |
| | | // 核容测试模块
|
| | | $(function() {
|
| | | var arrTh = ['机房名称', '设备ID', '设备名称','设备状态', '在线电压(V)', '组端电压(V)', '组端电流(mA)','设备温度(℃)', '已测容量(AH)', '设备告警', '已测时间'];
|
| | |
| | |
|
| | |
|
| | |
|
| | | //查询最近30内的设备和电池告警并播报语音
|
| | | function searchRecentlyAlarm(){
|
| | | $.ajax({ |
| | | type: "post", |
| | | url: "Battalarm_dataAction!serchIn30", |
| | | async:true, |
| | | dataType:'json',
|
| | | data:null, |
| | | success: function(data){ |
| | | console.info(data);
|
| | | var model = eval("("+data.result+")");
|
| | | console.info(model);
|
| | | if(model.code == 1){
|
| | | var alarm_str = "";
|
| | | for(var i=0;i<model.data.length;i++){
|
| | | var obj = model.data[i];
|
| | | alarm_str += obj.note+";";
|
| | | }
|
| | | voice.play(alarm_str,searchRecentlyAlarm);
|
| | | }else{ |
| | | setTimeout(searchRecentlyAlarm, 5000);
|
| | | }
|
| | | },
|
| | | error:function() {
|
| | | setTimeout(searchRecentlyAlarm, 5000);
|
| | | } |
| | | });
|
| | | }
|
| | | |
| | |
|
| | | // 根据数据生成表格
|
| | | function createTblByModel(model) {
|
| | |
| | | var to_speak = new SpeechSynthesisUtterance(txt);
|
| | | to_speak.voice = this.voice; // 设定中文播报
|
| | | to_speak.rate = this.rate;
|
| | | console.info(to_speak);
|
| | | //console.info(to_speak);
|
| | | this.speak.speak(to_speak);
|
| | |
|
| | | var starttime = new Date();
|
| | |
| | | if(callback && typeof callback == 'function'){
|
| | | var endtime = new Date();
|
| | | var timelong = (endtime.getTime()-starttime.getTime())/1000;
|
| | | console.info(parseInt(_timeInterval)+"==="+parseInt(timelong));
|
| | | //console.info(parseInt(_timeInterval)+"==="+parseInt(timelong));
|
| | | if(timelong > this.timeInterval){
|
| | | callback();
|
| | | }else{
|