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
| import Diagram from '@/assets/js/newDiagram'
| import dynamometry from '../images/dynamometry.png'
| import transformer from '../images/transformer.png'
| import testedmotor from '../images/testedmotor.png'
| // import ACImg from '../images/AC.png'
|
| const lineWidth = 2;
| const lineStrokeColor = '#105b96';
| const frequencyWidth = 96;
| const ACWidth = 124;
| const parameterWidth = 85;
|
|
| function girdCircuitDiagram(stc, flush) {
|
| let diagram = new Diagram();
| // let thisWidth = stc.scrollWidth;
| // let thisHeight = stc.scrollHeight;
| diagram.width = 236;
| diagram.height= 579;
| diagram.setCanvas(stc, flush);
|
| let start = [1, 40];
| let line1 = diagram.line({
| id: 'line1',
| strokeStyle: lineStrokeColor,
| lineWidth: lineWidth,
| points: [
| start,
| [start[0]+200, start[1]]
| ]
| });
| let line2 = diagram.line({
| id: 'line2',
| strokeStyle: lineStrokeColor,
| lineWidth: lineWidth,
| points: [
| [line1[0][0]+110,line1[0][1]],
| [line1[0][0]+110, line1[0][1]+30]
| ]
| });
| let arc1 = diagram.arc({
| id: 'arc1',
| point: [
| line2[1][0], line2[1][1]
| ],
| fillStyle: lineStrokeColor,
| strokeStyle: lineStrokeColor,
| radius: 3,
| type: 'fill'
| })
| let line3 = diagram.line({
| id: 'line3',
| strokeStyle: lineStrokeColor,
| lineWidth: lineWidth,
| points: [
| [line2[1][0],line2[1][1] + 30],
| [line2[1][0], line2[1][1] + 120]
| ]
| });
| let arc2 = diagram.arc({
| id: 'arc2',
| point: [
| line3[0][0], line3[0][1]
| ],
| fillStyle: lineStrokeColor,
| strokeStyle: lineStrokeColor,
| radius: 3,
| type: 'fill'
| })
| let line4 = diagram.line({
| id: 'line4',
| strokeStyle: lineStrokeColor,
| lineWidth: lineWidth,
| points: [
| [line3[0][0],line3[0][1]],
| [line2[1][0], line2[1][1]]
| ]
| });
|
| let line5 = diagram.line({
| id: 'line5',
| strokeStyle: lineStrokeColor,
| lineWidth: lineWidth,
| points: [
| [line3[1][0],line3[1][1]+200],
| [line3[1][0], line3[1][1]+330]
| ]
| });
| // 虚线矩形
| let dashLine1 =diagram.dashLine({
| id:"diagram1",
| strokeStyle: lineStrokeColor,
| lineWidth: lineWidth,
| points: [
| [line3[1][0]+113,line3[1][1]],
| [line3[1][0]-110, line3[1][1]]
| ]
| })
| let dashLine2 =diagram.dashLine({
| id:"diagram2",
| strokeStyle: lineStrokeColor,
| lineWidth: lineWidth,
| points: [
| [dashLine1[1][0],dashLine1[1][1]],
| [dashLine1[1][0], dashLine1[1][1]+200]
| ]
| })
| let dashLine3 =diagram.dashLine({
| id:"diagram3",
| strokeStyle: lineStrokeColor,
| lineWidth: lineWidth,
| points: [
| [dashLine2[1][0],dashLine2[1][1]],
| [dashLine1[0][0], dashLine1[0][1]+200]
| ]
| })
| let dashLine4 =diagram.dashLine({
| id:"diagram4",
| strokeStyle: lineStrokeColor,
| lineWidth: lineWidth,
| points: [
| [dashLine3[1][0],dashLine3[1][1]],
| [dashLine1[0][0], dashLine1[0][1]]
| ]
| })
| let Image1 = diagram.drawImage({
| id: 'img1',
| url: transformer,
| point: [line3[0][0]-30, line3[0][1]+10],
| width: 70,
| height:60,
| })
|
| let Image2 = diagram.drawImage({
| id: 'img2',
| url: dynamometry,
| point: [line5[0][0]-40, line5[0][1]+20],
| width: 70,
| height:60,
| })
| let Image3 = diagram.drawImage({
| id: 'img3',
| url: testedmotor,
| point: [line5[1][0]-40, line5[1][1]-30],
| width: 70,
| height:60,
| })
|
| let text1 = diagram.text({
| id: "text1",
| text: '10KV母线',
| fillStyle: '#ffff18',
| fontSize: 12,
| fontWidth:1,
| point:[line1[1][0]-50,line1[1][1]-20],
| showPanel: false,
| });
| let text2 = diagram.text({
| id: "text2",
| text: '升压变压器',
| fillStyle: '#ffff18',
| fontSize: 12,
| fontWidth:1,
| point:[line2[1][0]-70,line2[1][1]+40],
| showPanel: false,
| });
| let text3 = diagram.text({
| id: "text3",
| text: 'AFE变频驱动柜',
| fillStyle: '#ffff18',
| fontSize: 12,
| fontWidth:1,
| point:[dashLine1[1][0]+10,dashLine1[1][1]+10],
| showPanel: false,
| });
| let text4 = diagram.text({
| id: "text4",
| text: '受功电机',
| fillStyle: '#ffff18',
| fontSize: 12,
| fontWidth:1,
| point:[dashLine3[1][0]-90,dashLine3[1][1]+30],
| showPanel: false,
| });
| let text5 = diagram.text({
| id: "text5",
| text: '受试电机',
| fillStyle: '#ffff18',
| fontSize: 12,
| fontWidth:1,
| point:[line5[1][0]+20,line5[1][1]-40],
| showPanel: false,
| });
|
| let text6 = diagram.text({
| id: "text6",
| text: '&&水&&冷&&柜&&',
| fillStyle: '#ffff18',
| fontSize: 12,
| fontWidth:1,
| point:[dashLine1[1][0]+20,dashLine1[1][1]+45],
| showPanel: false,
| type:true,
| radBorder: true,
| bgColor:"#1E8EDF"
| });
| let text7 = diagram.text({
| id: "text7",
| text: '&整流模块&',
| fillStyle: '#ffff18',
| fontSize: 12,
| fontWidth:1,
| point:[dashLine1[1][0]+65,dashLine1[1][1]+45],
| showPanel: false,
| type:true,
| radBorder: true,
| bgColor:"#1E8EDF"
| });
| let text8 = diagram.text({
| id: "text8",
| text: '&逆 变 柜 &',
| fillStyle: '#ffff18',
| fontSize: 12,
| fontWidth:1,
| point:[text6.right[0]+18,text6.right[1]+25],
| // point:[dashLine1[1][0]+65,dashLine1[1][1]+142],
| showPanel: false,
| type:true,
| radBorder: true,
| bgColor:"#1E8EDF"
| });
| let text9 = diagram.text({
| id: "text9",
| text: '&&控&&制&&柜&&',
| fillStyle: '#ffff18',
| fontSize: 12,
| fontWidth:1,
| point:[dashLine1[1][0]+145,dashLine1[1][1]+45],
| showPanel: false,
| type:true,
| radBorder: true,
| bgColor:"#1E8EDF"
| });
| let text10 = diagram.text({
| id: "text10",
| text: '&&进&&线&&柜&&',
| fillStyle: '#ffff18',
| fontSize: 12,
| fontWidth:1,
| point:[dashLine1[1][0]+190,dashLine1[1][1]+45],
| showPanel: false,
| type:true,
| radBorder: true,
| bgColor:"#1E8EDF"
| });
|
|
|
|
|
|
|
|
|
| return diagram;
| }
|
|
| export default girdCircuitDiagram;
|
|