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

📄 ds9123prefchoose.frm

📁 利用VB开发的针对Maxim-Dallas DS2770电量检测芯片
💻 FRM
字号:
VERSION 5.00
Begin VB.Form DS9123PrefChoose 
   Caption         =   "Select Preferences"
   ClientHeight    =   1845
   ClientLeft      =   45
   ClientTop       =   555
   ClientWidth     =   3765
   Icon            =   "DS9123PrefChoose.frx":0000
   LinkTopic       =   "Form2"
   ScaleHeight     =   1845
   ScaleWidth      =   3765
   StartUpPosition =   2  'CenterScreen
   Begin VB.CommandButton cmdPoll 
      Caption         =   "Poll Serial Ports"
      Height          =   372
      Left            =   720
      TabIndex        =   6
      Top             =   1440
      Width           =   1455
   End
   Begin VB.CommandButton cmdOK 
      Caption         =   "OK"
      Height          =   372
      Left            =   2280
      TabIndex        =   5
      Top             =   1440
      Width           =   1455
   End
   Begin VB.Frame Frame1 
      Height          =   1335
      Left            =   0
      TabIndex        =   0
      Top             =   0
      Width           =   3732
      Begin VB.ComboBox txtBaudRate 
         Height          =   288
         Left            =   1920
         TabIndex        =   4
         Text            =   "19200"
         Top             =   840
         Width           =   1092
      End
      Begin VB.ComboBox txtCommPort 
         Height          =   288
         Left            =   1920
         TabIndex        =   2
         Text            =   "1"
         Top             =   360
         Width           =   1092
      End
      Begin VB.Label Label2 
         BackStyle       =   0  'Transparent
         Caption         =   "Baud Rate"
         Height          =   372
         Left            =   720
         TabIndex        =   3
         Top             =   840
         Width           =   1212
      End
      Begin VB.Label Label1 
         Caption         =   "Comm Port"
         Height          =   252
         Left            =   720
         TabIndex        =   1
         Top             =   360
         Width           =   1332
      End
   End
   Begin VB.Menu mnuNotes 
      Caption         =   "&Notes"
   End
End
Attribute VB_Name = "DS9123PrefChoose"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Public PortOK As Boolean

Private Sub cmdOK_Click()
    PortOK = True
    MousePointer = 11
    DS9123.PrefCommPort = txtCommPort.Text
    DS9123.PrefBaudRate = txtBaudRate.Text
    DS9123.SavePref
    Unload Me
    If Not DS9123.Initializing Then
        DS9123.Initialize
    End If
    MousePointer = 0
End Sub

Private Sub cmdPoll_Click()
    MousePointer = 11
    DS9123.AdapterError = False
    DS9123.PollSerialPorts
    If DS9123.AdapterError = True Then
        MsgBox "Unable to Find DS9123." & Chr$(13) & Chr$(10) & "Check Connection and Click OK."
    Else
        txtCommPort.Text = DS9123.PrefCommPort
        DS9123.SavePref
        DS9123.Initialize
    End If
    MousePointer = 0
End Sub

Private Sub Form_Load()
    txtCommPort.AddItem "1", 0
    txtCommPort.AddItem "2", 1
    txtCommPort.AddItem "3", 2
    txtCommPort.AddItem "4", 3
    txtCommPort.AddItem "5", 4
    txtCommPort.AddItem "6", 5
    txtCommPort.AddItem "7", 6
    txtCommPort.AddItem "8", 7
    txtCommPort.AddItem "9", 8
    txtCommPort.AddItem "10", 9
    
    txtBaudRate.AddItem "9600", 0
    txtBaudRate.AddItem "19200", 1
    txtBaudRate.AddItem "57600", 2
    
    If DS9123.PrefCommPort <> 0 Then
        txtCommPort.Text = DS9123.PrefCommPort
    End If
    
    If DS9123.PrefBaudRate <> 0 Then
        txtBaudRate.Text = DS9123.PrefBaudRate
    End If
End Sub

Private Sub Form_Unload(Cancel As Integer)
    If PortOK = False Then
        End
    End If
End Sub

Private Sub mnuNotes_Click()
    MsgBox "The Baud Rate of 19200 should be selected for optimum performance of this software.  The 9600 Baud Rate should only be selected if your computer cannot support 19200.", , "Note on Baud Rate"
End Sub

⌨️ 快捷键说明

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