hdw
2018-11-12 f87e0c49cf023c58b090ea4a30863d5dd8e9cc97
gx_tieta/WebRoot/js/elecircle.content.js
@@ -476,12 +476,12 @@
   });
   
   // 拓扑图名称
   eleCircle.drawText({
   /*eleCircle.drawText({
      id: 'title',
      startX: 400,
      startY: 40,
      name: '设备浮充状态电流方向',
   });
   });*/
   
   // 设备内部温度
   eleCircle.drawText({
@@ -489,6 +489,14 @@
      startX: 270,
      startY: 100,
      name: '设备温度:0℃',
   });
   // dcdc模块告警
   eleCircle.drawText({
      id: 'dcdcWarn',
      startX: 250,
      startY: 390,
      name: 'DCDC模块告警:0x8000/0x8000',
   });
   
   var currentObj = {
@@ -812,7 +820,18 @@
        }
        this.ele.append(_ul);
    };
    // 设置配置项
    _prop.setOpts = function(options) {
       this.options = options;
        this._init();
        if(this.options.length != 0) {
            this.show();
        }
    };
    // 根据配置项的值获取li
    _prop._setLi = function(li, option) {
        var _i, _a = $('<a></a>');
@@ -838,6 +857,9 @@
           }
           var list = option.content.list[option.status]?option.content.list[option.status]:'未知';
           var txt = option.content.text+list;
           _a.append(txt);
        }else if(option.type == 'text') {
           var txt = option.content.text;
           _a.append(txt);
        }
        
@@ -884,6 +906,29 @@
            }
        }
    };
    // 设置文本内容
    _prop.setText = function(name, text, notShow) {
       var _itemList = this.ele.find('li');
       // 遍历配置项
        for(var i =0; i<this.options.length; i++) {
           var _opts = this.options[i];    // 获取当前循环的变量
           // 根据名称确定更改的内容
            if(_opts.name == name) {
                var _tmp = $.extend({}, _opts); // 获取全新对象,避免引用传递
                _tmp.content.text = text;
                // 设置是否显示
                if(notShow) {
                   _tmp.notShow = true;
                }else {
                   _tmp.notShow = false;
                }
                this._setLi(_itemList.eq(i), _tmp); // 更新li的内容
            }
        }
    };
    var options = [
      {
@@ -935,6 +980,53 @@
           }
        }
    ];
    // 61850配置项
    gl.circleStatus.e61850Opts = options;
    var optionsBts = [
      {
         name: 'workstatus',
         type: 'list',
         notShow: false,
         //imgCallback: gl.statusImg.getImg,
         status: 0,
         content: {
            list:gl.BTS9100.workstates,
            text: '设备状态:'
         }
      },
      {
         name: 'stop',
         type: 'list',
         status: 0,
         notShow: false,
         content: {
            list:gl.BTS9100.alarmstates,
            text: '上一次核容终止原因:'
         }
      },
      {
         name: 'count',
         type: 'text',
         status: 0,
         notShow: false,
         content: {
            text: '通信计数:'
         }
      },
      {
         name: 'percent',
         type: 'text',
         status: 0,
         notShow: false,
         content: {
            text:'通信丢包率:'
         }
      }
    ];
    // bts9100配置项
    gl.circleStatus.btsOpts = optionsBts;
    var status = new Status($('#eleCircleStatus'), options);
    gl.circleStatus.status = status;
    
@@ -955,9 +1047,6 @@
          var data = model.data[0];
           var alarmstatus = data.dev_alarmstate;   //[0:'无',1:'暂停',2:'放电测试',3:'放电等待',4:'限流充电',5:'直流充电',6:'充电等待',7:'测试时间到',8:'测试容量到',9:'单体下限到',10:'组端下限到',11:'市电异常',12:'存储卡不足',13:'负载温度高',14:'电流异常',15:'远程通信坏',16:'负载通信坏',17:'选择通信坏',18:'负载电流坏',19:'内存申请坏',20:'未知'];
          var workstatus =parseInt(data.dev_workstate) ;   //[0:'在线监测',1:'放电测试',2:'充电测试',3:'内阻测试',4:'未知'];
           if(typeof callback == 'function') {
              callback.call({}, data);
           }
           // 判断workstatus
           switch(workstatus) {
              case 0:   {   // 浮充状态
@@ -1020,6 +1109,11 @@
              }
              break;
           }
           // 设置左上方内容
           if(typeof callback == 'function') {
              callback.apply({}, [batt, data, mygraph]);
           }
       }else {
          mygraph.graphtype = 4 ;
         _str = '(未连接)';