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

📄 filterset.frm

📁 gps全球卫星定位VB源码(部分)请自行准备设备接口
💻 FRM
字号:
VERSION 5.00
Begin VB.Form frmFilterSet 
   Caption         =   "车辆显示调整"
   ClientHeight    =   3375
   ClientLeft      =   60
   ClientTop       =   330
   ClientWidth     =   5505
   ControlBox      =   0   'False
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   3375
   ScaleWidth      =   5505
   StartUpPosition =   3  'Windows Default
   Begin VB.ComboBox cmbRoadLayer 
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   420
      ItemData        =   "FilterSet.frx":0000
      Left            =   2640
      List            =   "FilterSet.frx":0002
      TabIndex        =   18
      Top             =   1080
      Width           =   2175
   End
   Begin VB.TextBox txtMinStepDistance 
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   360
      Left            =   4200
      TabIndex        =   16
      Text            =   "0"
      Top             =   120
      Width           =   495
   End
   Begin VB.TextBox txtUry 
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   360
      Left            =   3960
      TabIndex        =   11
      Text            =   "0"
      Top             =   2400
      Width           =   1095
   End
   Begin VB.TextBox txtUrx 
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   360
      Left            =   2760
      TabIndex        =   10
      Text            =   "0"
      Top             =   2400
      Width           =   1095
   End
   Begin VB.TextBox txtLly 
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   360
      Left            =   1560
      TabIndex        =   9
      Text            =   "0"
      Top             =   2400
      Width           =   1095
   End
   Begin VB.TextBox txtLlx 
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   360
      Left            =   240
      TabIndex        =   8
      Text            =   "0"
      Top             =   2400
      Width           =   1095
   End
   Begin VB.CheckBox chk4 
      Caption         =   "过滤掉超界的数据"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   240
      TabIndex        =   7
      Top             =   1560
      Width           =   2295
   End
   Begin VB.CheckBox chk3 
      Caption         =   "锁定到路网"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   240
      TabIndex        =   5
      Top             =   1080
      Width           =   2295
   End
   Begin VB.CheckBox chk2 
      Caption         =   "自动辨别方向"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   240
      TabIndex        =   4
      Top             =   600
      Width           =   2295
   End
   Begin VB.TextBox txtMaxStepDistance 
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   360
      Left            =   2520
      TabIndex        =   3
      Text            =   "1000"
      Top             =   120
      Width           =   735
   End
   Begin VB.CheckBox chk1 
      Caption         =   "滤掉两次距离>="
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   240
      TabIndex        =   2
      Top             =   120
      Width           =   2175
   End
   Begin VB.CommandButton cmdCancel 
      Cancel          =   -1  'True
      Caption         =   "放弃"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   435
      Left            =   3000
      TabIndex        =   1
      Top             =   2880
      Width           =   945
   End
   Begin VB.CommandButton cmdOk 
      Caption         =   "确定"
      Default         =   -1  'True
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   435
      Left            =   1320
      TabIndex        =   0
      Top             =   2880
      Width           =   945
   End
   Begin VB.Label lbl2 
      Caption         =   "米的"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   4680
      TabIndex        =   17
      Top             =   120
      Width           =   495
   End
   Begin VB.Label lblBorderury 
      Caption         =   "右上纬度"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   3960
      TabIndex        =   15
      Top             =   2040
      Width           =   1095
   End
   Begin VB.Label lblBorderurx 
      Caption         =   "右上经度"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   2760
      TabIndex        =   14
      Top             =   2040
      Width           =   1095
   End
   Begin VB.Label lblBorderlly 
      Caption         =   "左下纬度"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   1560
      TabIndex        =   13
      Top             =   2040
      Width           =   1095
   End
   Begin VB.Label lblBorderllx 
      Caption         =   "左下经度"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   240
      TabIndex        =   12
      Top             =   2040
      Width           =   1095
   End
   Begin VB.Label lbl1 
      Caption         =   "米或<="
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   3240
      TabIndex        =   6
      Top             =   120
      Width           =   855
   End
End
Attribute VB_Name = "frmFilterSet"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Private Sub chk4_Click()
    If chk4.Value = vbChecked Then
        txtLlx = MonitorForm.oCompoundMap.mapRange.left
        txtLly = MonitorForm.oCompoundMap.mapRange.bottom
        txtUrx = MonitorForm.oCompoundMap.mapRange.right
        txtUry = MonitorForm.oCompoundMap.mapRange.top
    End If
End Sub

Private Sub cmdCancel_Click()
    Unload Me
End Sub

Private Sub cmdOk_Click()
    Dim nFilterMode As Integer
    nFilterMode = GetMode
    Dim oTarget As New CTarget
    Dim i As Long
    For i = 1 To MDIMainForm.oTargetManager.GetCount
        Set oTarget = MDIMainForm.oTargetManager.GetTargetByIndex(i)
        oTarget.SetFilterMode nFilterMode
        oTarget.SetMaxStepDistance Val(txtMaxStepDistance)
        oTarget.SetMinStepDistance Val(txtMinStepDistance)
        oTarget.SetLlx (txtLlx)
        oTarget.SetLly (txtLly)
        oTarget.SetUrx (txtUrx)
        oTarget.SetUry (txtUry)
        oTarget.SetRoadLayer (cmbRoadLayer)
    Next
    Unload Me
End Sub

Private Sub Form_Load()
    Dim nFilterMode As Integer
    Dim oTarget As New CTarget
    Dim i As Long
    Dim oMapLayer As MapLayer
    For i = 0 To MDIMainForm.oSpaDB.MapLayers.Count - 1
        Set oMapLayer = MDIMainForm.oSpaDB.MapLayers(i)
        If oMapLayer.IsValid Then
            If (oMapLayer.spaType = meShapeLine Or oMapLayer.spaType = meShapePoly) And Not oMapLayer.IsAnnoMap Then
                cmbRoadLayer.AddItem oMapLayer.Name
            End If
        End If
    Next
    
    For i = 1 To MDIMainForm.oTargetManager.GetCount
        Set oTarget = MDIMainForm.oTargetManager.GetTargetByIndex(i)
        nFilterMode = oTarget.GetFilterMode
        SetMode nFilterMode
        txtMaxStepDistance = oTarget.GetMaxStepDistance
        txtMinStepDistance = oTarget.GetMinStepDistance
        txtLlx = oTarget.GetLlx
        txtLly = oTarget.GetLly
        txtUrx = oTarget.GetUrx
        txtUry = oTarget.GetUry
        cmbRoadLayer = oTarget.GetRoadLayer
        Exit For
    Next
End Sub

Private Function GetMode() As Integer
    Dim nMode As Integer
    nMode = 0
    If chk1.Value = 1 Then
        nMode = nMode + 1
    End If
    If chk2.Value = 1 Then
        nMode = nMode + 2
    End If
    If chk3.Value = 1 Then
        nMode = nMode + 4
    End If
    If chk4.Value = 1 Then
        nMode = nMode + 8
    End If
    GetMode = nMode
End Function
Private Sub SetMode(ByVal nMode As Integer)
    If nMode Mod 2 = 1 Then
        chk1.Value = 1
    Else
        chk1.Value = 0
    End If
    If nMode Mod 4 >= 2 Then
        chk2.Value = 1
    Else
        chk2.Value = 0
    End If
    If nMode Mod 8 >= 4 Then
        chk3.Value = 1
    Else
        chk3.Value = 0
    End If
    If nMode Mod 16 >= 8 Then
        chk4.Value = 1
    Else
        chk4.Value = 0
    End If
End Sub

⌨️ 快捷键说明

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