New Gui design

This commit is contained in:
Mans 2021-02-23 14:52:51 +01:00
parent 10903dcf92
commit 08897a7cb0
16 changed files with 777 additions and 4828 deletions

View File

@ -30,19 +30,16 @@ Partial Class AppForm
' '
'Panel_Start 'Panel_Start
' '
Me.Panel_Start.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
Or System.Windows.Forms.AnchorStyles.Left) _
Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.Panel_Start.Controls.Add(Me.Button_Multiple) Me.Panel_Start.Controls.Add(Me.Button_Multiple)
Me.Panel_Start.Controls.Add(Me.Button_Individual) Me.Panel_Start.Controls.Add(Me.Button_Individual)
Me.Panel_Start.Location = New System.Drawing.Point(-3, -2) Me.Panel_Start.Location = New System.Drawing.Point(0, 0)
Me.Panel_Start.Name = "Panel_Start" Me.Panel_Start.Name = "Panel_Start"
Me.Panel_Start.Size = New System.Drawing.Size(2005, 876) Me.Panel_Start.Size = New System.Drawing.Size(1395, 772)
Me.Panel_Start.TabIndex = 0 Me.Panel_Start.TabIndex = 0
' '
'Button_Multiple 'Button_Multiple
' '
Me.Button_Multiple.Location = New System.Drawing.Point(742, 422) Me.Button_Multiple.Location = New System.Drawing.Point(700, 422)
Me.Button_Multiple.Name = "Button_Multiple" Me.Button_Multiple.Name = "Button_Multiple"
Me.Button_Multiple.Size = New System.Drawing.Size(117, 93) Me.Button_Multiple.Size = New System.Drawing.Size(117, 93)
Me.Button_Multiple.TabIndex = 1 Me.Button_Multiple.TabIndex = 1
@ -51,7 +48,7 @@ Partial Class AppForm
' '
'Button_Individual 'Button_Individual
' '
Me.Button_Individual.Location = New System.Drawing.Point(742, 285) Me.Button_Individual.Location = New System.Drawing.Point(700, 285)
Me.Button_Individual.Name = "Button_Individual" Me.Button_Individual.Name = "Button_Individual"
Me.Button_Individual.Size = New System.Drawing.Size(117, 93) Me.Button_Individual.Size = New System.Drawing.Size(117, 93)
Me.Button_Individual.TabIndex = 0 Me.Button_Individual.TabIndex = 0
@ -62,8 +59,10 @@ Partial Class AppForm
' '
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(1584, 761) Me.ClientSize = New System.Drawing.Size(1384, 761)
Me.Controls.Add(Me.Panel_Start) Me.Controls.Add(Me.Panel_Start)
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle
Me.MaximizeBox = False
Me.Name = "AppForm" Me.Name = "AppForm"
Me.Text = "AppForm" Me.Text = "AppForm"
Me.Panel_Start.ResumeLayout(False) Me.Panel_Start.ResumeLayout(False)

View File

@ -7,6 +7,8 @@
Me.Top = 20 Me.Top = 20
Me.Left = 50 Me.Left = 50
' Get floor gratings database
Database.Retrive_Database()
End Sub End Sub
Private Sub Button_Individual_Click(sender As Object, e As EventArgs) Handles Button_Individual.Click Private Sub Button_Individual_Click(sender As Object, e As EventArgs) Handles Button_Individual.Click
Panel_Start.Controls.Clear() Panel_Start.Controls.Clear()

View File

@ -10,7 +10,7 @@
Public Shared Sub Load_DrawingPanel() Public Shared Sub Load_DrawingPanel()
AddHandler GUI.DrawingPanel.Paint, AddressOf DrawingPanel_Paint AddHandler Individual.Panel_Grating.Paint, AddressOf DrawingPanel_Paint
Get_DrawboxParameters() Get_DrawboxParameters()
@ -26,8 +26,8 @@
' --- Retrive parameters for the drawing box --- ' --- Retrive parameters for the drawing box ---
Private Shared Sub Get_DrawboxParameters() Private Shared Sub Get_DrawboxParameters()
guiPanelL = GUI.DrawingPanel.Size.Width guiPanelL = Individual.Panel_Grating.Size.Width
guiPanelW = GUI.DrawingPanel.Size.Height guiPanelW = Individual.Panel_Grating.Size.Height
Data.guiPanelMidX = guiPanelL / 2 Data.guiPanelMidX = guiPanelL / 2
Data.guiPanelMidY = guiPanelW / 2 Data.guiPanelMidY = guiPanelW / 2
@ -141,7 +141,7 @@
Data.gratingPoints.Rows(3)("X") = (-Data.gratingL / 2) / 1000 Data.gratingPoints.Rows(3)("X") = (-Data.gratingL / 2) / 1000
Data.gratingPoints.Rows(3)("Y") = (-Data.gratingW / 2) / 1000 Data.gratingPoints.Rows(3)("Y") = (-Data.gratingW / 2) / 1000
GUI.DrawingPanel.Refresh() Individual.Panel_Grating.Refresh()
End Sub End Sub
' --- Draw all the lines for the panel and grating --- ' --- Draw all the lines for the panel and grating ---

View File

@ -1,394 +0,0 @@
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()>
Partial Class GUI
Inherits System.Windows.Forms.Form
'Form overrides dispose to clean up the component list.
<System.Diagnostics.DebuggerNonUserCode()>
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
Finally
MyBase.Dispose(disposing)
End Try
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()>
Private Sub InitializeComponent()
Me.components = New System.ComponentModel.Container()
Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(GUI))
Me.DrawingPanel = New System.Windows.Forms.Panel()
Me.Label10 = New System.Windows.Forms.Label()
Me.Label8 = New System.Windows.Forms.Label()
Me.ContextMenuStrip1 = New System.Windows.Forms.ContextMenuStrip(Me.components)
Me.Label1 = New System.Windows.Forms.Label()
Me.Label2 = New System.Windows.Forms.Label()
Me.ExportSWButton = New System.Windows.Forms.Button()
Me.AngleButton = 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.Label3 = New System.Windows.Forms.Label()
Me.Label4 = New System.Windows.Forms.Label()
Me.Label5 = New System.Windows.Forms.Label()
Me.Label6 = New System.Windows.Forms.Label()
Me.Label7 = New System.Windows.Forms.Label()
Me.ComboBox_Width = New System.Windows.Forms.ComboBox()
Me.Button_Square = New System.Windows.Forms.Button()
Me.Label9 = New System.Windows.Forms.Label()
Me.ComboBox_Material = New System.Windows.Forms.ComboBox()
Me.Label_Material = New System.Windows.Forms.Label()
Me.CheckBox_WholeMeshWidths = New System.Windows.Forms.CheckBox()
Me.TextBox_Length = New System.Windows.Forms.TextBox()
Me.Button_SquareSide = New System.Windows.Forms.Button()
Me.DrawingPanel.SuspendLayout()
Me.SuspendLayout()
'
'DrawingPanel
'
Me.DrawingPanel.BackColor = System.Drawing.SystemColors.Window
Me.DrawingPanel.Controls.Add(Me.Label10)
Me.DrawingPanel.Controls.Add(Me.Label8)
Me.DrawingPanel.Location = New System.Drawing.Point(240, 145)
Me.DrawingPanel.Margin = New System.Windows.Forms.Padding(2, 2, 2, 2)
Me.DrawingPanel.Name = "DrawingPanel"
Me.DrawingPanel.Size = New System.Drawing.Size(1130, 560)
Me.DrawingPanel.TabIndex = 0
'
'Label10
'
Me.Label10.AutoSize = True
Me.Label10.Location = New System.Drawing.Point(13, 482)
Me.Label10.Name = "Label10"
Me.Label10.Size = New System.Drawing.Size(18, 13)
Me.Label10.TabIndex = 1
Me.Label10.Text = "W"
'
'Label8
'
Me.Label8.AutoSize = True
Me.Label8.Location = New System.Drawing.Point(66, 533)
Me.Label8.Name = "Label8"
Me.Label8.Size = New System.Drawing.Size(13, 13)
Me.Label8.TabIndex = 0
Me.Label8.Text = "L"
'
'ContextMenuStrip1
'
Me.ContextMenuStrip1.ImageScalingSize = New System.Drawing.Size(20, 20)
Me.ContextMenuStrip1.Name = "ContextMenuStrip1"
Me.ContextMenuStrip1.Size = New System.Drawing.Size(61, 4)
'
'Label1
'
Me.Label1.AutoSize = True
Me.Label1.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label1.Location = New System.Drawing.Point(45, 400)
Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(44, 17)
Me.Label1.TabIndex = 4
Me.Label1.Text = "Width"
'
'Label2
'
Me.Label2.AutoSize = True
Me.Label2.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label2.Location = New System.Drawing.Point(34, 460)
Me.Label2.Name = "Label2"
Me.Label2.Size = New System.Drawing.Size(52, 17)
Me.Label2.TabIndex = 5
Me.Label2.Text = "Length"
'
'ExportSWButton
'
Me.ExportSWButton.BackColor = System.Drawing.SystemColors.ActiveCaption
Me.ExportSWButton.Location = New System.Drawing.Point(1281, 717)
Me.ExportSWButton.Margin = New System.Windows.Forms.Padding(2, 2, 2, 2)
Me.ExportSWButton.Name = "ExportSWButton"
Me.ExportSWButton.Size = New System.Drawing.Size(92, 33)
Me.ExportSWButton.TabIndex = 6
Me.ExportSWButton.Text = "Export"
Me.ExportSWButton.UseVisualStyleBackColor = False
'
'AngleButton
'
Me.AngleButton.Enabled = False
Me.AngleButton.Location = New System.Drawing.Point(529, 55)
Me.AngleButton.Margin = New System.Windows.Forms.Padding(2, 2, 2, 2)
Me.AngleButton.Name = "AngleButton"
Me.AngleButton.Size = New System.Drawing.Size(92, 28)
Me.AngleButton.TabIndex = 7
Me.AngleButton.Text = "Add Angle"
Me.AngleButton.UseVisualStyleBackColor = True
'
'SettingsButton
'
Me.SettingsButton.Location = New System.Drawing.Point(11, 709)
Me.SettingsButton.Margin = New System.Windows.Forms.Padding(2, 2, 2, 2)
Me.SettingsButton.Name = "SettingsButton"
Me.SettingsButton.Size = New System.Drawing.Size(60, 41)
Me.SettingsButton.TabIndex = 12
Me.SettingsButton.Text = "Settings"
Me.SettingsButton.UseVisualStyleBackColor = True
'
'ComboBox_TypeChooser
'
Me.ComboBox_TypeChooser.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
Me.ComboBox_TypeChooser.FormattingEnabled = True
Me.ComboBox_TypeChooser.Items.AddRange(New Object() {"Pressure Welded", "Type A"})
Me.ComboBox_TypeChooser.Location = New System.Drawing.Point(91, 46)
Me.ComboBox_TypeChooser.Margin = New System.Windows.Forms.Padding(2, 2, 2, 2)
Me.ComboBox_TypeChooser.Name = "ComboBox_TypeChooser"
Me.ComboBox_TypeChooser.Size = New System.Drawing.Size(141, 21)
Me.ComboBox_TypeChooser.TabIndex = 13
Me.ComboBox_TypeChooser.Tag = ""
'
'ComboBox_MeshSize
'
Me.ComboBox_MeshSize.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
Me.ComboBox_MeshSize.Enabled = False
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(91, 196)
Me.ComboBox_MeshSize.Margin = New System.Windows.Forms.Padding(2, 2, 2, 2)
Me.ComboBox_MeshSize.Name = "ComboBox_MeshSize"
Me.ComboBox_MeshSize.Size = New System.Drawing.Size(141, 21)
Me.ComboBox_MeshSize.TabIndex = 14
'
'ComboBox_Thickness
'
Me.ComboBox_Thickness.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
Me.ComboBox_Thickness.Enabled = False
Me.ComboBox_Thickness.FormattingEnabled = True
Me.ComboBox_Thickness.Items.AddRange(New Object() {"2", "3", "4"})
Me.ComboBox_Thickness.Location = New System.Drawing.Point(91, 305)
Me.ComboBox_Thickness.Margin = New System.Windows.Forms.Padding(2, 2, 2, 2)
Me.ComboBox_Thickness.Name = "ComboBox_Thickness"
Me.ComboBox_Thickness.Size = New System.Drawing.Size(141, 21)
Me.ComboBox_Thickness.TabIndex = 15
'
'ComboBox_Height
'
Me.ComboBox_Height.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
Me.ComboBox_Height.Enabled = False
Me.ComboBox_Height.FormattingEnabled = True
Me.ComboBox_Height.Items.AddRange(New Object() {"20", "25", "30"})
Me.ComboBox_Height.Location = New System.Drawing.Point(91, 264)
Me.ComboBox_Height.Margin = New System.Windows.Forms.Padding(2, 2, 2, 2)
Me.ComboBox_Height.Name = "ComboBox_Height"
Me.ComboBox_Height.Size = New System.Drawing.Size(141, 21)
Me.ComboBox_Height.TabIndex = 16
'
'Label3
'
Me.Label3.AutoSize = True
Me.Label3.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label3.Location = New System.Drawing.Point(46, 45)
Me.Label3.Name = "Label3"
Me.Label3.Size = New System.Drawing.Size(40, 17)
Me.Label3.TabIndex = 17
Me.Label3.Text = "Type"
'
'Label4
'
Me.Label4.AutoSize = True
Me.Label4.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label4.Location = New System.Drawing.Point(13, 197)
Me.Label4.Name = "Label4"
Me.Label4.Size = New System.Drawing.Size(73, 17)
Me.Label4.TabIndex = 18
Me.Label4.Text = "Mesh Size"
'
'Label5
'
Me.Label5.AutoSize = True
Me.Label5.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label5.Location = New System.Drawing.Point(14, 306)
Me.Label5.Name = "Label5"
Me.Label5.Size = New System.Drawing.Size(72, 17)
Me.Label5.TabIndex = 19
Me.Label5.Text = "Thickness"
'
'Label6
'
Me.Label6.AutoSize = True
Me.Label6.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label6.Location = New System.Drawing.Point(37, 264)
Me.Label6.Name = "Label6"
Me.Label6.Size = New System.Drawing.Size(49, 17)
Me.Label6.TabIndex = 20
Me.Label6.Text = "Height"
'
'Label7
'
Me.Label7.AutoSize = True
Me.Label7.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label7.Location = New System.Drawing.Point(394, 31)
Me.Label7.Name = "Label7"
Me.Label7.Size = New System.Drawing.Size(78, 17)
Me.Label7.TabIndex = 21
Me.Label7.Text = "Functions"
'
'ComboBox_Width
'
Me.ComboBox_Width.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
Me.ComboBox_Width.Enabled = False
Me.ComboBox_Width.FormattingEnabled = True
Me.ComboBox_Width.Items.AddRange(New Object() {"500", "700", "722", "1000"})
Me.ComboBox_Width.Location = New System.Drawing.Point(94, 400)
Me.ComboBox_Width.Margin = New System.Windows.Forms.Padding(2, 2, 2, 2)
Me.ComboBox_Width.Name = "ComboBox_Width"
Me.ComboBox_Width.Size = New System.Drawing.Size(141, 21)
Me.ComboBox_Width.TabIndex = 23
'
'Button_Square
'
Me.Button_Square.Enabled = False
Me.Button_Square.Location = New System.Drawing.Point(716, 55)
Me.Button_Square.Name = "Button_Square"
Me.Button_Square.Size = New System.Drawing.Size(92, 28)
Me.Button_Square.TabIndex = 25
Me.Button_Square.Text = "Add Square C"
Me.Button_Square.UseVisualStyleBackColor = True
'
'Label9
'
Me.Label9.AutoSize = True
Me.Label9.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label9.Location = New System.Drawing.Point(28, 9)
Me.Label9.Name = "Label9"
Me.Label9.Size = New System.Drawing.Size(146, 17)
Me.Label9.TabIndex = 26
Me.Label9.Text = "Floor gratings data"
'
'ComboBox_Material
'
Me.ComboBox_Material.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
Me.ComboBox_Material.Enabled = False
Me.ComboBox_Material.FormattingEnabled = True
Me.ComboBox_Material.Items.AddRange(New Object() {"12x100 (B9)", "25x50 (F4)", "34x37 (H3)"})
Me.ComboBox_Material.Location = New System.Drawing.Point(91, 88)
Me.ComboBox_Material.Margin = New System.Windows.Forms.Padding(2, 2, 2, 2)
Me.ComboBox_Material.Name = "ComboBox_Material"
Me.ComboBox_Material.Size = New System.Drawing.Size(141, 21)
Me.ComboBox_Material.TabIndex = 27
'
'Label_Material
'
Me.Label_Material.AutoSize = True
Me.Label_Material.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label_Material.Location = New System.Drawing.Point(28, 88)
Me.Label_Material.Name = "Label_Material"
Me.Label_Material.Size = New System.Drawing.Size(58, 17)
Me.Label_Material.TabIndex = 28
Me.Label_Material.Text = "Material"
'
'CheckBox_WholeMeshWidths
'
Me.CheckBox_WholeMeshWidths.AutoSize = True
Me.CheckBox_WholeMeshWidths.Enabled = False
Me.CheckBox_WholeMeshWidths.Location = New System.Drawing.Point(94, 368)
Me.CheckBox_WholeMeshWidths.Margin = New System.Windows.Forms.Padding(2, 2, 2, 2)
Me.CheckBox_WholeMeshWidths.Name = "CheckBox_WholeMeshWidths"
Me.CheckBox_WholeMeshWidths.Size = New System.Drawing.Size(121, 18)
Me.CheckBox_WholeMeshWidths.TabIndex = 29
Me.CheckBox_WholeMeshWidths.Text = "Whole mesh widths"
Me.CheckBox_WholeMeshWidths.UseCompatibleTextRendering = True
Me.CheckBox_WholeMeshWidths.UseVisualStyleBackColor = True
'
'TextBox_Length
'
Me.TextBox_Length.Enabled = False
Me.TextBox_Length.Location = New System.Drawing.Point(94, 460)
Me.TextBox_Length.Margin = New System.Windows.Forms.Padding(2, 2, 2, 2)
Me.TextBox_Length.Name = "TextBox_Length"
Me.TextBox_Length.Size = New System.Drawing.Size(141, 20)
Me.TextBox_Length.TabIndex = 30
'
'Button_SquareSide
'
Me.Button_SquareSide.Enabled = False
Me.Button_SquareSide.Location = New System.Drawing.Point(918, 55)
Me.Button_SquareSide.Margin = New System.Windows.Forms.Padding(2, 2, 2, 2)
Me.Button_SquareSide.Name = "Button_SquareSide"
Me.Button_SquareSide.Size = New System.Drawing.Size(91, 28)
Me.Button_SquareSide.TabIndex = 31
Me.Button_SquareSide.Text = "Square Side"
Me.Button_SquareSide.UseVisualStyleBackColor = True
'
'GUI
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(1546, 742)
Me.Controls.Add(Me.Button_SquareSide)
Me.Controls.Add(Me.TextBox_Length)
Me.Controls.Add(Me.AngleButton)
Me.Controls.Add(Me.Button_Square)
Me.Controls.Add(Me.Label7)
Me.Controls.Add(Me.CheckBox_WholeMeshWidths)
Me.Controls.Add(Me.ComboBox_Material)
Me.Controls.Add(Me.Label_Material)
Me.Controls.Add(Me.Label9)
Me.Controls.Add(Me.ComboBox_Width)
Me.Controls.Add(Me.ComboBox_MeshSize)
Me.Controls.Add(Me.ComboBox_TypeChooser)
Me.Controls.Add(Me.Label3)
Me.Controls.Add(Me.Label4)
Me.Controls.Add(Me.Label6)
Me.Controls.Add(Me.Label5)
Me.Controls.Add(Me.SettingsButton)
Me.Controls.Add(Me.ExportSWButton)
Me.Controls.Add(Me.ComboBox_Height)
Me.Controls.Add(Me.ComboBox_Thickness)
Me.Controls.Add(Me.Label2)
Me.Controls.Add(Me.Label1)
Me.Controls.Add(Me.DrawingPanel)
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle
Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)
Me.MaximizeBox = False
Me.Name = "GUI"
Me.Text = "Floor Gratings"
Me.DrawingPanel.ResumeLayout(False)
Me.DrawingPanel.PerformLayout()
Me.ResumeLayout(False)
Me.PerformLayout()
End Sub
Friend WithEvents DrawingPanel As Panel
Friend WithEvents ContextMenuStrip1 As ContextMenuStrip
Friend WithEvents Label1 As Label
Friend WithEvents Label2 As Label
Friend WithEvents ExportSWButton As Button
Friend WithEvents AngleButton 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
Friend WithEvents Label3 As Label
Friend WithEvents Label4 As Label
Friend WithEvents Label5 As Label
Friend WithEvents Label6 As Label
Friend WithEvents Label7 As Label
Friend WithEvents ComboBox_Width As ComboBox
Friend WithEvents Button_Square As Button
Friend WithEvents Label9 As Label
Friend WithEvents ComboBox_Material As ComboBox
Friend WithEvents Label_Material As Label
Friend WithEvents CheckBox_WholeMeshWidths As CheckBox
Friend WithEvents TextBox_Length As TextBox
Friend WithEvents Label10 As Label
Friend WithEvents Label8 As Label
Friend WithEvents Button_SquareSide As Button
End Class

File diff suppressed because it is too large Load Diff

View File

@ -1,144 +0,0 @@
Imports XCCLibrary
Public Class GUI
'Public Shared filepath As String = "C:\Users\Anton\Documents\Exjobb"
Public Shared filepath As String = "C:\Users\xperd\Documents"
' --- Start method (main) for GUI ---
Sub GUI_load() Handles MyBase.Load
' Initialize GUI
Init_Form()
' Initialize DataTables, Measurments and more
Data.Init_Data()
' Initialize DrawingPanel
Draw_Grating.Load_DrawingPanel()
' Get floor gratings database
Database.Retrive_Database()
' Load XCC settings
adminClass.loadSettings(Settings.filesFolder, Settings.HLCtFolder, "SolidWorks")
End Sub
' --- Initialize GUI (form) size and position ---
Private Sub Init_Form()
Me.Width = 1400
Me.Height = 800
Me.Top = 20
Me.Left = 50
End Sub
' ---------------------------------- GUI Templates ----------------------------------
' --- TextBox Template ---
Public Sub Create_TextBox(TextBoxName As String, TextBoxText As String, TextBoxLeft As Integer, TextBoxTop As Integer,
TextBoxWidth As Integer)
Dim textBoxTemp As New TextBox With {
.Name = TextBoxName,
.Text = TextBoxText,
.Left = TextBoxLeft,
.Top = TextBoxTop,
.Width = TextBoxWidth,
.Font = New Font("Microsoft Sans Serif", 10)
}
Me.Controls.Add(textBoxTemp)
End Sub
' --- Label Template for GUI ---
Public Sub Create_LabelGUI(LabelName As String, LabelText As String, LabelLeft As Integer, LabelTop As Integer)
Dim LabelTemp As New Label With {
.Name = LabelName,
.Text = LabelText,
.Left = LabelLeft,
.Top = LabelTop,
.Font = New Font("Microsoft Sans Serif", 10)
}
Me.Controls.Add(LabelTemp)
End Sub
' ---------------------------------- Gratings Data ----------------------------------
' --- When user changes grating type ---
Private Sub ComboBox_TypeChooser_TextChanged(sender As Object, e As EventArgs) Handles ComboBox_TypeChooser.TextChanged
User_Input.TypeChanged(sender, e)
End Sub
' --- When user changes grating material ---
Private Sub ComboBox_Material_TextChanged(sender As Object, e As EventArgs) Handles ComboBox_Material.TextChanged
User_Input.MaterialChanged(sender, e)
End Sub
' --- When user changes mesh size ---
Private Sub ComboBox_MeshSize_TextChanged(sender As Object, e As EventArgs) Handles ComboBox_MeshSize.TextChanged
User_Input.MeshChanged(sender, e)
End Sub
' --- When user changes grating height ---
Private Sub ComboBox_Height_TextChanged(sender As Object, e As EventArgs) Handles ComboBox_Height.TextChanged
User_Input.HeightChanged(sender, e)
End Sub
' --- When user changes grating thickness ---
Private Sub ComboBox_Thickness_TextChanged(sender As Object, e As EventArgs) Handles ComboBox_Thickness.TextChanged
User_Input.ThicknessChanged(sender, e)
End Sub
' --- When user checkes/uncheckes whole meshes ---
Private Sub CheckBox_WholeMeshWidths_CheckedChanged(sender As Object, e As EventArgs) _
Handles CheckBox_WholeMeshWidths.CheckedChanged
User_Input.WholeMeshWidthsChanged(sender, e)
End Sub
' --- Grating width changed ---
Private Sub WidthB_TextChanged(sender As Object, e As EventArgs) Handles ComboBox_Width.TextChanged
User_Input.WidthChanged(sender, e)
End Sub
' --- Check if width is a number ---
Private Sub ComboBox_Width_KeyPress(sender As Object, e As KeyPressEventArgs) Handles ComboBox_Width.KeyPress
User_Input.Check_IfNumber(e)
End Sub
' --- Grating length changed ---
Private Sub LengthBox_TextChanged(sender As Object, e As EventArgs) Handles TextBox_Length.TextChanged
User_Input.LengthChanged(sender, e)
End Sub
' --- Check if length is a number ---
Private Sub ComboBox_Length_KeyPress(sender As Object, e As KeyPressEventArgs) Handles TextBox_Length.KeyPress
User_Input.Check_IfNumber(e)
End Sub
' ---------------------------------- Functions ----------------------------------
' --- When angle button is pressed ---
Private Sub AngleButton_Click(sender As Object, e As EventArgs) Handles AngleButton.Click
Corner_Angle.AngleButton(sender, e)
End Sub
' --- When square corner button is pressed ---
Private Sub Button_Square_Click(sender As Object, e As EventArgs) Handles Button_Square.Click
Corner_Rectangle.SquareButtton(sender, e)
End Sub
' --- When square side button is pressed ---
Private Sub Button_SquareSide_Click(sender As Object, e As EventArgs) Handles Button_SquareSide.Click
Side_Rectangle.SquareSideButtton(sender, e)
End Sub
' ---------------------------------- Settings ----------------------------------
' --- Settings button clicked ---
Private Sub SettingsButton_Click(sender As Object, e As EventArgs) Handles SettingsButton.Click
Settings.ButtonClicked(sender, e)
End Sub
' ---------------------------------- Export to SW ----------------------------------
' --- When export to SW button is pressed ---
Private Sub ExportSWButton_Click(sender As Object, e As EventArgs) Handles ExportSWButton.Click
'Model_3D.BuildGrating()
Drawing.CreateDrawing()
End Sub
End Class

View File

@ -23,38 +23,46 @@ Partial Class Individual
<System.Diagnostics.DebuggerStepThrough()> _ <System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent() Private Sub InitializeComponent()
Me.Panel_Data = New System.Windows.Forms.Panel() Me.Panel_Data = New System.Windows.Forms.Panel()
Me.ComboBox_Type = New System.Windows.Forms.ComboBox() Me.CheckBox_Whole_Mesh = New System.Windows.Forms.CheckBox()
Me.ComboBox_Material = New System.Windows.Forms.ComboBox() Me.Button_Export_GUI = New System.Windows.Forms.Button()
Me.Button_Export_SW = New System.Windows.Forms.Button()
Me.Label_Heading = New System.Windows.Forms.Label()
Me.Label_Material = New System.Windows.Forms.Label()
Me.Label_Mesh = New System.Windows.Forms.Label()
Me.Label_Height = New System.Windows.Forms.Label()
Me.Label_Thickness = New System.Windows.Forms.Label()
Me.Label_Width = New System.Windows.Forms.Label()
Me.Label_Length = New System.Windows.Forms.Label()
Me.Label_Type = New System.Windows.Forms.Label()
Me.TextBox_Length = New System.Windows.Forms.TextBox()
Me.ComboBox_Mesh = New System.Windows.Forms.ComboBox()
Me.ComboBox_Width = New System.Windows.Forms.ComboBox()
Me.ComboBox_Thickness = New System.Windows.Forms.ComboBox() Me.ComboBox_Thickness = New System.Windows.Forms.ComboBox()
Me.ComboBox_Height = New System.Windows.Forms.ComboBox() Me.ComboBox_Height = New System.Windows.Forms.ComboBox()
Me.ComboBox_Width = New System.Windows.Forms.ComboBox() Me.ComboBox_Material = New System.Windows.Forms.ComboBox()
Me.ComboBox_Mesh = New System.Windows.Forms.ComboBox() Me.ComboBox_Type = New System.Windows.Forms.ComboBox()
Me.TextBox_Length = New System.Windows.Forms.TextBox() Me.Panel_Recesses = New System.Windows.Forms.Panel()
Me.Label_Type = New System.Windows.Forms.Label()
Me.Label_Length = New System.Windows.Forms.Label()
Me.Label_Width = New System.Windows.Forms.Label()
Me.Label_Thickness = New System.Windows.Forms.Label()
Me.Label_Height = New System.Windows.Forms.Label()
Me.Label_Mesh = New System.Windows.Forms.Label()
Me.Label_Material = New System.Windows.Forms.Label()
Me.Label_Heading = New System.Windows.Forms.Label()
Me.Panel1 = New System.Windows.Forms.Panel()
Me.Label_Recesses = New System.Windows.Forms.Label()
Me.Button_Angle_Corner = New System.Windows.Forms.Button()
Me.Button_Square_Corner = New System.Windows.Forms.Button()
Me.Button_Angle_Side = New System.Windows.Forms.Button()
Me.Button_Square_Side = New System.Windows.Forms.Button()
Me.Button_Square_Middle = New System.Windows.Forms.Button() Me.Button_Square_Middle = New System.Windows.Forms.Button()
Me.Panel2 = New System.Windows.Forms.Panel() Me.Button_Settings = New System.Windows.Forms.Button()
Me.Button_Square_Side = New System.Windows.Forms.Button()
Me.Button_Angle_Side = New System.Windows.Forms.Button()
Me.Button_Square_Corner = New System.Windows.Forms.Button()
Me.Button_Angle_Corner = New System.Windows.Forms.Button()
Me.Label_Recesses = New System.Windows.Forms.Label()
Me.Panel_Grating = New System.Windows.Forms.Panel()
Me.Label2 = New System.Windows.Forms.Label()
Me.Label1 = New System.Windows.Forms.Label()
Me.Panel_Data.SuspendLayout() Me.Panel_Data.SuspendLayout()
Me.Panel1.SuspendLayout() Me.Panel_Recesses.SuspendLayout()
Me.Panel_Grating.SuspendLayout()
Me.SuspendLayout() Me.SuspendLayout()
' '
'Panel_Data 'Panel_Data
' '
Me.Panel_Data.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles)
Me.Panel_Data.BackColor = System.Drawing.SystemColors.GradientActiveCaption Me.Panel_Data.BackColor = System.Drawing.SystemColors.GradientActiveCaption
Me.Panel_Data.Controls.Add(Me.CheckBox_Whole_Mesh)
Me.Panel_Data.Controls.Add(Me.Button_Export_GUI)
Me.Panel_Data.Controls.Add(Me.Button_Export_SW)
Me.Panel_Data.Controls.Add(Me.Label_Heading) Me.Panel_Data.Controls.Add(Me.Label_Heading)
Me.Panel_Data.Controls.Add(Me.Label_Material) Me.Panel_Data.Controls.Add(Me.Label_Material)
Me.Panel_Data.Controls.Add(Me.Label_Mesh) Me.Panel_Data.Controls.Add(Me.Label_Mesh)
@ -73,139 +81,36 @@ Partial Class Individual
Me.Panel_Data.Location = New System.Drawing.Point(0, 0) Me.Panel_Data.Location = New System.Drawing.Point(0, 0)
Me.Panel_Data.Margin = New System.Windows.Forms.Padding(0) Me.Panel_Data.Margin = New System.Windows.Forms.Padding(0)
Me.Panel_Data.Name = "Panel_Data" Me.Panel_Data.Name = "Panel_Data"
Me.Panel_Data.Size = New System.Drawing.Size(266, 800) Me.Panel_Data.Size = New System.Drawing.Size(290, 772)
Me.Panel_Data.TabIndex = 0 Me.Panel_Data.TabIndex = 0
' '
'ComboBox_Type 'CheckBox_Whole_Mesh
' '
Me.ComboBox_Type.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList Me.CheckBox_Whole_Mesh.AutoSize = True
Me.ComboBox_Type.FormattingEnabled = True Me.CheckBox_Whole_Mesh.Location = New System.Drawing.Point(110, 387)
Me.ComboBox_Type.Location = New System.Drawing.Point(110, 101) Me.CheckBox_Whole_Mesh.Name = "CheckBox_Whole_Mesh"
Me.ComboBox_Type.Name = "ComboBox_Type" Me.CheckBox_Whole_Mesh.Size = New System.Drawing.Size(122, 17)
Me.ComboBox_Type.Size = New System.Drawing.Size(121, 21) Me.CheckBox_Whole_Mesh.TabIndex = 19
Me.ComboBox_Type.TabIndex = 0 Me.CheckBox_Whole_Mesh.Text = "Whole Mesh Widths"
Me.CheckBox_Whole_Mesh.UseVisualStyleBackColor = True
' '
'ComboBox_Material 'Button_Export_GUI
' '
Me.ComboBox_Material.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList Me.Button_Export_GUI.Location = New System.Drawing.Point(35, 690)
Me.ComboBox_Material.FormattingEnabled = True Me.Button_Export_GUI.Name = "Button_Export_GUI"
Me.ComboBox_Material.Location = New System.Drawing.Point(110, 142) Me.Button_Export_GUI.Size = New System.Drawing.Size(75, 23)
Me.ComboBox_Material.Name = "ComboBox_Material" Me.Button_Export_GUI.TabIndex = 18
Me.ComboBox_Material.Size = New System.Drawing.Size(121, 21) Me.Button_Export_GUI.Text = "Export GUI"
Me.ComboBox_Material.TabIndex = 1 Me.Button_Export_GUI.UseVisualStyleBackColor = True
' '
'ComboBox_Thickness 'Button_Export_SW
' '
Me.ComboBox_Thickness.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList Me.Button_Export_SW.Location = New System.Drawing.Point(156, 690)
Me.ComboBox_Thickness.FormattingEnabled = True Me.Button_Export_SW.Name = "Button_Export_SW"
Me.ComboBox_Thickness.Location = New System.Drawing.Point(110, 323) Me.Button_Export_SW.Size = New System.Drawing.Size(75, 23)
Me.ComboBox_Thickness.Name = "ComboBox_Thickness" Me.Button_Export_SW.TabIndex = 17
Me.ComboBox_Thickness.Size = New System.Drawing.Size(121, 21) Me.Button_Export_SW.Text = "Export SW"
Me.ComboBox_Thickness.TabIndex = 3 Me.Button_Export_SW.UseVisualStyleBackColor = True
'
'ComboBox_Height
'
Me.ComboBox_Height.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
Me.ComboBox_Height.FormattingEnabled = True
Me.ComboBox_Height.Location = New System.Drawing.Point(110, 278)
Me.ComboBox_Height.Name = "ComboBox_Height"
Me.ComboBox_Height.Size = New System.Drawing.Size(121, 21)
Me.ComboBox_Height.TabIndex = 2
'
'ComboBox_Width
'
Me.ComboBox_Width.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
Me.ComboBox_Width.FormattingEnabled = True
Me.ComboBox_Width.Location = New System.Drawing.Point(110, 393)
Me.ComboBox_Width.Name = "ComboBox_Width"
Me.ComboBox_Width.Size = New System.Drawing.Size(121, 21)
Me.ComboBox_Width.TabIndex = 4
'
'ComboBox_Mesh
'
Me.ComboBox_Mesh.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
Me.ComboBox_Mesh.FormattingEnabled = True
Me.ComboBox_Mesh.Location = New System.Drawing.Point(110, 233)
Me.ComboBox_Mesh.Name = "ComboBox_Mesh"
Me.ComboBox_Mesh.Size = New System.Drawing.Size(121, 21)
Me.ComboBox_Mesh.TabIndex = 6
'
'TextBox_Length
'
Me.TextBox_Length.Location = New System.Drawing.Point(110, 433)
Me.TextBox_Length.Name = "TextBox_Length"
Me.TextBox_Length.Size = New System.Drawing.Size(121, 20)
Me.TextBox_Length.TabIndex = 7
'
'Label_Type
'
Me.Label_Type.AutoSize = True
Me.Label_Type.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label_Type.Location = New System.Drawing.Point(64, 101)
Me.Label_Type.Name = "Label_Type"
Me.Label_Type.Size = New System.Drawing.Size(40, 16)
Me.Label_Type.TabIndex = 8
Me.Label_Type.Text = "Type"
'
'Label_Length
'
Me.Label_Length.AutoSize = True
Me.Label_Length.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label_Length.Location = New System.Drawing.Point(52, 433)
Me.Label_Length.Name = "Label_Length"
Me.Label_Length.Size = New System.Drawing.Size(52, 17)
Me.Label_Length.TabIndex = 9
Me.Label_Length.Text = "Length"
'
'Label_Width
'
Me.Label_Width.AutoSize = True
Me.Label_Width.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label_Width.Location = New System.Drawing.Point(60, 393)
Me.Label_Width.Name = "Label_Width"
Me.Label_Width.Size = New System.Drawing.Size(44, 17)
Me.Label_Width.TabIndex = 10
Me.Label_Width.Text = "Width"
'
'Label_Thickness
'
Me.Label_Thickness.AutoSize = True
Me.Label_Thickness.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label_Thickness.Location = New System.Drawing.Point(32, 324)
Me.Label_Thickness.Name = "Label_Thickness"
Me.Label_Thickness.Size = New System.Drawing.Size(72, 17)
Me.Label_Thickness.TabIndex = 11
Me.Label_Thickness.Text = "Thickness"
'
'Label_Height
'
Me.Label_Height.AutoSize = True
Me.Label_Height.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label_Height.Location = New System.Drawing.Point(55, 279)
Me.Label_Height.Name = "Label_Height"
Me.Label_Height.Size = New System.Drawing.Size(49, 17)
Me.Label_Height.TabIndex = 12
Me.Label_Height.Text = "Height"
'
'Label_Mesh
'
Me.Label_Mesh.AutoSize = True
Me.Label_Mesh.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label_Mesh.Location = New System.Drawing.Point(31, 233)
Me.Label_Mesh.Name = "Label_Mesh"
Me.Label_Mesh.Size = New System.Drawing.Size(73, 17)
Me.Label_Mesh.TabIndex = 13
Me.Label_Mesh.Text = "Mesh Size"
'
'Label_Material
'
Me.Label_Material.AutoSize = True
Me.Label_Material.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label_Material.Location = New System.Drawing.Point(46, 143)
Me.Label_Material.Name = "Label_Material"
Me.Label_Material.Size = New System.Drawing.Size(58, 17)
Me.Label_Material.TabIndex = 14
Me.Label_Material.Text = "Material"
' '
'Label_Heading 'Label_Heading
' '
@ -217,21 +122,205 @@ Partial Class Individual
Me.Label_Heading.TabIndex = 15 Me.Label_Heading.TabIndex = 15
Me.Label_Heading.Text = "Grating Parameters" Me.Label_Heading.Text = "Grating Parameters"
' '
'Panel1 'Label_Material
' '
Me.Panel1.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _ Me.Label_Material.AutoSize = True
Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) Me.Label_Material.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Panel1.BackColor = System.Drawing.Color.Silver Me.Label_Material.Location = New System.Drawing.Point(46, 143)
Me.Panel1.Controls.Add(Me.Button_Square_Middle) Me.Label_Material.Name = "Label_Material"
Me.Panel1.Controls.Add(Me.Button_Square_Side) Me.Label_Material.Size = New System.Drawing.Size(58, 17)
Me.Panel1.Controls.Add(Me.Button_Angle_Side) Me.Label_Material.TabIndex = 14
Me.Panel1.Controls.Add(Me.Button_Square_Corner) Me.Label_Material.Text = "Material"
Me.Panel1.Controls.Add(Me.Button_Angle_Corner) '
Me.Panel1.Controls.Add(Me.Label_Recesses) 'Label_Mesh
Me.Panel1.Location = New System.Drawing.Point(0, 0) '
Me.Panel1.Name = "Panel1" Me.Label_Mesh.AutoSize = True
Me.Panel1.Size = New System.Drawing.Size(1357, 122) Me.Label_Mesh.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Panel1.TabIndex = 1 Me.Label_Mesh.Location = New System.Drawing.Point(31, 233)
Me.Label_Mesh.Name = "Label_Mesh"
Me.Label_Mesh.Size = New System.Drawing.Size(73, 17)
Me.Label_Mesh.TabIndex = 13
Me.Label_Mesh.Text = "Mesh Size"
'
'Label_Height
'
Me.Label_Height.AutoSize = True
Me.Label_Height.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label_Height.Location = New System.Drawing.Point(55, 279)
Me.Label_Height.Name = "Label_Height"
Me.Label_Height.Size = New System.Drawing.Size(49, 17)
Me.Label_Height.TabIndex = 12
Me.Label_Height.Text = "Height"
'
'Label_Thickness
'
Me.Label_Thickness.AutoSize = True
Me.Label_Thickness.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label_Thickness.Location = New System.Drawing.Point(32, 324)
Me.Label_Thickness.Name = "Label_Thickness"
Me.Label_Thickness.Size = New System.Drawing.Size(72, 17)
Me.Label_Thickness.TabIndex = 11
Me.Label_Thickness.Text = "Thickness"
'
'Label_Width
'
Me.Label_Width.AutoSize = True
Me.Label_Width.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label_Width.Location = New System.Drawing.Point(60, 418)
Me.Label_Width.Name = "Label_Width"
Me.Label_Width.Size = New System.Drawing.Size(44, 17)
Me.Label_Width.TabIndex = 10
Me.Label_Width.Text = "Width"
'
'Label_Length
'
Me.Label_Length.AutoSize = True
Me.Label_Length.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label_Length.Location = New System.Drawing.Point(52, 458)
Me.Label_Length.Name = "Label_Length"
Me.Label_Length.Size = New System.Drawing.Size(52, 17)
Me.Label_Length.TabIndex = 9
Me.Label_Length.Text = "Length"
'
'Label_Type
'
Me.Label_Type.AutoSize = True
Me.Label_Type.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label_Type.Location = New System.Drawing.Point(64, 101)
Me.Label_Type.Name = "Label_Type"
Me.Label_Type.Size = New System.Drawing.Size(40, 16)
Me.Label_Type.TabIndex = 8
Me.Label_Type.Text = "Type"
'
'TextBox_Length
'
Me.TextBox_Length.Location = New System.Drawing.Point(110, 458)
Me.TextBox_Length.Name = "TextBox_Length"
Me.TextBox_Length.Size = New System.Drawing.Size(146, 20)
Me.TextBox_Length.TabIndex = 7
'
'ComboBox_Mesh
'
Me.ComboBox_Mesh.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
Me.ComboBox_Mesh.FormattingEnabled = True
Me.ComboBox_Mesh.Location = New System.Drawing.Point(110, 233)
Me.ComboBox_Mesh.Name = "ComboBox_Mesh"
Me.ComboBox_Mesh.Size = New System.Drawing.Size(146, 21)
Me.ComboBox_Mesh.TabIndex = 6
'
'ComboBox_Width
'
Me.ComboBox_Width.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
Me.ComboBox_Width.FormattingEnabled = True
Me.ComboBox_Width.Location = New System.Drawing.Point(110, 418)
Me.ComboBox_Width.Name = "ComboBox_Width"
Me.ComboBox_Width.Size = New System.Drawing.Size(146, 21)
Me.ComboBox_Width.TabIndex = 4
'
'ComboBox_Thickness
'
Me.ComboBox_Thickness.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
Me.ComboBox_Thickness.FormattingEnabled = True
Me.ComboBox_Thickness.Location = New System.Drawing.Point(110, 323)
Me.ComboBox_Thickness.Name = "ComboBox_Thickness"
Me.ComboBox_Thickness.Size = New System.Drawing.Size(146, 21)
Me.ComboBox_Thickness.TabIndex = 3
'
'ComboBox_Height
'
Me.ComboBox_Height.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
Me.ComboBox_Height.FormattingEnabled = True
Me.ComboBox_Height.Location = New System.Drawing.Point(110, 278)
Me.ComboBox_Height.Name = "ComboBox_Height"
Me.ComboBox_Height.Size = New System.Drawing.Size(146, 21)
Me.ComboBox_Height.TabIndex = 2
'
'ComboBox_Material
'
Me.ComboBox_Material.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
Me.ComboBox_Material.FormattingEnabled = True
Me.ComboBox_Material.Location = New System.Drawing.Point(110, 142)
Me.ComboBox_Material.Name = "ComboBox_Material"
Me.ComboBox_Material.Size = New System.Drawing.Size(146, 21)
Me.ComboBox_Material.TabIndex = 1
'
'ComboBox_Type
'
Me.ComboBox_Type.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
Me.ComboBox_Type.FormattingEnabled = True
Me.ComboBox_Type.Location = New System.Drawing.Point(110, 101)
Me.ComboBox_Type.Name = "ComboBox_Type"
Me.ComboBox_Type.Size = New System.Drawing.Size(146, 21)
Me.ComboBox_Type.TabIndex = 0
'
'Panel_Recesses
'
Me.Panel_Recesses.BackColor = System.Drawing.Color.Silver
Me.Panel_Recesses.Controls.Add(Me.Button_Square_Middle)
Me.Panel_Recesses.Controls.Add(Me.Button_Settings)
Me.Panel_Recesses.Controls.Add(Me.Button_Square_Side)
Me.Panel_Recesses.Controls.Add(Me.Button_Angle_Side)
Me.Panel_Recesses.Controls.Add(Me.Button_Square_Corner)
Me.Panel_Recesses.Controls.Add(Me.Button_Angle_Corner)
Me.Panel_Recesses.Controls.Add(Me.Label_Recesses)
Me.Panel_Recesses.Location = New System.Drawing.Point(0, 0)
Me.Panel_Recesses.Name = "Panel_Recesses"
Me.Panel_Recesses.Size = New System.Drawing.Size(1395, 120)
Me.Panel_Recesses.TabIndex = 1
'
'Button_Square_Middle
'
Me.Button_Square_Middle.Location = New System.Drawing.Point(901, 25)
Me.Button_Square_Middle.Name = "Button_Square_Middle"
Me.Button_Square_Middle.Size = New System.Drawing.Size(70, 70)
Me.Button_Square_Middle.TabIndex = 21
Me.Button_Square_Middle.Text = "Square Middle"
Me.Button_Square_Middle.UseVisualStyleBackColor = True
'
'Button_Settings
'
Me.Button_Settings.Location = New System.Drawing.Point(1255, 3)
Me.Button_Settings.Name = "Button_Settings"
Me.Button_Settings.Size = New System.Drawing.Size(75, 23)
Me.Button_Settings.TabIndex = 16
Me.Button_Settings.Text = "Settings"
Me.Button_Settings.UseVisualStyleBackColor = True
'
'Button_Square_Side
'
Me.Button_Square_Side.Location = New System.Drawing.Point(796, 25)
Me.Button_Square_Side.Name = "Button_Square_Side"
Me.Button_Square_Side.Size = New System.Drawing.Size(70, 70)
Me.Button_Square_Side.TabIndex = 20
Me.Button_Square_Side.Text = "Square Side"
Me.Button_Square_Side.UseVisualStyleBackColor = True
'
'Button_Angle_Side
'
Me.Button_Angle_Side.Location = New System.Drawing.Point(586, 25)
Me.Button_Angle_Side.Name = "Button_Angle_Side"
Me.Button_Angle_Side.Size = New System.Drawing.Size(70, 70)
Me.Button_Angle_Side.TabIndex = 19
Me.Button_Angle_Side.Text = "Angle Side"
Me.Button_Angle_Side.UseVisualStyleBackColor = True
'
'Button_Square_Corner
'
Me.Button_Square_Corner.Location = New System.Drawing.Point(691, 25)
Me.Button_Square_Corner.Name = "Button_Square_Corner"
Me.Button_Square_Corner.Size = New System.Drawing.Size(70, 70)
Me.Button_Square_Corner.TabIndex = 18
Me.Button_Square_Corner.Text = "Square Corner"
Me.Button_Square_Corner.UseVisualStyleBackColor = True
'
'Button_Angle_Corner
'
Me.Button_Angle_Corner.Location = New System.Drawing.Point(481, 25)
Me.Button_Angle_Corner.Name = "Button_Angle_Corner"
Me.Button_Angle_Corner.Size = New System.Drawing.Size(70, 70)
Me.Button_Angle_Corner.TabIndex = 17
Me.Button_Angle_Corner.Text = "Angle Corner"
Me.Button_Angle_Corner.UseVisualStyleBackColor = True
' '
'Label_Recesses 'Label_Recesses
' '
@ -243,78 +332,54 @@ Partial Class Individual
Me.Label_Recesses.TabIndex = 16 Me.Label_Recesses.TabIndex = 16
Me.Label_Recesses.Text = "Recesses" Me.Label_Recesses.Text = "Recesses"
' '
'Button_Angle_Corner 'Panel_Grating
' '
Me.Button_Angle_Corner.Location = New System.Drawing.Point(481, 36) Me.Panel_Grating.BackColor = System.Drawing.Color.White
Me.Button_Angle_Corner.Name = "Button_Angle_Corner" Me.Panel_Grating.Controls.Add(Me.Label2)
Me.Button_Angle_Corner.Size = New System.Drawing.Size(50, 50) Me.Panel_Grating.Controls.Add(Me.Label1)
Me.Button_Angle_Corner.TabIndex = 17 Me.Panel_Grating.Location = New System.Drawing.Point(290, 120)
Me.Button_Angle_Corner.Text = "Angle Corner" Me.Panel_Grating.Name = "Panel_Grating"
Me.Button_Angle_Corner.UseVisualStyleBackColor = True Me.Panel_Grating.Size = New System.Drawing.Size(1105, 652)
Me.Panel_Grating.TabIndex = 2
' '
'Button_Square_Corner 'Label2
' '
Me.Button_Square_Corner.Location = New System.Drawing.Point(839, 36) Me.Label2.AutoSize = True
Me.Button_Square_Corner.Name = "Button_Square_Corner" Me.Label2.Font = New System.Drawing.Font("Microsoft Sans Serif", 7.8!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Button_Square_Corner.Size = New System.Drawing.Size(50, 50) Me.Label2.Location = New System.Drawing.Point(64, 625)
Me.Button_Square_Corner.TabIndex = 18 Me.Label2.Name = "Label2"
Me.Button_Square_Corner.Text = "Square Corner" Me.Label2.Size = New System.Drawing.Size(13, 13)
Me.Button_Square_Corner.UseVisualStyleBackColor = True Me.Label2.TabIndex = 1
Me.Label2.Text = "L"
' '
'Button_Angle_Side 'Label1
' '
Me.Button_Angle_Side.Location = New System.Drawing.Point(660, 36) Me.Label1.AutoSize = True
Me.Button_Angle_Side.Name = "Button_Angle_Side" Me.Label1.Font = New System.Drawing.Font("Microsoft Sans Serif", 7.8!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Button_Angle_Side.Size = New System.Drawing.Size(50, 50) Me.Label1.Location = New System.Drawing.Point(13, 575)
Me.Button_Angle_Side.TabIndex = 19 Me.Label1.Name = "Label1"
Me.Button_Angle_Side.Text = "Angle Side" Me.Label1.Size = New System.Drawing.Size(18, 13)
Me.Button_Angle_Side.UseVisualStyleBackColor = True Me.Label1.TabIndex = 0
' Me.Label1.Text = "W"
'Button_Square_Side
'
Me.Button_Square_Side.Location = New System.Drawing.Point(1018, 36)
Me.Button_Square_Side.Name = "Button_Square_Side"
Me.Button_Square_Side.Size = New System.Drawing.Size(50, 50)
Me.Button_Square_Side.TabIndex = 20
Me.Button_Square_Side.Text = "Square Side"
Me.Button_Square_Side.UseVisualStyleBackColor = True
'
'Button_Square_Middle
'
Me.Button_Square_Middle.Location = New System.Drawing.Point(1197, 36)
Me.Button_Square_Middle.Name = "Button_Square_Middle"
Me.Button_Square_Middle.Size = New System.Drawing.Size(50, 50)
Me.Button_Square_Middle.TabIndex = 21
Me.Button_Square_Middle.Text = "Square Middle"
Me.Button_Square_Middle.UseVisualStyleBackColor = True
'
'Panel2
'
Me.Panel2.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
Or System.Windows.Forms.AnchorStyles.Left) _
Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.Panel2.BackColor = System.Drawing.Color.White
Me.Panel2.Location = New System.Drawing.Point(262, 121)
Me.Panel2.Name = "Panel2"
Me.Panel2.Size = New System.Drawing.Size(1081, 613)
Me.Panel2.TabIndex = 2
' '
'Individual 'Individual
' '
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.BackColor = System.Drawing.SystemColors.Control Me.BackColor = System.Drawing.SystemColors.Control
Me.ClientSize = New System.Drawing.Size(1342, 733) Me.ClientSize = New System.Drawing.Size(1395, 772)
Me.Controls.Add(Me.Panel_Data) Me.Controls.Add(Me.Panel_Data)
Me.Controls.Add(Me.Panel1) Me.Controls.Add(Me.Panel_Recesses)
Me.Controls.Add(Me.Panel2) Me.Controls.Add(Me.Panel_Grating)
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None
Me.Name = "Individual" Me.Name = "Individual"
Me.Text = "Individual" Me.Text = "Individual"
Me.Panel_Data.ResumeLayout(False) Me.Panel_Data.ResumeLayout(False)
Me.Panel_Data.PerformLayout() Me.Panel_Data.PerformLayout()
Me.Panel1.ResumeLayout(False) Me.Panel_Recesses.ResumeLayout(False)
Me.Panel1.PerformLayout() Me.Panel_Recesses.PerformLayout()
Me.Panel_Grating.ResumeLayout(False)
Me.Panel_Grating.PerformLayout()
Me.ResumeLayout(False) Me.ResumeLayout(False)
End Sub End Sub
@ -335,12 +400,18 @@ Partial Class Individual
Friend WithEvents Label_Thickness As Label Friend WithEvents Label_Thickness As Label
Friend WithEvents Label_Width As Label Friend WithEvents Label_Width As Label
Friend WithEvents Label_Length As Label Friend WithEvents Label_Length As Label
Friend WithEvents Panel1 As Panel Friend WithEvents Panel_Recesses As Panel
Friend WithEvents Button_Square_Middle As Button Friend WithEvents Button_Square_Middle As Button
Friend WithEvents Button_Square_Side As Button Friend WithEvents Button_Square_Side As Button
Friend WithEvents Button_Angle_Side As Button Friend WithEvents Button_Angle_Side As Button
Friend WithEvents Button_Square_Corner As Button Friend WithEvents Button_Square_Corner As Button
Friend WithEvents Button_Angle_Corner As Button Friend WithEvents Button_Angle_Corner As Button
Friend WithEvents Label_Recesses As Label Friend WithEvents Label_Recesses As Label
Friend WithEvents Panel2 As Panel Friend WithEvents Panel_Grating As Panel
Friend WithEvents Button_Export_GUI As Button
Friend WithEvents Button_Export_SW As Button
Friend WithEvents Button_Settings As Button
Friend WithEvents CheckBox_Whole_Mesh As CheckBox
Friend WithEvents Label2 As Label
Friend WithEvents Label1 As Label
End Class End Class

View File

@ -1,9 +1,159 @@
Public Class Individual Imports XCCLibrary
Private Sub TextBox1_TextChanged(sender As Object, e As EventArgs) Handles TextBox_Length.TextChanged Public Class Individual
'Public Shared filepath As String = "C:\Users\Anton\Documents\Exjobb"
Public Shared filepath As String = "C:\Users\xperd\Documents"
' --- Start method (main) for GUI ---
Sub Individual_load() Handles MyBase.Load
' Initialize GUI
Init_Form()
' Initialize DataTables, Measurments and more
Data.Init_Data()
' Initialize DrawingPanel
Draw_Grating.Load_DrawingPanel()
' Load XCC settings
adminClass.loadSettings(Settings.filesFolder, Settings.HLCtFolder, "SolidWorks")
End Sub End Sub
Private Sub Label1_Click(sender As Object, e As EventArgs) Handles Label_Type.Click ' --- Initialize GUI (form) size and position ---
Private Sub Init_Form()
Me.Width = AppForm.Width
Me.Height = AppForm.Height
ComboBox_Type.Items.Add("Pressure Welded")
ComboBox_Type.Items.Add("Type A")
End Sub
' ---------------------------------- Individual Templates ----------------------------------
' --- TextBox Template ---
Public Sub Create_TextBox_Recesses(TextBoxName As String, TextBoxText As String, TextBoxLeft As Integer, TextBoxTop As Integer,
TextBoxWidth As Integer)
Dim textBoxTemp As New TextBox With {
.Name = TextBoxName,
.Text = TextBoxText,
.Left = TextBoxLeft,
.Top = TextBoxTop,
.Width = TextBoxWidth,
.Font = New Font("Microsoft Sans Serif", 10)
}
Me.Panel_Recesses.Controls.Add(textBoxTemp)
End Sub
' --- Label Template for Individual ---
Public Sub Create_Label_Recesses(LabelName As String, LabelText As String, LabelLeft As Integer, LabelTop As Integer)
Dim LabelTemp As New Label With {
.Name = LabelName,
.Text = LabelText,
.Left = LabelLeft,
.Top = LabelTop,
.Font = New Font("Microsoft Sans Serif", 10)
}
Me.Panel_Recesses.Controls.Add(LabelTemp)
End Sub
' ---------------------------------- Gratings Data ----------------------------------
' --- When user changes grating type ---
Private Sub ComboBox_Type_TextChanged(sender As Object, e As EventArgs) Handles ComboBox_Type.TextChanged
User_Input.TypeChanged(sender, e)
End Sub
' --- When user changes grating material ---
Private Sub ComboBox_Material_TextChanged(sender As Object, e As EventArgs) Handles ComboBox_Material.TextChanged
User_Input.MaterialChanged(sender, e)
End Sub
' --- When user changes mesh size ---
Private Sub ComboBox_Mesh_TextChanged(sender As Object, e As EventArgs) Handles ComboBox_Mesh.TextChanged
User_Input.MeshChanged(sender, e)
End Sub
' --- When user changes grating height ---
Private Sub ComboBox_Height_TextChanged(sender As Object, e As EventArgs) Handles ComboBox_Height.TextChanged
User_Input.HeightChanged(sender, e)
End Sub
' --- When user changes grating thickness ---
Private Sub ComboBox_Thickness_TextChanged(sender As Object, e As EventArgs) Handles ComboBox_Thickness.TextChanged
User_Input.ThicknessChanged(sender, e)
End Sub
' --- When user checkes/uncheckes whole meshes ---
Private Sub CheckBox_Whole_Mesh_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox_Whole_Mesh.CheckedChanged
User_Input.WholeMeshWidthsChanged(sender, e)
End Sub
' --- Grating width changed ---
Private Sub WidthB_TextChanged(sender As Object, e As EventArgs) Handles ComboBox_Width.TextChanged
User_Input.WidthChanged(sender, e)
End Sub
' --- Check if width is a number ---
Private Sub ComboBox_Width_KeyPress(sender As Object, e As KeyPressEventArgs) Handles ComboBox_Width.KeyPress
User_Input.Check_IfNumber(e)
End Sub
' --- Grating length changed ---
Private Sub LengthBox_TextChanged(sender As Object, e As EventArgs) Handles TextBox_Length.TextChanged
User_Input.LengthChanged(sender, e)
End Sub
' --- Check if length is a number ---
Private Sub ComboBox_Length_KeyPress(sender As Object, e As KeyPressEventArgs) Handles TextBox_Length.KeyPress
User_Input.Check_IfNumber(e)
End Sub
' ---------------------------------- Functions ----------------------------------
' --- When angle button is pressed ---
Private Sub Button_Angle_Corner_Click(sender As Object, e As EventArgs) Handles Button_Angle_Corner.Click
Corner_Angle.AngleButton(sender, e)
End Sub
' --- When angle side button is pressed ---
Private Sub Button_Angle_Side_Click(sender As Object, e As EventArgs) Handles Button_Angle_Side.Click
End Sub End Sub
' --- When square corner button is pressed ---
Private Sub Button_Square_Corner_Click(sender As Object, e As EventArgs) Handles Button_Square_Corner.Click
Corner_Rectangle.SquareButtton(sender, e)
End Sub
' --- When square side button is pressed ---
Private Sub Button_Square_Side_Click(sender As Object, e As EventArgs) Handles Button_Square_Side.Click
Side_Rectangle.SquareSideButtton(sender, e)
End Sub
' --- When middle square button is pressed ---
Private Sub Button_Square_Middle_Click(sender As Object, e As EventArgs) Handles Button_Square_Middle.Click
End Sub
' ---------------------------------- Settings ----------------------------------
' --- Settings button clicked ---
Private Sub Button_Settings_Click(sender As Object, e As EventArgs) Handles Button_Settings.Click
Settings.ButtonClicked(sender, e)
End Sub
' ---------------------------------- Export to SW ----------------------------------
' --- When export to SW button is pressed ---
Private Sub Button_Export_SW_Click(sender As Object, e As EventArgs) Handles Button_Export_SW.Click
'Model_3D.BuildGrating()
Drawing.CreateDrawing()
End Sub
' ---------------------------------- Export GUI ----------------------------------
' --- When export GUI button is pressed ---
Private Sub Button_Export_GUI_Click(sender As Object, e As EventArgs) Handles Button_Export_GUI.Click
End Sub
End Class End Class

View File

@ -1,7 +1,7 @@
Imports XCCLibrary Imports XCCLibrary
Public Class Settings Public Class Settings
Public Shared filesFolder As String = GUI.filepath ' Hämta från settings Public Shared filesFolder As String = Individual.filepath ' Hämta från settings
Public Shared HLCtFolder As String = GUI.filepath & "\X2021" ' Hämta från settings Public Shared HLCtFolder As String = Individual.filepath & "\X2021" ' Hämta från settings
' --- Settings button clicked --- ' --- Settings button clicked ---
Public Shared Sub ButtonClicked(sender As Object, e As EventArgs) Public Shared Sub ButtonClicked(sender As Object, e As EventArgs)

View File

@ -42,7 +42,7 @@
angleRecessPoints.Columns.Add("GUI X", GetType(Integer)) angleRecessPoints.Columns.Add("GUI X", GetType(Integer))
angleRecessPoints.Columns.Add("GUI Y", GetType(Integer)) angleRecessPoints.Columns.Add("GUI Y", GetType(Integer))
GUI.CheckBox_WholeMeshWidths.Checked = True Individual.CheckBox_Whole_Mesh.Checked = True
pointsMeasurements.Add("Lmes", {1, 2, 1}) pointsMeasurements.Add("Lmes", {1, 2, 1})
pointsMeasurements.Add("Wmes", {2, 3, 2}) pointsMeasurements.Add("Wmes", {2, 3, 2})

View File

@ -12,16 +12,16 @@
Public Shared Sub TypeChanged(sender As Object, e As EventArgs) Public Shared Sub TypeChanged(sender As Object, e As EventArgs)
GUI.ComboBox_Material.Enabled = True Individual.ComboBox_Material.Enabled = True
GUI.ComboBox_Material.Items.Clear() Individual.ComboBox_Material.Items.Clear()
gratingType = GUI.ComboBox_TypeChooser.Text gratingType = Individual.ComboBox_Type.Text
Dim materialDT As DataTable = Database.database.Tables("Material") Dim materialDT As DataTable = Database.database.Tables("Material")
Dim typeInDT As String = materialDT.Rows(0)("TYPE") Dim typeInDT As String = materialDT.Rows(0)("TYPE")
For i = 0 To materialDT.Rows.Count - 1 For i = 0 To materialDT.Rows.Count - 1
If gratingType = typeInDT Then If gratingType = typeInDT Then
GUI.ComboBox_Material.Items.Add(materialDT.Rows(i)("MATERIAL")) Individual.ComboBox_Material.Items.Add(materialDT.Rows(i)("MATERIAL"))
End If End If
Try Try
typeInDT = materialDT.Rows(i + 1)("TYPE") typeInDT = materialDT.Rows(i + 1)("TYPE")
@ -29,12 +29,12 @@
End Try End Try
Next Next
GUI.ComboBox_Material.Text = GUI.ComboBox_Material.Items(0) Individual.ComboBox_Material.Text = Individual.ComboBox_Material.Items(0)
End Sub End Sub
Public Shared Sub MaterialChanged(sender As Object, e As EventArgs) Public Shared Sub MaterialChanged(sender As Object, e As EventArgs)
GUI.ComboBox_MeshSize.Enabled = True Individual.ComboBox_Mesh.Enabled = True
gratingMaterial = GUI.ComboBox_Material.Text gratingMaterial = Individual.ComboBox_Material.Text
Dim serratedDT As DataTable = Database.database.Tables("Serrated") Dim serratedDT As DataTable = Database.database.Tables("Serrated")
@ -47,10 +47,10 @@
If gratingMaterial = materialInDT AndAlso gratingType = typeInDT Then If gratingMaterial = materialInDT AndAlso gratingType = typeInDT Then
serratedCheckBox.Name = "CheckBox_Serrated" serratedCheckBox.Name = "CheckBox_Serrated"
serratedCheckBox.Text = "Serrated" serratedCheckBox.Text = "Serrated"
serratedCheckBox.Left = 115 serratedCheckBox.Left = Individual.ComboBox_Material.Left
serratedCheckBox.Top = 115 serratedCheckBox.Top = Individual.ComboBox_Material.Top + 25
AddHandler serratedCheckBox.CheckedChanged, AddressOf CheckBox_Serrated_CheckedChanged AddHandler serratedCheckBox.CheckedChanged, AddressOf CheckBox_Serrated_CheckedChanged
GUI.Controls.Add(serratedCheckBox) Individual.Panel_Data.Controls.Add(serratedCheckBox)
serratedCheckBoxBol = True serratedCheckBoxBol = True
Exit For Exit For
End If End If
@ -74,7 +74,7 @@
Next Next
If serratedCheckBoxBol = True AndAlso removeCheckBox = True Then If serratedCheckBoxBol = True AndAlso removeCheckBox = True Then
RemoveHandler serratedCheckBox.CheckedChanged, AddressOf CheckBox_Serrated_CheckedChanged RemoveHandler serratedCheckBox.CheckedChanged, AddressOf CheckBox_Serrated_CheckedChanged
GUI.Controls.RemoveByKey("CheckBox_Serrated") Individual.Panel_Data.Controls.RemoveByKey("CheckBox_Serrated")
serratedCheckBoxBol = False serratedCheckBoxBol = False
gratingSerrated = False gratingSerrated = False
End If End If
@ -86,16 +86,16 @@
lacqueredCheckBox.Name = "CheckBox_Lacquered" lacqueredCheckBox.Name = "CheckBox_Lacquered"
lacqueredCheckBox.Text = "Lacquered" lacqueredCheckBox.Text = "Lacquered"
lacqueredCheckBox.Left = 115 lacqueredCheckBox.Left = Individual.ComboBox_Material.Left
lacqueredCheckBox.Top = 135 lacqueredCheckBox.Top = Individual.ComboBox_Material.Top + 50
AddHandler lacqueredCheckBox.CheckedChanged, AddressOf CheckBox_Lacquered_CheckedChanged AddHandler lacqueredCheckBox.CheckedChanged, AddressOf CheckBox_Lacquered_CheckedChanged
GUI.Controls.Add(lacqueredCheckBox) Individual.Panel_Data.Controls.Add(lacqueredCheckBox)
lacqueredCheckBoxBol = True lacqueredCheckBoxBol = True
ElseIf lacqueredCheckBoxBol = True AndAlso gratingMaterial <> "Hot dip galvanized steel" _ ElseIf lacqueredCheckBoxBol = True AndAlso gratingMaterial <> "Hot dip galvanized steel" _
AndAlso gratingMaterial <> "Untreated" Then AndAlso gratingMaterial <> "Untreated" Then
RemoveHandler lacqueredCheckBox.CheckedChanged, AddressOf CheckBox_Lacquered_CheckedChanged RemoveHandler lacqueredCheckBox.CheckedChanged, AddressOf CheckBox_Lacquered_CheckedChanged
GUI.Controls.RemoveByKey("CheckBox_Lacquered") Individual.Panel_Data.Controls.RemoveByKey("CheckBox_Lacquered")
lacqueredCheckBoxBol = False lacqueredCheckBoxBol = False
gratingLacquered = False gratingLacquered = False
End If End If
@ -125,12 +125,12 @@
End Sub End Sub
Private Shared Sub Update_AvalaibleMeshes() Private Shared Sub Update_AvalaibleMeshes()
GUI.ComboBox_Height.Items.Clear() Individual.ComboBox_Height.Items.Clear()
GUI.ComboBox_Height.Enabled = False Individual.ComboBox_Height.Enabled = False
GUI.ComboBox_Thickness.Items.Clear() Individual.ComboBox_Thickness.Items.Clear()
GUI.ComboBox_Thickness.Enabled = False Individual.ComboBox_Thickness.Enabled = False
GUI.ComboBox_MeshSize.Items.Clear() Individual.ComboBox_Mesh.Items.Clear()
Dim meshesDT As DataTable = Database.database.Tables("Meshes") Dim meshesDT As DataTable = Database.database.Tables("Meshes")
@ -144,14 +144,14 @@
" (" & meshesDT.Rows(i)("NAME") & ")" " (" & meshesDT.Rows(i)("NAME") & ")"
Dim addItem As Boolean = True Dim addItem As Boolean = True
For j = 0 To GUI.ComboBox_MeshSize.Items.Count - 1 For j = 0 To Individual.ComboBox_Mesh.Items.Count - 1
If item = GUI.ComboBox_MeshSize.Items(j) Then If item = Individual.ComboBox_Mesh.Items(j) Then
addItem = False addItem = False
Exit For Exit For
End If End If
Next Next
If addItem = True Then If addItem = True Then
GUI.ComboBox_MeshSize.Items.Add(item) Individual.ComboBox_Mesh.Items.Add(item)
End If End If
End If End If
Try Try
@ -162,18 +162,18 @@
End Try End Try
Next Next
If GUI.ComboBox_MeshSize.Items.Count = 0 Then If Individual.ComboBox_Mesh.Items.Count = 0 Then
GUI.ComboBox_MeshSize.Items.Add("") Individual.ComboBox_Mesh.Items.Add("")
End If End If
End Sub End Sub
Public Shared Sub MeshChanged(sender As Object, e As EventArgs) Public Shared Sub MeshChanged(sender As Object, e As EventArgs)
GUI.ComboBox_Thickness.Items.Clear() Individual.ComboBox_Thickness.Items.Clear()
GUI.ComboBox_Thickness.Enabled = False Individual.ComboBox_Thickness.Enabled = False
GUI.ComboBox_Height.Enabled = True Individual.ComboBox_Height.Enabled = True
GUI.ComboBox_Height.Items.Clear() Individual.ComboBox_Height.Items.Clear()
gratingMesh = GUI.ComboBox_MeshSize.Text gratingMesh = Individual.ComboBox_Mesh.Text
loadBarSpacing = CInt(gratingMesh.Split("x")(0)) loadBarSpacing = CInt(gratingMesh.Split("x")(0))
crossBarSpacing = CInt(gratingMesh.Split("x")(1).Split(" ")(0)) crossBarSpacing = CInt(gratingMesh.Split("x")(1).Split(" ")(0))
gratingName = gratingMesh.Split("(")(1).Split(")")(0) gratingName = gratingMesh.Split("(")(1).Split(")")(0)
@ -217,14 +217,14 @@
tempList.Sort() tempList.Sort()
For i = 0 To tempList.Count - 1 For i = 0 To tempList.Count - 1
GUI.ComboBox_Height.Items.Add(tempList(i)) Individual.ComboBox_Height.Items.Add(tempList(i))
Next Next
End Sub End Sub
Public Shared Sub HeightChanged(sender As Object, e As EventArgs) Public Shared Sub HeightChanged(sender As Object, e As EventArgs)
GUI.ComboBox_Thickness.Enabled = True Individual.ComboBox_Thickness.Enabled = True
GUI.ComboBox_Thickness.Items.Clear() Individual.ComboBox_Thickness.Items.Clear()
gratingHeight = CInt(GUI.ComboBox_Height.Text) gratingHeight = CInt(Individual.ComboBox_Height.Text)
Dim meshesDT As DataTable = Database.database.Tables("Meshes") Dim meshesDT As DataTable = Database.database.Tables("Meshes")
@ -267,27 +267,27 @@
tempList.Sort() tempList.Sort()
For i = 0 To tempList.Count - 1 For i = 0 To tempList.Count - 1
GUI.ComboBox_Thickness.Items.Add(tempList(i)) Individual.ComboBox_Thickness.Items.Add(tempList(i))
Next Next
End Sub End Sub
Public Shared Sub WholeMeshWidthsChanged(sender As Object, e As EventArgs) Public Shared Sub WholeMeshWidthsChanged(sender As Object, e As EventArgs)
If sender.Checked Then If sender.Checked Then
GUI.ComboBox_Width.DropDownStyle = ComboBoxStyle.DropDownList Individual.ComboBox_Width.DropDownStyle = ComboBoxStyle.DropDownList
Else Else
GUI.ComboBox_Width.DropDownStyle = ComboBoxStyle.DropDown Individual.ComboBox_Width.DropDownStyle = ComboBoxStyle.DropDown
End If End If
End Sub End Sub
Public Shared Sub ThicknessChanged(sender As Object, e As EventArgs) Public Shared Sub ThicknessChanged(sender As Object, e As EventArgs)
GUI.ComboBox_Width.Enabled = True Individual.ComboBox_Width.Enabled = True
GUI.ComboBox_Width.Items.Clear() Individual.ComboBox_Width.Items.Clear()
GUI.TextBox_Length.Text = 1000 Individual.TextBox_Length.Text = 1000
GUI.TextBox_Length.Enabled = True Individual.TextBox_Length.Enabled = True
GUI.CheckBox_WholeMeshWidths.Enabled = True Individual.CheckBox_Whole_Mesh.Enabled = True
loadBarThickness = CInt(GUI.ComboBox_Thickness.Text) loadBarThickness = CInt(Individual.ComboBox_Thickness.Text)
Dim meshesDT As DataTable = Database.database.Tables("Meshes") Dim meshesDT As DataTable = Database.database.Tables("Meshes")
@ -324,7 +324,7 @@
Dim wholeMeshesDT As DataTable = Database.database.Tables("Whole Meshes") Dim wholeMeshesDT As DataTable = Database.database.Tables("Whole Meshes")
For i = 0 To wholeMeshesDT.Rows.Count - 1 For i = 0 To wholeMeshesDT.Rows.Count - 1
If Not IsDBNull(wholeMeshesDT.Rows(i)(wholeMeshesColumn)) Then If Not IsDBNull(wholeMeshesDT.Rows(i)(wholeMeshesColumn)) Then
GUI.ComboBox_Width.Items.Add(wholeMeshesDT.Rows(i)(wholeMeshesColumn)) Individual.ComboBox_Width.Items.Add(wholeMeshesDT.Rows(i)(wholeMeshesColumn))
End If End If
Next Next
End Sub End Sub
@ -332,10 +332,10 @@
Public Shared Sub WidthChanged(sender As Object, e As EventArgs) Public Shared Sub WidthChanged(sender As Object, e As EventArgs)
If GUI.ComboBox_Width.Text <> "" Then If Individual.ComboBox_Width.Text <> "" Then
If CInt(GUI.ComboBox_Width.Text) >= GUI.ComboBox_Width.Items(GUI.ComboBox_Width.Items.Count - 1) AndAlso If CInt(Individual.ComboBox_Width.Text) >= Individual.ComboBox_Width.Items(Individual.ComboBox_Width.Items.Count - 1) AndAlso
CInt(GUI.ComboBox_Width.Text) <= GUI.ComboBox_Width.Items(0) Then CInt(Individual.ComboBox_Width.Text) <= Individual.ComboBox_Width.Items(0) Then
Data.gratingW = CInt(GUI.ComboBox_Width.Text) Data.gratingW = CInt(Individual.ComboBox_Width.Text)
Draw_Grating.Update_GratingPoints() Draw_Grating.Update_GratingPoints()
End If End If
Enable_Recesses() Enable_Recesses()
@ -343,9 +343,9 @@
End Sub End Sub
Public Shared Sub LengthChanged(sender As Object, e As EventArgs) Public Shared Sub LengthChanged(sender As Object, e As EventArgs)
If GUI.TextBox_Length.Text <> "" Then If Individual.TextBox_Length.Text <> "" Then
If CInt(GUI.TextBox_Length.Text) >= 200 AndAlso CInt(GUI.TextBox_Length.Text) <= 6000 Then If CInt(Individual.TextBox_Length.Text) >= 200 AndAlso CInt(Individual.TextBox_Length.Text) <= 6000 Then
Data.gratingL = CInt(GUI.TextBox_Length.Text) Data.gratingL = CInt(Individual.TextBox_Length.Text)
Draw_Grating.Update_GratingPoints() Draw_Grating.Update_GratingPoints()
Else Else
'Message: Out of boundary 'Message: Out of boundary
@ -355,18 +355,18 @@
End Sub End Sub
Private Shared Sub Enable_Recesses() Private Shared Sub Enable_Recesses()
If GUI.ComboBox_Width.Text <> "" AndAlso GUI.TextBox_Length.Text <> "" Then If Individual.ComboBox_Width.Text <> "" AndAlso Individual.TextBox_Length.Text <> "" Then
GUI.AngleButton.Enabled = True Individual.Button_Angle_Corner.Enabled = True
GUI.Button_Square.Enabled = True Individual.Button_Square_Corner.Enabled = True
GUI.Button_SquareSide.Enabled = True Individual.Button_Square_Side.Enabled = True
End If End If
End Sub End Sub
' --- Creates the table with points data used in SW --- ' --- Creates the table with points data used in SW ---
Public Shared Function Create_ExportTable() As DataTable Public Shared Function Create_ExportTable() As DataTable
Dim lSpacing As String = GUI.ComboBox_MeshSize.Text.Split("x")(0) Dim lSpacing As String = Individual.ComboBox_Mesh.Text.Split("x")(0)
Dim cSpacing As String = GUI.ComboBox_MeshSize.Text.Split("x")(1).Split(" ")(0) Dim cSpacing As String = Individual.ComboBox_Mesh.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))
@ -384,14 +384,14 @@
gratingTable.Rows.Add() gratingTable.Rows.Add()
gratingTable.Rows(0)("SERRATED") = False 'Hämta från GUI gratingTable.Rows(0)("SERRATED") = False 'Hämta från GUI
gratingTable.Rows(0)("WIDTH") = CInt(GUI.ComboBox_Width.Text) gratingTable.Rows(0)("WIDTH") = CInt(Individual.ComboBox_Width.Text)
gratingTable.Rows(0)("LENGTH") = CInt(GUI.TextBox_Length.Text) gratingTable.Rows(0)("LENGTH") = CInt(Individual.TextBox_Length.Text)
gratingTable.Rows(0)("LOADBAR_THICKNESS") = CInt(GUI.ComboBox_Thickness.Text) gratingTable.Rows(0)("LOADBAR_THICKNESS") = CInt(Individual.ComboBox_Thickness.Text)
gratingTable.Rows(0)("LOADBAR_HEIGHT") = CInt(GUI.ComboBox_Height.Text) gratingTable.Rows(0)("LOADBAR_HEIGHT") = CInt(Individual.ComboBox_Height.Text)
gratingTable.Rows(0)("LOADBAR_SPACING") = CInt(lSpacing) gratingTable.Rows(0)("LOADBAR_SPACING") = CInt(lSpacing)
gratingTable.Rows(0)("CROSSBAR_SPACING") = CInt(cSpacing) gratingTable.Rows(0)("CROSSBAR_SPACING") = CInt(cSpacing)
If GUI.ComboBox_TypeChooser.Text = "Pressure Welded" Then If Individual.ComboBox_Type.Text = "Pressure Welded" Then
gratingTable.Rows(0)("TYPE") = "pressure_welded" ' Här behövs namn HLCt modellen gratingTable.Rows(0)("TYPE") = "pressure_welded" ' Här behövs namn HLCt modellen
gratingTable.Rows(0)("CROSSBAR_DIAMETER") = 5 gratingTable.Rows(0)("CROSSBAR_DIAMETER") = 5
gratingTable.Rows(0)("CROSSBAR_THICKNESS") = 0 gratingTable.Rows(0)("CROSSBAR_THICKNESS") = 0

View File

@ -1,23 +1,31 @@
Public Class Corner_Angle Public Class Corner_Angle
Private Shared buttonOffset As Integer
' --- Create textboxes when user clicks the angle corner recess button --- ' --- Create textboxes when user clicks the angle corner recess button ---
Public Shared Sub AngleButton(sender As Object, e As EventArgs) Public Shared Sub AngleButton(sender As Object, e As EventArgs)
GUI.Controls("AngleButton").Enabled = False Individual.Panel_Recesses.Controls("Button_Angle_Corner").Enabled = False
GUI.Controls("Button_Square").Enabled = False Individual.Panel_Recesses.Controls("Button_Angle_Side").Enabled = False
GUI.Controls("Button_SquareSide").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 = GUI.Controls("AngleButton").Location.X Dim buttonX As Integer = Individual.Panel_Recesses.Controls("Button_Angle_Corner").Location.X + Individual.Panel_Recesses.Controls("Button_Angle_Corner").Width
Dim buttonY As Integer = GUI.Controls("AngleButton").Location.Y Dim buttonY As Integer = Individual.Panel_Recesses.Controls("Button_Angle_Corner").Location.Y
GUI.Create_TextBox("X_TextBox", "", buttonX + 20, buttonY + 40, 60) Individual.Create_TextBox_Recesses("Y_TextBox", "", buttonX + 60, buttonY + 10, 60)
AddHandler GUI.Controls("X_TextBox").TextChanged, AddressOf FunctionTextCorner_Changed AddHandler Individual.Panel_Recesses.Controls("Y_TextBox").TextChanged, AddressOf FunctionTextCorner_Changed
AddHandler GUI.Controls("X_TextBox").KeyPress, AddressOf FunctionText_KeyPress AddHandler Individual.Panel_Recesses.Controls("Y_TextBox").KeyPress, AddressOf FunctionText_KeyPress
GUI.Create_LabelGUI("X_Label", "L", buttonX, buttonY + 43) Individual.Create_Label_Recesses("Y_Label", "Width", buttonX + 18, buttonY + 13)
GUI.Create_TextBox("Y_TextBox", "", buttonX + 130, buttonY + 40, 60) Individual.Create_TextBox_Recesses("X_TextBox", "", buttonX + 60, buttonY + 40, 60)
AddHandler GUI.Controls("Y_TextBox").TextChanged, AddressOf FunctionTextCorner_Changed AddHandler Individual.Panel_Recesses.Controls("X_TextBox").TextChanged, AddressOf FunctionTextCorner_Changed
AddHandler GUI.Controls("Y_TextBox").KeyPress, AddressOf FunctionText_KeyPress AddHandler Individual.Panel_Recesses.Controls("X_TextBox").KeyPress, AddressOf FunctionText_KeyPress
GUI.Create_LabelGUI("Y_Label", "W", buttonX + 110, buttonY + 43) Individual.Create_Label_Recesses("X_Label", "Length", buttonX + 10, buttonY + 43)
buttonOffset = 130
Individual.Panel_Recesses.Controls("Button_Angle_Side").Left = Individual.Panel_Recesses.Controls("Button_Angle_Side").Left + buttonOffset
Individual.Panel_Recesses.Controls("Button_Square_Corner").Left = Individual.Panel_Recesses.Controls("Button_Square_Corner").Left + buttonOffset
Individual.Panel_Recesses.Controls("Button_Square_Side").Left = Individual.Panel_Recesses.Controls("Button_Square_Side").Left + buttonOffset
Individual.Panel_Recesses.Controls("Button_Square_Middle").Left = Individual.Panel_Recesses.Controls("Button_Square_Middle").Left + buttonOffset
End Sub End Sub
' --- Check the key pressed by the user --- ' --- Check the key pressed by the user ---
@ -29,15 +37,15 @@
Private Shared Sub FunctionTextCorner_Changed(sender As TextBox, e As EventArgs) Private Shared Sub FunctionTextCorner_Changed(sender As TextBox, e As EventArgs)
Dim value1, value2 As Integer Dim value1, value2 As Integer
Try Try
value1 = CInt(GUI.Controls("X_TextBox").Text) value1 = CInt(Individual.Panel_Recesses.Controls("X_TextBox").Text)
value2 = CInt(GUI.Controls("Y_TextBox").Text) value2 = CInt(Individual.Panel_Recesses.Controls("Y_TextBox").Text)
Catch ex As Exception Catch ex As Exception
value1 = 0 value1 = 0
value2 = 0 value2 = 0
End Try End Try
If value1 > 0 AndAlso value2 > 0 Then If value1 > 0 AndAlso value2 > 0 Then
If GUI.DrawingPanel.Controls.Count = 2 Then If Individual.Panel_Grating.Controls.Count = 2 Then
For i = 0 To Data.gratingPoints.Rows.Count - 1 For i = 0 To Data.gratingPoints.Rows.Count - 1
If Data.gratingPoints.Rows(i)("RECESS OK") Then If Data.gratingPoints.Rows(i)("RECESS OK") Then
Dim pointButton As New Button With { Dim pointButton As New Button With {
@ -58,19 +66,19 @@
gp.AddEllipse(New Rectangle(New Point(0, 0), New Size(30, 30))) gp.AddEllipse(New Rectangle(New Point(0, 0), New Size(30, 30)))
pointButton.Region = New Region(gp) pointButton.Region = New Region(gp)
GUI.DrawingPanel.Controls.Add(pointButton) Individual.Panel_Grating.Controls.Add(pointButton)
AddHandler pointButton.Click, AddressOf PointButton_Click AddHandler pointButton.Click, AddressOf PointButton_Click
End If End If
Next Next
End If End If
ElseIf GUI.DrawingPanel.Controls.Count > 2 Then ElseIf Individual.Panel_Grating.Controls.Count > 2 Then
For i = 0 To Data.gratingPoints.Rows.Count - 1 For i = 0 To Data.gratingPoints.Rows.Count - 1
If Data.gratingPoints.Rows(i)("RECESS OK") Then If Data.gratingPoints.Rows(i)("RECESS OK") Then
Dim buttonName As String = Data.gratingPoints.Rows(i)("NAME") & "_Button" Dim buttonName As String = Data.gratingPoints.Rows(i)("NAME") & "_Button"
RemoveHandler GUI.DrawingPanel.Controls(buttonName).Click, AddressOf PointButton_Click RemoveHandler Individual.Panel_Grating.Controls(buttonName).Click, AddressOf PointButton_Click
GUI.DrawingPanel.Controls.RemoveByKey(Data.gratingPoints.Rows(i)("NAME") & "_Button") Individual.Panel_Grating.Controls.RemoveByKey(Data.gratingPoints.Rows(i)("NAME") & "_Button")
End If End If
Next Next
End If End If
@ -92,8 +100,8 @@
For i = 0 To Data.gratingPoints.Rows.Count - 1 For i = 0 To Data.gratingPoints.Rows.Count - 1
If Data.gratingPoints.Rows(i)("RECESS OK") Then If Data.gratingPoints.Rows(i)("RECESS OK") Then
Dim buttonName As String = Data.gratingPoints.Rows(i)("NAME") & "_Button" Dim buttonName As String = Data.gratingPoints.Rows(i)("NAME") & "_Button"
RemoveHandler GUI.DrawingPanel.Controls(buttonName).Click, AddressOf PointButton_Click RemoveHandler Individual.Panel_Grating.Controls(buttonName).Click, AddressOf PointButton_Click
GUI.DrawingPanel.Controls.RemoveByKey(Data.gratingPoints.Rows(i)("NAME") & "_Button") Individual.Panel_Grating.Controls.RemoveByKey(Data.gratingPoints.Rows(i)("NAME") & "_Button")
End If End If
Next Next
@ -103,10 +111,10 @@
Dim pX As Decimal = Data.gratingPoints.Rows(index)("X") Dim pX As Decimal = Data.gratingPoints.Rows(index)("X")
Dim pY As Decimal = Data.gratingPoints.Rows(index)("Y") Dim pY As Decimal = Data.gratingPoints.Rows(index)("Y")
Dim dXGUI As Integer = CInt(GUI.Controls("X_TextBox").Text / Data.scaleDiff) Dim dXGUI As Integer = CInt(Individual.Panel_Recesses.Controls("X_TextBox").Text / Data.scaleDiff)
Dim dYGUI As Integer = CInt(GUI.Controls("Y_TextBox").Text / Data.scaleDiff) Dim dYGUI As Integer = CInt(Individual.Panel_Recesses.Controls("Y_TextBox").Text / Data.scaleDiff)
Dim dX As Decimal = GUI.Controls("X_TextBox").Text / 1000 Dim dX As Decimal = Individual.Panel_Recesses.Controls("X_TextBox").Text / 1000
Dim dY As Decimal = GUI.Controls("Y_TextBox").Text / 1000 Dim dY As Decimal = Individual.Panel_Recesses.Controls("Y_TextBox").Text / 1000
Data.recessData.Rows.Add() Data.recessData.Rows.Add()
@ -115,37 +123,37 @@
If mesName.Split("_")(0) <> "SS1" AndAlso mesName.Split("_")(0) <> "SS" Then If mesName.Split("_")(0) <> "SS1" AndAlso mesName.Split("_")(0) <> "SS" Then
If index + 1 = Data.pointsMeasurements(mesName)(0) Then If index + 1 = Data.pointsMeasurements(mesName)(0) Then
If Draw_Grating.measureLabels(mesName)(3) = 1 Then If Draw_Grating.measureLabels(mesName)(3) = 1 Then
Draw_Grating.measureLabels(mesName)(0) = Draw_Grating.measureLabels(mesName)(0) - GUI.Controls("X_TextBox").Text Draw_Grating.measureLabels(mesName)(0) = Draw_Grating.measureLabels(mesName)(0) - Individual.Panel_Recesses.Controls("X_TextBox").Text
Draw_Grating.measureLabels(mesName)(1) = Draw_Grating.measureLabels(mesName)(1) + dXGUI / 2 Draw_Grating.measureLabels(mesName)(1) = Draw_Grating.measureLabels(mesName)(1) + dXGUI / 2
ElseIf Draw_Grating.measureLabels(mesName)(3) = 2 Then ElseIf Draw_Grating.measureLabels(mesName)(3) = 2 Then
Draw_Grating.measureLabels(mesName)(0) = Draw_Grating.measureLabels(mesName)(0) - GUI.Controls("Y_TextBox").Text Draw_Grating.measureLabels(mesName)(0) = Draw_Grating.measureLabels(mesName)(0) - Individual.Panel_Recesses.Controls("Y_TextBox").Text
Draw_Grating.measureLabels(mesName)(2) = Draw_Grating.measureLabels(mesName)(2) + dYGUI / 2 Draw_Grating.measureLabels(mesName)(2) = Draw_Grating.measureLabels(mesName)(2) + dYGUI / 2
ElseIf Draw_Grating.measureLabels(mesName)(3) = 3 Then ElseIf Draw_Grating.measureLabels(mesName)(3) = 3 Then
Draw_Grating.measureLabels(mesName)(0) = Draw_Grating.measureLabels(mesName)(0) - GUI.Controls("X_TextBox").Text Draw_Grating.measureLabels(mesName)(0) = Draw_Grating.measureLabels(mesName)(0) - Individual.Panel_Recesses.Controls("X_TextBox").Text
Draw_Grating.measureLabels(mesName)(1) = Draw_Grating.measureLabels(mesName)(1) - dXGUI / 2 Draw_Grating.measureLabels(mesName)(1) = Draw_Grating.measureLabels(mesName)(1) - dXGUI / 2
Else Else
Draw_Grating.measureLabels(mesName)(0) = Draw_Grating.measureLabels(mesName)(0) - GUI.Controls("Y_TextBox").Text Draw_Grating.measureLabels(mesName)(0) = Draw_Grating.measureLabels(mesName)(0) - Individual.Panel_Recesses.Controls("Y_TextBox").Text
Draw_Grating.measureLabels(mesName)(2) = Draw_Grating.measureLabels(mesName)(2) - dYGUI / 2 Draw_Grating.measureLabels(mesName)(2) = Draw_Grating.measureLabels(mesName)(2) - dYGUI / 2
End If End If
ElseIf index + 1 = Data.pointsMeasurements(mesName)(1) Then ElseIf index + 1 = Data.pointsMeasurements(mesName)(1) Then
If Draw_Grating.measureLabels(mesName)(3) = 1 Then If Draw_Grating.measureLabels(mesName)(3) = 1 Then
Draw_Grating.measureLabels(mesName)(0) = Draw_Grating.measureLabels(mesName)(0) - GUI.Controls("Y_TextBox").Text Draw_Grating.measureLabels(mesName)(0) = Draw_Grating.measureLabels(mesName)(0) - Individual.Panel_Recesses.Controls("Y_TextBox").Text
Draw_Grating.measureLabels(mesName)(2) = Draw_Grating.measureLabels(mesName)(2) + dYGUI / 2 Draw_Grating.measureLabels(mesName)(2) = Draw_Grating.measureLabels(mesName)(2) + dYGUI / 2
ElseIf Draw_Grating.measureLabels(mesName)(3) = 2 Then ElseIf Draw_Grating.measureLabels(mesName)(3) = 2 Then
Draw_Grating.measureLabels(mesName)(0) = Draw_Grating.measureLabels(mesName)(0) - GUI.Controls("X_TextBox").Text Draw_Grating.measureLabels(mesName)(0) = Draw_Grating.measureLabels(mesName)(0) - Individual.Panel_Recesses.Controls("X_TextBox").Text
Draw_Grating.measureLabels(mesName)(1) = Draw_Grating.measureLabels(mesName)(1) - dXGUI / 2 Draw_Grating.measureLabels(mesName)(1) = Draw_Grating.measureLabels(mesName)(1) - dXGUI / 2
ElseIf Draw_Grating.measureLabels(mesName)(3) = 3 Then ElseIf Draw_Grating.measureLabels(mesName)(3) = 3 Then
Draw_Grating.measureLabels(mesName)(0) = Draw_Grating.measureLabels(mesName)(0) - GUI.Controls("Y_TextBox").Text Draw_Grating.measureLabels(mesName)(0) = Draw_Grating.measureLabels(mesName)(0) - Individual.Panel_Recesses.Controls("Y_TextBox").Text
Draw_Grating.measureLabels(mesName)(2) = Draw_Grating.measureLabels(mesName)(2) - dYGUI / 2 Draw_Grating.measureLabels(mesName)(2) = Draw_Grating.measureLabels(mesName)(2) - dYGUI / 2
Else Else
Draw_Grating.measureLabels(mesName)(0) = Draw_Grating.measureLabels(mesName)(0) - GUI.Controls("X_TextBox").Text Draw_Grating.measureLabels(mesName)(0) = Draw_Grating.measureLabels(mesName)(0) - Individual.Panel_Recesses.Controls("X_TextBox").Text
Draw_Grating.measureLabels(mesName)(1) = Draw_Grating.measureLabels(mesName)(1) + dXGUI / 2 Draw_Grating.measureLabels(mesName)(1) = Draw_Grating.measureLabels(mesName)(1) + dXGUI / 2
End If End If
End If End If
ElseIf mesName.Split("_")(0) = "SS1" AndAlso index + 2 = Data.pointsMeasurements(mesName)(1) Then ElseIf mesName.Split("_")(0) = "SS1" AndAlso index + 2 = Data.pointsMeasurements(mesName)(1) Then
If Draw_Grating.measureLabels(mesName)(3) = 1 Then If Draw_Grating.measureLabels(mesName)(3) = 1 Then
Draw_Grating.measureLabels(mesName)(0) = Draw_Grating.measureLabels(mesName)(0) - GUI.Controls("X_TextBox").Text Draw_Grating.measureLabels(mesName)(0) = Draw_Grating.measureLabels(mesName)(0) - Individual.Panel_Recesses.Controls("X_TextBox").Text
Draw_Grating.measureLabels(mesName)(1) = Draw_Grating.measureLabels(mesName)(1) + dXGUI / 2 Draw_Grating.measureLabels(mesName)(1) = Draw_Grating.measureLabels(mesName)(1) + dXGUI / 2
Draw_Grating.sideSquareMesLine(mesName)(0) = Draw_Grating.sideSquareMesLine(mesName)(0) + dXGUI Draw_Grating.sideSquareMesLine(mesName)(0) = Draw_Grating.sideSquareMesLine(mesName)(0) + dXGUI
@ -206,16 +214,16 @@
Data.angleRecessPoints.Rows.Add(pointRow) Data.angleRecessPoints.Rows.Add(pointRow)
' Add recess measurments (GUI) ' Add recess measurments (GUI)
Draw_Grating.measureLabels.Add("A_" & mesNum, {CInt(GUI.Controls("X_TextBox").Text), pXGUI + dXGUI / 2 - 8, Draw_Grating.measureLabels.Add("A_" & mesNum, {CInt(Individual.Panel_Recesses.Controls("X_TextBox").Text), pXGUI + dXGUI / 2 - 8,
pYGUI + dYGUI + 3, 1}) pYGUI + dYGUI + 3, 1})
Draw_Grating.measureLabels.Add("A_" & mesNum + 1, {CInt(GUI.Controls("Y_TextBox").Text), pXGUI + dXGUI + 3, Draw_Grating.measureLabels.Add("A_" & mesNum + 1, {CInt(Individual.Panel_Recesses.Controls("Y_TextBox").Text), pXGUI + dXGUI + 3,
pYGUI + dYGUI / 2 - 4, 1}) pYGUI + dYGUI / 2 - 4, 1})
' Recess Data ' Recess Data
Data.recessData.Rows(Data.recessData.Rows.Count - 1)("RECESS TYPE") = "ANGLE" Data.recessData.Rows(Data.recessData.Rows.Count - 1)("RECESS TYPE") = "ANGLE"
Data.recessData.Rows(Data.recessData.Rows.Count - 1)("CORNER") = 1 Data.recessData.Rows(Data.recessData.Rows.Count - 1)("CORNER") = 1
Data.recessData.Rows(Data.recessData.Rows.Count - 1)("WIDTH") = CInt(GUI.Controls("Y_TextBox").Text) 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(GUI.Controls("X_TextBox").Text) Data.recessData.Rows(Data.recessData.Rows.Count - 1)("LENGTH") = CInt(Individual.Panel_Recesses.Controls("X_TextBox").Text)
ElseIf pointQuadrant = 2 Then ElseIf pointQuadrant = 2 Then
' Add the new points ' Add the new points
@ -246,16 +254,16 @@
Data.angleRecessPoints.Rows.Add(pointRow) Data.angleRecessPoints.Rows.Add(pointRow)
' Add recess measurments (GUI) ' Add recess measurments (GUI)
Draw_Grating.measureLabels.Add("A_" & mesNum, {CInt(GUI.Controls("Y_TextBox").Text), pXGUI - dXGUI - 18 - 3, Draw_Grating.measureLabels.Add("A_" & mesNum, {CInt(Individual.Panel_Recesses.Controls("Y_TextBox").Text), pXGUI - dXGUI - 18 - 3,
pYGUI + dYGUI / 2 - 4, 2}) pYGUI + dYGUI / 2 - 4, 2})
Draw_Grating.measureLabels.Add("A_" & mesNum + 1, {CInt(GUI.Controls("X_TextBox").Text), pXGUI - dXGUI / 2 - 8, Draw_Grating.measureLabels.Add("A_" & mesNum + 1, {CInt(Individual.Panel_Recesses.Controls("X_TextBox").Text), pXGUI - dXGUI / 2 - 8,
pYGUI + dYGUI + 3, 2}) pYGUI + dYGUI + 3, 2})
' Recess Data ' Recess Data
Data.recessData.Rows(Data.recessData.Rows.Count - 1)("RECESS TYPE") = "ANGLE" Data.recessData.Rows(Data.recessData.Rows.Count - 1)("RECESS TYPE") = "ANGLE"
Data.recessData.Rows(Data.recessData.Rows.Count - 1)("CORNER") = 2 Data.recessData.Rows(Data.recessData.Rows.Count - 1)("CORNER") = 2
Data.recessData.Rows(Data.recessData.Rows.Count - 1)("WIDTH") = CInt(GUI.Controls("Y_TextBox").Text) 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(GUI.Controls("X_TextBox").Text) Data.recessData.Rows(Data.recessData.Rows.Count - 1)("LENGTH") = CInt(Individual.Panel_Recesses.Controls("X_TextBox").Text)
ElseIf pointQuadrant = 3 Then ElseIf pointQuadrant = 3 Then
' Add the new points ' Add the new points
@ -285,16 +293,16 @@
Data.angleRecessPoints.Rows.Add(pointRow) Data.angleRecessPoints.Rows.Add(pointRow)
' Add recess measurments (GUI) ' Add recess measurments (GUI)
Draw_Grating.measureLabels.Add("A_" & mesNum, {CInt(GUI.Controls("X_TextBox").Text), pXGUI - dXGUI / 2 - 8, Draw_Grating.measureLabels.Add("A_" & mesNum, {CInt(Individual.Panel_Recesses.Controls("X_TextBox").Text), pXGUI - dXGUI / 2 - 8,
pYGUI - dYGUI - 12 - 3, 3}) pYGUI - dYGUI - 12 - 3, 3})
Draw_Grating.measureLabels.Add("A_" & mesNum + 1, {CInt(GUI.Controls("Y_TextBox").Text), pXGUI - dXGUI - 18 - 3, Draw_Grating.measureLabels.Add("A_" & mesNum + 1, {CInt(Individual.Panel_Recesses.Controls("Y_TextBox").Text), pXGUI - dXGUI - 18 - 3,
pYGUI - dYGUI / 2 - 4, 3}) pYGUI - dYGUI / 2 - 4, 3})
' Recess Data ' Recess Data
Data.recessData.Rows(Data.recessData.Rows.Count - 1)("RECESS TYPE") = "ANGLE" Data.recessData.Rows(Data.recessData.Rows.Count - 1)("RECESS TYPE") = "ANGLE"
Data.recessData.Rows(Data.recessData.Rows.Count - 1)("CORNER") = 3 Data.recessData.Rows(Data.recessData.Rows.Count - 1)("CORNER") = 3
Data.recessData.Rows(Data.recessData.Rows.Count - 1)("WIDTH") = CInt(GUI.Controls("Y_TextBox").Text) 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(GUI.Controls("X_TextBox").Text) Data.recessData.Rows(Data.recessData.Rows.Count - 1)("LENGTH") = CInt(Individual.Panel_Recesses.Controls("X_TextBox").Text)
Else Else
' Add the new points ' Add the new points
@ -321,16 +329,16 @@
Data.angleRecessPoints.Rows.Add(pointRow) Data.angleRecessPoints.Rows.Add(pointRow)
' Add recess measurments (GUI) ' Add recess measurments (GUI)
Draw_Grating.measureLabels.Add("A_" & mesNum, {CInt(GUI.Controls("Y_TextBox").Text), pXGUI + dXGUI + 3, Draw_Grating.measureLabels.Add("A_" & mesNum, {CInt(Individual.Panel_Recesses.Controls("Y_TextBox").Text), pXGUI + dXGUI + 3,
pYGUI - dYGUI / 2 - 4, 4}) pYGUI - dYGUI / 2 - 4, 4})
Draw_Grating.measureLabels.Add("A_" & mesNum + 1, {CInt(GUI.Controls("X_TextBox").Text), pXGUI + dXGUI / 2 - 8, Draw_Grating.measureLabels.Add("A_" & mesNum + 1, {CInt(Individual.Panel_Recesses.Controls("X_TextBox").Text), pXGUI + dXGUI / 2 - 8,
pYGUI - dYGUI - 12 - 3, 4}) pYGUI - dYGUI - 12 - 3, 4})
' Recess Data ' Recess Data
Data.recessData.Rows(Data.recessData.Rows.Count - 1)("RECESS TYPE") = "ANGLE" Data.recessData.Rows(Data.recessData.Rows.Count - 1)("RECESS TYPE") = "ANGLE"
Data.recessData.Rows(Data.recessData.Rows.Count - 1)("CORNER") = 4 Data.recessData.Rows(Data.recessData.Rows.Count - 1)("CORNER") = 4
Data.recessData.Rows(Data.recessData.Rows.Count - 1)("WIDTH") = CInt(GUI.Controls("Y_TextBox").Text) 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(GUI.Controls("X_TextBox").Text) Data.recessData.Rows(Data.recessData.Rows.Count - 1)("LENGTH") = CInt(Individual.Panel_Recesses.Controls("X_TextBox").Text)
End If End If
@ -339,22 +347,29 @@
Data.gratingPoints.Rows.RemoveAt(index) Data.gratingPoints.Rows.RemoveAt(index)
'Redraw grating 'Redraw grating
GUI.DrawingPanel.Refresh() Individual.Panel_Grating.Refresh()
RemoveHandler GUI.Controls("X_TextBox").TextChanged, AddressOf FunctionTextCorner_Changed RemoveHandler Individual.Panel_Recesses.Controls("X_TextBox").TextChanged, AddressOf FunctionTextCorner_Changed
RemoveHandler GUI.Controls("X_TextBox").KeyPress, AddressOf FunctionText_KeyPress RemoveHandler Individual.Panel_Recesses.Controls("X_TextBox").KeyPress, AddressOf FunctionText_KeyPress
GUI.Controls.RemoveByKey("X_TextBox") Individual.Panel_Recesses.Controls.RemoveByKey("X_TextBox")
RemoveHandler GUI.Controls("Y_TextBox").TextChanged, AddressOf FunctionTextCorner_Changed RemoveHandler Individual.Panel_Recesses.Controls("Y_TextBox").TextChanged, AddressOf FunctionTextCorner_Changed
RemoveHandler GUI.Controls("Y_TextBox").KeyPress, AddressOf FunctionText_KeyPress RemoveHandler Individual.Panel_Recesses.Controls("Y_TextBox").KeyPress, AddressOf FunctionText_KeyPress
GUI.Controls.RemoveByKey("Y_TextBox") Individual.Panel_Recesses.Controls.RemoveByKey("Y_TextBox")
GUI.Controls.RemoveByKey("X_Label") Individual.Panel_Recesses.Controls.RemoveByKey("X_Label")
GUI.Controls.RemoveByKey("Y_Label") Individual.Panel_Recesses.Controls.RemoveByKey("Y_Label")
GUI.Controls("AngleButton").Enabled = True Individual.Panel_Recesses.Controls("Button_Angle_Corner").Enabled = True
GUI.Controls("Button_Square").Enabled = True Individual.Panel_Recesses.Controls("Button_Angle_Side").Enabled = True
GUI.Controls("Button_SquareSide").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.Panel_Recesses.Controls("Button_Angle_Side").Left = Individual.Panel_Recesses.Controls("Button_Angle_Side").Left - buttonOffset
Individual.Panel_Recesses.Controls("Button_Square_Corner").Left = Individual.Panel_Recesses.Controls("Button_Square_Corner").Left - buttonOffset
Individual.Panel_Recesses.Controls("Button_Square_Side").Left = Individual.Panel_Recesses.Controls("Button_Square_Side").Left - buttonOffset
Individual.Panel_Recesses.Controls("Button_Square_Middle").Left = Individual.Panel_Recesses.Controls("Button_Square_Middle").Left - buttonOffset
End Sub End Sub
' --- Determines the clicked points quadrant --- ' --- Determines the clicked points quadrant ---

View File

@ -1,23 +1,30 @@
Public Class Corner_Rectangle Public Class Corner_Rectangle
Private Shared buttonOffset As Integer
' --- Create textboxes when user clicks the rectangle corner recess button --- ' --- Create textboxes when user clicks the rectangle corner recess button ---
Public Shared Sub SquareButtton(sender As Object, e As EventArgs) Public Shared Sub SquareButtton(sender As Object, e As EventArgs)
GUI.Controls("AngleButton").Enabled = False Individual.Panel_Recesses.Controls("Button_Angle_Corner").Enabled = False
GUI.Controls("Button_Square").Enabled = False Individual.Panel_Recesses.Controls("Button_Angle_Side").Enabled = False
GUI.Controls("Button_SquareSide").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 = GUI.Controls("Button_Square").Location.X Dim buttonX As Integer = Individual.Panel_Recesses.Controls("Button_Square_Corner").Location.X + Individual.Panel_Recesses.Controls("Button_Square_Corner").Width
Dim buttonY As Integer = GUI.Controls("Button_Square").Location.Y Dim buttonY As Integer = Individual.Panel_Recesses.Controls("Button_Square_Corner").Location.Y
GUI.Create_TextBox("X_TextBox", "", buttonX + 20, buttonY + 40, 60) Individual.Create_TextBox_Recesses("Y_TextBox", "", buttonX + 60, buttonY + 10, 60)
AddHandler GUI.Controls("X_TextBox").TextChanged, AddressOf FunctionTextCorner_Changed AddHandler Individual.Panel_Recesses.Controls("Y_TextBox").TextChanged, AddressOf FunctionTextCorner_Changed
AddHandler GUI.Controls("X_TextBox").KeyPress, AddressOf FunctionText_KeyPress AddHandler Individual.Panel_Recesses.Controls("Y_TextBox").KeyPress, AddressOf FunctionText_KeyPress
GUI.Create_LabelGUI("X_Label", "L", buttonX, buttonY + 43) Individual.Create_Label_Recesses("Y_Label", "Width", buttonX + 18, buttonY + 13)
Individual.Create_TextBox_Recesses("X_TextBox", "", buttonX + 60, buttonY + 40, 60)
AddHandler Individual.Panel_Recesses.Controls("X_TextBox").TextChanged, AddressOf FunctionTextCorner_Changed
AddHandler Individual.Panel_Recesses.Controls("X_TextBox").KeyPress, AddressOf FunctionText_KeyPress
Individual.Create_Label_Recesses("X_Label", "Length", buttonX + 10, buttonY + 43)
buttonOffset = 130
Individual.Panel_Recesses.Controls("Button_Square_Side").Left = Individual.Panel_Recesses.Controls("Button_Square_Side").Left + buttonOffset
Individual.Panel_Recesses.Controls("Button_Square_Middle").Left = Individual.Panel_Recesses.Controls("Button_Square_Middle").Left + buttonOffset
GUI.Create_TextBox("Y_TextBox", "", buttonX + 130, buttonY + 40, 60)
AddHandler GUI.Controls("Y_TextBox").TextChanged, AddressOf FunctionTextCorner_Changed
AddHandler GUI.Controls("Y_TextBox").KeyPress, AddressOf FunctionText_KeyPress
GUI.Create_LabelGUI("Y_Label", "W", buttonX + 110, buttonY + 43)
End Sub End Sub
' --- Check the key pressed by the user --- ' --- Check the key pressed by the user ---
@ -29,15 +36,15 @@
Private Shared Sub FunctionTextCorner_Changed(sender As TextBox, e As EventArgs) Private Shared Sub FunctionTextCorner_Changed(sender As TextBox, e As EventArgs)
Dim value1, value2 As Integer Dim value1, value2 As Integer
Try Try
value1 = CInt(GUI.Controls("X_TextBox").Text) value1 = CInt(Individual.Panel_Recesses.Controls("X_TextBox").Text)
value2 = CInt(GUI.Controls("Y_TextBox").Text) value2 = CInt(Individual.Panel_Recesses.Controls("Y_TextBox").Text)
Catch ex As Exception Catch ex As Exception
value1 = 0 value1 = 0
value2 = 0 value2 = 0
End Try End Try
If value1 > 0 AndAlso value2 > 0 Then If value1 > 0 AndAlso value2 > 0 Then
If GUI.DrawingPanel.Controls.Count = 2 Then If Individual.Panel_Grating.Controls.Count = 2 Then
For i = 0 To Data.gratingPoints.Rows.Count - 1 For i = 0 To Data.gratingPoints.Rows.Count - 1
If Data.gratingPoints.Rows(i)("RECESS OK") Then If Data.gratingPoints.Rows(i)("RECESS OK") Then
Dim pointButton As New Button With { Dim pointButton As New Button With {
@ -58,19 +65,19 @@
gp.AddEllipse(New Rectangle(New Point(0, 0), New Size(30, 30))) gp.AddEllipse(New Rectangle(New Point(0, 0), New Size(30, 30)))
pointButton.Region = New Region(gp) pointButton.Region = New Region(gp)
GUI.DrawingPanel.Controls.Add(pointButton) Individual.Panel_Grating.Controls.Add(pointButton)
AddHandler pointButton.Click, AddressOf PointButton_Click AddHandler pointButton.Click, AddressOf PointButton_Click
End If End If
Next Next
End If End If
ElseIf GUI.DrawingPanel.Controls.Count > 2 Then ElseIf Individual.Panel_Grating.Controls.Count > 2 Then
For i = 0 To Data.gratingPoints.Rows.Count - 1 For i = 0 To Data.gratingPoints.Rows.Count - 1
If Data.gratingPoints.Rows(i)("RECESS OK") Then If Data.gratingPoints.Rows(i)("RECESS OK") Then
Dim buttonName As String = Data.gratingPoints.Rows(i)("NAME") & "_Button" Dim buttonName As String = Data.gratingPoints.Rows(i)("NAME") & "_Button"
RemoveHandler GUI.DrawingPanel.Controls(buttonName).Click, AddressOf PointButton_Click RemoveHandler Individual.Panel_Grating.Controls(buttonName).Click, AddressOf PointButton_Click
GUI.DrawingPanel.Controls.RemoveByKey(Data.gratingPoints.Rows(i)("NAME") & "_Button") Individual.Panel_Grating.Controls.RemoveByKey(Data.gratingPoints.Rows(i)("NAME") & "_Button")
End If End If
Next Next
End If End If
@ -92,8 +99,8 @@
For i = 0 To Data.gratingPoints.Rows.Count - 1 For i = 0 To Data.gratingPoints.Rows.Count - 1
If Data.gratingPoints.Rows(i)("RECESS OK") Then If Data.gratingPoints.Rows(i)("RECESS OK") Then
Dim buttonName As String = Data.gratingPoints.Rows(i)("NAME") & "_Button" Dim buttonName As String = Data.gratingPoints.Rows(i)("NAME") & "_Button"
RemoveHandler GUI.DrawingPanel.Controls(buttonName).Click, AddressOf PointButton_Click RemoveHandler Individual.Panel_Grating.Controls(buttonName).Click, AddressOf PointButton_Click
GUI.DrawingPanel.Controls.RemoveByKey(Data.gratingPoints.Rows(i)("NAME") & "_Button") Individual.Panel_Grating.Controls.RemoveByKey(Data.gratingPoints.Rows(i)("NAME") & "_Button")
End If End If
Next Next
@ -103,10 +110,10 @@
Dim pX As Decimal = Data.gratingPoints.Rows(index)("X") Dim pX As Decimal = Data.gratingPoints.Rows(index)("X")
Dim pY As Decimal = Data.gratingPoints.Rows(index)("Y") Dim pY As Decimal = Data.gratingPoints.Rows(index)("Y")
Dim dXGUI As Integer = CInt(GUI.Controls("X_TextBox").Text / Data.scaleDiff) Dim dXGUI As Integer = CInt(Individual.Panel_Recesses.Controls("X_TextBox").Text / Data.scaleDiff)
Dim dYGUI As Integer = CInt(GUI.Controls("Y_TextBox").Text / Data.scaleDiff) Dim dYGUI As Integer = CInt(Individual.Panel_Recesses.Controls("Y_TextBox").Text / Data.scaleDiff)
Dim dX As Decimal = GUI.Controls("X_TextBox").Text / 1000 Dim dX As Decimal = Individual.Panel_Recesses.Controls("X_TextBox").Text / 1000
Dim dY As Decimal = GUI.Controls("Y_TextBox").Text / 1000 Dim dY As Decimal = Individual.Panel_Recesses.Controls("Y_TextBox").Text / 1000
Data.recessData.Rows.Add() Data.recessData.Rows.Add()
@ -115,37 +122,37 @@
If mesName.Split("_")(0) <> "SS1" AndAlso mesName.Split("_")(0) <> "SS" Then If mesName.Split("_")(0) <> "SS1" AndAlso mesName.Split("_")(0) <> "SS" Then
If index + 1 = Data.pointsMeasurements(mesName)(0) Then If index + 1 = Data.pointsMeasurements(mesName)(0) Then
If Draw_Grating.measureLabels(mesName)(3) = 1 Then If Draw_Grating.measureLabels(mesName)(3) = 1 Then
Draw_Grating.measureLabels(mesName)(0) = Draw_Grating.measureLabels(mesName)(0) - GUI.Controls("X_TextBox").Text Draw_Grating.measureLabels(mesName)(0) = Draw_Grating.measureLabels(mesName)(0) - Individual.Panel_Recesses.Controls("X_TextBox").Text
Draw_Grating.measureLabels(mesName)(1) = Draw_Grating.measureLabels(mesName)(1) + dXGUI / 2 Draw_Grating.measureLabels(mesName)(1) = Draw_Grating.measureLabels(mesName)(1) + dXGUI / 2
ElseIf Draw_Grating.measureLabels(mesName)(3) = 2 Then ElseIf Draw_Grating.measureLabels(mesName)(3) = 2 Then
Draw_Grating.measureLabels(mesName)(0) = Draw_Grating.measureLabels(mesName)(0) - GUI.Controls("Y_TextBox").Text Draw_Grating.measureLabels(mesName)(0) = Draw_Grating.measureLabels(mesName)(0) - Individual.Panel_Recesses.Controls("Y_TextBox").Text
Draw_Grating.measureLabels(mesName)(2) = Draw_Grating.measureLabels(mesName)(2) + dYGUI / 2 Draw_Grating.measureLabels(mesName)(2) = Draw_Grating.measureLabels(mesName)(2) + dYGUI / 2
ElseIf Draw_Grating.measureLabels(mesName)(3) = 3 Then ElseIf Draw_Grating.measureLabels(mesName)(3) = 3 Then
Draw_Grating.measureLabels(mesName)(0) = Draw_Grating.measureLabels(mesName)(0) - GUI.Controls("X_TextBox").Text Draw_Grating.measureLabels(mesName)(0) = Draw_Grating.measureLabels(mesName)(0) - Individual.Panel_Recesses.Controls("X_TextBox").Text
Draw_Grating.measureLabels(mesName)(1) = Draw_Grating.measureLabels(mesName)(1) - dXGUI / 2 Draw_Grating.measureLabels(mesName)(1) = Draw_Grating.measureLabels(mesName)(1) - dXGUI / 2
Else Else
Draw_Grating.measureLabels(mesName)(0) = Draw_Grating.measureLabels(mesName)(0) - GUI.Controls("Y_TextBox").Text Draw_Grating.measureLabels(mesName)(0) = Draw_Grating.measureLabels(mesName)(0) - Individual.Panel_Recesses.Controls("Y_TextBox").Text
Draw_Grating.measureLabels(mesName)(2) = Draw_Grating.measureLabels(mesName)(2) - dYGUI / 2 Draw_Grating.measureLabels(mesName)(2) = Draw_Grating.measureLabels(mesName)(2) - dYGUI / 2
End If End If
ElseIf index + 1 = Data.pointsMeasurements(mesName)(1) Then ElseIf index + 1 = Data.pointsMeasurements(mesName)(1) Then
If Draw_Grating.measureLabels(mesName)(3) = 1 Then If Draw_Grating.measureLabels(mesName)(3) = 1 Then
Draw_Grating.measureLabels(mesName)(0) = Draw_Grating.measureLabels(mesName)(0) - GUI.Controls("Y_TextBox").Text Draw_Grating.measureLabels(mesName)(0) = Draw_Grating.measureLabels(mesName)(0) - Individual.Panel_Recesses.Controls("Y_TextBox").Text
Draw_Grating.measureLabels(mesName)(2) = Draw_Grating.measureLabels(mesName)(2) + dYGUI / 2 Draw_Grating.measureLabels(mesName)(2) = Draw_Grating.measureLabels(mesName)(2) + dYGUI / 2
ElseIf Draw_Grating.measureLabels(mesName)(3) = 2 Then ElseIf Draw_Grating.measureLabels(mesName)(3) = 2 Then
Draw_Grating.measureLabels(mesName)(0) = Draw_Grating.measureLabels(mesName)(0) - GUI.Controls("X_TextBox").Text Draw_Grating.measureLabels(mesName)(0) = Draw_Grating.measureLabels(mesName)(0) - Individual.Panel_Recesses.Controls("X_TextBox").Text
Draw_Grating.measureLabels(mesName)(1) = Draw_Grating.measureLabels(mesName)(1) - dXGUI / 2 Draw_Grating.measureLabels(mesName)(1) = Draw_Grating.measureLabels(mesName)(1) - dXGUI / 2
ElseIf Draw_Grating.measureLabels(mesName)(3) = 3 Then ElseIf Draw_Grating.measureLabels(mesName)(3) = 3 Then
Draw_Grating.measureLabels(mesName)(0) = Draw_Grating.measureLabels(mesName)(0) - GUI.Controls("Y_TextBox").Text Draw_Grating.measureLabels(mesName)(0) = Draw_Grating.measureLabels(mesName)(0) - Individual.Panel_Recesses.Controls("Y_TextBox").Text
Draw_Grating.measureLabels(mesName)(2) = Draw_Grating.measureLabels(mesName)(2) - dYGUI / 2 Draw_Grating.measureLabels(mesName)(2) = Draw_Grating.measureLabels(mesName)(2) - dYGUI / 2
Else Else
Draw_Grating.measureLabels(mesName)(0) = Draw_Grating.measureLabels(mesName)(0) - GUI.Controls("X_TextBox").Text Draw_Grating.measureLabels(mesName)(0) = Draw_Grating.measureLabels(mesName)(0) - Individual.Panel_Recesses.Controls("X_TextBox").Text
Draw_Grating.measureLabels(mesName)(1) = Draw_Grating.measureLabels(mesName)(1) + dXGUI / 2 Draw_Grating.measureLabels(mesName)(1) = Draw_Grating.measureLabels(mesName)(1) + dXGUI / 2
End If End If
End If End If
ElseIf mesName.Split("_")(0) = "SS1" AndAlso index + 2 = Data.pointsMeasurements(mesName)(1) Then ElseIf mesName.Split("_")(0) = "SS1" AndAlso index + 2 = Data.pointsMeasurements(mesName)(1) Then
If Draw_Grating.measureLabels(mesName)(3) = 1 Then If Draw_Grating.measureLabels(mesName)(3) = 1 Then
Draw_Grating.measureLabels(mesName)(0) = Draw_Grating.measureLabels(mesName)(0) - GUI.Controls("X_TextBox").Text Draw_Grating.measureLabels(mesName)(0) = Draw_Grating.measureLabels(mesName)(0) - Individual.Panel_Recesses.Controls("X_TextBox").Text
Draw_Grating.measureLabels(mesName)(1) = Draw_Grating.measureLabels(mesName)(1) + dXGUI / 2 Draw_Grating.measureLabels(mesName)(1) = Draw_Grating.measureLabels(mesName)(1) + dXGUI / 2
Draw_Grating.sideSquareMesLine(mesName)(0) = Draw_Grating.sideSquareMesLine(mesName)(0) + dXGUI Draw_Grating.sideSquareMesLine(mesName)(0) = Draw_Grating.sideSquareMesLine(mesName)(0) + dXGUI
@ -209,16 +216,16 @@
Data.pointsMeasurements.Add("S_" & mesNum + 1, {index + 2, index + 3, 4}) Data.pointsMeasurements.Add("S_" & mesNum + 1, {index + 2, index + 3, 4})
' Add recess measurments (GUI) ' Add recess measurments (GUI)
Draw_Grating.measureLabels.Add("S_" & mesNum, {CInt(GUI.Controls("X_TextBox").Text), pXGUI + dXGUI / 2 - 8, Draw_Grating.measureLabels.Add("S_" & mesNum, {CInt(Individual.Panel_Recesses.Controls("X_TextBox").Text), pXGUI + dXGUI / 2 - 8,
pYGUI + dYGUI + 3, 1}) pYGUI + dYGUI + 3, 1})
Draw_Grating.measureLabels.Add("S_" & mesNum + 1, {CInt(GUI.Controls("Y_TextBox").Text), pXGUI + dXGUI + 3, Draw_Grating.measureLabels.Add("S_" & mesNum + 1, {CInt(Individual.Panel_Recesses.Controls("Y_TextBox").Text), pXGUI + dXGUI + 3,
pYGUI + dYGUI / 2 - 4, 1}) pYGUI + dYGUI / 2 - 4, 1})
' Recess Data ' Recess Data
Data.recessData.Rows(Data.recessData.Rows.Count - 1)("RECESS TYPE") = "SQUARE" Data.recessData.Rows(Data.recessData.Rows.Count - 1)("RECESS TYPE") = "SQUARE"
Data.recessData.Rows(Data.recessData.Rows.Count - 1)("CORNER") = 1 Data.recessData.Rows(Data.recessData.Rows.Count - 1)("CORNER") = 1
Data.recessData.Rows(Data.recessData.Rows.Count - 1)("WIDTH") = CInt(GUI.Controls("Y_TextBox").Text) 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(GUI.Controls("X_TextBox").Text) Data.recessData.Rows(Data.recessData.Rows.Count - 1)("LENGTH") = CInt(Individual.Panel_Recesses.Controls("X_TextBox").Text)
ElseIf pointQuadrant = 2 Then ElseIf pointQuadrant = 2 Then
' Add the new points ' Add the new points
@ -246,16 +253,16 @@
Data.pointsMeasurements.Add("S_" & mesNum + 1, {index + 2, index + 3, 1}) Data.pointsMeasurements.Add("S_" & mesNum + 1, {index + 2, index + 3, 1})
' Add recess measurments (GUI) ' Add recess measurments (GUI)
Draw_Grating.measureLabels.Add("S_" & mesNum, {CInt(GUI.Controls("Y_TextBox").Text), pXGUI - dXGUI - 18 - 3, Draw_Grating.measureLabels.Add("S_" & mesNum, {CInt(Individual.Panel_Recesses.Controls("Y_TextBox").Text), pXGUI - dXGUI - 18 - 3,
pYGUI + dYGUI / 2 - 4, 2}) pYGUI + dYGUI / 2 - 4, 2})
Draw_Grating.measureLabels.Add("S_" & mesNum + 1, {CInt(GUI.Controls("X_TextBox").Text), pXGUI - dXGUI / 2 - 8, Draw_Grating.measureLabels.Add("S_" & mesNum + 1, {CInt(Individual.Panel_Recesses.Controls("X_TextBox").Text), pXGUI - dXGUI / 2 - 8,
pYGUI + dYGUI + 3, 2}) pYGUI + dYGUI + 3, 2})
' Recess Data ' Recess Data
Data.recessData.Rows(Data.recessData.Rows.Count - 1)("RECESS TYPE") = "SQUARE" Data.recessData.Rows(Data.recessData.Rows.Count - 1)("RECESS TYPE") = "SQUARE"
Data.recessData.Rows(Data.recessData.Rows.Count - 1)("CORNER") = 2 Data.recessData.Rows(Data.recessData.Rows.Count - 1)("CORNER") = 2
Data.recessData.Rows(Data.recessData.Rows.Count - 1)("WIDTH") = CInt(GUI.Controls("Y_TextBox").Text) 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(GUI.Controls("X_TextBox").Text) Data.recessData.Rows(Data.recessData.Rows.Count - 1)("LENGTH") = CInt(Individual.Panel_Recesses.Controls("X_TextBox").Text)
ElseIf pointQuadrant = 3 Then ElseIf pointQuadrant = 3 Then
' Add the new points ' Add the new points
@ -282,16 +289,16 @@
Data.pointsMeasurements.Add("S_" & mesNum + 1, {index + 2, index + 3, 2}) Data.pointsMeasurements.Add("S_" & mesNum + 1, {index + 2, index + 3, 2})
' Add recess measurments (GUI) ' Add recess measurments (GUI)
Draw_Grating.measureLabels.Add("S_" & mesNum, {CInt(GUI.Controls("X_TextBox").Text), pXGUI - dXGUI / 2 - 8, Draw_Grating.measureLabels.Add("S_" & mesNum, {CInt(Individual.Panel_Recesses.Controls("X_TextBox").Text), pXGUI - dXGUI / 2 - 8,
pYGUI - dYGUI - 12 - 3, 3}) pYGUI - dYGUI - 12 - 3, 3})
Draw_Grating.measureLabels.Add("S_" & mesNum + 1, {CInt(GUI.Controls("Y_TextBox").Text), pXGUI - dXGUI - 18 - 3, Draw_Grating.measureLabels.Add("S_" & mesNum + 1, {CInt(Individual.Panel_Recesses.Controls("Y_TextBox").Text), pXGUI - dXGUI - 18 - 3,
pYGUI - dYGUI / 2 - 4, 3}) pYGUI - dYGUI / 2 - 4, 3})
' Recess Data ' Recess Data
Data.recessData.Rows(Data.recessData.Rows.Count - 1)("RECESS TYPE") = "SQUARE" Data.recessData.Rows(Data.recessData.Rows.Count - 1)("RECESS TYPE") = "SQUARE"
Data.recessData.Rows(Data.recessData.Rows.Count - 1)("CORNER") = 3 Data.recessData.Rows(Data.recessData.Rows.Count - 1)("CORNER") = 3
Data.recessData.Rows(Data.recessData.Rows.Count - 1)("WIDTH") = CInt(GUI.Controls("Y_TextBox").Text) 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(GUI.Controls("X_TextBox").Text) Data.recessData.Rows(Data.recessData.Rows.Count - 1)("LENGTH") = CInt(Individual.Panel_Recesses.Controls("X_TextBox").Text)
Else Else
' Add the new points ' Add the new points
@ -315,16 +322,16 @@
Data.pointsMeasurements.Add("S_" & mesNum + 1, {index + 2, index + 3, 3}) Data.pointsMeasurements.Add("S_" & mesNum + 1, {index + 2, index + 3, 3})
' Add recess measurments (GUI) ' Add recess measurments (GUI)
Draw_Grating.measureLabels.Add("S_" & mesNum, {CInt(GUI.Controls("Y_TextBox").Text), pXGUI + dXGUI + 3, Draw_Grating.measureLabels.Add("S_" & mesNum, {CInt(Individual.Panel_Recesses.Controls("Y_TextBox").Text), pXGUI + dXGUI + 3,
pYGUI - dYGUI / 2 - 4, 4}) pYGUI - dYGUI / 2 - 4, 4})
Draw_Grating.measureLabels.Add("S_" & mesNum + 1, {CInt(GUI.Controls("X_TextBox").Text), pXGUI + dXGUI / 2 - 8, Draw_Grating.measureLabels.Add("S_" & mesNum + 1, {CInt(Individual.Panel_Recesses.Controls("X_TextBox").Text), pXGUI + dXGUI / 2 - 8,
pYGUI - dYGUI - 12 - 3, 4}) pYGUI - dYGUI - 12 - 3, 4})
' Recess Data ' Recess Data
Data.recessData.Rows(Data.recessData.Rows.Count - 1)("RECESS TYPE") = "SQUARE" Data.recessData.Rows(Data.recessData.Rows.Count - 1)("RECESS TYPE") = "SQUARE"
Data.recessData.Rows(Data.recessData.Rows.Count - 1)("CORNER") = 4 Data.recessData.Rows(Data.recessData.Rows.Count - 1)("CORNER") = 4
Data.recessData.Rows(Data.recessData.Rows.Count - 1)("WIDTH") = CInt(GUI.Controls("Y_TextBox").Text) 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(GUI.Controls("X_TextBox").Text) Data.recessData.Rows(Data.recessData.Rows.Count - 1)("LENGTH") = CInt(Individual.Panel_Recesses.Controls("X_TextBox").Text)
End If End If
Data.gratingPoints.Rows.InsertAt(pointRow1, index + 1) Data.gratingPoints.Rows.InsertAt(pointRow1, index + 1)
@ -333,22 +340,27 @@
Data.gratingPoints.Rows.RemoveAt(index) Data.gratingPoints.Rows.RemoveAt(index)
'Redraw grating 'Redraw grating
GUI.DrawingPanel.Refresh() Individual.Panel_Grating.Refresh()
RemoveHandler GUI.Controls("X_TextBox").TextChanged, AddressOf FunctionTextCorner_Changed RemoveHandler Individual.Panel_Recesses.Controls("X_TextBox").TextChanged, AddressOf FunctionTextCorner_Changed
RemoveHandler GUI.Controls("X_TextBox").KeyPress, AddressOf FunctionText_KeyPress RemoveHandler Individual.Panel_Recesses.Controls("X_TextBox").KeyPress, AddressOf FunctionText_KeyPress
GUI.Controls.RemoveByKey("X_TextBox") Individual.Panel_Recesses.Controls.RemoveByKey("X_TextBox")
RemoveHandler GUI.Controls("Y_TextBox").TextChanged, AddressOf FunctionTextCorner_Changed RemoveHandler Individual.Panel_Recesses.Controls("Y_TextBox").TextChanged, AddressOf FunctionTextCorner_Changed
RemoveHandler GUI.Controls("Y_TextBox").KeyPress, AddressOf FunctionText_KeyPress RemoveHandler Individual.Panel_Recesses.Controls("Y_TextBox").KeyPress, AddressOf FunctionText_KeyPress
GUI.Controls.RemoveByKey("Y_TextBox") Individual.Panel_Recesses.Controls.RemoveByKey("Y_TextBox")
GUI.Controls.RemoveByKey("X_Label") Individual.Panel_Recesses.Controls.RemoveByKey("X_Label")
GUI.Controls.RemoveByKey("Y_Label") Individual.Panel_Recesses.Controls.RemoveByKey("Y_Label")
GUI.Controls("AngleButton").Enabled = True Individual.Panel_Recesses.Controls("Button_Square_Side").Left = Individual.Panel_Recesses.Controls("Button_Square_Side").Left - buttonOffset
GUI.Controls("Button_Square").Enabled = True Individual.Panel_Recesses.Controls("Button_Square_Middle").Left = Individual.Panel_Recesses.Controls("Button_Square_Middle").Left - buttonOffset
GUI.Controls("Button_SquareSide").Enabled = True
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
End Sub End Sub
' --- Determines the clicked points quadrant --- ' --- Determines the clicked points quadrant ---

View File

@ -1,30 +1,36 @@
Public Class Side_Rectangle Public Class Side_Rectangle
Private Shared buttonOffset As Integer
Private Shared sideSquareValues(3) As Integer Private Shared sideSquareValues(3) As Integer
Private Shared numOfSideRectangles As Integer = 0 Private Shared numOfSideRectangles As Integer = 0
' --- Create textboxes when user clicks the rectangle side recess button --- ' --- Create textboxes when user clicks the rectangle side recess button ---
Public Shared Sub SquareSideButtton(sender As Object, e As EventArgs) Public Shared Sub SquareSideButtton(sender As Object, e As EventArgs)
GUI.Controls("AngleButton").Enabled = False Individual.Panel_Recesses.Controls("Button_Angle_Corner").Enabled = False
GUI.Controls("Button_Square").Enabled = False Individual.Panel_Recesses.Controls("Button_Angle_Side").Enabled = False
GUI.Controls("Button_SquareSide").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 = GUI.Controls("Button_SquareSide").Location.X Dim buttonX As Integer = Individual.Panel_Recesses.Controls("Button_Square_Side").Location.X + Individual.Panel_Recesses.Controls("Button_Square_Side").Width
Dim buttonY As Integer = GUI.Controls("Button_SquareSide").Location.Y Dim buttonY As Integer = Individual.Panel_Recesses.Controls("Button_Square_Side").Location.Y
GUI.Create_TextBox("X_TextBox", "", buttonX + 20, buttonY + 40, 60) Individual.Create_TextBox_Recesses("Y_TextBox", "", buttonX + 60, buttonY - 7, 60)
AddHandler GUI.Controls("X_TextBox").TextChanged, AddressOf FunctionTextSide_Changed AddHandler Individual.Panel_Recesses.Controls("Y_TextBox").TextChanged, AddressOf FunctionTextSide_Changed
AddHandler GUI.Controls("X_TextBox").KeyPress, AddressOf FunctionText_KeyPress AddHandler Individual.Panel_Recesses.Controls("Y_TextBox").KeyPress, AddressOf FunctionText_KeyPress
GUI.Create_LabelGUI("X_Label", "L", buttonX, buttonY + 43) Individual.Create_Label_Recesses("Y_Label", "Width", buttonX + 18, buttonY - 4)
GUI.Create_TextBox("Y_TextBox", "", buttonX + 130, buttonY + 40, 60) Individual.Create_TextBox_Recesses("X_TextBox", "", buttonX + 60, buttonY + 23, 60)
AddHandler GUI.Controls("Y_TextBox").TextChanged, AddressOf FunctionTextSide_Changed AddHandler Individual.Panel_Recesses.Controls("X_TextBox").TextChanged, AddressOf FunctionTextSide_Changed
AddHandler GUI.Controls("Y_TextBox").KeyPress, AddressOf FunctionText_KeyPress AddHandler Individual.Panel_Recesses.Controls("X_TextBox").KeyPress, AddressOf FunctionText_KeyPress
GUI.Create_LabelGUI("Y_Label", "W", buttonX + 110, buttonY + 43) Individual.Create_Label_Recesses("X_Label", "Length", buttonX + 10, buttonY + 26)
GUI.Create_TextBox("Off_TextBox", "", buttonX + 250, buttonY + 40, 60) Individual.Create_TextBox_Recesses("Off_TextBox", "", buttonX + 60, buttonY + 53, 60)
AddHandler GUI.Controls("Off_TextBox").TextChanged, AddressOf FunctionTextSide_Changed AddHandler Individual.Panel_Recesses.Controls("Off_TextBox").TextChanged, AddressOf FunctionTextSide_Changed
AddHandler GUI.Controls("Off_TextBox").KeyPress, AddressOf FunctionText_KeyPress AddHandler Individual.Panel_Recesses.Controls("Off_TextBox").KeyPress, AddressOf FunctionText_KeyPress
GUI.Create_LabelGUI("Off_Label", "Offset", buttonX + 210, buttonY + 43) Individual.Create_Label_Recesses("Off_Label", "Offset", buttonX + 16, buttonY + 56)
buttonOffset = 130
Individual.Panel_Recesses.Controls("Button_Square_Middle").Left = Individual.Panel_Recesses.Controls("Button_Square_Middle").Left + buttonOffset
End Sub End Sub
' --- Check the key pressed by the user --- ' --- Check the key pressed by the user ---
@ -35,9 +41,9 @@
' --- Adds clickable buttons for all sides if conditions are met --- ' --- Adds clickable buttons for all sides if conditions are met ---
Private Shared Sub FunctionTextSide_Changed(sender As TextBox, e As EventArgs) Private Shared Sub FunctionTextSide_Changed(sender As TextBox, e As EventArgs)
Try Try
sideSquareValues(0) = CInt(GUI.Controls("X_TextBox").Text) sideSquareValues(0) = CInt(Individual.Panel_Recesses.Controls("X_TextBox").Text)
sideSquareValues(1) = CInt(GUI.Controls("Y_TextBox").Text) sideSquareValues(1) = CInt(Individual.Panel_Recesses.Controls("Y_TextBox").Text)
sideSquareValues(2) = CInt(GUI.Controls("Off_TextBox").Text) sideSquareValues(2) = CInt(Individual.Panel_Recesses.Controls("Off_TextBox").Text)
Catch ex As Exception Catch ex As Exception
sideSquareValues(0) = 0 sideSquareValues(0) = 0
sideSquareValues(1) = 0 sideSquareValues(1) = 0
@ -45,7 +51,7 @@
End Try End Try
If sideSquareValues(0) > 0 AndAlso sideSquareValues(1) > 0 AndAlso sideSquareValues(2) > 0 Then If sideSquareValues(0) > 0 AndAlso sideSquareValues(1) > 0 AndAlso sideSquareValues(2) > 0 Then
If GUI.DrawingPanel.Controls.Count = 2 Then If Individual.Panel_Grating.Controls.Count = 2 Then
For i = 1 To 4 For i = 1 To 4
Dim sidePoints As New List(Of String) Dim sidePoints As New List(Of String)
If i = 1 Then If i = 1 Then
@ -71,30 +77,30 @@
Next Next
Else Else
' Update button size and position ' Update button size and position
For i = 2 To GUI.DrawingPanel.Controls.Count - 1 For i = 2 To Individual.Panel_Grating.Controls.Count - 1
Dim buttonSide As Integer = CInt(GUI.DrawingPanel.Controls(i).Name.Split("_")(1)) Dim buttonSide As Integer = CInt(Individual.Panel_Grating.Controls(i).Name.Split("_")(1))
If buttonSide = 1 Then If buttonSide = 1 Then
GUI.DrawingPanel.Controls(i).Width = sideSquareValues(0) / (Data.scaleDiff) Individual.Panel_Grating.Controls(i).Width = sideSquareValues(0) / (Data.scaleDiff)
GUI.DrawingPanel.Controls(i).Left = Data.grossAreaPoints.Rows(0)("GUI X") + sideSquareValues(2) / (Data.scaleDiff) Individual.Panel_Grating.Controls(i).Left = Data.grossAreaPoints.Rows(0)("GUI X") + sideSquareValues(2) / (Data.scaleDiff)
ElseIf buttonSide = 2 Then ElseIf buttonSide = 2 Then
GUI.DrawingPanel.Controls(i).Height = sideSquareValues(1) / (Data.scaleDiff) Individual.Panel_Grating.Controls(i).Height = sideSquareValues(1) / (Data.scaleDiff)
GUI.DrawingPanel.Controls(i).Top = Data.grossAreaPoints.Rows(1)("GUI Y") + sideSquareValues(2) / (Data.scaleDiff) Individual.Panel_Grating.Controls(i).Top = Data.grossAreaPoints.Rows(1)("GUI Y") + sideSquareValues(2) / (Data.scaleDiff)
ElseIf buttonSide = 3 Then ElseIf buttonSide = 3 Then
GUI.DrawingPanel.Controls(i).Width = sideSquareValues(0) / (Data.scaleDiff) Individual.Panel_Grating.Controls(i).Width = sideSquareValues(0) / (Data.scaleDiff)
GUI.DrawingPanel.Controls(i).Left = Data.grossAreaPoints.Rows(2)("GUI X") - sideSquareValues(2) / (Data.scaleDiff) - GUI.DrawingPanel.Controls(i).Width Individual.Panel_Grating.Controls(i).Left = Data.grossAreaPoints.Rows(2)("GUI X") - sideSquareValues(2) / (Data.scaleDiff) - Individual.Panel_Grating.Controls(i).Width
Else Else
GUI.DrawingPanel.Controls(i).Height = sideSquareValues(1) / (Data.scaleDiff) Individual.Panel_Grating.Controls(i).Height = sideSquareValues(1) / (Data.scaleDiff)
GUI.DrawingPanel.Controls(i).Top = Data.grossAreaPoints.Rows(3)("GUI Y") - sideSquareValues(2) / (Data.scaleDiff) - GUI.DrawingPanel.Controls(i).Height Individual.Panel_Grating.Controls(i).Top = Data.grossAreaPoints.Rows(3)("GUI Y") - sideSquareValues(2) / (Data.scaleDiff) - Individual.Panel_Grating.Controls(i).Height
End If End If
Next Next
End If End If
ElseIf GUI.DrawingPanel.Controls.Count > 2 Then ElseIf Individual.Panel_Grating.Controls.Count > 2 Then
For i = 2 To GUI.DrawingPanel.Controls.Count - 1 For i = 2 To Individual.Panel_Grating.Controls.Count - 1
RemoveHandler GUI.DrawingPanel.Controls(2).Click, AddressOf SideButton_Click RemoveHandler Individual.Panel_Grating.Controls(2).Click, AddressOf SideButton_Click
GUI.DrawingPanel.Controls.RemoveAt(2) Individual.Panel_Grating.Controls.RemoveAt(2)
Next Next
End If End If
End Sub End Sub
@ -116,7 +122,7 @@
sideButton.FlatAppearance.MouseOverBackColor = Color.Red sideButton.FlatAppearance.MouseOverBackColor = Color.Red
sideButton.FlatAppearance.MouseDownBackColor = Color.DarkRed sideButton.FlatAppearance.MouseDownBackColor = Color.DarkRed
GUI.DrawingPanel.Controls.Add(sideButton) Individual.Panel_Grating.Controls.Add(sideButton)
AddHandler sideButton.Click, AddressOf SideButton_Click AddHandler sideButton.Click, AddressOf SideButton_Click
End Sub End Sub
@ -127,9 +133,9 @@
Dim sidePressed As Integer = CInt(sender.Name.Split("_")(1)) Dim sidePressed As Integer = CInt(sender.Name.Split("_")(1))
' Remove point buttons ' Remove point buttons
For i = 2 To GUI.DrawingPanel.Controls.Count - 1 For i = 2 To Individual.Panel_Grating.Controls.Count - 1
RemoveHandler GUI.DrawingPanel.Controls(2).Click, AddressOf SideButton_Click RemoveHandler Individual.Panel_Grating.Controls(2).Click, AddressOf SideButton_Click
GUI.DrawingPanel.Controls.RemoveAt(2) Individual.Panel_Grating.Controls.RemoveAt(2)
Next Next
Dim sidePoints As New List(Of Integer) Dim sidePoints As New List(Of Integer)
@ -324,25 +330,25 @@
Data.grossAreaPoints.Rows(0)("GUI Y") - 15}) Data.grossAreaPoints.Rows(0)("GUI Y") - 15})
' Add recess measurments (GUI) ' Add recess measurments (GUI)
Draw_Grating.measureLabels.Add("SS1_" & mesNum, {CInt(GUI.Controls("Off_TextBox").Text) - (Data.gratingPoints.Rows(index)("X") * 1000 + Data.gratingL / 2), 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") + sideSquareValues(2) / Data.scaleDiff) / 2 - 8, (Data.gratingPoints.Rows(index)("GUI X") + Data.grossAreaPoints.Rows(0)("GUI X") + sideSquareValues(2) / Data.scaleDiff) / 2 - 8,
Data.grossAreaPoints.Rows(0)("GUI Y") - 15 - 12 - 3, Data.grossAreaPoints.Rows(0)("GUI Y") - 15 - 12 - 3,
1}) '15 är linjen, 12 är textens höjd, 3 är lite extra 1}) '15 är linjen, 12 är textens höjd, 3 är lite extra
Draw_Grating.measureLabels.Add("SS_" & mesNum + 1, {CInt(GUI.Controls("X_TextBox").Text), Draw_Grating.measureLabels.Add("SS_" & mesNum + 1, {CInt(Individual.Panel_Recesses.Controls("X_TextBox").Text),
Data.grossAreaPoints.Rows(0)("GUI X") + sideSquareValues(2) / (Data.scaleDiff) + CInt(GUI.Controls("X_TextBox").Text) / (2 * Data.scaleDiff) - 8, Data.grossAreaPoints.Rows(0)("GUI X") + sideSquareValues(2) / (Data.scaleDiff) + CInt(Individual.Panel_Recesses.Controls("X_TextBox").Text) / (2 * Data.scaleDiff) - 8,
Data.grossAreaPoints.Rows(0)("GUI Y") + sideSquareValues(1) / (Data.scaleDiff) + 3, Data.grossAreaPoints.Rows(0)("GUI Y") + sideSquareValues(1) / (Data.scaleDiff) + 3,
1}) 1})
Draw_Grating.measureLabels.Add("SS_" & mesNum + 2, {CInt(GUI.Controls("Y_TextBox").Text), Draw_Grating.measureLabels.Add("SS_" & mesNum + 2, {CInt(Individual.Panel_Recesses.Controls("Y_TextBox").Text),
Data.grossAreaPoints.Rows(0)("GUI X") + sideSquareValues(2) / Data.scaleDiff - 18 - 3, Data.grossAreaPoints.Rows(0)("GUI X") + sideSquareValues(2) / Data.scaleDiff - 18 - 3,
Data.grossAreaPoints.Rows(0)("GUI Y") + CInt(GUI.Controls("Y_TextBox").Text) / (2 * Data.scaleDiff) - 4, Data.grossAreaPoints.Rows(0)("GUI Y") + CInt(Individual.Panel_Recesses.Controls("Y_TextBox").Text) / (2 * Data.scaleDiff) - 4,
1}) 1})
' Recess Data ' Recess Data
Data.recessData.Rows(Data.recessData.Rows.Count - 1)("RECESS TYPE") = "SIDE SQUARE" Data.recessData.Rows(Data.recessData.Rows.Count - 1)("RECESS TYPE") = "SIDE SQUARE"
Data.recessData.Rows(Data.recessData.Rows.Count - 1)("SIDE") = 1 Data.recessData.Rows(Data.recessData.Rows.Count - 1)("SIDE") = 1
Data.recessData.Rows(Data.recessData.Rows.Count - 1)("WIDTH") = CInt(GUI.Controls("Y_TextBox").Text) 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(GUI.Controls("X_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") = CInt(GUI.Controls("Off_TextBox").Text) Data.recessData.Rows(Data.recessData.Rows.Count - 1)("OFFSET") = CInt(Individual.Panel_Recesses.Controls("Off_TextBox").Text)
ElseIf sidePressed = 2 Then ElseIf sidePressed = 2 Then
' Add the new points ' Add the new points
@ -381,17 +387,17 @@
Data.grossAreaPoints.Rows(1)("GUI Y") + sideSquareValues(2) / Data.scaleDiff}) Data.grossAreaPoints.Rows(1)("GUI Y") + sideSquareValues(2) / Data.scaleDiff})
' Add recess measurments (GUI) ' Add recess measurments (GUI)
Draw_Grating.measureLabels.Add("SS1_" & mesNum, {CInt(GUI.Controls("Off_TextBox").Text) - (Data.gratingW / 2 - Data.gratingPoints.Rows(index)("Y") * 1000), Draw_Grating.measureLabels.Add("SS1_" & mesNum, {CInt(Individual.Panel_Recesses.Controls("Off_TextBox").Text) - (Data.gratingW / 2 - Data.gratingPoints.Rows(index)("Y") * 1000),
Data.grossAreaPoints.Rows(1)("GUI X") + 15 + 3, Data.grossAreaPoints.Rows(1)("GUI X") + 15 + 3,
(Data.gratingPoints.Rows(index)("GUI Y") + Data.grossAreaPoints.Rows(1)("GUI Y") + sideSquareValues(2) / Data.scaleDiff) / 2 - 4, (Data.gratingPoints.Rows(index)("GUI Y") + Data.grossAreaPoints.Rows(1)("GUI Y") + sideSquareValues(2) / Data.scaleDiff) / 2 - 4,
2}) 2})
Draw_Grating.measureLabels.Add("SS_" & mesNum + 1, {CInt(GUI.Controls("Y_TextBox").Text), Draw_Grating.measureLabels.Add("SS_" & mesNum + 1, {CInt(Individual.Panel_Recesses.Controls("Y_TextBox").Text),
Data.grossAreaPoints.Rows(1)("GUI X") - sideSquareValues(0) / Data.scaleDiff - 18 - 3, Data.grossAreaPoints.Rows(1)("GUI X") - sideSquareValues(0) / Data.scaleDiff - 18 - 3,
Data.grossAreaPoints.Rows(1)("GUI Y") + (sideSquareValues(2) + sideSquareValues(1) / 2) / Data.scaleDiff - 4, Data.grossAreaPoints.Rows(1)("GUI Y") + (sideSquareValues(2) + sideSquareValues(1) / 2) / Data.scaleDiff - 4,
2}) 2})
Draw_Grating.measureLabels.Add("SS_" & mesNum + 2, {CInt(GUI.Controls("X_TextBox").Text), Draw_Grating.measureLabels.Add("SS_" & mesNum + 2, {CInt(Individual.Panel_Recesses.Controls("X_TextBox").Text),
Data.grossAreaPoints.Rows(1)("GUI X") - sideSquareValues(0) / (2 * Data.scaleDiff) - 8, Data.grossAreaPoints.Rows(1)("GUI X") - sideSquareValues(0) / (2 * Data.scaleDiff) - 8,
Data.grossAreaPoints.Rows(1)("GUI Y") + sideSquareValues(2) / Data.scaleDiff - 15 - 3, Data.grossAreaPoints.Rows(1)("GUI Y") + sideSquareValues(2) / Data.scaleDiff - 15 - 3,
2}) 2})
@ -399,9 +405,9 @@
' Recess Data ' Recess Data
Data.recessData.Rows(Data.recessData.Rows.Count - 1)("RECESS TYPE") = "SIDE SQUARE" Data.recessData.Rows(Data.recessData.Rows.Count - 1)("RECESS TYPE") = "SIDE SQUARE"
Data.recessData.Rows(Data.recessData.Rows.Count - 1)("SIDE") = 2 Data.recessData.Rows(Data.recessData.Rows.Count - 1)("SIDE") = 2
Data.recessData.Rows(Data.recessData.Rows.Count - 1)("WIDTH") = CInt(GUI.Controls("Y_TextBox").Text) 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(GUI.Controls("X_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") = CInt(GUI.Controls("Off_TextBox").Text) Data.recessData.Rows(Data.recessData.Rows.Count - 1)("OFFSET") = CInt(Individual.Panel_Recesses.Controls("Off_TextBox").Text)
ElseIf sidePressed = 3 Then ElseIf sidePressed = 3 Then
' Add the new points ' Add the new points
@ -437,25 +443,25 @@
Data.grossAreaPoints.Rows(2)("GUI Y") + 15}) Data.grossAreaPoints.Rows(2)("GUI Y") + 15})
' Add recess measurments (GUI) ' Add recess measurments (GUI)
Draw_Grating.measureLabels.Add("SS1_" & mesNum, {CInt(GUI.Controls("Off_TextBox").Text) - (Data.gratingL / 2 - Data.gratingPoints.Rows(index)("X") * 1000), Draw_Grating.measureLabels.Add("SS1_" & mesNum, {CInt(Individual.Panel_Recesses.Controls("Off_TextBox").Text) - (Data.gratingL / 2 - Data.gratingPoints.Rows(index)("X") * 1000),
(Data.gratingPoints.Rows(index)("GUI X") + Data.grossAreaPoints.Rows(2)("GUI X") - sideSquareValues(2) / Data.scaleDiff) / 2 - 8, (Data.gratingPoints.Rows(index)("GUI X") + Data.grossAreaPoints.Rows(2)("GUI X") - sideSquareValues(2) / Data.scaleDiff) / 2 - 8,
Data.grossAreaPoints.Rows(2)("GUI Y") + 15 + 3, Data.grossAreaPoints.Rows(2)("GUI Y") + 15 + 3,
3}) '15 är linjen, 12 är textens höjd, 3 är lite extra 3}) '15 är linjen, 12 är textens höjd, 3 är lite extra
Draw_Grating.measureLabels.Add("SS_" & mesNum + 1, {CInt(GUI.Controls("X_TextBox").Text), Draw_Grating.measureLabels.Add("SS_" & mesNum + 1, {CInt(Individual.Panel_Recesses.Controls("X_TextBox").Text),
Data.grossAreaPoints.Rows(2)("GUI X") - sideSquareValues(2) / (Data.scaleDiff) - CInt(GUI.Controls("X_TextBox").Text) / (2 * Data.scaleDiff) - 8, Data.grossAreaPoints.Rows(2)("GUI X") - sideSquareValues(2) / (Data.scaleDiff) - CInt(Individual.Panel_Recesses.Controls("X_TextBox").Text) / (2 * Data.scaleDiff) - 8,
Data.grossAreaPoints.Rows(2)("GUI Y") - sideSquareValues(1) / (Data.scaleDiff) - 12 - 3, Data.grossAreaPoints.Rows(2)("GUI Y") - sideSquareValues(1) / (Data.scaleDiff) - 12 - 3,
3}) 3})
Draw_Grating.measureLabels.Add("SS_" & mesNum + 2, {CInt(GUI.Controls("Y_TextBox").Text), Draw_Grating.measureLabels.Add("SS_" & mesNum + 2, {CInt(Individual.Panel_Recesses.Controls("Y_TextBox").Text),
Data.grossAreaPoints.Rows(2)("GUI X") - sideSquareValues(2) / Data.scaleDiff + 3, Data.grossAreaPoints.Rows(2)("GUI X") - sideSquareValues(2) / Data.scaleDiff + 3,
Data.grossAreaPoints.Rows(2)("GUI Y") - CInt(GUI.Controls("Y_TextBox").Text) / (2 * Data.scaleDiff) - 4, Data.grossAreaPoints.Rows(2)("GUI Y") - CInt(Individual.Panel_Recesses.Controls("Y_TextBox").Text) / (2 * Data.scaleDiff) - 4,
3}) 3})
' Recess Data ' Recess Data
Data.recessData.Rows(Data.recessData.Rows.Count - 1)("RECESS TYPE") = "SIDE SQUARE" Data.recessData.Rows(Data.recessData.Rows.Count - 1)("RECESS TYPE") = "SIDE SQUARE"
Data.recessData.Rows(Data.recessData.Rows.Count - 1)("SIDE") = 3 Data.recessData.Rows(Data.recessData.Rows.Count - 1)("SIDE") = 3
Data.recessData.Rows(Data.recessData.Rows.Count - 1)("WIDTH") = CInt(GUI.Controls("Y_TextBox").Text) 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(GUI.Controls("X_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") = CInt(GUI.Controls("Off_TextBox").Text) Data.recessData.Rows(Data.recessData.Rows.Count - 1)("OFFSET") = CInt(Individual.Panel_Recesses.Controls("Off_TextBox").Text)
Else Else
' Add the new points ' Add the new points
@ -491,17 +497,17 @@
Data.grossAreaPoints.Rows(3)("GUI Y") - sideSquareValues(2) / Data.scaleDiff}) Data.grossAreaPoints.Rows(3)("GUI Y") - sideSquareValues(2) / Data.scaleDiff})
' Add recess measurments (GUI) ' Add recess measurments (GUI)
Draw_Grating.measureLabels.Add("SS1_" & mesNum, {CInt(GUI.Controls("Off_TextBox").Text) - (Data.gratingW / 2 + Data.gratingPoints.Rows(index)("Y") * 1000), Draw_Grating.measureLabels.Add("SS1_" & mesNum, {CInt(Individual.Panel_Recesses.Controls("Off_TextBox").Text) - (Data.gratingW / 2 + Data.gratingPoints.Rows(index)("Y") * 1000),
Data.grossAreaPoints.Rows(3)("GUI X") - 15 - 18 - 3, Data.grossAreaPoints.Rows(3)("GUI X") - 15 - 18 - 3,
(Data.gratingPoints.Rows(index)("GUI Y") + Data.grossAreaPoints.Rows(3)("GUI Y") - sideSquareValues(2) / Data.scaleDiff) / 2 - 4, (Data.gratingPoints.Rows(index)("GUI Y") + Data.grossAreaPoints.Rows(3)("GUI Y") - sideSquareValues(2) / Data.scaleDiff) / 2 - 4,
4}) 4})
Draw_Grating.measureLabels.Add("SS_" & mesNum + 1, {CInt(GUI.Controls("Y_TextBox").Text), Draw_Grating.measureLabels.Add("SS_" & mesNum + 1, {CInt(Individual.Panel_Recesses.Controls("Y_TextBox").Text),
Data.grossAreaPoints.Rows(3)("GUI X") + sideSquareValues(0) / Data.scaleDiff + 3, Data.grossAreaPoints.Rows(3)("GUI X") + sideSquareValues(0) / Data.scaleDiff + 3,
Data.grossAreaPoints.Rows(3)("GUI Y") - (sideSquareValues(2) + sideSquareValues(1) / 2) / Data.scaleDiff - 4, Data.grossAreaPoints.Rows(3)("GUI Y") - (sideSquareValues(2) + sideSquareValues(1) / 2) / Data.scaleDiff - 4,
4}) 4})
Draw_Grating.measureLabels.Add("SS_" & mesNum + 2, {CInt(GUI.Controls("X_TextBox").Text), Draw_Grating.measureLabels.Add("SS_" & mesNum + 2, {CInt(Individual.Panel_Recesses.Controls("X_TextBox").Text),
Data.grossAreaPoints.Rows(3)("GUI X") + sideSquareValues(0) / (2 * Data.scaleDiff) - 8, Data.grossAreaPoints.Rows(3)("GUI X") + sideSquareValues(0) / (2 * Data.scaleDiff) - 8,
Data.grossAreaPoints.Rows(3)("GUI Y") - sideSquareValues(2) / Data.scaleDiff + 3, Data.grossAreaPoints.Rows(3)("GUI Y") - sideSquareValues(2) / Data.scaleDiff + 3,
4}) 4})
@ -509,9 +515,9 @@
' Recess Data ' Recess Data
Data.recessData.Rows(Data.recessData.Rows.Count - 1)("RECESS TYPE") = "SIDE SQUARE" Data.recessData.Rows(Data.recessData.Rows.Count - 1)("RECESS TYPE") = "SIDE SQUARE"
Data.recessData.Rows(Data.recessData.Rows.Count - 1)("SIDE") = 4 Data.recessData.Rows(Data.recessData.Rows.Count - 1)("SIDE") = 4
Data.recessData.Rows(Data.recessData.Rows.Count - 1)("WIDTH") = CInt(GUI.Controls("Y_TextBox").Text) 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(GUI.Controls("X_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") = CInt(GUI.Controls("Off_TextBox").Text) Data.recessData.Rows(Data.recessData.Rows.Count - 1)("OFFSET") = CInt(Individual.Panel_Recesses.Controls("Off_TextBox").Text)
End If End If
Data.gratingPoints.Rows.InsertAt(pointRow1, index + 1) Data.gratingPoints.Rows.InsertAt(pointRow1, index + 1)
@ -522,26 +528,32 @@
numOfSideRectangles += 1 numOfSideRectangles += 1
'Redraw grating 'Redraw grating
GUI.DrawingPanel.Refresh() Individual.Panel_Grating.Refresh()
RemoveHandler GUI.Controls("X_TextBox").TextChanged, AddressOf FunctionTextSide_Changed RemoveHandler Individual.Panel_Recesses.Controls("X_TextBox").TextChanged, AddressOf FunctionTextSide_Changed
RemoveHandler GUI.Controls("X_TextBox").KeyPress, AddressOf FunctionText_KeyPress RemoveHandler Individual.Panel_Recesses.Controls("X_TextBox").KeyPress, AddressOf FunctionText_KeyPress
GUI.Controls.RemoveByKey("X_TextBox") Individual.Panel_Recesses.Controls.RemoveByKey("X_TextBox")
RemoveHandler GUI.Controls("Y_TextBox").TextChanged, AddressOf FunctionTextSide_Changed RemoveHandler Individual.Panel_Recesses.Controls("Y_TextBox").TextChanged, AddressOf FunctionTextSide_Changed
RemoveHandler GUI.Controls("Y_TextBox").KeyPress, AddressOf FunctionText_KeyPress RemoveHandler Individual.Panel_Recesses.Controls("Y_TextBox").KeyPress, AddressOf FunctionText_KeyPress
GUI.Controls.RemoveByKey("Y_TextBox") Individual.Panel_Recesses.Controls.RemoveByKey("Y_TextBox")
RemoveHandler GUI.Controls("Off_TextBox").TextChanged, AddressOf FunctionTextSide_Changed RemoveHandler Individual.Panel_Recesses.Controls("Off_TextBox").TextChanged, AddressOf FunctionTextSide_Changed
RemoveHandler GUI.Controls("Off_TextBox").KeyPress, AddressOf FunctionText_KeyPress RemoveHandler Individual.Panel_Recesses.Controls("Off_TextBox").KeyPress, AddressOf FunctionText_KeyPress
GUI.Controls.RemoveByKey("Off_TextBox") Individual.Panel_Recesses.Controls.RemoveByKey("Off_TextBox")
GUI.Controls.RemoveByKey("X_Label") Individual.Panel_Recesses.Controls.RemoveByKey("X_Label")
GUI.Controls.RemoveByKey("Y_Label") Individual.Panel_Recesses.Controls.RemoveByKey("Y_Label")
GUI.Controls.RemoveByKey("Off_Label") Individual.Panel_Recesses.Controls.RemoveByKey("Off_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.Panel_Recesses.Controls("Button_Square_Middle").Left = Individual.Panel_Recesses.Controls("Button_Square_Middle").Left - buttonOffset
GUI.Controls("AngleButton").Enabled = True
GUI.Controls("Button_Square").Enabled = True
GUI.Controls("Button_SquareSide").Enabled = True
End Sub End Sub
End Class End Class

View File

@ -79,7 +79,7 @@ Public Class Drawing
Dim iPart As PartDoc Dim iPart As PartDoc
iPart = swApp.ActiveDoc iPart = swApp.ActiveDoc
Dim newName As String Dim newName As String
newName = GUI.filepath & "\Temp" & "\TESTPART" & 1 & ".SLDPRT" newName = Individual.filepath & "\Temp" & "\TESTPART" & 1 & ".SLDPRT"
Dim config As Configuration Dim config As Configuration
config = iPart.GetActiveConfiguration config = iPart.GetActiveConfiguration
@ -122,7 +122,7 @@ Public Class Drawing
Dim swSheet As Sheet Dim swSheet As Sheet
swSheet = iDrawing.GetCurrentSheet() swSheet = iDrawing.GetCurrentSheet()
swSheet.SetProperties2(12, 12, 1, 1, False, swSheetWidth, swSheetHeight, True) swSheet.SetProperties2(12, 12, 1, 1, False, swSheetWidth, swSheetHeight, True)
swSheet.SetTemplateName(GUI.filepath & "\X2021\Weland ritningsmallar\A3 Part.slddrt") swSheet.SetTemplateName(Individual.filepath & "\X2021\Weland ritningsmallar\A3 Part.slddrt")
swSheet.ReloadTemplate(True) swSheet.ReloadTemplate(True)
Dim layMgr As LayerMgr Dim layMgr As LayerMgr
@ -131,7 +131,7 @@ Public Class Drawing
status = layMgr.SetCurrentLayer("Svenska") status = layMgr.SetCurrentLayer("Svenska")
Dim myView As View Dim myView As View
myView = iDrawing.CreateDrawViewFromModelView3(GUI.filepath & "\Temp\TESTPART1.SLDPRT", "*Front", swSheetWidth / 2, swSheetHeight / 2, 0) myView = iDrawing.CreateDrawViewFromModelView3(Individual.filepath & "\Temp\TESTPART1.SLDPRT", "*Front", swSheetWidth / 2, swSheetHeight / 2, 0)
myView.UseSheetScale() = True myView.UseSheetScale() = True
Dim viewScale1, viewScale2 As Double Dim viewScale1, viewScale2 As Double
Dim lengthForDrawing As Integer = Data.gratingL Dim lengthForDrawing As Integer = Data.gratingL
@ -225,7 +225,7 @@ Public Class Drawing
Add_Dimensions(sortedMeasurments("Lmes"), CompName, myView, iDrawing, swExtensions, OutLine, scaleDecimal, X_Mid, Y_Mid) Add_Dimensions(sortedMeasurments("Lmes"), CompName, myView, iDrawing, swExtensions, OutLine, scaleDecimal, X_Mid, Y_Mid)
Add_Dimensions(sortedMeasurments("Wmes"), CompName, myView, iDrawing, swExtensions, OutLine, scaleDecimal, X_Mid, Y_Mid) Add_Dimensions(sortedMeasurments("Wmes"), CompName, myView, iDrawing, swExtensions, OutLine, scaleDecimal, X_Mid, Y_Mid)
Dim myView2 As View Dim myView2 As View
myView2 = iDrawing.CreateDrawViewFromModelView3(GUI.filepath & "\Temp\TESTPART1.SLDPRT", "*Bottom", swSheetWidth / 2, OutLine(3) + sideCounter(0) * 0.01 + 0.03, 0) myView2 = iDrawing.CreateDrawViewFromModelView3(Individual.filepath & "\Temp\TESTPART1.SLDPRT", "*Bottom", swSheetWidth / 2, OutLine(3) + sideCounter(0) * 0.01 + 0.03, 0)
myView2.UseSheetScale() = True myView2.UseSheetScale() = True
Dim OutLine2 = myView2.GetOutline Dim OutLine2 = myView2.GetOutline
@ -246,7 +246,7 @@ Public Class Drawing
Dim longstatus As Integer Dim longstatus As Integer
Dim newName As String Dim newName As String
newName = GUI.filepath & "\Temp" & "\TESTDRAWING" & 1 & ".SLDDRW" newName = Individual.filepath & "\Temp" & "\TESTDRAWING" & 1 & ".SLDDRW"
status = layMgr.AddLayer("Symbol", "", 0, 0, 2) status = layMgr.AddLayer("Symbol", "", 0, 0, 2)

View File

@ -97,13 +97,6 @@
<SubType>Form</SubType> <SubType>Form</SubType>
</Compile> </Compile>
<Compile Include="GUI\Settings.vb" /> <Compile Include="GUI\Settings.vb" />
<Compile Include="GUI\GUI.vb">
<SubType>Form</SubType>
</Compile>
<Compile Include="GUI\GUI.Designer.vb">
<DependentUpon>GUI.vb</DependentUpon>
<SubType>Form</SubType>
</Compile>
<Compile Include="My Project\AssemblyInfo.vb" /> <Compile Include="My Project\AssemblyInfo.vb" />
<Compile Include="My Project\Application.Designer.vb"> <Compile Include="My Project\Application.Designer.vb">
<AutoGen>True</AutoGen> <AutoGen>True</AutoGen>
@ -130,9 +123,6 @@
<EmbeddedResource Include="GUI\AppForm.resx"> <EmbeddedResource Include="GUI\AppForm.resx">
<DependentUpon>AppForm.vb</DependentUpon> <DependentUpon>AppForm.vb</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="GUI\GUI.resx">
<DependentUpon>GUI.vb</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="GUI\Individual.resx"> <EmbeddedResource Include="GUI\Individual.resx">
<DependentUpon>Individual.vb</DependentUpon> <DependentUpon>Individual.vb</DependentUpon>
</EmbeddedResource> </EmbeddedResource>