Comboboxes gui

This commit is contained in:
Mans 2021-02-01 10:14:01 +01:00
parent c5a8b20002
commit e24f50dc27
3 changed files with 91 additions and 8 deletions

View File

@ -37,6 +37,10 @@ Partial Class GUI
Me.LabelAngleX = New System.Windows.Forms.Label() Me.LabelAngleX = New System.Windows.Forms.Label()
Me.LabelAngleY = New System.Windows.Forms.Label() Me.LabelAngleY = New System.Windows.Forms.Label()
Me.SettingsButton = New System.Windows.Forms.Button() Me.SettingsButton = New System.Windows.Forms.Button()
Me.ComboBox_TypeChooser = New System.Windows.Forms.ComboBox()
Me.ComboBox_MeshSize = New System.Windows.Forms.ComboBox()
Me.ComboBox_Thickness = New System.Windows.Forms.ComboBox()
Me.ComboBox_Height = New System.Windows.Forms.ComboBox()
Me.SuspendLayout() Me.SuspendLayout()
' '
'DrawingPanel 'DrawingPanel
@ -108,7 +112,7 @@ Partial Class GUI
' '
'AngleButton 'AngleButton
' '
Me.AngleButton.Location = New System.Drawing.Point(38, 162) Me.AngleButton.Location = New System.Drawing.Point(43, 343)
Me.AngleButton.Name = "AngleButton" Me.AngleButton.Name = "AngleButton"
Me.AngleButton.Size = New System.Drawing.Size(122, 34) Me.AngleButton.Size = New System.Drawing.Size(122, 34)
Me.AngleButton.TabIndex = 7 Me.AngleButton.TabIndex = 7
@ -118,7 +122,7 @@ Partial Class GUI
'AngleD1 'AngleD1
' '
Me.AngleD1.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.AngleD1.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.AngleD1.Location = New System.Drawing.Point(52, 224) Me.AngleD1.Location = New System.Drawing.Point(57, 405)
Me.AngleD1.Name = "AngleD1" Me.AngleD1.Name = "AngleD1"
Me.AngleD1.Size = New System.Drawing.Size(82, 26) Me.AngleD1.Size = New System.Drawing.Size(82, 26)
Me.AngleD1.TabIndex = 8 Me.AngleD1.TabIndex = 8
@ -127,7 +131,7 @@ Partial Class GUI
'AngleD2 'AngleD2
' '
Me.AngleD2.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.AngleD2.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.AngleD2.Location = New System.Drawing.Point(196, 224) Me.AngleD2.Location = New System.Drawing.Point(201, 405)
Me.AngleD2.Name = "AngleD2" Me.AngleD2.Name = "AngleD2"
Me.AngleD2.Size = New System.Drawing.Size(90, 26) Me.AngleD2.Size = New System.Drawing.Size(90, 26)
Me.AngleD2.TabIndex = 9 Me.AngleD2.TabIndex = 9
@ -137,7 +141,7 @@ Partial Class GUI
' '
Me.LabelAngleX.AutoSize = True Me.LabelAngleX.AutoSize = True
Me.LabelAngleX.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.LabelAngleX.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.LabelAngleX.Location = New System.Drawing.Point(26, 227) Me.LabelAngleX.Location = New System.Drawing.Point(31, 408)
Me.LabelAngleX.Name = "LabelAngleX" Me.LabelAngleX.Name = "LabelAngleX"
Me.LabelAngleX.Size = New System.Drawing.Size(20, 20) Me.LabelAngleX.Size = New System.Drawing.Size(20, 20)
Me.LabelAngleX.TabIndex = 10 Me.LabelAngleX.TabIndex = 10
@ -147,7 +151,7 @@ Partial Class GUI
' '
Me.LabelAngleY.AutoSize = True Me.LabelAngleY.AutoSize = True
Me.LabelAngleY.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.LabelAngleY.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.LabelAngleY.Location = New System.Drawing.Point(171, 227) Me.LabelAngleY.Location = New System.Drawing.Point(176, 408)
Me.LabelAngleY.Name = "LabelAngleY" Me.LabelAngleY.Name = "LabelAngleY"
Me.LabelAngleY.Size = New System.Drawing.Size(19, 20) Me.LabelAngleY.Size = New System.Drawing.Size(19, 20)
Me.LabelAngleY.TabIndex = 11 Me.LabelAngleY.TabIndex = 11
@ -155,18 +159,58 @@ Partial Class GUI
' '
'SettingsButton 'SettingsButton
' '
Me.SettingsButton.Location = New System.Drawing.Point(12, 11) Me.SettingsButton.Location = New System.Drawing.Point(1104, 12)
Me.SettingsButton.Name = "SettingsButton" Me.SettingsButton.Name = "SettingsButton"
Me.SettingsButton.Size = New System.Drawing.Size(80, 50) Me.SettingsButton.Size = New System.Drawing.Size(80, 50)
Me.SettingsButton.TabIndex = 12 Me.SettingsButton.TabIndex = 12
Me.SettingsButton.Text = "Settings" Me.SettingsButton.Text = "Settings"
Me.SettingsButton.UseVisualStyleBackColor = True Me.SettingsButton.UseVisualStyleBackColor = True
' '
'ComboBox_TypeChooser
'
Me.ComboBox_TypeChooser.FormattingEnabled = True
Me.ComboBox_TypeChooser.Items.AddRange(New Object() {"Pressure Welded", "Type A"})
Me.ComboBox_TypeChooser.Location = New System.Drawing.Point(43, 147)
Me.ComboBox_TypeChooser.Name = "ComboBox_TypeChooser"
Me.ComboBox_TypeChooser.Size = New System.Drawing.Size(187, 24)
Me.ComboBox_TypeChooser.TabIndex = 13
'
'ComboBox_MeshSize
'
Me.ComboBox_MeshSize.FormattingEnabled = True
Me.ComboBox_MeshSize.Items.AddRange(New Object() {"12x100 (B9)", "25x50 (F4)", "34x37 (H3)"})
Me.ComboBox_MeshSize.Location = New System.Drawing.Point(43, 186)
Me.ComboBox_MeshSize.Name = "ComboBox_MeshSize"
Me.ComboBox_MeshSize.Size = New System.Drawing.Size(187, 24)
Me.ComboBox_MeshSize.TabIndex = 14
'
'ComboBox_Thickness
'
Me.ComboBox_Thickness.FormattingEnabled = True
Me.ComboBox_Thickness.Items.AddRange(New Object() {"2", "3", "4"})
Me.ComboBox_Thickness.Location = New System.Drawing.Point(43, 230)
Me.ComboBox_Thickness.Name = "ComboBox_Thickness"
Me.ComboBox_Thickness.Size = New System.Drawing.Size(187, 24)
Me.ComboBox_Thickness.TabIndex = 15
'
'ComboBox_Height
'
Me.ComboBox_Height.FormattingEnabled = True
Me.ComboBox_Height.Items.AddRange(New Object() {"20", "25", "30"})
Me.ComboBox_Height.Location = New System.Drawing.Point(43, 266)
Me.ComboBox_Height.Name = "ComboBox_Height"
Me.ComboBox_Height.Size = New System.Drawing.Size(187, 24)
Me.ComboBox_Height.TabIndex = 16
'
'GUI 'GUI
' '
Me.AutoScaleDimensions = New System.Drawing.SizeF(8.0!, 16.0!) Me.AutoScaleDimensions = New System.Drawing.SizeF(8.0!, 16.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(1199, 614) Me.ClientSize = New System.Drawing.Size(1199, 614)
Me.Controls.Add(Me.ComboBox_Height)
Me.Controls.Add(Me.ComboBox_Thickness)
Me.Controls.Add(Me.ComboBox_MeshSize)
Me.Controls.Add(Me.ComboBox_TypeChooser)
Me.Controls.Add(Me.SettingsButton) Me.Controls.Add(Me.SettingsButton)
Me.Controls.Add(Me.LabelAngleY) Me.Controls.Add(Me.LabelAngleY)
Me.Controls.Add(Me.LabelAngleX) Me.Controls.Add(Me.LabelAngleX)
@ -201,4 +245,8 @@ Partial Class GUI
Friend WithEvents LabelAngleX As Label Friend WithEvents LabelAngleX As Label
Friend WithEvents LabelAngleY As Label Friend WithEvents LabelAngleY As Label
Friend WithEvents SettingsButton As Button Friend WithEvents SettingsButton As Button
Friend WithEvents ComboBox_TypeChooser As ComboBox
Friend WithEvents ComboBox_MeshSize As ComboBox
Friend WithEvents ComboBox_Thickness As ComboBox
Friend WithEvents ComboBox_Height As ComboBox
End Class End Class

View File

@ -302,17 +302,42 @@ Public Class GUI
End Sub End Sub
Private Function Create_ExportTable() As DataTable Private Function Create_ExportTable() As DataTable
Dim lSpacing As String = ComboBox_MeshSize.Text.Split("x")(0)
Dim cSpacing As String = ComboBox_MeshSize.Text.Split("x")(1).Split(" ")(0)
Dim gratingTable As New DataTable Dim gratingTable As New DataTable
gratingTable.Columns.Add("TYPE", GetType(String)) gratingTable.Columns.Add("TYPE", GetType(String))
gratingTable.Columns.Add("SERRATED", GetType(Boolean)) gratingTable.Columns.Add("SERRATED", GetType(Boolean))
gratingTable.Columns.Add("WIDTH", GetType(Decimal)) gratingTable.Columns.Add("WIDTH", GetType(Decimal))
gratingTable.Columns.Add("LENGTH", GetType(Decimal)) gratingTable.Columns.Add("LENGTH", GetType(Decimal))
gratingTable.Columns.Add("LOADBAR_THICKNESS", GetType(Decimal))
gratingTable.Columns.Add("LOADBAR_HEIGHT", GetType(Decimal))
gratingTable.Columns.Add("LOADBAR_SPACING", GetType(Decimal))
gratingTable.Columns.Add("CROSSBAR_SPACING", GetType(Decimal))
gratingTable.Columns.Add("CROSSBAR_DIAMETER", GetType(Decimal))
gratingTable.Columns.Add("CROSSBAR_THICKNESS", GetType(Decimal))
gratingTable.Columns.Add("CROSSBAR_HEIGHT", GetType(Decimal))
gratingTable.Rows.Add() gratingTable.Rows.Add()
gratingTable.Rows(0)("TYPE") = "pressure_welded" ' Här behövs namn HLCt modellen gratingTable.Rows(0)("TYPE") = ComboBox_TypeChooser.Text ' Här behövs namn HLCt modellen
gratingTable.Rows(0)("SERRATED") = False gratingTable.Rows(0)("SERRATED") = False
gratingTable.Rows(0)("WIDTH") = CDec(WidthBox.Text) gratingTable.Rows(0)("WIDTH") = CDec(WidthBox.Text)
gratingTable.Rows(0)("LENGTH") = CDec(LengthBox.Text) gratingTable.Rows(0)("LENGTH") = CDec(LengthBox.Text)
gratingTable.Rows(0)("LOADBAR_THICKNESS") = CDec(ComboBox_Thickness.Text)
gratingTable.Rows(0)("LOADBAR_HEIGHT") = CDec(ComboBox_Height.Text)
gratingTable.Rows(0)("LOADBAR_SPACING") = CDec(lSpacing)
gratingTable.Rows(0)("CROSSBAR_SPACING") = CDec(cSpacing)
If gratingTable.Rows(0)("TYPE") = "pressure_welded" Then
gratingTable.Rows(0)("CROSSBAR_DIAMETER") = 5
gratingTable.Rows(0)("CROSSBAR_THICKNESS") = 0
gratingTable.Rows(0)("CROSSBAR_HEIGHT") = 0
Else
gratingTable.Rows(0)("CROSSBAR_DIAMETER") = 0
gratingTable.Rows(0)("CROSSBAR_THICKNESS") = 2
gratingTable.Rows(0)("CROSSBAR_HEIGHT") = 15
End If
Return gratingTable Return gratingTable
End Function End Function

View File

@ -20,7 +20,17 @@ Public Class Program
inst_ = ExternalClass.instantiate_parts(parentID, gratingParameters("TYPE"), "") ' Ange pressure welded eller type A, Serrated? inst_ = ExternalClass.instantiate_parts(parentID, gratingParameters("TYPE"), "") ' Ange pressure welded eller type A, Serrated?
ExternalClass.modify_parameter_value("DP_GRATING_WIDTH", inst_, gratingParameters("WIDTH")) ExternalClass.modify_parameter_value("DP_GRATING_WIDTH", inst_, gratingParameters("WIDTH"))
ExternalClass.modify_parameter_value("DP_GRATING_LENGTH", inst_, gratingParameters("LENGTH")) ExternalClass.modify_parameter_value("DP_GRATING_LENGTH", inst_, gratingParameters("LENGTH"))
'Lägg in fler DP ExternalClass.modify_parameter_value("DP_LOADBAR_THICKNESS", inst_, gratingParameters("LOADBAR_THICKNESS"))
ExternalClass.modify_parameter_value("DP_LOADBAR_HEIGHT", inst_, gratingParameters("LOADBAR_HEIGHT"))
ExternalClass.modify_parameter_value("DP_LOADBAR_SPACING", inst_, gratingParameters("LOADBAR_SPACING"))
ExternalClass.modify_parameter_value("DP_CROSSBAR_SPACING", inst_, gratingParameters("CROSSBAR_SPACING"))
If gratingParameters("TYPE") = "pressure_welded" Then
ExternalClass.modify_parameter_value("DP_CROSSBAR_DIAMETER", inst_, gratingParameters("CROSSBAR_DIAMETER"))
Else
ExternalClass.modify_parameter_value("DP_CROSSBAR_THICKNESS", inst_, gratingParameters("CROSSBAR_THICKNESS"))
ExternalClass.modify_parameter_value("DP_CROSSBAR_HEIGHT", inst_, gratingParameters("CROSSBAR_HEIGHT"))
End If
importClass.copyGroupsByDataSet(ExternalClass.groupds_new) importClass.copyGroupsByDataSet(ExternalClass.groupds_new)
Dim grNr = groupClass.NewGroupID Dim grNr = groupClass.NewGroupID