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

📄 水准网平差.frm

📁 采用vb程序语言编写
💻 FRM
📖 第 1 页 / 共 2 页
字号:
VERSION 5.00
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "comdlg32.ocx"
Begin VB.Form Form1 
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "Form1"
   ClientHeight    =   5400
   ClientLeft      =   150
   ClientTop       =   840
   ClientWidth     =   6615
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   5400
   ScaleWidth      =   6615
   ShowInTaskbar   =   0   'False
   StartUpPosition =   3  '窗口缺省
   Begin VB.TextBox Text5 
      Height          =   375
      Left            =   1320
      TabIndex        =   16
      Text            =   "Text4"
      Top             =   3120
      Width           =   1215
   End
   Begin VB.CommandButton Command3 
      Caption         =   "Command3"
      Height          =   375
      Left            =   3480
      TabIndex        =   13
      Top             =   3120
      Width           =   1335
   End
   Begin VB.TextBox Text4 
      Height          =   375
      Left            =   1320
      TabIndex        =   11
      Text            =   "Text4"
      Top             =   2400
      Width           =   1215
   End
   Begin VB.TextBox Text3 
      Height          =   375
      Left            =   1320
      TabIndex        =   10
      Text            =   "Text3"
      Top             =   1680
      Width           =   1215
   End
   Begin VB.TextBox Text2 
      Height          =   375
      Left            =   1320
      TabIndex        =   9
      Text            =   "Text2"
      Top             =   1080
      Width           =   1215
   End
   Begin VB.TextBox Text1 
      Height          =   375
      Left            =   1320
      TabIndex        =   8
      Text            =   "Text1"
      Top             =   480
      Width           =   1215
   End
   Begin MSComDlg.CommonDialog CommonDialog1 
      Left            =   5520
      Top             =   120
      _ExtentX        =   847
      _ExtentY        =   847
      _Version        =   393216
   End
   Begin VB.CommandButton Command2 
      Caption         =   "退出"
      Height          =   495
      Left            =   3960
      TabIndex        =   4
      Top             =   4200
      Width           =   1695
   End
   Begin VB.CommandButton Command1 
      Caption         =   "水准网平差计算"
      Height          =   495
      Left            =   1200
      TabIndex        =   3
      Top             =   4200
      Width           =   1695
   End
   Begin VB.Frame Frame1 
      Caption         =   "定权方式"
      Height          =   1335
      Left            =   4680
      TabIndex        =   0
      Top             =   720
      Width           =   1695
      Begin VB.OptionButton Option2 
         Caption         =   "水准距离定权"
         Height          =   300
         Left            =   120
         TabIndex        =   2
         Top             =   840
         Width           =   1455
      End
      Begin VB.OptionButton Option1 
         Caption         =   "测站数定权"
         Height          =   300
         Left            =   120
         TabIndex        =   1
         Top             =   360
         Width           =   1215
      End
   End
   Begin VB.Label Label6 
      Caption         =   "单位权观测数"
      Height          =   375
      Left            =   600
      TabIndex        =   15
      Top             =   3120
      Width           =   615
   End
   Begin VB.Label Label5 
      Caption         =   "Label5"
      Height          =   15
      Left            =   960
      TabIndex        =   14
      Top             =   2640
      Width           =   135
   End
   Begin VB.Label Label4 
      Caption         =   "测段数"
      Height          =   375
      Left            =   600
      TabIndex        =   12
      Top             =   2520
      Width           =   615
   End
   Begin VB.Label Label3 
      Caption         =   "待求高程点数"
      Height          =   375
      Left            =   600
      TabIndex        =   7
      Top             =   1680
      Width           =   615
   End
   Begin VB.Label Label2 
      Caption         =   "观测高差数"
      Height          =   375
      Left            =   600
      TabIndex        =   6
      Top             =   1080
      Width           =   615
   End
   Begin VB.Label Label1 
      Caption         =   "已知高程点数"
      Height          =   495
      Left            =   600
      TabIndex        =   5
      Top             =   480
      Width           =   615
   End
   Begin VB.Menu file 
      Caption         =   "文件"
      Index           =   1
      Begin VB.Menu OriginalFile 
         Caption         =   "数据输入"
      End
      Begin VB.Menu ResultFile 
         Caption         =   "结果保存"
      End
      Begin VB.Menu exit 
         Caption         =   "退出"
      End
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
'Option Base 1

Dim n1 As Integer, n2 As Integer 'N1为已知高程点数,N2为观测高差数
Dim N3 As Integer, N4 As Integer 'N3为所测水准路线数,N4为待求点高程数
Dim vMatrix() As Double, B() As Double, P() As Double 'p为权矩阵
Dim hMatrix() As Double, ceduanMatrix() As Double, gaochaMatrix() As Double
'Hmatrix()为存储已知高程点矩阵,ceduanMatrix()为存储测段数矩阵,gaochaMatrix()高差矩阵
Dim LL() As Double, XX() As Double 'LL()为存储观测量平差值的矩阵,XX()为存储所选参数平差值的矩阵
Dim daiqiuMatrix() As Double
Dim dqiuHv() As Double, gchv() As Double  'dqiuHv()所选参数改正,gchv()为观测高差改正
'Dim P1() As Double  '定义权阵
Dim S1() As Double  '定义接受水准距离的数组
Dim c   '接受单位权观测,其值的类型根据用户确定
Dim L0() As Double, X0() As Double 'L0()、X0()分别用来存储观测值和必要参数的初值

'*****************************************
'********************************************
Dim Matrixsum() As Double, MatrixMinus() As Double
'Matrixsum()为存储两个矩阵相加后的和矩阵,MatrixMinus()为存储两矩阵相减后的差矩阵
Dim MatrixMultiply() As Double, Matrixchange() As Double
'MatrixMultiply()为两矩阵相乘后的积矩阵,Matrixchange()为存储一矩阵转置后的矩阵
Dim MatrixMultiply1() As Double
Dim MatrixMultiply2() As Double, MatrixMultiply3() As Double, MatrixMultiply4() As Double

'MatrixMultiplyi()为存储两矩阵乘积的积矩阵
'*********************************************
'*********************************************
Private Type ShuizhunNode   '定义水准点的结构
 ID As String    '定义水准点号
 'a() As Integer   '定义与之相连的点数
' B() As String    '定义与之相连的点号
 'ceduanH() As ceduanH    '定义测段的高差
 IDH As Double '存储高程
End Type

Private Type ceduanH   '定义测段结构,存储大小和方向
 H As Double        '测段高差大小
 'Obool As Boolean  '用来表明测段高差方向性
 ID1 As ShuizhunNode 'ID1用来存储测段两边点号,高程大的为ID1
 ID2 As ShuizhunNode   'ID2用来存储测段两边点号,高程小的为ID1
End Type


'Dim xishuB() As Integer   '系数矩阵
Dim xishuB() As Double  '系数矩阵
'Dim L() As Integer   '常数矩阵 '注意所采用的数据类型
Dim L() As Double   '常数矩阵 '注意所采用的数据类型
Dim a1() As ceduanH, a2() As ShuizhunNode
Dim i1 As Integer 'i1为观测参数个数
Dim i2 As Integer 'i2为必要参数个数
Dim i3 As Integer 'i3为水准点总数
'**********************************
'**********************************

Public Sub xshuB()   '构造系数矩阵B以及L''''
  
  Dim i As Integer
  Dim k0 As Integer, k1 As Integer, k2 As Integer  'k0,k1,k2为for循环计数器
  'ReDim xishuB(1 To i1, 1 To i2)  'i2 为所选必要观测参数个数
  'ReDim L(1 To i1)
  
  For i = 1 To i1    '以观测值个数来组建系数阵B
  If Mid(a1(i).ID1.ID, 1, 4) = "Para" And Mid(a1(i).ID2.ID, 1, 4) = "Para" Then
  
    xishuB(i, Val(Right(a1(i).ID1.ID, 2))) = 1
    xishuB(i, Val(Right(a1(i).ID2.ID, 2))) = -1
    For k0 = 1 To i2
     If Val(Right(a1(i).ID1.ID, 2)) <> k0 And Val(Right(a1(i).ID2.ID, 2)) <> k0 Then
        xishuB(i, k0) = 0
      End If
        
    Next k0
    'L(i, 1) = (-1) * (a1(i).ID1.IDH - a1(i).ID2.IDH - a1(i).H) * 1000 '构建常量矩阵L
   L(i, 1) = (-1) * (a1(i).ID1.IDH - a1(i).ID2.IDH - a1(i).H)
 Else
  
 
  If Mid(a1(i).ID1.ID, 1, 4) = "Para" Then
    xishuB(i, Val(Right(a1(i).ID1.ID, 2))) = 1
    For k1 = 1 To i2
      If k1 <> Val(Right(a1(i).ID1.ID, 2)) Then
      xishuB(i, k1) = 0
     End If
    Next k1
   ' L(i, 1) = (-1) * (a1(i).ID1.IDH - a1(i).ID2.IDH - a1(i).H) * 1000 '构建常量矩阵L
    L(i, 1) = (-1) * (a1(i).ID1.IDH - a1(i).ID2.IDH - a1(i).H)
    End If
 
   
   If Mid(a1(i).ID2.ID, 1, 4) = "Para" Then
    xishuB(i, Val(Right(a1(i).ID2.ID, 2))) = -1
    For k2 = 1 To i2
      If k2 <> Val(Right(a1(i).ID2.ID, 2)) Then
      xishuB(i, k2) = 0
     End If
    Next k2
   ' L(i, 1) = (-1) * (a1(i).ID1.IDH - a1(i).ID2.IDH - a1(i).H) * 1000 '构建常量矩阵L
   L(i, 1) = (-1) * (a1(i).ID1.IDH - a1(i).ID2.IDH - a1(i).H)
   'End Select
   End If
 End If
   
    
   ' L(i) = (-1) * (a1(i).ID1.IDH - a1(i).ID2.IDH - a1(i).H) '构建常量矩阵L
    

⌨️ 快捷键说明

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