📄 平曲线敷设.frm
字号:
VERSION 5.00
Begin VB.Form frmpqxfs
BorderStyle = 3 'Fixed Dialog
Caption = "基本型敷设"
ClientHeight = 3600
ClientLeft = 45
ClientTop = 345
ClientWidth = 7230
Icon = "平曲线敷设.frx":0000
KeyPreview = -1 'True
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 3600
ScaleWidth = 7230
ShowInTaskbar = 0 'False
StartUpPosition = 2 '屏幕中心
Begin VB.CommandButton Command3
Caption = "加桩"
Height = 375
Left = 900
TabIndex = 8
Top = 3160
Width = 855
End
Begin VB.Frame Frame3
Caption = "加桩桩号"
Height = 735
Left = 0
TabIndex = 16
Top = 2340
Width = 2655
Begin VB.TextBox Text6
Height = 270
Left = 1320
TabIndex = 7
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 Frame2
Caption = "计算结果"
Height = 3495
Left = 2760
TabIndex = 14
Top = 40
Width = 4455
Begin VB.ListBox List1
Height = 3120
Left = 120
TabIndex = 15
Top = 240
Width = 4215
End
End
Begin VB.CommandButton Command2
Caption = "确定"
Height = 375
Left = 1800
TabIndex = 9
Top = 3160
Width = 855
End
Begin VB.CommandButton Command1
Caption = "计算"
Height = 375
Left = 0
TabIndex = 6
Top = 3160
Width = 855
End
Begin VB.Frame Frame1
Caption = "原始数据"
Height = 2220
Left = 0
TabIndex = 0
Top = 40
Width = 2655
Begin VB.TextBox Text5
Height = 270
Left = 1320
TabIndex = 5
Text = "Text5"
Top = 1800
Width = 1215
End
Begin VB.TextBox Text4
Height = 270
Left = 1320
TabIndex = 4
Text = "Text4"
Top = 1440
Width = 1215
End
Begin VB.TextBox Text3
Height = 270
Left = 1320
TabIndex = 3
Text = "Text3"
Top = 1080
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 Text1
Height = 270
Left = 1320
TabIndex = 1
Text = "Text1"
Top = 360
Width = 1215
End
Begin VB.Label Label6
Caption = "加桩间距Lj="
Height = 255
Left = 120
TabIndex = 18
Top = 1800
Width = 1215
End
Begin VB.Label Label4
Caption = "缓和曲线LS="
Height = 255
Left = 120
TabIndex = 13
Top = 1440
Width = 1095
End
Begin VB.Label Label3
Caption = "曲线半径R ="
Height = 255
Left = 120
TabIndex = 12
Top = 1080
Width = 1095
End
Begin VB.Label Label2
Caption = "路线偏角PJ="
Height = 255
Left = 120
TabIndex = 11
Top = 720
Width = 1215
End
Begin VB.Label Label1
Caption = "交点桩号JD="
Height = 255
Left = 120
TabIndex = 10
Top = 360
Width = 1095
End
End
End
Attribute VB_Name = "frmpqxfs"
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, ls, p, q, th, 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)
ls = Val(Text4.Text)
LJ = Val(Text5.Text)
Call dfmhhd
p = ls * ls / 24 / r
q = ls / 2 - ls ^ 3 / 240 / r / r
b = ls / 2 / r
th = (r + p) * Tan(hudu / 2) + q
eh = (r + p) / Cos(hudu / 2) - r
ly = (hudu - 2 * b) * r
lh = ly + 2 * ls
zh = jd - th
hy = zh + ls
qz = hy + ly / 2
yh = hy + ly
hz = yh + ls
If hudu - 2 * b < 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)Ls= " + Str(Int(ls * 1000 + 0.5) / 1000)
List1.AddItem " 切线长度 (m)Th= " + Str(Int(th * 1000 + 0.5) / 1000)
List1.AddItem " 外距长度 (m)Eh= " + Str(Int(eh * 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
If jz > qz Then l = hz - jz
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
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 Command3_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
If jz > qz Then l = hz - jz
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 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 = ""
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 + -