hdw
2018-11-12 e41ab8b70d97c1f32d2bf61156a37c4b17746a66
gx_tieta/WebRoot/js/elecircle.js
@@ -312,7 +312,7 @@
   var opts = $.extend({}, defaults, options || {});
   
   // 根据开关的类型和快关的状态设置value的值获取线包电压
   var lineVol = '线包电压:';
   /*var lineVol = '线包电压:';
   if(opts.id == 'ko') {
      if(opts.stats == 'on') {
         lineVol =lineVol + '0V';
@@ -325,7 +325,7 @@
      }else {
         lineVol =lineVol + '0V';
      }
   }
   }*/
   
   
   
@@ -495,7 +495,7 @@
   }
   
   // 绘制背景色
   this.context.beginPath();
   /*this.context.beginPath();
   this.context.fillStyle = '#FFFFFF';
   var strWidth = getStringWidth(lineVol);
   this.context.rect(valueTxtX,valueTxtY-12,strWidth,14);
@@ -504,7 +504,7 @@
   this.context.strokStyle = '#0000DD';
   this.context.fillStyle = '#0000DD';
   this.context.font = 'bold 12px Arial';
   this.context.fillText(lineVol, valueTxtX, valueTxtY);
   this.context.fillText(lineVol, valueTxtX, valueTxtY);*/
   var switchBtnInfor = {
      options: opts,
@@ -812,17 +812,30 @@
   
   this.context.setLineDash([]);   // 恢复实线
   
   if(opts.name.length > 0) {
      this.context.beginPath();
      this.context.fillStyle = '#FFFFFF';
      this.context.rect(opts.startX-20,opts.startY+16*2+156, 30,32);
      this.context.fill();
   }
   var textList = opts.name.split('&');
   this.context.fillStyle = opts.strokeStyle;
   var lineHeight = 16;
   for(var i=0; i<textList.length; i++) {
      this.context.fillText(textList[i], opts.startX-20, opts.startY+lineHeight*i+200);
   }
   
   // 存储内容
   var dotLineInfor = {
      options: opts,
      type:'drawDotLine',
   }
   };
   this.opts.push(dotLineInfor);
   
   
@@ -1124,6 +1137,46 @@
   }
   this.opts.push(txtInfor);
}
// 绘制图片
EleCircle.prototype.drawImg = function(options) {
   var defaluts = {
      img: '',
      startX: 0,
      startY: 0,
      width: 30,
      height: 30,
      lineWidth: 4,
      fontSize: 14,
      fontWeight: '',
      strokeStyle: '#000',
      fillStyle: '#000',
      isShow: true,
      name:'',
      id: '',
   };
   var opts = $.extend({}, defaluts, options || {});
   if(opts.img != '' && opts.isShow) {
      this.context.drawImage(opts.img, opts.startX, opts.startY, opts.width, opts.height);
      this.context.lineWidth = opts.lineWidth;
      this.context.strokeStyle = opts.strokeStyle;
      this.context.fillStyle = opts.fillStyle;
      this.context.font = opts.fontSize+'px Arial';
      this.context.fillText(opts.name, opts.startX+30, opts.startY+25);
   }
   // 存储内容
   var txtInfor = {
      options: opts,
      type:'drawImg',
   };
   this.opts.push(txtInfor);
};
// 重新绘制图
EleCircle.prototype.redraw =function() {
@@ -1443,7 +1496,7 @@
            isCanMove: 1,
            clockwise: 0,
            txtFillStyle: '#000',
            name: '电池组浮充状态电流方向'
            name: '设备浮充状态电流方向'
         },
         discharge: {
            points:[
@@ -1454,7 +1507,7 @@
            isCanMove: 1,
            clockwise: 1,
            txtFillStyle: '#000',
            name: '电池组放电测试时电流方向'
            name: '设备放电测试时电流方向'
         },
         constCharge: {
            points:[
@@ -1465,7 +1518,7 @@
            isCanMove: 1,
            clockwise: 0,
            txtFillStyle: '#000',
            name: '电池组稳流充电时电流方向'
            name: '设备稳流充电时电流方向'
         },
         directCharge: {
            points:[
@@ -1476,7 +1529,7 @@
            isCanMove: 1,
            clockwise: 0,
            txtFillStyle: '#000',
            name: '电池组直连充电时电流方向'
            name: '设备直连充电时电流方向'
         },
         unLink: {
            points:[
@@ -1493,7 +1546,7 @@
            name: 'K1/D1测试'
         },
         powerCutDis: {
            name: '电池组停电放电'
            name: '设备停电放电'
         }
      };
      
@@ -2088,19 +2141,19 @@
      var titleList = {
         floatCharge:{
            fillStyle: '#000',
            name: '电池组浮充状态'
            name: '设备浮充状态'
         },
         discharge: {
            fillStyle: '#000',
            name: '电池组放电测试'
            name: '设备放电测试'
         },
         constCharge: {
            fillStyle: '#000',
            name: '电池组稳流充电'
            name: '设备稳流充电'
         },
         directCharge: {
            fillStyle: '#000',
            name: '电池组直连充电'
            name: '设备直连充电'
         },
         unLink: {
            fillStyle: '#FF0000',
@@ -2112,7 +2165,7 @@
         },
         powerCutDis: {
            fillStyle: '#000',
            name: '电池组停电放电'
            name: '设备停电放电'
         }
      };