added conditions for thickness, bug with some choices where options are empty
This commit is contained in:
parent
4283e09c79
commit
83c3984c65
BIN
Databas.xlsx
BIN
Databas.xlsx
Binary file not shown.
|
|
@ -2,8 +2,8 @@
|
||||||
Imports Excel = Microsoft.Office.Interop.Excel
|
Imports Excel = Microsoft.Office.Interop.Excel
|
||||||
|
|
||||||
Public Class GUI
|
Public Class GUI
|
||||||
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"
|
||||||
|
|
||||||
Dim excelApp As Excel.Application = New Excel.Application
|
Dim excelApp As Excel.Application = New Excel.Application
|
||||||
Dim excelWB As Excel.Workbook
|
Dim excelWB As Excel.Workbook
|
||||||
|
|
|
||||||
|
|
@ -217,11 +217,49 @@
|
||||||
GUI.ComboBox_Thickness.Items.Clear()
|
GUI.ComboBox_Thickness.Items.Clear()
|
||||||
gratingHeight = CInt(GUI.ComboBox_Height.Text)
|
gratingHeight = CInt(GUI.ComboBox_Height.Text)
|
||||||
|
|
||||||
' Add thicknesses
|
Dim meshesDT As DataTable = GUI.dataBase("Meshes")
|
||||||
If gratingHeight = 20 Then
|
|
||||||
GUI.ComboBox_Thickness.Items.Add("2")
|
Dim nameInDT As String = meshesDT.Rows(0)("NAME")
|
||||||
GUI.ComboBox_Thickness.Items.Add("3")
|
Dim materialInDT As String = meshesDT.Rows(0)("MATERIAL")
|
||||||
End If
|
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 HeightInDT As Integer = CInt(meshesDT.Rows(0)("LB-HEIGHT"))
|
||||||
|
|
||||||
|
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 AndAlso gratingHeight = HeightInDT Then
|
||||||
|
|
||||||
|
Dim addItem As Boolean = True
|
||||||
|
For j = 0 To tempList.Count - 1
|
||||||
|
If meshesDT.Rows(i)("LB-THICKNESS") = tempList(j) Then
|
||||||
|
addItem = False
|
||||||
|
Exit For
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
If addItem = True Then
|
||||||
|
tempList.Add(CInt(meshesDT.Rows(i)("LB-THICKNESS")))
|
||||||
|
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"))
|
||||||
|
HeightInDT = CInt(meshesDT.Rows(i + 1)("LB-HEIGHT"))
|
||||||
|
Catch ex As Exception
|
||||||
|
End Try
|
||||||
|
Next
|
||||||
|
|
||||||
|
tempList.Sort()
|
||||||
|
For i = 0 To tempList.Count - 2
|
||||||
|
GUI.ComboBox_Thickness.Items.Add(tempList(i))
|
||||||
|
Next
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Public Shared Sub ThicknessChanged(sender As Object, e As EventArgs)
|
Public Shared Sub ThicknessChanged(sender As Object, e As EventArgs)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue