hdw
2018-11-22 aa39b7fa5eb2eb2f65e00d134c82eaa958900813
gx_tieta/WebRoot/js/dischargetest/bts.js
@@ -14,8 +14,14 @@
      $('#btn_ensure').addClass('whyc-btn-disabled'); // 设定参数无效
   },
   active:function() {
      $('#btn_start_test').removeClass('whyc-btn-disabled'); // 启动测试可以点击
      $('#btn_ensure').removeClass('whyc-btn-disabled');    // 设置参数可以点击
      if(!$('#btn_start_test').hasClass('no-remove-disabled')) {
         $('#btn_start_test').removeClass('whyc-btn-disabled'); // 启动测试可以点击
      }
      if(!$('#btn_ensure').hasClass('no-remove-disabled')) {
         $('#btn_ensure').removeClass('whyc-btn-disabled');    // 设置参数可以点击
      }
   },
   startTest:function(param) {
      if(param) {
@@ -39,8 +45,10 @@
   // 放电电流
   $('#discurr').testVal({
      pattern: /^[0-9]+(\.[0-9]*)?$/,
      regVal: false,
      msg: '输入的数据格式不正确'
      regVal: true,
      min: 0,
      max: 1000,
      msg: '取值范围0~1000A'
   });
   
   // 放电小时率
@@ -53,29 +61,37 @@
   // 放电电容
   $('#discap').testVal({
      pattern: /^[0-9]+$/,
      regVal: false,
      msg: '输入的数据格式不正确'
      regVal: true,
      min: 0,
      max: 90000,
      msg: '取值范围0~90000AH'
   });
   
   // 放电时长
   $('#distime').testVal({
      pattern: /^[0-9]+$/,
      regVal: false,
      msg: '输入的数据格式不正确'
      regVal: true,
      min: 0,
      max: 5940,
      msg: '取值范围0~5940分钟'
   });
   
   // 单体下限阀值
   $('#MonomerVol_low').testVal({
      pattern: /^[0-9]+(\.[0-9]*)?$/,
      regVal: false,
      msg: '输入的数据格式不正确'
      regVal: true,
      min: 0,
      max: 20,
      msg: '取值范围0~20V'
   });
   
   // 组端下限阀值GroupVol_low
   $('#GroupVol_low').testVal({
      pattern: /^[0-9]+(\.[0-9]*)?$/,
      regVal: false,
      msg: '输入的数据格式不正确'
      regVal: true,
      min: 0,
      max: 60,
      msg: '取值范围0~60V'
   });
   
   // 单体下限数量
@@ -118,8 +134,8 @@
});
//获取BTS设备的测试参数等
function searchBTSTestParam(temp){
   var is_showAlert = (arguments.length==1);
function searchBTSTestParam(temp, acStart){
   var is_showAlert = (acStart == undefined);
   loading.showLoading();
   $.ajax({    
       type: "post",             
@@ -134,9 +150,13 @@
         if(model.code == 1 && model.data != undefined && model.data.length>0){
            setBTSParam(model.data, false);
            if(is_showAlert){            
               noContent.showNoContent("获取测试参数成功");
               noContent.showNoContent("获取测试参数成功", true);
            }
            initPopup(BTS_popup);
            if(!acStart) {
               BTSBtn.startTest(false);
            }
         }else{
            if(model.data != undefined && model.data.length>0){
               setBTSParam(model.data, true);
@@ -198,8 +218,8 @@
// 设置参数
function setBTSParam(list, errorStatus) {
   //setDischageBattinfo(list[0].fsparam.BattGroupNum);            //设置被测电池组信息
   // setDischageBattinfo(list[0].fsparam.BattGroupNum);            //设置被测电池组信息
   // console.log(list);
   if(list[0].fsparam.TestCmd == CMD_BTS_StartDischarge){
      $('#discharge_type').val(CMD_BTS_StartDischarge);
   }else if(list[0].fsparam.TestCmd == CMD_BTS_StartRESTest){
@@ -218,6 +238,18 @@
   $('#DCVolHighLimit').val(list[0].fsparam.DCVolHighLimit);
   $('#ChargeCurrSet').val(list[0].fsparam.ChargeCurrSet);
   $('#TempUpHighLimit').val(list[0].fsparam.MonomerTmp_High);
   // 充电电流
   $('#ChargeCurrSet').testVal('option', 'allOpts', {
      regVal: true
      ,update: true
      ,min: 0
      ,max: list[0].binf.charge_curr_max
      ,msg: '取值范围0~'+list[0].binf.charge_curr_max+'A'
   });
   // 设置文本值
   $('#ChargeCurrSetLabel .val-range').text('0~'+list[0].binf.charge_curr_max);
}
// 更新BTS设备测试信息
@@ -236,10 +268,11 @@
         var model = eval('('+data.result+')');
         //console.info(model);
         if(model.code == 1){
            noContent.showNoContent("修改测试参数成功");
            noContent.showNoContent("修改测试参数成功", true);
            var temp = {
               num:CMD_61850_GETPARAM,
               dev_id:param.dev_id
               dev_id:param.dev_id,
               TestCmd: 0
            };
            searchBTSTestParam(temp,true);            //重新读取一次测试参数
            
@@ -312,13 +345,13 @@
function showBTSContent(cmd, issuccess) {
   if(cmd == CMD_BTS_Start){
      if(issuccess){
         noContent.showNoContent("启动测试成功");
         noContent.showNoContent("启动测试成功", true);
      }else{
         noContent.showNoContent("启动测试失败");
      }
   }else if(cmd == CMD_BTS_Stop){
      if(issuccess){
         noContent.showNoContent("停止测试成功");
         noContent.showNoContent("停止测试成功", true);
      }else{
         noContent.showNoContent("停止测试失败");
      }