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

📄 frmgpstrack.frm

📁 用VB开发的巡检系统基于MAPINFo用VB开发的巡检系统基于MAPINFo很好的
💻 FRM
📖 第 1 页 / 共 2 页
字号:
VERSION 5.00
Object = "{648A5603-2C6E-101B-82B6-000000000014}#1.1#0"; "mscomm32.ocx"
Begin VB.Form frmGpsTrack 
   Caption         =   "GPS跟踪设置"
   ClientHeight    =   5835
   ClientLeft      =   60
   ClientTop       =   450
   ClientWidth     =   6690
   Icon            =   "frmGpsTrack.frx":0000
   LinkTopic       =   "Form1"
   LockControls    =   -1  'True
   MaxButton       =   0   'False
   ScaleHeight     =   5835
   ScaleWidth      =   6690
   Begin VB.CheckBox Check1 
      Caption         =   "生成GPS监测数据文件"
      Enabled         =   0   'False
      Height          =   315
      Left            =   4290
      TabIndex        =   29
      Top             =   60
      Value           =   1  'Checked
      Width           =   2295
   End
   Begin VB.ComboBox Combo3 
      Height          =   300
      Left            =   1050
      Style           =   2  'Dropdown List
      TabIndex        =   28
      Top             =   60
      Width           =   1575
   End
   Begin VB.CommandButton Command4 
      Caption         =   "清空内容"
      Height          =   375
      Left            =   3930
      TabIndex        =   26
      Top             =   5370
      Width           =   1215
   End
   Begin VB.Frame Frame2 
      Caption         =   "当前接收数据"
      Height          =   1065
      Left            =   30
      TabIndex        =   5
      Top             =   4230
      Width           =   6615
      Begin VB.TextBox Text3 
         Alignment       =   2  'Center
         BackColor       =   &H00C0FFC0&
         Height          =   315
         Index           =   3
         Left            =   3210
         Locked          =   -1  'True
         TabIndex        =   25
         Top             =   600
         Width           =   885
      End
      Begin VB.TextBox Text3 
         Alignment       =   2  'Center
         BackColor       =   &H00C0FFC0&
         Height          =   315
         Index           =   2
         Left            =   600
         Locked          =   -1  'True
         TabIndex        =   24
         Top             =   600
         Width           =   2025
      End
      Begin VB.TextBox Text3 
         Alignment       =   2  'Center
         BackColor       =   &H00C0FFC0&
         Height          =   315
         Index           =   1
         Left            =   3210
         Locked          =   -1  'True
         TabIndex        =   23
         Top             =   240
         Width           =   2025
      End
      Begin VB.TextBox Text3 
         Alignment       =   2  'Center
         BackColor       =   &H00C0FFC0&
         Height          =   315
         Index           =   0
         Left            =   600
         Locked          =   -1  'True
         TabIndex        =   22
         Top             =   240
         Width           =   2025
      End
      Begin VB.Label Label11 
         AutoSize        =   -1  'True
         Caption         =   "星数:"
         Height          =   180
         Left            =   2730
         TabIndex        =   21
         Top             =   660
         Width           =   450
      End
      Begin VB.Label Label10 
         AutoSize        =   -1  'True
         Caption         =   "时间:"
         Height          =   180
         Left            =   90
         TabIndex        =   20
         Top             =   660
         Width           =   450
      End
      Begin VB.Label Label9 
         AutoSize        =   -1  'True
         Caption         =   "纬度:"
         Height          =   180
         Left            =   2745
         TabIndex        =   19
         Top             =   300
         Width           =   450
      End
      Begin VB.Label Label8 
         AutoSize        =   -1  'True
         Caption         =   "经度:"
         Height          =   180
         Left            =   105
         TabIndex        =   18
         Top             =   300
         Width           =   450
      End
   End
   Begin VB.CommandButton Command3 
      Caption         =   "退出(&E)"
      Height          =   375
      Left            =   5160
      TabIndex        =   4
      Top             =   5370
      Width           =   1215
   End
   Begin VB.CommandButton Command2 
      Caption         =   "停止(&T)"
      Height          =   375
      Left            =   2700
      TabIndex        =   3
      Top             =   5370
      Width           =   1215
   End
   Begin VB.CommandButton Command1 
      Caption         =   "开始跟踪(&S)"
      Height          =   375
      Left            =   1470
      TabIndex        =   2
      Top             =   5370
      Width           =   1215
   End
   Begin VB.TextBox Text1 
      BackColor       =   &H00C0E0FF&
      Height          =   2865
      Left            =   30
      Locked          =   -1  'True
      MultiLine       =   -1  'True
      ScrollBars      =   3  'Both
      TabIndex        =   1
      Top             =   1320
      Width           =   6615
   End
   Begin VB.Frame Frame1 
      Height          =   945
      Left            =   30
      TabIndex        =   0
      Top             =   360
      Width           =   6615
      Begin MSCommLib.MSComm MSComm1 
         Left            =   5940
         Top             =   90
         _ExtentX        =   1005
         _ExtentY        =   1005
         _Version        =   393216
         DTREnable       =   -1  'True
      End
      Begin VB.TextBox Text2 
         Alignment       =   2  'Center
         BackColor       =   &H8000000F&
         Height          =   315
         Index           =   3
         Left            =   5280
         Locked          =   -1  'True
         TabIndex        =   17
         Text            =   "无"
         Top             =   540
         Width           =   825
      End
      Begin VB.TextBox Text2 
         Alignment       =   2  'Center
         BackColor       =   &H8000000F&
         Height          =   315
         Index           =   2
         Left            =   3000
         Locked          =   -1  'True
         TabIndex        =   16
         Text            =   "1"
         Top             =   540
         Width           =   915
      End
      Begin VB.TextBox Text2 
         Alignment       =   2  'Center
         BackColor       =   &H8000000F&
         Height          =   315
         Index           =   1
         Left            =   960
         Locked          =   -1  'True
         TabIndex        =   15
         Text            =   "无"
         Top             =   540
         Width           =   975
      End
      Begin VB.ComboBox Combo2 
         Height          =   300
         Left            =   3000
         Style           =   2  'Dropdown List
         TabIndex        =   14
         Top             =   150
         Width           =   1185
      End
      Begin VB.TextBox Text2 
         Alignment       =   2  'Center
         BackColor       =   &H8000000F&
         Height          =   315
         Index           =   0
         Left            =   5280
         Locked          =   -1  'True
         TabIndex        =   13
         Text            =   "8"
         Top             =   150
         Width           =   825
      End
      Begin VB.ComboBox Combo1 
         Height          =   300
         Left            =   960
         Style           =   2  'Dropdown List
         TabIndex        =   12
         Top             =   150
         Width           =   1005
      End
      Begin VB.Label Label6 
         AutoSize        =   -1  'True
         Caption         =   "数据流控制:"
         Height          =   180
         Left            =   4230
         TabIndex        =   11
         Top             =   600
         Width           =   990
      End
      Begin VB.Label Label5 
         Caption         =   "停止位:"
         Height          =   255
         Left            =   2340
         TabIndex        =   10
         Top             =   600
         Width           =   885
      End
      Begin VB.Label Label4 
         Caption         =   "奇偶校验:"
         Height          =   255
         Left            =   105
         TabIndex        =   9
         Top             =   600
         Width           =   885
      End
      Begin VB.Label Label3 
         Caption         =   "数据位:"
         Height          =   255
         Left            =   4605
         TabIndex        =   8
         Top             =   210
         Width           =   885
      End
      Begin VB.Label Label2 
         Caption         =   "每秒位数:"
         Height          =   255
         Left            =   2160
         TabIndex        =   7
         Top             =   210
         Width           =   885
      End
      Begin VB.Label Label1 
         Caption         =   "连接串口:"
         Height          =   255
         Left            =   120
         TabIndex        =   6
         Top             =   210
         Width           =   885
      End
   End
   Begin VB.Label Label7 
      AutoSize        =   -1  'True
      Caption         =   "GPS终端号:"
      Height          =   180
      Left            =   120
      TabIndex        =   27
      Top             =   120
      Width           =   900
   End
