| | |
| | | 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() {
|
| | | this.context.clearRect(0, 0, this.canvas.width, this.canvas.height);
|
| | |
| | | isCanMove: 1,
|
| | | clockwise: 0,
|
| | | txtFillStyle: '#000',
|
| | | name: '电池组浮充状态电流方向'
|
| | | name: '设备浮充状态电流方向'
|
| | | },
|
| | | discharge: {
|
| | | points:[
|
| | |
| | | isCanMove: 1,
|
| | | clockwise: 1,
|
| | | txtFillStyle: '#000',
|
| | | name: '电池组放电测试时电流方向'
|
| | | name: '设备放电测试时电流方向'
|
| | | },
|
| | | constCharge: {
|
| | | points:[
|
| | |
| | | isCanMove: 1,
|
| | | clockwise: 0,
|
| | | txtFillStyle: '#000',
|
| | | name: '电池组稳流充电时电流方向'
|
| | | name: '设备稳流充电时电流方向'
|
| | | },
|
| | | directCharge: {
|
| | | points:[
|
| | |
| | | isCanMove: 1,
|
| | | clockwise: 0,
|
| | | txtFillStyle: '#000',
|
| | | name: '电池组直连充电时电流方向'
|
| | | name: '设备直连充电时电流方向'
|
| | | },
|
| | | unLink: {
|
| | | points:[
|
| | |
| | | name: 'K1/D1测试'
|
| | | },
|
| | | powerCutDis: {
|
| | | name: '电池组停电放电'
|
| | | name: '设备停电放电'
|
| | | }
|
| | | };
|
| | |
|
| | |
| | | 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',
|
| | |
| | | },
|
| | | powerCutDis: {
|
| | | fillStyle: '#000',
|
| | | name: '电池组停电放电'
|
| | | name: '设备停电放电'
|
| | | }
|
| | | };
|
| | |
|