⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 form5.frm

📁 基于MSCOMM的炉温控制系统上位机程序
💻 FRM
字号:
VERSION 5.00
Begin VB.Form Form5 
   BorderStyle     =   0  'None
   Caption         =   "参数设置"
   ClientHeight    =   4035
   ClientLeft      =   0
   ClientTop       =   105
   ClientWidth     =   5535
   LinkTopic       =   "Form5"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   269
   ScaleMode       =   3  'Pixel
   ScaleWidth      =   369
   ShowInTaskbar   =   0   'False
   StartUpPosition =   3  '窗口缺省
   Begin 炉温自动控制系统.xp_canvas xp_canvas1 
      Height          =   4020
      Left            =   0
      TabIndex        =   0
      Top             =   0
      Width           =   5505
      _ExtentX        =   9710
      _ExtentY        =   7091
      Caption         =   "参数设置"
      Begin 炉温自动控制系统.xpcmdbutton Command1 
         Height          =   465
         Left            =   2880
         TabIndex        =   15
         Top             =   3195
         Width           =   1095
         _ExtentX        =   1931
         _ExtentY        =   820
         Caption         =   "取消"
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "宋体"
            Size            =   9
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
      End
      Begin 炉温自动控制系统.xpcmdbutton Command2 
         Height          =   465
         Left            =   1170
         TabIndex        =   14
         Top             =   3195
         Width           =   1050
         _ExtentX        =   1852
         _ExtentY        =   820
         Caption         =   "确定"
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "宋体"
            Size            =   9
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
      End
      Begin VB.Frame Frame1 
         BackColor       =   &H00DEEBEF&
         Caption         =   "温度设定"
         Height          =   2340
         Left            =   225
         TabIndex        =   1
         Top             =   675
         Width           =   4890
         Begin VB.Frame Frame3 
            BackColor       =   &H00DEEBEF&
            Caption         =   "温度设置"
            Height          =   855
            Left            =   120
            TabIndex        =   9
            Top             =   1200
            Width           =   4575
            Begin VB.TextBox Text3 
               BeginProperty Font 
                  Name            =   "宋体"
                  Size            =   12
                  Charset         =   134
                  Weight          =   400
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               Height          =   375
               Left            =   3150
               TabIndex        =   11
               Text            =   "Text3"
               Top             =   240
               Width           =   855
            End
            Begin VB.TextBox Text2 
               BeginProperty Font 
                  Name            =   "宋体"
                  Size            =   12
                  Charset         =   134
                  Weight          =   400
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               Height          =   375
               Left            =   1200
               TabIndex        =   10
               Text            =   "36.2"
               Top             =   240
               Width           =   735
            End
            Begin VB.Label Label3 
               BackColor       =   &H00DEEBEF&
               Caption         =   "设置温度:"
               BeginProperty Font 
                  Name            =   "宋体"
                  Size            =   12
                  Charset         =   134
                  Weight          =   400
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               Height          =   255
               Left            =   2040
               TabIndex        =   13
               Top             =   360
               Width           =   1215
            End
            Begin VB.Label Label2 
               BackColor       =   &H00DEEBEF&
               Caption         =   "当前温度:"
               BeginProperty Font 
                  Name            =   "宋体"
                  Size            =   12
                  Charset         =   134
                  Weight          =   400
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               Height          =   255
               Left            =   120
               TabIndex        =   12
               Top             =   360
               Width           =   1095
            End
         End
         Begin VB.Frame Frame2 
            BackColor       =   &H00DEEBEF&
            Caption         =   "PID参数调整"
            Height          =   690
            Left            =   150
            TabIndex        =   2
            Top             =   225
            Width           =   4515
            Begin VB.TextBox Text1 
               Alignment       =   2  'Center
               Appearance      =   0  'Flat
               BeginProperty Font 
                  Name            =   "宋体"
                  Size            =   12
                  Charset         =   134
                  Weight          =   400
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               Height          =   390
               Index           =   0
               Left            =   675
               TabIndex        =   5
               Text            =   "1"
               Top             =   225
               Width           =   720
            End
            Begin VB.TextBox Text1 
               Alignment       =   2  'Center
               Appearance      =   0  'Flat
               BeginProperty Font 
                  Name            =   "宋体"
                  Size            =   12
                  Charset         =   134
                  Weight          =   400
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               Height          =   390
               Index           =   1
               Left            =   2100
               TabIndex        =   4
               Text            =   "1"
               Top             =   225
               Width           =   720
            End
            Begin VB.TextBox Text1 
               Alignment       =   2  'Center
               Appearance      =   0  'Flat
               BeginProperty Font 
                  Name            =   "宋体"
                  Size            =   12
                  Charset         =   134
                  Weight          =   400
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               Height          =   390
               Index           =   2
               Left            =   3465
               TabIndex        =   3
               Text            =   "1"
               Top             =   225
               Width           =   765
            End
            Begin VB.Label Label1 
               BackColor       =   &H00DEEBEF&
               Caption         =   "kp"
               BeginProperty Font 
                  Name            =   "宋体"
                  Size            =   15
                  Charset         =   134
                  Weight          =   700
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               Height          =   315
               Index           =   0
               Left            =   225
               TabIndex        =   8
               Top             =   300
               Width           =   615
            End
            Begin VB.Label Label1 
               BackColor       =   &H00DEEBEF&
               Caption         =   "ki"
               BeginProperty Font 
                  Name            =   "宋体"
                  Size            =   15
                  Charset         =   134
                  Weight          =   700
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               Height          =   315
               Index           =   1
               Left            =   1650
               TabIndex        =   7
               Top             =   300
               Width           =   615
            End
            Begin VB.Label Label1 
               BackColor       =   &H00DEEBEF&
               Caption         =   "kd"
               BeginProperty Font 
                  Name            =   "宋体"
                  Size            =   15
                  Charset         =   134
                  Weight          =   700
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               Height          =   315
               Index           =   2
               Left            =   3000
               TabIndex        =   6
               Top             =   300
               Width           =   615
            End
         End
      End
   End
End
Attribute VB_Name = "Form5"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim TxtChange As Boolean
Private Sub Command1_Click()
Unload Me
End Sub

Private Sub Command2_Click()

Set db = Workspaces(0).OpenDatabase(App.Path + "/control.mdb")
Set td = db.TableDefs("control")
Set Rs = td.OpenRecordset
Rs.Edit
For i = 0 To 2
  Rs.Fields(i).Value = CDbl(Text1(i).Text)
  Form1.Label6(i).Caption = CDbl(Text1(i).Text)
Next

Rs.Update
Rs.Close
If TxtChange = True Then
  Form1.Label12.Caption = Form5.Text3.Text
End If
Set db = Workspaces(0).OpenDatabase(App.Path + "/control.mdb")
Set td = db.TableDefs("settemp")
Set Rs = td.OpenRecordset
Rs.Edit
Rs.Fields(0).Value = CDbl(Text3.Text)
Rs.Update
Rs.Close
Unload Me
End Sub

Private Sub Form_Activate()
Form5.Text2.Text = Form1.Label11.Caption
Form5.Text3.Text = Form1.Label12.Caption
End Sub

Private Sub Form_Load()
TxtChange = False
For i = 0 To 2
   Text1(i).Text = Form1.Label6(i).Caption
Next
End Sub

Private Sub Text3_Change()
TxtChange = True
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -