📄 form6.frm
字号:
VERSION 5.00
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "comdlg32.ocx"
Begin VB.Form Form6
Caption = "读数曲线"
ClientHeight = 7665
ClientLeft = 60
ClientTop = 465
ClientWidth = 8820
LinkTopic = "Form6"
ScaleHeight = 7665
ScaleWidth = 8820
StartUpPosition = 3 '窗口缺省
Begin MSComDlg.CommonDialog CommonDialog1
Left = 840
Top = 6480
_ExtentX = 847
_ExtentY = 847
_Version = 393216
FileName = " "
End
Begin VB.TextBox Text2
Height = 375
Left = 4200
TabIndex = 9
Top = 5760
Width = 1455
End
Begin VB.TextBox Text1
Height = 375
Left = 2160
TabIndex = 8
Top = 5760
Width = 1335
End
Begin VB.Timer Timer1
Enabled = 0 'False
Interval = 100
Left = 240
Top = 6480
End
Begin VB.CommandButton Command3
Caption = "保存"
Height = 375
Left = 3480
TabIndex = 7
Top = 6480
Width = 975
End
Begin VB.PictureBox Picture1
Height = 4575
Left = 600
ScaleHeight = 4515
ScaleWidth = 7635
TabIndex = 2
Top = 240
Width = 7695
End
Begin VB.CommandButton Command2
Caption = "退出"
Height = 375
Left = 5280
TabIndex = 1
Top = 6480
Width = 975
End
Begin VB.CommandButton Command1
Caption = "绘图"
Height = 375
Left = 1800
TabIndex = 0
Top = 6480
Width = 975
End
Begin VB.Label Label6
Caption = "Y:"
Height = 375
Left = 3960
TabIndex = 11
Top = 5880
Width = 255
End
Begin VB.Label Label5
Caption = "X:"
Height = 375
Left = 1800
TabIndex = 10
Top = 5880
Width = 255
End
Begin VB.Label Label4
Caption = "横 坐 标"
Height = 255
Left = 3240
TabIndex = 6
Top = 5160
Width = 2055
End
Begin VB.Label Label3
Caption = " 标"
Height = 495
Left = 120
TabIndex = 5
Top = 1680
Width = 375
End
Begin VB.Label Label2
Caption = "坐"
Height = 375
Left = 240
TabIndex = 4
Top = 2280
Width = 255
End
Begin VB.Label Label1
Caption = "纵"
Height = 255
Left = 240
TabIndex = 3
Top = 960
Width = 255
End
End
Attribute VB_Name = "Form6"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim i As Integer
Dim xiebo(120) As Integer
Dim N1
Private Sub Command1_Click()
Picture1.Scale (-60, 60)-(60, -60)
Picture1.Line (-60, 60)-(60, -60), QBColor(9), B
Picture1.Line (-60, 0)-(60, 0), RGB(255, 0, 0)
Picture1.Line (0, 60)-(0, -60), RGB(255, 0, 0)
For k = 0 To 120 Step 1
xiebo(k) = 0
Next k
i = 0
Timer1.Interval = 100
If Command1.Caption = "绘图" Then
Timer1.Enabled = True
Command1.Caption = "暂停"
Else: If Command1.Caption = "暂停" Then Timer1.Enabled = False
Command1.Caption = "绘图"
End If
'If Form6.Command1.Caption = "绘图" Then Form6.Command1.Caption = "停止"
'Form1.MSComm1.InputMode = comInputModeText
' Form1.MSComm1.InputLen = 1
'Form1.MSComm1.RThreshold = 1
'Form1.MSComm1.SThreshold = 10
'Form6.Timer1.Enabled = True
'Else:
'Form6.Command1.Caption = "绘图"
'Form1.MSComm1.PortOpen = False
'StopTiming
' End If
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Command3_Click()
Dim strFile As String
CommonDialog1.ShowSave
strFile = CommonDialog1.FileName
If strFile <> "" Then
Open strFile For Output As #1
Print #1, Picture1.Picture
Close #1
End If
End Sub
Private Sub Picture1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Me.Text1 = Str(X)
Me.Text2 = Str(Y)
End Sub
Private Sub Timer1_Timer()
Dim X, t As Integer
N1 = Array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25)
Picture1.Cls
Picture1.Scale (-60, 60)-(60, -60)
Picture1.Line (-60, 60)-(60, -60), QBColor(9), B
Picture1.Line (-60, 0)-(60, 0), RGB(255, 0, 0)
Picture1.Line (0, 60)-(0, -60), RGB(255, 0, 0)
For j = 120 To 1 Step -1
xiebo(j) = xiebo(j - 1)
Next j
xiebo(0) = N1(i)
For t = 1 To 120 Step 1
X = t - 60
Picture1.Line (X - 1, xiebo(t - 1))-(X, xiebo(t)), RGB(0, 255, 0)
Next t
i = i + 1
'Dim X, Y As Single
'Dim bb As Double
' Dim cc As Single
' Dim bbstr As String
' Dim xieboChart(1 To 100) As Double
'Form1.MSComm1.PortOpen = True
'Form6.Text1.Text = Form1.MSComm1.Input
' bbstr = Form1.MSComm1.Input
'bb = Val(Form1.MSComm1.Input)
'xieboChart(100) = bb
'For i = 1 To 99 Step 1
'xieboChart(1) = bb
' xieboChart(i + 1) = xieboChart(i)
'X = -5 + i * 0.1
'xieboChart (i)
'Picture1.PSet (X, Y), RGB(255, 0, 0)
'Next i
'Form1.MSComm1.PortOpen = False
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -