import Diagram from '@/assets/js/newDiagram' import dynamometry from '../images/dynamometry.png' import testedmotor from '../images/testedmotor.png' import sensor from '../images/sensor.png' import shock from '../images/shock.png' import speedCabinet from '../images/speedCabinet.png' const lineWidth = 2; const lineStrokeColor = '#105b96'; function girdCircuitDiagram(stc, flush) { let diagram = new Diagram(); // let thisWidth = stc.scrollWidth; // let thisHeight = stc.scrollHeight; diagram.width = 525; diagram.height= 380; diagram.setCanvas(stc, flush); let start = [60, 100]; // // 线 let line1 = diagram.line({ id: 'line1', strokeStyle: lineStrokeColor, lineWidth: lineWidth, points: [ start, [start[0], start[1]+200] ] }); let line2 = diagram.line({ id: 'line2', strokeStyle: lineStrokeColor, lineWidth: lineWidth, points: [ [line1[1][0],line1[1][1]], [line1[1][0]+200, line1[1][1]] ] }); let line3 = diagram.line({ id: 'line3', strokeStyle: lineStrokeColor, lineWidth: lineWidth, points: [ [line2[1][0]+2,line2[1][1]], [line2[1][0]+190, line2[1][1]] ] }); let line4 = diagram.line({ id: 'line4', strokeStyle: lineStrokeColor, lineWidth: lineWidth, points: [ [line2[1][0],line2[1][1]-10], [line2[1][0], line2[1][1]+10] ] }); let line5 = diagram.line({ id: 'line5', strokeStyle: lineStrokeColor, lineWidth: lineWidth, points: [ [line3[0][0],line3[0][1]-10], [line3[0][0], line3[0][1]+10] ] }); let line6 = diagram.line({ id: 'line6', strokeStyle: lineStrokeColor, lineWidth: lineWidth, points: [ [line3[1][0],line3[1][1]], [line3[1][0], line3[1][1]-220] ] }); let line7 = diagram.line({ id: 'line7', strokeStyle: lineStrokeColor, lineWidth: lineWidth, points: [ [line6[1][0],line6[1][1]], [line6[1][0]-40, line6[1][1]] ] }); let arc1 = diagram.arc({ id: 'arc1', point: [ line7[1][0], line7[1][1] ], fillStyle: lineStrokeColor, strokeStyle: lineStrokeColor, radius: 3, type: 'fill' }) let line8 = diagram.line({ id: 'line8', strokeStyle: lineStrokeColor, lineWidth: lineWidth, points: [ [line7[1][0]-30,line7[1][1]], [line7[1][0]-300, line7[1][1]] ] }); let arc2 = diagram.arc({ id: 'arc2', point: [ line8[0][0], line8[0][1] ], fillStyle: lineStrokeColor, strokeStyle: lineStrokeColor, radius: 3, type: 'fill' }) let line9 = diagram.line({ id: 'line9', strokeStyle: lineStrokeColor, lineWidth: lineWidth, points: [ [line7[1][0],line7[1][1]], [line8[0][0], line8[0][1]] ], }); let text1 = diagram.text({ id: "text1", text: '直流配电板', fillStyle: '#1e9ff2', fontSize: 12, fontWidth:1, point:[line1[0][0]-28,line1[0][1]-21], showPanel: false, type:true, radBorder: true, borderColor:"#1e9ff2" }); let text2 = diagram.text({ id: "text2", text: '整流电源', fillStyle: '#1e9ff2', fontSize: 12, fontWidth:1, point:[line9[1][0]-120,line9[1][1]], showPanel: false, type:true, radBorder: true, borderColor:"#1e9ff2" }); let text3 = diagram.text({ id: "text3", text: '900V', fillStyle: '#fff', fontSize: 12, fontWidth:1, point:[line9[1][0]-220,line9[1][1]-10], showPanel: false, }); let text4 = diagram.text({ id: "text4", text: '直流调速柜', fillStyle: '#1e9ff2', fontSize: 12, fontWidth:1, point:[line1[0][0]+20,line1[0][1]+50], showPanel: false, }); let text5 = diagram.text({ id: "text5", text: '升压变压器', fillStyle: '#1e9ff2', fontSize: 12, fontWidth:1, point:[line6[1][0]-30,line6[1][1]+60], showPanel: false, type:true, radBorder: true, borderColor:"#1e9ff2" }); let text6 = diagram.text({ id: "text6", text: ' AFE变频& 驱动柜 ', fillStyle: '#1e9ff2', fontSize: 12, fontWidth:1, point:[line6[1][0]-30,line6[1][1]+120], showPanel: false, type:true, radBorder: true, borderColor:"#1e9ff2" }); let dashLine1 =diagram.dashLine({ id:"diagram1", strokeStyle: lineStrokeColor, lineWidth: lineWidth, points: [ [line4[1][0]-150,line4[1][1]-10], [line4[1][0]-150, line4[1][1]-70] ] }) let dashLine2 =diagram.dashLine({ id:"diagram2", strokeStyle: lineStrokeColor, lineWidth: lineWidth, points: [ [dashLine1[1][0],dashLine1[1][1]], [dashLine1[1][0]+70, dashLine1[1][1]] ] }) let dashLine3 =diagram.dashLine({ id:"diagram3", strokeStyle: lineStrokeColor, lineWidth: lineWidth, points: [ [dashLine2[1][0],dashLine2[1][1]], [dashLine2[1][0], dashLine2[1][1]-20] ] }) let arrow1 = diagram.drawArrow({ id: 'arrow1', fillStyle: '#105b96', size: 50, direction: 'top', type: 'fill', point: dashLine3[0] }) // // 测试电机 let Image1 = diagram.drawImage({ id: 'img1', url: dynamometry, point: [line3[0][0]+20, line3[0][1]-30], width: 70, height:60, }) // // 受试电机 let Image2 = diagram.drawImage({ id: 'img2', url: testedmotor, point: [dashLine1[0][0]-20, dashLine1[0][1]-30], width: 70, height:60, }) // // 齿轮箱 let Image3 = diagram.drawImage({ id: 'img3', url: sensor, point: [line4[1][0]-60, line4[1][1]-25], width: 30, height:30, }) // // 直流调速柜 let Image4 = diagram.drawImage({ id: 'img4', url: speedCabinet, point: [line1[0][0]-30, line1[0][1]+60], width: 60, height:70, }) // // 噪声 let Image6 = diagram.drawImage({ id: 'img6', url: shock, point: [dashLine3[1][0]-30, dashLine3[1][1]-100], width: 60, height:70, }) // 转速:9r/min let text7 = diagram.text({ id: "text7", text: '转速:9r/min', fillStyle: "#ffff18", fontSize: 12, fontWidth:1, point:[Image2.top[0]-10,Image2.top[1]-10], showPanel: false, }); // 受试电机 let text8 = diagram.text({ id: "text8", text: '受试电机', fillStyle: "#ffff18", fontSize: 12, fontWidth:1, point:[Image2.bottom[0]-10,Image2.bottom[1]+10], showPanel: false, }); // let text9 = diagram.text({ id: "text9", text: '轴联器链接', fillStyle: "#ffff18", fontSize: 12, fontWidth:1, point:[Image3.top[0]+20,Image3.top[1]-20], showPanel: false, }); let text10 = diagram.text({ id: "text10", text: '齿轮箱', fillStyle: "#ffff18", fontSize: 12, fontWidth:1, point:[Image3.bottom[0]-20,Image3.bottom[1]+10], showPanel: false, }); let text11 = diagram.text({ id: "text11", text: '噪声: 20 dB', fillStyle: "#ffff18", fontSize: 12, fontWidth:1, point:[Image6.top[0]-30,Image6.top[1]-15], showPanel: false, }); // let text12 = diagram.text({ // id: "text12", // text: '&电压:690V&频率:44.5Hz&转速:89r/min&输出功率:980kW', // fillStyle: '#ffffff', // fontSize: 12, // fontWidth:1, // point:[Image3.top[0]+50,Image3.top[1]-160], // showPanel: false, // type:true, // radBorder: true, // bgColor:"rgba(2, 151, 215, 0.3)", // borderColor:"rgba(30, 159, 242, 1)" // }); // let text13 = diagram.text({ // id: "text13", // text: ' 受功电机', // fillStyle: "#ffff18", // fontSize: 12, // fontWidth:1, // point:[Image3.top[0]+50,Image3.top[1]-160], // showPanel: false, // }); // return diagram; } export default girdCircuitDiagram;