📄 frmgrid2fltint.frm
字号:
VERSION 5.00
Begin VB.Form frmGrid2FltInt
BorderStyle = 3 'Fixed Dialog
Caption = "栅格->浮点(整数)"
ClientHeight = 3045
ClientLeft = 45
ClientTop = 330
ClientWidth = 4905
ControlBox = 0 'False
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 3045
ScaleWidth = 4905
ShowInTaskbar = 0 'False
StartUpPosition = 1 'CenterOwner
Begin VB.CommandButton cmdCancel
Caption = "取消"
Height = 435
Left = 3735
TabIndex = 11
Top = 2460
Width = 945
End
Begin VB.CommandButton cmdOk
Caption = "确定"
Height = 435
Left = 2625
TabIndex = 10
Top = 2460
Width = 945
End
Begin VB.Frame Frame1
Caption = "参加分析的数据"
Height = 1065
Left = 1515
TabIndex = 5
Top = -15
Width = 3390
Begin VB.ComboBox cmbDsList
Height = 315
Left = 1095
Style = 2 'Dropdown List
TabIndex = 7
Top = 255
Width = 2100
End
Begin VB.ComboBox cmbDtList
Height = 315
Left = 1095
Style = 2 'Dropdown List
TabIndex = 6
Top = 645
Width = 2100
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "数据源:"
Height = 195
Index = 0
Left = 340
TabIndex = 9
Top = 330
Width = 720
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "数据集:"
Height = 195
Index = 1
Left = 345
TabIndex = 8
Top = 645
Width = 720
End
End
Begin VB.Frame Frame4
Caption = "结果数据集保存"
Height = 1140
Left = 1515
TabIndex = 0
Top = 1065
Width = 3390
Begin VB.ComboBox cmbDsListResult
Height = 315
Left = 1095
Style = 2 'Dropdown List
TabIndex = 2
Top = 285
Width = 2070
End
Begin VB.TextBox txtDataset
Height = 315
Left = 1095
TabIndex = 1
Text = "Raster"
Top = 660
Width = 2070
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "数据源:"
Height = 195
Index = 6
Left = 340
TabIndex = 4
Top = 330
Width = 720
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "数据集:"
Height = 195
Index = 7
Left = 340
TabIndex = 3
Top = 705
Width = 720
End
End
Begin VB.Image Image1
Appearance = 0 'Flat
BorderStyle = 1 'Fixed Single
Height = 3030
Left = 30
Picture = "frmGrid2FltInt.frx":0000
Stretch = -1 'True
Top = 0
Width = 1425
End
End
Attribute VB_Name = "frmGrid2FltInt"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Public iChangeType As Integer
Private Sub cmbDsList_Click()
If cmbDsList.Text = "" Then Exit Sub
If frmMain.bActiveFrm Then
ChangeDs cmbDsList.Text, cmbDtList
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 objGridAnalystEx As soGridAnalystEx
Dim objMathOperator As soMathOperator
Dim strTmp As String
Set objDs = frmMain.SuperWorkspace.Datasources(cmbDsList.Text)
Set objDtRst = objDs.Datasets(cmbDtList.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 iChangeType
Case 1 '转换为整型
Set objDtRst = objMathOperator.Int(objDtRst, objDs, strTmp)
strTmp = "转换为整型"
Case 2 '转换为浮点
Set objDtRst = objMathOperator.Float(objDtRst, objDs, strTmp)
strTmp = "转换为浮点"
End Select
If Not objDtRst Is Nothing Then
frmMain.SuperWkspManager.Refresh
Else
MsgBox "数学分析(" & strTmp & ")失败", vbInformation, "信息提示"
End If
Set objDtRst = Nothing
Set objDs = Nothing
Set objGridAnalystEx = Nothing
Set objMathOperator = Nothing
Unload Me
Else
txtDataset.Text = ""
txtDataset.SetFocus
End If
Set objDtRst = Nothing
Set objDs = Nothing
Set objGridAnalystEx = Nothing
Set objMathOperator = Nothing
End Sub
Private Sub Form_Activate()
frmMain.bActiveFrm = True
cmbDsList_Click
If iChangeType = 1 Then
Me.Caption = "栅格->整数"
Else
Me.Caption = "栅格->浮点"
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -