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;