vb编程 课程设计说明书(2)

2019-04-15 18:02

intstartangle = 360 intendangle = 0 Else

intstartangle = 0 intendangle = 360 intCW = 1 End If End Sub

Private Sub Cmdlist_Click()

Dim L_a As Double, L_b As Double

Dim i As Integer, F_AB As Double, F_BC As Double, F_CD As Double

Dim W_BC As Double, W_CD As Double, E_BC As Double, E_CD As Double Dim X_E As Double, Y_E As Double, Vx_E As Double, Vy_E As Double, Ax_E As Double, Ay_E As Double Dim strStr1, strStr2, strStr3 As String Dim intTemp As Integer For i = 0 To 8

grdDataList.ColAlignment(i) = flexAlignCenterCenter Next i

If Abs(intendangle - intstartangle) < 360 Then intTemp = 1

Else

intTemp = 10 End If

For i = intstartangle To intendangle Step intCW * intTemp

Call YDFX(i, L_a, L_b, F_BC, F_CD, W_BC, W_CD, E_BC, E_CD, X_E, Y_E, Vx_E, Vy_E, Ax_E, Ay_E)

strStr1 = Format(Str(F_CD), \Chr(9) & Format(Str(E_CD), \

strStr2 = Format(Str(X_E), \& Chr(9) & Format(Str(Vx_E), \& Chr(9) & Format(Str(Ax_E), \

strStr3 = Format(Str(Y_E), \& Chr(9) & Format(Str(Vy_E), \& Chr(9) & Format(Str(Ay_E), \

grdDataList.AddItem (Str(i) & Chr(9) & strStr1 & Chr(9) & strStr2 & Chr(9) & strStr3) Next i

grdDataList.FixedRows = 1 Cmdlist.Enabled = False End Sub

Private Sub Command6_Click() Unload Me End Sub

Private Sub Cmddraw_Click()

Dim wp As Double, hp As Double, i As Integer '获取控件的宽度,高度

wp = Abs(Picdraw(0).ScaleWidth) hp = Abs(Picdraw(0).ScaleHeight) Dim angle_L As Double, Sx As Double If intstartangle * intendangle < 0 Then If intstartangle < 0 Then

angle_L = Abs(intstartangle) Else

angle_L = Abs(intendangle) End If Else

angle_L = 0 End If

'确定横向作图比例 Sx = (wp - 240) / 360 For i = 0 To 8 Picdraw(i).Cls

'设置绘图参数

Picdraw(i).ScaleMode = 1 Picdraw(i).DrawStyle = 0 Picdraw(i).DrawWidth = 1.5 '设置坐标系

Picdraw(i).Scale (-120 - angle_L * Sx, hp / 2)-(wp - angle_L * Sx - 120, -hp / 2)

'画坐标系

Picdraw(i).Line (-80 - angle_L * Sx, 0)-(wp - angle_L * Sx - 160, 0) Picdraw(i).Line (wp - angle_L * Sx - 160, 0)-Step(-120, 120) Picdraw(i).Line (wp - angle_L * Sx - 160, 0)-Step(-120, -120) Picdraw(i).CurrentX = wp - angle_L * Sx - 700 Picdraw(i).CurrentY = 250 Picdraw(i).Print \ Picdraw(i).CurrentX = -120 Picdraw(i).CurrentY = -10 Picdraw(i).Print \

Picdraw(i).Line (0, hp / 2 - 60)-(0, -(hp / 2 - 60)) Picdraw(i).Line (0, hp / 2 - 60)-Step(-120, -120) Picdraw(i).Line (0, hp / 2 - 60)-Step(120, -120) Picdraw(i).CurrentX = 160

Picdraw(i).CurrentY = hp / 2 - 60 Select Case i Case 0

Picdraw(i).Print \ Case 1

Picdraw(i).Print \ Case 2

Picdraw(i).Print \ Case 3

Picdraw(i).Print \ Case 4

Picdraw(i).Print \ Case 5

Picdraw(i).Print \ Case 6

Picdraw(i).Print \ Case 7

Picdraw(i).Print \ Case 8

Picdraw(i).Print \ End Select Next i

Tmrdraw.Enabled = True End Sub

Private Sub txtAngle_Change() If Tmrdraw.Enabled = True Then Exit Sub End If

Dim F_AB As Double, F_CD As Double, W_CD As Double, E_CD As Double, L_a As Double, L_b As Double

Dim F_BC As Double, W_BC As Double, E_BC As Double

Dim X_E As Double, Vx_E As Double, Ax_E As Double, Y_E As Double, Vy_E As Double, Ay_E As Double

Call YDFX(Val(txtAngle.Text), L_a, L_b, F_BC, F_CD, W_BC, W_CD, E_BC, E_CD, X_E, Y_E, Vx_E, Vy_E, Ax_E, Ay_E)

lblCurrent(0).Caption = Format(Str(F_CD), \ lblCurrent(1).Caption = Format(Str(W_CD), \

lblCurrent(2).Caption = Format(Str(E_CD), \ lblCurrent(3).Caption = Format(Str(X_E), \ lblCurrent(4).Caption = Format(Str(Vx_E), \ lblCurrent(5).Caption = Format(Str(Ax_E), \ lblCurrent(6).Caption = Format(Str(Y_E), \ lblCurrent(7).Caption = Format(Str(Vy_E), \ lblCurrent(8).Caption = Format(Str(Ay_E), \End Sub

Private Sub tmrplay_Timer() Picplay.Cls

'判断显示比例的合法性

If Val(txtscale.Text) <= 0 Or Val(txtscale.Text) > 50 Then

MsgBox \请输入(0.50)之间的值作为显示比例!\vbInformation + vbOKOnly, \消息框\ txtscale.Text = \

Tmrplay.Enabled = False Exit Sub End If

'获取显示比例dblsxy Dim sxy As Double, i As Integer Dim L_a As Double, L_b As Double L_a = Val(Txtlength(5).Text) L_b = Val(Txtlength(6).Text) L_ab = Val(Txtlength(0).Text)


vb编程 课程设计说明书(2).doc 将本文的Word文档下载到电脑 下载失败或者文档不完整,请联系客服人员解决!

下一篇:机械工程测试技术基础(第三版)课后答案全集(1)

相关阅读
本类排行
× 注册会员免费下载(下载后可以自由复制和排版)

马上注册会员

注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信: QQ: