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

📄 frmdevicesetup

📁 用VB编写的接收卫星接收机的是数据
💻
字号:
VERSION 5.00
Begin VB.Form frmDeviceSetup 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "打开/配置设备向导 Step1 —— 打开设备"
   ClientHeight    =   4260
   ClientLeft      =   45
   ClientTop       =   375
   ClientWidth     =   6765
   FillColor       =   &H00FFFFFF&
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   4260
   ScaleWidth      =   6765
   StartUpPosition =   1  '所有者中心
   Visible         =   0   'False
   Begin VB.PictureBox picBanner 
      Appearance      =   0  'Flat
      BackColor       =   &H80000005&
      ForeColor       =   &H80000008&
      Height          =   825
      Index           =   1
      Left            =   0
      Picture         =   "frmDeviceSetup修改.frx":0000
      ScaleHeight     =   795
      ScaleWidth      =   6765
      TabIndex        =   8
      Top             =   0
      Width           =   6800
      Begin VB.Label Label2 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "Ezusb Open and Setup Wizard"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   15
            Charset         =   134
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00FFFFFF&
         Height          =   300
         Left            =   120
         TabIndex        =   9
         Top             =   120
         Width           =   4455
      End
   End
   Begin VB.PictureBox picBanner 
      Appearance      =   0  'Flat
      BackColor       =   &H80000005&
      ForeColor       =   &H80000008&
      Height          =   825
      Index           =   0
      Left            =   0
      ScaleHeight     =   795
      ScaleWidth      =   6765
      TabIndex        =   6
      Top             =   0
      Width           =   6800
      Begin VB.Label lblBannerTitle 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "Ezusb Open and Setup Wizard"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   15
            Charset         =   134
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00FFFFFF&
         Height          =   300
         Left            =   120
         TabIndex        =   7
         Top             =   120
         Width           =   4455
      End
   End
   Begin VB.TextBox txtDatafilePath 
      Height          =   300
      Left            =   1440
      TabIndex        =   5
      Top             =   3405
      Width           =   1455
   End
   Begin VB.TextBox txtFirmwarePath 
      Height          =   300
      Left            =   1440
      TabIndex        =   3
      Top             =   2205
      Width           =   1455
   End
   Begin VB.ComboBox combDevices 
      Height          =   300
      Left            =   2520
      Style           =   2  'Dropdown List
      TabIndex        =   1
      Top             =   1200
      Width           =   2055
   End
   Begin VB.Label lblDatafilePath 
      AutoSize        =   -1  'True
      Caption         =   "* 数据存储文件路径:"
      Height          =   180
      Left            =   480
      TabIndex        =   4
      Top             =   3120
      Width           =   1710
   End
   Begin VB.Label lblFirmwarePath 
      AutoSize        =   -1  'True
      Caption         =   "可用的固件配置代码(*.hex):"
      Height          =   180
      Left            =   480
      TabIndex        =   2
      Top             =   1920
      Width           =   2340
   End
   Begin VB.Label lblDevices 
      AutoSize        =   -1  'True
      Caption         =   "* 可用的Ezusb设备:"
      Height          =   180
      Left            =   480
      TabIndex        =   0
      Top             =   960
      Width           =   1620
   End
End
Attribute VB_Name = "frmDeviceSetup"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False

Private Sub Form_Activate()
Dim retval As Long

' Start 8051 Chip
' Until Application Quit or Reopen another Device
If Trim(txtDatafilePath.Text) = "" Then
   MsgBox "请指定数据存储文件"
   Exit Sub
End If

With frmMain.ezlibObj
 ' If Some Device opened Now,close it
 'If .IsChipRunning = ChipIsRunning Then .StopChip
  If Len(Trim(.CurrentDeviceName)) <> 0 Then
    .CloseDevice ' it will StopChip and Close Device
    ' Clear the Device Descriptor
    Call procFillDeviceDescriptor(False)
    ' Clear the Configuration Descriptor
    Call procFillConfigurationDescriptor(False)
  End If
  
 ' 1,Open Device
  
  If .OpenDevice(combDevices.List(combDevices.ListIndex)) = 1 Then
  If .OpenDevice("Ezusb-0") = 1 Then
      MsgBox "打开设备 " + combDevices.List(combDevices.ListIndex) + " 失败"
      Exit Sub
  End If
  End If
  '2. Download Firmware code if it's specified and Start Chip
  '   Finally it will Fill Descriptor Feilds into FlexGrid Control Cells
  retval = procDownload(txtFirmwarePath.Text)
  Select Case retval
  Case 1:
         MsgBox "代码加载失败"
         .CloseDevice
         Exit Sub
  Case 2:
         MsgBox "启动固件代码配置设备失败"
         .CloseDevice
         Exit Sub
  End Select
  
  
End With


  ' 3. Store the Paths
frmMain.strDatafilePath = Trim(txtDatafilePath.Text)
frmMain.strFirmwarePath = Trim(txtFirmwarePath.Text)

frmDeviceSetup.Hide

' 4. Show next Step
'If chkNext.Value = 1 Then
  'g_blWorking = False
 ' Call procTransferSetup
'End If
End Sub

Private Sub Form_Load()
' Init Devices List
Call procFillDeviceList
' Fill Textboxes
txtFirmwarePath.Text = "F:\毕业设计代码\isostrm.hex"
txtDatafilePath.Text = "F:\毕业设计代码\savedata"


End Sub

Private Sub procFillDeviceList()
Dim strDeviceName As String
Dim ezlibTmp As New EZlib1
  frmMain.lblWorkName.Caption = "正在寻找可用的设备..."
  frmMain.prgsWork.Max = optLngDevTo - optLngDevFrom + 1
  frmMain.prgsWork.Min = 1
  
  combDevices.Clear
  
  For i = optLngDevFrom To optLngDevTo
     strDeviceName = "Ezusb-" + CStr(i)
     
     If ezlibTmp.OpenDevice(strDeviceName) = 0 Then
         combDevices.AddItem strDeviceName
     End If
     
     If Len(Trim(ezlibTmp.CurrentDeviceName)) <> 0 Then
         ezlibTmp.CloseDevice
     End If
     
     frmMain.prgsWork.Value = i + 1
     frmMain.lblPrecent.Caption = CStr(Int(i / frmMain.prgsWork.Max * 100)) + "%"
     
     DoEvents
  Next i
  
  frmMain.lblWorkName = ""
  frmMain.lblPrecent.Caption = ""
  frmMain.prgsWork.Value = 1
  
  
  
  ' Init Check box's value, the Check Box marks weather to Set Transfer Ctrl Next
  'If frmMain.blIsTransCtrlSet = True Then
   ' won't set TransferCtrl  in Next Step
    'chkNext.Value = 0
 ' Else
   ' Will Show frmTransferStep to set TransferCtrl in Next Step
   ' chkNext.Value = 1
 ' End If
  
End Sub


⌨️ 快捷键说明

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