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

📄 frmoption.frm

📁 回流焊监控系统-DCS,VB编写,对PLC进行通讯采集和控制,界面直观,操作方便,可以作为同类软件系统提供示范
💻 FRM
字号:
VERSION 5.00
Begin VB.Form frmOption 
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "型号选项"
   ClientHeight    =   6435
   ClientLeft      =   5730
   ClientTop       =   2400
   ClientWidth     =   5145
   Icon            =   "frmOption.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   6435
   ScaleWidth      =   5145
   ShowInTaskbar   =   0   'False
   Begin VB.CheckBox ckTemp 
      Caption         =   "冷却2"
      Height          =   255
      Index           =   9
      Left            =   600
      TabIndex        =   28
      Top             =   4920
      Width           =   1215
   End
   Begin VB.CheckBox ckTemp 
      Caption         =   "冷却1"
      Height          =   255
      Index           =   8
      Left            =   600
      TabIndex        =   27
      Top             =   4560
      Width           =   1215
   End
   Begin VB.CheckBox ckTemp 
      Caption         =   "制冷开关"
      Height          =   255
      Index           =   7
      Left            =   600
      TabIndex        =   26
      Top             =   4200
      Width           =   1215
   End
   Begin VB.CheckBox ckTemp 
      Caption         =   "机盖开关"
      Height          =   255
      Index           =   6
      Left            =   600
      TabIndex        =   25
      Top             =   3840
      Width           =   1215
   End
   Begin VB.CheckBox ckTemp 
      Caption         =   "氮气开关"
      Height          =   255
      Index           =   5
      Left            =   600
      TabIndex        =   24
      Top             =   3480
      Width           =   1215
   End
   Begin VB.CheckBox ckTemp 
      Caption         =   "风机3"
      Height          =   255
      Index           =   4
      Left            =   600
      TabIndex        =   23
      Top             =   3120
      Width           =   1215
   End
   Begin VB.CheckBox ckTemp 
      Caption         =   "风机2"
      Height          =   255
      Index           =   3
      Left            =   600
      TabIndex        =   22
      Top             =   2760
      Width           =   1215
   End
   Begin VB.CheckBox ckTemp 
      Caption         =   "风机1"
      Height          =   255
      Index           =   2
      Left            =   600
      TabIndex        =   21
      Top             =   2400
      Width           =   1215
   End
   Begin VB.CheckBox ckTemp 
      Caption         =   "掉板检测"
      Height          =   255
      Index           =   1
      Left            =   600
      TabIndex        =   20
      Top             =   2040
      Width           =   1215
   End
   Begin VB.CheckBox ckTemp 
      Caption         =   "产品检测"
      Height          =   255
      Index           =   0
      Left            =   600
      TabIndex        =   19
      Top             =   1680
      Width           =   1215
   End
   Begin VB.CheckBox ckTemp 
      Caption         =   "读板卡曲线"
      Height          =   255
      Index           =   10
      Left            =   600
      TabIndex        =   18
      Top             =   5280
      Width           =   1215
   End
   Begin VB.CheckBox ckTemp 
      Caption         =   "宽度调节"
      Height          =   255
      Index           =   11
      Left            =   2880
      TabIndex        =   17
      Top             =   1680
      Width           =   1215
   End
   Begin VB.CheckBox ckTemp 
      Caption         =   "定时设置"
      Height          =   255
      Index           =   12
      Left            =   2880
      TabIndex        =   16
      Top             =   2040
      Width           =   1215
   End
   Begin VB.CheckBox ckTemp 
      Caption         =   "曲线测试"
      Height          =   255
      Index           =   13
      Left            =   2880
      TabIndex        =   15
      Top             =   2400
      Width           =   1215
   End
   Begin VB.CheckBox ckTemp 
      Caption         =   "氮气曲线"
      Height          =   255
      Index           =   14
      Left            =   2880
      TabIndex        =   14
      Top             =   2760
      Width           =   1215
   End
   Begin VB.CheckBox ckTemp 
      Caption         =   "运输反转"
      Height          =   255
      Index           =   15
      Left            =   2880
      TabIndex        =   13
      Top             =   3120
      Width           =   1215
   End
   Begin VB.CheckBox ckTemp 
      Caption         =   "掉板清零"
      Height          =   255
      Index           =   16
      Left            =   2880
      TabIndex        =   12
      Top             =   3480
      Width           =   1215
   End
   Begin VB.CheckBox ckTemp 
      Caption         =   "产量清零"
      Height          =   255
      Index           =   17
      Left            =   2880
      TabIndex        =   11
      Top             =   3840
      Width           =   1215
   End
   Begin VB.CheckBox ckTemp 
      Caption         =   "台达PLC"
      Height          =   255
      Index           =   18
      Left            =   2880
      TabIndex        =   10
      Top             =   4200
      Value           =   1  'Checked
      Width           =   1215
   End
   Begin VB.CheckBox ckTemp 
      Caption         =   "西门子PLC"
      Height          =   255
      Index           =   19
      Left            =   2880
      TabIndex        =   9
      Top             =   4560
      Width           =   1215
   End
   Begin VB.CheckBox ckTemp 
      Caption         =   "三菱PLC"
      Height          =   255
      Index           =   20
      Left            =   2880
      TabIndex        =   8
      Top             =   4920
      Width           =   1215
   End
   Begin VB.CheckBox ckTemp 
      Caption         =   "直接读PLC区曲线"
      Height          =   255
      Index           =   21
      Left            =   2880
      TabIndex        =   7
      Top             =   5280
      Width           =   1815
   End
   Begin VB.CheckBox ckTemp 
      Caption         =   "单面/双面 加热"
      Height          =   375
      Index           =   22
      Left            =   2760
      TabIndex        =   6
      Top             =   600
      Width           =   1815
   End
   Begin VB.Frame Frame2 
      Caption         =   "选项"
      Height          =   4455
      Left            =   120
      TabIndex        =   5
      Top             =   1320
      Width           =   4815
   End
   Begin VB.Frame Frame1 
      Caption         =   "型号选择"
      ClipControls    =   0   'False
      Height          =   1095
      Left            =   120
      TabIndex        =   3
      Top             =   120
      Width           =   4815
      Begin VB.ComboBox cbType 
         Height          =   300
         Left            =   960
         TabIndex        =   0
         Top             =   480
         Width           =   1215
      End
      Begin VB.Label Label1 
         Caption         =   "型号"
         Height          =   255
         Left            =   360
         TabIndex        =   4
         Top             =   480
         Width           =   495
      End
   End
   Begin VB.CommandButton CancelButton 
      Caption         =   "取消"
      Height          =   375
      Left            =   3240
      TabIndex        =   2
      Top             =   5880
      Width           =   1215
   End
   Begin VB.CommandButton OKButton 
      Caption         =   "确定"
      Default         =   -1  'True
      Height          =   375
      Left            =   720
      TabIndex        =   1
      Top             =   5880
      Width           =   1215
   End
