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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
| // 基础配置
| 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);
| // run2Charge(diagram);
| // run3Charge(diagram);
| }
|
| if (type == "run2") {
| run2Charge(diagram);
| }
|
| if (type == "run3") {
| run3Charge(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]],
| });
| }
|
| // 运行状态2
| function run2Charge(diagram) {
|
| // // 线条3
| // let line3 = diagram.getOption('line3').points;
| // // 线条4
| // let line4 = diagram.getOption('line4').points;
| // diagram.moveDot({
| // id: 'line3_dot',
| // fillStyle: springGreen,
| // strokeStyle: springGreen,
| // radius: scalcRadius,
| // flush: true,
| // points: [line3[0], line4[1]],
| // });
| // // 线条5
| // let line5 = diagram.getOption('line5').points;
| // // 线条6
| // let line6 = diagram.getOption('line6').points;
| // diagram.moveDot({
| // id: 'line5_dot',
| // fillStyle: springGreen,
| // strokeStyle: springGreen,
| // radius: scalcRadius,
| // flush: true,
| // points: [line5[0], line6[1]],
| // });
| }
|
| function run3Charge(diagram) {
|
| // 线条1
| let line1 = diagram.getOption('line1').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[1]],
| });
|
| // 线条3
| let line3 = diagram.getOption('line3').points;
| // 线条4
| let line4 = diagram.getOption('line4').points;
| diagram.moveDot({
| id: 'line3_dot',
| fillStyle: springGreen,
| strokeStyle: springGreen,
| radius: scalcRadius,
| flush: true,
| points: [line3[0], line4[1]],
| });
|
|
| // 线条5
| let line5 = diagram.getOption('line5').points;
| // 线条6
| let line6 = diagram.getOption('line6').points;
| diagram.moveDot({
| id: 'line5_dot',
| fillStyle: springGreen,
| strokeStyle: springGreen,
| radius: scalcRadius,
| flush: true,
| points: [line5[0], line6[1]],
| });
|
| }
|
|
| export default diagramStates;
|
|