📄 mainform.frm
字号:
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Begin VB.Form frmMain
Caption = "USB Test"
ClientHeight = 10515
ClientLeft = 165
ClientTop = 555
ClientWidth = 15240
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 10515
ScaleWidth = 15240
StartUpPosition = 3 '窗口缺省
Visible = 0 'False
Begin VB.Timer Timer3
Enabled = 0 'False
Interval = 90
Left = 12240
Top = 0
End
Begin VB.Timer Timer2
Enabled = 0 'False
Interval = 80
Left = 11640
Top = 0
End
Begin VB.PictureBox Picture2
BackColor = &H00FF8080&
Height = 3135
Left = 6120
ScaleHeight = 3075
ScaleWidth = 7275
TabIndex = 26
Top = 6600
Width = 7335
End
Begin VB.PictureBox Picture1
BackColor = &H00FFC0C0&
Height = 5175
Left = 6120
ScaleHeight = 5115
ScaleWidth = 7275
TabIndex = 24
Top = 1080
Width = 7335
End
Begin MSComctlLib.StatusBar StatusBar1
Align = 2 'Align Bottom
Height = 375
Left = 0
TabIndex = 23
Top = 10140
Width = 15240
_ExtentX = 26882
_ExtentY = 661
_Version = 393216
BeginProperty Panels {8E3867A5-8586-11D1-B16A-00C0F0283628}
NumPanels = 2
BeginProperty Panel1 {8E3867AB-8586-11D1-B16A-00C0F0283628}
AutoSize = 1
Object.Width = 13150
Text = "郑州大学"
TextSave = "郑州大学"
EndProperty
BeginProperty Panel2 {8E3867AB-8586-11D1-B16A-00C0F0283628}
AutoSize = 1
Object.Width = 13150
Text = "大鼠行为控制系统"
TextSave = "大鼠行为控制系统"
EndProperty
EndProperty
End
Begin VB.Frame Frame1
Caption = "SET"
Height = 4455
Left = 240
TabIndex = 10
Top = 1080
Width = 3135
Begin VB.ComboBox Combo7
Height = 300
Left = 1560
TabIndex = 29
Text = "10"
Top = 3960
Width = 975
End
Begin VB.TextBox Text2
Height = 375
Left = 1560
TabIndex = 22
Text = "100"
Top = 1440
Width = 975
End
Begin VB.ComboBox Combo6
Height = 300
Left = 1560
TabIndex = 21
Text = "100"
Top = 2760
Width = 975
End
Begin VB.ComboBox Combo5
Height = 300
Left = 1560
TabIndex = 19
Text = "正脉冲"
Top = 360
Width = 975
End
Begin VB.ComboBox Combo1
Height = 300
Left = 1560
TabIndex = 13
Text = "1"
Top = 2160
Width = 975
End
Begin VB.ComboBox Combo2
Height = 300
Left = 1560
TabIndex = 12
Text = "1"
Top = 840
Width = 975
End
Begin VB.ComboBox Combo4
Height = 300
Left = 1560
TabIndex = 11
Text = "0"
Top = 3360
Width = 975
End
Begin VB.Label Label4
Caption = "档位"
Height = 375
Left = 360
TabIndex = 28
Top = 3960
Width = 855
End
Begin VB.Label Label3
Caption = "脉冲间隔(100ms-25.5s)"
Height = 375
Left = 360
TabIndex = 20
Top = 2760
Width = 1215
End
Begin VB.Label Label2
Caption = "正/负脉冲"
Height = 255
Left = 360
TabIndex = 18
Top = 360
Width = 855
End
Begin VB.Label Label8
Caption = "占空比(1%-50%)"
Height = 375
Left = 360
TabIndex = 17
Top = 2160
Width = 975
End
Begin VB.Label Label7
Caption = "脉冲长度(1-255)"
Height = 495
Left = 360
TabIndex = 16
Top = 840
Width = 975
End
Begin VB.Label Label6
Caption = "频率(25Hz-10KHz)"
Height = 495
Left = 360
TabIndex = 15
Top = 1440
Width = 1095
End
Begin VB.Label Label5
Caption = "脉串数(0-255)"
Height = 375
Left = 360
TabIndex = 14
Top = 3360
Width = 975
End
End
Begin VB.CommandButton cmdClear
Caption = "Clear"
Height = 375
Left = 2760
TabIndex = 3
Top = 9720
Width = 975
End
Begin VB.TextBox Text1
Height = 3975
Left = 240
MultiLine = -1 'True
ScrollBars = 3 'Both
TabIndex = 2
Top = 5640
Width = 5175
End
Begin VB.Timer Timer1
Interval = 100
Left = 11040
Top = 0
End
Begin VB.Frame Frame3
Caption = "ORDER"
Height = 4335
Left = 3600
TabIndex = 1
Top = 1200
Width = 1815
Begin VB.CommandButton Command5
Caption = "RELAX"
Height = 495
Left = 360
TabIndex = 8
Top = 3120
Width = 1095
End
Begin VB.CommandButton Command4
Caption = "HAPPY"
Height = 495
Left = 360
TabIndex = 7
Top = 2400
Width = 1095
End
Begin VB.CommandButton Command3
Caption = "AHEAD"
Height = 495
Left = 360
TabIndex = 6
Top = 1680
Width = 1095
End
Begin VB.CommandButton Command2
Caption = "RIGHT"
Height = 495
Left = 360
TabIndex = 5
Top = 960
Width = 1095
End
Begin VB.CommandButton Command1
Caption = "LEFT"
Height = 495
Left = 360
TabIndex = 4
Top = 240
Width = 1095
End
End
Begin VB.CommandButton cmdExit
Caption = "Exit"
Height = 375
Left = 3960
TabIndex = 0
Top = 9720
Width = 1095
End
Begin VB.Label Label11
Alignment = 2 'Center
Caption = "图2 一个周期的刺激波形"
Height = 255
Left = 8400
TabIndex = 27
Top = 9840
Width = 2655
End
Begin VB.Label Label19
Alignment = 2 'Center
Caption = "图1 刺激波形"
Height = 255
Left = 8040
TabIndex = 25
Top = 6360
Width = 3375
End
Begin VB.Label Label1
Caption = "大鼠行为控制训练系统"
BeginProperty Font
Name = "宋体"
Size = 24
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000000FF&
Height = 615
Left = 2880
TabIndex = 9
Top = 240
Width = 5175
End
End
Attribute VB_Name = "frmMain"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim order As Integer
Dim mFreqH As Integer
Dim mFreqL As Integer
Dim mWidth As Integer
Dim mLen As Integer
Dim mNum As Integer
Dim mPn As Integer
Dim mCmdNum As Integer
Dim mTime As Integer
Dim flag As Boolean
'Dim a As Integer
'Dim b As Integer
'Dim c As Integer
'Dim d As Integer
'Dim e As Integer
'新增添变量,与画图相关的全局变量
Dim SFmTime As Long
Dim SFmFreq As Integer
Dim vHeight, vLow As Integer '定义高低电平时间
Dim temp1 As Integer '暂存脉冲数
Dim sum As Long
Dim sum1 As Long
Dim mBasewidth As Integer '定义一个周期的宽度
Dim tempNum As Integer '串数
'CLEAR按键单击事件,清空文本框内容。
Private Sub cmdClear_Click()
Text1.Text = ""
End Sub
'EXIT按键单击事件,关闭USB设备并退出程序。
Private Sub cmdExit_Click()
SI_Close (hUSBDevice)
End
End Sub
'鼠标按下ORDER框按钮对应事件,将命令ORDER写入IOBuf(0)
Private Sub Command1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
order = 1
GetsSetPara
Text1.Text = "(Date & Time )" & Text1.Text & Chr(13) & Chr(10) & "Go left! " _
& Chr(13) & Chr(10) & "******************************" & Chr(13) & Chr(10)
Open "c:\note.txt" For Append As #1
Write #1, Text1
Close #1
pictureini
End Sub
Private Sub Command1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
order = 0
End Sub
Private Sub Command2_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
order = 2
GetsSetPara
Text1.Text = "(Date & Time )" & Text1.Text & Chr(13) & Chr(10) & "Go left! " _
& Chr(13) & Chr(10) & "******************************" & Chr(13) & Chr(10)
Open "c:\note.txt" For Append As #1
Write #1, Text1
Close #1
pictureini
End Sub
Private Sub Command2_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -