Measuments for middle square added to SW. Error when adding other measuremtns togheter
This commit is contained in:
parent
1b2384a636
commit
cdf56dbf19
|
|
@ -132,51 +132,26 @@
|
|||
numOfMiddleRectangles += 1
|
||||
|
||||
|
||||
|
||||
If sidePressed = 3 Then
|
||||
For j = 2 To Data.gratingPoints.Rows.Count - 1
|
||||
If Data.gratingPoints.Rows(j)("GUI Y") = Data.grossAreaPoints.Rows(2)("GUI Y") Then
|
||||
sidePoints.Add(j)
|
||||
End If
|
||||
Next
|
||||
Index = sidePoints(0)
|
||||
If sidePoints.Count > 2 Then
|
||||
For i = sidePoints.Count / 2 To 2 Step -1
|
||||
If Data.gratingPoints.Rows(sidePoints(i * 2 - 2))("GUI X") >
|
||||
Data.grossAreaPoints.Rows(2)("GUI X") - sideSquareValues(2) / Data.scaleDiff Then
|
||||
Index = sidePoints(i * 2 - 2)
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
|
||||
Else
|
||||
For j = 3 To Data.gratingPoints.Rows.Count - 1
|
||||
If Data.gratingPoints.Rows(j)("GUI X") = Data.grossAreaPoints.Rows(3)("GUI X") Then
|
||||
sidePoints.Add(j)
|
||||
Dim sidePoints3 As New List(Of Integer)
|
||||
For j = 2 To Data.gratingPoints.Rows.Count - 1
|
||||
If Data.gratingPoints.Rows(j)("GUI Y") = Data.grossAreaPoints.Rows(2)("GUI Y") Then
|
||||
sidePoints3.Add(j)
|
||||
End If
|
||||
Next
|
||||
sidePoints.Add(0)
|
||||
Index = sidePoints(0)
|
||||
If sidePoints.Count > 2 Then
|
||||
For i = sidePoints.Count / 2 To 2 Step -1
|
||||
If Data.gratingPoints.Rows(sidePoints(i * 2 - 2))("GUI Y") >
|
||||
Data.grossAreaPoints.Rows(3)("GUI Y") - sideSquareValues(2) / Data.scaleDiff Then
|
||||
Index = sidePoints(i * 2 - 2)
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
Dim sidePoints4 As New List(Of Integer)
|
||||
For j = 3 To Data.gratingPoints.Rows.Count - 1
|
||||
If Data.gratingPoints.Rows(j)("GUI X") = Data.grossAreaPoints.Rows(3)("GUI X") Then
|
||||
sidePoints4.Add(j)
|
||||
End If
|
||||
Next
|
||||
sidePoints4.Add(0)
|
||||
|
||||
' Add recess measuements (SW)
|
||||
Data.pointsMeasurements.Add("MS1_" & mesNum, {Data.grossAreaPoints.Rows(3), numOfMiddleRectangles * 4 - 1, 3})
|
||||
Data.pointsMeasurements.Add("MS1_" & mesNum + 1, {sidePoints(0) + 1, numOfMiddleRectangles * 4 - 1, 4})
|
||||
Data.pointsMeasurements.Add("MS_" & mesNum + 2, {numOfMiddleRectangles * 4 - 1, numOfMiddleRectangles * 4 - 2, 3})
|
||||
Data.pointsMeasurements.Add("MS_" & mesNum + 3, {numOfMiddleRectangles * 4 - 4, numOfMiddleRectangles * 4 - 1, 4})
|
||||
|
||||
Data.pointsMeasurements.Add("MS1_" & numOfMiddleRectangles & "_" & mesNum, {sidePoints4(0) + 1, numOfMiddleRectangles * 4, 3})
|
||||
Data.pointsMeasurements.Add("MS1_" & numOfMiddleRectangles & "_" & mesNum + 1, {sidePoints3(sidePoints3.Count - 1) + 1, numOfMiddleRectangles * 4, 4})
|
||||
Data.pointsMeasurements.Add("MS_" & numOfMiddleRectangles & "_" & mesNum + 2, {numOfMiddleRectangles * 4, numOfMiddleRectangles * 4 - 1, 3})
|
||||
Data.pointsMeasurements.Add("MS_" & numOfMiddleRectangles & "_" & mesNum + 3, {numOfMiddleRectangles * 4 - 3, numOfMiddleRectangles * 4, 4})
|
||||
|
||||
|
||||
'' Add support line data for sidesquare measurement
|
||||
|
|
|
|||
|
|
@ -229,7 +229,7 @@ Public Class Drawing
|
|||
For j = 0 To Data.pointsMeasurements.Count - 1
|
||||
Dim measureName As String = Data.pointsMeasurements.Keys(j)
|
||||
Dim measureDist As Double
|
||||
If mesName.Split("_")(0) = "MS" Then
|
||||
If measureName.Split("_")(0) = "MS" Then
|
||||
If Data.pointsMeasurements(measureName)(2) = 1 OrElse Data.pointsMeasurements(measureName)(2) = 3 Then
|
||||
Dim x1 As Double = Data.gratingMiddlePoints.Rows(Data.pointsMeasurements(measureName)(0) - 1)("X")
|
||||
Dim x2 As Double = Data.gratingMiddlePoints.Rows(Data.pointsMeasurements(measureName)(1) - 1)("X")
|
||||
|
|
@ -240,7 +240,7 @@ Public Class Drawing
|
|||
measureDist = Math.Abs(y1 - y2)
|
||||
End If
|
||||
|
||||
ElseIf mesName.Split("_")(0) = "MS1" Then
|
||||
ElseIf measureName.Split("_")(0) = "MS1" Then
|
||||
If Data.pointsMeasurements(measureName)(2) = 1 OrElse Data.pointsMeasurements(measureName)(2) = 3 Then
|
||||
Dim x1 As Double = Data.gratingPoints.Rows(Data.pointsMeasurements(measureName)(0) - 1)("X")
|
||||
Dim x2 As Double = Data.gratingMiddlePoints.Rows(Data.pointsMeasurements(measureName)(1) - 1)("X")
|
||||
|
|
@ -336,8 +336,18 @@ Public Class Drawing
|
|||
, OutLine() As Double, scaleDecimal As Double, X_Mid As Double, Y_Mid As Double, mesName As String)
|
||||
|
||||
Dim measurement As IDisplayDimension
|
||||
Dim point1NameSW As String = "Point" & points(0) & "@Sketch1@" & CompName & "@" & myView.GetName2
|
||||
Dim point2NameSW As String = "Point" & points(1) & "@Sketch1@" & CompName & "@" & myView.GetName2
|
||||
Dim point1NameSW, point2NameSW As String
|
||||
If mesName.Split("_")(0) = "MS" Then
|
||||
point1NameSW = "Point" & points(0) - (CInt(mesName.Split("_")(1)) - 1) * 4 & "@Sketch" & CInt(mesName.Split("_")(1)) + 1 & "@" & CompName & "@" & myView.GetName2
|
||||
point2NameSW = "Point" & points(1) - (CInt(mesName.Split("_")(1)) - 1) * 4 & "@Sketch" & CInt(mesName.Split("_")(1)) + 1 & "@" & CompName & "@" & myView.GetName2
|
||||
ElseIf mesName.Split("_")(0) = "MS1" Then
|
||||
point1NameSW = "Point" & points(0) & "@Sketch1@" & CompName & "@" & myView.GetName2
|
||||
point2NameSW = "Point" & points(1) - (CInt(mesName.Split("_")(1)) - 1) * 4 & "@Sketch" & CInt(mesName.Split("_")(1)) + 1 & "@" & CompName & "@" & myView.GetName2
|
||||
Else
|
||||
point1NameSW = "Point" & points(0) & "@Sketch1@" & CompName & "@" & myView.GetName2
|
||||
point2NameSW = "Point" & points(1) & "@Sketch1@" & CompName & "@" & myView.GetName2
|
||||
End If
|
||||
|
||||
|
||||
iDrawing.ClearSelection2(True)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue