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
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
| // 基础配置
| let springGreen = "#50cef5";
| let red = "#b370fe";
| let scalcRadius = 6;
| // 放电状态
| 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 == "run") {
| runCharge(diagram);
| }
|
| if (type == "bigPower") {
| bigPowerCharge(diagram);
| }
|
| if (type == "eleBoard") {
| eleBoardCharge(diagram);
| }
|
| if (type == "speedCabinet") {
| speedCabinetCharge(diagram);
| }
|
| if (type == "electric") {
| electricCharge(diagram);
| }
|
| if (type == "sensor") {
| sensorCharge(diagram);
| }
|
| if (type == "dynamometer") {
| dynamometerCharge(diagram);
| }
|
| if (type == "AFEcabinet") {
| AFEcabinetCharge(diagram);
| }
|
| if (type == "transformer") {
| transformerCharge(diagram);
| }
|
| if (type == "waterStation") {
| waterStationCharge(diagram);
| }
|
| if (type == "oilStation") {
| oilStationCharge(diagram);
| }
|
| if (type == "switch5000") {
| switch5000Charge(diagram);
| }
|
| if (type == "switch32001") {
| switch32001Charge(diagram);
| }
|
| if (type == "switch32002") {
| switch32002Charge(diagram);
| }
|
| if (type == "switch5200") {
| switch5200Charge(diagram);
| }
| }
|
| // 浮充状态
| function runCharge(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]],
| });
|
| // diagram.moveDot({
| // id: 'line2_dot',
| // fillStyle: springGreen,
| // strokeStyle: springGreen,
| // radius: scalcRadius,
| // flush: true,
| // points: line2,
| // });
|
| // 线条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]],
| });
|
| // diagram.moveDot({
| // id: 'line4_dot',
| // fillStyle: springGreen,
| // strokeStyle: springGreen,
| // radius: scalcRadius,
| // flush: true,
| // points: line4,
| // });
|
| // 线条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]],
| });
|
| // diagram.moveDot({
| // id: 'line6_dot',
| // fillStyle: springGreen,
| // strokeStyle: springGreen,
| // radius: scalcRadius,
| // flush: true,
| // points: line6,
| // });
|
| // 线条7
| let line7 = diagram.getOption('line7').points;
| diagram.moveDot({
| id: 'line7_dot',
| fillStyle: springGreen,
| strokeStyle: springGreen,
| radius: scalcRadius,
| flush: true,
| points: line7,
| });
|
|
| // 线条8
| let line8 = diagram.getOption('line8').points;
| diagram.moveDot({
| id: 'line8_dot',
| fillStyle: springGreen,
| strokeStyle: springGreen,
| radius: scalcRadius,
| flush: true,
| points: line8,
| });
|
| // 线条9
| let line9 = diagram.getOption('line9').points;
| diagram.moveDot({
| id: 'line9_dot',
| fillStyle: springGreen,
| strokeStyle: springGreen,
| radius: scalcRadius,
| flush: true,
| points: line9,
| });
|
|
| // 线条10
| let line10 = diagram.getOption('line10').points;
| diagram.moveDot({
| id: 'line10_dot',
| fillStyle: springGreen,
| strokeStyle: springGreen,
| radius: scalcRadius,
| flush: true,
| points: line10,
| });
|
|
| // 线条11
| let line11 = diagram.getOption('line11').points;
| diagram.moveDot({
| id: 'line11_dot',
| fillStyle: springGreen,
| strokeStyle: springGreen,
| radius: scalcRadius,
| flush: true,
| points: line11,
| });
|
| // 线条12
| let line12 = diagram.getOption('line12').points;
| diagram.moveDot({
| id: 'line12_dot',
| fillStyle: springGreen,
| strokeStyle: springGreen,
| radius: scalcRadius,
| flush: true,
| points: line12,
| });
|
|
| // 线条13
| let line13 = diagram.getOption('line13').points;
| diagram.moveDot({
| id: 'line13_dot',
| fillStyle: springGreen,
| strokeStyle: springGreen,
| radius: scalcRadius,
| flush: true,
| points: line13,
| });
|
| // 线条14
| let line14 = diagram.getOption('line14').points;
| // 线条15
| let line15 = diagram.getOption('line15').points;
| diagram.moveDot({
| id: 'line14_dot',
| fillStyle: springGreen,
| strokeStyle: springGreen,
| radius: scalcRadius,
| flush: true,
| points: [line14[0], line15[1]],
| });
|
|
| // diagram.moveDot({
| // id: 'line15_dot',
| // fillStyle: springGreen,
| // strokeStyle: springGreen,
| // radius: scalcRadius,
| // flush: true,
| // points: line15,
| // });
| }
|
| function bigPowerCharge(diagram) {
| //大功率整流电源
| let Image2 = diagram.getOption('img2');
| diagram.ripples({
| id: 'ripples1',
| flush: true,
| color: '#50cef5',
| point: [Image2.point[0] + Image2.width / 2, Image2.point[1] + Image2.height / 2],
| maxRadius: Image2.width > Image2.height ? (Image2.width / 2) + 15 : (Image2.height / 2) + 15,
| minRadius: Image2.width > Image2.height ? Image2.width / 4 : Image2.height / 4,
| radius: Image2.width > Image2.height ? Image2.width / 2 : Image2.height / 2,
| })
| let line18 = diagram.getOption('line18').points;
| diagram.moveDot({
| id: 'line18_dot',
| fillStyle: springGreen,
| strokeStyle: springGreen,
| radius: scalcRadius,
| flush: true,
| points: [
| [line18[0][0] - 35, line18[0][1]],
| [line18[1][0] + 35, line18[1][1]]
| ],
| });
| }
|
| function eleBoardCharge(diagram) {
| //直流主配电板
| let Image3 = diagram.getOption('img3');
| diagram.ripples({
| id: 'ripples2',
| flush: true,
| color: '#50cef5',
| point: [Image3.point[0] + Image3.width / 2, Image3.point[1] + Image3.height / 2],
| maxRadius: Image3.width > Image3.height ? (Image3.width / 2) + 15 : (Image3.height / 2) + 15,
| minRadius: Image3.width > Image3.height ? Image3.width / 4 : Image3.height / 4,
| radius: Image3.width > Image3.height ? Image3.width / 2 : Image3.height / 2,
| })
| let line18 = diagram.getOption('line18').points;
| let line19 = diagram.getOption('line19').points;
| let line20 = diagram.getOption('line20').points;
| let line21 = diagram.getOption('line21').points;
|
| diagram.moveDot({
| id: 'line21_dot',
| fillStyle: springGreen,
| strokeStyle: springGreen,
| radius: scalcRadius,
| flush: true,
| points: [
| [line18[0][0] - 35, line21[1][1]],
| [line21[0][0], line21[0][1]],
| ],
| });
| diagram.moveDot({
| id: 'line20_dot',
| fillStyle: springGreen,
| strokeStyle: springGreen,
| radius: scalcRadius,
| flush: true,
| points: [
| [line20[1][0], line20[1][1]],
| [line20[0][0], line20[0][1]],
| ],
| });
| diagram.moveDot({
| id: 'line19_dot',
| fillStyle: springGreen,
| strokeStyle: springGreen,
| radius: scalcRadius,
| flush: true,
| points: [
| [line19[0][0], line19[0][1]],
| [line19[1][0] + 35, line19[1][1]],
| ],
| });
| }
|
| function speedCabinetCharge(diagram) {
| //直流调速柜
| let Image4 = diagram.getOption('img4');
| diagram.ripples({
| id: 'ripples3',
| flush: true,
| color: '#50cef5',
| point: [Image4.point[0] + Image4.width / 2, Image4.point[1] + Image4.height / 2],
| maxRadius: Image4.width > Image4.height ? (Image4.width / 2) + 15 : (Image4.height / 2) + 15,
| minRadius: Image4.width > Image4.height ? Image4.width / 4 : Image4.height / 4,
| radius: Image4.width > Image4.height ? Image4.width / 2 : Image4.height / 2,
| })
|
| let line22 = diagram.getOption('line22').points;
| let line23 = diagram.getOption('line23').points;
| let line24 = diagram.getOption('line24').points;
| let line25 = diagram.getOption('line25').points;
| let line26 = diagram.getOption('line26').points;
|
| diagram.moveDot({
| id: 'line26_dot',
| fillStyle: springGreen,
| strokeStyle: springGreen,
| radius: scalcRadius,
| flush: true,
| points: [
| [line26[1][0] - 35, line26[1][1]],
| [line26[0][0], line26[0][1]],
| ],
| });
| diagram.moveDot({
| id: 'line25_dot',
| fillStyle: springGreen,
| strokeStyle: springGreen,
| radius: scalcRadius,
| flush: true,
| points: [
| [line25[1][0], line25[1][1]],
| [line25[0][0], line25[0][1]],
| ],
| });
| diagram.moveDot({
| id: 'line24_dot',
| fillStyle: springGreen,
| strokeStyle: springGreen,
| radius: scalcRadius,
| flush: true,
| points: [
| [line24[1][0], line24[1][1]],
| [line24[0][0], line24[0][1]],
| ],
| });
| diagram.moveDot({
| id: 'line23_dot',
| fillStyle: springGreen,
| strokeStyle: springGreen,
| radius: scalcRadius,
| flush: true,
| points: [
| [line23[1][0], line23[1][1]],
| [line23[0][0], line23[0][1]],
| ],
| });
| diagram.moveDot({
| id: 'line22_dot',
| fillStyle: springGreen,
| strokeStyle: springGreen,
| radius: scalcRadius,
| flush: true,
| points: [
| [line22[0][0], line22[0][1]],
| [line22[1][0] + 35, line22[1][1]],
| ],
| });
| }
|
| function electricCharge(diagram) {
| //电机
| let Image5 = diagram.getOption('img5');
| diagram.ripples({
| id: 'ripples4',
| flush: true,
| color: '#50cef5',
| point: [Image5.point[0] + Image5.width / 2, Image5.point[1] + Image5.height / 2],
| maxRadius: Image5.width > Image5.height ? (Image5.width / 2) + 15 : (Image5.height / 2) + 15,
| minRadius: Image5.width > Image5.height ? Image5.width / 4 : Image5.height / 4,
| radius: Image5.width > Image5.height ? Image5.width / 2 : Image5.height / 2,
| })
|
| let line27 = diagram.getOption('line27').points;
| let line28 = diagram.getOption('line28').points;
|
| diagram.moveDot({
| id: 'line28_dot',
| fillStyle: springGreen,
| strokeStyle: springGreen,
| radius: scalcRadius,
| flush: true,
| points: [
| [line28[1][0], line28[1][1] + 35],
| [line28[0][0], line28[0][1]],
| ],
| });
| diagram.moveDot({
| id: 'line27_dot',
| fillStyle: springGreen,
| strokeStyle: springGreen,
| radius: scalcRadius,
| flush: true,
| points: [
| [line27[0][0], line27[0][1]],
| [line27[1][0] + 35, line27[1][1]],
| ],
| });
| let line30 = diagram.getOption('line30').points;
| let line31 = diagram.getOption('line31').points;
| let line29 = diagram.getOption('line29').points;
|
| diagram.moveDot({
| id: 'line30_dot',
| fillStyle: springGreen,
| strokeStyle: springGreen,
| radius: scalcRadius,
| flush: true,
| points: [
| [line30[1][0] - 35, line30[1][1]],
| [line30[0][0], line30[0][1]],
| ],
| });
| diagram.moveDot({
| id: 'line31_dot',
| fillStyle: springGreen,
| strokeStyle: springGreen,
| radius: scalcRadius,
| flush: true,
| points: [
| [line31[0][0], line31[0][1]],
| [line31[1][0], line31[1][1] - 35],
| ],
| });
| //震动测试器
| let Image14 = diagram.getOption('img14');
| diagram.ripples({
| id: 'ripples14',
| flush: true,
| color: '#50cef5',
| point: [Image14.point[0] + Image14.width / 2, Image14.point[1] + Image14.height / 2],
| maxRadius: Image14.width > Image14.height ? (Image14.width / 2) + 15 : (Image14.height / 2) + 15,
| minRadius: Image14.width > Image14.height ? Image14.width / 4 : Image14.height / 4,
| radius: Image14.width > Image14.height ? Image14.width / 2 : Image14.height / 2,
| })
| diagram.moveDot({
| id: 'line29_dot',
| fillStyle: springGreen,
| strokeStyle: springGreen,
| radius: scalcRadius,
| flush: true,
| points: [
| [line29[1][0], line29[1][1] + 35],
| [line29[0][0], line29[0][1] - 35],
| ],
| });
| }
|
| function sensorCharge(diagram) {
| //扭矩传感器
| let Image7 = diagram.getOption('img7');
| diagram.ripples({
| id: 'ripples5',
| flush: true,
| color: '#50cef5',
| point: [Image7.point[0] + Image7.width / 2, Image7.point[1] + Image7.height / 2],
| maxRadius: Image7.width > Image7.height ? (Image7.width / 2) + 15 : (Image7.height / 2) + 15,
| minRadius: Image7.width > Image7.height ? Image7.width / 4 : Image7.height / 4,
| radius: Image7.width > Image7.height ? Image7.width / 2 : Image7.height / 2,
| })
| let line32 = diagram.getOption('line32').points;
| diagram.moveDot({
| id: 'line32_dot',
| fillStyle: springGreen,
| strokeStyle: springGreen,
| radius: scalcRadius,
| flush: true,
| points: [
| [line32[1][0], line32[1][1] + 35],
| [line32[0][0], line32[0][1] - 35],
| ],
| });
| }
|
| function dynamometerCharge(diagram) {
| //测功机
| let Image8 = diagram.getOption('img8');
| diagram.ripples({
| id: 'ripples6',
| flush: true,
| color: '#50cef5',
| point: [Image8.point[0] + Image8.width / 2, Image8.point[1] + Image8.height / 2],
| maxRadius: Image8.width > Image8.height ? (Image8.width / 2) + 15 : (Image8.height / 2) + 15,
| minRadius: Image8.width > Image8.height ? Image8.width / 4 : Image8.height / 4,
| radius: Image8.width > Image8.height ? Image8.width / 2 : Image8.height / 2,
| })
| let line35 = diagram.getOption('line35').points;
| let line34 = diagram.getOption('line34').points;
| let line33 = diagram.getOption('line33').points;
| diagram.moveDot({
| id: 'line35_dot',
| fillStyle: springGreen,
| strokeStyle: springGreen,
| radius: scalcRadius,
| flush: true,
| points: [
| [line35[1][0] + 35, line35[1][1]],
| [line35[0][0], line35[0][1]],
| ],
| });
| diagram.moveDot({
| id: 'line34_dot',
| fillStyle: springGreen,
| strokeStyle: springGreen,
| radius: scalcRadius,
| flush: true,
| points: [
| [line34[1][0], line34[1][1]],
| [line34[0][0], line34[0][1]],
| ],
| });
| diagram.moveDot({
| id: 'line33_dot',
| fillStyle: springGreen,
| strokeStyle: springGreen,
| radius: scalcRadius,
| flush: true,
| points: [
| [line33[1][0], line33[1][1]],
| [line33[0][0] - 35, line33[0][1]],
| ],
| });
| }
|
| function AFEcabinetCharge(diagram) {
| //变频柜
| let Image9 = diagram.getOption('img9');
| diagram.ripples({
| id: 'ripples7',
| flush: true,
| color: '#50cef5',
| point: [Image9.point[0] + Image9.width / 2, Image9.point[1] + Image9.height / 2],
| maxRadius: Image9.width > Image9.height ? (Image9.width / 2) + 15 : (Image9.height / 2) + 15,
| minRadius: Image9.width > Image9.height ? Image9.width / 4 : Image9.height / 4,
| radius: Image9.width > Image9.height ? Image9.width / 2 : Image9.height / 2,
| })
| let line36 = diagram.getOption('line36').points;
| let line37 = diagram.getOption('line37').points;
| let line38 = diagram.getOption('line38').points;
| diagram.moveDot({
| id: 'line38_dot',
| fillStyle: springGreen,
| strokeStyle: springGreen,
| radius: scalcRadius,
| flush: true,
| points: [
| [line38[1][0] + 35, line38[1][1]],
| [line38[0][0], line38[0][1]],
| ],
| });
| diagram.moveDot({
| id: 'line37_dot',
| fillStyle: springGreen,
| strokeStyle: springGreen,
| radius: scalcRadius,
| flush: true,
| points: [
| [line37[1][0], line37[1][1]],
| [line37[0][0], line37[0][1]],
| ],
| });
| diagram.moveDot({
| id: 'line36_dot',
| fillStyle: springGreen,
| strokeStyle: springGreen,
| radius: scalcRadius,
| flush: true,
| points: [
| [line36[1][0], line36[1][1]],
| [line36[0][0] - 35, line36[0][1]],
| ],
| });
| }
|
| function transformerCharge(diagram) {
| //变压器
| let Image10 = diagram.getOption('img10');
| diagram.ripples({
| id: 'ripples8',
| flush: true,
| color: '#50cef5',
| point: [Image10.point[0] + Image10.width / 2, Image10.point[1] + Image10.height / 2],
| maxRadius: Image10.width > Image10.height ? (Image10.width / 2) + 15 : (Image10.height / 2) + 15,
| minRadius: Image10.width > Image10.height ? Image10.width / 4 : Image10.height / 4,
| radius: Image10.width > Image10.height ? Image10.width / 2 : Image10.height / 2,
| })
| }
|
| function waterStationCharge(diagram) {
| //供水站
| let Image11 = diagram.getOption('img11');
| diagram.ripples({
| id: 'ripples9',
| flush: true,
| color: '#50cef5',
| point: [Image11.point[0] + Image11.width / 2, Image11.point[1] + Image11.height / 2],
| maxRadius: Image11.width > Image11.height ? (Image11.width / 2) + 15 : (Image11.height / 2) + 15,
| minRadius: Image11.width > Image11.height ? Image11.width / 4 : Image11.height / 4,
| radius: Image11.width > Image11.height ? Image11.width / 2 : Image11.height / 2,
| })
|
| let line16 = diagram.getOption('line16').points;
| diagram.moveDot({
| id: 'line16_dot',
| fillStyle: springGreen,
| strokeStyle: springGreen,
| radius: scalcRadius,
| flush: true,
| points: [line16[0],
| [line16[1][0] + 35, line16[1][1]]
| ],
| });
| }
|
| function oilStationCharge(diagram) {
| //供油站
| let Image12 = diagram.getOption('img12');
| diagram.ripples({
| id: 'ripples10',
| flush: true,
| color: '#50cef5',
| point: [Image12.point[0] + Image12.width / 2, Image12.point[1] + Image12.height / 2],
| maxRadius: Image12.width > Image12.height ? (Image12.width / 2) + 15 : (Image12.height / 2) + 15,
| minRadius: Image12.width > Image12.height ? Image12.width / 4 : Image12.height / 4,
| radius: Image12.width > Image12.height ? Image12.width / 2 : Image12.height / 2,
| })
|
| let line17 = diagram.getOption('line17').points;
| diagram.moveDot({
| id: 'line17_dot',
| fillStyle: springGreen,
| strokeStyle: springGreen,
| radius: scalcRadius,
| flush: true,
| points: [line17[0],
| [line17[1][0] + 35, line17[1][1]]
| ],
| });
|
| }
|
| function switch5000Charge(diagram) {
| // 打开开关
| diagram.setOption('km1', 'state', true);
| }
|
| function switch32001Charge(diagram) {
| // 打开开关
| diagram.setOption('km2', 'state', true);
| }
|
| function switch32002Charge(diagram) {
| // 打开开关
| diagram.setOption('km3', 'state', true);
| }
|
| function switch5200Charge(diagram) {
| // 打开开关
| diagram.setOption('km4', 'state', true);
| }
|
|
| export default diagramStates;
|
|