Merge branch 'dev_lxw' of https://whychdw@gitlab.com/whyclxw1/gx_tieta.git into dev_lxw
| | |
| | | // 设置语音播报对象
|
| | | var Voice = function() {
|
| | | this.speak = window.speechSynthesis;
|
| | | this.tospeak = new SpeechSynthesisUtterance('');
|
| | | this.voice = '';
|
| | | this.zh_CN = false;
|
| | | this.rate = 1.5;
|
| | | this._setLang(); // 获取并检测是否有中文的环境
|
| | | this.timeInterval = 28; //循环间隔(秒)
|
| | | this.timeInterval = 27; //循环间隔(秒)
|
| | | this.speak_enable = true; //ture:开启语音播报 false:停止语音播报
|
| | | };
|
| | |
|
| | |
| | | console.info('你的电脑不支持中文播报!');
|
| | | }
|
| | | _timeInterval = this.timeInterval;
|
| | | //console.info(this.zh_CN);
|
| | | //console.info(this.speak_enable);
|
| | | if(!this.speak_enable){ //识别是否开启声音播报
|
| | | if(callback && typeof callback == 'function'){
|
| | | setTimeout(function(){
|
| | |
| | | return;
|
| | | }
|
| | | this.cancel();
|
| | | var to_speak = new SpeechSynthesisUtterance(txt);
|
| | | to_speak.voice = this.voice; // 设定中文播报
|
| | | to_speak.rate = this.rate;
|
| | | this.tospeak.text = txt;
|
| | | this.tospeak.voice = this.voice; // 设定中文播报
|
| | | this.tospeak.rate = this.rate;
|
| | | //console.info(to_speak);
|
| | | this.speak.speak(to_speak);
|
| | | |
| | | var starttime = new Date();
|
| | | to_speak.onend = function(event) { |
| | | //console.info(event);
|
| | | this.speak.speak(this.tospeak);
|
| | | //console.info(this.tospeak);
|
| | | this.tospeak.onend = function(event) { |
| | | //console.info("播放结束");
|
| | | if(callback && typeof callback == 'function'){
|
| | | var endtime = new Date();
|
| | | var timelong = (endtime.getTime()-starttime.getTime())/1000;
|
| | |
| | | }
|
| | | };
|
| | |
|
| | | to_speak.onerror = function(event) { |
| | | //console.info(event);
|
| | | };
|
| | |
|
| | | };
|
| | |
|
| | | // 退出当前播报
|
| | |
| | | //根据机房id查询机房下的电池组信息(左侧导航第四层,根据机房查询下面的电池组,num中存放uid)
|
| | | public List serchBattByStation(Object obj){
|
| | | BattInf binf=(BattInf) obj;
|
| | | String sql="select DISTINCT StationName,StationName1,StationName2,StationId,StationIP,FBSDeviceId,BattGroupName,BattGroupName1,BattGroupName2,MonCount,battgroupId,MonCapStd,MonVolStd,MonResStd,MonSerStd,BattProducer,BattInUseDate,GroupIndexInFBSDevice,Load_curr,DisCurrMax " +
|
| | | String sql="select DISTINCT StationName,StationName1,StationName2,StationId,stationid_ex,StationIP,FBSDeviceId,BattGroupName,BattGroupName1,BattGroupName2,MonCount,battgroupId,MonCapStd,MonVolStd,MonResStd,MonSerStd,BattProducer,BattInUseDate,GroupIndexInFBSDevice,Load_curr,DisCurrMax " +
|
| | | "from db_battinf.tb_battinf where StationName1 like ? and StationName2 like ? and StationName like ? ";
|
| | | //机房id
|
| | | String idSqlT=" and Stationid like ? ";
|
| | |
| | | batt.setStationName1(rs.getString("stationName1"));
|
| | | batt.setStationName2(rs.getString("stationName2"));
|
| | | batt.setStationId(rs.getString("StationId"));
|
| | | batt.setStationId_ex(rs.getString("stationId_ex"));
|
| | | batt.setStationIp(rs.getString("StationIP"));
|
| | | batt.setBattGroupName(rs.getString("BattGroupName").trim());
|
| | | batt.setBattGroupName1(rs.getString("BattGroupName1").trim());
|