All recesses instatniated in Fill grid SW
This commit is contained in:
parent
5feacbdc42
commit
d81383eb25
|
|
@ -1,8 +1,7 @@
|
||||||
|
|
||||||
Public Class Individual
|
Public Class Individual
|
||||||
|
Public Shared filepath As String = "C:\Users\Anton\Documents\Exjobb"
|
||||||
'Public Shared filepath As String = "C:\Users\Anton\Documents\Exjobb"
|
'Public Shared filepath As String = "C:\Users\xperd\Documents"
|
||||||
Public Shared filepath As String = "C:\Users\xperd\Documents"
|
|
||||||
|
|
||||||
Sub Load_GUI()
|
Sub Load_GUI()
|
||||||
' Initialize GUI
|
' Initialize GUI
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,7 @@
|
||||||
recessData.Columns.Add("WIDTH", GetType(Integer))
|
recessData.Columns.Add("WIDTH", GetType(Integer))
|
||||||
recessData.Columns.Add("LENGTH", GetType(Integer))
|
recessData.Columns.Add("LENGTH", GetType(Integer))
|
||||||
recessData.Columns.Add("OFFSET", GetType(Integer))
|
recessData.Columns.Add("OFFSET", GetType(Integer))
|
||||||
recessData.Columns.Add("GRATINGS", GetType(Integer()))
|
recessData.Columns.Add("GRATINGS", GetType(List(Of Integer)))
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Public Shared Sub Init_GrossAreaPoints()
|
Public Shared Sub Init_GrossAreaPoints()
|
||||||
|
|
|
||||||
|
|
@ -123,23 +123,55 @@ Public Class Grating_Fill
|
||||||
|
|
||||||
Public Shared Sub Calculate_Recesses()
|
Public Shared Sub Calculate_Recesses()
|
||||||
Dim cornerAngleCounter As Integer = 0
|
Dim cornerAngleCounter As Integer = 0
|
||||||
For Each DR As DataRow In Data.recessData.Rows
|
For k = 0 To Data.recessData.Rows.Count - 1
|
||||||
If DR("RECESS TYPE") = "ANGLE" Then
|
If Data.recessData.Rows(k)("RECESS TYPE") = "ANGLE" Then
|
||||||
cornerAngleCounter += 1
|
cornerAngleCounter += 1
|
||||||
For i = 1 To 2
|
For i = 1 To 2
|
||||||
Dim p1X, p1Y As Integer
|
Dim pX, pY As Integer
|
||||||
For Each gDR As DataRow In Data.gratingPoints.Rows
|
For Each gDR As DataRow In Data.gratingPoints.Rows
|
||||||
If gDR("NAME") = "CA" & cornerAngleCounter & "_" & i Then
|
If gDR("NAME") = "CA" & cornerAngleCounter & "_" & i Then
|
||||||
p1X = gDR("X")
|
pX = Data.gratingL / 2 + CInt(gDR("X") * 1000)
|
||||||
p1Y = gDR("Y")
|
pY = Data.gratingW / 2 - CInt(gDR("Y") * 1000)
|
||||||
|
Exit For
|
||||||
End If
|
End If
|
||||||
Next
|
Next
|
||||||
|
|
||||||
|
Dim colIndex As Integer
|
||||||
|
For j = 0 To numOfHorizontal - 1
|
||||||
|
If pX >= j * minLength AndAlso pX <= (j + 1) * minLength Then
|
||||||
|
colIndex = j
|
||||||
|
Exit For
|
||||||
|
End If
|
||||||
Next
|
Next
|
||||||
'Kolla var de ligger jämfört med gratings
|
|
||||||
'Lägg till grating index i "GRATINGS"
|
|
||||||
|
|
||||||
|
Dim rowIndex As Integer
|
||||||
|
For j = 0 To numOfVertical
|
||||||
|
If pY >= j * maxSingleWidth AndAlso pY <= (j + 1) * maxSingleWidth Then
|
||||||
|
rowIndex = j
|
||||||
|
Exit For
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
Dim gratingIndex As Integer = rowIndex * numOfHorizontal + colIndex
|
||||||
|
|
||||||
|
Dim tempList As New List(Of Integer)
|
||||||
|
Try
|
||||||
|
tempList = Data.recessData.Rows(k)("GRATINGS")
|
||||||
|
Catch ex As Exception
|
||||||
|
End Try
|
||||||
|
|
||||||
|
Dim indexNotAdded As Boolean = True
|
||||||
|
For j = 0 To tempList.Count - 1
|
||||||
|
If gratingIndex = tempList(j) Then
|
||||||
|
indexNotAdded = False
|
||||||
|
Exit For
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
If indexNotAdded Then
|
||||||
|
tempList.Add(gratingIndex)
|
||||||
|
End If
|
||||||
|
|
||||||
|
Data.recessData.Rows(k)("GRATINGS") = tempList
|
||||||
|
Next
|
||||||
End If
|
End If
|
||||||
Next
|
Next
|
||||||
End Sub
|
End Sub
|
||||||
|
|
|
||||||
|
|
@ -185,7 +185,7 @@
|
||||||
|
|
||||||
pointRow1("NAME") = "CR" & cornerRectangleCounter & "_" & 1
|
pointRow1("NAME") = "CR" & cornerRectangleCounter & "_" & 1
|
||||||
pointRow1("QUADRANT") = pointQuadrant
|
pointRow1("QUADRANT") = pointQuadrant
|
||||||
pointRow1("RECESS OK") = True
|
pointRow1("RECESS OK") = False ' Can be True (implemented in GUI but not for SW)
|
||||||
|
|
||||||
pointRow2("NAME") = "CR" & cornerRectangleCounter & "_" & 2
|
pointRow2("NAME") = "CR" & cornerRectangleCounter & "_" & 2
|
||||||
pointRow2("QUADRANT") = pointQuadrant
|
pointRow2("QUADRANT") = pointQuadrant
|
||||||
|
|
@ -193,7 +193,7 @@
|
||||||
|
|
||||||
pointRow3("NAME") = "CR" & cornerRectangleCounter & "_" & 3
|
pointRow3("NAME") = "CR" & cornerRectangleCounter & "_" & 3
|
||||||
pointRow3("QUADRANT") = pointQuadrant
|
pointRow3("QUADRANT") = pointQuadrant
|
||||||
pointRow3("RECESS OK") = True
|
pointRow3("RECESS OK") = False ' Can be True (implemented in GUI but not for SW)
|
||||||
|
|
||||||
If pointQuadrant = 1 Then
|
If pointQuadrant = 1 Then
|
||||||
' Add the new points
|
' Add the new points
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,6 @@ Public Class Model_3D
|
||||||
ExternalClass.modify_parameter_value("DP_OFFSET_X", inst_, 0)
|
ExternalClass.modify_parameter_value("DP_OFFSET_X", inst_, 0)
|
||||||
ExternalClass.modify_parameter_value("DP_OFFSET_Y", inst_, 0)
|
ExternalClass.modify_parameter_value("DP_OFFSET_Y", inst_, 0)
|
||||||
|
|
||||||
'Instantiate recess rectangle
|
|
||||||
parentID = inst_
|
parentID = inst_
|
||||||
For Each recessDR As DataRow In Data.recessData.Rows
|
For Each recessDR As DataRow In Data.recessData.Rows
|
||||||
Inst_Recesses(parentID, gratingParameters, recessDR)
|
Inst_Recesses(parentID, gratingParameters, recessDR)
|
||||||
|
|
|
||||||
|
|
@ -9,8 +9,6 @@ Public Class Model_3D_Fill
|
||||||
XCCBaseClass.newDesign()
|
XCCBaseClass.newDesign()
|
||||||
ExternalClass.PopulateTamplateXMLGroup()
|
ExternalClass.PopulateTamplateXMLGroup()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Dim inst_ As Integer
|
Dim inst_ As Integer
|
||||||
Dim parentID As Integer = 0
|
Dim parentID As Integer = 0
|
||||||
Dim gratingParameters As DataRow = exportTable.Rows(0)
|
Dim gratingParameters As DataRow = exportTable.Rows(0)
|
||||||
|
|
@ -48,6 +46,11 @@ Public Class Model_3D_Fill
|
||||||
ExternalClass.modify_parameter_value("DP_OFFSET_Y", inst_, (Grating_Fill.gratingDimensions.Rows(i)("WIDTH") / 2) + offsetY)
|
ExternalClass.modify_parameter_value("DP_OFFSET_Y", inst_, (Grating_Fill.gratingDimensions.Rows(i)("WIDTH") / 2) + offsetY)
|
||||||
Next
|
Next
|
||||||
|
|
||||||
|
parentID = Grating_Fill.numOfHorizontal * (Grating_Fill.numOfVertical - 1) + 1
|
||||||
|
For Each recessDR As DataRow In Data.recessData.Rows
|
||||||
|
Inst_Recesses(parentID, gratingParameters, recessDR)
|
||||||
|
Next
|
||||||
|
|
||||||
importClass.copyGroupsByDataSet(ExternalClass.groupds_new)
|
importClass.copyGroupsByDataSet(ExternalClass.groupds_new)
|
||||||
Dim grNr = groupClass.NewGroupID
|
Dim grNr = groupClass.NewGroupID
|
||||||
Dim designTable = designModel.selectDesign("*")
|
Dim designTable = designModel.selectDesign("*")
|
||||||
|
|
@ -55,4 +58,128 @@ Public Class Model_3D_Fill
|
||||||
groupClass.InstantiateGroup(designName, grNr, "START")
|
groupClass.InstantiateGroup(designName, grNr, "START")
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Private Shared Sub Inst_Recesses(parentID As Integer, gratingParameters As DataRow, recessDR As DataRow)
|
||||||
|
Dim inst_ As Integer
|
||||||
|
|
||||||
|
If recessDR("RECESS TYPE") = "SQUARE" Then
|
||||||
|
Dim squareL As Integer = recessDR("LENGTH") + gratingParameters("LOADBAR_THICKNESS")
|
||||||
|
Dim squareW As Integer = recessDR("WIDTH") + gratingParameters("LOADBAR_THICKNESS")
|
||||||
|
|
||||||
|
inst_ = ExternalClass.instantiate_parts(parentID, "recess_rectangle", "")
|
||||||
|
|
||||||
|
ExternalClass.modify_parameter_value("DP_LENGTH", inst_, squareL + gratingParameters("LOADBAR_THICKNESS"))
|
||||||
|
ExternalClass.modify_parameter_value("DP_WIDTH", inst_, squareW)
|
||||||
|
ExternalClass.modify_parameter_value("DP_EDGEBAR_HEIGHT", inst_, gratingParameters("LOADBAR_HEIGHT"))
|
||||||
|
ExternalClass.modify_parameter_value("DP_EDGEBAR_THICKNESS", inst_, gratingParameters("LOADBAR_THICKNESS"))
|
||||||
|
|
||||||
|
If recessDR("CORNER") = 1 Then
|
||||||
|
ExternalClass.modify_parameter_value("DP_OFFSET_W", inst_, Data.gratingW - squareW)
|
||||||
|
ExternalClass.modify_parameter_value("DP_OFFSET_L", inst_, 0)
|
||||||
|
|
||||||
|
'Position
|
||||||
|
ExternalClass.modify_parameter_value("DP_V_EDGEBAR_POS", inst_, squareL)
|
||||||
|
ExternalClass.modify_parameter_value("DP_V_EDGEBAR_BOTTOM", inst_, gratingParameters("LOADBAR_THICKNESS"))
|
||||||
|
ExternalClass.modify_parameter_value("DP_H_EDGEBAR_POS", inst_, 0)
|
||||||
|
|
||||||
|
ElseIf recessDR("CORNER") = 2 Then
|
||||||
|
ExternalClass.modify_parameter_value("DP_OFFSET_W", inst_, Data.gratingW - squareW)
|
||||||
|
ExternalClass.modify_parameter_value("DP_OFFSET_L", inst_, Data.gratingL - squareL - gratingParameters("LOADBAR_THICKNESS"))
|
||||||
|
|
||||||
|
'Position
|
||||||
|
ExternalClass.modify_parameter_value("DP_V_EDGEBAR_POS", inst_, 0)
|
||||||
|
ExternalClass.modify_parameter_value("DP_V_EDGEBAR_BOTTOM", inst_, gratingParameters("LOADBAR_THICKNESS"))
|
||||||
|
ExternalClass.modify_parameter_value("DP_H_EDGEBAR_POS", inst_, 0)
|
||||||
|
|
||||||
|
ElseIf recessDR("CORNER") = 3 Then
|
||||||
|
ExternalClass.modify_parameter_value("DP_OFFSET_W", inst_, 0)
|
||||||
|
ExternalClass.modify_parameter_value("DP_OFFSET_L", inst_, Data.gratingL - squareL - gratingParameters("LOADBAR_THICKNESS"))
|
||||||
|
|
||||||
|
'Position
|
||||||
|
ExternalClass.modify_parameter_value("DP_V_EDGEBAR_POS", inst_, 0)
|
||||||
|
ExternalClass.modify_parameter_value("DP_V_EDGEBAR_BOTTOM", inst_, 0)
|
||||||
|
ExternalClass.modify_parameter_value("DP_H_EDGEBAR_POS", inst_, squareW - gratingParameters("LOADBAR_THICKNESS"))
|
||||||
|
Else
|
||||||
|
ExternalClass.modify_parameter_value("DP_OFFSET_W", inst_, 0)
|
||||||
|
ExternalClass.modify_parameter_value("DP_OFFSET_L", inst_, 0)
|
||||||
|
|
||||||
|
'Position
|
||||||
|
ExternalClass.modify_parameter_value("DP_V_EDGEBAR_POS", inst_, squareL)
|
||||||
|
ExternalClass.modify_parameter_value("DP_V_EDGEBAR_BOTTOM", inst_, 0)
|
||||||
|
ExternalClass.modify_parameter_value("DP_H_EDGEBAR_POS", inst_, squareW - gratingParameters("LOADBAR_THICKNESS"))
|
||||||
|
End If
|
||||||
|
|
||||||
|
ElseIf recessDR("RECESS TYPE") = "ANGLE" Then
|
||||||
|
inst_ = ExternalClass.instantiate_parts(parentID, "recess_angle", "")
|
||||||
|
|
||||||
|
ExternalClass.modify_parameter_value("DP_EDGEBAR_HEIGHT", inst_, gratingParameters("LOADBAR_HEIGHT"))
|
||||||
|
ExternalClass.modify_parameter_value("DP_EDGEBAR_THICKNESS", inst_, gratingParameters("LOADBAR_THICKNESS"))
|
||||||
|
|
||||||
|
If recessDR("CORNER") = 1 Then
|
||||||
|
ExternalClass.modify_parameter_value("DP_LENGTH", inst_, recessDR("WIDTH"))
|
||||||
|
ExternalClass.modify_parameter_value("DP_WIDTH", inst_, recessDR("LENGTH"))
|
||||||
|
ExternalClass.modify_parameter_value("DP_OFFSET_W", inst_, Data.gratingW)
|
||||||
|
ExternalClass.modify_parameter_value("DP_OFFSET_L", inst_, 0)
|
||||||
|
ExternalClass.modify_parameter_value("DP_ROTATION", inst_, 90)
|
||||||
|
|
||||||
|
ElseIf recessDR("CORNER") = 2 Then
|
||||||
|
ExternalClass.modify_parameter_value("DP_LENGTH", inst_, recessDR("LENGTH"))
|
||||||
|
ExternalClass.modify_parameter_value("DP_WIDTH", inst_, recessDR("WIDTH"))
|
||||||
|
ExternalClass.modify_parameter_value("DP_OFFSET_W", inst_, Data.gratingW)
|
||||||
|
ExternalClass.modify_parameter_value("DP_OFFSET_L", inst_, Data.gratingL)
|
||||||
|
ExternalClass.modify_parameter_value("DP_ROTATION", inst_, 180)
|
||||||
|
|
||||||
|
ElseIf recessDR("CORNER") = 3 Then
|
||||||
|
ExternalClass.modify_parameter_value("DP_LENGTH", inst_, recessDR("WIDTH"))
|
||||||
|
ExternalClass.modify_parameter_value("DP_WIDTH", inst_, recessDR("LENGTH"))
|
||||||
|
ExternalClass.modify_parameter_value("DP_OFFSET_W", inst_, 0)
|
||||||
|
ExternalClass.modify_parameter_value("DP_OFFSET_L", inst_, Data.gratingL)
|
||||||
|
ExternalClass.modify_parameter_value("DP_ROTATION", inst_, 270)
|
||||||
|
|
||||||
|
Else
|
||||||
|
ExternalClass.modify_parameter_value("DP_LENGTH", inst_, recessDR("LENGTH"))
|
||||||
|
ExternalClass.modify_parameter_value("DP_WIDTH", inst_, recessDR("WIDTH"))
|
||||||
|
ExternalClass.modify_parameter_value("DP_OFFSET_W", inst_, 0)
|
||||||
|
ExternalClass.modify_parameter_value("DP_OFFSET_L", inst_, 0)
|
||||||
|
ExternalClass.modify_parameter_value("DP_ROTATION", inst_, 0)
|
||||||
|
|
||||||
|
End If
|
||||||
|
|
||||||
|
ElseIf recessDR("RECESS TYPE") = "SIDE SQUARE" Then
|
||||||
|
inst_ = ExternalClass.instantiate_parts(parentID, "recess_side_square", "")
|
||||||
|
|
||||||
|
ExternalClass.modify_parameter_value("DP_EDGEBAR_HEIGHT", inst_, gratingParameters("LOADBAR_HEIGHT"))
|
||||||
|
ExternalClass.modify_parameter_value("DP_EDGEBAR_THICKNESS", inst_, gratingParameters("LOADBAR_THICKNESS"))
|
||||||
|
|
||||||
|
If recessDR("SIDE") = 1 Then
|
||||||
|
ExternalClass.modify_parameter_value("DP_LENGTH", inst_, recessDR("WIDTH"))
|
||||||
|
ExternalClass.modify_parameter_value("DP_WIDTH", inst_, recessDR("LENGTH"))
|
||||||
|
ExternalClass.modify_parameter_value("DP_OFFSET_W", inst_, Data.gratingW)
|
||||||
|
ExternalClass.modify_parameter_value("DP_OFFSET_L", inst_, recessDR("OFFSET"))
|
||||||
|
ExternalClass.modify_parameter_value("DP_ROTATION", inst_, 90)
|
||||||
|
|
||||||
|
ElseIf recessDR("SIDE") = 2 Then
|
||||||
|
ExternalClass.modify_parameter_value("DP_LENGTH", inst_, recessDR("LENGTH"))
|
||||||
|
ExternalClass.modify_parameter_value("DP_WIDTH", inst_, recessDR("WIDTH"))
|
||||||
|
ExternalClass.modify_parameter_value("DP_OFFSET_W", inst_, Data.gratingW - recessDR("OFFSET"))
|
||||||
|
ExternalClass.modify_parameter_value("DP_OFFSET_L", inst_, Data.gratingL)
|
||||||
|
ExternalClass.modify_parameter_value("DP_ROTATION", inst_, 180)
|
||||||
|
|
||||||
|
ElseIf recessDR("SIDE") = 3 Then
|
||||||
|
ExternalClass.modify_parameter_value("DP_LENGTH", inst_, recessDR("WIDTH"))
|
||||||
|
ExternalClass.modify_parameter_value("DP_WIDTH", inst_, recessDR("LENGTH"))
|
||||||
|
ExternalClass.modify_parameter_value("DP_OFFSET_W", inst_, 0)
|
||||||
|
ExternalClass.modify_parameter_value("DP_OFFSET_L", inst_, Data.gratingL - recessDR("OFFSET"))
|
||||||
|
ExternalClass.modify_parameter_value("DP_ROTATION", inst_, 270)
|
||||||
|
|
||||||
|
Else
|
||||||
|
ExternalClass.modify_parameter_value("DP_LENGTH", inst_, recessDR("LENGTH"))
|
||||||
|
ExternalClass.modify_parameter_value("DP_WIDTH", inst_, recessDR("WIDTH"))
|
||||||
|
ExternalClass.modify_parameter_value("DP_OFFSET_W", inst_, recessDR("OFFSET"))
|
||||||
|
ExternalClass.modify_parameter_value("DP_OFFSET_L", inst_, 0)
|
||||||
|
ExternalClass.modify_parameter_value("DP_ROTATION", inst_, 0)
|
||||||
|
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
End Class
|
End Class
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue