| | |
| | | // 测试容量
|
| | | $("#test_content").val(data.dev_captest_cap.toFixed(1)+"AH");
|
| | |
|
| | | // 设备状态
|
| | | var outTime = 2*60; // 设备超时时间(2分钟)
|
| | | var isOutTime = false; //通讯中断 判断设备是否通讯中断 true:中断 false:正常
|
| | | var devStatus = data.note; // 设备状态
|
| | | var nowTime = new Date().getTime(); // 当前时间
|
| | | var record = new Date(data.record_datetime).getTime(); // 数据更新时间
|
| | | // 根据系统时间和数据更新日期对比,计算设备是否未连接
|
| | | if(Math.abs(nowTime-record)/1000 > outTime){
|
| | | isOutTime = true;
|
| | | }
|
| | | |
| | | // 系统是否通信超时
|
| | | if(isOutTime) {
|
| | | devStatus = '<span style="color: #FF0000">未连接</span>';
|
| | | }
|
| | | |
| | | |
| | | // 设置面板的值
|
| | | status8kw.setText('workstatus', '设备状态:'+data.note);
|
| | | status8kw.setText('workstatus', '设备状态:'+devStatus);
|
| | | status8kw.setText('stop', '上一次终止原因:'+data.stop_reason);
|
| | | status8kw.setText('signalCount', '通信计数:'+data.dev_commcount);
|
| | | // 设置丢包率
|
| | |
| | |
|
| | | // 电路拓扑图状态
|
| | | var topgraphType = '';
|
| | | switch(data.dev_workstate) {
|
| | | // 设备工作状态
|
| | | var devWorkState = isOutTime?-1:data.dev_workstate;
|
| | | // 根据设备工作状态选择拓扑图模式
|
| | | switch(devWorkState) {
|
| | | case 2:
|
| | | topgraphType = 'charge';
|
| | | break;
|
| | |
| | | y: lTopPoint.y,
|
| | | },
|
| | | end: {
|
| | | x: 118,
|
| | | x: testModule.line1.start.x,
|
| | | y: lTopPoint.y,
|
| | | },
|
| | | lineWidth: 1,
|
| | |
| | | y: lBottomPoint.y,
|
| | | },
|
| | | end: {
|
| | | x: 118,
|
| | | x: testModule.line1.start.x,
|
| | | y: lBottomPoint.y,
|
| | | },
|
| | | lineWidth: 1,
|
| | |
| | | };
|
| | | // 绘制线
|
| | | topgraph.drawLine(endLine);
|
| | |
|
| | | |
| | | // 绘制8kw后方的线
|
| | | var testMoudleBehindLine = draw8kwBehindLine(topgraph, startLine, endLine, rTopPoint, testModule);
|
| | | // console.log(testMoudleBehindLine)
|
| | | // 测试模块上方开关和线条
|
| | | var topSwitchs = drawTestModuleSwitch(topgraph, startLine);
|
| | | // var topSwitchs = drawTestModuleSwitch(topgraph, startLine);
|
| | |
|
| | | // 测试模块下方开关和线条
|
| | | var bottomSwitchs = drawTestModuleSwitch(topgraph, endLine, true);
|
| | | //var bottomSwitchs = drawTestModuleSwitch(topgraph, endLine, true);
|
| | |
|
| | | // 绘制电感
|
| | | var inductance = drawInductance(topgraph, topSwitchs.switch1Line2.start, bottomSwitchs.switch1Line2.start);
|
| | | // var inductance = drawInductance(topgraph, topSwitchs.switch1Line2.start, bottomSwitchs.switch1Line2.start);
|
| | |
|
| | | // 绘制整流器
|
| | | var screenImg = drawScreenImg(topgraph);
|
| | |
| | | };
|
| | | // 绘制line3
|
| | | topgraph.drawLine(line4);
|
| | |
|
| | | |
| | | return {
|
| | | line1: line1,
|
| | | line2: line2,
|
| | |
| | | line4: line4
|
| | | }
|
| | | }
|
| | | |
| | | // 绘制8kw后方的两条主线
|
| | | function draw8kwBehindLine(topgraph, startLine, endLine, rTopPoint,testModule) {
|
| | | // 上方线条
|
| | | var line1 = {
|
| | | id: 'testMoudleBehindLine1',
|
| | | start: {
|
| | | x: testModule.line2.start.x,
|
| | | y: startLine.start.y,
|
| | | },
|
| | | end: {
|
| | | x: rTopPoint.x,
|
| | | y: startLine.start.y,
|
| | | },
|
| | | lineWidth: 1,
|
| | | strokeStyle: "#000000",
|
| | | };
|
| | | // 绘制线
|
| | | topgraph.drawLine(line1);
|
| | | |
| | | // 下方线条
|
| | | var line2 = {
|
| | | id: 'testMoudleBehindLine2',
|
| | | start: {
|
| | | x: testModule.line2.start.x,
|
| | | y: endLine.start.y,
|
| | | },
|
| | | end: {
|
| | | x: rTopPoint.x,
|
| | | y: endLine.start.y,
|
| | | },
|
| | | lineWidth: 1,
|
| | | strokeStyle: "#FF0000",
|
| | | };
|
| | | // 绘制线
|
| | | topgraph.drawLine(line2);
|
| | | |
| | | return {
|
| | | line1: line1,
|
| | | line2: line2
|
| | | }
|
| | | }
|
| | | |
| | | |
| | |
|
| | | // 绘制测试模块中上方的开关和线条
|
| | | function drawTestModuleSwitch(topgraph, line1, pos) {
|
| | |
| | | }
|
| | |
|
| | | return {
|
| | | eleGroup2: eleGroup2, // 电池组1
|
| | | testModule: testModule, // 8KW测试框
|
| | | testMoudleBehindLine: testMoudleBehindLine, // 8kw测试框的后方的线
|
| | | eleGroup: eleGroup, // 电池组1
|
| | | eleGroup2: eleGroup2, // 电池组2
|
| | | startLine: startLine, // 开始线
|
| | | endLine: endLine, // 结束线
|
| | | topSwitchs: topSwitchs, // 上方开关
|
| | | bottomSwitchs: bottomSwitchs, // 下方开关
|
| | | inductance: inductance, // 电感
|
| | | //topSwitchs: topSwitchs, // 上方开关
|
| | | //bottomSwitchs: bottomSwitchs, // 下方开关
|
| | | // inductance: inductance, // 电感
|
| | | loaderImg: loaderImg, // 负载
|
| | | screenImg: screenImg // 整流器
|
| | | }
|
| | |
| | | options.push(option);
|
| | |
|
| | | // 线条
|
| | | var line = list.inductance.line1;
|
| | | // var line = list.inductance.line1;
|
| | | // 配置项
|
| | | var option = {
|
| | | /*var option = {
|
| | | id: 'moveArc_discharge_inductance_line1',
|
| | | start: {
|
| | | x: line.start.x,
|
| | |
| | | x: line.start.x,
|
| | | y: line.start.y
|
| | | },
|
| | | };
|
| | | };*/
|
| | | // 添加到配置项中
|
| | | options.push(option);
|
| | | //options.push(option);
|
| | |
|
| | | // 线条
|
| | | var line = list.inductance.line2;
|
| | | // var line = list.inductance.line2;
|
| | | // 配置项
|
| | | var option = {
|
| | | /*var option = {
|
| | | id: 'moveArc_discharge_inductance_line2',
|
| | | start: {
|
| | | x: line.start.x,
|
| | |
| | | x: line.start.x,
|
| | | y: line.start.y
|
| | | },
|
| | | };
|
| | | };*/
|
| | | // 添加到配置项中
|
| | | options.push(option);
|
| | | // options.push(option);
|
| | |
|
| | | // 线条
|
| | | var line = list.loaderImg.line1;
|
| | |
| | | };
|
| | | // 添加到配置项中
|
| | | // options.push(option);
|
| | |
|
| | | |
| | | // 线条
|
| | | var line1 = list.topSwitchs.switch2Line1;
|
| | | var line1 = list.testMoudleBehindLine.line1;
|
| | | var line2 = list.loaderImg.line1;
|
| | | // 配置项
|
| | | var option = {
|
| | | id: 'moveArc_discharge_topSwitch_loaderImg_line1',
|
| | | id: 'moveArc_discharge_testMoudleBehindLine_line1_loaderImg_line1',
|
| | | start: {
|
| | | x: line2.start.x,
|
| | | x: line2.start.x,
|
| | | y: line2.start.y
|
| | | },
|
| | | end: {
|
| | | x: line1.start.x,
|
| | | x: line1.start.x,
|
| | | y: line1.start.y
|
| | | },
|
| | | point: {
|
| | | x: line2.start.x,
|
| | | x: line2.start.x,
|
| | | y: line2.start.y
|
| | | },
|
| | | };
|
| | | // 添加到配置项中
|
| | | options.push(option);
|
| | |
|
| | | |
| | | // 线条
|
| | | var line1 = list.bottomSwitchs.switch2Line1;
|
| | | var line1 = list.testMoudleBehindLine.line2;
|
| | | var line2 = list.loaderImg.line2;
|
| | | // 配置项
|
| | | var option = {
|
| | | id: 'moveArc_discharge_bottomSwitchs_loaderImg_line1',
|
| | | id: 'moveArc_discharge_testMoudleBehindLine_line2_loaderImg_line2',
|
| | | start: {
|
| | | x: line1.start.x,
|
| | | x: line1.start.x,
|
| | | y: line1.start.y
|
| | | },
|
| | | end: {
|
| | | x: line2.end.x,
|
| | | x: line2.end.x,
|
| | | y: line2.end.y
|
| | | },
|
| | | point: {
|
| | | x: line1.start.x,
|
| | | x: line1.start.x,
|
| | | y: line1.start.y
|
| | | },
|
| | | };
|
| | |
| | | };
|
| | | // 添加到配置项中
|
| | | options.push(option);
|
| | |
|
| | | // 线条
|
| | | var line = list.inductance.line1;
|
| | | // 配置项
|
| | | var option = {
|
| | | id: 'moveArc_discharge_inductance_line1',
|
| | | start: {
|
| | | x: line.end.x,
|
| | | y: line.end.y
|
| | | },
|
| | | end: {
|
| | | x: line.start.x,
|
| | | y: line.start.y
|
| | | },
|
| | | point: {
|
| | | x: line.end.x,
|
| | | y: line.end.y
|
| | | },
|
| | | };
|
| | | // 添加到配置项中
|
| | | options.push(option);
|
| | |
|
| | | // 线条
|
| | | var line = list.inductance.line2;
|
| | | // 配置项
|
| | | var option = {
|
| | | id: 'moveArc_discharge_inductance_line2',
|
| | | start: {
|
| | | x: line.end.x,
|
| | | y: line.end.y
|
| | | },
|
| | | end: {
|
| | | x: line.start.x,
|
| | | y: line.start.y
|
| | | },
|
| | | point: {
|
| | | x: line.end.x,
|
| | | y: line.end.y
|
| | | },
|
| | | };
|
| | | // 添加到配置项中
|
| | | options.push(option);
|
| | |
|
| | | // 线条
|
| | | var line = list.loaderImg.line1;
|
| | | // 配置项
|
| | |
| | | };
|
| | | // 添加到配置项中
|
| | | options.push(option);
|
| | |
|
| | | |
| | | // console.log(list);
|
| | | // 线条
|
| | | var line1 = list.topSwitchs.switch2Line1;
|
| | | var line1 = list.testMoudleBehindLine.line1;
|
| | | var line2 = list.loaderImg.line1;
|
| | | // 配置项
|
| | | var option = {
|
| | | id: 'moveArc_discharge_topSwitch_loaderImg_line1',
|
| | | id: 'moveArc_discharge_testMoudleBehindLine_line1_loaderImg_line1',
|
| | | start: {
|
| | | x: line1.start.x,
|
| | | y: line1.start.y
|
| | |
| | | };
|
| | | // 添加到配置项中
|
| | | options.push(option);
|
| | |
|
| | | |
| | | // 线条
|
| | | var line1 = list.bottomSwitchs.switch2Line1;
|
| | | var line1 = list.testMoudleBehindLine.line2;
|
| | | var line2 = list.loaderImg.line2;
|
| | | // 配置项
|
| | | var option = {
|
| | | id: 'moveArc_discharge_bottomSwitchs_loaderImg_line1',
|
| | | id: 'moveArc_discharge_testMoudleBehindLine_line2_loaderImg_line2',
|
| | | start: {
|
| | | x: line2.end.x,
|
| | | y: line2.end.y
|