Home > Software engineering >  Should help to see how to run, this paragraph with Dcollection and Levelsection always shows undefin
Should help to see how to run, this paragraph with Dcollection and Levelsection always shows undefin

Time:05-10

'class level net adjustment LevelNet
Option Explicit
Dim QSD As New DCollection 'count points list
Dim WZD As New DCollection 'unknown points list
Dim sections () As the measurement section New LevelSection '
Dim kNum known points As the Integer '
Dim sNum As Integer 'measurement section number
Dim msNum As Integer number 'necessary observation
Dim fDegree As Integer 'freedom
Dim uWeight As Double 'unit weight
Dim uWeight0 As Double 'prior unit weight
Dim tDistance As Double 'total number of distance
Dim tPoints As Integer 'total points
Dim PVV As Double 'used for precision evaluation of
Const eps As Double default accuracy
=0.00000001 'Private Function readQsd (dlist () As String) As DCollection calculate data points' read the
Dim bm As Benchmark, the ds () As String, d As the Variant, bs As New DCollection
For Each d In dlist
The Set bm=New Benchmark
Ds=Split (d,) ", "
Bm. Id=UCase (ds (0))
Bm. AppH=Val (ds) (1)
Bm. Known=True
If bs. ExistsKey (bm) id)=False Then
Bs. Add bm, bm id
End the If
Next
The Set readQsd=bs
End the Function
Private Function readObs (dlist () As String) As LevelSection calculate data points () 'read the
Dim ss () As the New LevelSection, ds () As String, I As an Integer, j As Integer
J=UBound (dlist)
ReDim ss (j) As the New LevelSection
For I=0 To j
Ds=Split (dlist (1), ", ")
Ss (I). FromID=UCase (ds (0))
Ss (I). ToID=UCase (ds (1))
Ss (I). Observe=Val (ds (2))
Ss (I). The short=Val (ds) (3)
Next I
End the Function
Private Function SplitLine (ByVal s As String) As String format () 'decomposition data
S=Replace (s, CRH (9), "")
S=Replace (s, ""," ")
S=Replace (s, CRH (13), "")
S=Replace (s, CRH (10), "")
SplitLine Split (Trim (s))
End the Function

Public Sub readData (ByVal obsText As String, qsdText As String, ByVal uw As String) 'read
Dim bs0 As DCollection 'count points list
Set bs0=readQsd (SplitLine (qsdText)) 'read up the points, you must first call
Sections=readObs (SplitLine (obsText) observation data read '
UWeight0=Val (uw)
Dim bm As Benchmark, s As the Variant
For Each sections In 's according to the level of the observation data to construct point collection
The Set bm=New Benchmark
Bm. Id=s. romID
If bs0. ExistsKey (bm) id) And QSD. ExistsKey (bm) id)=False Then
Bm, appH=bs0. Item (bm. Id). AppH
Bm. AdjH=bm. AppH
Bm. Known=True
QSD. Add bm, bm id
ElseIf bs0. ExistsKey (bm) id)=False And WZD. ExistsKey (bm) id)=False Then
Bm. AppH=- 99999
Bm. Known=False
WZD. Add bm, bm id
End the If
The Set bm=New Benchmark
Bm. Id=s.t olD
If bs0. ExistsKey (bm) id) And QSD. ExistsKey (bm) id)=False Then
Bm. AppH=bs0. Item (bm. Id). AppH
Bm. AdjH=bm. AppH
Bm. Known=True
QSD. Add bm, bm id
ElseIf bs0. ExistsKey (bm) id)=False And WZD. ExistsKey (bm) id)=False Then
Bm. AppH=- 99999
Bm. Known=False
WZD. Add bm, bm id
End the If
Next
SNum=UBound (sections) + 1 'measurement section number
MsNum=WZD. Count 'necessary observation number=total points - known points
TPoints=kNum + msNum
FDegree=sNum - msNum 'freedom=total number of measurement section - necessary observation number
End Sub
Public Property Get sectionNum ()
SectionNum=UBound (sections) + 1 'measurement section number
End Property
Public Property Get mustNum ()
MustNum=msNum 'necessary observation number
End Property
Public Property Get freeDegree ()
FreeDegree=fDegree 'freedom=total number of measurement section - necessary observation number
End Property
Public Property Get unitWeight ()
UnitWeight unit weight=uWeight '
End Property
Public Property Get totalDistance ()
TotalDistance total distance=tDistance '
End Property
Public Property Get totalPoints ()
TotalPoints unit weight=tPoints'
End Property
Public Function calcApproximateAltitude () As a Boolean 'calculating approximate height
Dim As Integer I
Dim bm1 As Benchmark, bm2 As Benchmark, s As the Variant
For I=0 To UBound (sections)
In sections For Each s
Then If QSD. ExistsKey (s. romID)
The Set bm1=QSD. Item (s. romID)
If WZD. ExistsKey (s.t oID) Then
The Set bm2=WZD. Item (s.t oID)
Bm2. AppH=bm1. AppH + s.O bserve
End the If
ElseIf QSD. ExistsKey (s.t oID) Then
The Set bm2=QSD. Item (s.t oID)
Then If WZD. ExistsKey (s. romID)
The Set bm1=WZD. Item (s. romID)
BML. AppH=bm2. AppH - s.O bserve
End the If
The Set bm1=WZD. Item (s. romID)
ElseIf WZD. ExistsKey (s. romID) And WZD. ExistsKey s.t (oID) Then
The Set bm1=WZD. Item (s. romID)
The Set bm2=WZD. Item (s) toID)
If (bm1. AppH + 9999) & gt; Eps And (bm2 appH + 9999) & lt; Eps Then
Bm2. AppH=bm1. AppH + s.O bserve
ElseIf (bm1 appH + 9999) & lt; Eps And (bm2 appH + 9999) & gt; Eps Then
BML. AppH=bm2. AppH - s.O bserve
End the If
End the If
Next
Next I detect whether there is a standard point cannot be calculated
In sections For Each s
Then If WZD. ExistsKey (s. romID)
nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  • Related