| | |
| | | var opts = $.extend({}, defaults, options || {});
|
| | |
|
| | | // 根据开关的类型和快关的状态设置value的值获取线包电压
|
| | | var lineVol = '线包电压:';
|
| | | /*var lineVol = '线包电压:';
|
| | | if(opts.id == 'ko') {
|
| | | if(opts.stats == 'on') {
|
| | | lineVol =lineVol + '0V';
|
| | |
| | | }else {
|
| | | lineVol =lineVol + '0V';
|
| | | }
|
| | | }
|
| | | }*/
|
| | |
|
| | |
|
| | |
|
| | |
| | | }
|
| | |
|
| | | // 绘制背景色
|
| | | this.context.beginPath();
|
| | | /*this.context.beginPath();
|
| | | this.context.fillStyle = '#FFFFFF';
|
| | | var strWidth = getStringWidth(lineVol);
|
| | | this.context.rect(valueTxtX,valueTxtY-12,strWidth,14);
|
| | |
| | | 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,
|
| | |
| | |
|
| | | 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);
|
| | |
|
| | |
|