Changes in GUI

This commit is contained in:
Anton 2021-05-03 11:55:46 +02:00
parent 76fe9f1f67
commit 253127066f
27 changed files with 747 additions and 576 deletions

View File

@ -16,14 +16,20 @@ Public Class AppForm
Dim savedData As String() = System.IO.File.ReadAllLines(appDataPath & "\SavedData.txt") Dim savedData As String() = System.IO.File.ReadAllLines(appDataPath & "\SavedData.txt")
For i = 0 To savedData.Length - 1 For i = 0 To savedData.Length - 1
If savedData(i) = "Export Folder Path" Then If savedData(i) = Settings.exportFolderHead Then
Settings.exportFolder = savedData(i + 1) Settings.exportFolder = savedData(i + 1)
Main_Menu.Button_Order.Enabled = True ElseIf savedData(i) = Settings.KBUpdateTimeHead Then
Main_Menu.Label_SettingsError.Visible = False Settings.KBUpdateTime = savedData(i + 1)
ElseIf savedData(i) = Settings.SRNameHead Then
Settings.SRName = savedData(i + 1)
ElseIf savedData(i) = Settings.SRPhoneHead Then
Settings.SRPhone = savedData(i + 1)
ElseIf savedData(i) = Settings.SRMailHead Then
Settings.SRMail = savedData(i + 1)
End If End If
Next Next
'FIXA: Add for sales reps.
'FIXA: Kolla all settings data är ok Settings.Check_Settings()
Dim appDir As String = Application.StartupPath Dim appDir As String = Application.StartupPath
@ -44,10 +50,10 @@ Public Class AppForm
Next Next
Me.Width = 1400 Me.Width = 800
Me.Height = 800 Me.Height = 500
Me.Top = 20 Me.Top = 170
Me.Left = 50 Me.Left = 350
Panel_Start.Controls.Clear() Panel_Start.Controls.Clear()
Main_Menu.TopLevel = False Main_Menu.TopLevel = False
@ -66,14 +72,14 @@ Public Class AppForm
' Load XCC settings ' Load XCC settings
adminClass.loadSettings(Settings.filesFolder, Settings.HLCtFolder, "SolidWorks") adminClass.loadSettings(Settings.filesFolder, Settings.HLCtFolder, "SolidWorks")
Individual.ComboBox_Type.Items.Add("Pressure Welded") Grating_Configurator.ComboBox_Type.Items.Add("Pressure Welded")
Individual.ComboBox_Type.Items.Add("Type A") Grating_Configurator.ComboBox_Type.Items.Add("Type A")
For i = 25 To 55 Step 5 For i = 25 To 55 Step 5
Individual.ComboBox_Frame.Items.Add(i & " x " & i) Grating_Configurator.ComboBox_Frame.Items.Add(i & " x " & i)
Next Next
For i = 65 To 85 Step 10 For i = 65 To 85 Step 10
Individual.ComboBox_Frame.Items.Add(i & " x " & i) Grating_Configurator.ComboBox_Frame.Items.Add(i & " x " & i)
Next Next
End Sub End Sub

View File

@ -10,7 +10,7 @@
Public Shared Sub Load_DrawingPanel() Public Shared Sub Load_DrawingPanel()
AddHandler Individual.Panel_Grating.Paint, AddressOf DrawingPanel_Paint AddHandler Grating_Configurator.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 = Individual.Panel_Grating.Size.Width guiPanelL = Grating_Configurator.Panel_Grating.Size.Width
guiPanelW = Individual.Panel_Grating.Size.Height guiPanelW = Grating_Configurator.Panel_Grating.Size.Height
Data.guiPanelMidX = guiPanelL / 2 Data.guiPanelMidX = guiPanelL / 2
Data.guiPanelMidY = guiPanelW / 2 Data.guiPanelMidY = guiPanelW / 2
@ -147,7 +147,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
Individual.Panel_Grating.Refresh() Grating_Configurator.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,5 +1,5 @@
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> <Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()>
Partial Class Individual Partial Class Grating_Configurator
Inherits System.Windows.Forms.Form Inherits System.Windows.Forms.Form
'Form overrides dispose to clean up the component list. 'Form overrides dispose to clean up the component list.
@ -22,7 +22,7 @@ Partial Class Individual
'Do not modify it using the code editor. 'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> <System.Diagnostics.DebuggerStepThrough()>
Private Sub InitializeComponent() Private Sub InitializeComponent()
Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(Individual)) Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(Grating_Configurator))
Me.Panel_Data = New System.Windows.Forms.Panel() Me.Panel_Data = New System.Windows.Forms.Panel()
Me.Label8 = New System.Windows.Forms.Label() Me.Label8 = New System.Windows.Forms.Label()
Me.ComboBox_Frame = New System.Windows.Forms.ComboBox() Me.ComboBox_Frame = New System.Windows.Forms.ComboBox()

View File

@ -1,5 +1,5 @@
 
Public Class Individual Public Class Grating_Configurator
Sub Load_GUI() Sub Load_GUI()
' Initialize GUI ' Initialize GUI
@ -444,6 +444,11 @@ Public Class Individual
AppForm.Panel_Start.Controls.Clear() AppForm.Panel_Start.Controls.Clear()
Main_Menu.TopLevel = False Main_Menu.TopLevel = False
AppForm.Panel_Start.Controls.Add(Main_Menu) AppForm.Panel_Start.Controls.Add(Main_Menu)
AppForm.Width = 800
AppForm.Height = 500
AppForm.Top = 170
AppForm.Left = 350
Main_Menu.Show() Main_Menu.Show()
End Sub End Sub

View File

@ -31,8 +31,8 @@ Partial Class Main_Menu
' '
'Button_Settings 'Button_Settings
' '
Me.Button_Settings.Location = New System.Drawing.Point(68, 59) Me.Button_Settings.Location = New System.Drawing.Point(49, 47)
Me.Button_Settings.Margin = New System.Windows.Forms.Padding(2, 2, 2, 2) Me.Button_Settings.Margin = New System.Windows.Forms.Padding(2)
Me.Button_Settings.Name = "Button_Settings" Me.Button_Settings.Name = "Button_Settings"
Me.Button_Settings.Size = New System.Drawing.Size(127, 41) Me.Button_Settings.Size = New System.Drawing.Size(127, 41)
Me.Button_Settings.TabIndex = 5 Me.Button_Settings.TabIndex = 5
@ -42,7 +42,7 @@ Partial Class Main_Menu
'Button_Multiple 'Button_Multiple
' '
Me.Button_Multiple.Enabled = False Me.Button_Multiple.Enabled = False
Me.Button_Multiple.Location = New System.Drawing.Point(734, 439) Me.Button_Multiple.Location = New System.Drawing.Point(500, 296)
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 = 4 Me.Button_Multiple.TabIndex = 4
@ -52,7 +52,7 @@ Partial Class Main_Menu
'Button_Individual 'Button_Individual
' '
Me.Button_Individual.Enabled = False Me.Button_Individual.Enabled = False
Me.Button_Individual.Location = New System.Drawing.Point(734, 302) Me.Button_Individual.Location = New System.Drawing.Point(500, 166)
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 = 3 Me.Button_Individual.TabIndex = 3
@ -62,7 +62,7 @@ Partial Class Main_Menu
'Button_Order 'Button_Order
' '
Me.Button_Order.Enabled = False Me.Button_Order.Enabled = False
Me.Button_Order.Location = New System.Drawing.Point(194, 353) Me.Button_Order.Location = New System.Drawing.Point(132, 250)
Me.Button_Order.Name = "Button_Order" Me.Button_Order.Name = "Button_Order"
Me.Button_Order.Size = New System.Drawing.Size(117, 65) Me.Button_Order.Size = New System.Drawing.Size(117, 65)
Me.Button_Order.TabIndex = 7 Me.Button_Order.TabIndex = 7
@ -74,7 +74,7 @@ Partial Class Main_Menu
Me.Label_SettingsError.AutoSize = True Me.Label_SettingsError.AutoSize = True
Me.Label_SettingsError.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Label_SettingsError.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label_SettingsError.ForeColor = System.Drawing.Color.Red Me.Label_SettingsError.ForeColor = System.Drawing.Color.Red
Me.Label_SettingsError.Location = New System.Drawing.Point(215, 71) Me.Label_SettingsError.Location = New System.Drawing.Point(194, 59)
Me.Label_SettingsError.Margin = New System.Windows.Forms.Padding(2, 0, 2, 0) Me.Label_SettingsError.Margin = New System.Windows.Forms.Padding(2, 0, 2, 0)
Me.Label_SettingsError.Name = "Label_SettingsError" Me.Label_SettingsError.Name = "Label_SettingsError"
Me.Label_SettingsError.Size = New System.Drawing.Size(112, 17) Me.Label_SettingsError.Size = New System.Drawing.Size(112, 17)
@ -85,14 +85,14 @@ Partial Class Main_Menu
' '
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(1046, 627) Me.ClientSize = New System.Drawing.Size(800, 500)
Me.Controls.Add(Me.Label_SettingsError) Me.Controls.Add(Me.Label_SettingsError)
Me.Controls.Add(Me.Button_Order) Me.Controls.Add(Me.Button_Order)
Me.Controls.Add(Me.Button_Settings) Me.Controls.Add(Me.Button_Settings)
Me.Controls.Add(Me.Button_Multiple) Me.Controls.Add(Me.Button_Multiple)
Me.Controls.Add(Me.Button_Individual) Me.Controls.Add(Me.Button_Individual)
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None
Me.Margin = New System.Windows.Forms.Padding(2, 2, 2, 2) Me.Margin = New System.Windows.Forms.Padding(2)
Me.Name = "Main_Menu" Me.Name = "Main_Menu"
Me.Text = "Main_Menu" Me.Text = "Main_Menu"
Me.ResumeLayout(False) Me.ResumeLayout(False)

View File

@ -1,7 +1,6 @@
 
Public Class Main_Menu Public Class Main_Menu
Private Sub Generate_Folders() Private Sub Generate_Folders()
Settings.folderPaths.Add("object_" & Data.objectNum, Settings.folderPaths("order") & "\Object " & Data.objectNum) Settings.folderPaths.Add("object_" & Data.objectNum, Settings.folderPaths("order") & "\Object " & Data.objectNum)
System.IO.Directory.CreateDirectory(Settings.folderPaths("object_" & Data.objectNum)) System.IO.Directory.CreateDirectory(Settings.folderPaths("object_" & Data.objectNum))
@ -52,25 +51,30 @@ Public Class Main_Menu
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
If AppForm.fillMode = True Then If AppForm.fillMode = True Then
Individual.Panel_Data.Controls.RemoveByKey("Label_Max_Load") Grating_Configurator.Panel_Data.Controls.RemoveByKey("Label_Max_Load")
RemoveHandler Individual.Panel_Data.Controls("TextBox_Max_Load").KeyPress, AddressOf Individual.TextBox_Max_Load_KeyPress RemoveHandler Grating_Configurator.Panel_Data.Controls("TextBox_Max_Load").KeyPress, AddressOf Grating_Configurator.TextBox_Max_Load_KeyPress
Individual.Panel_Data.Controls.RemoveByKey("TextBox_Max_Load") Grating_Configurator.Panel_Data.Controls.RemoveByKey("TextBox_Max_Load")
Individual.Panel_Data.Controls.RemoveByKey("Label_Max_Load_Unit") Grating_Configurator.Panel_Data.Controls.RemoveByKey("Label_Max_Load_Unit")
Individual.Panel_Data.Controls.RemoveByKey("Label_Max_Weight") Grating_Configurator.Panel_Data.Controls.RemoveByKey("Label_Max_Weight")
RemoveHandler Individual.Panel_Data.Controls("TextBox_Max_Weight").KeyPress, AddressOf Individual.TextBox_Max_Load_KeyPress RemoveHandler Grating_Configurator.Panel_Data.Controls("TextBox_Max_Weight").KeyPress, AddressOf Grating_Configurator.TextBox_Max_Load_KeyPress
Individual.Panel_Data.Controls.RemoveByKey("TextBox_Max_Weight") Grating_Configurator.Panel_Data.Controls.RemoveByKey("TextBox_Max_Weight")
Individual.Panel_Data.Controls.RemoveByKey("Label_Max_Weight_Unit") Grating_Configurator.Panel_Data.Controls.RemoveByKey("Label_Max_Weight_Unit")
RemoveHandler Individual.Panel_Data.Controls("Button_Calculate").Click, AddressOf Individual.Button_Calculate_Click RemoveHandler Grating_Configurator.Panel_Data.Controls("Button_Calculate").Click, AddressOf Grating_Configurator.Button_Calculate_Click
Individual.Panel_Data.Controls.RemoveByKey("Button_Calculate") Grating_Configurator.Panel_Data.Controls.RemoveByKey("Button_Calculate")
End If End If
AppForm.fillMode = False AppForm.fillMode = False
AppForm.Panel_Start.Controls.Clear() AppForm.Panel_Start.Controls.Clear()
Individual.TopLevel = False Grating_Configurator.TopLevel = False
AppForm.Panel_Start.Controls.Add(Individual) AppForm.Panel_Start.Controls.Add(Grating_Configurator)
Individual.Load_GUI() AppForm.Width = 1400
Individual.Show() AppForm.Height = 800
AppForm.Top = 20
AppForm.Left = 50
Grating_Configurator.Load_GUI()
Grating_Configurator.Show()
Data.objectNum += 1 Data.objectNum += 1
Generate_Folders() Generate_Folders()
@ -79,10 +83,15 @@ Public Class Main_Menu
Private Sub Button_Multiple_Click(sender As Object, e As EventArgs) Handles Button_Multiple.Click Private Sub Button_Multiple_Click(sender As Object, e As EventArgs) Handles Button_Multiple.Click
AppForm.fillMode = True AppForm.fillMode = True
AppForm.Panel_Start.Controls.Clear() AppForm.Panel_Start.Controls.Clear()
Individual.TopLevel = False Grating_Configurator.TopLevel = False
AppForm.Panel_Start.Controls.Add(Individual) AppForm.Panel_Start.Controls.Add(Grating_Configurator)
Individual.Load_GUI() AppForm.Width = 1400
Individual.Show() AppForm.Height = 800
AppForm.Top = 20
AppForm.Left = 50
Grating_Configurator.Load_GUI()
Grating_Configurator.Show()
Data.objectNum += 1 Data.objectNum += 1
Generate_Folders() Generate_Folders()
@ -95,6 +104,9 @@ Public Class Main_Menu
AppForm.Panel_Start.Controls.Clear() AppForm.Panel_Start.Controls.Clear()
Settings.TopLevel = False Settings.TopLevel = False
AppForm.Panel_Start.Controls.Add(Settings) AppForm.Panel_Start.Controls.Add(Settings)
AppForm.Width = 800
AppForm.Height = 500
Settings.Init_Settings() Settings.Init_Settings()
Settings.Show() Settings.Show()
End Sub End Sub
@ -103,7 +115,7 @@ Public Class Main_Menu
Button_Individual.Enabled = True Button_Individual.Enabled = True
Button_Multiple.Enabled = True Button_Multiple.Enabled = True
Settings.folderPaths.Add("order", Settings.exportFolder & "\Order " & GUI_Export.Get_RandomNumber(1000, 9999)) Settings.folderPaths.Add("order", Settings.exportFolder & "\Order " & GUI_Export.Get_RandomNumber(10000, 99999))
System.IO.Directory.CreateDirectory(Settings.folderPaths("order")) System.IO.Directory.CreateDirectory(Settings.folderPaths("order"))
Data.objectNum = 0 Data.objectNum = 0

View File

@ -32,11 +32,17 @@ Partial Class Settings
Me.TextBox_Mail = New System.Windows.Forms.TextBox() Me.TextBox_Mail = New System.Windows.Forms.TextBox()
Me.Label_Mail = New System.Windows.Forms.Label() Me.Label_Mail = New System.Windows.Forms.Label()
Me.Button_Save = New System.Windows.Forms.Button() Me.Button_Save = New System.Windows.Forms.Button()
Me.Label_Name_Needed = New System.Windows.Forms.Label()
Me.Label_Phone_Needed = New System.Windows.Forms.Label()
Me.Label_Mail_Needed = New System.Windows.Forms.Label()
Me.Label_KB_Updated = New System.Windows.Forms.Label()
Me.Label_File_Path = New System.Windows.Forms.Label()
Me.CheckBox_NoSW = New System.Windows.Forms.CheckBox()
Me.SuspendLayout() Me.SuspendLayout()
' '
'Button_KB 'Button_KB
' '
Me.Button_KB.Location = New System.Drawing.Point(639, 133) Me.Button_KB.Location = New System.Drawing.Point(506, 113)
Me.Button_KB.Name = "Button_KB" Me.Button_KB.Name = "Button_KB"
Me.Button_KB.Size = New System.Drawing.Size(160, 68) Me.Button_KB.Size = New System.Drawing.Size(160, 68)
Me.Button_KB.TabIndex = 0 Me.Button_KB.TabIndex = 0
@ -45,7 +51,7 @@ Partial Class Settings
' '
'Button_FilePath 'Button_FilePath
' '
Me.Button_FilePath.Location = New System.Drawing.Point(639, 283) Me.Button_FilePath.Location = New System.Drawing.Point(506, 263)
Me.Button_FilePath.Name = "Button_FilePath" Me.Button_FilePath.Name = "Button_FilePath"
Me.Button_FilePath.Size = New System.Drawing.Size(160, 68) Me.Button_FilePath.Size = New System.Drawing.Size(160, 68)
Me.Button_FilePath.TabIndex = 1 Me.Button_FilePath.TabIndex = 1
@ -55,7 +61,7 @@ Partial Class Settings
'Label_Name 'Label_Name
' '
Me.Label_Name.AutoSize = True Me.Label_Name.AutoSize = True
Me.Label_Name.Location = New System.Drawing.Point(113, 203) Me.Label_Name.Location = New System.Drawing.Point(72, 159)
Me.Label_Name.Name = "Label_Name" Me.Label_Name.Name = "Label_Name"
Me.Label_Name.Size = New System.Drawing.Size(38, 13) Me.Label_Name.Size = New System.Drawing.Size(38, 13)
Me.Label_Name.TabIndex = 2 Me.Label_Name.TabIndex = 2
@ -64,7 +70,7 @@ Partial Class Settings
'TextBox_Name 'TextBox_Name
' '
Me.TextBox_Name.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.TextBox_Name.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.TextBox_Name.Location = New System.Drawing.Point(200, 200) Me.TextBox_Name.Location = New System.Drawing.Point(159, 156)
Me.TextBox_Name.Name = "TextBox_Name" Me.TextBox_Name.Name = "TextBox_Name"
Me.TextBox_Name.Size = New System.Drawing.Size(171, 21) Me.TextBox_Name.Size = New System.Drawing.Size(171, 21)
Me.TextBox_Name.TabIndex = 3 Me.TextBox_Name.TabIndex = 3
@ -73,7 +79,7 @@ Partial Class Settings
' '
Me.Label_UserData.AutoSize = True Me.Label_UserData.AutoSize = True
Me.Label_UserData.Font = New System.Drawing.Font("Microsoft Sans Serif", 12.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Label_UserData.Font = New System.Drawing.Font("Microsoft Sans Serif", 12.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label_UserData.Location = New System.Drawing.Point(112, 156) Me.Label_UserData.Location = New System.Drawing.Point(71, 112)
Me.Label_UserData.Name = "Label_UserData" Me.Label_UserData.Name = "Label_UserData"
Me.Label_UserData.Size = New System.Drawing.Size(181, 20) Me.Label_UserData.Size = New System.Drawing.Size(181, 20)
Me.Label_UserData.TabIndex = 4 Me.Label_UserData.TabIndex = 4
@ -82,7 +88,7 @@ Partial Class Settings
'TextBox_Phone 'TextBox_Phone
' '
Me.TextBox_Phone.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.TextBox_Phone.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.TextBox_Phone.Location = New System.Drawing.Point(200, 241) Me.TextBox_Phone.Location = New System.Drawing.Point(159, 197)
Me.TextBox_Phone.Name = "TextBox_Phone" Me.TextBox_Phone.Name = "TextBox_Phone"
Me.TextBox_Phone.Size = New System.Drawing.Size(171, 21) Me.TextBox_Phone.Size = New System.Drawing.Size(171, 21)
Me.TextBox_Phone.TabIndex = 6 Me.TextBox_Phone.TabIndex = 6
@ -90,7 +96,7 @@ Partial Class Settings
'Label_Tel 'Label_Tel
' '
Me.Label_Tel.AutoSize = True Me.Label_Tel.AutoSize = True
Me.Label_Tel.Location = New System.Drawing.Point(113, 244) Me.Label_Tel.Location = New System.Drawing.Point(72, 200)
Me.Label_Tel.Name = "Label_Tel" Me.Label_Tel.Name = "Label_Tel"
Me.Label_Tel.Size = New System.Drawing.Size(81, 13) Me.Label_Tel.Size = New System.Drawing.Size(81, 13)
Me.Label_Tel.TabIndex = 5 Me.Label_Tel.TabIndex = 5
@ -99,7 +105,7 @@ Partial Class Settings
'TextBox_Mail 'TextBox_Mail
' '
Me.TextBox_Mail.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.TextBox_Mail.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.TextBox_Mail.Location = New System.Drawing.Point(200, 283) Me.TextBox_Mail.Location = New System.Drawing.Point(159, 239)
Me.TextBox_Mail.Name = "TextBox_Mail" Me.TextBox_Mail.Name = "TextBox_Mail"
Me.TextBox_Mail.Size = New System.Drawing.Size(171, 21) Me.TextBox_Mail.Size = New System.Drawing.Size(171, 21)
Me.TextBox_Mail.TabIndex = 8 Me.TextBox_Mail.TabIndex = 8
@ -107,7 +113,7 @@ Partial Class Settings
'Label_Mail 'Label_Mail
' '
Me.Label_Mail.AutoSize = True Me.Label_Mail.AutoSize = True
Me.Label_Mail.Location = New System.Drawing.Point(113, 286) Me.Label_Mail.Location = New System.Drawing.Point(72, 242)
Me.Label_Mail.Name = "Label_Mail" Me.Label_Mail.Name = "Label_Mail"
Me.Label_Mail.Size = New System.Drawing.Size(29, 13) Me.Label_Mail.Size = New System.Drawing.Size(29, 13)
Me.Label_Mail.TabIndex = 7 Me.Label_Mail.TabIndex = 7
@ -115,18 +121,80 @@ Partial Class Settings
' '
'Button_Save 'Button_Save
' '
Me.Button_Save.Location = New System.Drawing.Point(858, 533) Me.Button_Save.Location = New System.Drawing.Point(330, 379)
Me.Button_Save.Name = "Button_Save" Me.Button_Save.Name = "Button_Save"
Me.Button_Save.Size = New System.Drawing.Size(99, 54) Me.Button_Save.Size = New System.Drawing.Size(129, 54)
Me.Button_Save.TabIndex = 9 Me.Button_Save.TabIndex = 9
Me.Button_Save.Text = "Save" Me.Button_Save.Text = "Save"
Me.Button_Save.UseVisualStyleBackColor = True Me.Button_Save.UseVisualStyleBackColor = True
' '
'Label_Name_Needed
'
Me.Label_Name_Needed.AutoSize = True
Me.Label_Name_Needed.ForeColor = System.Drawing.Color.Red
Me.Label_Name_Needed.Location = New System.Drawing.Point(336, 159)
Me.Label_Name_Needed.Name = "Label_Name_Needed"
Me.Label_Name_Needed.Size = New System.Drawing.Size(45, 13)
Me.Label_Name_Needed.TabIndex = 10
Me.Label_Name_Needed.Text = "Needed"
'
'Label_Phone_Needed
'
Me.Label_Phone_Needed.AutoSize = True
Me.Label_Phone_Needed.ForeColor = System.Drawing.Color.Red
Me.Label_Phone_Needed.Location = New System.Drawing.Point(336, 202)
Me.Label_Phone_Needed.Name = "Label_Phone_Needed"
Me.Label_Phone_Needed.Size = New System.Drawing.Size(45, 13)
Me.Label_Phone_Needed.TabIndex = 11
Me.Label_Phone_Needed.Text = "Needed"
'
'Label_Mail_Needed
'
Me.Label_Mail_Needed.AutoSize = True
Me.Label_Mail_Needed.ForeColor = System.Drawing.Color.Red
Me.Label_Mail_Needed.Location = New System.Drawing.Point(336, 244)
Me.Label_Mail_Needed.Name = "Label_Mail_Needed"
Me.Label_Mail_Needed.Size = New System.Drawing.Size(45, 13)
Me.Label_Mail_Needed.TabIndex = 12
Me.Label_Mail_Needed.Text = "Needed"
'
'Label_KB_Updated
'
Me.Label_KB_Updated.AutoSize = True
Me.Label_KB_Updated.Location = New System.Drawing.Point(698, 143)
Me.Label_KB_Updated.Name = "Label_KB_Updated"
Me.Label_KB_Updated.Size = New System.Drawing.Size(0, 13)
Me.Label_KB_Updated.TabIndex = 13
'
'Label_File_Path
'
Me.Label_File_Path.AutoSize = True
Me.Label_File_Path.Location = New System.Drawing.Point(698, 291)
Me.Label_File_Path.Name = "Label_File_Path"
Me.Label_File_Path.Size = New System.Drawing.Size(0, 13)
Me.Label_File_Path.TabIndex = 14
'
'CheckBox_NoSW
'
Me.CheckBox_NoSW.AutoSize = True
Me.CheckBox_NoSW.Location = New System.Drawing.Point(506, 81)
Me.CheckBox_NoSW.Name = "CheckBox_NoSW"
Me.CheckBox_NoSW.Size = New System.Drawing.Size(140, 17)
Me.CheckBox_NoSW.TabIndex = 15
Me.CheckBox_NoSW.Text = "Run without SolidWorks"
Me.CheckBox_NoSW.UseVisualStyleBackColor = True
'
'Settings 'Settings
' '
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(1046, 627) Me.ClientSize = New System.Drawing.Size(800, 500)
Me.Controls.Add(Me.CheckBox_NoSW)
Me.Controls.Add(Me.Label_File_Path)
Me.Controls.Add(Me.Label_KB_Updated)
Me.Controls.Add(Me.Label_Mail_Needed)
Me.Controls.Add(Me.Label_Phone_Needed)
Me.Controls.Add(Me.Label_Name_Needed)
Me.Controls.Add(Me.Button_Save) Me.Controls.Add(Me.Button_Save)
Me.Controls.Add(Me.TextBox_Mail) Me.Controls.Add(Me.TextBox_Mail)
Me.Controls.Add(Me.Label_Mail) Me.Controls.Add(Me.Label_Mail)
@ -155,4 +223,10 @@ Partial Class Settings
Friend WithEvents TextBox_Mail As TextBox Friend WithEvents TextBox_Mail As TextBox
Friend WithEvents Label_Mail As Label Friend WithEvents Label_Mail As Label
Friend WithEvents Button_Save As Button Friend WithEvents Button_Save As Button
Friend WithEvents Label_Name_Needed As Label
Friend WithEvents Label_Phone_Needed As Label
Friend WithEvents Label_Mail_Needed As Label
Friend WithEvents Label_KB_Updated As Label
Friend WithEvents Label_File_Path As Label
Friend WithEvents CheckBox_NoSW As CheckBox
End Class End Class

View File

@ -2,40 +2,77 @@
Public Class Settings Public Class Settings
Public Shared filesFolder As String Public Shared filesFolder As String
Public Shared HLCtFolder As String Public Shared HLCtFolder As String
Public Shared exportFolder As String
Public Shared folderPaths As New Dictionary(Of String, String) Public Shared folderPaths As New Dictionary(Of String, String)
Public Shared SRName, SRPhone, SRMail As String
Private Shared appDataList As New List(Of String) Private Shared appDataList As New List(Of String)
Public Shared Sub Init_Settings() Public Shared withoutSW As Boolean
Public Shared KBUpdateTime As String
Public Shared KBUpdateTimeHead As String = "Knowledge Base: Last Updated"
Public Shared exportFolder As String
Public Shared exportFolderHead As String = "Export Folder Path"
Public Shared SRName, SRPhone, SRMail As String
Public Shared SRNameHead As String = "Sales Representative: Name"
Public Shared SRPhoneHead As String = "Sales Representative: Phone Number"
Public Shared SRMailHead As String = "Sales Representative: Mail"
Public Sub Init_Settings()
Dim appData As String() = System.IO.File.ReadAllLines(AppForm.appDataPath & "\SavedData.txt") Dim appData As String() = System.IO.File.ReadAllLines(AppForm.appDataPath & "\SavedData.txt")
appDataList.Clear()
For i = 0 To appData.Length - 1 For i = 0 To appData.Length - 1
appDataList.Add(appData(i)) appDataList.Add(appData(i))
Next Next
TextBox_Name.Text = SRName
TextBox_Phone.Text = SRPhone
TextBox_Mail.Text = SRMail
Label_KB_Updated.Text = "Last Updated: " & KBUpdateTime
Label_File_Path.Text = exportFolder
End Sub End Sub
Private Sub TextBox_Name_TextChanged(sender As Object, e As EventArgs) Handles TextBox_Name.TextChanged Private Sub TextBox_Name_Leave(sender As Object, e As EventArgs) Handles TextBox_Name.Leave
SRName = sender.Text SRName = sender.Text
Update_AppData("Sales Representative: Name", SRName) Update_AppData(SRNameHead, SRName)
End Sub End Sub
Private Sub TextBox_Phone_TextChanged(sender As Object, e As EventArgs) Handles TextBox_Phone.TextChanged Private Sub TextBox_Phone_Leave(sender As Object, e As EventArgs) Handles TextBox_Phone.Leave
SRPhone = sender.Text SRPhone = sender.Text
Update_AppData("Sales Representative: Phone number", SRPhone) Update_AppData(SRPhoneHead, SRPhone)
End Sub End Sub
Private Sub TextBox_Mail_TextChanged(sender As Object, e As EventArgs) Handles TextBox_Mail.TextChanged Private Sub TextBox_Mail_Leave(sender As Object, e As EventArgs) Handles TextBox_Mail.Leave
SRMail = sender.Text SRMail = sender.Text
Update_AppData("Sales Representative: Mail", SRMail) Update_AppData(SRMailHead, SRMail)
End Sub End Sub
Private Sub CheckBox_NoSW_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox_NoSW.CheckedChanged
If CheckBox_NoSW.Checked = True Then
withoutSW = True
Button_KB.Enabled = False
Label_KB_Updated.Text = ""
Else
withoutSW = False
Button_KB.Enabled = True
Label_KB_Updated.Text = "Last Updated: " & KBUpdateTime
Label_KB_Updated.ForeColor = Color.Black
End If
End Sub
Private Sub Button_KB_Click(sender As Object, e As EventArgs) Handles Button_KB.Click Private Sub Button_KB_Click(sender As Object, e As EventArgs) Handles Button_KB.Click
adminClass.updateDatabase() 'Update KB 'adminClass.updateDatabase() 'Update KB
Dim timeNow As Date = Date.Now
KBUpdateTime = timeNow.ToString()
Label_KB_Updated.Text = "Last Updated: " & KBUpdateTime
Update_AppData(KBUpdateTimeHead, KBUpdateTime)
End Sub End Sub
Private Sub Button_FilePath_Click(sender As Object, e As EventArgs) Handles Button_FilePath.Click Private Sub Button_FilePath_Click(sender As Object, e As EventArgs) Handles Button_FilePath.Click
@ -43,14 +80,25 @@ Public Class Settings
If ofd.ShowDialog() <> DialogResult.Cancel Then If ofd.ShowDialog() <> DialogResult.Cancel Then
Settings.exportFolder = ofd.SelectedPath Settings.exportFolder = ofd.SelectedPath
Update_AppData("Export Folder Path", ofd.SelectedPath) Update_AppData(exportFolderHead, ofd.SelectedPath)
Label_File_Path.Text = exportFolder
End If End If
End Sub End Sub
Private Sub Button_Save_Click(sender As Object, e As EventArgs) Handles Button_Save.Click Private Sub Button_Save_Click(sender As Object, e As EventArgs) Handles Button_Save.Click
System.IO.File.WriteAllLines(AppForm.appDataPath & "\SavedData.txt", appDataList.ToArray()) System.IO.File.WriteAllLines(AppForm.appDataPath & "\SavedData.txt", appDataList.ToArray())
If SRName <> "" AndAlso SRPhone <> "" AndAlso SRMail <> "" AndAlso Settings.exportFolder <> "" Then Check_Settings()
AppForm.fillMode = True
AppForm.Panel_Start.Controls.Clear()
Main_Menu.TopLevel = False
AppForm.Panel_Start.Controls.Add(Main_Menu)
Main_Menu.Show()
End Sub
Public Sub Check_Settings()
If SRName <> "" AndAlso SRPhone <> "" AndAlso SRMail <> "" AndAlso exportFolder <> "" Then
Main_Menu.Button_Order.Enabled = True Main_Menu.Button_Order.Enabled = True
Main_Menu.Label_SettingsError.Visible = False Main_Menu.Label_SettingsError.Visible = False
Else Else
@ -58,11 +106,37 @@ Public Class Settings
Main_Menu.Label_SettingsError.Visible = True Main_Menu.Label_SettingsError.Visible = True
End If End If
AppForm.fillMode = True If exportFolder = "" Then
AppForm.Panel_Start.Controls.Clear() Label_File_Path.Text = "Needed"
Main_Menu.TopLevel = False Label_File_Path.ForeColor = Color.Red
AppForm.Panel_Start.Controls.Add(Main_Menu) Else
Main_Menu.Show() Label_File_Path.ForeColor = Color.Black
End If
If withoutSW = False AndAlso KBUpdateTime = "" Then
Label_KB_Updated.Text = "Update"
Label_KB_Updated.ForeColor = Color.Red
Else
Label_KB_Updated.ForeColor = Color.Black
End If
If SRName <> "" Then
Label_Name_Needed.Visible = False
Else
Label_Name_Needed.Visible = True
End If
If SRPhone <> "" Then
Label_Phone_Needed.Visible = False
Else
Label_Phone_Needed.Visible = True
End If
If SRMail <> "" Then
Label_Mail_Needed.Visible = False
Else
Label_Mail_Needed.Visible = True
End If
End Sub End Sub
Private Shared Sub Update_AppData(dataName As String, data As String) Private Shared Sub Update_AppData(dataName As String, data As String)

View File

@ -19,7 +19,7 @@
Get_Grid_Beams() Get_Grid_Beams()
Calculate_Support_Beams() Calculate_Support_Beams()
Individual.Panel_Grating.Refresh() Grating_Configurator.Panel_Grating.Refresh()
End Sub End Sub
@ -34,7 +34,7 @@
Return Data.gratingW Return Data.gratingW
End Function End Function
Private Shared Function Get_Max_Length(gratingMaxWidth As Integer) Private Shared Function Get_Max_Length(gratingMaxWidth As Integer)
Dim maxWeight As Double = CDbl(Individual.Panel_Data.Controls("TextBox_Max_Weight").Text) Dim maxWeight As Double = CDbl(Grating_Configurator.Panel_Data.Controls("TextBox_Max_Weight").Text)
Dim loadBarHeight As Integer = 25 Dim loadBarHeight As Integer = 25
Dim loadBarThickness As Integer = 2 Dim loadBarThickness As Integer = 2
@ -147,7 +147,7 @@
Private Shared Sub Calculate_Support_Beams() Private Shared Sub Calculate_Support_Beams()
' Hämta belastning från gui ' Hämta belastning från gui
Dim maxLoad As Double = CDbl(Individual.Panel_Data.Controls("TextBox_Max_Load").Text) Dim maxLoad As Double = CDbl(Grating_Configurator.Panel_Data.Controls("TextBox_Max_Load").Text)
' Kolla mot load tables och hitta max längd ' Kolla mot load tables och hitta max längd
Dim loadDT As DataTable = Database.database.Tables("LOAD") Dim loadDT As DataTable = Database.database.Tables("LOAD")

View File

@ -11,13 +11,13 @@ Public Class Database
' Make .csv files of each sheet in Excel ' Make .csv files of each sheet in Excel
excelApp.DisplayAlerts = False excelApp.DisplayAlerts = False
Dim wSNames As New List(Of String) Dim wSNames As New List(Of String)
excelWB = excelApp.Workbooks.Open(Settings2ABC.HLCtFolder & "\Database\Databas.xlsx") excelWB = excelApp.Workbooks.Open(Settings.HLCtFolder & "\Database\Databas.xlsx")
For i = 1 To 5 For i = 1 To 5
Dim activeSheet As Excel.Worksheet Dim activeSheet As Excel.Worksheet
activeSheet = excelWB.Sheets(i) activeSheet = excelWB.Sheets(i)
wSNames.Add(activeSheet.Name) wSNames.Add(activeSheet.Name)
activeSheet.SaveAs(Settings2ABC.HLCtFolder & "\Database\" & wSNames(i - 1), Excel.XlFileFormat.xlCSV) activeSheet.SaveAs(Settings.HLCtFolder & "\Database\" & wSNames(i - 1), Excel.XlFileFormat.xlCSV)
System.Runtime.InteropServices.Marshal.ReleaseComObject(activeSheet) System.Runtime.InteropServices.Marshal.ReleaseComObject(activeSheet)
Next Next
@ -32,7 +32,7 @@ Public Class Database
.TableName = wSNames(i) .TableName = wSNames(i)
} }
Dim lines = IO.File.ReadAllLines(Settings2ABC.HLCtFolder & "\Database\" & wSNames(i) & ".csv") Dim lines = IO.File.ReadAllLines(Settings.HLCtFolder & "\Database\" & wSNames(i) & ".csv")
' Create DataTable columns ' Create DataTable columns
Dim words As String() = lines(0).Split(New Char() {","c}) Dim words As String() = lines(0).Split(New Char() {","c})

View File

@ -20,16 +20,16 @@
Public Shared frameSize As Integer Public Shared frameSize As Integer
Public Shared Sub TypeChanged(sender As Object, e As EventArgs) Public Shared Sub TypeChanged(sender As Object, e As EventArgs)
Individual.ComboBox_Material.Enabled = True Grating_Configurator.ComboBox_Material.Enabled = True
Individual.ComboBox_Material.Items.Clear() Grating_Configurator.ComboBox_Material.Items.Clear()
gratingType = Individual.ComboBox_Type.Text gratingType = Grating_Configurator.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
Individual.ComboBox_Material.Items.Add(materialDT.Rows(i)("MATERIAL")) Grating_Configurator.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")
@ -37,12 +37,12 @@
End Try End Try
Next Next
Individual.ComboBox_Material.Text = Individual.ComboBox_Material.Items(0) Grating_Configurator.ComboBox_Material.Text = Grating_Configurator.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)
Individual.ComboBox_Mesh.Enabled = True Grating_Configurator.ComboBox_Mesh.Enabled = True
gratingMaterial = Individual.ComboBox_Material.Text gratingMaterial = Grating_Configurator.ComboBox_Material.Text
Dim serratedDT As DataTable = Database.database.Tables("Serrated") Dim serratedDT As DataTable = Database.database.Tables("Serrated")
@ -55,10 +55,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 = Individual.ComboBox_Material.Left serratedCheckBox.Left = Grating_Configurator.ComboBox_Material.Left
serratedCheckBox.Top = Individual.ComboBox_Material.Top + 25 serratedCheckBox.Top = Grating_Configurator.ComboBox_Material.Top + 25
AddHandler serratedCheckBox.CheckedChanged, AddressOf CheckBox_Serrated_CheckedChanged AddHandler serratedCheckBox.CheckedChanged, AddressOf CheckBox_Serrated_CheckedChanged
Individual.Panel_Data.Controls.Add(serratedCheckBox) Grating_Configurator.Panel_Data.Controls.Add(serratedCheckBox)
serratedCheckBoxBol = True serratedCheckBoxBol = True
Exit For Exit For
End If End If
@ -82,7 +82,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
Individual.Panel_Data.Controls.RemoveByKey("CheckBox_Serrated") Grating_Configurator.Panel_Data.Controls.RemoveByKey("CheckBox_Serrated")
serratedCheckBoxBol = False serratedCheckBoxBol = False
gratingSerrated = False gratingSerrated = False
End If End If
@ -94,16 +94,16 @@
lacqueredCheckBox.Name = "CheckBox_Lacquered" lacqueredCheckBox.Name = "CheckBox_Lacquered"
lacqueredCheckBox.Text = "Lacquered" lacqueredCheckBox.Text = "Lacquered"
lacqueredCheckBox.Left = Individual.ComboBox_Material.Left lacqueredCheckBox.Left = Grating_Configurator.ComboBox_Material.Left
lacqueredCheckBox.Top = Individual.ComboBox_Material.Top + 50 lacqueredCheckBox.Top = Grating_Configurator.ComboBox_Material.Top + 50
AddHandler lacqueredCheckBox.CheckedChanged, AddressOf CheckBox_Lacquered_CheckedChanged AddHandler lacqueredCheckBox.CheckedChanged, AddressOf CheckBox_Lacquered_CheckedChanged
Individual.Panel_Data.Controls.Add(lacqueredCheckBox) Grating_Configurator.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
Individual.Panel_Data.Controls.RemoveByKey("CheckBox_Lacquered") Grating_Configurator.Panel_Data.Controls.RemoveByKey("CheckBox_Lacquered")
lacqueredCheckBoxBol = False lacqueredCheckBoxBol = False
gratingLacquered = False gratingLacquered = False
End If End If
@ -130,12 +130,12 @@
End Sub End Sub
Private Shared Sub Update_AvalaibleMeshes() Private Shared Sub Update_AvalaibleMeshes()
Individual.ComboBox_Height.Items.Clear() Grating_Configurator.ComboBox_Height.Items.Clear()
Individual.ComboBox_Height.Enabled = False Grating_Configurator.ComboBox_Height.Enabled = False
Individual.ComboBox_Thickness.Items.Clear() Grating_Configurator.ComboBox_Thickness.Items.Clear()
Individual.ComboBox_Thickness.Enabled = False Grating_Configurator.ComboBox_Thickness.Enabled = False
Individual.ComboBox_Mesh.Items.Clear() Grating_Configurator.ComboBox_Mesh.Items.Clear()
Dim meshesDT As DataTable = Database.database.Tables("Meshes") Dim meshesDT As DataTable = Database.database.Tables("Meshes")
@ -149,14 +149,14 @@
" (" & meshesDT.Rows(i)("NAME") & ")" " (" & meshesDT.Rows(i)("NAME") & ")"
Dim addItem As Boolean = True Dim addItem As Boolean = True
For j = 0 To Individual.ComboBox_Mesh.Items.Count - 1 For j = 0 To Grating_Configurator.ComboBox_Mesh.Items.Count - 1
If item = Individual.ComboBox_Mesh.Items(j) Then If item = Grating_Configurator.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
Individual.ComboBox_Mesh.Items.Add(item) Grating_Configurator.ComboBox_Mesh.Items.Add(item)
End If End If
End If End If
Try Try
@ -167,18 +167,18 @@
End Try End Try
Next Next
If Individual.ComboBox_Mesh.Items.Count = 0 Then If Grating_Configurator.ComboBox_Mesh.Items.Count = 0 Then
Individual.ComboBox_Mesh.Items.Add("") Grating_Configurator.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)
Individual.ComboBox_Thickness.Items.Clear() Grating_Configurator.ComboBox_Thickness.Items.Clear()
Individual.ComboBox_Thickness.Enabled = False Grating_Configurator.ComboBox_Thickness.Enabled = False
Individual.ComboBox_Height.Enabled = True Grating_Configurator.ComboBox_Height.Enabled = True
Individual.ComboBox_Height.Items.Clear() Grating_Configurator.ComboBox_Height.Items.Clear()
gratingMesh = Individual.ComboBox_Mesh.Text gratingMesh = Grating_Configurator.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)
@ -222,14 +222,14 @@
tempList.Sort() tempList.Sort()
For i = 0 To tempList.Count - 1 For i = 0 To tempList.Count - 1
Individual.ComboBox_Height.Items.Add(tempList(i)) Grating_Configurator.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)
Individual.ComboBox_Thickness.Enabled = True Grating_Configurator.ComboBox_Thickness.Enabled = True
Individual.ComboBox_Thickness.Items.Clear() Grating_Configurator.ComboBox_Thickness.Items.Clear()
gratingHeight = CInt(Individual.ComboBox_Height.Text) gratingHeight = CInt(Grating_Configurator.ComboBox_Height.Text)
Dim meshesDT As DataTable = Database.database.Tables("Meshes") Dim meshesDT As DataTable = Database.database.Tables("Meshes")
@ -272,13 +272,13 @@
tempList.Sort() tempList.Sort()
For i = 0 To tempList.Count - 1 For i = 0 To tempList.Count - 1
Individual.ComboBox_Thickness.Items.Add(tempList(i)) Grating_Configurator.ComboBox_Thickness.Items.Add(tempList(i))
Next Next
For i = 0 To Individual.ComboBox_Frame.Items.Count - 1 For i = 0 To Grating_Configurator.ComboBox_Frame.Items.Count - 1
Dim item As String = Individual.ComboBox_Frame.Items(i) Dim item As String = Grating_Configurator.ComboBox_Frame.Items(i)
If CInt(item.Split(" ")(0)) = gratingHeight + 5 Then If CInt(item.Split(" ")(0)) = gratingHeight + 5 Then
Individual.ComboBox_Frame.Text = Individual.ComboBox_Frame.Items(i) Grating_Configurator.ComboBox_Frame.Text = Grating_Configurator.ComboBox_Frame.Items(i)
Exit For Exit For
End If End If
Next Next
@ -287,16 +287,16 @@
Public Shared Sub ThicknessChanged(sender As Object, e As EventArgs) Public Shared Sub ThicknessChanged(sender As Object, e As EventArgs)
Individual.ComboBox_Width.Enabled = True Grating_Configurator.ComboBox_Width.Enabled = True
Individual.ComboBox_Width.Items.Clear() Grating_Configurator.ComboBox_Width.Items.Clear()
Individual.TextBox_Width.Enabled = True Grating_Configurator.TextBox_Width.Enabled = True
Individual.TextBox_Length.Text = 1000 Grating_Configurator.TextBox_Length.Text = 1000
Individual.TextBox_Length.Enabled = True Grating_Configurator.TextBox_Length.Enabled = True
If AppForm.fillMode = False Then If AppForm.fillMode = False Then
Individual.Panel_Data.Controls("CheckBox_Whole_Mesh").Enabled = True Grating_Configurator.Panel_Data.Controls("CheckBox_Whole_Mesh").Enabled = True
End If End If
loadBarThickness = CInt(Individual.ComboBox_Thickness.Text) loadBarThickness = CInt(Grating_Configurator.ComboBox_Thickness.Text)
Dim meshesDT As DataTable = Database.database.Tables("Meshes") Dim meshesDT As DataTable = Database.database.Tables("Meshes")
@ -341,22 +341,22 @@
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
Individual.ComboBox_Width.Items.Add(wholeMeshesDT.Rows(i)(wholeMeshesColumn)) Grating_Configurator.ComboBox_Width.Items.Add(wholeMeshesDT.Rows(i)(wholeMeshesColumn))
End If End If
Next Next
Individual.ComboBox_Width.Text = Individual.ComboBox_Width.Items(0) Grating_Configurator.ComboBox_Width.Text = Grating_Configurator.ComboBox_Width.Items(0)
Individual.TextBox_Width.Text = 1000 Grating_Configurator.TextBox_Width.Text = 1000
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
Individual.ComboBox_Width.DropDownStyle = ComboBoxStyle.DropDownList Grating_Configurator.ComboBox_Width.DropDownStyle = ComboBoxStyle.DropDownList
Individual.Panel_Data.Controls.RemoveByKey("CheckBox_Edge_Bar") Grating_Configurator.Panel_Data.Controls.RemoveByKey("CheckBox_Edge_Bar")
Else Else
Individual.ComboBox_Width.DropDownStyle = ComboBoxStyle.DropDown Grating_Configurator.ComboBox_Width.DropDownStyle = ComboBoxStyle.DropDown
Dim CheckTemp As New CheckBox With { Dim CheckTemp As New CheckBox With {
.Name = "CheckBox_Edge_Bar", .Name = "CheckBox_Edge_Bar",
@ -370,7 +370,7 @@
.BackColor = Color.Transparent .BackColor = Color.Transparent
} }
AddHandler CheckTemp.CheckedChanged, AddressOf CheckBox_Edge_Bar_CheckedChanged AddHandler CheckTemp.CheckedChanged, AddressOf CheckBox_Edge_Bar_CheckedChanged
Individual.Panel_Data.Controls.Add(CheckTemp) Grating_Configurator.Panel_Data.Controls.Add(CheckTemp)
End If End If
End Sub End Sub
@ -382,18 +382,18 @@
Public Shared Sub WidthChanged(sender As Object, e As EventArgs) Public Shared Sub WidthChanged(sender As Object, e As EventArgs)
If AppForm.fillMode Then If AppForm.fillMode Then
If Individual.TextBox_Width.Text <> "" Then If Grating_Configurator.TextBox_Width.Text <> "" Then
If CInt(Individual.TextBox_Width.Text) >= Individual.ComboBox_Width.Items(Individual.ComboBox_Width.Items.Count - 1) Then If CInt(Grating_Configurator.TextBox_Width.Text) >= Grating_Configurator.ComboBox_Width.Items(Grating_Configurator.ComboBox_Width.Items.Count - 1) Then
Data.gratingW = CInt(Individual.TextBox_Width.Text) Data.gratingW = CInt(Grating_Configurator.TextBox_Width.Text)
Draw_Grating.Update_GratingPoints() Draw_Grating.Update_GratingPoints()
End If End If
Enable_Buttons() Enable_Buttons()
End If End If
Else Else
If Individual.ComboBox_Width.Text <> "" Then If Grating_Configurator.ComboBox_Width.Text <> "" Then
If CInt(Individual.ComboBox_Width.Text) >= Individual.ComboBox_Width.Items(Individual.ComboBox_Width.Items.Count - 1) AndAlso If CInt(Grating_Configurator.ComboBox_Width.Text) >= Grating_Configurator.ComboBox_Width.Items(Grating_Configurator.ComboBox_Width.Items.Count - 1) AndAlso
CInt(Individual.ComboBox_Width.Text) <= Individual.ComboBox_Width.Items(0) Then CInt(Grating_Configurator.ComboBox_Width.Text) <= Grating_Configurator.ComboBox_Width.Items(0) Then
Data.gratingW = CInt(Individual.ComboBox_Width.Text) Data.gratingW = CInt(Grating_Configurator.ComboBox_Width.Text)
Draw_Grating.Update_GratingPoints() Draw_Grating.Update_GratingPoints()
End If End If
Enable_Buttons() Enable_Buttons()
@ -402,16 +402,16 @@
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 Individual.TextBox_Length.Text <> "" Then If Grating_Configurator.TextBox_Length.Text <> "" Then
If AppForm.fillMode Then If AppForm.fillMode Then
If CInt(Individual.TextBox_Length.Text) >= 300 Then If CInt(Grating_Configurator.TextBox_Length.Text) >= 300 Then
Data.gratingL = CInt(Individual.TextBox_Length.Text) Data.gratingL = CInt(Grating_Configurator.TextBox_Length.Text)
Draw_Grating.Update_GratingPoints() Draw_Grating.Update_GratingPoints()
Enable_Buttons() Enable_Buttons()
End If End If
Else Else
If CInt(Individual.TextBox_Length.Text) >= 300 AndAlso CInt(Individual.TextBox_Length.Text) <= 6000 Then If CInt(Grating_Configurator.TextBox_Length.Text) >= 300 AndAlso CInt(Grating_Configurator.TextBox_Length.Text) <= 6000 Then
Data.gratingL = CInt(Individual.TextBox_Length.Text) Data.gratingL = CInt(Grating_Configurator.TextBox_Length.Text)
Draw_Grating.Update_GratingPoints() Draw_Grating.Update_GratingPoints()
Enable_Buttons() Enable_Buttons()
End If End If
@ -420,37 +420,37 @@
End Sub End Sub
Public Shared Sub FrameChanged(Sender As Object, e As EventArgs) Public Shared Sub FrameChanged(Sender As Object, e As EventArgs)
If Individual.ComboBox_Frame.Text <> "" Then If Grating_Configurator.ComboBox_Frame.Text <> "" Then
frameSize = CInt(Individual.ComboBox_Frame.Text.Split(" ")(0)) frameSize = CInt(Grating_Configurator.ComboBox_Frame.Text.Split(" ")(0))
End If End If
End Sub End Sub
Private Shared Sub Enable_Buttons() Private Shared Sub Enable_Buttons()
If AppForm.fillMode Then If AppForm.fillMode Then
If Individual.TextBox_Width.Text <> "" AndAlso Individual.TextBox_Length.Text <> "" Then If Grating_Configurator.TextBox_Width.Text <> "" AndAlso Grating_Configurator.TextBox_Length.Text <> "" Then
Individual.Button_Export_GUI.Enabled = True Grating_Configurator.Button_Export_GUI.Enabled = True
Individual.Button_Export_SW.Enabled = True Grating_Configurator.Button_Export_SW.Enabled = True
Individual.Panel_Data.Controls("Button_Calculate").Enabled = True Grating_Configurator.Panel_Data.Controls("Button_Calculate").Enabled = True
Individual.Button_Angle_Corner.Enabled = True Grating_Configurator.Button_Angle_Corner.Enabled = True
Individual.Button_Angle_Side.Enabled = True Grating_Configurator.Button_Angle_Side.Enabled = True
Individual.Button_Square_Corner.Enabled = True Grating_Configurator.Button_Square_Corner.Enabled = True
Individual.Button_Square_Side.Enabled = True Grating_Configurator.Button_Square_Side.Enabled = True
Individual.Button_Square_Middle.Enabled = True Grating_Configurator.Button_Square_Middle.Enabled = True
Individual.Panel_Data.Controls("TextBox_Max_Load").Enabled = True Grating_Configurator.Panel_Data.Controls("TextBox_Max_Load").Enabled = True
Individual.Panel_Data.Controls("TextBox_Max_Weight").Enabled = True Grating_Configurator.Panel_Data.Controls("TextBox_Max_Weight").Enabled = True
End If End If
Else Else
If Individual.ComboBox_Width.Text <> "" AndAlso Individual.TextBox_Length.Text <> "" Then If Grating_Configurator.ComboBox_Width.Text <> "" AndAlso Grating_Configurator.TextBox_Length.Text <> "" Then
Individual.Button_Export_GUI.Enabled = True Grating_Configurator.Button_Export_GUI.Enabled = True
Individual.Button_Export_SW.Enabled = True Grating_Configurator.Button_Export_SW.Enabled = True
Individual.Button_Angle_Corner.Enabled = True Grating_Configurator.Button_Angle_Corner.Enabled = True
Individual.Button_Angle_Side.Enabled = True Grating_Configurator.Button_Angle_Side.Enabled = True
Individual.Button_Square_Corner.Enabled = True Grating_Configurator.Button_Square_Corner.Enabled = True
Individual.Button_Square_Side.Enabled = True Grating_Configurator.Button_Square_Side.Enabled = True
Individual.Button_Square_Middle.Enabled = True Grating_Configurator.Button_Square_Middle.Enabled = True
End If End If
End If End If
End Sub End Sub
@ -458,8 +458,8 @@
' --- 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 = Individual.ComboBox_Mesh.Text.Split("x")(0) Dim lSpacing As String = Grating_Configurator.ComboBox_Mesh.Text.Split("x")(0)
Dim cSpacing As String = Individual.ComboBox_Mesh.Text.Split("x")(1).Split(" ")(0) Dim cSpacing As String = Grating_Configurator.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))
@ -484,15 +484,15 @@
gratingTable.Rows(0)("NAME") = gratingName gratingTable.Rows(0)("NAME") = gratingName
gratingTable.Rows(0)("SERRATED") = gratingSerrated gratingTable.Rows(0)("SERRATED") = gratingSerrated
gratingTable.Rows(0)("LACQUERED") = gratingLacquered gratingTable.Rows(0)("LACQUERED") = gratingLacquered
gratingTable.Rows(0)("WIDTH") = CInt(Individual.ComboBox_Width.Text) gratingTable.Rows(0)("WIDTH") = CInt(Grating_Configurator.ComboBox_Width.Text)
gratingTable.Rows(0)("LENGTH") = CInt(Individual.TextBox_Length.Text) gratingTable.Rows(0)("LENGTH") = CInt(Grating_Configurator.TextBox_Length.Text)
gratingTable.Rows(0)("LOADBAR_THICKNESS") = CInt(Individual.ComboBox_Thickness.Text) gratingTable.Rows(0)("LOADBAR_THICKNESS") = CInt(Grating_Configurator.ComboBox_Thickness.Text)
gratingTable.Rows(0)("LOADBAR_HEIGHT") = CInt(Individual.ComboBox_Height.Text) gratingTable.Rows(0)("LOADBAR_HEIGHT") = CInt(Grating_Configurator.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)
gratingTable.Rows(0)("FRAME_SIZE") = frameSize gratingTable.Rows(0)("FRAME_SIZE") = frameSize
If Individual.ComboBox_Type.Text = "Pressure Welded" Then If Grating_Configurator.ComboBox_Type.Text = "Pressure Welded" Then
If gratingSerrated = True Then If gratingSerrated = True Then
gratingTable.Rows(0)("TYPE") = "pressure_welded_serrated" gratingTable.Rows(0)("TYPE") = "pressure_welded_serrated"
Else Else

View File

@ -22,7 +22,7 @@ Public Class GUI_Export
End Sub End Sub
Private Shared Sub Generate_Screenshot() Private Shared Sub Generate_Screenshot()
Dim gratingImg As New Bitmap(Individual.Panel_Grating.Width - 1, Individual.Panel_Grating.Height - 1) Dim gratingImg As New Bitmap(Grating_Configurator.Panel_Grating.Width - 1, Grating_Configurator.Panel_Grating.Height - 1)
Dim graphicImg As Graphics = Graphics.FromImage(gratingImg) Dim graphicImg As Graphics = Graphics.FromImage(gratingImg)
Draw_Grating.Draw_Grating(graphicImg, 12) Draw_Grating.Draw_Grating(graphicImg, 12)

View File

@ -3,34 +3,34 @@
Private Shared cornerAngleCounter As Integer = 0 Private Shared cornerAngleCounter As Integer = 0
' --- 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)
Individual.Panel_Recesses.Controls("Button_Angle_Corner").Enabled = False Grating_Configurator.Panel_Recesses.Controls("Button_Angle_Corner").Enabled = False
Individual.Panel_Recesses.Controls("Button_Angle_Side").Enabled = False Grating_Configurator.Panel_Recesses.Controls("Button_Angle_Side").Enabled = False
Individual.Panel_Recesses.Controls("Button_Square_Corner").Enabled = False Grating_Configurator.Panel_Recesses.Controls("Button_Square_Corner").Enabled = False
Individual.Panel_Recesses.Controls("Button_Square_Side").Enabled = False Grating_Configurator.Panel_Recesses.Controls("Button_Square_Side").Enabled = False
Individual.Panel_Recesses.Controls("Button_Square_Middle").Enabled = False Grating_Configurator.Panel_Recesses.Controls("Button_Square_Middle").Enabled = False
Dim buttonX As Integer = Individual.Panel_Recesses.Controls("Button_Angle_Corner").Location.X + Individual.Panel_Recesses.Controls("Button_Angle_Corner").Width Dim buttonX As Integer = Grating_Configurator.Panel_Recesses.Controls("Button_Angle_Corner").Location.X + Grating_Configurator.Panel_Recesses.Controls("Button_Angle_Corner").Width
Dim buttonY As Integer = Individual.Panel_Recesses.Controls("Button_Angle_Corner").Location.Y Dim buttonY As Integer = Grating_Configurator.Panel_Recesses.Controls("Button_Angle_Corner").Location.Y
Individual.Create_TextBox_Recesses("Y_TextBox", "", buttonX + 60, buttonY + 10, 60) Grating_Configurator.Create_TextBox_Recesses("Y_TextBox", "", buttonX + 60, buttonY + 10, 60)
AddHandler Individual.Panel_Recesses.Controls("Y_TextBox").TextChanged, AddressOf FunctionTextCorner_Changed AddHandler Grating_Configurator.Panel_Recesses.Controls("Y_TextBox").TextChanged, AddressOf FunctionTextCorner_Changed
AddHandler Individual.Panel_Recesses.Controls("Y_TextBox").KeyPress, AddressOf FunctionText_KeyPress AddHandler Grating_Configurator.Panel_Recesses.Controls("Y_TextBox").KeyPress, AddressOf FunctionText_KeyPress
Individual.Create_Label_Recesses("Y_Label", "Width", buttonX + 18, buttonY + 13) Grating_Configurator.Create_Label_Recesses("Y_Label", "Width", buttonX + 18, buttonY + 13)
Individual.Create_TextBox_Recesses("X_TextBox", "", buttonX + 60, buttonY + 40, 60) Grating_Configurator.Create_TextBox_Recesses("X_TextBox", "", buttonX + 60, buttonY + 40, 60)
AddHandler Individual.Panel_Recesses.Controls("X_TextBox").TextChanged, AddressOf FunctionTextCorner_Changed AddHandler Grating_Configurator.Panel_Recesses.Controls("X_TextBox").TextChanged, AddressOf FunctionTextCorner_Changed
AddHandler Individual.Panel_Recesses.Controls("X_TextBox").KeyPress, AddressOf FunctionText_KeyPress AddHandler Grating_Configurator.Panel_Recesses.Controls("X_TextBox").KeyPress, AddressOf FunctionText_KeyPress
Individual.Create_Label_Recesses("X_Label", "Length", buttonX + 10, buttonY + 43) Grating_Configurator.Create_Label_Recesses("X_Label", "Length", buttonX + 10, buttonY + 43)
buttonOffset = 130 buttonOffset = 130
Individual.Panel_Recesses.Controls("Button_Angle_Side").Left = Individual.Panel_Recesses.Controls("Button_Angle_Side").Left + buttonOffset Grating_Configurator.Panel_Recesses.Controls("Button_Angle_Side").Left = Grating_Configurator.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 Grating_Configurator.Panel_Recesses.Controls("Button_Square_Corner").Left = Grating_Configurator.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 Grating_Configurator.Panel_Recesses.Controls("Button_Square_Side").Left = Grating_Configurator.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 Grating_Configurator.Panel_Recesses.Controls("Button_Square_Middle").Left = Grating_Configurator.Panel_Recesses.Controls("Button_Square_Middle").Left + buttonOffset
Individual.Panel_Recesses.Controls("Button_Radius").Left = Individual.Panel_Recesses.Controls("Button_Radius").Left + buttonOffset Grating_Configurator.Panel_Recesses.Controls("Button_Radius").Left = Grating_Configurator.Panel_Recesses.Controls("Button_Radius").Left + buttonOffset
Individual.Button_Angle_Corner.FlatStyle = FlatStyle.Flat Grating_Configurator.Button_Angle_Corner.FlatStyle = FlatStyle.Flat
Individual.Button_Angle_Corner.FlatAppearance.BorderColor = Color.Red Grating_Configurator.Button_Angle_Corner.FlatAppearance.BorderColor = Color.Red
End Sub End Sub
' --- Check the key pressed by the user --- ' --- Check the key pressed by the user ---
@ -42,15 +42,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(Individual.Panel_Recesses.Controls("X_TextBox").Text) value1 = CInt(Grating_Configurator.Panel_Recesses.Controls("X_TextBox").Text)
value2 = CInt(Individual.Panel_Recesses.Controls("Y_TextBox").Text) value2 = CInt(Grating_Configurator.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 Individual.Panel_Grating.Controls.Count = 2 Then If Grating_Configurator.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 {
@ -71,19 +71,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)
Individual.Panel_Grating.Controls.Add(pointButton) Grating_Configurator.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 Individual.Panel_Grating.Controls.Count > 2 Then ElseIf Grating_Configurator.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 Individual.Panel_Grating.Controls(buttonName).Click, AddressOf PointButton_Click RemoveHandler Grating_Configurator.Panel_Grating.Controls(buttonName).Click, AddressOf PointButton_Click
Individual.Panel_Grating.Controls.RemoveByKey(Data.gratingPoints.Rows(i)("NAME") & "_Button") Grating_Configurator.Panel_Grating.Controls.RemoveByKey(Data.gratingPoints.Rows(i)("NAME") & "_Button")
End If End If
Next Next
End If End If
@ -105,8 +105,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 Individual.Panel_Grating.Controls(buttonName).Click, AddressOf PointButton_Click RemoveHandler Grating_Configurator.Panel_Grating.Controls(buttonName).Click, AddressOf PointButton_Click
Individual.Panel_Grating.Controls.RemoveByKey(Data.gratingPoints.Rows(i)("NAME") & "_Button") Grating_Configurator.Panel_Grating.Controls.RemoveByKey(Data.gratingPoints.Rows(i)("NAME") & "_Button")
End If End If
Next Next
@ -118,10 +118,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(Individual.Panel_Recesses.Controls("X_TextBox").Text / Data.scaleDiff) Dim dXGUI As Integer = CInt(Grating_Configurator.Panel_Recesses.Controls("X_TextBox").Text / Data.scaleDiff)
Dim dYGUI As Integer = CInt(Individual.Panel_Recesses.Controls("Y_TextBox").Text / Data.scaleDiff) Dim dYGUI As Integer = CInt(Grating_Configurator.Panel_Recesses.Controls("Y_TextBox").Text / Data.scaleDiff)
Dim dX As Decimal = Individual.Panel_Recesses.Controls("X_TextBox").Text / 1000 Dim dX As Decimal = Grating_Configurator.Panel_Recesses.Controls("X_TextBox").Text / 1000
Dim dY As Decimal = Individual.Panel_Recesses.Controls("Y_TextBox").Text / 1000 Dim dY As Decimal = Grating_Configurator.Panel_Recesses.Controls("Y_TextBox").Text / 1000
Data.recessData.Rows.Add() Data.recessData.Rows.Add()
Data.recessData.Rows(Data.recessData.Rows.Count - 1)("NAME") = "CA" & cornerAngleCounter Data.recessData.Rows(Data.recessData.Rows.Count - 1)("NAME") = "CA" & cornerAngleCounter
@ -131,52 +131,52 @@
If mesName.Split("_")(0) <> "SS1" AndAlso mesName.Split("_")(0) <> "SS" AndAlso mesName.Split("_")(0) <> "MS" AndAlso mesName.Split("_")(0) <> "MS1" Then If mesName.Split("_")(0) <> "SS1" AndAlso mesName.Split("_")(0) <> "SS" AndAlso mesName.Split("_")(0) <> "MS" AndAlso mesName.Split("_")(0) <> "MS1" 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) - Individual.Panel_Recesses.Controls("X_TextBox").Text Draw_Grating.measureLabels(mesName)(0) = Draw_Grating.measureLabels(mesName)(0) - Grating_Configurator.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) - Individual.Panel_Recesses.Controls("Y_TextBox").Text Draw_Grating.measureLabels(mesName)(0) = Draw_Grating.measureLabels(mesName)(0) - Grating_Configurator.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) - Individual.Panel_Recesses.Controls("X_TextBox").Text Draw_Grating.measureLabels(mesName)(0) = Draw_Grating.measureLabels(mesName)(0) - Grating_Configurator.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) - Individual.Panel_Recesses.Controls("Y_TextBox").Text Draw_Grating.measureLabels(mesName)(0) = Draw_Grating.measureLabels(mesName)(0) - Grating_Configurator.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) - Individual.Panel_Recesses.Controls("Y_TextBox").Text Draw_Grating.measureLabels(mesName)(0) = Draw_Grating.measureLabels(mesName)(0) - Grating_Configurator.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) - Individual.Panel_Recesses.Controls("X_TextBox").Text Draw_Grating.measureLabels(mesName)(0) = Draw_Grating.measureLabels(mesName)(0) - Grating_Configurator.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) - Individual.Panel_Recesses.Controls("Y_TextBox").Text Draw_Grating.measureLabels(mesName)(0) = Draw_Grating.measureLabels(mesName)(0) - Grating_Configurator.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) - Individual.Panel_Recesses.Controls("X_TextBox").Text Draw_Grating.measureLabels(mesName)(0) = Draw_Grating.measureLabels(mesName)(0) - Grating_Configurator.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) - Individual.Panel_Recesses.Controls("X_TextBox").Text Draw_Grating.measureLabels(mesName)(0) = Draw_Grating.measureLabels(mesName)(0) - Grating_Configurator.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
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) - Individual.Panel_Recesses.Controls("Y_TextBox").Text Draw_Grating.measureLabels(mesName)(0) = Draw_Grating.measureLabels(mesName)(0) - Grating_Configurator.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
Draw_Grating.sideSquareMesLine(mesName)(1) = Draw_Grating.sideSquareMesLine(mesName)(1) + dYGUI Draw_Grating.sideSquareMesLine(mesName)(1) = Draw_Grating.sideSquareMesLine(mesName)(1) + dYGUI
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) - Individual.Panel_Recesses.Controls("X_TextBox").Text Draw_Grating.measureLabels(mesName)(0) = Draw_Grating.measureLabels(mesName)(0) - Grating_Configurator.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
Else Else
Draw_Grating.measureLabels(mesName)(0) = Draw_Grating.measureLabels(mesName)(0) - Individual.Panel_Recesses.Controls("Y_TextBox").Text Draw_Grating.measureLabels(mesName)(0) = Draw_Grating.measureLabels(mesName)(0) - Grating_Configurator.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
Draw_Grating.sideSquareMesLine(mesName)(1) = Draw_Grating.sideSquareMesLine(mesName)(1) - dYGUI Draw_Grating.sideSquareMesLine(mesName)(1) = Draw_Grating.sideSquareMesLine(mesName)(1) - dYGUI
@ -245,16 +245,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(Individual.Panel_Recesses.Controls("X_TextBox").Text), pXGUI + dXGUI / 2 - 8, Draw_Grating.measureLabels.Add("A_" & mesNum, {CInt(Grating_Configurator.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(Individual.Panel_Recesses.Controls("Y_TextBox").Text), pXGUI + dXGUI + 3, Draw_Grating.measureLabels.Add("A_" & mesNum + 1, {CInt(Grating_Configurator.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(Individual.Panel_Recesses.Controls("Y_TextBox").Text) Data.recessData.Rows(Data.recessData.Rows.Count - 1)("WIDTH") = CInt(Grating_Configurator.Panel_Recesses.Controls("Y_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)("LENGTH") = CInt(Grating_Configurator.Panel_Recesses.Controls("X_TextBox").Text)
ElseIf pointQuadrant = 2 Then ElseIf pointQuadrant = 2 Then
' Add the new points ' Add the new points
@ -285,16 +285,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(Individual.Panel_Recesses.Controls("Y_TextBox").Text), pXGUI - dXGUI - 18 - 3, Draw_Grating.measureLabels.Add("A_" & mesNum, {CInt(Grating_Configurator.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(Individual.Panel_Recesses.Controls("X_TextBox").Text), pXGUI - dXGUI / 2 - 8, Draw_Grating.measureLabels.Add("A_" & mesNum + 1, {CInt(Grating_Configurator.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(Individual.Panel_Recesses.Controls("Y_TextBox").Text) Data.recessData.Rows(Data.recessData.Rows.Count - 1)("WIDTH") = CInt(Grating_Configurator.Panel_Recesses.Controls("Y_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)("LENGTH") = CInt(Grating_Configurator.Panel_Recesses.Controls("X_TextBox").Text)
ElseIf pointQuadrant = 3 Then ElseIf pointQuadrant = 3 Then
' Add the new points ' Add the new points
@ -324,16 +324,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(Individual.Panel_Recesses.Controls("X_TextBox").Text), pXGUI - dXGUI / 2 - 8, Draw_Grating.measureLabels.Add("A_" & mesNum, {CInt(Grating_Configurator.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(Individual.Panel_Recesses.Controls("Y_TextBox").Text), pXGUI - dXGUI - 18 - 3, Draw_Grating.measureLabels.Add("A_" & mesNum + 1, {CInt(Grating_Configurator.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(Individual.Panel_Recesses.Controls("Y_TextBox").Text) Data.recessData.Rows(Data.recessData.Rows.Count - 1)("WIDTH") = CInt(Grating_Configurator.Panel_Recesses.Controls("Y_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)("LENGTH") = CInt(Grating_Configurator.Panel_Recesses.Controls("X_TextBox").Text)
Else Else
' Add the new points ' Add the new points
@ -360,16 +360,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(Individual.Panel_Recesses.Controls("Y_TextBox").Text), pXGUI + dXGUI + 3, Draw_Grating.measureLabels.Add("A_" & mesNum, {CInt(Grating_Configurator.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(Individual.Panel_Recesses.Controls("X_TextBox").Text), pXGUI + dXGUI / 2 - 8, Draw_Grating.measureLabels.Add("A_" & mesNum + 1, {CInt(Grating_Configurator.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(Individual.Panel_Recesses.Controls("Y_TextBox").Text) Data.recessData.Rows(Data.recessData.Rows.Count - 1)("WIDTH") = CInt(Grating_Configurator.Panel_Recesses.Controls("Y_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)("LENGTH") = CInt(Grating_Configurator.Panel_Recesses.Controls("X_TextBox").Text)
End If End If
@ -378,32 +378,32 @@
Data.gratingPoints.Rows.RemoveAt(index) Data.gratingPoints.Rows.RemoveAt(index)
'Redraw grating 'Redraw grating
Individual.Panel_Grating.Refresh() Grating_Configurator.Panel_Grating.Refresh()
RemoveHandler Individual.Panel_Recesses.Controls("X_TextBox").TextChanged, AddressOf FunctionTextCorner_Changed RemoveHandler Grating_Configurator.Panel_Recesses.Controls("X_TextBox").TextChanged, AddressOf FunctionTextCorner_Changed
RemoveHandler Individual.Panel_Recesses.Controls("X_TextBox").KeyPress, AddressOf FunctionText_KeyPress RemoveHandler Grating_Configurator.Panel_Recesses.Controls("X_TextBox").KeyPress, AddressOf FunctionText_KeyPress
Individual.Panel_Recesses.Controls.RemoveByKey("X_TextBox") Grating_Configurator.Panel_Recesses.Controls.RemoveByKey("X_TextBox")
RemoveHandler Individual.Panel_Recesses.Controls("Y_TextBox").TextChanged, AddressOf FunctionTextCorner_Changed RemoveHandler Grating_Configurator.Panel_Recesses.Controls("Y_TextBox").TextChanged, AddressOf FunctionTextCorner_Changed
RemoveHandler Individual.Panel_Recesses.Controls("Y_TextBox").KeyPress, AddressOf FunctionText_KeyPress RemoveHandler Grating_Configurator.Panel_Recesses.Controls("Y_TextBox").KeyPress, AddressOf FunctionText_KeyPress
Individual.Panel_Recesses.Controls.RemoveByKey("Y_TextBox") Grating_Configurator.Panel_Recesses.Controls.RemoveByKey("Y_TextBox")
Individual.Panel_Recesses.Controls.RemoveByKey("X_Label") Grating_Configurator.Panel_Recesses.Controls.RemoveByKey("X_Label")
Individual.Panel_Recesses.Controls.RemoveByKey("Y_Label") Grating_Configurator.Panel_Recesses.Controls.RemoveByKey("Y_Label")
Individual.Panel_Recesses.Controls("Button_Angle_Corner").Enabled = True Grating_Configurator.Panel_Recesses.Controls("Button_Angle_Corner").Enabled = True
Individual.Panel_Recesses.Controls("Button_Angle_Side").Enabled = True Grating_Configurator.Panel_Recesses.Controls("Button_Angle_Side").Enabled = True
Individual.Panel_Recesses.Controls("Button_Square_Corner").Enabled = True Grating_Configurator.Panel_Recesses.Controls("Button_Square_Corner").Enabled = True
Individual.Panel_Recesses.Controls("Button_Square_Side").Enabled = True Grating_Configurator.Panel_Recesses.Controls("Button_Square_Side").Enabled = True
Individual.Panel_Recesses.Controls("Button_Square_Middle").Enabled = True Grating_Configurator.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 Grating_Configurator.Panel_Recesses.Controls("Button_Angle_Side").Left = Grating_Configurator.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 Grating_Configurator.Panel_Recesses.Controls("Button_Square_Corner").Left = Grating_Configurator.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 Grating_Configurator.Panel_Recesses.Controls("Button_Square_Side").Left = Grating_Configurator.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 Grating_Configurator.Panel_Recesses.Controls("Button_Square_Middle").Left = Grating_Configurator.Panel_Recesses.Controls("Button_Square_Middle").Left - buttonOffset
Individual.Panel_Recesses.Controls("Button_Radius").Left = Individual.Panel_Recesses.Controls("Button_Radius").Left - buttonOffset Grating_Configurator.Panel_Recesses.Controls("Button_Radius").Left = Grating_Configurator.Panel_Recesses.Controls("Button_Radius").Left - buttonOffset
Individual.Button_Angle_Corner.FlatAppearance.BorderColor = Color.Black Grating_Configurator.Button_Angle_Corner.FlatAppearance.BorderColor = Color.Black
End Sub End Sub
' --- Determines the clicked points quadrant --- ' --- Determines the clicked points quadrant ---

View File

@ -3,32 +3,32 @@
Private Shared cornerRectangleCounter As Integer = 0 Private Shared cornerRectangleCounter As Integer = 0
' --- 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)
Individual.Panel_Recesses.Controls("Button_Angle_Corner").Enabled = False Grating_Configurator.Panel_Recesses.Controls("Button_Angle_Corner").Enabled = False
Individual.Panel_Recesses.Controls("Button_Angle_Side").Enabled = False Grating_Configurator.Panel_Recesses.Controls("Button_Angle_Side").Enabled = False
Individual.Panel_Recesses.Controls("Button_Square_Corner").Enabled = False Grating_Configurator.Panel_Recesses.Controls("Button_Square_Corner").Enabled = False
Individual.Panel_Recesses.Controls("Button_Square_Side").Enabled = False Grating_Configurator.Panel_Recesses.Controls("Button_Square_Side").Enabled = False
Individual.Panel_Recesses.Controls("Button_Square_Middle").Enabled = False Grating_Configurator.Panel_Recesses.Controls("Button_Square_Middle").Enabled = False
Dim buttonX As Integer = Individual.Panel_Recesses.Controls("Button_Square_Corner").Location.X + Individual.Panel_Recesses.Controls("Button_Square_Corner").Width Dim buttonX As Integer = Grating_Configurator.Panel_Recesses.Controls("Button_Square_Corner").Location.X + Grating_Configurator.Panel_Recesses.Controls("Button_Square_Corner").Width
Dim buttonY As Integer = Individual.Panel_Recesses.Controls("Button_Square_Corner").Location.Y Dim buttonY As Integer = Grating_Configurator.Panel_Recesses.Controls("Button_Square_Corner").Location.Y
Individual.Create_TextBox_Recesses("Y_TextBox", "", buttonX + 60, buttonY + 10, 60) Grating_Configurator.Create_TextBox_Recesses("Y_TextBox", "", buttonX + 60, buttonY + 10, 60)
AddHandler Individual.Panel_Recesses.Controls("Y_TextBox").TextChanged, AddressOf FunctionTextCorner_Changed AddHandler Grating_Configurator.Panel_Recesses.Controls("Y_TextBox").TextChanged, AddressOf FunctionTextCorner_Changed
AddHandler Individual.Panel_Recesses.Controls("Y_TextBox").KeyPress, AddressOf FunctionText_KeyPress AddHandler Grating_Configurator.Panel_Recesses.Controls("Y_TextBox").KeyPress, AddressOf FunctionText_KeyPress
Individual.Create_Label_Recesses("Y_Label", "Width", buttonX + 18, buttonY + 13) Grating_Configurator.Create_Label_Recesses("Y_Label", "Width", buttonX + 18, buttonY + 13)
Individual.Create_TextBox_Recesses("X_TextBox", "", buttonX + 60, buttonY + 40, 60) Grating_Configurator.Create_TextBox_Recesses("X_TextBox", "", buttonX + 60, buttonY + 40, 60)
AddHandler Individual.Panel_Recesses.Controls("X_TextBox").TextChanged, AddressOf FunctionTextCorner_Changed AddHandler Grating_Configurator.Panel_Recesses.Controls("X_TextBox").TextChanged, AddressOf FunctionTextCorner_Changed
AddHandler Individual.Panel_Recesses.Controls("X_TextBox").KeyPress, AddressOf FunctionText_KeyPress AddHandler Grating_Configurator.Panel_Recesses.Controls("X_TextBox").KeyPress, AddressOf FunctionText_KeyPress
Individual.Create_Label_Recesses("X_Label", "Length", buttonX + 10, buttonY + 43) Grating_Configurator.Create_Label_Recesses("X_Label", "Length", buttonX + 10, buttonY + 43)
buttonOffset = 130 buttonOffset = 130
Individual.Panel_Recesses.Controls("Button_Square_Side").Left = Individual.Panel_Recesses.Controls("Button_Square_Side").Left + buttonOffset Grating_Configurator.Panel_Recesses.Controls("Button_Square_Side").Left = Grating_Configurator.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 Grating_Configurator.Panel_Recesses.Controls("Button_Square_Middle").Left = Grating_Configurator.Panel_Recesses.Controls("Button_Square_Middle").Left + buttonOffset
Individual.Panel_Recesses.Controls("Button_Radius").Left = Individual.Panel_Recesses.Controls("Button_Radius").Left + buttonOffset Grating_Configurator.Panel_Recesses.Controls("Button_Radius").Left = Grating_Configurator.Panel_Recesses.Controls("Button_Radius").Left + buttonOffset
Individual.Button_Square_Corner.FlatStyle = FlatStyle.Flat Grating_Configurator.Button_Square_Corner.FlatStyle = FlatStyle.Flat
Individual.Button_Square_Corner.FlatAppearance.BorderColor = Color.Red Grating_Configurator.Button_Square_Corner.FlatAppearance.BorderColor = Color.Red
End Sub End Sub
@ -41,15 +41,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(Individual.Panel_Recesses.Controls("X_TextBox").Text) value1 = CInt(Grating_Configurator.Panel_Recesses.Controls("X_TextBox").Text)
value2 = CInt(Individual.Panel_Recesses.Controls("Y_TextBox").Text) value2 = CInt(Grating_Configurator.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 Individual.Panel_Grating.Controls.Count = 2 Then If Grating_Configurator.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 {
@ -70,19 +70,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)
Individual.Panel_Grating.Controls.Add(pointButton) Grating_Configurator.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 Individual.Panel_Grating.Controls.Count > 2 Then ElseIf Grating_Configurator.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 Individual.Panel_Grating.Controls(buttonName).Click, AddressOf PointButton_Click RemoveHandler Grating_Configurator.Panel_Grating.Controls(buttonName).Click, AddressOf PointButton_Click
Individual.Panel_Grating.Controls.RemoveByKey(Data.gratingPoints.Rows(i)("NAME") & "_Button") Grating_Configurator.Panel_Grating.Controls.RemoveByKey(Data.gratingPoints.Rows(i)("NAME") & "_Button")
End If End If
Next Next
End If End If
@ -104,8 +104,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 Individual.Panel_Grating.Controls(buttonName).Click, AddressOf PointButton_Click RemoveHandler Grating_Configurator.Panel_Grating.Controls(buttonName).Click, AddressOf PointButton_Click
Individual.Panel_Grating.Controls.RemoveByKey(Data.gratingPoints.Rows(i)("NAME") & "_Button") Grating_Configurator.Panel_Grating.Controls.RemoveByKey(Data.gratingPoints.Rows(i)("NAME") & "_Button")
End If End If
Next Next
@ -117,10 +117,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(Individual.Panel_Recesses.Controls("X_TextBox").Text / Data.scaleDiff) Dim dXGUI As Integer = CInt(Grating_Configurator.Panel_Recesses.Controls("X_TextBox").Text / Data.scaleDiff)
Dim dYGUI As Integer = CInt(Individual.Panel_Recesses.Controls("Y_TextBox").Text / Data.scaleDiff) Dim dYGUI As Integer = CInt(Grating_Configurator.Panel_Recesses.Controls("Y_TextBox").Text / Data.scaleDiff)
Dim dX As Decimal = Individual.Panel_Recesses.Controls("X_TextBox").Text / 1000 Dim dX As Decimal = Grating_Configurator.Panel_Recesses.Controls("X_TextBox").Text / 1000
Dim dY As Decimal = Individual.Panel_Recesses.Controls("Y_TextBox").Text / 1000 Dim dY As Decimal = Grating_Configurator.Panel_Recesses.Controls("Y_TextBox").Text / 1000
Data.recessData.Rows.Add() Data.recessData.Rows.Add()
Data.recessData.Rows(Data.recessData.Rows.Count - 1)("NAME") = "CR" & cornerRectangleCounter Data.recessData.Rows(Data.recessData.Rows.Count - 1)("NAME") = "CR" & cornerRectangleCounter
@ -130,52 +130,52 @@
If mesName.Split("_")(0) <> "SS1" AndAlso mesName.Split("_")(0) <> "SS" AndAlso mesName.Split("_")(0) <> "MS" AndAlso mesName.Split("_")(0) <> "MS1" Then If mesName.Split("_")(0) <> "SS1" AndAlso mesName.Split("_")(0) <> "SS" AndAlso mesName.Split("_")(0) <> "MS" AndAlso mesName.Split("_")(0) <> "MS1" 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) - Individual.Panel_Recesses.Controls("X_TextBox").Text Draw_Grating.measureLabels(mesName)(0) = Draw_Grating.measureLabels(mesName)(0) - Grating_Configurator.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) - Individual.Panel_Recesses.Controls("Y_TextBox").Text Draw_Grating.measureLabels(mesName)(0) = Draw_Grating.measureLabels(mesName)(0) - Grating_Configurator.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) - Individual.Panel_Recesses.Controls("X_TextBox").Text Draw_Grating.measureLabels(mesName)(0) = Draw_Grating.measureLabels(mesName)(0) - Grating_Configurator.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) - Individual.Panel_Recesses.Controls("Y_TextBox").Text Draw_Grating.measureLabels(mesName)(0) = Draw_Grating.measureLabels(mesName)(0) - Grating_Configurator.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) - Individual.Panel_Recesses.Controls("Y_TextBox").Text Draw_Grating.measureLabels(mesName)(0) = Draw_Grating.measureLabels(mesName)(0) - Grating_Configurator.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) - Individual.Panel_Recesses.Controls("X_TextBox").Text Draw_Grating.measureLabels(mesName)(0) = Draw_Grating.measureLabels(mesName)(0) - Grating_Configurator.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) - Individual.Panel_Recesses.Controls("Y_TextBox").Text Draw_Grating.measureLabels(mesName)(0) = Draw_Grating.measureLabels(mesName)(0) - Grating_Configurator.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) - Individual.Panel_Recesses.Controls("X_TextBox").Text Draw_Grating.measureLabels(mesName)(0) = Draw_Grating.measureLabels(mesName)(0) - Grating_Configurator.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) - Individual.Panel_Recesses.Controls("X_TextBox").Text Draw_Grating.measureLabels(mesName)(0) = Draw_Grating.measureLabels(mesName)(0) - Grating_Configurator.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
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) - Individual.Panel_Recesses.Controls("Y_TextBox").Text Draw_Grating.measureLabels(mesName)(0) = Draw_Grating.measureLabels(mesName)(0) - Grating_Configurator.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
Draw_Grating.sideSquareMesLine(mesName)(1) = Draw_Grating.sideSquareMesLine(mesName)(1) + dYGUI Draw_Grating.sideSquareMesLine(mesName)(1) = Draw_Grating.sideSquareMesLine(mesName)(1) + dYGUI
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) - Individual.Panel_Recesses.Controls("X_TextBox").Text Draw_Grating.measureLabels(mesName)(0) = Draw_Grating.measureLabels(mesName)(0) - Grating_Configurator.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
Else Else
Draw_Grating.measureLabels(mesName)(0) = Draw_Grating.measureLabels(mesName)(0) - Individual.Panel_Recesses.Controls("Y_TextBox").Text Draw_Grating.measureLabels(mesName)(0) = Draw_Grating.measureLabels(mesName)(0) - Grating_Configurator.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
Draw_Grating.sideSquareMesLine(mesName)(1) = Draw_Grating.sideSquareMesLine(mesName)(1) - dYGUI Draw_Grating.sideSquareMesLine(mesName)(1) = Draw_Grating.sideSquareMesLine(mesName)(1) - dYGUI
@ -247,16 +247,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(Individual.Panel_Recesses.Controls("X_TextBox").Text), pXGUI + dXGUI / 2 - 8, Draw_Grating.measureLabels.Add("S_" & mesNum, {CInt(Grating_Configurator.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(Individual.Panel_Recesses.Controls("Y_TextBox").Text), pXGUI + dXGUI + 3, Draw_Grating.measureLabels.Add("S_" & mesNum + 1, {CInt(Grating_Configurator.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(Individual.Panel_Recesses.Controls("Y_TextBox").Text) Data.recessData.Rows(Data.recessData.Rows.Count - 1)("WIDTH") = CInt(Grating_Configurator.Panel_Recesses.Controls("Y_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)("LENGTH") = CInt(Grating_Configurator.Panel_Recesses.Controls("X_TextBox").Text)
ElseIf pointQuadrant = 2 Then ElseIf pointQuadrant = 2 Then
' Add the new points ' Add the new points
@ -284,16 +284,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(Individual.Panel_Recesses.Controls("Y_TextBox").Text), pXGUI - dXGUI - 18 - 3, Draw_Grating.measureLabels.Add("S_" & mesNum, {CInt(Grating_Configurator.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(Individual.Panel_Recesses.Controls("X_TextBox").Text), pXGUI - dXGUI / 2 - 8, Draw_Grating.measureLabels.Add("S_" & mesNum + 1, {CInt(Grating_Configurator.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(Individual.Panel_Recesses.Controls("Y_TextBox").Text) Data.recessData.Rows(Data.recessData.Rows.Count - 1)("WIDTH") = CInt(Grating_Configurator.Panel_Recesses.Controls("Y_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)("LENGTH") = CInt(Grating_Configurator.Panel_Recesses.Controls("X_TextBox").Text)
ElseIf pointQuadrant = 3 Then ElseIf pointQuadrant = 3 Then
' Add the new points ' Add the new points
@ -320,16 +320,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(Individual.Panel_Recesses.Controls("X_TextBox").Text), pXGUI - dXGUI / 2 - 8, Draw_Grating.measureLabels.Add("S_" & mesNum, {CInt(Grating_Configurator.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(Individual.Panel_Recesses.Controls("Y_TextBox").Text), pXGUI - dXGUI - 18 - 3, Draw_Grating.measureLabels.Add("S_" & mesNum + 1, {CInt(Grating_Configurator.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(Individual.Panel_Recesses.Controls("Y_TextBox").Text) Data.recessData.Rows(Data.recessData.Rows.Count - 1)("WIDTH") = CInt(Grating_Configurator.Panel_Recesses.Controls("Y_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)("LENGTH") = CInt(Grating_Configurator.Panel_Recesses.Controls("X_TextBox").Text)
Else Else
' Add the new points ' Add the new points
@ -353,16 +353,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(Individual.Panel_Recesses.Controls("Y_TextBox").Text), pXGUI + dXGUI + 3, Draw_Grating.measureLabels.Add("S_" & mesNum, {CInt(Grating_Configurator.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(Individual.Panel_Recesses.Controls("X_TextBox").Text), pXGUI + dXGUI / 2 - 8, Draw_Grating.measureLabels.Add("S_" & mesNum + 1, {CInt(Grating_Configurator.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(Individual.Panel_Recesses.Controls("Y_TextBox").Text) Data.recessData.Rows(Data.recessData.Rows.Count - 1)("WIDTH") = CInt(Grating_Configurator.Panel_Recesses.Controls("Y_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)("LENGTH") = CInt(Grating_Configurator.Panel_Recesses.Controls("X_TextBox").Text)
End If End If
Data.gratingPoints.Rows.InsertAt(pointRow1, index + 1) Data.gratingPoints.Rows.InsertAt(pointRow1, index + 1)
@ -371,30 +371,30 @@
Data.gratingPoints.Rows.RemoveAt(index) Data.gratingPoints.Rows.RemoveAt(index)
'Redraw grating 'Redraw grating
Individual.Panel_Grating.Refresh() Grating_Configurator.Panel_Grating.Refresh()
RemoveHandler Individual.Panel_Recesses.Controls("X_TextBox").TextChanged, AddressOf FunctionTextCorner_Changed RemoveHandler Grating_Configurator.Panel_Recesses.Controls("X_TextBox").TextChanged, AddressOf FunctionTextCorner_Changed
RemoveHandler Individual.Panel_Recesses.Controls("X_TextBox").KeyPress, AddressOf FunctionText_KeyPress RemoveHandler Grating_Configurator.Panel_Recesses.Controls("X_TextBox").KeyPress, AddressOf FunctionText_KeyPress
Individual.Panel_Recesses.Controls.RemoveByKey("X_TextBox") Grating_Configurator.Panel_Recesses.Controls.RemoveByKey("X_TextBox")
RemoveHandler Individual.Panel_Recesses.Controls("Y_TextBox").TextChanged, AddressOf FunctionTextCorner_Changed RemoveHandler Grating_Configurator.Panel_Recesses.Controls("Y_TextBox").TextChanged, AddressOf FunctionTextCorner_Changed
RemoveHandler Individual.Panel_Recesses.Controls("Y_TextBox").KeyPress, AddressOf FunctionText_KeyPress RemoveHandler Grating_Configurator.Panel_Recesses.Controls("Y_TextBox").KeyPress, AddressOf FunctionText_KeyPress
Individual.Panel_Recesses.Controls.RemoveByKey("Y_TextBox") Grating_Configurator.Panel_Recesses.Controls.RemoveByKey("Y_TextBox")
Individual.Panel_Recesses.Controls.RemoveByKey("X_Label") Grating_Configurator.Panel_Recesses.Controls.RemoveByKey("X_Label")
Individual.Panel_Recesses.Controls.RemoveByKey("Y_Label") Grating_Configurator.Panel_Recesses.Controls.RemoveByKey("Y_Label")
Individual.Panel_Recesses.Controls("Button_Square_Side").Left = Individual.Panel_Recesses.Controls("Button_Square_Side").Left - buttonOffset Grating_Configurator.Panel_Recesses.Controls("Button_Square_Side").Left = Grating_Configurator.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 Grating_Configurator.Panel_Recesses.Controls("Button_Square_Middle").Left = Grating_Configurator.Panel_Recesses.Controls("Button_Square_Middle").Left - buttonOffset
Individual.Panel_Recesses.Controls("Button_Radius").Left = Individual.Panel_Recesses.Controls("Button_Radius").Left - buttonOffset Grating_Configurator.Panel_Recesses.Controls("Button_Radius").Left = Grating_Configurator.Panel_Recesses.Controls("Button_Radius").Left - buttonOffset
Individual.Panel_Recesses.Controls("Button_Angle_Corner").Enabled = True Grating_Configurator.Panel_Recesses.Controls("Button_Angle_Corner").Enabled = True
Individual.Panel_Recesses.Controls("Button_Angle_Side").Enabled = True Grating_Configurator.Panel_Recesses.Controls("Button_Angle_Side").Enabled = True
Individual.Panel_Recesses.Controls("Button_Square_Corner").Enabled = True Grating_Configurator.Panel_Recesses.Controls("Button_Square_Corner").Enabled = True
Individual.Panel_Recesses.Controls("Button_Square_Side").Enabled = True Grating_Configurator.Panel_Recesses.Controls("Button_Square_Side").Enabled = True
Individual.Panel_Recesses.Controls("Button_Square_Middle").Enabled = True Grating_Configurator.Panel_Recesses.Controls("Button_Square_Middle").Enabled = True
Individual.Button_Square_Corner.FlatAppearance.BorderColor = Color.Black Grating_Configurator.Button_Square_Corner.FlatAppearance.BorderColor = Color.Black
End Sub End Sub
' --- Determines the clicked points quadrant --- ' --- Determines the clicked points quadrant ---

View File

@ -5,40 +5,40 @@
' --- Create textboxes when user clicks the rectangle side recess button --- ' --- Create textboxes when user clicks the rectangle side recess button ---
Public Shared Sub SquareMiddleButtton(sender As Object, e As EventArgs) Public Shared Sub SquareMiddleButtton(sender As Object, e As EventArgs)
Individual.Panel_Recesses.Controls("Button_Angle_Corner").Enabled = False Grating_Configurator.Panel_Recesses.Controls("Button_Angle_Corner").Enabled = False
Individual.Panel_Recesses.Controls("Button_Angle_Side").Enabled = False Grating_Configurator.Panel_Recesses.Controls("Button_Angle_Side").Enabled = False
Individual.Panel_Recesses.Controls("Button_Square_Corner").Enabled = False Grating_Configurator.Panel_Recesses.Controls("Button_Square_Corner").Enabled = False
Individual.Panel_Recesses.Controls("Button_Square_Side").Enabled = False Grating_Configurator.Panel_Recesses.Controls("Button_Square_Side").Enabled = False
Individual.Panel_Recesses.Controls("Button_Square_Middle").Enabled = False Grating_Configurator.Panel_Recesses.Controls("Button_Square_Middle").Enabled = False
Dim buttonX As Integer = Individual.Panel_Recesses.Controls("Button_Square_Middle").Location.X + Individual.Panel_Recesses.Controls("Button_Square_Middle").Width Dim buttonX As Integer = Grating_Configurator.Panel_Recesses.Controls("Button_Square_Middle").Location.X + Grating_Configurator.Panel_Recesses.Controls("Button_Square_Middle").Width
Dim buttonY As Integer = Individual.Panel_Recesses.Controls("Button_Square_Middle").Location.Y Dim buttonY As Integer = Grating_Configurator.Panel_Recesses.Controls("Button_Square_Middle").Location.Y
Individual.Create_TextBox_Recesses("Y_TextBox", "", buttonX + 60, buttonY + 10, 60) Grating_Configurator.Create_TextBox_Recesses("Y_TextBox", "", buttonX + 60, buttonY + 10, 60)
AddHandler Individual.Panel_Recesses.Controls("Y_TextBox").TextChanged, AddressOf FunctionTextMiddle_Changed AddHandler Grating_Configurator.Panel_Recesses.Controls("Y_TextBox").TextChanged, AddressOf FunctionTextMiddle_Changed
AddHandler Individual.Panel_Recesses.Controls("Y_TextBox").KeyPress, AddressOf FunctionText_KeyPress AddHandler Grating_Configurator.Panel_Recesses.Controls("Y_TextBox").KeyPress, AddressOf FunctionText_KeyPress
Individual.Create_Label_Recesses("Y_Label", "Width", buttonX + 18, buttonY + 13) Grating_Configurator.Create_Label_Recesses("Y_Label", "Width", buttonX + 18, buttonY + 13)
Individual.Create_TextBox_Recesses("X_TextBox", "", buttonX + 60, buttonY + 40, 60) Grating_Configurator.Create_TextBox_Recesses("X_TextBox", "", buttonX + 60, buttonY + 40, 60)
AddHandler Individual.Panel_Recesses.Controls("X_TextBox").TextChanged, AddressOf FunctionTextMiddle_Changed AddHandler Grating_Configurator.Panel_Recesses.Controls("X_TextBox").TextChanged, AddressOf FunctionTextMiddle_Changed
AddHandler Individual.Panel_Recesses.Controls("X_TextBox").KeyPress, AddressOf FunctionText_KeyPress AddHandler Grating_Configurator.Panel_Recesses.Controls("X_TextBox").KeyPress, AddressOf FunctionText_KeyPress
Individual.Create_Label_Recesses("X_Label", "Length", buttonX + 10, buttonY + 43) Grating_Configurator.Create_Label_Recesses("X_Label", "Length", buttonX + 10, buttonY + 43)
Individual.Create_TextBox_Recesses("OffX_TextBox", "", buttonX + 185, buttonY + 10, 60) Grating_Configurator.Create_TextBox_Recesses("OffX_TextBox", "", buttonX + 185, buttonY + 10, 60)
AddHandler Individual.Panel_Recesses.Controls("OffX_TextBox").TextChanged, AddressOf FunctionTextMiddle_Changed AddHandler Grating_Configurator.Panel_Recesses.Controls("OffX_TextBox").TextChanged, AddressOf FunctionTextMiddle_Changed
AddHandler Individual.Panel_Recesses.Controls("OffX_TextBox").KeyPress, AddressOf FunctionText_KeyPress AddHandler Grating_Configurator.Panel_Recesses.Controls("OffX_TextBox").KeyPress, AddressOf FunctionText_KeyPress
Individual.Create_Label_Recesses("OffX_Label", "Offset X", buttonX + 126, buttonY + 13) Grating_Configurator.Create_Label_Recesses("OffX_Label", "Offset X", buttonX + 126, buttonY + 13)
Individual.Create_TextBox_Recesses("OffY_TextBox", "", buttonX + 185, buttonY + 40, 60) Grating_Configurator.Create_TextBox_Recesses("OffY_TextBox", "", buttonX + 185, buttonY + 40, 60)
AddHandler Individual.Panel_Recesses.Controls("OffY_TextBox").TextChanged, AddressOf FunctionTextMiddle_Changed AddHandler Grating_Configurator.Panel_Recesses.Controls("OffY_TextBox").TextChanged, AddressOf FunctionTextMiddle_Changed
AddHandler Individual.Panel_Recesses.Controls("OffY_TextBox").KeyPress, AddressOf FunctionText_KeyPress AddHandler Grating_Configurator.Panel_Recesses.Controls("OffY_TextBox").KeyPress, AddressOf FunctionText_KeyPress
Individual.Create_Label_Recesses("OffY_Label", "Offset Y", buttonX + 126, buttonY + 43) Grating_Configurator.Create_Label_Recesses("OffY_Label", "Offset Y", buttonX + 126, buttonY + 43)
buttonOffset = 260 buttonOffset = 260
Individual.Panel_Recesses.Controls("Button_Radius").Left = Individual.Panel_Recesses.Controls("Button_Radius").Left + buttonOffset Grating_Configurator.Panel_Recesses.Controls("Button_Radius").Left = Grating_Configurator.Panel_Recesses.Controls("Button_Radius").Left + buttonOffset
Individual.Button_Square_Middle.FlatStyle = FlatStyle.Flat Grating_Configurator.Button_Square_Middle.FlatStyle = FlatStyle.Flat
Individual.Button_Square_Middle.FlatAppearance.BorderColor = Color.Red Grating_Configurator.Button_Square_Middle.FlatAppearance.BorderColor = Color.Red
End Sub End Sub
' --- Check the key pressed by the user --- ' --- Check the key pressed by the user ---
@ -49,10 +49,10 @@
' --- Adds clickable buttons for all sides if conditions are met --- ' --- Adds clickable buttons for all sides if conditions are met ---
Private Shared Sub FunctionTextMiddle_Changed(sender As TextBox, e As EventArgs) Private Shared Sub FunctionTextMiddle_Changed(sender As TextBox, e As EventArgs)
Try Try
middleSquareValues(0) = CInt(Individual.Panel_Recesses.Controls("X_TextBox").Text) middleSquareValues(0) = CInt(Grating_Configurator.Panel_Recesses.Controls("X_TextBox").Text)
middleSquareValues(1) = CInt(Individual.Panel_Recesses.Controls("Y_TextBox").Text) middleSquareValues(1) = CInt(Grating_Configurator.Panel_Recesses.Controls("Y_TextBox").Text)
middleSquareValues(2) = CInt(Individual.Panel_Recesses.Controls("OffX_TextBox").Text) middleSquareValues(2) = CInt(Grating_Configurator.Panel_Recesses.Controls("OffX_TextBox").Text)
middleSquareValues(3) = CInt(Individual.Panel_Recesses.Controls("OffY_TextBox").Text) middleSquareValues(3) = CInt(Grating_Configurator.Panel_Recesses.Controls("OffY_TextBox").Text)
Catch ex As Exception Catch ex As Exception
middleSquareValues(0) = 0 middleSquareValues(0) = 0
middleSquareValues(1) = 0 middleSquareValues(1) = 0
@ -61,7 +61,7 @@
End Try End Try
If middleSquareValues(0) > 0 AndAlso middleSquareValues(1) > 0 AndAlso middleSquareValues(2) > 0 AndAlso middleSquareValues(3) > 0 Then If middleSquareValues(0) > 0 AndAlso middleSquareValues(1) > 0 AndAlso middleSquareValues(2) > 0 AndAlso middleSquareValues(3) > 0 Then
If Individual.Panel_Grating.Controls.Count = 2 Then If Grating_Configurator.Panel_Grating.Controls.Count = 2 Then
Dim middleButton As New Button With { Dim middleButton As New Button With {
.Width = middleSquareValues(0) / Data.scaleDiff, .Width = middleSquareValues(0) / Data.scaleDiff,
.Height = middleSquareValues(1) / Data.scaleDiff, .Height = middleSquareValues(1) / Data.scaleDiff,
@ -77,28 +77,28 @@
middleButton.FlatAppearance.MouseOverBackColor = Color.Red middleButton.FlatAppearance.MouseOverBackColor = Color.Red
middleButton.FlatAppearance.MouseDownBackColor = Color.DarkRed middleButton.FlatAppearance.MouseDownBackColor = Color.DarkRed
Individual.Panel_Grating.Controls.Add(middleButton) Grating_Configurator.Panel_Grating.Controls.Add(middleButton)
AddHandler middleButton.Click, AddressOf MiddleButton_Click AddHandler middleButton.Click, AddressOf MiddleButton_Click
Else Else
' Update button size and position ' Update button size and position
Individual.Panel_Grating.Controls("Button_Middle").Width = middleSquareValues(0) / Data.scaleDiff Grating_Configurator.Panel_Grating.Controls("Button_Middle").Width = middleSquareValues(0) / Data.scaleDiff
Individual.Panel_Grating.Controls("Button_Middle").Height = middleSquareValues(1) / Data.scaleDiff Grating_Configurator.Panel_Grating.Controls("Button_Middle").Height = middleSquareValues(1) / Data.scaleDiff
Individual.Panel_Grating.Controls("Button_Middle").Left = Data.grossAreaPoints.Rows(3)("GUI X") + middleSquareValues(2) / Data.scaleDiff Grating_Configurator.Panel_Grating.Controls("Button_Middle").Left = Data.grossAreaPoints.Rows(3)("GUI X") + middleSquareValues(2) / Data.scaleDiff
Individual.Panel_Grating.Controls("Button_Middle").Top = Data.grossAreaPoints.Rows(3)("GUI Y") - (middleSquareValues(3) + middleSquareValues(1)) / Data.scaleDiff Grating_Configurator.Panel_Grating.Controls("Button_Middle").Top = Data.grossAreaPoints.Rows(3)("GUI Y") - (middleSquareValues(3) + middleSquareValues(1)) / Data.scaleDiff
End If End If
ElseIf Individual.Panel_Grating.Controls.Count > 2 Then ElseIf Grating_Configurator.Panel_Grating.Controls.Count > 2 Then
RemoveHandler Individual.Panel_Grating.Controls("Button_Middle").Click, AddressOf MiddleButton_Click RemoveHandler Grating_Configurator.Panel_Grating.Controls("Button_Middle").Click, AddressOf MiddleButton_Click
Individual.Panel_Grating.Controls.RemoveByKey("Button_Middle") Grating_Configurator.Panel_Grating.Controls.RemoveByKey("Button_Middle")
End If End If
End Sub End Sub
' --- When a side function button is pressed --- ' --- When a side function button is pressed ---
Private Shared Sub MiddleButton_Click(sender As Button, e As EventArgs) Private Shared Sub MiddleButton_Click(sender As Button, e As EventArgs)
' Remove point buttons ' Remove point buttons
RemoveHandler Individual.Panel_Grating.Controls("Button_Middle").Click, AddressOf MiddleButton_Click RemoveHandler Grating_Configurator.Panel_Grating.Controls("Button_Middle").Click, AddressOf MiddleButton_Click
Individual.Panel_Grating.Controls.RemoveByKey("Button_Middle") Grating_Configurator.Panel_Grating.Controls.RemoveByKey("Button_Middle")
Dim mesNum As Integer = Data.pointsMeasurements.Count - 1 Dim mesNum As Integer = Data.pointsMeasurements.Count - 1
@ -173,33 +173,33 @@
' Add recess measurments (GUI) ' Add recess measurments (GUI)
Draw_Grating.measureLabels.Add("MS1_" & numOfMiddleRectangles & "_" & mesNum, Draw_Grating.measureLabels.Add("MS1_" & numOfMiddleRectangles & "_" & mesNum,
{CInt(Individual.Panel_Recesses.Controls("OffX_TextBox").Text), {CInt(Grating_Configurator.Panel_Recesses.Controls("OffX_TextBox").Text),
Data.grossAreaPoints.Rows(3)("GUI X") + (middleSquareValues(2) / Data.scaleDiff) / 2 - 8, Data.grossAreaPoints.Rows(3)("GUI X") + (middleSquareValues(2) / Data.scaleDiff) / 2 - 8,
Data.grossAreaPoints.Rows(3)("GUI Y") - middleSquareValues(3) / Data.scaleDiff - 12 - 3, Data.grossAreaPoints.Rows(3)("GUI Y") - middleSquareValues(3) / Data.scaleDiff - 12 - 3,
1}) 1})
Draw_Grating.measureLabels.Add("MS1_" & numOfMiddleRectangles & "_" & mesNum + 1, Draw_Grating.measureLabels.Add("MS1_" & numOfMiddleRectangles & "_" & mesNum + 1,
{CInt(Individual.Panel_Recesses.Controls("OffY_TextBox").Text), {CInt(Grating_Configurator.Panel_Recesses.Controls("OffY_TextBox").Text),
Data.grossAreaPoints.Rows(3)("GUI X") + middleSquareValues(2) / Data.scaleDiff + 3, Data.grossAreaPoints.Rows(3)("GUI X") + middleSquareValues(2) / Data.scaleDiff + 3,
Data.grossAreaPoints.Rows(3)("GUI Y") - middleSquareValues(3) / Data.scaleDiff + (middleSquareValues(3) / Data.scaleDiff) / 2 - 6, Data.grossAreaPoints.Rows(3)("GUI Y") - middleSquareValues(3) / Data.scaleDiff + (middleSquareValues(3) / Data.scaleDiff) / 2 - 6,
1}) 1})
Draw_Grating.measureLabels.Add("MS_" & numOfMiddleRectangles & "_" & mesNum + 2, Draw_Grating.measureLabels.Add("MS_" & numOfMiddleRectangles & "_" & mesNum + 2,
{CInt(Individual.Panel_Recesses.Controls("X_TextBox").Text), {CInt(Grating_Configurator.Panel_Recesses.Controls("X_TextBox").Text),
Data.grossAreaPoints.Rows(3)("GUI X") + middleSquareValues(2) / Data.scaleDiff + (CInt(Individual.Panel_Recesses.Controls("X_TextBox").Text) / Data.scaleDiff) / 2 - 8, Data.grossAreaPoints.Rows(3)("GUI X") + middleSquareValues(2) / Data.scaleDiff + (CInt(Grating_Configurator.Panel_Recesses.Controls("X_TextBox").Text) / Data.scaleDiff) / 2 - 8,
Data.grossAreaPoints.Rows(3)("GUI Y") - middleSquareValues(3) / Data.scaleDiff - CInt(Individual.Panel_Recesses.Controls("Y_TextBox").Text) / Data.scaleDiff - 12 - 3, Data.grossAreaPoints.Rows(3)("GUI Y") - middleSquareValues(3) / Data.scaleDiff - CInt(Grating_Configurator.Panel_Recesses.Controls("Y_TextBox").Text) / Data.scaleDiff - 12 - 3,
1}) 1})
Draw_Grating.measureLabels.Add("MS_" & numOfMiddleRectangles & "_" & mesNum + 3, Draw_Grating.measureLabels.Add("MS_" & numOfMiddleRectangles & "_" & mesNum + 3,
{CInt(Individual.Panel_Recesses.Controls("Y_TextBox").Text), {CInt(Grating_Configurator.Panel_Recesses.Controls("Y_TextBox").Text),
Data.grossAreaPoints.Rows(3)("GUI X") + middleSquareValues(2) / Data.scaleDiff + CInt(Individual.Panel_Recesses.Controls("X_TextBox").Text) / Data.scaleDiff + 3, Data.grossAreaPoints.Rows(3)("GUI X") + middleSquareValues(2) / Data.scaleDiff + CInt(Grating_Configurator.Panel_Recesses.Controls("X_TextBox").Text) / Data.scaleDiff + 3,
Data.grossAreaPoints.Rows(3)("GUI Y") - middleSquareValues(3) / Data.scaleDiff - (CInt(Individual.Panel_Recesses.Controls("Y_TextBox").Text) / Data.scaleDiff) / 2 - 6, Data.grossAreaPoints.Rows(3)("GUI Y") - middleSquareValues(3) / Data.scaleDiff - (CInt(Grating_Configurator.Panel_Recesses.Controls("Y_TextBox").Text) / Data.scaleDiff) / 2 - 6,
1}) 1})
' Recess Data ' Recess Data
Data.recessData.Rows(Data.recessData.Rows.Count - 1)("RECESS TYPE") = "MIDDLE SQUARE" Data.recessData.Rows(Data.recessData.Rows.Count - 1)("RECESS TYPE") = "MIDDLE SQUARE"
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)("WIDTH") = CInt(Grating_Configurator.Panel_Recesses.Controls("Y_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)("LENGTH") = CInt(Grating_Configurator.Panel_Recesses.Controls("X_TextBox").Text)
Data.recessData.Rows(Data.recessData.Rows.Count - 1)("OFFSET X") = CInt(Individual.Panel_Recesses.Controls("OffX_TextBox").Text) Data.recessData.Rows(Data.recessData.Rows.Count - 1)("OFFSET X") = CInt(Grating_Configurator.Panel_Recesses.Controls("OffX_TextBox").Text)
Data.recessData.Rows(Data.recessData.Rows.Count - 1)("OFFSET Y") = CInt(Individual.Panel_Recesses.Controls("OffY_TextBox").Text) Data.recessData.Rows(Data.recessData.Rows.Count - 1)("OFFSET Y") = CInt(Grating_Configurator.Panel_Recesses.Controls("OffY_TextBox").Text)
@ -209,37 +209,37 @@
Data.gratingMiddlePoints.Rows.InsertAt(pointRow4, numOfMiddleRectangles * 4 - 1) Data.gratingMiddlePoints.Rows.InsertAt(pointRow4, numOfMiddleRectangles * 4 - 1)
'Redraw grating 'Redraw grating
Individual.Panel_Grating.Refresh() Grating_Configurator.Panel_Grating.Refresh()
RemoveHandler Individual.Panel_Recesses.Controls("X_TextBox").TextChanged, AddressOf FunctionTextMiddle_Changed RemoveHandler Grating_Configurator.Panel_Recesses.Controls("X_TextBox").TextChanged, AddressOf FunctionTextMiddle_Changed
RemoveHandler Individual.Panel_Recesses.Controls("X_TextBox").KeyPress, AddressOf FunctionText_KeyPress RemoveHandler Grating_Configurator.Panel_Recesses.Controls("X_TextBox").KeyPress, AddressOf FunctionText_KeyPress
Individual.Panel_Recesses.Controls.RemoveByKey("X_TextBox") Grating_Configurator.Panel_Recesses.Controls.RemoveByKey("X_TextBox")
RemoveHandler Individual.Panel_Recesses.Controls("Y_TextBox").TextChanged, AddressOf FunctionTextMiddle_Changed RemoveHandler Grating_Configurator.Panel_Recesses.Controls("Y_TextBox").TextChanged, AddressOf FunctionTextMiddle_Changed
RemoveHandler Individual.Panel_Recesses.Controls("Y_TextBox").KeyPress, AddressOf FunctionText_KeyPress RemoveHandler Grating_Configurator.Panel_Recesses.Controls("Y_TextBox").KeyPress, AddressOf FunctionText_KeyPress
Individual.Panel_Recesses.Controls.RemoveByKey("Y_TextBox") Grating_Configurator.Panel_Recesses.Controls.RemoveByKey("Y_TextBox")
RemoveHandler Individual.Panel_Recesses.Controls("OffX_TextBox").TextChanged, AddressOf FunctionTextMiddle_Changed RemoveHandler Grating_Configurator.Panel_Recesses.Controls("OffX_TextBox").TextChanged, AddressOf FunctionTextMiddle_Changed
RemoveHandler Individual.Panel_Recesses.Controls("OffX_TextBox").KeyPress, AddressOf FunctionText_KeyPress RemoveHandler Grating_Configurator.Panel_Recesses.Controls("OffX_TextBox").KeyPress, AddressOf FunctionText_KeyPress
Individual.Panel_Recesses.Controls.RemoveByKey("OffX_TextBox") Grating_Configurator.Panel_Recesses.Controls.RemoveByKey("OffX_TextBox")
RemoveHandler Individual.Panel_Recesses.Controls("OffY_TextBox").TextChanged, AddressOf FunctionTextMiddle_Changed RemoveHandler Grating_Configurator.Panel_Recesses.Controls("OffY_TextBox").TextChanged, AddressOf FunctionTextMiddle_Changed
RemoveHandler Individual.Panel_Recesses.Controls("OffY_TextBox").KeyPress, AddressOf FunctionText_KeyPress RemoveHandler Grating_Configurator.Panel_Recesses.Controls("OffY_TextBox").KeyPress, AddressOf FunctionText_KeyPress
Individual.Panel_Recesses.Controls.RemoveByKey("OffY_TextBox") Grating_Configurator.Panel_Recesses.Controls.RemoveByKey("OffY_TextBox")
Individual.Panel_Recesses.Controls.RemoveByKey("X_Label") Grating_Configurator.Panel_Recesses.Controls.RemoveByKey("X_Label")
Individual.Panel_Recesses.Controls.RemoveByKey("Y_Label") Grating_Configurator.Panel_Recesses.Controls.RemoveByKey("Y_Label")
Individual.Panel_Recesses.Controls.RemoveByKey("OffX_Label") Grating_Configurator.Panel_Recesses.Controls.RemoveByKey("OffX_Label")
Individual.Panel_Recesses.Controls.RemoveByKey("OffY_Label") Grating_Configurator.Panel_Recesses.Controls.RemoveByKey("OffY_Label")
Individual.Panel_Recesses.Controls("Button_Angle_Corner").Enabled = True Grating_Configurator.Panel_Recesses.Controls("Button_Angle_Corner").Enabled = True
Individual.Panel_Recesses.Controls("Button_Angle_Side").Enabled = True Grating_Configurator.Panel_Recesses.Controls("Button_Angle_Side").Enabled = True
Individual.Panel_Recesses.Controls("Button_Square_Corner").Enabled = True Grating_Configurator.Panel_Recesses.Controls("Button_Square_Corner").Enabled = True
Individual.Panel_Recesses.Controls("Button_Square_Side").Enabled = True Grating_Configurator.Panel_Recesses.Controls("Button_Square_Side").Enabled = True
Individual.Panel_Recesses.Controls("Button_Square_Middle").Enabled = True Grating_Configurator.Panel_Recesses.Controls("Button_Square_Middle").Enabled = True
Individual.Panel_Recesses.Controls("Button_Radius").Left = Individual.Panel_Recesses.Controls("Button_Radius").Left - buttonOffset Grating_Configurator.Panel_Recesses.Controls("Button_Radius").Left = Grating_Configurator.Panel_Recesses.Controls("Button_Radius").Left - buttonOffset
Individual.Button_Square_Middle.FlatAppearance.BorderColor = Color.Black Grating_Configurator.Button_Square_Middle.FlatAppearance.BorderColor = Color.Black
End Sub End Sub
End Class End Class

View File

@ -5,36 +5,36 @@
' --- 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)
Individual.Panel_Recesses.Controls("Button_Angle_Corner").Enabled = False Grating_Configurator.Panel_Recesses.Controls("Button_Angle_Corner").Enabled = False
Individual.Panel_Recesses.Controls("Button_Angle_Side").Enabled = False Grating_Configurator.Panel_Recesses.Controls("Button_Angle_Side").Enabled = False
Individual.Panel_Recesses.Controls("Button_Square_Corner").Enabled = False Grating_Configurator.Panel_Recesses.Controls("Button_Square_Corner").Enabled = False
Individual.Panel_Recesses.Controls("Button_Square_Side").Enabled = False Grating_Configurator.Panel_Recesses.Controls("Button_Square_Side").Enabled = False
Individual.Panel_Recesses.Controls("Button_Square_Middle").Enabled = False Grating_Configurator.Panel_Recesses.Controls("Button_Square_Middle").Enabled = False
Dim buttonX As Integer = Individual.Panel_Recesses.Controls("Button_Square_Side").Location.X + Individual.Panel_Recesses.Controls("Button_Square_Side").Width Dim buttonX As Integer = Grating_Configurator.Panel_Recesses.Controls("Button_Square_Side").Location.X + Grating_Configurator.Panel_Recesses.Controls("Button_Square_Side").Width
Dim buttonY As Integer = Individual.Panel_Recesses.Controls("Button_Square_Side").Location.Y Dim buttonY As Integer = Grating_Configurator.Panel_Recesses.Controls("Button_Square_Side").Location.Y
Individual.Create_TextBox_Recesses("Y_TextBox", "", buttonX + 60, buttonY - 7, 60) Grating_Configurator.Create_TextBox_Recesses("Y_TextBox", "", buttonX + 60, buttonY - 7, 60)
AddHandler Individual.Panel_Recesses.Controls("Y_TextBox").TextChanged, AddressOf FunctionTextSide_Changed AddHandler Grating_Configurator.Panel_Recesses.Controls("Y_TextBox").TextChanged, AddressOf FunctionTextSide_Changed
AddHandler Individual.Panel_Recesses.Controls("Y_TextBox").KeyPress, AddressOf FunctionText_KeyPress AddHandler Grating_Configurator.Panel_Recesses.Controls("Y_TextBox").KeyPress, AddressOf FunctionText_KeyPress
Individual.Create_Label_Recesses("Y_Label", "Width", buttonX + 18, buttonY - 4) Grating_Configurator.Create_Label_Recesses("Y_Label", "Width", buttonX + 18, buttonY - 4)
Individual.Create_TextBox_Recesses("X_TextBox", "", buttonX + 60, buttonY + 23, 60) Grating_Configurator.Create_TextBox_Recesses("X_TextBox", "", buttonX + 60, buttonY + 23, 60)
AddHandler Individual.Panel_Recesses.Controls("X_TextBox").TextChanged, AddressOf FunctionTextSide_Changed AddHandler Grating_Configurator.Panel_Recesses.Controls("X_TextBox").TextChanged, AddressOf FunctionTextSide_Changed
AddHandler Individual.Panel_Recesses.Controls("X_TextBox").KeyPress, AddressOf FunctionText_KeyPress AddHandler Grating_Configurator.Panel_Recesses.Controls("X_TextBox").KeyPress, AddressOf FunctionText_KeyPress
Individual.Create_Label_Recesses("X_Label", "Length", buttonX + 10, buttonY + 26) Grating_Configurator.Create_Label_Recesses("X_Label", "Length", buttonX + 10, buttonY + 26)
Individual.Create_TextBox_Recesses("Off_TextBox", "", buttonX + 60, buttonY + 53, 60) Grating_Configurator.Create_TextBox_Recesses("Off_TextBox", "", buttonX + 60, buttonY + 53, 60)
AddHandler Individual.Panel_Recesses.Controls("Off_TextBox").TextChanged, AddressOf FunctionTextSide_Changed AddHandler Grating_Configurator.Panel_Recesses.Controls("Off_TextBox").TextChanged, AddressOf FunctionTextSide_Changed
AddHandler Individual.Panel_Recesses.Controls("Off_TextBox").KeyPress, AddressOf FunctionText_KeyPress AddHandler Grating_Configurator.Panel_Recesses.Controls("Off_TextBox").KeyPress, AddressOf FunctionText_KeyPress
Individual.Create_Label_Recesses("Off_Label", "Offset", buttonX + 16, buttonY + 56) Grating_Configurator.Create_Label_Recesses("Off_Label", "Offset", buttonX + 16, buttonY + 56)
buttonOffset = 130 buttonOffset = 130
Individual.Panel_Recesses.Controls("Button_Square_Middle").Left = Individual.Panel_Recesses.Controls("Button_Square_Middle").Left + buttonOffset Grating_Configurator.Panel_Recesses.Controls("Button_Square_Middle").Left = Grating_Configurator.Panel_Recesses.Controls("Button_Square_Middle").Left + buttonOffset
Individual.Panel_Recesses.Controls("Button_Radius").Left = Individual.Panel_Recesses.Controls("Button_Radius").Left + buttonOffset Grating_Configurator.Panel_Recesses.Controls("Button_Radius").Left = Grating_Configurator.Panel_Recesses.Controls("Button_Radius").Left + buttonOffset
Individual.Button_Square_Side.FlatStyle = FlatStyle.Flat Grating_Configurator.Button_Square_Side.FlatStyle = FlatStyle.Flat
Individual.Button_Square_Side.FlatAppearance.BorderColor = Color.Red Grating_Configurator.Button_Square_Side.FlatAppearance.BorderColor = Color.Red
End Sub End Sub
@ -46,9 +46,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(Individual.Panel_Recesses.Controls("X_TextBox").Text) sideSquareValues(0) = CInt(Grating_Configurator.Panel_Recesses.Controls("X_TextBox").Text)
sideSquareValues(1) = CInt(Individual.Panel_Recesses.Controls("Y_TextBox").Text) sideSquareValues(1) = CInt(Grating_Configurator.Panel_Recesses.Controls("Y_TextBox").Text)
sideSquareValues(2) = CInt(Individual.Panel_Recesses.Controls("Off_TextBox").Text) sideSquareValues(2) = CInt(Grating_Configurator.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
@ -56,7 +56,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 Individual.Panel_Grating.Controls.Count = 2 Then If Grating_Configurator.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
@ -82,30 +82,30 @@
Next Next
Else Else
' Update button size and position ' Update button size and position
For i = 2 To Individual.Panel_Grating.Controls.Count - 1 For i = 2 To Grating_Configurator.Panel_Grating.Controls.Count - 1
Dim buttonSide As Integer = CInt(Individual.Panel_Grating.Controls(i).Name.Split("_")(1)) Dim buttonSide As Integer = CInt(Grating_Configurator.Panel_Grating.Controls(i).Name.Split("_")(1))
If buttonSide = 1 Then If buttonSide = 1 Then
Individual.Panel_Grating.Controls(i).Width = sideSquareValues(0) / (Data.scaleDiff) Grating_Configurator.Panel_Grating.Controls(i).Width = sideSquareValues(0) / (Data.scaleDiff)
Individual.Panel_Grating.Controls(i).Left = Data.grossAreaPoints.Rows(0)("GUI X") + sideSquareValues(2) / (Data.scaleDiff) Grating_Configurator.Panel_Grating.Controls(i).Left = Data.grossAreaPoints.Rows(0)("GUI X") + sideSquareValues(2) / (Data.scaleDiff)
ElseIf buttonSide = 2 Then ElseIf buttonSide = 2 Then
Individual.Panel_Grating.Controls(i).Height = sideSquareValues(1) / (Data.scaleDiff) Grating_Configurator.Panel_Grating.Controls(i).Height = sideSquareValues(1) / (Data.scaleDiff)
Individual.Panel_Grating.Controls(i).Top = Data.grossAreaPoints.Rows(1)("GUI Y") + sideSquareValues(2) / (Data.scaleDiff) Grating_Configurator.Panel_Grating.Controls(i).Top = Data.grossAreaPoints.Rows(1)("GUI Y") + sideSquareValues(2) / (Data.scaleDiff)
ElseIf buttonSide = 3 Then ElseIf buttonSide = 3 Then
Individual.Panel_Grating.Controls(i).Width = sideSquareValues(0) / (Data.scaleDiff) Grating_Configurator.Panel_Grating.Controls(i).Width = sideSquareValues(0) / (Data.scaleDiff)
Individual.Panel_Grating.Controls(i).Left = Data.grossAreaPoints.Rows(2)("GUI X") - sideSquareValues(2) / (Data.scaleDiff) - Individual.Panel_Grating.Controls(i).Width Grating_Configurator.Panel_Grating.Controls(i).Left = Data.grossAreaPoints.Rows(2)("GUI X") - sideSquareValues(2) / (Data.scaleDiff) - Grating_Configurator.Panel_Grating.Controls(i).Width
Else Else
Individual.Panel_Grating.Controls(i).Height = sideSquareValues(1) / (Data.scaleDiff) Grating_Configurator.Panel_Grating.Controls(i).Height = sideSquareValues(1) / (Data.scaleDiff)
Individual.Panel_Grating.Controls(i).Top = Data.grossAreaPoints.Rows(3)("GUI Y") - sideSquareValues(2) / (Data.scaleDiff) - Individual.Panel_Grating.Controls(i).Height Grating_Configurator.Panel_Grating.Controls(i).Top = Data.grossAreaPoints.Rows(3)("GUI Y") - sideSquareValues(2) / (Data.scaleDiff) - Grating_Configurator.Panel_Grating.Controls(i).Height
End If End If
Next Next
End If End If
ElseIf Individual.Panel_Grating.Controls.Count > 2 Then ElseIf Grating_Configurator.Panel_Grating.Controls.Count > 2 Then
For i = 2 To Individual.Panel_Grating.Controls.Count - 1 For i = 2 To Grating_Configurator.Panel_Grating.Controls.Count - 1
RemoveHandler Individual.Panel_Grating.Controls(2).Click, AddressOf SideButton_Click RemoveHandler Grating_Configurator.Panel_Grating.Controls(2).Click, AddressOf SideButton_Click
Individual.Panel_Grating.Controls.RemoveAt(2) Grating_Configurator.Panel_Grating.Controls.RemoveAt(2)
Next Next
End If End If
End Sub End Sub
@ -127,7 +127,7 @@
sideButton.FlatAppearance.MouseOverBackColor = Color.Red sideButton.FlatAppearance.MouseOverBackColor = Color.Red
sideButton.FlatAppearance.MouseDownBackColor = Color.DarkRed sideButton.FlatAppearance.MouseDownBackColor = Color.DarkRed
Individual.Panel_Grating.Controls.Add(sideButton) Grating_Configurator.Panel_Grating.Controls.Add(sideButton)
AddHandler sideButton.Click, AddressOf SideButton_Click AddHandler sideButton.Click, AddressOf SideButton_Click
End Sub End Sub
@ -138,9 +138,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 Individual.Panel_Grating.Controls.Count - 1 For i = 2 To Grating_Configurator.Panel_Grating.Controls.Count - 1
RemoveHandler Individual.Panel_Grating.Controls(2).Click, AddressOf SideButton_Click RemoveHandler Grating_Configurator.Panel_Grating.Controls(2).Click, AddressOf SideButton_Click
Individual.Panel_Grating.Controls.RemoveAt(2) Grating_Configurator.Panel_Grating.Controls.RemoveAt(2)
Next Next
Dim sidePoints As New List(Of Integer) Dim sidePoints As New List(Of Integer)
@ -346,25 +346,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(Individual.Panel_Recesses.Controls("Off_TextBox").Text) - (Data.gratingPoints.Rows(index)("X") * 1000 + Data.gratingL / 2), Draw_Grating.measureLabels.Add("SS1_" & mesNum, {CInt(Grating_Configurator.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(Individual.Panel_Recesses.Controls("X_TextBox").Text), Draw_Grating.measureLabels.Add("SS_" & mesNum + 1, {CInt(Grating_Configurator.Panel_Recesses.Controls("X_TextBox").Text),
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 X") + sideSquareValues(2) / (Data.scaleDiff) + CInt(Grating_Configurator.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(Individual.Panel_Recesses.Controls("Y_TextBox").Text), Draw_Grating.measureLabels.Add("SS_" & mesNum + 2, {CInt(Grating_Configurator.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(Individual.Panel_Recesses.Controls("Y_TextBox").Text) / (2 * Data.scaleDiff) - 4, Data.grossAreaPoints.Rows(0)("GUI Y") + CInt(Grating_Configurator.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(Individual.Panel_Recesses.Controls("Y_TextBox").Text) Data.recessData.Rows(Data.recessData.Rows.Count - 1)("WIDTH") = CInt(Grating_Configurator.Panel_Recesses.Controls("Y_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)("LENGTH") = CInt(Grating_Configurator.Panel_Recesses.Controls("X_TextBox").Text)
Data.recessData.Rows(Data.recessData.Rows.Count - 1)("OFFSET") = CInt(Individual.Panel_Recesses.Controls("Off_TextBox").Text) Data.recessData.Rows(Data.recessData.Rows.Count - 1)("OFFSET") = CInt(Grating_Configurator.Panel_Recesses.Controls("Off_TextBox").Text)
ElseIf sidePressed = 2 Then ElseIf sidePressed = 2 Then
' Add the new points ' Add the new points
@ -403,17 +403,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(Individual.Panel_Recesses.Controls("Off_TextBox").Text) - (Data.gratingW / 2 - Data.gratingPoints.Rows(index)("Y") * 1000), Draw_Grating.measureLabels.Add("SS1_" & mesNum, {CInt(Grating_Configurator.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(Individual.Panel_Recesses.Controls("Y_TextBox").Text), Draw_Grating.measureLabels.Add("SS_" & mesNum + 1, {CInt(Grating_Configurator.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(Individual.Panel_Recesses.Controls("X_TextBox").Text), Draw_Grating.measureLabels.Add("SS_" & mesNum + 2, {CInt(Grating_Configurator.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})
@ -421,9 +421,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(Individual.Panel_Recesses.Controls("Y_TextBox").Text) Data.recessData.Rows(Data.recessData.Rows.Count - 1)("WIDTH") = CInt(Grating_Configurator.Panel_Recesses.Controls("Y_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)("LENGTH") = CInt(Grating_Configurator.Panel_Recesses.Controls("X_TextBox").Text)
Data.recessData.Rows(Data.recessData.Rows.Count - 1)("OFFSET") = CInt(Individual.Panel_Recesses.Controls("Off_TextBox").Text) Data.recessData.Rows(Data.recessData.Rows.Count - 1)("OFFSET") = CInt(Grating_Configurator.Panel_Recesses.Controls("Off_TextBox").Text)
ElseIf sidePressed = 3 Then ElseIf sidePressed = 3 Then
' Add the new points ' Add the new points
@ -459,25 +459,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(Individual.Panel_Recesses.Controls("Off_TextBox").Text) - (Data.gratingL / 2 - Data.gratingPoints.Rows(index)("X") * 1000), Draw_Grating.measureLabels.Add("SS1_" & mesNum, {CInt(Grating_Configurator.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(Individual.Panel_Recesses.Controls("X_TextBox").Text), Draw_Grating.measureLabels.Add("SS_" & mesNum + 1, {CInt(Grating_Configurator.Panel_Recesses.Controls("X_TextBox").Text),
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 X") - sideSquareValues(2) / (Data.scaleDiff) - CInt(Grating_Configurator.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(Individual.Panel_Recesses.Controls("Y_TextBox").Text), Draw_Grating.measureLabels.Add("SS_" & mesNum + 2, {CInt(Grating_Configurator.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(Individual.Panel_Recesses.Controls("Y_TextBox").Text) / (2 * Data.scaleDiff) - 4, Data.grossAreaPoints.Rows(2)("GUI Y") - CInt(Grating_Configurator.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(Individual.Panel_Recesses.Controls("Y_TextBox").Text) Data.recessData.Rows(Data.recessData.Rows.Count - 1)("WIDTH") = CInt(Grating_Configurator.Panel_Recesses.Controls("Y_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)("LENGTH") = CInt(Grating_Configurator.Panel_Recesses.Controls("X_TextBox").Text)
Data.recessData.Rows(Data.recessData.Rows.Count - 1)("OFFSET") = CInt(Individual.Panel_Recesses.Controls("Off_TextBox").Text) Data.recessData.Rows(Data.recessData.Rows.Count - 1)("OFFSET") = CInt(Grating_Configurator.Panel_Recesses.Controls("Off_TextBox").Text)
Else Else
' Add the new points ' Add the new points
@ -513,17 +513,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(Individual.Panel_Recesses.Controls("Off_TextBox").Text) - (Data.gratingW / 2 + Data.gratingPoints.Rows(index)("Y") * 1000), Draw_Grating.measureLabels.Add("SS1_" & mesNum, {CInt(Grating_Configurator.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(Individual.Panel_Recesses.Controls("Y_TextBox").Text), Draw_Grating.measureLabels.Add("SS_" & mesNum + 1, {CInt(Grating_Configurator.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(Individual.Panel_Recesses.Controls("X_TextBox").Text), Draw_Grating.measureLabels.Add("SS_" & mesNum + 2, {CInt(Grating_Configurator.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})
@ -531,9 +531,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(Individual.Panel_Recesses.Controls("Y_TextBox").Text) Data.recessData.Rows(Data.recessData.Rows.Count - 1)("WIDTH") = CInt(Grating_Configurator.Panel_Recesses.Controls("Y_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)("LENGTH") = CInt(Grating_Configurator.Panel_Recesses.Controls("X_TextBox").Text)
Data.recessData.Rows(Data.recessData.Rows.Count - 1)("OFFSET") = CInt(Individual.Panel_Recesses.Controls("Off_TextBox").Text) Data.recessData.Rows(Data.recessData.Rows.Count - 1)("OFFSET") = CInt(Grating_Configurator.Panel_Recesses.Controls("Off_TextBox").Text)
End If End If
Data.gratingPoints.Rows.InsertAt(pointRow1, index + 1) Data.gratingPoints.Rows.InsertAt(pointRow1, index + 1)
@ -544,35 +544,35 @@
numOfSideRectangles += 1 numOfSideRectangles += 1
'Redraw grating 'Redraw grating
Individual.Panel_Grating.Refresh() Grating_Configurator.Panel_Grating.Refresh()
RemoveHandler Individual.Panel_Recesses.Controls("X_TextBox").TextChanged, AddressOf FunctionTextSide_Changed RemoveHandler Grating_Configurator.Panel_Recesses.Controls("X_TextBox").TextChanged, AddressOf FunctionTextSide_Changed
RemoveHandler Individual.Panel_Recesses.Controls("X_TextBox").KeyPress, AddressOf FunctionText_KeyPress RemoveHandler Grating_Configurator.Panel_Recesses.Controls("X_TextBox").KeyPress, AddressOf FunctionText_KeyPress
Individual.Panel_Recesses.Controls.RemoveByKey("X_TextBox") Grating_Configurator.Panel_Recesses.Controls.RemoveByKey("X_TextBox")
RemoveHandler Individual.Panel_Recesses.Controls("Y_TextBox").TextChanged, AddressOf FunctionTextSide_Changed RemoveHandler Grating_Configurator.Panel_Recesses.Controls("Y_TextBox").TextChanged, AddressOf FunctionTextSide_Changed
RemoveHandler Individual.Panel_Recesses.Controls("Y_TextBox").KeyPress, AddressOf FunctionText_KeyPress RemoveHandler Grating_Configurator.Panel_Recesses.Controls("Y_TextBox").KeyPress, AddressOf FunctionText_KeyPress
Individual.Panel_Recesses.Controls.RemoveByKey("Y_TextBox") Grating_Configurator.Panel_Recesses.Controls.RemoveByKey("Y_TextBox")
RemoveHandler Individual.Panel_Recesses.Controls("Off_TextBox").TextChanged, AddressOf FunctionTextSide_Changed RemoveHandler Grating_Configurator.Panel_Recesses.Controls("Off_TextBox").TextChanged, AddressOf FunctionTextSide_Changed
RemoveHandler Individual.Panel_Recesses.Controls("Off_TextBox").KeyPress, AddressOf FunctionText_KeyPress RemoveHandler Grating_Configurator.Panel_Recesses.Controls("Off_TextBox").KeyPress, AddressOf FunctionText_KeyPress
Individual.Panel_Recesses.Controls.RemoveByKey("Off_TextBox") Grating_Configurator.Panel_Recesses.Controls.RemoveByKey("Off_TextBox")
Individual.Panel_Recesses.Controls.RemoveByKey("X_Label") Grating_Configurator.Panel_Recesses.Controls.RemoveByKey("X_Label")
Individual.Panel_Recesses.Controls.RemoveByKey("Y_Label") Grating_Configurator.Panel_Recesses.Controls.RemoveByKey("Y_Label")
Individual.Panel_Recesses.Controls.RemoveByKey("Off_Label") Grating_Configurator.Panel_Recesses.Controls.RemoveByKey("Off_Label")
Individual.Panel_Recesses.Controls("Button_Angle_Corner").Enabled = True Grating_Configurator.Panel_Recesses.Controls("Button_Angle_Corner").Enabled = True
Individual.Panel_Recesses.Controls("Button_Angle_Side").Enabled = True Grating_Configurator.Panel_Recesses.Controls("Button_Angle_Side").Enabled = True
Individual.Panel_Recesses.Controls("Button_Square_Corner").Enabled = True Grating_Configurator.Panel_Recesses.Controls("Button_Square_Corner").Enabled = True
Individual.Panel_Recesses.Controls("Button_Square_Side").Enabled = True Grating_Configurator.Panel_Recesses.Controls("Button_Square_Side").Enabled = True
Individual.Panel_Recesses.Controls("Button_Square_Middle").Enabled = True Grating_Configurator.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 Grating_Configurator.Panel_Recesses.Controls("Button_Square_Middle").Left = Grating_Configurator.Panel_Recesses.Controls("Button_Square_Middle").Left - buttonOffset
Individual.Panel_Recesses.Controls("Button_Radius").Left = Individual.Panel_Recesses.Controls("Button_Radius").Left - buttonOffset Grating_Configurator.Panel_Recesses.Controls("Button_Radius").Left = Grating_Configurator.Panel_Recesses.Controls("Button_Radius").Left - buttonOffset
Individual.Button_Square_Side.FlatAppearance.BorderColor = Color.Black Grating_Configurator.Button_Square_Side.FlatAppearance.BorderColor = Color.Black
End Sub End Sub
End Class End Class

View File

@ -469,9 +469,9 @@ Public Class Frame_3D
If endPieceLength > 0 Then If endPieceLength > 0 Then
Dim Part = swApp.OpenDoc6(Settings2ABC.HLCtFolder & "\HLCt\frame_l_straight.SLDPRT", 1, 0, "", longstatus, longwarnings) Dim Part = swApp.OpenDoc6(Settings.HLCtFolder & "\HLCt\frame_l_straight.SLDPRT", 1, 0, "", longstatus, longwarnings)
longstatus = Part.SaveAs3(Settings2ABC.folderPaths("object_" & Data.objectNum & "_models3D_frames_sw_support") & "\FRAME_L_END_PIECE" & j + 1 & ".SLDPRT", 0, 0) longstatus = Part.SaveAs3(Settings.folderPaths("object_" & Data.objectNum & "_models3D_frames_sw_support") & "\FRAME_L_END_PIECE" & j + 1 & ".SLDPRT", 0, 0)
Dim swEquationMgr As EquationMgr Dim swEquationMgr As EquationMgr
swEquationMgr = Part.GetEquationMgr() swEquationMgr = Part.GetEquationMgr()
@ -511,7 +511,7 @@ Public Class Frame_3D
Dim swWarnings As Integer Dim swWarnings As Integer
boolstatus = Part.Save3(4, swErrors, swWarnings) boolstatus = Part.Save3(4, swErrors, swWarnings)
swApp.CloseDoc(Settings2ABC.folderPaths("object_" & Data.objectNum & "_models3D_frames_sw_support") & "\FRAME_L_END_PIECE" & j + 1 & ".SLDPRT") swApp.CloseDoc(Settings.folderPaths("object_" & Data.objectNum & "_models3D_frames_sw_support") & "\FRAME_L_END_PIECE" & j + 1 & ".SLDPRT")
End If End If
Next Next
End Sub End Sub

View File

@ -30,12 +30,12 @@ Public Class Frame_Drawing
Dim transMatrix As Object = Nothing Dim transMatrix As Object = Nothing
For j = 0 To compNames.Count - 2 + endPieceExist For j = 0 To compNames.Count - 2 + endPieceExist
Dim frameID = Frame_3D.cuttingList.ElementAt(i).Value(j) Dim frameID = Frame_3D.cuttingList.ElementAt(i).Value(j)
compNames(j) = Settings2ABC.folderPaths("object_" & Data.objectNum & "_models3D_frames_sw") & "\" & "FRAME_L_STRAIGHT_" & frameID & ".SLDPRT" compNames(j) = Settings.folderPaths("object_" & Data.objectNum & "_models3D_frames_sw") & "\" & "FRAME_L_STRAIGHT_" & frameID & ".SLDPRT"
coordNames(j) = "" coordNames(j) = ""
Next Next
If endPieceLength > 0 Then If endPieceLength > 0 Then
compNames(compNames.Count - 1) = Settings2ABC.folderPaths("object_" & Data.objectNum & "_models3D_frames_sw_support") & "\FRAME_L_END_PIECE" & i + 1 & ".SLDPRT" compNames(compNames.Count - 1) = Settings.folderPaths("object_" & Data.objectNum & "_models3D_frames_sw_support") & "\FRAME_L_END_PIECE" & i + 1 & ".SLDPRT"
coordNames(coordNames.Count - 1) = "" coordNames(coordNames.Count - 1) = ""
End If End If
@ -45,7 +45,7 @@ Public Class Frame_Drawing
Dim config As Configuration Dim config As Configuration
config = assembly.GetActiveConfiguration config = assembly.GetActiveConfiguration
Dim swCustPropMgr = config.CustomPropertyManager Dim swCustPropMgr = config.CustomPropertyManager
longstatus = swCustPropMgr.Add3("Benämning", 30, "Whole L Straight Frame " & Individual.ComboBox_Frame.Text & " x 3", 1) longstatus = swCustPropMgr.Add3("Benämning", 30, "Whole L Straight Frame " & Grating_Configurator.ComboBox_Frame.Text & " x 3", 1)
longstatus = swCustPropMgr.Add3("ExtraBenämning1", 30, "Cutting Instructions for Whole Frame ", 1) longstatus = swCustPropMgr.Add3("ExtraBenämning1", 30, "Cutting Instructions for Whole Frame ", 1)
longstatus = swCustPropMgr.Add3("Materialsort", 30, "Hot Dip Galvanized Steel", 1) longstatus = swCustPropMgr.Add3("Materialsort", 30, "Hot Dip Galvanized Steel", 1)
longstatus = swCustPropMgr.Add3("Art. Nr", 30, "TBD", 1) longstatus = swCustPropMgr.Add3("Art. Nr", 30, "TBD", 1)
@ -60,9 +60,9 @@ Public Class Frame_Drawing
longstatus = swCustPropMgr.Add3("Revision", 30, "", 1) longstatus = swCustPropMgr.Add3("Revision", 30, "", 1)
longstatus = model.SaveAs3(Settings2ABC.folderPaths("object_" & Data.objectNum & "_models3D_frames_sw") & "\FRAME_ASSEMBLY" & i + 1 & ".SLDASM", 0, 0) longstatus = model.SaveAs3(Settings.folderPaths("object_" & Data.objectNum & "_models3D_frames_sw") & "\FRAME_ASSEMBLY" & i + 1 & ".SLDASM", 0, 0)
swApp.CloseDoc(Settings2ABC.folderPaths("object_" & Data.objectNum & "_models3D_frames_sw") & "\FRAME_ASSEMBLY" & i + 1 & ".SLDASM") swApp.CloseDoc(Settings.folderPaths("object_" & Data.objectNum & "_models3D_frames_sw") & "\FRAME_ASSEMBLY" & i + 1 & ".SLDASM")
Next Next
End Sub End Sub
@ -82,7 +82,7 @@ Public Class Frame_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(Settings2ABC.HLCtFolder & "\Files Needed\A3 Part.slddrt") swSheet.SetTemplateName(Settings.HLCtFolder & "\Files Needed\A3 Part.slddrt")
swSheet.ReloadTemplate(True) swSheet.ReloadTemplate(True)
swSheet.SetScale(1, 10, False, False) swSheet.SetScale(1, 10, False, False)
swSheet.SetName("Frame 1") swSheet.SetName("Frame 1")
@ -92,14 +92,14 @@ Public Class Frame_Drawing
For i = 0 To Frame_3D.cuttingList.Count - 1 For i = 0 To Frame_3D.cuttingList.Count - 1
If i > 0 Then If i > 0 Then
status = iDrawing.NewSheet3("Frame" & i + 1, 12, 12, 1, 10, False, Settings2ABC.HLCtFolder & "\Files Needed\A3 Part.slddrt", status = iDrawing.NewSheet3("Frame" & i + 1, 12, 12, 1, 10, False, Settings.HLCtFolder & "\Files Needed\A3 Part.slddrt",
swSheetWidth, swSheetHeight, "Same as sheet specified in Document Properties") swSheetWidth, swSheetHeight, "Same as sheet specified in Document Properties")
End If End If
status = layMgr.SetCurrentLayer("Svenska") status = layMgr.SetCurrentLayer("Svenska")
Dim myView As View Dim myView As View
myView = iDrawing.CreateDrawViewFromModelView3(Settings2ABC.folderPaths("object_" & Data.objectNum & "_models3D_frames_sw") & "\FRAME_ASSEMBLY" & i + 1 & ".SLDASM", myView = iDrawing.CreateDrawViewFromModelView3(Settings.folderPaths("object_" & Data.objectNum & "_models3D_frames_sw") & "\FRAME_ASSEMBLY" & i + 1 & ".SLDASM",
"*Front", swSheetWidth / 2, swSheetHeight / 2, 0) "*Front", swSheetWidth / 2, swSheetHeight / 2, 0)
myView.UseSheetScale() = True myView.UseSheetScale() = True
myView.SetDisplayTangentEdges2(2) myView.SetDisplayTangentEdges2(2)
@ -192,10 +192,10 @@ Public Class Frame_Drawing
Next Next
Dim newName As String Dim newName As String
newName = Settings2ABC.folderPaths("object_" & Data.objectNum & "_drawings_frames_sw") & "\frame_drawing.SLDDRW" newName = Settings.folderPaths("object_" & Data.objectNum & "_drawings_frames_sw") & "\frame_drawing.SLDDRW"
status = iDrawing.SaveAs3(newName, 0, 0) status = iDrawing.SaveAs3(newName, 0, 0)
status = iDrawing.SaveAs3(Settings2ABC.folderPaths("object_" & Data.objectNum & "_drawings_frames_pdf") & "\frame_drawing.pdf", 0, 2) status = iDrawing.SaveAs3(Settings.folderPaths("object_" & Data.objectNum & "_drawings_frames_pdf") & "\frame_drawing.pdf", 0, 2)
End Sub End Sub

View File

@ -81,15 +81,15 @@ Public Class Individual_3D
Dim childrenSourcePaths As New List(Of String) Dim childrenSourcePaths As New List(Of String)
Dim childrenDestPaths As New List(Of String) Dim childrenDestPaths As New List(Of String)
sourcePath = Settings2ABC.filesFolder & "\Files\CADStart\" & designName & ".SLDASM" sourcePath = Settings.filesFolder & "\Files\CADStart\" & designName & ".SLDASM"
destPath = Settings2ABC.folderPaths("object_" & Data.objectNum & "_models3D_gratings_sw") & "\GRATING_ASSEMBLY.SLDASM" destPath = Settings.folderPaths("object_" & Data.objectNum & "_models3D_gratings_sw") & "\GRATING_ASSEMBLY.SLDASM"
childrenSourcePaths.Add(Settings2ABC.HLCtFolder & "\HLCt\Parts\START.SLDPRT") childrenSourcePaths.Add(Settings.HLCtFolder & "\HLCt\Parts\START.SLDPRT")
childrenDestPaths.Add(Settings2ABC.folderPaths("object_" & Data.objectNum & "_models3D_gratings_sw_support") & "\MASTER.SLDPRT") childrenDestPaths.Add(Settings.folderPaths("object_" & Data.objectNum & "_models3D_gratings_sw_support") & "\MASTER.SLDPRT")
Dim instanceCounter As New Dictionary(Of String, Integer) Dim instanceCounter As New Dictionary(Of String, Integer)
For i = 0 To partDT.Rows.Count - 1 For i = 0 To partDT.Rows.Count - 1
childrenSourcePaths.Add(Settings2ABC.filesFolder & "\Files\CADStart\" & partDT.Rows(i)("partName") & ".SLDPRT") childrenSourcePaths.Add(Settings.filesFolder & "\Files\CADStart\" & partDT.Rows(i)("partName") & ".SLDPRT")
Dim partName As String = partDT.Rows(i)("partName") Dim partName As String = partDT.Rows(i)("partName")
Dim partNameArray As String() = partName.Split("_") Dim partNameArray As String() = partName.Split("_")
@ -106,10 +106,10 @@ Public Class Individual_3D
End Try End Try
If partNameArray(0) = "FRAME" Then If partNameArray(0) = "FRAME" Then
childrenDestPaths.Add(Settings2ABC.folderPaths("object_" & Data.objectNum & "_models3D_frames_sw") & "\" & newName & childrenDestPaths.Add(Settings.folderPaths("object_" & Data.objectNum & "_models3D_frames_sw") & "\" & newName &
instanceCounter(newName.Substring(0, newName.Length - 1)) & ".SLDPRT") instanceCounter(newName.Substring(0, newName.Length - 1)) & ".SLDPRT")
Else Else
childrenDestPaths.Add(Settings2ABC.folderPaths("object_" & Data.objectNum & "_models3D_gratings_sw") & "\" & newName & childrenDestPaths.Add(Settings.folderPaths("object_" & Data.objectNum & "_models3D_gratings_sw") & "\" & newName &
instanceCounter(newName.Substring(0, newName.Length - 1)) & ".SLDPRT") instanceCounter(newName.Substring(0, newName.Length - 1)) & ".SLDPRT")
End If End If
Next Next

View File

@ -116,20 +116,20 @@ Public Class Individual_3D_Simplified
Dim childrenSourcePaths As New List(Of String) Dim childrenSourcePaths As New List(Of String)
Dim childrenDestPaths As New List(Of String) Dim childrenDestPaths As New List(Of String)
sourcePath = Settings2ABC.filesFolder & "\Files\CADStart\" & designName & ".SLDASM" sourcePath = Settings.filesFolder & "\Files\CADStart\" & designName & ".SLDASM"
childrenSourcePaths.Add(Settings2ABC.HLCtFolder & "\HLCt\Parts\START.SLDPRT") childrenSourcePaths.Add(Settings.HLCtFolder & "\HLCt\Parts\START.SLDPRT")
If withFrame = True Then If withFrame = True Then
destPath = Settings2ABC.folderPaths("object_" & Data.objectNum & "_models3D_gratings_sw_support") & "\GRATING_ASSEMBLY_SIMPLIFIED_WITH_FRAME.SLDASM" destPath = Settings.folderPaths("object_" & Data.objectNum & "_models3D_gratings_sw_support") & "\GRATING_ASSEMBLY_SIMPLIFIED_WITH_FRAME.SLDASM"
childrenDestPaths.Add(Settings2ABC.folderPaths("object_" & Data.objectNum & "_models3D_gratings_sw_support") & "\MASTER_SIMPLIFIED_WITH_FRAME.SLDPRT") childrenDestPaths.Add(Settings.folderPaths("object_" & Data.objectNum & "_models3D_gratings_sw_support") & "\MASTER_SIMPLIFIED_WITH_FRAME.SLDPRT")
Else Else
destPath = Settings2ABC.folderPaths("object_" & Data.objectNum & "_models3D_gratings_sw_support") & "\GRATING_ASSEMBLY_SIMPLIFIED.SLDASM" destPath = Settings.folderPaths("object_" & Data.objectNum & "_models3D_gratings_sw_support") & "\GRATING_ASSEMBLY_SIMPLIFIED.SLDASM"
childrenDestPaths.Add(Settings2ABC.folderPaths("object_" & Data.objectNum & "_models3D_gratings_sw_support") & "\MASTER_SIMPLIFIED.SLDPRT") childrenDestPaths.Add(Settings.folderPaths("object_" & Data.objectNum & "_models3D_gratings_sw_support") & "\MASTER_SIMPLIFIED.SLDPRT")
End If End If
Dim instanceCounter As New Dictionary(Of String, Integer) Dim instanceCounter As New Dictionary(Of String, Integer)
For i = 0 To partDT.Rows.Count - 1 For i = 0 To partDT.Rows.Count - 1
childrenSourcePaths.Add(Settings2ABC.filesFolder & "\Files\CADStart\" & partDT.Rows(i)("partName") & ".SLDPRT") childrenSourcePaths.Add(Settings.filesFolder & "\Files\CADStart\" & partDT.Rows(i)("partName") & ".SLDPRT")
Dim partName As String = partDT.Rows(i)("partName") Dim partName As String = partDT.Rows(i)("partName")
Dim partNameArray As String() = partName.Split("_") Dim partNameArray As String() = partName.Split("_")
@ -146,10 +146,10 @@ Public Class Individual_3D_Simplified
End Try End Try
If partNameArray(0) = "FRAME" Then If partNameArray(0) = "FRAME" Then
childrenDestPaths.Add(Settings2ABC.folderPaths("object_" & Data.objectNum & "_models3D_frames_sw") & "\" & newName & childrenDestPaths.Add(Settings.folderPaths("object_" & Data.objectNum & "_models3D_frames_sw") & "\" & newName &
instanceCounter(newName.Substring(0, newName.Length - 1)) & ".SLDPRT") instanceCounter(newName.Substring(0, newName.Length - 1)) & ".SLDPRT")
Else Else
childrenDestPaths.Add(Settings2ABC.folderPaths("object_" & Data.objectNum & "_models3D_gratings_sw_support") & "\" & newName & childrenDestPaths.Add(Settings.folderPaths("object_" & Data.objectNum & "_models3D_gratings_sw_support") & "\" & newName &
instanceCounter(newName.Substring(0, newName.Length - 1)) & ".SLDPRT") instanceCounter(newName.Substring(0, newName.Length - 1)) & ".SLDPRT")
End If End If
Next Next

View File

@ -112,7 +112,7 @@ Public Class Individual_Drawing
Dim iPart As PartDoc Dim iPart As PartDoc
iPart = swApp.ActiveDoc iPart = swApp.ActiveDoc
Dim newName As String Dim newName As String
newName = Settings2ABC.folderPaths("object_" & Data.objectNum & "_models3D_gratings_sw_support") & "\simplified_grating.SLDPRT" newName = Settings.folderPaths("object_" & Data.objectNum & "_models3D_gratings_sw_support") & "\simplified_grating.SLDPRT"
Dim config As Configuration Dim config As Configuration
config = iPart.GetActiveConfiguration config = iPart.GetActiveConfiguration
@ -167,7 +167,7 @@ Public Class Individual_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(Settings2ABC.HLCtFolder & "\Files Needed\A3 Part.slddrt") swSheet.SetTemplateName(Settings.HLCtFolder & "\Files Needed\A3 Part.slddrt")
swSheet.ReloadTemplate(True) swSheet.ReloadTemplate(True)
Dim layMgr As LayerMgr Dim layMgr As LayerMgr
@ -176,7 +176,7 @@ Public Class Individual_Drawing
status = layMgr.SetCurrentLayer("Svenska") status = layMgr.SetCurrentLayer("Svenska")
Dim myView As View Dim myView As View
myView = iDrawing.CreateDrawViewFromModelView3(Settings2ABC.folderPaths("object_" & Data.objectNum & "_models3D_gratings_sw_support") & "\simplified_grating.SLDPRT", myView = iDrawing.CreateDrawViewFromModelView3(Settings.folderPaths("object_" & Data.objectNum & "_models3D_gratings_sw_support") & "\simplified_grating.SLDPRT",
"*Front", swSheetWidth / 2, swSheetHeight / 2, 0) "*Front", swSheetWidth / 2, swSheetHeight / 2, 0)
myView.UseSheetScale() = True myView.UseSheetScale() = True
Dim viewScale1, viewScale2 As Double Dim viewScale1, viewScale2 As Double
@ -293,7 +293,7 @@ Public Class Individual_Drawing
Add_Dimensions(sortedMeasurments("Lmes"), CompName, myView, iDrawing, swExtensions, OutLine, scaleDecimal, X_Mid, Y_Mid, "Lmes") Add_Dimensions(sortedMeasurments("Lmes"), CompName, myView, iDrawing, swExtensions, OutLine, scaleDecimal, X_Mid, Y_Mid, "Lmes")
Add_Dimensions(sortedMeasurments("Wmes"), CompName, myView, iDrawing, swExtensions, OutLine, scaleDecimal, X_Mid, Y_Mid, "Wmes") Add_Dimensions(sortedMeasurments("Wmes"), CompName, myView, iDrawing, swExtensions, OutLine, scaleDecimal, X_Mid, Y_Mid, "Wmes")
Dim myView2 As View Dim myView2 As View
myView2 = iDrawing.CreateDrawViewFromModelView3(Settings2ABC.folderPaths("object_" & Data.objectNum & "_models3D_gratings_sw_support") & "\simplified_grating.SLDPRT", myView2 = iDrawing.CreateDrawViewFromModelView3(Settings.folderPaths("object_" & Data.objectNum & "_models3D_gratings_sw_support") & "\simplified_grating.SLDPRT",
"*Bottom", swSheetWidth / 2, OutLine(3) + sideCounter(0) * 0.01 + 0.03, 0) "*Bottom", swSheetWidth / 2, OutLine(3) + sideCounter(0) * 0.01 + 0.03, 0)
myView2.UseSheetScale() = True myView2.UseSheetScale() = True
@ -315,7 +315,7 @@ Public Class Individual_Drawing
Dim longstatus As Integer Dim longstatus As Integer
Dim newName As String Dim newName As String
newName = Settings2ABC.folderPaths("object_" & Data.objectNum & "_drawings_gratings_sw") & "\grating_drawing.SLDDRW" newName = Settings.folderPaths("object_" & Data.objectNum & "_drawings_gratings_sw") & "\grating_drawing.SLDDRW"
status = layMgr.AddLayer("Symbol", "", 0, 0, 2) status = layMgr.AddLayer("Symbol", "", 0, 0, 2)
status = layMgr.SetCurrentLayer("Symbol") status = layMgr.SetCurrentLayer("Symbol")
@ -339,7 +339,7 @@ Public Class Individual_Drawing
swSkMgr.AddToDB = False swSkMgr.AddToDB = False
longstatus = iDrawing.SaveAs3(newName, 0, 0) longstatus = iDrawing.SaveAs3(newName, 0, 0)
longstatus = iDrawing.SaveAs3(Settings2ABC.folderPaths("object_" & Data.objectNum & "_drawings_gratings_pdf") & "\grating_drawing.pdf", 0, 2) longstatus = iDrawing.SaveAs3(Settings.folderPaths("object_" & Data.objectNum & "_drawings_gratings_pdf") & "\grating_drawing.pdf", 0, 2)
End Sub End Sub
Private Shared Sub Add_Dimensions(points() As Integer, CompName As String, myView As View, iDrawing As DrawingDoc, swExtensions As SldWorks.ModelDocExtension _ Private Shared Sub Add_Dimensions(points() As Integer, CompName As String, myView As View, iDrawing As DrawingDoc, swExtensions As SldWorks.ModelDocExtension _

View File

@ -16,7 +16,7 @@ Public Class Instructions
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(Settings2ABC.HLCtFolder & "\Files Needed\A3 Part.slddrt") swSheet.SetTemplateName(Settings.HLCtFolder & "\Files Needed\A3 Part.slddrt")
swSheet.ReloadTemplate(True) swSheet.ReloadTemplate(True)
swSheet.SetScale(1, 10, False, False) swSheet.SetScale(1, 10, False, False)
swSheet.SetName("Instructions") swSheet.SetName("Instructions")
@ -28,15 +28,15 @@ Public Class Instructions
Dim drawName As String Dim drawName As String
If AppForm.fillMode = True Then If AppForm.fillMode = True Then
If withFrame = True Then If withFrame = True Then
drawName = Settings2ABC.folderPaths("object_" & Data.objectNum & "_models3D_gratings_sw_support") & "\GRATINGS_ASSEMBLY_SIMPLIFIED_WITH_FRAME.SLDASM" drawName = Settings.folderPaths("object_" & Data.objectNum & "_models3D_gratings_sw_support") & "\GRATINGS_ASSEMBLY_SIMPLIFIED_WITH_FRAME.SLDASM"
Else Else
drawName = Settings2ABC.folderPaths("object_" & Data.objectNum & "_models3D_gratings_sw_support") & "\GRATINGS_ASSEMBLY_SIMPLIFIED.SLDASM" drawName = Settings.folderPaths("object_" & Data.objectNum & "_models3D_gratings_sw_support") & "\GRATINGS_ASSEMBLY_SIMPLIFIED.SLDASM"
End If End If
Else Else
If withFrame = True Then If withFrame = True Then
drawName = Settings2ABC.folderPaths("object_" & Data.objectNum & "_models3D_gratings_sw_support") & "\GRATING_ASSEMBLY_SIMPLIFIED_WITH_FRAME.SLDASM" drawName = Settings.folderPaths("object_" & Data.objectNum & "_models3D_gratings_sw_support") & "\GRATING_ASSEMBLY_SIMPLIFIED_WITH_FRAME.SLDASM"
Else Else
drawName = Settings2ABC.folderPaths("object_" & Data.objectNum & "_models3D_gratings_sw_support") & "\GRATING_ASSEMBLY_SIMPLIFIED.SLDASM" drawName = Settings.folderPaths("object_" & Data.objectNum & "_models3D_gratings_sw_support") & "\GRATING_ASSEMBLY_SIMPLIFIED.SLDASM"
End If End If
End If End If
@ -271,11 +271,11 @@ Public Class Instructions
' --- instruction for support beams --- ' --- instruction for support beams ---
If Calculate_Fill_Grid.withSupportBeam = True Then If Calculate_Fill_Grid.withSupportBeam = True Then
status = iDrawing.NewSheet3("Support Beams", 12, 12, 1, 10, False, Settings2ABC.HLCtFolder & "\Files Needed\A3 Part.slddrt", status = iDrawing.NewSheet3("Support Beams", 12, 12, 1, 10, False, Settings.HLCtFolder & "\Files Needed\A3 Part.slddrt",
swSheetWidth, swSheetHeight, "Same as sheet specified in Document Properties") swSheetWidth, swSheetHeight, "Same as sheet specified in Document Properties")
status = layMgr.SetCurrentLayer("Svenska") status = layMgr.SetCurrentLayer("Svenska")
drawName = Settings2ABC.folderPaths("object_" & Data.objectNum & "_models3D_gratings_sw_support") & "\GRATINGS_ASSEMBLY_SIMPLIFIED.SLDASM" drawName = Settings.folderPaths("object_" & Data.objectNum & "_models3D_gratings_sw_support") & "\GRATINGS_ASSEMBLY_SIMPLIFIED.SLDASM"
myView = iDrawing.CreateDrawViewFromModelView3(drawName, "*Front", swSheetWidth / 2, adjustedHeightPosInSheet, 0) myView = iDrawing.CreateDrawViewFromModelView3(drawName, "*Front", swSheetWidth / 2, adjustedHeightPosInSheet, 0)
myView.UseSheetScale() = True myView.UseSheetScale() = True
@ -413,7 +413,7 @@ Public Class Instructions
End If End If
Dim newName As String Dim newName As String
newName = Settings2ABC.folderPaths("object_" & Data.objectNum & "_guide") & "\assembly_instructions.SLDDRW" newName = Settings.folderPaths("object_" & Data.objectNum & "_guide") & "\assembly_instructions.SLDDRW"
status = iDrawing.SaveAs3(newName, 0, 0) status = iDrawing.SaveAs3(newName, 0, 0)
status = iDrawing.SaveAs3(newName, 0, 2) status = iDrawing.SaveAs3(newName, 0, 2)

View File

@ -121,15 +121,15 @@ Public Class Multiple_3D
Dim childrenSourcePaths As New List(Of String) Dim childrenSourcePaths As New List(Of String)
Dim childrenDestPaths As New List(Of String) Dim childrenDestPaths As New List(Of String)
sourcePath = Settings2ABC.filesFolder & "\Files\CADStart\" & designName & ".SLDASM" sourcePath = Settings.filesFolder & "\Files\CADStart\" & designName & ".SLDASM"
destPath = Settings2ABC.folderPaths("object_" & Data.objectNum & "_models3D_gratings_sw") & "\GRATINGS_ASSEMBLY.SLDASM" destPath = Settings.folderPaths("object_" & Data.objectNum & "_models3D_gratings_sw") & "\GRATINGS_ASSEMBLY.SLDASM"
childrenSourcePaths.Add(Settings2ABC.HLCtFolder & "\HLCt\Parts\START.SLDPRT") childrenSourcePaths.Add(Settings.HLCtFolder & "\HLCt\Parts\START.SLDPRT")
childrenDestPaths.Add(Settings2ABC.folderPaths("object_" & Data.objectNum & "_models3D_gratings_sw_support") & "\MASTER.SLDPRT") childrenDestPaths.Add(Settings.folderPaths("object_" & Data.objectNum & "_models3D_gratings_sw_support") & "\MASTER.SLDPRT")
Dim instanceCounter As New Dictionary(Of String, Integer) Dim instanceCounter As New Dictionary(Of String, Integer)
For i = 0 To partDT.Rows.Count - 1 For i = 0 To partDT.Rows.Count - 1
childrenSourcePaths.Add(Settings2ABC.filesFolder & "\Files\CADStart\" & partDT.Rows(i)("partName") & ".SLDPRT") childrenSourcePaths.Add(Settings.filesFolder & "\Files\CADStart\" & partDT.Rows(i)("partName") & ".SLDPRT")
Dim partName As String = partDT.Rows(i)("partName") Dim partName As String = partDT.Rows(i)("partName")
Dim partNameArray As String() = partName.Split("_") Dim partNameArray As String() = partName.Split("_")
@ -146,10 +146,10 @@ Public Class Multiple_3D
End Try End Try
If partNameArray(0) = "FRAME" Then If partNameArray(0) = "FRAME" Then
childrenDestPaths.Add(Settings2ABC.folderPaths("object_" & Data.objectNum & "_models3D_frames_sw") & "\" & newName & childrenDestPaths.Add(Settings.folderPaths("object_" & Data.objectNum & "_models3D_frames_sw") & "\" & newName &
instanceCounter(newName.Substring(0, newName.Length - 1)) & ".SLDPRT") instanceCounter(newName.Substring(0, newName.Length - 1)) & ".SLDPRT")
Else Else
childrenDestPaths.Add(Settings2ABC.folderPaths("object_" & Data.objectNum & "_models3D_gratings_sw") & "\" & newName & childrenDestPaths.Add(Settings.folderPaths("object_" & Data.objectNum & "_models3D_gratings_sw") & "\" & newName &
instanceCounter(newName.Substring(0, newName.Length - 1)) & ".SLDPRT") instanceCounter(newName.Substring(0, newName.Length - 1)) & ".SLDPRT")
End If End If
Next Next

View File

@ -181,21 +181,21 @@ Public Class Multiple_3D_Simplified
Dim childrenSourcePaths As New List(Of String) Dim childrenSourcePaths As New List(Of String)
Dim childrenDestPaths As New List(Of String) Dim childrenDestPaths As New List(Of String)
sourcePath = Settings2ABC.filesFolder & "\Files\CADStart\" & designName & ".SLDASM" sourcePath = Settings.filesFolder & "\Files\CADStart\" & designName & ".SLDASM"
childrenSourcePaths.Add(Settings2ABC.HLCtFolder & "\HLCt\Parts\START.SLDPRT") childrenSourcePaths.Add(Settings.HLCtFolder & "\HLCt\Parts\START.SLDPRT")
Dim frameStr As String = "" Dim frameStr As String = ""
If withFrame = True Then If withFrame = True Then
frameStr = "_WITH_FRAME" frameStr = "_WITH_FRAME"
End If End If
destPath = Settings2ABC.folderPaths("object_" & Data.objectNum & "_models3D_gratings_sw_support") & "\GRATINGS_ASSEMBLY_SIMPLIFIED" & frameStr & ".SLDASM" destPath = Settings.folderPaths("object_" & Data.objectNum & "_models3D_gratings_sw_support") & "\GRATINGS_ASSEMBLY_SIMPLIFIED" & frameStr & ".SLDASM"
childrenDestPaths.Add(Settings2ABC.folderPaths("object_" & Data.objectNum & "_models3D_gratings_sw_support") & "\MASTER_SIMPLIFIED" & frameStr & ".SLDPRT") childrenDestPaths.Add(Settings.folderPaths("object_" & Data.objectNum & "_models3D_gratings_sw_support") & "\MASTER_SIMPLIFIED" & frameStr & ".SLDPRT")
Dim instanceCounter As New Dictionary(Of String, Integer) Dim instanceCounter As New Dictionary(Of String, Integer)
For i = 0 To partDT.Rows.Count - 1 For i = 0 To partDT.Rows.Count - 1
childrenSourcePaths.Add(Settings2ABC.filesFolder & "\Files\CADStart\" & partDT.Rows(i)("partName") & ".SLDPRT") childrenSourcePaths.Add(Settings.filesFolder & "\Files\CADStart\" & partDT.Rows(i)("partName") & ".SLDPRT")
Dim partName As String = partDT.Rows(i)("partName") Dim partName As String = partDT.Rows(i)("partName")
Dim partNameArray As String() = partName.Split("_") Dim partNameArray As String() = partName.Split("_")
@ -212,10 +212,10 @@ Public Class Multiple_3D_Simplified
End Try End Try
If partNameArray(0) = "FRAME" Then If partNameArray(0) = "FRAME" Then
childrenDestPaths.Add(Settings2ABC.folderPaths("object_" & Data.objectNum & "_models3D_frames_sw") & "\" & newName & frameStr & childrenDestPaths.Add(Settings.folderPaths("object_" & Data.objectNum & "_models3D_frames_sw") & "\" & newName & frameStr &
instanceCounter(newName.Substring(0, newName.Length - 1)) & ".SLDPRT") instanceCounter(newName.Substring(0, newName.Length - 1)) & ".SLDPRT")
Else Else
childrenDestPaths.Add(Settings2ABC.folderPaths("object_" & Data.objectNum & "_models3D_gratings_sw_support") & "\" & newName & frameStr & childrenDestPaths.Add(Settings.folderPaths("object_" & Data.objectNum & "_models3D_gratings_sw_support") & "\" & newName & frameStr &
instanceCounter(newName.Substring(0, newName.Length - 1)) & ".SLDPRT") instanceCounter(newName.Substring(0, newName.Length - 1)) & ".SLDPRT")
End If End If
Next Next

View File

@ -16,7 +16,7 @@ Public Class Multiple_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(Settings2ABC.HLCtFolder & "\Files Needed\A3 Part.slddrt") swSheet.SetTemplateName(Settings.HLCtFolder & "\Files Needed\A3 Part.slddrt")
swSheet.ReloadTemplate(True) swSheet.ReloadTemplate(True)
swSheet.SetScale(1, 10, False, False) swSheet.SetScale(1, 10, False, False)
swSheet.SetName("Assembly") swSheet.SetName("Assembly")
@ -28,7 +28,7 @@ Public Class Multiple_Drawing
Dim adjustedHeightPosInSheet As Double = swSheetHeight / 2 + 0.02 Dim adjustedHeightPosInSheet As Double = swSheetHeight / 2 + 0.02
Dim myView As View Dim myView As View
myView = iDrawing.CreateDrawViewFromModelView3(Settings2ABC.folderPaths("object_" & Data.objectNum & "_models3D_gratings_sw_support") & "\GRATINGS_ASSEMBLY_SIMPLIFIED.SLDASM", myView = iDrawing.CreateDrawViewFromModelView3(Settings.folderPaths("object_" & Data.objectNum & "_models3D_gratings_sw_support") & "\GRATINGS_ASSEMBLY_SIMPLIFIED.SLDASM",
"*Front", swSheetWidth / 2, adjustedHeightPosInSheet, 0) "*Front", swSheetWidth / 2, adjustedHeightPosInSheet, 0)
myView.UseSheetScale() = True myView.UseSheetScale() = True
myView.SetDisplayTangentEdges2(2) myView.SetDisplayTangentEdges2(2)
@ -431,10 +431,10 @@ Public Class Multiple_Drawing
Next Next
Dim newName As String Dim newName As String
newName = Settings2ABC.folderPaths("object_" & Data.objectNum & "_drawings_gratings_sw") & "\grating_drawing.SLDDRW" newName = Settings.folderPaths("object_" & Data.objectNum & "_drawings_gratings_sw") & "\grating_drawing.SLDDRW"
status = iDrawing.SaveAs3(newName, 0, 0) status = iDrawing.SaveAs3(newName, 0, 0)
status = iDrawing.SaveAs3(Settings2ABC.folderPaths("object_" & Data.objectNum & "_drawings_gratings_pdf") & "\grating_drawing.pdf", 0, 2) status = iDrawing.SaveAs3(Settings.folderPaths("object_" & Data.objectNum & "_drawings_gratings_pdf") & "\grating_drawing.pdf", 0, 2)
End Sub End Sub

View File

@ -85,10 +85,10 @@
<SubType>Form</SubType> <SubType>Form</SubType>
</Compile> </Compile>
<Compile Include="GUI\Draw_Grating.vb" /> <Compile Include="GUI\Draw_Grating.vb" />
<Compile Include="GUI\Individual.Designer.vb"> <Compile Include="GUI\Grating_Configurator.Designer.vb">
<DependentUpon>Individual.vb</DependentUpon> <DependentUpon>Grating_Configurator.vb</DependentUpon>
</Compile> </Compile>
<Compile Include="GUI\Individual.vb"> <Compile Include="GUI\Grating_Configurator.vb">
<SubType>Form</SubType> <SubType>Form</SubType>
</Compile> </Compile>
<Compile Include="GUI\Main_Menu.Designer.vb"> <Compile Include="GUI\Main_Menu.Designer.vb">
@ -139,8 +139,8 @@
<DependentUpon>AppForm.vb</DependentUpon> <DependentUpon>AppForm.vb</DependentUpon>
<SubType>Designer</SubType> <SubType>Designer</SubType>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="GUI\Individual.resx"> <EmbeddedResource Include="GUI\Grating_Configurator.resx">
<DependentUpon>Individual.vb</DependentUpon> <DependentUpon>Grating_Configurator.vb</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="GUI\Main_Menu.resx"> <EmbeddedResource Include="GUI\Main_Menu.resx">
<DependentUpon>Main_Menu.vb</DependentUpon> <DependentUpon>Main_Menu.vb</DependentUpon>