📄 libfig.bas
字号:
Attribute VB_Name = "LibFig"
Option Explicit
Rem 悬点实测示功图与泵转化示功图
Sub Fig_Dyny(jcal As Integer, pr() As Single, prl() As Single, XPump() As Single, llpump() As Single)
Dim Xzb As Integer, Yzb As Integer
Dim spr As Single, Pmax As Single
Dim i As Integer, j As Integer
Dim i_ As Double
spr = 0
Pmax = 0
For j = 0 To jcal
If pr(j) > spr Then spr = pr(j)
If prl(j) > Pmax Then Pmax = prl(j)
Next j
Xzb = Int(spr + 1)
Yzb = Int(Pmax / 10000) + 1
Yzb = Yzb * 10
If Pmax <= 1 Then
Yzb = 1
Xzb = 1
End If
Simulator.PictRodPump.ForeColor = vbBlue
Simulator.PictRodPump.Cls
If Pmax <= 1 Then
Simulator.PictRodPump.Scale (-0.2 * Xzb, Yzb)-(Xzb, 0)
Simulator.PictRodPump.Line (-0.2 * Xzb, (1 - 0.002) * Yzb)-(1.2 * Xzb, 0.002), , BF
For i = 1 To 4
Simulator.PictRodPump.Line (0.25 * i, 0)-(0.25 * i, 0.03 * Yzb)
Next i
For i = 1 To 4
Simulator.PictRodPump.Line (0, i * Yzb / 4)-(0.02, i * Yzb / 4): DoEvents
Next i
Simulator.PictRodPump.CurrentX = 0.6 * Xzb
Simulator.PictRodPump.CurrentY = -0.08 * Yzb * 1000
Simulator.PictRodPump.Print "光杆位移(m)"
Simulator.PictRodPump.CurrentY = 0.95 * Yzb * 1000
Simulator.PictRodPump.CurrentX = -0.15 * Xzb
Simulator.PictRodPump.Print "载" & vbCrLf
Simulator.PictRodPump.CurrentX = -0.15 * Xzb
Simulator.PictRodPump.Print "荷"
Simulator.PictRodPump.CurrentX = -0.18 * Xzb
Simulator.PictRodPump.Print "(kN)"
Else
Simulator.PictRodPump.Scale (-0.2 * Xzb, 1.2 * Yzb * 1000#)-(1.2 * Xzb, -1.2 * Yzb * 1000# / 4)
Simulator.PictRodPump.Line (-0.2 * Xzb, 1.2 * Yzb * 1000#)-((1 - 0.002) * 1.2 * Xzb, -(1 - 0.02) * 1.2 * Yzb * 1000# / 4), vbWhite, BF
Simulator.PictRodPump.CurrentX = 0.6 * Xzb
Simulator.PictRodPump.CurrentY = -0.08 * Yzb * 1000
Simulator.PictRodPump.Print "光杆位移(m)"
Simulator.PictRodPump.CurrentY = 0.95 * Yzb * 1000
Simulator.PictRodPump.CurrentX = -0.15 * Xzb
Simulator.PictRodPump.Print "载" & vbCrLf
Simulator.PictRodPump.CurrentX = -0.15 * Xzb
Simulator.PictRodPump.Print "荷"
Simulator.PictRodPump.CurrentX = -0.18 * Xzb
Simulator.PictRodPump.Print "(kN)"
'载荷
Simulator.PictRodPump.Line (0, -1.2 * Yzb * 1000# / 4)-(0, 1.15 * Yzb * 1000#)
For i = 0 To 5
Simulator.PictRodPump.Line (0, -Yzb * 1000# / 4 + i * Yzb * 1000# / 4)-(0.08, -Yzb * 1000# / 4 + i * Yzb * 1000# / 4)
If i Mod 2 = 1 Or i = 0 Then
Simulator.PictRodPump.CurrentY = -Yzb * 1000# / 4 + i * Yzb * 1000# / 4 + Yzb * 50
If i = 1 Then
Simulator.PictRodPump.CurrentX = -0.06 * Xzb
Simulator.PictRodPump.Print "0"
Else
If i = 0 Then
Simulator.PictRodPump.CurrentX = -0.14 * Xzb
Else
Simulator.PictRodPump.CurrentX = -0.1 * Xzb
End If
Simulator.PictRodPump.Print Format((i - 1) * Yzb / 4, "##0")
End If
End If
Next i
For i_ = -0.01 * Xzb To 0.015 * Xzb Step 0.0006 * Xzb
Simulator.PictRodPump.Line (i_, 1.02 * Yzb * 1000#)-(0, 1.16 * Yzb * 1000#)
Next
'光杆位移坐标
Simulator.PictRodPump.Line (0, 0)-(1.15 * Xzb, 0)
For i = 0 To 2 * Xzb
Simulator.PictRodPump.Line (0.5 * i, 0)-(0.5 * i, 0.03 * Yzb * 1000#)
If i = 0 Or i = Xzb Or i = 2 * Xzb Then
Simulator.PictRodPump.CurrentY = -0.1 * Yzb * 1000# / 4
If i = 0 Then
Simulator.PictRodPump.CurrentX = 0.5 * i + 0.01 * Xzb
Simulator.PictRodPump.Print "0"
Else
Simulator.PictRodPump.CurrentX = 0.5 * i - 0.06 * Xzb
Simulator.PictRodPump.Print Format(0.5 * i, "## 0.0")
End If
End If
Next i
For i_ = -20 * Yzb To 20 * Yzb Step Yzb
Simulator.PictRodPump.Line (1.05 * Xzb, i_)-(1.15 * Xzb, 0)
DoEvents
Next
End If
Simulator.PictRodPump.DrawWidth = 1
For j = 1 To jcal - 1
Simulator.PictRodPump.Line (XPump(j), llpump(j))-(XPump(j + 1), llpump(j + 1))
Next j
For j = 1 To jcal - 1
Simulator.PictRodPump.Line (pr(j), prl(j))-(pr(j + 1), prl(j + 1))
Next j
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -