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

📄 frmmath.frm

📁 超图网络分析扩展的VB开发程序的应用,对地理信息系统开发有益
💻 FRM
字号:
VERSION 5.00
Begin VB.Form frmMath 
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "栅格代数运算(加减乘除)"
   ClientHeight    =   4320
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   5370
   ControlBox      =   0   'False
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   4320
   ScaleWidth      =   5370
   ShowInTaskbar   =   0   'False
   StartUpPosition =   1  'CenterOwner
   Begin VB.CommandButton cmdCancel 
      Caption         =   "取消"
      Height          =   435
      Left            =   4380
      TabIndex        =   16
      Top             =   3705
      Width           =   945
   End
   Begin VB.CommandButton cmdOk 
      Caption         =   "确定"
      Height          =   435
      Left            =   3270
      TabIndex        =   15
      Top             =   3705
      Width           =   945
   End
   Begin VB.Frame Frame2 
      Caption         =   "参加运算的数据"
      Height          =   1125
      Left            =   1965
      TabIndex        =   10
      Top             =   1125
      Width           =   3390
      Begin VB.ComboBox cmbDsList2 
         Height          =   315
         Left            =   1095
         Style           =   2  'Dropdown List
         TabIndex        =   12
         Top             =   255
         Width           =   2100
      End
      Begin VB.ComboBox cmbDtList2 
         Height          =   315
         Left            =   1095
         Style           =   2  'Dropdown List
         TabIndex        =   11
         Top             =   645
         Width           =   2100
      End
      Begin VB.Label Label1 
         AutoSize        =   -1  'True
         Caption         =   "数据源:"
         Height          =   195
         Index           =   3
         Left            =   340
         TabIndex        =   14
         Top             =   330
         Width           =   720
      End
      Begin VB.Label Label1 
         AutoSize        =   -1  'True
         Caption         =   "数据集:"
         Height          =   195
         Index           =   2
         Left            =   340
         TabIndex        =   13
         Top             =   690
         Width           =   720
      End
   End
   Begin VB.Frame Frame4 
      Caption         =   "结果数据集保存"
      Height          =   1140
      Left            =   1965
      TabIndex        =   5
      Top             =   2280
      Width           =   3390
      Begin VB.TextBox txtDataset 
         Height          =   315
         Left            =   1095
         TabIndex        =   7
         Text            =   "Raster"
         Top             =   660
         Width           =   2070
      End
      Begin VB.ComboBox cmbDsListResult 
         Height          =   315
         Left            =   1095
         Style           =   2  'Dropdown List
         TabIndex        =   6
         Top             =   285
         Width           =   2070
      End
      Begin VB.Label Label1 
         AutoSize        =   -1  'True
         Caption         =   "数据集:"
         Height          =   195
         Index           =   7
         Left            =   340
         TabIndex        =   9
         Top             =   705
         Width           =   720
      End
      Begin VB.Label Label1 
         AutoSize        =   -1  'True
         Caption         =   "数据源:"
         Height          =   195
         Index           =   6
         Left            =   340
         TabIndex        =   8
         Top             =   330
         Width           =   720
      End
   End
   Begin VB.Frame Frame1 
      Caption         =   "参加分析的数据"
      Height          =   1065
      Left            =   1965
      TabIndex        =   0
      Top             =   30
      Width           =   3390
      Begin VB.ComboBox cmbDtList1 
         Height          =   315
         Left            =   1095
         Style           =   2  'Dropdown List
         TabIndex        =   2
         Top             =   645
         Width           =   2100
      End
      Begin VB.ComboBox cmbDsList1 
         Height          =   315
         Left            =   1095
         Style           =   2  'Dropdown List
         TabIndex        =   1
         Top             =   255
         Width           =   2100
      End
      Begin VB.Label Label1 
         AutoSize        =   -1  'True
         Caption         =   "数据集:"
         Height          =   195
         Index           =   1
         Left            =   345
         TabIndex        =   4
         Top             =   645
         Width           =   720
      End
      Begin VB.Label Label1 
         AutoSize        =   -1  'True
         Caption         =   "数据源:"
         Height          =   195
         Index           =   0
         Left            =   340
         TabIndex        =   3
         Top             =   330
         Width           =   720
      End
   End
   Begin VB.Image Image1 
      BorderStyle     =   1  'Fixed Single
      Height          =   4275
      Left            =   75
      Picture         =   "frmMath.frx":0000
      Stretch         =   -1  'True
      Top             =   0
      Width           =   1830
   End
End
Attribute VB_Name = "frmMath"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Public iMathMod As Integer

Private Sub cmbDsList1_Click()
    If cmbDsList1.Text = "" Then Exit Sub
    If frmMain.bActiveFrm Then
        ChangeDs cmbDsList1.Text, cmbDtList1
    End If
End Sub

Private Sub cmbDsList2_Click()
    If cmbDsList2.Text = "" Then Exit Sub
    If frmMain.bActiveFrm Then
        ChangeDs cmbDsList2.Text, cmbDtList2
    End If
End Sub

Private Sub cmdCancel_Click()
    Unload Me
End Sub

Private Sub cmdOk_Click()
    Dim objDs As soDataSource
    Dim objDtRst As soDatasetRaster
    Dim objDtLocal As soDatasetRaster
    Dim objGridAnalystEx As soGridAnalystEx
    Dim objMathOperator As soMathOperator
    Dim strTmp As String
    
    Set objDs = frmMain.SuperWorkspace.Datasources(cmbDsList1.Text)
    Set objDtRst = objDs.Datasets(cmbDtList1.Text)
    Set objDs = frmMain.SuperWorkspace.Datasources(cmbDsList2.Text)
    Set objDtLocal = objDs.Datasets(cmbDtList2.Text)
    Set objDs = frmMain.SuperWorkspace.Datasources(cmbDsListResult.Text)
    strTmp = DataSetName(objDs, txtDataset.Text)
    If strTmp <> "" Then
        Set objGridAnalystEx = frmMain.SuperAnalyst.GridAnalyst
        Set objMathOperator = objGridAnalystEx.Math
        Select Case iMathMod
            Case 1 '加运算
                Set objDtRst = objMathOperator.Plus(objDtRst, objDtLocal, objDs, strTmp)
                strTmp = "加运算"
            Case 2 '减运算
                Set objDtRst = objMathOperator.Minus(objDtRst, objDtLocal, objDs, strTmp)
                strTmp = "减运算"
            Case 3 '乘运算
                Set objDtRst = objMathOperator.Times(objDtRst, objDtLocal, objDs, strTmp)
                strTmp = "乘运算"
            Case 4 '除运算
                Set objDtRst = objMathOperator.Divide(objDtRst, objDtLocal, objDs, strTmp)
                strTmp = "除运算"
        End Select
        If Not objDtRst Is Nothing Then
            frmMain.SuperWkspManager.Refresh
        Else
            
            MsgBox "数学(" & strTmp & ")分析失败", vbInformation, "信息提示"
        End If
        Set objDtLocal = Nothing
        Set objDtRst = Nothing
        Set objDs = Nothing
        Set objGridAnalystEx = Nothing
        Set objMathOperator = Nothing
        Unload Me
    Else
        txtDataset.Text = ""
        txtDataset.SetFocus
    End If
    
    Set objDtLocal = Nothing
    Set objDtRst = Nothing
    Set objDs = Nothing
    Set objGridAnalystEx = Nothing
    Set objMathOperator = Nothing
End Sub

Private Sub Form_Activate()
    frmMain.bActiveFrm = True
    cmbDsList1_Click
    cmbDsList2_Click
End Sub

⌨️ 快捷键说明

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