End
Attribute VB_Name = "frmGpsTrack"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim rs As New ADODB.Recordset
Dim sGpsID As String
Dim bCreateGpsDataFile As Boolean

Private Sub Command1_Click()
    '开始跟踪
    Dim lpDeviceID As String
    Dim lpComPort As Integer, lpBTS As Long, lpInputLen As Integer
    Dim sSetting As String
    
    On Error GoTo Err_NoPort
    lpDeviceID = Me.Combo3.Text
    
    lpComPort = Me.Combo1.Text
    lpBTS = Me.Combo2.Text
    If lpDeviceID = "" Then Exit Sub
    '//BBBB 为波特率,P 为奇偶校验,D 为数据位数,S 为停止位数。
    sSetting = lpBTS & ",N,8,1"
    lpInputLen = 1
    
    With Me
        If .MSComm1.PortOpen = True Then .MSComm1.PortOpen = False
        .MSComm1.CommPort = lpComPort
        .MSComm1.Settings = sSetting
        .MSComm1.Handshaking = comNone
        .MSComm1.PortOpen = True
    End With
    Me.Command1.Enabled = False
    Me.Command2.Enabled = True
    
    Set_ProfileStringINI "Gps", "Com", lpComPort, App.Path + "\ProCFG.Ini"
    Set_ProfileStringINI "Gps", "BTL", lpBTS, App.Path + "\ProCFG.Ini"
    
    '------------------------------------------------------------
    '打开临时图层进行轨迹回放操作
    '判断是否已经打开临时表
    Dim TablePath As String
    If Not IsOpenTable("tmpTrack.tab") Then
        TablePath = App.Path + "\tempmap\tmpTrack.tab"
        If Dir(TablePath, vbDirectory) = "" Then
            CreateTable_TempTrack '创建临时表
        End If
        OpenTable (TablePath)
    End If
    TableName = "tmpTrack"

⌨️ 快捷键说明

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