📄 非对称敷设.frm
字号:
VERSION 5.00
Begin VB.Form frmfdcfs
BorderStyle = 3 'Fixed Dialog
Caption = "非对称型敷设"
ClientHeight = 3960
ClientLeft = 45
ClientTop = 345
ClientWidth = 7275
Icon = "非对称敷设.frx":0000
KeyPreview = -1 'True
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 3960
ScaleWidth = 7275
ShowInTaskbar = 0 'False
StartUpPosition = 2 '屏幕中心
Begin VB.CommandButton Command3
Caption = "关闭"
Height = 375
Left = 1800
TabIndex = 10
Top = 3520
Width = 855
End
Begin VB.CommandButton Command2
Caption = "加桩"
Height = 375
Left = 900
TabIndex = 9
Top = 3520
Width = 855
End
Begin VB.CommandButton Command1
Caption = "计算"
Height = 375
Left = 0
TabIndex = 7
Top = 3520
Width = 855
End
Begin VB.Frame Frame2
Caption = "计算结果"
Height = 3855
Left = 2760
TabIndex = 18
Top = 40
Width = 4455
Begin VB.ListBox List1
Height = 3480
Left = 120
TabIndex = 19
Top = 240
Width = 4215
End
End
Begin VB.Frame Frame3
Caption = "加桩桩号"
Height = 735
Left = 0
TabIndex = 16
Top = 2640
Width = 2655
Begin VB.TextBox Text6
Height = 270
Left = 1320
TabIndex = 8
Text = "Text6"
Top = 360
Width = 1215
End
Begin VB.Label Label5
Caption = "加桩桩号JZ="
Height = 255
Left = 120
TabIndex = 17
Top = 360
Width = 1335
End
End
Begin VB.Frame Frame1
Caption = "原始数据"
Height = 2580
Left = 0
TabIndex = 0
Top = 40
Width = 2655
Begin VB.TextBox Text7
Height = 270
Left = 1320
TabIndex = 5
Text = "Text7"
Top = 1800
Width = 1215
End
Begin VB.TextBox Text1
Height = 270
Left = 1320
TabIndex = 1
Text = "Text1"
Top = 360
Width = 1215
End
Begin VB.TextBox Text2
Height = 270
Left = 1320
TabIndex = 2
Text = "Text2"
ToolTipText = "如36°15′45″按36.1545输入"
Top = 720
Width = 1215
End
Begin VB.TextBox Text3
Height = 270
Left = 1320
TabIndex = 3
Text = "Text3"
Top = 1080
Width = 1215
End
Begin VB.TextBox Text4
Height = 270
Left = 1320
TabIndex = 4
Text = "Text4"
Top = 1440
Width = 1215
End
Begin VB.TextBox Text5
Height = 270
Left = 1320
TabIndex = 6
Text = "Text5"
Top = 2160
Width = 1215
End
Begin VB.Label Label8
Caption = "缓和曲线LS2="
Height = 255
Left = 120
TabIndex = 20
Top = 1800
Width = 1215
End
Begin VB.Label Label1
Caption = "交点桩号JD ="
Height = 255
Left = 120
TabIndex = 15
Top = 360
Width = 1215
End
Begin VB.Label Label2
Caption = "路线偏角PJ ="
Height = 255
Left = 120
TabIndex = 14
Top = 720
Width = 1215
End
Begin VB.Label Label3
Caption = "曲线半径R ="
Height = 255
Left = 120
TabIndex = 13
Top = 1080
Width = 1215
End
Begin VB.Label Label4
Caption = "缓和曲线LS1="
Height = 255
Left = 120
TabIndex = 12
Top = 1440
Width = 1215
End
Begin VB.Label Label6
Caption = "加桩间距Lj ="
Height = 255
Left = 120
TabIndex = 11
Top = 2160
Width = 1215
End
End
End
Attribute VB_Name = "frmfdcfs"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim jd, zh, hy, qz, yh, hz As Double
Dim r, ls1, ls2, p1, p2, q1, q2, th1, th2, eh, lh As Double
Private Sub Command1_Click()
'计算
On Error GoTo handlerror
Text6.Visible = True
jd = Val(Text1.Text)
sjwjs = Val(Text2.Text)
r = Val(Text3.Text)
ls1 = Val(Text4.Text)
ls2 = Val(Text7.Text)
LJ = Val(Text5.Text)
Call dfmhhd
p1 = ls1 * ls1 / 24 / r - ls1 ^ 4 / 2688 / r ^ 3
p2 = ls2 * ls2 / 24 / r - ls2 ^ 4 / 2688 / r ^ 3
q1 = ls1 / 2 - ls1 ^ 3 / 240 / r / r
q2 = ls2 / 2 - ls2 ^ 3 / 240 / r / r
b1 = ls1 / 2 / r
b2 = ls2 / 2 / r
th1 = (r + p2 - (r + p1) * Cos(hudu)) / Sin(hudu) + q1
th2 = (r + p1 - (r + p2) * Cos(hudu)) / Sin(hudu) + q2
ly = (hudu - b1 - b2) * r
lh = ly + ls1 + ls2
zh = jd - th1
hy = zh + ls1
u = (p2 - p1) / 2 / r / Sin(hudu / 2)
qz = zh + ls1 + ly / 2
' qz = zh + ls1 + (hudu / 2 - b1) * r + r * Atn(u / (1 - u * u))
yh = zh + lh - ls2
hz = zh + lh
If hudu - b1 - b2 < 0 Then
xianshi = MsgBox("请增加半径或减少缓和曲线长度后再计算。", vbInformation, "问题提示")
Exit Sub
End If
List1.Clear
List1.AddItem ""
List1.AddItem " ~~~~~~~曲线要素~~~~~~~"
List1.AddItem " 路线交点 (m)JD= " + Str(jd)
List1.AddItem " 路线偏角(°′″)PJ= " + Str(sjwjs)
List1.AddItem " 圆曲线半径 (m)R = " + Str(Int(r * 1000 + 0.5) / 1000)
List1.AddItem " 缓和曲线长度 (m)Ls1= " + Str(Int(ls1 * 1000 + 0.5) / 1000)
List1.AddItem " 缓和曲线长度 (m)Ls2= " + Str(Int(ls2 * 1000 + 0.5) / 1000)
List1.AddItem " 切线长度 (m)Th1= " + Str(Int(th1 * 1000 + 0.5) / 1000)
List1.AddItem " 切线长度 (m)Th2= " + Str(Int(th2 * 1000 + 0.5) / 1000)
List1.AddItem " 中间圆曲线长 (m)Ly= " + Str(Int(ly * 1000 + 0.5) / 1000)
List1.AddItem " 平曲线全长 (m)Lh= " + Str(Int(lh * 1000 + 0.5) / 1000)
List1.AddItem ""
List1.AddItem " ------控制点桩号------"
List1.AddItem " ZH= " + Str(Int(zh * 1000 + 0.5) / 1000)
List1.AddItem " HY= " + Str(Int(hy * 1000 + 0.5) / 1000)
List1.AddItem " QZ= " + Str(Int(qz * 1000 + 0.5) / 1000)
List1.AddItem " YH= " + Str(Int(yh * 1000 + 0.5) / 1000)
List1.AddItem " HZ= " + Str(Int(hz * 1000 + 0.5) / 1000)
If LJ = 0 Then Exit Sub
m = Int((hz - zh) / LJ + 1)
jz = Int(zh / LJ) * LJ + LJ
List1.AddItem ""
List1.AddItem " -------加桩坐标-------"
For i = 1 To m
l = jz - zh
p = p1
q = q1
ls = ls1
th = th1
If jz > qz Then
l = hz - jz
p = p2
q = q2
ls = ls2
th = th2
End If
If l < ls Then
x = l - l ^ 5 / 40 / r / r / ls / ls
y = l ^ 3 / 6 / r / ls - l ^ 7 / 336 / r / r / r / ls / ls / ls
Else
fi = ((l - ls) / r + ls / 2 / r)
x = q + r * Sin(fi)
y = p + r * (1 - Cos(fi))
End If
x = Int(x * 1000 + 0.5) / 1000
y = Int(y * 1000 + 0.5) / 1000
chdu1 = Len(x)
kge1 = ""
kong = " "
For j = 6 To chdu1 Step -1
kge1 = kge1 + kong
Next j
chdu2 = Len(y)
kge2 = ""
For j = 6 To chdu2 Step -1
kge2 = kge2 + kong
Next j
chdu3 = Len(jz)
kge3 = ""
For j = 6 To chdu3 Step -1
kge3 = kge3 + kong
Next j
List1.AddItem " JZ=" + Str(Int(jz * 1000 + 0.5) / 1000) + kge3 + " X=" + Str(x) + kge1 + " Y=" + Str(y) + kge2 + " Th-X=" + Str(Int((th - x) * 1000 + 0.5) / 1000)
jz = jz + LJ
If jz > hz Then Exit For
Next i
Text6.SetFocus
Exit Sub
handlerror:
xianshi = MsgBox("请检查输入的数据后再计算。", vbInformation, "问题提示")
End Sub
Private Sub Command2_Click()
'加桩计算
On Error GoTo handlerror
jz = Val(Text6.Text)
If jz < zh Then
x = zh - jz
y = 0
End If
If jz > hz Then
x = jz - hz
y = 0
End If
If zh < jz And jz < hz Then
l = jz - zh
p = p1
q = q1
ls = ls1
th = th1
If jz > qz Then
l = hz - jz
p = p2
q = q2
ls = ls2
th = th2
End If
If l < ls Then
x = l - l ^ 5 / 40 / r / r / ls / ls
y = l ^ 3 / 6 / r / ls - l ^ 7 / 336 / r / r / r / ls / ls / ls
Else
fi = ((l - ls) / r + ls / 2 / r)
x = q + r * Sin(fi)
y = p + r * (1 - Cos(fi))
End If
End If
x = Int(x * 1000 + 0.5) / 1000
y = Int(y * 1000 + 0.5) / 1000
chdu1 = Len(x)
kge1 = ""
kong = " "
For j = 6 To chdu1 Step -1
kge1 = kge1 + kong
Next j
chdu2 = Len(y)
kge2 = ""
For j = 6 To chdu2 Step -1
kge2 = kge2 + kong
Next j
chdu3 = Len(jz)
kge3 = ""
For j = 6 To chdu3 Step -1
kge3 = kge3 + kong
Next j
List1.AddItem " JZ=" + Str(Int(jz * 1000 + 0.5) / 1000) + kge3 + " X=" + Str(x) + kge1 + " Y=" + Str(y) + kge2 + " Th-X=" + Str(Int((th - x) * 1000 + 0.5) / 1000)
Text6.Text = ""
Text6.SetFocus
Exit Sub
handlerror:
xianshi = MsgBox("请检查输入的数据后再计算。", vbInformation, "问题提示")
End Sub
Private Sub Command3_Click()
'确定
On Error GoTo handlerror
If List1.ListCount > 1 And rjsfzc = 88 Then
frmMain.Text1 = frmMain.Text1 & vbCrLf & ""
frmMain.Text1 = frmMain.Text1 & vbCrLf & " 五、非对称基本型平曲线计算结果:"
For i = 0 To List1.ListCount - 1
frmMain.Text1 = frmMain.Text1 & vbCrLf & List1.List(i)
Next i
frmMain.Text1 = frmMain.Text1 & vbCrLf & " --------------------------------------"
End If
Unload Me
Exit Sub
handlerror:
End Sub
Private Sub Form_KeyPress(KeyAscii As Integer)
'Esc键退出,VbEscape可以用27代替
On Error GoTo handlerror
If KeyAscii = 27 Then
Unload Me
End If
Exit Sub
handlerror:
End Sub
Private Sub Form_Load()
'启动窗体
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text7.Text = ""
Text6.Text = ""
Text6.Visible = False
List1.Clear
List1.AddItem "长度:米,角度:如36°15′45″按36.1545输入"
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -