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

📄 frmopcgroupproperties.frm

📁 opc 通讯 册测试通讯OPC使用 客户端/服务端
💻 FRM
字号:
VERSION 5.00
Begin VB.Form frmOPCGroupProperties 
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "OPC 组属性"
   ClientHeight    =   2235
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   4680
   ControlBox      =   0   'False
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   2235
   ScaleWidth      =   4680
   ShowInTaskbar   =   0   'False
   StartUpPosition =   1  '所有者中心
   Begin VB.CommandButton OkButton 
      Caption         =   "确定(&Y)"
      Height          =   375
      Left            =   1920
      TabIndex        =   7
      Top             =   1710
      Width           =   1335
   End
   Begin VB.CheckBox ActiveState 
      Alignment       =   1  'Right Justify
      Caption         =   "Active State:"
      Height          =   375
      Left            =   270
      TabIndex        =   6
      ToolTipText     =   "Click here to change the active state of the group"
      Top             =   1320
      Value           =   1  'Checked
      Width           =   1215
   End
   Begin VB.TextBox DeadBand 
      Height          =   285
      Left            =   1110
      MaxLength       =   3
      TabIndex        =   5
      Text            =   "0"
      ToolTipText     =   "Enter a new Group DeadBand 0 - 100"
      Top             =   930
      Width           =   3135
   End
   Begin VB.TextBox UpdateRate 
      Height          =   285
      Left            =   1110
      TabIndex        =   3
      Text            =   "100"
      ToolTipText     =   "Enter a new Group Update Rate 0 - 2147483647 milliseconds"
      Top             =   570
      Width           =   3135
   End
   Begin VB.TextBox GroupName 
      Height          =   285
      Left            =   1110
      Locked          =   -1  'True
      TabIndex        =   1
      Text            =   "Group Name"
      ToolTipText     =   "The Group Name cannot be edited in this demo"
      Top             =   210
      Width           =   3135
   End
   Begin VB.Label Label3 
      AutoSize        =   -1  'True
      Caption         =   "比率:"
      Height          =   180
      Left            =   360
      TabIndex        =   4
      Top             =   960
      Width           =   540
   End
   Begin VB.Label Label2 
      AutoSize        =   -1  'True
      Caption         =   "刷新频率:"
      Height          =   180
      Left            =   0
      TabIndex        =   2
      Top             =   600
      Width           =   900
   End
   Begin VB.Label Label1 
      AutoSize        =   -1  'True
      Caption         =   "组名称:"
      Height          =   180
      Left            =   180
      TabIndex        =   0
      Top             =   240
      Width           =   720
   End
End
Attribute VB_Name = "frmOPCGroupProperties"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Option Base 1

Private Sub Form_Load()
    Dim VarSingle As Single
    Dim VarLong As Long
    Dim VarState As Boolean
        
    If Not Module1.SelectedOPCGroup Is Nothing Then
        GroupName.Text = Module1.SelectedOPCGroup.GetGroupName
        If (Module1.SelectedOPCGroup.GetGroupUpdateRate(VarLong) = True) Then
            UpdateRate.Text = Str(VarLong)
        Else
            UpdateRate.Text = "0"
        End If
        If (Module1.SelectedOPCGroup.GetGroupDeadBand(VarSingle) = True) Then
            DeadBand.Text = Str(VarSingle)
        Else
            DeadBand.Text = "0"
        End If
        If (Module1.SelectedOPCGroup.GetGroupActiveState(VarState) = True) Then
            If VarState = True Then
                ActiveState.Value = 1
            Else
                ActiveState.Value = 0
            End If
        Else
            ActiveState.Value = 0
        End If
        
    End If
       
End Sub

Private Sub ActiveState_Click()
    If Not Module1.SelectedOPCGroup Is Nothing Then
        Module1.SelectedOPCGroup.SetGroupActiveState (ActiveState.Value)
    End If
End Sub

Private Sub DeadBand_Change()
    If Not Module1.SelectedOPCGroup Is Nothing Then
        Module1.SelectedOPCGroup.SetGroupDeadBand (Val(DeadBand.Text))
    End If
End Sub

Private Sub UpdateRate_Change()
    If Not Module1.SelectedOPCGroup Is Nothing Then
        Module1.SelectedOPCGroup.SetGroupUpdateRate (Val(UpdateRate.Text))
    End If
End Sub

Private Sub OkButton_Click()
    fMainForm.tvTreeView.Enabled = True
    Unload Me
End Sub

Private Sub Form_Deactivate()
    frmOPCGroupProperties.Show
End Sub

⌨️ 快捷键说明

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