Friend Sub ComputeAndDrawAdvancedParamTable()
If pDrawAdvancedParamTableFlag = True Then
Try
Dim alEntity As IAeccAlignmentEntity
Dim aTangent As IAeccAlignmentTangent, aSpiral As IAeccAlignmentSpiral, aArc As IAeccAlignmentArc
Dim aSCSGroup As IAeccAlignmentSCSGroup, aEntities As IAeccAlignmentEntities, spiralIn As IAeccAlignmentSpiral, spiralOut As IAeccAlignmentSpiral
Dim spiralInLength As Double, spiralInDelta As Double, spiralOutLength As Double, spiralOutDelta As Double
Dim allTangentsLength As Double, allSCSGroupLength As Double, allOfDownradius1SCSGroupLength As Double
Dim allOfradius2SCSGroupLength As Double, allSCSGroupAngle As Double, summOfHeightForward As Double, summOfHeightReverse As Double, allOfgradientLength As Double
Dim index As Int32
index = 0 : allTangentsLength = 0 : allSCSGroupLength = 0 : allOfDownradius1SCSGroupLength = 0 : allOfradius2SCSGroupLength = 0 : allSCSGroupAngle = 0 : allOfgradientLength = 0
aEntities = curAlignment.Entities
dlgMain.pb1.Value = 0 : dlgMain.pb1.Refresh()
For index = 0 To aEntities.Count - 1
alEntity = aEntities.Item(index)
Select Case alEntity.Type
Case AeccAlignmentEntityType.aeccArc
aArc = alEntity
allSCSGroupLength = allSCSGroupLength + aArc.Length
If aEntities.EntityAtId(alEntity.EntityBefore).Type = AeccAlignmentEntityType.aeccSpiral Then
spiralIn = aEntities.EntityAtId(alEntity.EntityBefore)
spiralInLength = spiralIn.Length
spiralInDelta = spiralIn.Delta
Else
spiralInLength = 0
spiralInDelta = 0
End If
If aEntities.EntityAtId(alEntity.EntityAfter).Type = AeccAlignmentEntityType.aeccSpiral Then
spiralOut = aEntities.EntityAtId(alEntity.EntityAfter)
spiralOutLength = spiralOut.Length
spiralOutDelta = spiralOut.Delta
Else
spiralOutLength = 0
spiralOutDelta = 0
End If
If aArc.Radius < pRadius1 Then
allOfDownradius1SCSGroupLength = allOfDownradius1SCSGroupLength + spiralInLength + aArc.Length + spiralOutLength
End If
If Abs(aArc.Radius - pRadius2) < (1 / (10 ^ pPrecisionAdvancedParamTable)) Then
allOfradius2SCSGroupLength = allOfradius2SCSGroupLength + spiralInLength + aArc.Length + spiralOutLength
End If
allSCSGroupAngle = allSCSGroupAngle + spiralInDelta + aArc.Delta + spiralOutDelta
Case AeccAlignmentEntityType.aeccSpiral
aSpiral = alEntity
allSCSGroupLength = allSCSGroupLength + aSpiral.Length
Case AeccAlignmentEntityType.aeccTangent
aTangent = alEntity
allTangentsLength = allTangentsLength + aTangent.Length
Case AeccAlignmentEntityType.aeccSpiralCurveSpiralGroup
aSCSGroup = alEntity
allSCSGroupLength = allSCSGroupLength + aSCSGroup.Length
If aSCSGroup.Arc.Radius < pRadius1 Then
allOfDownradius1SCSGroupLength = allOfDownradius1SCSGroupLength + aSCSGroup.Length
End If
If Abs(aSCSGroup.Arc.Radius - pRadius2) < (1 / (10 ^ pPrecisionAdvancedParamTable)) Then
allOfradius2SCSGroupLength = allOfradius2SCSGroupLength + aSCSGroup.Length
End If
allSCSGroupAngle = allSCSGroupAngle + aSCSGroup.Arc.Delta + aSCSGroup.SpiralIn.Delta + aSCSGroup.SpiralOut.Delta
Case Else
End Select
dlgMain.pb1.Value = CInt(((index + 1) / (aEntities.Count)) * 100) : dlgMain.pb1.Refresh()
Next index
index = 0 : summOfHeightForward = 0
dlgMain.pb1.Value = 0 : dlgMain.pb1.Refresh()
For index = 0 To curFGProfile.PVIs.Count - 1
If index + 2 <= curFGProfile.PVIs.Count Then
If curFGProfile.PVIs.Item(index).Elevation < curFGProfile.PVIs.Item(index + 1).Elevation Then
summOfHeightForward = summOfHeightForward + (curFGProfile.PVIs.Item(index + 1).Elevation - curFGProfile.PVIs.Item(index).Elevation)
End If
If Abs(curFGProfile.PVIs.Item(index).Elevation - curFGProfile.PVIs.Item(index + 1).Elevation) / (curFGProfile.PVIs.Item(index + 1).Station - curFGProfile.PVIs.Item(index).Station) > pGradient Then
allOfgradientLength = allOfgradientLength + (curFGProfile.PVIs.Item(index + 1).Station - curFGProfile.PVIs.Item(index).Station)
End If
End If
dlgMain.pb1.Value = CInt(((index + 1) / (curFGProfile.PVIs.Count)) * 100) : dlgMain.pb1.Refresh()
Next index
index = 0 : summOfHeightReverse = 0
dlgMain.pb1.Value = 0 : dlgMain.pb1.Refresh()
For index = curFGProfile.PVIs.Count - 1 To 0 Step -1
If index - 1 >= 0 Then
If curFGProfile.PVIs.Item(index).Elevation < curFGProfile.PVIs.Item(index - 1).Elevation Then
summOfHeightReverse = summOfHeightReverse + (curFGProfile.PVIs.Item(index - 1).Elevation - curFGProfile.PVIs.Item(index).Elevation)
End If
End If
dlgMain.pb1.Value = CInt(((index + 1) / (curFGProfile.PVIs.Count)) * 100) : dlgMain.pb1.Refresh()
Next index
insertionPointAdvancedParamTable(0) = minCurProfileViewExtPoint(0)
insertionPointAdvancedParamTable(1) = minCurProfileViewExtPoint(1) - 5900 + pDeltaAdvancedParamTableY
Dim aTable As AcadTable
aTable = ThisDrawing.ModelSpace.AddTable(insertionPointAdvancedParamTable, 8, 2, textHeightWorkingValue * 3.2, textHeightWorkingValue * 50)
aTable.RegenerateTableSuppressed = True
With aTable
.Layer = pLayerAdvancedParamTableName
.HeaderSuppressed = True
.TitleSuppressed = True
.SetColumnWidth(1, textHeightWorkingValue * 10)
.SetTextHeight(0, textHeightWorkingValue)
.SetTextHeight(1, textHeightWorkingValue)
'.SetAlignment 0, acMiddleCenter
.SetAlignment(1, AcCellAlignment.acMiddleCenter)
'.StyleName = ThisDrawing.TextStyles.item(styleWorkingValueNameIndex).Name
.SetTextStyle(0, ThisDrawing.TextStyles.Item(styleWorkingValueNameIndex).Name)
.SetTextStyle(1, ThisDrawing.TextStyles.Item(styleWorkingValueNameIndex).Name)
.SetText(0, 0, ResourceManagerMainShadow.GetString("Parameters:", curUICulture)) '"Показатели:"
.SetText(1, 0, ResourceManagerMainShadow.GetString("Tangents length, m", curUICulture)) : .SetText(1, 1, CStr(FormatNumber(allTangentsLength, pPrecisionAdvancedParamTable, vbTrue, vbFalse, vbFalse))) '"Длина прямых, м"
.SetText(2, 0, ResourceManagerMainShadow.GetString("Curves length, m", curUICulture)) : .SetText(2, 1, CStr(FormatNumber(allSCSGroupLength, pPrecisionAdvancedParamTable, vbTrue, vbFalse, vbFalse))) '"Длина кривых, м"
.SetText(3, 0, ResourceManagerMainShadow.GetString("Including at radius less than", curUICulture) & " " & pRadius1 & " " & ResourceManagerMainShadow.GetString("m, m", curUICulture)) : .SetText(3, 1, CStr(FormatNumber(allOfDownradius1SCSGroupLength, pPrecisionAdvancedParamTable, vbTrue, vbFalse, vbFalse))) '"В том числе при радиусе менее" '"м, м"
.SetText(4, 0, ResourceManagerMainShadow.GetString("Including at radius", curUICulture) & " " & pRadius2 & " " & ResourceManagerMainShadow.GetString("m, m", curUICulture)) : .SetText(4, 1, CStr(FormatNumber(allOfradius2SCSGroupLength, pPrecisionAdvancedParamTable, vbTrue, vbFalse, vbFalse))) '"В том числе при радиусе" '"м, м"
angleDegree = allSCSGroupAngle * (180 / 3.1415926535897931)
angleMinute = (angleDegree - Int(angleDegree)) * 60
.SetText(5, 0, ResourceManagerMainShadow.GetString("The sum of the PI angles, degree", curUICulture)) : .SetText(5, 1, CStr(Int(angleDegree)) & ChrW(176) & CStr(-Int(-angleMinute)) & "'") '"Сумма углов поворота, град"
.SetText(6, 0, ResourceManagerMainShadow.GetString("The sum of the heights be overcome - one way / return, m", curUICulture)) : .SetText(6, 1, CStr(FormatNumber(summOfHeightForward, pPrecisionAdvancedParamTable, vbTrue, vbFalse, vbFalse)) & "/" & CStr(FormatNumber(summOfHeightReverse, pPrecisionAdvancedParamTable, vbTrue, vbFalse, vbFalse))) '"Сумма преодолеваемых высот - туда/обратно, м"
.SetText(7, 0, ResourceManagerMainShadow.GetString("The sum of the area lengths with gradient more than", curUICulture) & " " & pGradient & ResourceManagerMainShadow.GetString(", m", curUICulture)) : .SetText(7, 1, CStr(FormatNumber(allOfgradientLength, pPrecisionAdvancedParamTable, vbTrue, vbFalse, vbFalse))) '"Сумма длин участков с уклоном более" '", м"
.RegenerateTableSuppressed = False
.RecomputeTableBlock(True)
End With
Catch ex As System.Exception
BuildErrorMessage(ex, False)
End Try
End If
End Sub