Middle function fully implemented
This commit is contained in:
parent
36189ef58a
commit
93df8fc101
Binary file not shown.
Binary file not shown.
|
|
@ -241,6 +241,24 @@
|
|||
e.Graphics.DrawLine(pen, pTemp1(0), pTemp1(1), pTemp2(0), pTemp2(1))
|
||||
Next
|
||||
|
||||
For i = 0 To Data.gratingMiddlePoints.Rows.Count - 1
|
||||
Dim pTemp1(2) As Integer
|
||||
Dim pTemp2(2) As Integer
|
||||
|
||||
pTemp1(0) = Data.gratingMiddlePoints.Rows(i)("GUI X")
|
||||
pTemp1(1) = Data.gratingMiddlePoints.Rows(i)("GUI Y")
|
||||
|
||||
If (i + 1) Mod 4 = 0 Then
|
||||
pTemp2(0) = Data.gratingMiddlePoints.Rows(i - 3)("GUI X")
|
||||
pTemp2(1) = Data.gratingMiddlePoints.Rows(i - 3)("GUI Y")
|
||||
Else
|
||||
pTemp2(0) = Data.gratingMiddlePoints.Rows(i + 1)("GUI X")
|
||||
pTemp2(1) = Data.gratingMiddlePoints.Rows(i + 1)("GUI Y")
|
||||
End If
|
||||
|
||||
e.Graphics.DrawLine(pen, pTemp1(0), pTemp1(1), pTemp2(0), pTemp2(1))
|
||||
Next
|
||||
|
||||
|
||||
' Draw grating grid for fill area
|
||||
If AppForm.fillMode Then
|
||||
|
|
|
|||
|
|
@ -231,7 +231,7 @@ Public Class Individual
|
|||
|
||||
' --- When middle square button is pressed ---
|
||||
Private Sub Button_Square_Middle_Click(sender As Object, e As EventArgs) Handles Button_Square_Middle.Click
|
||||
|
||||
Middle_Rectangle.SquareMiddleButtton(sender, e)
|
||||
End Sub
|
||||
|
||||
' ---------------------------------- Calculate ----------------------------------
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
Public Class Data
|
||||
Public Shared grossAreaPoints As New DataTable
|
||||
Public Shared gratingPoints As New DataTable
|
||||
Public Shared gratingMiddlePoints As New DataTable
|
||||
Public Shared angleRecessPoints As New DataTable
|
||||
|
||||
Public Shared guiPanelMidX, guiPanelMidY As Integer
|
||||
|
|
@ -36,6 +37,13 @@
|
|||
gratingPoints.Columns.Add("GUI Y", GetType(Integer))
|
||||
gratingPoints.Columns.Add("RECESS OK", GetType(Boolean))
|
||||
|
||||
' Grating Middle points
|
||||
gratingMiddlePoints.Columns.Add("NAME", GetType(String))
|
||||
gratingMiddlePoints.Columns.Add("X", GetType(Decimal))
|
||||
gratingMiddlePoints.Columns.Add("Y", GetType(Decimal))
|
||||
gratingMiddlePoints.Columns.Add("GUI X", GetType(Integer))
|
||||
gratingMiddlePoints.Columns.Add("GUI Y", GetType(Integer))
|
||||
|
||||
' Angle recess points
|
||||
angleRecessPoints.Columns.Add("NAME", GetType(String))
|
||||
angleRecessPoints.Columns.Add("QUADRANT", GetType(String))
|
||||
|
|
@ -52,6 +60,8 @@
|
|||
recessData.Columns.Add("WIDTH", GetType(Integer))
|
||||
recessData.Columns.Add("LENGTH", GetType(Integer))
|
||||
recessData.Columns.Add("OFFSET", GetType(Integer))
|
||||
recessData.Columns.Add("OFFSET X", GetType(Integer))
|
||||
recessData.Columns.Add("OFFSET Y", GetType(Integer))
|
||||
recessData.Columns.Add("GRATINGS", GetType(List(Of Integer)))
|
||||
End Sub
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,204 @@
|
|||
Public Class Middle_Rectangle
|
||||
Private Shared middleSquareValues(3) As Integer
|
||||
Private Shared numOfMiddleRectangles As Integer = 0
|
||||
|
||||
' --- Create textboxes when user clicks the rectangle side recess button ---
|
||||
Public Shared Sub SquareMiddleButtton(sender As Object, e As EventArgs)
|
||||
Individual.Panel_Recesses.Controls("Button_Angle_Corner").Enabled = False
|
||||
Individual.Panel_Recesses.Controls("Button_Angle_Side").Enabled = False
|
||||
Individual.Panel_Recesses.Controls("Button_Square_Corner").Enabled = False
|
||||
Individual.Panel_Recesses.Controls("Button_Square_Side").Enabled = False
|
||||
Individual.Panel_Recesses.Controls("Button_Square_Middle").Enabled = False
|
||||
|
||||
Dim buttonX As Integer = Individual.Panel_Recesses.Controls("Button_Square_Middle").Location.X + Individual.Panel_Recesses.Controls("Button_Square_Middle").Width
|
||||
Dim buttonY As Integer = Individual.Panel_Recesses.Controls("Button_Square_Middle").Location.Y
|
||||
|
||||
Individual.Create_TextBox_Recesses("Y_TextBox", "", buttonX + 60, buttonY - 7, 60)
|
||||
AddHandler Individual.Panel_Recesses.Controls("Y_TextBox").TextChanged, AddressOf FunctionTextMiddle_Changed
|
||||
AddHandler Individual.Panel_Recesses.Controls("Y_TextBox").KeyPress, AddressOf FunctionText_KeyPress
|
||||
Individual.Create_Label_Recesses("Y_Label", "Width", buttonX + 18, buttonY - 4)
|
||||
|
||||
Individual.Create_TextBox_Recesses("X_TextBox", "", buttonX + 60, buttonY + 23, 60)
|
||||
AddHandler Individual.Panel_Recesses.Controls("X_TextBox").TextChanged, AddressOf FunctionTextMiddle_Changed
|
||||
AddHandler Individual.Panel_Recesses.Controls("X_TextBox").KeyPress, AddressOf FunctionText_KeyPress
|
||||
Individual.Create_Label_Recesses("X_Label", "Length", buttonX + 10, buttonY + 26)
|
||||
|
||||
Individual.Create_TextBox_Recesses("OffX_TextBox", "", buttonX + 60, buttonY + 53, 60)
|
||||
AddHandler Individual.Panel_Recesses.Controls("OffX_TextBox").TextChanged, AddressOf FunctionTextMiddle_Changed
|
||||
AddHandler Individual.Panel_Recesses.Controls("OffX_TextBox").KeyPress, AddressOf FunctionText_KeyPress
|
||||
Individual.Create_Label_Recesses("OffX_Label", "Offset X", buttonX + 16, buttonY + 56)
|
||||
|
||||
Individual.Create_TextBox_Recesses("OffY_TextBox", "", buttonX + 60, buttonY + 83, 60)
|
||||
AddHandler Individual.Panel_Recesses.Controls("OffY_TextBox").TextChanged, AddressOf FunctionTextMiddle_Changed
|
||||
AddHandler Individual.Panel_Recesses.Controls("OffY_TextBox").KeyPress, AddressOf FunctionText_KeyPress
|
||||
Individual.Create_Label_Recesses("OffY_Label", "Offset Y", buttonX + 16, buttonY + 86)
|
||||
|
||||
Individual.Button_Square_Middle.FlatStyle = FlatStyle.Flat
|
||||
Individual.Button_Square_Middle.FlatAppearance.BorderColor = Color.Red
|
||||
End Sub
|
||||
|
||||
' --- Check the key pressed by the user ---
|
||||
Private Shared Sub FunctionText_KeyPress(sender As Object, e As KeyPressEventArgs)
|
||||
User_Input.Check_IfNumber(e)
|
||||
End Sub
|
||||
|
||||
' --- Adds clickable buttons for all sides if conditions are met ---
|
||||
Private Shared Sub FunctionTextMiddle_Changed(sender As TextBox, e As EventArgs)
|
||||
Try
|
||||
middleSquareValues(0) = CInt(Individual.Panel_Recesses.Controls("X_TextBox").Text)
|
||||
middleSquareValues(1) = CInt(Individual.Panel_Recesses.Controls("Y_TextBox").Text)
|
||||
middleSquareValues(2) = CInt(Individual.Panel_Recesses.Controls("OffX_TextBox").Text)
|
||||
middleSquareValues(3) = CInt(Individual.Panel_Recesses.Controls("OffY_TextBox").Text)
|
||||
Catch ex As Exception
|
||||
middleSquareValues(0) = 0
|
||||
middleSquareValues(1) = 0
|
||||
middleSquareValues(2) = 0
|
||||
middleSquareValues(3) = 0
|
||||
End Try
|
||||
|
||||
If middleSquareValues(0) > 0 AndAlso middleSquareValues(1) > 0 AndAlso middleSquareValues(2) > 0 AndAlso middleSquareValues(3) > 0 Then
|
||||
If Individual.Panel_Grating.Controls.Count = 2 Then
|
||||
Dim middleButton As New Button With {
|
||||
.Width = middleSquareValues(0) / Data.scaleDiff,
|
||||
.Height = middleSquareValues(1) / Data.scaleDiff,
|
||||
.Left = Data.grossAreaPoints.Rows(3)("GUI X") + middleSquareValues(2) / Data.scaleDiff,
|
||||
.Top = Data.grossAreaPoints.Rows(3)("GUI Y") - (middleSquareValues(3) + middleSquareValues(1)) / Data.scaleDiff,
|
||||
.Name = "Button_Middle",
|
||||
.Text = ""
|
||||
}
|
||||
|
||||
middleButton.BackColor = Color.FromArgb(50, Color.Red)
|
||||
middleButton.FlatStyle = FlatStyle.Flat
|
||||
middleButton.FlatAppearance.BorderSize = 0
|
||||
middleButton.FlatAppearance.MouseOverBackColor = Color.Red
|
||||
middleButton.FlatAppearance.MouseDownBackColor = Color.DarkRed
|
||||
|
||||
Individual.Panel_Grating.Controls.Add(middleButton)
|
||||
|
||||
AddHandler middleButton.Click, AddressOf MiddleButton_Click
|
||||
Else
|
||||
' Update button size and position
|
||||
Individual.Panel_Grating.Controls("Button_Middle").Width = middleSquareValues(0) / Data.scaleDiff
|
||||
Individual.Panel_Grating.Controls("Button_Middle").Height = middleSquareValues(1) / Data.scaleDiff
|
||||
Individual.Panel_Grating.Controls("Button_Middle").Left = Data.grossAreaPoints.Rows(3)("GUI X") + middleSquareValues(2) / Data.scaleDiff
|
||||
Individual.Panel_Grating.Controls("Button_Middle").Top = Data.grossAreaPoints.Rows(3)("GUI Y") - (middleSquareValues(3) + middleSquareValues(1)) / Data.scaleDiff
|
||||
End If
|
||||
|
||||
ElseIf Individual.Panel_Grating.Controls.Count > 2 Then
|
||||
RemoveHandler Individual.Panel_Grating.Controls("Button_Middle").Click, AddressOf MiddleButton_Click
|
||||
Individual.Panel_Grating.Controls.RemoveByKey("Button_Middle")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
' --- When a side function button is pressed ---
|
||||
Private Shared Sub MiddleButton_Click(sender As Button, e As EventArgs)
|
||||
' Remove point buttons
|
||||
RemoveHandler Individual.Panel_Grating.Controls("Button_Middle").Click, AddressOf MiddleButton_Click
|
||||
Individual.Panel_Grating.Controls.RemoveByKey("Button_Middle")
|
||||
|
||||
Dim mesNum As Integer = Data.pointsMeasurements.Count - 1
|
||||
|
||||
Data.recessData.Rows.Add()
|
||||
|
||||
Dim pointRow1 As DataRow = Data.gratingMiddlePoints.NewRow
|
||||
Dim pointRow2 As DataRow = Data.gratingMiddlePoints.NewRow
|
||||
Dim pointRow3 As DataRow = Data.gratingMiddlePoints.NewRow
|
||||
Dim pointRow4 As DataRow = Data.gratingMiddlePoints.NewRow
|
||||
|
||||
pointRow1("NAME") = "MS" & numOfMiddleRectangles & "_" & 1
|
||||
pointRow1("X") = Data.grossAreaPoints.Rows(3)("X") + middleSquareValues(2) / 1000
|
||||
pointRow1("Y") = Data.grossAreaPoints.Rows(3)("Y") + (middleSquareValues(3) + middleSquareValues(1)) / 1000
|
||||
pointRow1("GUI X") = Data.grossAreaPoints.Rows(3)("GUI X") + middleSquareValues(2) / Data.scaleDiff
|
||||
pointRow1("GUI Y") = Data.grossAreaPoints.Rows(3)("GUI Y") - (middleSquareValues(3) + middleSquareValues(1)) / Data.scaleDiff
|
||||
|
||||
pointRow2("NAME") = "MS" & numOfMiddleRectangles & "_" & 2
|
||||
pointRow2("X") = Data.grossAreaPoints.Rows(3)("X") + (middleSquareValues(2) + middleSquareValues(0)) / 1000
|
||||
pointRow2("Y") = Data.grossAreaPoints.Rows(3)("Y") + (middleSquareValues(3) + middleSquareValues(1)) / 1000
|
||||
pointRow2("GUI X") = Data.grossAreaPoints.Rows(3)("GUI X") + (middleSquareValues(2) + middleSquareValues(0)) / Data.scaleDiff
|
||||
pointRow2("GUI Y") = Data.grossAreaPoints.Rows(3)("GUI Y") - (middleSquareValues(3) + middleSquareValues(1)) / Data.scaleDiff
|
||||
|
||||
pointRow3("NAME") = "MS" & numOfMiddleRectangles & "_" & 3
|
||||
pointRow3("X") = Data.grossAreaPoints.Rows(3)("X") + (middleSquareValues(2) + middleSquareValues(0)) / 1000
|
||||
pointRow3("Y") = Data.grossAreaPoints.Rows(3)("Y") + middleSquareValues(3) / 1000
|
||||
pointRow3("GUI X") = Data.grossAreaPoints.Rows(3)("GUI X") + (middleSquareValues(2) + middleSquareValues(0)) / Data.scaleDiff
|
||||
pointRow3("GUI Y") = Data.grossAreaPoints.Rows(3)("GUI Y") - middleSquareValues(3) / Data.scaleDiff
|
||||
|
||||
pointRow4("NAME") = "MS" & numOfMiddleRectangles & "_" & 4
|
||||
pointRow4("X") = Data.grossAreaPoints.Rows(3)("X") + middleSquareValues(2) / 1000
|
||||
pointRow4("Y") = Data.grossAreaPoints.Rows(3)("Y") + middleSquareValues(3) / 1000
|
||||
pointRow4("GUI X") = Data.grossAreaPoints.Rows(3)("GUI X") + middleSquareValues(2) / Data.scaleDiff
|
||||
pointRow4("GUI Y") = Data.grossAreaPoints.Rows(3)("GUI Y") - middleSquareValues(3) / Data.scaleDiff
|
||||
|
||||
|
||||
'' Add recess measuements (SW)
|
||||
'Data.pointsMeasurements.Add("SS1_" & mesNum, {sidePoints(0) + 1, index + 2, 1})
|
||||
'Data.pointsMeasurements.Add("SS_" & mesNum + 1, {Index + 2, Index + 5, 1})
|
||||
'Data.pointsMeasurements.Add("SS_" & mesNum + 2, {index + 2, index + 3, 4})
|
||||
|
||||
'' Add support line data for sidesquare measurement
|
||||
'Draw_Grating.sideSquareMesLine.Add("SS1_" & mesNum, {Data.gratingPoints.Rows(Index)("GUI X"),
|
||||
' Data.grossAreaPoints.Rows(0)("GUI Y") - 15,
|
||||
' Data.grossAreaPoints.Rows(0)("GUI X") + middleSquareValues(2) / Data.scaleDiff,
|
||||
' Data.grossAreaPoints.Rows(0)("GUI Y") - 15})
|
||||
|
||||
'' Add recess measurments (GUI)
|
||||
'Draw_Grating.measureLabels.Add("SS1_" & mesNum, {CInt(Individual.Panel_Recesses.Controls("Off_TextBox").Text) - (Data.gratingPoints.Rows(Index)("X") * 1000 + Data.gratingL / 2),
|
||||
' (Data.gratingPoints.Rows(Index)("GUI X") + Data.grossAreaPoints.Rows(0)("GUI X") + middleSquareValues(2) / Data.scaleDiff) / 2 - 8,
|
||||
' Data.grossAreaPoints.Rows(0)("GUI Y") - 15 - 12 - 3,
|
||||
' 1}) '15 är linjen, 12 är textens höjd, 3 är lite extra
|
||||
'Draw_Grating.measureLabels.Add("SS_" & mesNum + 1, {CInt(Individual.Panel_Recesses.Controls("X_TextBox").Text),
|
||||
' Data.grossAreaPoints.Rows(0)("GUI X") + middleSquareValues(2) / (Data.scaleDiff) + CInt(Individual.Panel_Recesses.Controls("X_TextBox").Text) / (2 * Data.scaleDiff) - 8,
|
||||
' Data.grossAreaPoints.Rows(0)("GUI Y") + middleSquareValues(1) / (Data.scaleDiff) + 3,
|
||||
' 1})
|
||||
'Draw_Grating.measureLabels.Add("SS_" & mesNum + 2, {CInt(Individual.Panel_Recesses.Controls("Y_TextBox").Text),
|
||||
' Data.grossAreaPoints.Rows(0)("GUI X") + middleSquareValues(2) / Data.scaleDiff - 18 - 3,
|
||||
' Data.grossAreaPoints.Rows(0)("GUI Y") + CInt(Individual.Panel_Recesses.Controls("Y_TextBox").Text) / (2 * Data.scaleDiff) - 4,
|
||||
' 1})
|
||||
|
||||
' Recess Data
|
||||
Data.recessData.Rows(Data.recessData.Rows.Count - 1)("RECESS TYPE") = "MIDDLE SQUARE"
|
||||
Data.recessData.Rows(Data.recessData.Rows.Count - 1)("WIDTH") = CInt(Individual.Panel_Recesses.Controls("Y_TextBox").Text)
|
||||
Data.recessData.Rows(Data.recessData.Rows.Count - 1)("LENGTH") = CInt(Individual.Panel_Recesses.Controls("X_TextBox").Text)
|
||||
Data.recessData.Rows(Data.recessData.Rows.Count - 1)("OFFSET X") = CInt(Individual.Panel_Recesses.Controls("OffX_TextBox").Text)
|
||||
Data.recessData.Rows(Data.recessData.Rows.Count - 1)("OFFSET Y") = CInt(Individual.Panel_Recesses.Controls("OffY_TextBox").Text)
|
||||
|
||||
numOfMiddleRectangles += 1
|
||||
|
||||
Data.gratingMiddlePoints.Rows.InsertAt(pointRow1, numOfMiddleRectangles * 4 - 4)
|
||||
Data.gratingMiddlePoints.Rows.InsertAt(pointRow2, numOfMiddleRectangles * 4 - 3)
|
||||
Data.gratingMiddlePoints.Rows.InsertAt(pointRow3, numOfMiddleRectangles * 4 - 2)
|
||||
Data.gratingMiddlePoints.Rows.InsertAt(pointRow4, numOfMiddleRectangles * 4 - 1)
|
||||
|
||||
'Redraw grating
|
||||
Individual.Panel_Grating.Refresh()
|
||||
|
||||
RemoveHandler Individual.Panel_Recesses.Controls("X_TextBox").TextChanged, AddressOf FunctionTextMiddle_Changed
|
||||
RemoveHandler Individual.Panel_Recesses.Controls("X_TextBox").KeyPress, AddressOf FunctionText_KeyPress
|
||||
Individual.Panel_Recesses.Controls.RemoveByKey("X_TextBox")
|
||||
|
||||
RemoveHandler Individual.Panel_Recesses.Controls("Y_TextBox").TextChanged, AddressOf FunctionTextMiddle_Changed
|
||||
RemoveHandler Individual.Panel_Recesses.Controls("Y_TextBox").KeyPress, AddressOf FunctionText_KeyPress
|
||||
Individual.Panel_Recesses.Controls.RemoveByKey("Y_TextBox")
|
||||
|
||||
RemoveHandler Individual.Panel_Recesses.Controls("OffX_TextBox").TextChanged, AddressOf FunctionTextMiddle_Changed
|
||||
RemoveHandler Individual.Panel_Recesses.Controls("OffX_TextBox").KeyPress, AddressOf FunctionText_KeyPress
|
||||
Individual.Panel_Recesses.Controls.RemoveByKey("OffX_TextBox")
|
||||
|
||||
RemoveHandler Individual.Panel_Recesses.Controls("OffY_TextBox").TextChanged, AddressOf FunctionTextMiddle_Changed
|
||||
RemoveHandler Individual.Panel_Recesses.Controls("OffY_TextBox").KeyPress, AddressOf FunctionText_KeyPress
|
||||
Individual.Panel_Recesses.Controls.RemoveByKey("OffY_TextBox")
|
||||
|
||||
Individual.Panel_Recesses.Controls.RemoveByKey("X_Label")
|
||||
Individual.Panel_Recesses.Controls.RemoveByKey("Y_Label")
|
||||
Individual.Panel_Recesses.Controls.RemoveByKey("OffX_Label")
|
||||
Individual.Panel_Recesses.Controls.RemoveByKey("OffY_Label")
|
||||
|
||||
Individual.Panel_Recesses.Controls("Button_Angle_Corner").Enabled = True
|
||||
Individual.Panel_Recesses.Controls("Button_Angle_Side").Enabled = True
|
||||
Individual.Panel_Recesses.Controls("Button_Square_Corner").Enabled = True
|
||||
Individual.Panel_Recesses.Controls("Button_Square_Side").Enabled = True
|
||||
Individual.Panel_Recesses.Controls("Button_Square_Middle").Enabled = True
|
||||
|
||||
Individual.Button_Square_Middle.FlatAppearance.BorderColor = Color.Black
|
||||
End Sub
|
||||
End Class
|
||||
|
|
@ -165,6 +165,16 @@ Public Class Model_3D
|
|||
ExternalClass.modify_parameter_value("DP_ROTATION", inst_, 0)
|
||||
|
||||
End If
|
||||
|
||||
ElseIf recessDR("RECESS TYPE") = "MIDDLE SQUARE" Then
|
||||
inst_ = ExternalClass.instantiate_parts(parentID, "recess_middle_square", "")
|
||||
|
||||
ExternalClass.modify_parameter_value("DP_LENGTH", inst_, recessDR("LENGTH"))
|
||||
ExternalClass.modify_parameter_value("DP_WIDTH", inst_, recessDR("WIDTH"))
|
||||
ExternalClass.modify_parameter_value("DP_EDGEBAR_HEIGHT", inst_, gratingParameters("LOADBAR_HEIGHT"))
|
||||
ExternalClass.modify_parameter_value("DP_EDGEBAR_THICKNESS", inst_, gratingParameters("LOADBAR_THICKNESS"))
|
||||
ExternalClass.modify_parameter_value("DP_OFFSET_W", inst_, recessDR("OFFSET Y"))
|
||||
ExternalClass.modify_parameter_value("DP_OFFSET_L", inst_, recessDR("OFFSET X"))
|
||||
End If
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -184,6 +184,16 @@ Public Class Model_3D_Fill
|
|||
ExternalClass.modify_parameter_value("DP_ROTATION", inst_, 0)
|
||||
|
||||
End If
|
||||
|
||||
ElseIf recessDR("RECESS TYPE") = "MIDDLE SQUARE" Then
|
||||
inst_ = ExternalClass.instantiate_parts(parentID, "recess_middle_square", "")
|
||||
|
||||
ExternalClass.modify_parameter_value("DP_LENGTH", inst_, recessDR("LENGTH"))
|
||||
ExternalClass.modify_parameter_value("DP_WIDTH", inst_, recessDR("WIDTH"))
|
||||
ExternalClass.modify_parameter_value("DP_EDGEBAR_HEIGHT", inst_, gratingParameters("LOADBAR_HEIGHT"))
|
||||
ExternalClass.modify_parameter_value("DP_EDGEBAR_THICKNESS", inst_, gratingParameters("LOADBAR_THICKNESS"))
|
||||
ExternalClass.modify_parameter_value("DP_OFFSET_W", inst_, recessDR("OFFSET Y"))
|
||||
ExternalClass.modify_parameter_value("DP_OFFSET_L", inst_, recessDR("OFFSET X"))
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
|
@ -439,6 +449,7 @@ Public Class Model_3D_Fill
|
|||
Dim cornerAngleCounter As Integer = 1
|
||||
Dim cornerRectangleCounter As Integer = 1
|
||||
Dim numOfSideRectangles As Integer = 0
|
||||
Dim numOfMiddleRectangles As Integer = 1
|
||||
For j = 0 To Data.recessData.Rows.Count - 1
|
||||
If Data.recessData.Rows(j)("RECESS TYPE") = "ANGLE" Then
|
||||
Dim RP As New List(Of Integer())
|
||||
|
|
@ -492,7 +503,8 @@ Public Class Model_3D_Fill
|
|||
|
||||
cornerAngleCounter += 1
|
||||
|
||||
ElseIf Data.recessData.Rows(j)("RECESS TYPE") = "SQUARE" OrElse Data.recessData.Rows(j)("RECESS TYPE") = "SIDE SQUARE" Then
|
||||
ElseIf Data.recessData.Rows(j)("RECESS TYPE") = "SQUARE" OrElse Data.recessData.Rows(j)("RECESS TYPE") = "SIDE SQUARE" _
|
||||
OrElse Data.recessData.Rows(j)("RECESS TYPE") = "MIDDLE SQUARE" Then
|
||||
Dim RP As New List(Of Integer())
|
||||
Dim rec1(1), rec2(1), rec3(1), rec4(1) As Integer
|
||||
|
||||
|
|
@ -504,30 +516,53 @@ Public Class Model_3D_Fill
|
|||
End If
|
||||
Next
|
||||
cornerRectangleCounter += 1
|
||||
Else
|
||||
ElseIf Data.recessData.Rows(j)("RECESS TYPE") = "SIDE SQUARE" Then
|
||||
For k = 0 To Data.gratingPoints.Rows.Count - 1
|
||||
If Data.gratingPoints.Rows(k)("NAME") = "CS" & numOfSideRectangles & "_" & 1 Then
|
||||
rowIndex = k
|
||||
End If
|
||||
Next
|
||||
numOfSideRectangles += 1
|
||||
ElseIf Data.recessData.Rows(j)("RECESS TYPE") = "MIDDLE SQUARE" Then
|
||||
For k = 0 To Data.gratingMiddlePoints.Rows.Count - 1
|
||||
If Data.gratingMiddlePoints.Rows(k)("NAME") = "MS" & numOfMiddleRectangles & "_" & 1 Then
|
||||
rowIndex = k
|
||||
End If
|
||||
Next
|
||||
numOfMiddleRectangles += 1
|
||||
End If
|
||||
|
||||
rec1(0) = Data.gratingPoints.Rows(rowIndex)("X") * 1000
|
||||
rec1(1) = Data.gratingPoints.Rows(rowIndex)("Y") * 1000
|
||||
If Data.recessData.Rows(j)("RECESS TYPE") = "SQUARE" OrElse Data.recessData.Rows(j)("RECESS TYPE") = "SIDE SQUARE" Then
|
||||
rec1(0) = Data.gratingPoints.Rows(rowIndex)("X") * 1000
|
||||
rec1(1) = Data.gratingPoints.Rows(rowIndex)("Y") * 1000
|
||||
|
||||
rec2(0) = Data.gratingPoints.Rows(rowIndex + 1)("X") * 1000
|
||||
rec2(1) = Data.gratingPoints.Rows(rowIndex + 1)("Y") * 1000
|
||||
rec2(0) = Data.gratingPoints.Rows(rowIndex + 1)("X") * 1000
|
||||
rec2(1) = Data.gratingPoints.Rows(rowIndex + 1)("Y") * 1000
|
||||
|
||||
rec3(0) = Data.gratingPoints.Rows(rowIndex + 2)("X") * 1000
|
||||
rec3(1) = Data.gratingPoints.Rows(rowIndex + 2)("Y") * 1000
|
||||
rec3(0) = Data.gratingPoints.Rows(rowIndex + 2)("X") * 1000
|
||||
rec3(1) = Data.gratingPoints.Rows(rowIndex + 2)("Y") * 1000
|
||||
|
||||
If Data.recessData.Rows(j)("RECESS TYPE") = "SQUARE" Then
|
||||
rec4(0) = Data.grossAreaPoints.Rows(Data.recessData.Rows(j)("CORNER") - 1)("X") * 1000
|
||||
rec4(1) = Data.grossAreaPoints.Rows(Data.recessData.Rows(j)("CORNER") - 1)("Y") * 1000
|
||||
Else
|
||||
rec4(0) = Data.gratingPoints.Rows(rowIndex + 3)("X") * 1000
|
||||
rec4(1) = Data.gratingPoints.Rows(rowIndex + 3)("Y") * 1000
|
||||
If Data.recessData.Rows(j)("RECESS TYPE") = "SQUARE" Then
|
||||
rec4(0) = Data.grossAreaPoints.Rows(Data.recessData.Rows(j)("CORNER") - 1)("X") * 1000
|
||||
rec4(1) = Data.grossAreaPoints.Rows(Data.recessData.Rows(j)("CORNER") - 1)("Y") * 1000
|
||||
ElseIf Data.recessData.Rows(j)("RECESS TYPE") = "SIDE SQUARE" Then
|
||||
rec4(0) = Data.gratingPoints.Rows(rowIndex + 3)("X") * 1000
|
||||
rec4(1) = Data.gratingPoints.Rows(rowIndex + 3)("Y") * 1000
|
||||
|
||||
End If
|
||||
|
||||
ElseIf Data.recessData.Rows(j)("RECESS TYPE") = "MIDDLE SQUARE" Then
|
||||
rec1(0) = Data.gratingMiddlePoints.Rows(rowIndex)("X") * 1000
|
||||
rec1(1) = Data.gratingMiddlePoints.Rows(rowIndex)("Y") * 1000
|
||||
|
||||
rec2(0) = Data.gratingMiddlePoints.Rows(rowIndex + 1)("X") * 1000
|
||||
rec2(1) = Data.gratingMiddlePoints.Rows(rowIndex + 1)("Y") * 1000
|
||||
|
||||
rec3(0) = Data.gratingMiddlePoints.Rows(rowIndex + 2)("X") * 1000
|
||||
rec3(1) = Data.gratingMiddlePoints.Rows(rowIndex + 2)("Y") * 1000
|
||||
|
||||
rec4(0) = Data.gratingMiddlePoints.Rows(rowIndex + 3)("X") * 1000
|
||||
rec4(1) = Data.gratingMiddlePoints.Rows(rowIndex + 3)("Y") * 1000
|
||||
End If
|
||||
|
||||
RP.Add(rec1)
|
||||
|
|
|
|||
|
|
@ -116,6 +116,7 @@
|
|||
</Compile>
|
||||
<Compile Include="Recess Functions\Corner_Angle.vb" />
|
||||
<Compile Include="Recess Functions\Corner_Rectangle.vb" />
|
||||
<Compile Include="Recess Functions\Middle_Rectangle.vb" />
|
||||
<Compile Include="Recess Functions\Side_Rectangle.vb" />
|
||||
<Compile Include="SolidWorks\Drawing.vb" />
|
||||
<Compile Include="SolidWorks\Model_3D.vb" />
|
||||
|
|
|
|||
Loading…
Reference in New Issue