whycwx
2021-07-23 88e497e20a51a2a127c4bc59f036f5367ab0670e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
// 基础配置
let springGreen = "#50cef5";
let red = "#b370fe";
let scalcRadius = 3;
// 放电状态
function diagramStates(diagram, type) {
    // 断开所有的开关
    // diagram.setOption('km1', 'state', false);
    // diagram.setOption('km2', 'state', false);
    // diagram.setOption('km3', 'state', false);
    // diagram.setOption('km4', 'state', false);
    // 清除电流
    // diagram.del(/^line.*dot$/);
    if (type == "run1") {
        run1Charge(diagram);
    }
 
}
 
// 运行状态1
function run1Charge(diagram) {
    // 线条1
    let line1 = diagram.getOption('line3').points;
    // 线条2
    let line2 = diagram.getOption('line2').points;
        diagram.moveDot({
            id: 'line1_dot',
            fillStyle: springGreen,
            strokeStyle: springGreen,
            radius: scalcRadius,
            flush: true,
            points: [line1[0], line2[0]],
        });
    // 线条3
    let line3 = diagram.getOption('line5').points;
        diagram.moveDot({
            id: 'line2_dot',
            fillStyle: springGreen,
            strokeStyle: springGreen,
            radius: scalcRadius,
            flush: true,
            points: [line2[0], line3[1]],
        });
    //线条4
    let line4 = diagram.getOption('line6').points;
        diagram.moveDot({
            id: 'line3_dot',
            fillStyle: springGreen,
            strokeStyle: springGreen,
            radius: scalcRadius,
            flush: true,
            points: [line3[0], line4[1]],
        });
    // 线条5
    let line5 = diagram.getOption('line12').points;  
        diagram.moveDot({
            id: 'line4_dot',
            fillStyle: springGreen,
            strokeStyle: springGreen,
            radius: scalcRadius,
            flush: true,
            points: [line4[1], line5[1]],
        });
    // 线条6
    let line6 = diagram.getOption('line13').points;  
        diagram.moveDot({
            id: 'line5_dot',
            fillStyle: springGreen,
            strokeStyle: springGreen,
            radius: scalcRadius,
            flush: true,
            points: [line5[1], line6[1]],
        });
}
export default diagramStates;