📄 frmset.frm
字号:
VERSION 5.00
Begin VB.Form FrmSet
BorderStyle = 3 'Fixed Dialog
Caption = "参数设置"
ClientHeight = 2775
ClientLeft = 45
ClientTop = 435
ClientWidth = 7095
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2775
ScaleWidth = 7095
ShowInTaskbar = 0 'False
StartUpPosition = 2 'CenterScreen
Begin VB.TextBox TxtPUsOf1mm
Alignment = 1 'Right Justify
Appearance = 0 'Flat
Height = 285
Left = 2400
TabIndex = 19
Top = 240
Width = 1335
End
Begin VB.Frame Frame1
Height = 1215
Left = 120
TabIndex = 10
Top = 480
Width = 6855
Begin VB.Timer Timer1
Enabled = 0 'False
Left = 240
Top = 600
End
Begin VB.CommandButton CmdC
Caption = "计算"
Height = 375
Left = 4440
TabIndex = 18
Top = 720
Width = 1095
End
Begin VB.TextBox TxtDis
Alignment = 1 'Right Justify
Appearance = 0 'Flat
Height = 285
Left = 4080
TabIndex = 16
Top = 240
Width = 1335
End
Begin VB.CommandButton CmdE
Caption = "停止"
Enabled = 0 'False
Height = 375
Left = 3000
TabIndex = 12
Top = 720
Width = 1095
End
Begin VB.CommandButton CmdS
Caption = "启动小车"
Height = 375
Left = 1560
TabIndex = 11
Top = 720
Width = 1215
End
Begin VB.Label Label12
AutoSize = -1 'True
Caption = "mm"
Height = 195
Left = 5520
TabIndex = 17
Top = 240
Width = 240
End
Begin VB.Label Label11
AutoSize = -1 'True
Caption = "实际移动距离:"
Height = 195
Left = 2880
TabIndex = 15
Top = 240
Width = 1260
End
Begin VB.Label Label10
AutoSize = -1 'True
Caption = "0"
Height = 195
Left = 1560
TabIndex = 14
Top = 240
Width = 90
End
Begin VB.Label Label9
AutoSize = -1 'True
Caption = "累积脉冲:"
Height = 195
Left = 480
TabIndex = 13
Top = 240
Width = 900
End
End
Begin VB.CommandButton CmdBack
Caption = "取消"
Height = 375
Left = 5760
TabIndex = 9
Top = 2280
Width = 1095
End
Begin VB.CommandButton CmdOK
Caption = "保存"
Default = -1 'True
Height = 375
Left = 4320
TabIndex = 0
Top = 2280
Width = 1095
End
Begin VB.TextBox TxtDisLtoR
Alignment = 1 'Right Justify
Appearance = 0 'Flat
Height = 285
Left = 5280
TabIndex = 8
Top = 1800
Width = 1335
End
Begin VB.TextBox TxtDefaultVel
Alignment = 1 'Right Justify
Appearance = 0 'Flat
Height = 285
Left = 1680
TabIndex = 7
Top = 1800
Width = 1335
End
Begin VB.Label Label8
AutoSize = -1 'True
Caption = "个"
Height = 195
Left = 3840
TabIndex = 6
Top = 240
Width = 180
End
Begin VB.Label Label7
AutoSize = -1 'True
Caption = "mm"
Height = 195
Left = 6720
TabIndex = 5
Top = 1800
Width = 240
End
Begin VB.Label Label6
AutoSize = -1 'True
Caption = "mm/s"
Height = 195
Left = 3240
TabIndex = 4
Top = 1800
Width = 390
End
Begin VB.Label Label4
AutoSize = -1 'True
Caption = "默认速度:"
Height = 195
Left = 360
TabIndex = 3
Top = 1800
Width = 900
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "左右两轮间距:"
Height = 195
Left = 3960
TabIndex = 2
Top = 1800
Width = 1260
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "小车前进1mm所需脉冲:"
Height = 195
Left = 360
TabIndex = 1
Top = 240
Width = 1950
End
End
Attribute VB_Name = "FrmSet"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub CmdBack_Click()
Unload Me
End Sub
Private Sub CmdC_Click()
TxtPUsOf1mm.Text = Val(Trim(Label10.Caption)) / Val(Trim(TxtDis.Text))
End Sub
Private Sub CmdE_Click()
sudden_stop2 AxisLeft, AxisRight
CmdE.Enabled = False
CmdS.Enabled = True
End Sub
Private Sub CmdOK_Click()
Dim ConnIni As String
ConnIni = GetAppPath & "\Setup.ini"
WriteOneString "setup", "PUsOf1mm", Trim(TxtPUsOf1mm.Text), ConnIni
WriteOneString "setup", "DefaultVel", Trim(TxtDefaultVel.Text), ConnIni
WriteOneString "setup", "DisLtoR", Trim(TxtDisLtoR.Text), ConnIni
MsgBox "系统参数设置已保存!"
Unload Me
ReadIniPara
End Sub
Private Sub CmdS_Click()
reset_pos AxisLeft
reset_pos AxisRight
set_conspeed AxisLeft, TestVel
set_conspeed AxisRight, TestVel
con_vmove2 AxisLeft, 1, AxisRight, 1
Timer1.Enabled = True
CmdS.Enabled = False
CmdE.Enabled = True
End Sub
Private Sub Form_Load()
TxtPUsOf1mm = PUsOf1mm
TxtDefaultVel = DefaultVel
TxtDisLtoR = DisLtoR
End Sub
Private Sub Timer1_Timer()
Dim pos As Long
get_abs_pos AxisBottleAngle, pos
Label10.Caption = pos
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -