Small fixes

This commit is contained in:
Anton 2021-02-08 13:41:59 +01:00
parent 318f83993f
commit 4283e09c79
1 changed files with 42 additions and 5 deletions

View File

@ -2,7 +2,7 @@
Public Shared gratingMaxW As Decimal = 1000
Public Shared gratingMaxL As Decimal = 1000
Private Shared gratingType, gratingMaterial, gratingMesh As String
Private Shared gratingType, gratingMaterial, gratingMesh, gratingName As String
Private Shared gratingSerrated As Boolean = False
Private Shared loadBarSpacing, crossBarSpacing, gratingHeight, loadBarThickness As Integer
@ -167,12 +167,49 @@
gratingMesh = GUI.ComboBox_MeshSize.Text
loadBarSpacing = CInt(gratingMesh.Split("x")(0))
crossBarSpacing = CInt(gratingMesh.Split("x")(1).Split(" ")(0))
gratingName = gratingMesh.Split("(")(1).Split(")")(0)
' Add heights
If loadBarSpacing = 12 And crossBarSpacing = 100 Then
GUI.ComboBox_Height.Items.Add("20")
GUI.ComboBox_Height.Items.Add("25")
End If
Dim meshesDT As DataTable = GUI.dataBase("Meshes")
Dim nameInDT As String = meshesDT.Rows(0)("NAME")
Dim materialInDT As String = meshesDT.Rows(0)("MATERIAL")
Dim serratedInDT As Boolean = CBool(meshesDT.Rows(0)("SERRATED"))
Dim LBSpacingInDT As Integer = CInt(meshesDT.Rows(0)("LB-SPACING"))
Dim CBSpacingInDT As Integer = CInt(meshesDT.Rows(0)("CB-SPACING"))
Dim tempList As New List(Of Integer)
For i = 0 To meshesDT.Rows.Count - 1
If gratingName = nameInDT AndAlso loadBarSpacing = LBSpacingInDT AndAlso crossBarSpacing = CBSpacingInDT _
AndAlso gratingSerrated = serratedInDT AndAlso gratingMaterial = materialInDT Then
Dim addItem As Boolean = True
For j = 0 To tempList.Count - 1
If meshesDT.Rows(i)("LB-HEIGHT") = tempList(j) Then
addItem = False
Exit For
End If
Next
If addItem = True Then
tempList.Add(CInt(meshesDT.Rows(i)("LB-HEIGHT")))
End If
End If
Try
nameInDT = meshesDT.Rows(i + 1)("NAME")
materialInDT = meshesDT.Rows(i + 1)("MATERIAL")
serratedInDT = CBool(meshesDT.Rows(i + 1)("SERRATED"))
LBSpacingInDT = CInt(meshesDT.Rows(i + 1)("LB-SPACING"))
CBSpacingInDT = CInt(meshesDT.Rows(i + 1)("CB-SPACING"))
Catch ex As Exception
End Try
Next
tempList.Sort()
For i = 0 To tempList.Count - 2
GUI.ComboBox_Height.Items.Add(tempList(i))
Next
End Sub
Public Shared Sub HeightChanged(sender As Object, e As EventArgs)