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
// 基础配置
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('line5').points;
        diagram.moveDot({
            id: 'line1_dot',
            fillStyle: springGreen,
            strokeStyle: springGreen,
            radius: scalcRadius,
            flush: true,
            points: [line1[1], line1[0]],
        });
    // 线条1
    let line2 = diagram.getOption('line3').points;
    // 线条2
    let line3 = diagram.getOption('line2').points;
        diagram.moveDot({
            id: 'line2_dot',
            fillStyle: springGreen,
            strokeStyle: springGreen,
            radius: scalcRadius,
            flush: true,
            points: [line2[1], line3[0]],
        });
}
export default diagramStates;