End
Attribute VB_Name = "frmOption"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False

Option Explicit

Dim IsNotFirst As Boolean

Private Sub CancelButton_Click()
 Me.Hide
 frmMain.Enabled = True
End Sub

Private Sub cbType_Click()
 Dim i As Long
 On Error GoTo Errhandle
 If cbType.ListIndex <> iCurrentOption Then
    For i = 0 To 22
      If oOption(cbType.ListIndex).bOption(i) Then
        ckTemp(i).Value = 1
      Else
        ckTemp(i).Value = 0
      End If
    Next
 End If
 Exit Sub
Errhandle:
  MsgBox Err.description
  Err.Clear
End Sub

Private Sub ckTemp_Click(Index As Integer)
 Dim i As Integer
 On Error GoTo Errhandle
 If IsNotFirst Then
    If Index >= 18 And Index <= 20 Then
      IsNotFirst = False
      For i = 18 To 20
       If i <> Index Then
        ckTemp(i).Value = 0
       Else
        ckTemp(i).Value = 1
       End If
      Next
      IsNotFirst = True
    Else
      If Index Mod 11 = 10 Then
          IsNotFirst = False
          If Index = 10 Then
           ckTemp(21).Value = 0
          Else
           ckTemp(10).Value = 0
          End If
          IsNotFirst = True
      End If
    End If
 End If
 Exit Sub
Errhandle:
 MsgBox Err.description
 Err.Clear
End Sub

Private Sub Form_Activate()
SetDlgBackColor Me
End Sub

Private Sub Form_Load()
  Dim i As Long
  cbType.Clear
  For i = 0 To iOptionCount - 1
    cbType.AddItem oOption(i).sOptionName
  Next
  cbType.ListIndex = iCurrentOption
  For i = 0 To 22
    If oOption(iCurrentOption).bOption(i) Then
      ckTemp(i).Value = 1
    Else
      ckTemp(i).Value = 0
    End If
  Next
  IsNotFirst = True
End Sub

Private Sub Form_Unload(Cancel As Integer)
Call CancelButton_Click
Cancel = 1
End Sub

Private Sub OKButton_Click()
  Dim i As Long, j As Long
   On Error GoTo Errhandle
  j = cbType.ListIndex
  WritePrivateProfileString "Option", "currentID", CStr(j), iniFile
  oOption(j).sOption = ""
  For i = 0 To 22
     oOption(j).bOption(i) = -ckTemp(i).Value
     oOption(j).sOption = oOption(j).sOption & ckTemp(i).Value
  Next
  WritePrivateProfileString "Option", CStr(j), oOption(j).sOption, iniFile
  Me.Hide
  frmMain.Enabled = True
  If MsgBox("程序从新启动后生效!是否要退出程序?", vbYesNo + vbQuestion, "提示") = vbYes Then
    End
  End If
'  Call frmMain.OptionReSet
  Exit Sub
Errhandle:
   MsgBox Err.description
   Err.Clear
End Sub

⌨️ 快捷键说明

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