📄 form1.frm
字号:
VERSION 5.00
Begin VB.Form Form1
BorderStyle = 4 'Fixed ToolWindow
Caption = "数据输入 天津大学自动化系研发 电机试验台一"
ClientHeight = 5460
ClientLeft = 4485
ClientTop = 1575
ClientWidth = 7515
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2497.652
ScaleMode = 0 'User
ScaleWidth = 3698.326
ShowInTaskbar = 0 'False
Begin VB.CommandButton Command1
Caption = "确 定"
BeginProperty Font
Name = "楷体_GB2312"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 1680
TabIndex = 21
Top = 4800
Width = 1455
End
Begin VB.Frame Frame1
Caption = "铭牌数据输入"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 3615
Left = 240
TabIndex = 2
Top = 840
Width = 7095
Begin VB.TextBox Text8
Height = 315
Left = 1440
TabIndex = 11
Top = 2400
Width = 1935
End
Begin VB.TextBox Text7
Height = 315
Left = 1440
TabIndex = 10
Top = 1800
Width = 1935
End
Begin VB.TextBox Text6
Height = 315
Left = 5040
TabIndex = 9
Top = 2400
Width = 1935
End
Begin VB.TextBox Text5
Height = 315
Left = 5040
TabIndex = 8
Top = 600
Width = 1935
End
Begin VB.TextBox Text4
Height = 315
Left = 5040
TabIndex = 7
Top = 1200
Width = 1935
End
Begin VB.TextBox Text3
Height = 315
Left = 5040
TabIndex = 6
Top = 1800
Width = 1935
End
Begin VB.TextBox Text2
Height = 315
Left = 1440
TabIndex = 5
Top = 1200
Width = 1932
End
Begin VB.TextBox Text1
Height = 315
Left = 1440
TabIndex = 4
Top = 600
Width = 1935
End
Begin VB.TextBox Text9
Height = 315
Left = 1440
TabIndex = 3
Top = 3000
Width = 5535
End
Begin VB.Label Label10
Caption = "生产厂家:"
BeginProperty Font
Name = "楷体_GB2312"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00C00000&
Height = 375
Left = 120
TabIndex = 20
Top = 3000
Width = 1215
End
Begin VB.Label Label9
Caption = "出厂日期:"
BeginProperty Font
Name = "楷体_GB2312"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00C00000&
Height = 375
Left = 120
TabIndex = 19
Top = 2400
Width = 1215
End
Begin VB.Label Label8
Caption = "防护等级:"
BeginProperty Font
Name = "楷体_GB2312"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00C00000&
Height = 375
Left = 120
TabIndex = 18
Top = 1800
Width = 1215
End
Begin VB.Label Label7
Caption = "额定电流:"
BeginProperty Font
Name = "楷体_GB2312"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00C00000&
Height = 375
Left = 3720
TabIndex = 17
Top = 2400
Width = 1215
End
Begin VB.Label Label6
Caption = "额定电压:"
BeginProperty Font
Name = "楷体_GB2312"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00C00000&
Height = 375
Left = 3720
TabIndex = 16
Top = 600
Width = 1215
End
Begin VB.Label Label5
Caption = "额定转速:"
BeginProperty Font
Name = "楷体_GB2312"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00C00000&
Height = 375
Left = 3720
TabIndex = 15
Top = 1200
Width = 1215
End
Begin VB.Label Label4
Caption = "额定功率:"
BeginProperty Font
Name = "楷体_GB2312"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00C00000&
Height = 375
Left = 3720
TabIndex = 14
Top = 1800
Width = 1215
End
Begin VB.Label Label1
Caption = "电机型号:"
BeginProperty Font
Name = "楷体_GB2312"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00C00000&
Height = 375
Left = 120
TabIndex = 13
Top = 600
Width = 1215
End
Begin VB.Label Label2
Caption = "编 号:"
BeginProperty Font
Name = "楷体_GB2312"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00C00000&
Height = 375
Left = 120
TabIndex = 12
Top = 1200
Width = 1215
End
End
Begin VB.CommandButton Command4
Caption = "退 出"
BeginProperty Font
Name = "楷体_GB2312"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 4320
TabIndex = 1
Top = 4800
Width = 1455
End
Begin VB.Label Label11
Caption = "请输入铭牌数据"
BeginProperty Font
Name = "楷体_GB2312"
Size = 15.75
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00C00000&
Height = 375
Left = 2520
TabIndex = 0
Top = 240
Width = 2415
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Set reportdb = OpenDatabase("F:\天津大学电机试验台程序\试验台数据库\报表")
Set reportrd = reportdb.OpenRecordset("报表", dbOpenTable)
Dim n As Integer
If (Text2.Text = "") Then
n = MsgBox("请输入编号", vbOKOnly, "警告窗口")
Else
reportname = Format(Now, "yy/mm/dd") + "-" + Format(Now, "hh/mm") + "-" + Text2.Text
reportrd.AddNew
reportrd.Fields(0) = reportname
reportrd.Fields(1) = Text1.Text
reportrd.Fields(2) = Text7.Text
reportrd.Fields(3) = Text8.Text
reportrd.Fields(4) = Text9.Text
reportrd.Fields(5) = Text5.Text
reportrd.Fields(6) = Text4.Text
reportrd.Fields(7) = Text6.Text
reportrd.Fields(8) = Text3.Text
reportrd.Update
Set reportdb = OpenDatabase("F:\天津大学电机试验台程序\试验台数据库\报表")
Set reportrd = reportdb.OpenRecordset("报表", dbOpenTable)
reportrd.MoveLast
reportrd.Edit
reportrd.Fields("空载试验是否已做") = "否"
reportrd.Fields("额定试验是否已做") = "否"
reportrd.Fields("启动试验是否已做") = "否"
reportrd.Fields("堵转试验是否已做") = "否"
reportrd.Fields("试验额定转速") = "0"
reportrd.Fields("试验额定电流") = "0"
reportrd.Fields("试验额定转矩") = "0"
reportrd.Fields("试验空载转速") = "0"
reportrd.Fields("试验空载电流") = "0"
reportrd.Fields("试验空载转矩") = "0"
reportrd.Fields("试验启动电流") = "0"
reportrd.Fields("试验启动转矩") = "0"
reportrd.Fields("试验堵转电流") = "0"
reportrd.Fields("试验堵转转矩") = "0"
reportrd.Update
kzhavebedone = False
edhavebedone = False
qdhavebedone = False
dzhavebedone = False
ErrCde = DRV_DeviceOpen(0, DeviceHandle)
'ptDevGetFeatures.buffer = DRV_GetAddress(lpDevFeatures)
'ErrCde = DRV_DeviceGetFeatures(DeviceHandle, ptDevGetFeatures)
lpCounterEventStart.counter = 1
ErrCde = DRV_CounterEventStart(DeviceHandle, lpCounterEventStart)
lpCounterEventStarts.counter = 0
ErrCde = DRV_CounterEventStart(DeviceHandle, lpCounterEventStarts)
lpCounterEventStartc.counter = 4
ErrCde = DRV_CounterEventStart(DeviceHandle, lpCounterEventStartc)
Text2.Text = ""
'form2load = True
Form2.Show
Form1.Hide
End If
End Sub
Private Sub Command4_Click()
End
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -