?? form2.frm
字號:
VERSION 5.00
Begin VB.Form Form2
Caption = "層流(1-1-1)"
ClientHeight = 6225
ClientLeft = 60
ClientTop = 420
ClientWidth = 7995
LinkTopic = "Form2"
ScaleHeight = 6225
ScaleWidth = 7995
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command3
Caption = "清除"
Height = 495
Left = 3000
TabIndex = 14
Top = 5640
Width = 1935
End
Begin VB.CommandButton Command2
Caption = "退出"
Height = 495
Left = 5880
TabIndex = 13
Top = 5640
Width = 1695
End
Begin VB.CommandButton Command1
Caption = "計算"
Height = 495
Left = 120
TabIndex = 12
Top = 5640
Width = 1695
End
Begin VB.TextBox Text11
Height = 615
Left = 600
TabIndex = 10
Top = 2160
Width = 2415
End
Begin VB.TextBox Text10
Height = 615
Left = 5520
TabIndex = 9
Top = 3840
Width = 2415
End
Begin VB.TextBox Text9
Height = 615
Left = 600
TabIndex = 8
Top = 3840
Width = 2415
End
Begin VB.TextBox Text8
Height = 615
Left = 5520
TabIndex = 7
Top = 3000
Width = 2415
End
Begin VB.TextBox Text7
Height = 615
Left = 600
TabIndex = 6
Top = 3000
Width = 2415
End
Begin VB.TextBox Text6
Height = 615
Left = 5520
TabIndex = 5
Top = 2160
Width = 2415
End
Begin VB.TextBox Text5
Height = 615
Left = 5520
TabIndex = 4
Top = 1320
Width = 2415
End
Begin VB.TextBox Text4
Height = 615
Left = 600
TabIndex = 3
Top = 1320
Width = 2415
End
Begin VB.TextBox Text3
Height = 615
Left = 5760
TabIndex = 2
Top = 240
Width = 1575
End
Begin VB.TextBox Text2
Height = 615
Left = 3120
TabIndex = 1
Top = 240
Width = 1455
End
Begin VB.TextBox Text1
Height = 615
Left = 600
TabIndex = 0
Top = 240
Width = 1335
End
Begin VB.Label Label12
Height = 615
Left = 240
TabIndex = 25
Top = 4920
Width = 7455
End
Begin VB.Label Label11
Caption = "re"
Height = 615
Left = 120
TabIndex = 24
Top = 3840
Width = 495
End
Begin VB.Label Label10
Caption = "流速"
Height = 615
Left = 4920
TabIndex = 23
Top = 3000
Width = 495
End
Begin VB.Label Label9
Caption = "計算的系數"
Height = 615
Left = 4920
TabIndex = 22
Top = 2160
Width = 495
End
Begin VB.Label Label8
Caption = "流量"
Height = 615
Left = 0
TabIndex = 21
Top = 3000
Width = 615
End
Begin VB.Label Label7
Caption = "高差"
Height = 615
Left = 0
TabIndex = 20
Top = 2160
Width = 615
End
Begin VB.Label Label6
Caption = "總損失系數"
Height = 615
Left = 4920
TabIndex = 19
Top = 1320
Width = 615
End
Begin VB.Label Label5
Caption = "總管長"
Height = 615
Left = 120
TabIndex = 18
Top = 1320
Width = 495
End
Begin VB.Label Label4
Caption = "溫度"
Height = 615
Left = 5160
TabIndex = 17
Top = 240
Width = 615
End
Begin VB.Label Label3
Caption = "d"
Height = 615
Left = 2520
TabIndex = 16
Top = 240
Width = 615
End
Begin VB.Label Label2
Caption = "ks"
Height = 615
Left = 120
TabIndex = 15
Top = 240
Width = 495
End
Begin VB.Label Label1
Caption = "ks/d"
Height = 615
Left = 5040
TabIndex = 11
Top = 3840
Width = 495
End
End
Attribute VB_Name = "Form2"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Dim b1 As Single, b2 As Single, b3 As Single, b4 As Single, b5 As Single
Dim a(21, 2) As Single, i As Integer, j As Integer, a1 As Single, a2 As Single, a3 As Single ' j為溫度
Dim b6 As Single, re As Single, b8 As Single, b9 As Single, b10 As Single
j = Val(Text3.Text)
If j < 0 Or j > 100 Then
MsgBox ("請輸入0到100之間的數")
Text1.Text = ""
Text1.SetFocus
End If
For i = 1 To 21
a(i, 1) = 5 * (i - 1)
Next i
a(1, 2) = 1.792
a(2, 2) = 1.519
a(3, 2) = 1.308
a(4, 2) = 1.141
a(5, 2) = 1.007
a(6, 2) = 0.897
a(7, 2) = 0.804
a(8, 2) = 0.727
a(9, 2) = 0.661
a(10, 2) = 0.605
a(11, 2) = 0.556
a(12, 2) = 0.513
a(13, 2) = 0.477
a(14, 2) = 0.444
a(15, 2) = 0.415
a(16, 2) = 0.39
a(17, 2) = 0.367
a(18, 2) = 0.347
a(19, 2) = 0.328
a(20, 2) = 0.311
a(21, 2) = 0.296
For i = 1 To 21
If j = a(i, 1) Then
a1 = a(i, 2)
End If
Next i
For i = 1 To 20
If a(i, 1) < j And j < a(i + 1, 1) Then
a1 = a(i, 2) - ((a(i, 2) - a(i + 1, 2)) / 5) * (j - a(i, 1))
End If
Next i
b1 = Val(Text1.Text)
b2 = Val(Text2.Text)
b3 = Val(Text4.Text)
b4 = Val(Text5.Text)
b6 = Val(Text11.Text)
If b1 <> 0 And b2 <> 0 And b3 <> 0 And b4 <> 0 And b6 <> 0 Then
For re = 1 To 2320
b5 = 64 / re
b8 = ((0.25 * 3.1415926 * ((b2) ^ 2) * (2 * 9.81 * b6) ^ (0.5)) / ((((b5 * b3) / b2) + b4) ^ (0.5)))
b9 = (4 * b8) / (3.14 * (b2 ^ 2))
b10 = (b9 * b2) / a1
If Abs(b10 - re) < 3 And b5 < 0.11 Then
Text6.Text = b5
Text7.Text = b8
Text8.Text = b9
Text9.Text = b10
Text10.Text = b1 / b2
End If
Next re
If re > 2320 Then
Label12.Caption = ""
Label12.Caption = "不在此區,請選擇其他區域"
End If
Else
Label12.Caption = ""
Label12.Caption = "請輸入KS D 溫度 長度 系數 高差H"
Text1.SetFocus
End If
End Sub
Private Sub Command2_Click()
Form2.Hide
Form1.Show
End Sub
Private Sub Command3_Click()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
Text9.Text = ""
Text10.Text = ""
Text11.Text = ""
Label12.Caption = ""
Text1.SetFocus
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -