whychdw
2019-11-09 bc3d486d87a18963583fb33cebb5fb7e69b33e55
拓扑图修改 添加设备未连接状态
2个文件已修改
168 ■■■■■ 已修改文件
Idce_Lithium/WebRoot/control.jsp 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Idce_Lithium/WebRoot/js/kw/kw.js 144 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Idce_Lithium/WebRoot/control.jsp
@@ -295,8 +295,25 @@
                // 测试容量
                $("#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);
                // 设置丢包率
@@ -307,7 +324,10 @@
                
                // 电路拓扑图状态
                var topgraphType = '';
                switch(data.dev_workstate) {
                // 设备工作状态
                var devWorkState = isOutTime?-1:data.dev_workstate;
                // 根据设备工作状态选择拓扑图模式
                switch(devWorkState) {
                    case 2:
                        topgraphType = 'charge';
                    break;
Idce_Lithium/WebRoot/js/kw/kw.js
@@ -30,7 +30,7 @@
            y: lTopPoint.y,
        },
        end: {
            x: 118,
            x: testModule.line1.start.x,
            y: lTopPoint.y,
        },
        lineWidth: 1,
@@ -47,7 +47,7 @@
            y: lBottomPoint.y,
        },
        end: {
            x: 118,
            x: testModule.line1.start.x,
            y: lBottomPoint.y,
        },
        lineWidth: 1,
@@ -56,14 +56,17 @@
    // 绘制线
    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);
@@ -199,6 +202,50 @@
            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) {
@@ -631,12 +678,15 @@
    }
    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        // 整流器
    }
@@ -730,9 +780,9 @@
    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,
@@ -746,14 +796,14 @@
            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,
@@ -767,9 +817,9 @@
            x: line.start.x,
            y: line.start.y
        },
    };
    };*/
    // 添加到配置项中
    options.push(option);
    // options.push(option);
    // 线条
    var line = list.loaderImg.line1;
@@ -899,11 +949,11 @@
    // 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,
            y: line2.start.y
@@ -921,11 +971,11 @@
    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,
            y: line1.start.y
@@ -1037,49 +1087,6 @@
    };
    // 添加到配置项中
    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;
    // 配置项
@@ -1207,12 +1214,13 @@
    // 添加到配置项中
    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
@@ -1230,11 +1238,11 @@
    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