var eleCircle = new EleCircle('eleCircle', {}); var signalGood = new Image(); signalGood.src="image/eleCircle/signalGood.gif"; var signalBad = new Image(); signalBad.src="image/eleCircle/signalBad.gif"; $(function() { eleCircle.drawImg({ startX: 10, startY: 30, width: 30, height: 30, isShow:false, id: 'signal' }); // 最上方的横线 eleCircle.drawLine({ startX: 120, startY: 80, endX: 440, endY: 80, strokeStyle: '#FF0000', fillStyle: '#FF0000', id: 'L1' }); // 横线下的第一个竖线 eleCircle.drawLine({ startX: 120, startY: 80, endX: 120, endY: 150, strokeStyle: '#FF0000', id: 'L11' }); // 横线下的第二个竖线 eleCircle.drawLine({ startX: 220, startY: 80, endX: 220, endY: 150, strokeStyle: '#FF0000', id: 'L12' }); // 横线下的第三个竖线 eleCircle.drawLine({ startX: 380, startY: 80, endX: 380, endY: 170, strokeStyle: '#FF0000', id: 'l13' }); // BATC+端后的横线 eleCircle.drawLine({ startX: 456, startY: 80, endX: 740, endY: 80, strokeStyle: '#FF0000', fillStyle: '#FF0000', id: 'L2' }); // BATC+端 eleCircle.drawBAT({ startX: 440, startY: 80, fillStyle: '#FF0000', strokeStyle: '#0000DD', name: 'BATC+端', id: 'BATCAnode' }); // BATC+端后的横线第一根竖线 eleCircle.drawLine({ startX: 586, startY: 80, endX: 586, endY: 190, strokeStyle: '#FF0000', fillStyle: '#FF0000', id: 'L21' }); // BATC+端后的横线第二根竖线 eleCircle.drawLine({ startX: 740, startY: 80, endX: 740, endY: 190, strokeStyle: '#FF0000', fillStyle: '#FF0000', id: 'l22' }); // DCDC模块 eleCircle.drawDCDC({ startX:120, startY:150, name: '放电单元', id: 'DCDC1' }); // DCDC升压电下的竖线 eleCircle.drawLine({ startX: 120, startY: 250, endX: 120, endY: 320, strokeStyle: '#FF0000', id: 'L14' }); // DCDC模块 eleCircle.drawDCDC({ startX:220, startY:150, name: '充电单元', id: 'DCDC2' }); // DCDC稳流下的竖线 eleCircle.drawLine({ startX: 220, startY: 250, endX: 220, endY: 320, strokeStyle: '#FF0000', id: 'L15' }); // DCDC模块下的横线 eleCircle.drawLine({ startX: 120, startY: 320, endX: 250, endY: 320, strokeStyle: '#FF0000', id: 'L3' }); // 绘制整流器 eleCircle.drawRectifier({ startX: 586, startY:190, name: '整&流&器', id:'rectifierInfor1' }); // Km开关后的横线 eleCircle.drawLine({ startX: 305, startY: 320, endX: 440, endY: 320, strokeStyle: '#FF0000', id: 'L4' }); // BATC-端后的横线 eleCircle.drawLine({ startX: 456, startY: 320, endX: 480, endY: 320, strokeStyle: '#FF0000', id: 'L5' }); // BATD+端 eleCircle.drawBAT({ startX: 440, startY: 320, fillStyle: '#FF0000', strokeStyle: '#0000DD', name: 'BATD+端', id: 'BATDAnode' }); // BATC-端后的横线的第一个横线电池在这个地方 eleCircle.drawLine({ startX: 480, startY: 320, endX: 480, endY: 360, strokeStyle: '#FF0000', id: 'L51' }); eleCircle.drawLine({ startX: 480, startY: 440, endX: 480, endY: 460, strokeStyle: '#000', id: 'L52' }); // 电池 eleCircle.drawEle({ startX: 480, startY: 360, direction: 'down', value: '0V', name:'电&池&组', id:"groupEle" }); // 电池后的横线 eleCircle.drawLine({ startX: 480, startY: 460, endX: 440, endY: 460, strokeStyle: '#000', id: 'L6' }); // BAT-端前横线 eleCircle.drawLine({ startX: 440, startY: 460, lineWidth: 2, endX: 305, endY: 460, strokeStyle: '#000', id: 'L6' }); // kc开关端前横线 eleCircle.drawLine({ startX: 250, startY: 460, lineWidth: 2, endX: 40, endY: 460, strokeStyle: '#000', id: 'L7' }); // BAT-端前横线上的竖线 eleCircle.drawLine({ startX: 40, startY: 460, lineWidth: 2, endX: 40, endY: 200, strokeStyle: '#000', id: 'L61' }); // DCDC升压左侧横线 eleCircle.drawLine({ startX: 40, startY: 200, lineWidth: 2, endX: 70, endY: 200, strokeStyle: '#000', id: 'L8' }); // BAT-端 eleCircle.drawBAT({ startX: 440, startY: 460, fillStyle: '#000', strokeStyle: '#0000DD', name: 'BAT-端', nPosition: 'down', id: 'BATCathode' }); // 绘制整流器后的线条 eleCircle.drawLine({ startX: 586, startY: 290, endX: 586, endY: 460, strokeStyle: '#000', }); // 整流器左横线 eleCircle.drawLine({ startX: 556, startY: 460, endX: 480, endY: 460, strokeStyle: '#000', }); // 绘制ko开关后的线 eleCircle.drawLine({ startX: 380, startY: 226, endX: 380, endY: 320, strokeStyle: '#FF0000', }); // 绘制用电负载模块 eleCircle.drawEleLoad({ startX: 740, startY: 190, name: '用&电&负&载', }); // 用电负载下的线 eleCircle.drawLine({ startX: 740, startY: 290, endX: 740, endY: 460, strokeStyle: '#000', }); // 向左的横线 eleCircle.drawLine({ startX: 740, startY: 460, endX: 556, endY: 460, strokeStyle: '#000', }); // 二极管上方的横线 // eleCircle.drawLine({ // startX: 380, // startY: 135, // endX: 430, // endY: 135, // strokeStyle: '#FF0000', // }); // 二极管上方的竖线 // eleCircle.drawLine({ // startX: 430, // startY: 135, // endX: 430, // endY: 160, // strokeStyle: '#FF0000', // }); // 二极管下方的竖线 // eleCircle.drawLine({ // startX: 430, // startY: 220, // endX: 430, // endY: 250, // strokeStyle: '#FF0000', // }); // 二极管下方的横线 // eleCircle.drawLine({ // startX: 430, // startY: 250, // endX: 380, // endY: 250, // strokeStyle: '#FF0000', // }); // BATC+端上方的虚线 eleCircle.drawDotLine({ startX: 448, startY: 72, endX: 448, endY: 60, }); // BATC+端上方的虚线(横线) eleCircle.drawDotLine({ startX: 448, startY: 60, endX: 20, endY: 60, }); // BATC+端下方的虚线 eleCircle.drawDotLine({ startX: 448, startY: 88, endX: 448, endY: 312, }); // BATD+端下方的虚线 eleCircle.drawDotLine({ startX: 448, startY: 328, endX: 448, endY: 452, }); // BAT-端下方的虚线 eleCircle.drawDotLine({ startX: 448, startY: 468, endX: 448, endY: 510, }); // BAT-端下方的虚线 eleCircle.drawDotLine({ startX: 448, startY: 468, endX: 448, endY: 510, }); // BAT-端下方的虚线(横线) eleCircle.drawDotLine({ startX: 448, startY: 510, endX: 20, endY: 510, }); // 最左侧虚线 eleCircle.drawDotLine({ startX: 20, startY: 60, endX: 20, endY: 510, name: 'BTS&设备' }); // 绘制二极管Do // eleCircle.drawDiode({ // startX: 430, // startY: 160, // id: 'diode' // }); // 绘制ko开关 eleCircle.drawSwitchBtn({ startX: 380, startY: 170, strokeStyle: '#000', fillStyle: '#0000DD', direction: 'up', name: 'k1', nPosition: 'left', txtLength: -1, id: 'ko' }); // km 开关 eleCircle.drawSwitchBtn({ startX: 305, startY: 320, direction: 'right', stats: 'off', strokeStyle: '#000', fillStyle: '#0000DD', name: 'k2', nPosition: 'up', id: 'km' }); // kC开关 eleCircle.drawSwitchBtn({ startX: 305, startY: 460, direction: 'right', stats: 'off', strokeStyle: '#000', fillStyle: '#0000DD', name: 'k3', id: 'kc' }); // 拓扑图名称 /*eleCircle.drawText({ id: 'title', startX: 400, startY: 40, name: '设备浮充状态电流方向', });*/ // 设备内部温度 eleCircle.drawText({ id: 'tmp', startX: 270, startY: 100, name: '设备温度:0℃', }); // dcdc模块告警 eleCircle.drawText({ id: 'dcdcWarn', startX: 250, startY: 390, name: 'DCDC模块告警:0x8000/0x8000', }); var currentObj = { id: 'current' }; var floatCharge = { points:[ [320, 40], [540, 40],[540, 520], [430, 520], [430, 360],[320,360] ], clockwise: 0, name: '设备浮充状态电流方向' } currentObj = $.extend({}, currentObj, floatCharge); // 绘制电流的的回路 eleCircle.drawCurrent(currentObj); // 绘制在线电压 eleCircle.drawText({ startX: 663, startY: 110, name: '0V', fontSize: 20, lineWidth: 20, fontWeight: 'bold', id: 'onlineVol' }); // 绘制地电压 eleCircle.drawText({ startX: 663, startY: 450, name: '0V', fontSize: 20, lineWidth: 20, fontWeight: 'bold' }); // 绘制电池电流 eleCircle.drawText({ startX: 510, startY: 120, name: '0A', fillStyle: '#0000DD', fontSize: 20, lineWidth: 20, fontWeight: 'bold', id: 'eleCurrent' }); // 负载电流 eleCircle.drawText({ id: 'loaderCurr', startX: 600, startY: 50, name: '最大负载电流:0A', }); // 最大核容电流 eleCircle.drawText({ id: 'disCurrMax', startX: 600, startY: 70, name: '最大核容电流:0A', }); // 浮充电流方向 var floatCurr = [ { fillColor:'#3d90df', moveLine:[{ startP:[480, 440], endP: [480, 460] },{ startP:[480, 460], endP:[586, 460] }] }, { fillColor:'#3d90df', moveLine:[{ startP:[586, 460], endP:[526, 290] }] }, { fillColor:'#3d90df', moveLine: [{ startP:[586, 190], endP: [586, 80] }] }, { moveLine: [{ startP:[586, 80], endP: [456, 80] }] }, { moveLine: [{ startP:[440, 80], endP: [380, 80] },{ startP:[380, 80], endP: [380, 170] }] }, { moveLine: [{ startP:[380, 226], endP: [380, 320] },{ startP:[380, 320], endP: [440, 320] }] }, { moveLine: [{ startP:[456, 320], endP: [480, 320] },{ startP:[480, 320], endP:[480, 360] }] } ]; // 放电测试 var disChargeCurr = [ { moveLine: [{ startP:[480, 360], endP:[480, 320] },{ startP:[480, 320], endP:[456, 320] }] }, { moveLine: [{ startP: [440, 320], endP: [305, 320] }] }, { moveLine: [{ startP: [250, 320], endP: [120, 320] }] }, { moveLine: [{ startP: [120, 320], endP: [120, 250] }] }, { moveLine: [{ startP: [120, 150], endP: [120, 80] }] }, { moveLine: [{ startP: [120, 80], endP: [220, 80] }] }, { moveLine: [{ startP: [220, 80], endP: [440, 80] }] }, { moveLine: [{ startP: [456, 80], endP: [740, 80] }] }, { moveLine: [{ startP: [740, 80], endP: [740, 190] }] }, { moveLine: [{ startP: [740, 290], endP: [740, 460] }] }, { moveLine: [{ startP: [740, 460], endP: [586, 460] }] }, { moveLine: [{ startP:[586, 460], endP:[480, 460] },{ startP:[480, 460], endP:[480, 440] }] } ]; // 稳流充电电流 var constCurr = [ { moveLine:[{ startP:[480, 440], endP: [480, 460] },{ startP:[480, 460], endP:[586, 460] }] }, { moveLine:[{ startP:[586, 460], endP:[526, 290] }] }, { moveLine: [{ startP:[586, 190], endP: [586, 80] }] }, { moveLine: [{ startP:[586, 80], endP: [456, 80] }] }, { moveLine: [{ startP:[440, 80], endP: [380, 80] }] }, { moveLine: [{ startP: [380, 80], endP: [220, 80] }] }, { moveLine: [{ startP: [220, 80], endP: [220, 150] }] }, { moveLine: [{ startP: [220, 250], endP: [220, 320] },{ startP: [220, 320], endP: [250, 320] }] }, { moveLine: [{ startP: [305, 320], endP: [440, 320] }] }, { moveLine: [{ startP: [456, 320], endP: [480, 320] },{ startP: [480, 320], endP: [480, 360] }] }, ]; eleCircle.drawRectList(floatCurr); }); //elecircle-status ;(function($, window, documment, gl) { // 设置当前模块的命名空间为circleStatus gl.namespace('circleStatus'); // 定义电路拓扑图状态类 var Status = function(ele, options) { this.ele = ele; this.options = options; this._init(); if(this.options.length != 0) { this.show(); } }; // 声明原型变量 var _prop = Status.prototype; // 初始化内容 _prop._init = function() { // 清理当前容器的内容 this.ele.hide(); this.ele.text(""); // 使用js的方式生成特定的元素 var _ul = $(''); // 遍历options for(var i=0; i'); this._setLi(_li, _opts); _ul.append(_li); } 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 = $(''); // 清空li li.text(""); // 内容仅有两种 if(option.type == 'bool') { // 当前是告警 if(option.status == 0) { li.addClass('elecircle-status-warn'); _i = $(''); _a = $(''+option.warn.text+''); }else { li.removeClass('elecircle-status-warn'); _i = $(''); _a = $(''+option.normal.text+''); } li.append(_i); }else if(option.type == 'list') { if(isFunction(option.imgCallback)) { var img = option.imgCallback(option.status);; _a.append(img); } 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); } li.append(_a); if(option.notShow) { li.hide(); }else { li.show(); } }; // 根据配置项的值获取 // 显示 _prop.show = function() { this.ele.show(); }; // 隐藏 _prop.hide = function() { this.ele.hide(); }; // 根据设置状态内容 _prop.setStatus = function(name, status, notShow) { var _itemList = this.ele.find('li'); // 遍历配置项 for(var i =0; i0 && (data.dev_testgroupnum == (batt.GroupIndexInFBSDevice+1))){ mygraph.graphtype = 1; _str = '(开关断开)'; }else{ if(mygraph.battstate == 3){ mygraph.graphtype = 1; _str = '(开关断开)'; }else{ mygraph.graphtype = 0; _str = '(开关闭合)'; } } // 当前设备是BTS设备 if(data.dev_testtype == 81) { _str += '(KD测试)'; mygraph.graphtype = 5; } } break; case 2: { //辨别当前电池组是否在充电 if(mygraph.battstate == 2 || ((data.dev_testgroupnum >0) && data.dev_testgroupnum == (batt.GroupIndexInFBSDevice+1))){ //充电 if(alarmstatus == 1 || alarmstatus == 2 || alarmstatus == 3 || alarmstatus == 4 || alarmstatus == 6){ //限流充电 -->常闭接触器断开 mygraph.graphtype = 2; _str = '(开关断开)'; }else{ //直流充电 -->常闭接触器闭合 mygraph.graphtype = 3 ; _str = '(开关闭合)'; } }else{ mygraph.graphtype = 0; _str = '(开关闭合)'; } } break; default:{ //未知 mygraph.graphtype = 4 ; _str = '(未知)'; } break; } // 设置左上方内容 if(typeof callback == 'function') { callback.apply({}, [batt, data, mygraph]); } }else { // console.log(123); mygraph.graphtype = 4 ; _str = '(未连接)'; // 回调函数 if(typeof callback == 'function') { callback(); } } // console.log(lasttype+"**"+mygraph.graphtype); // 判断是否更新拓扑图 if(lasttype != mygraph.graphtype){ mygraph.ischange = 1; } //console.log(mygraph); return _str; } gl.circleStatus.BTSCircle = BTSCircle; // 61850拓扑图显示 function BTS61850Circle(batt, model, mygraph, callback) { var _str = ""; var lasttype = mygraph.graphtype; if(model.code == 1) { 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:'未知']; //workstatus = 3; switch(workstatus) { case 0:{ //浮充状态拓扑图 mygraph.graphtype = 0; _str = '(开关闭合)'; } break; case 4:{ //浮充状态(内阻测试)拓扑图 mygraph.graphtype = 0; _str = '(开关闭合)'; // 当前设备是否是内阻测试 _str += '(内阻测试)'; } break; case 1:{ //充电状态拓扑图 mygraph.graphtype = 2; _str = '(开关断开)'; } break; case 2:{ //放电状态拓扑图 mygraph.graphtype = 1; _str = '(开关断开)'; } break; case 3:{ //放电状态拓扑图 mygraph.graphtype = 6; _str = '(开关闭合)'; } break; case 5:{ //放电状态(KD测试)拓扑图 mygraph.graphtype = 1; _str = '(开关断开)'; _str += '(KD测试)'; mygraph.graphtype = 5; } break; default:{ //未知 mygraph.graphtype = 4 ; _str = '(未知)'; } break; } // 执行callback函数 if(typeof callback == 'function') { callback.apply({}, [batt, data, mygraph]); } }else { mygraph.graphtype = 4 ; _str = '(未连接)'; // 回调函数更新拓扑图内容 if(typeof callback == 'function') { callback(); } } // 判断是否更新拓扑图 if(lasttype != mygraph.graphtype){ mygraph.ischange = 1; } return _str; } gl.circleStatus.BTS61850Circle = BTS61850Circle; // 验证设备类型 function regEquipType(eId, pattern) { // 遍历所有的形参 for(var i=1; i