From 253127066fd568aef64e2e7d9fdc38a7698fb4e9 Mon Sep 17 00:00:00 2001 From: Anton Date: Mon, 3 May 2021 11:55:46 +0200 Subject: [PATCH] Changes in GUI --- Wardrobe/GUI/AppForm.vb | 32 +-- Wardrobe/GUI/Draw_Grating.vb | 8 +- ...er.vb => Grating_Configurator.Designer.vb} | 4 +- ...ividual.resx => Grating_Configurator.resx} | 0 ...{Individual.vb => Grating_Configurator.vb} | 7 +- Wardrobe/GUI/Main_Menu.Designer.vb | 16 +- Wardrobe/GUI/Main_Menu.vb | 52 +++-- Wardrobe/GUI/Settings.Designer.vb | 98 +++++++-- Wardrobe/GUI/Settings.vb | 110 ++++++++-- Wardrobe/Gratings Data/Calculate_Fill_Grid.vb | 6 +- Wardrobe/Gratings Data/Database.vb | 6 +- Wardrobe/Gratings Data/User_Input.vb | 184 ++++++++--------- Wardrobe/Quote_Export/GUI_Export.vb | 2 +- Wardrobe/Recess Functions/Corner_Angle.vb | 166 ++++++++-------- Wardrobe/Recess Functions/Corner_Rectangle.vb | 158 +++++++-------- Wardrobe/Recess Functions/Middle_Rectangle.vb | 154 +++++++------- Wardrobe/Recess Functions/Side_Rectangle.vb | 188 +++++++++--------- Wardrobe/SolidWorks/Frame_3D.vb | 6 +- Wardrobe/SolidWorks/Frame_Drawing.vb | 20 +- Wardrobe/SolidWorks/Individual_3D.vb | 14 +- .../SolidWorks/Individual_3D_Simplified.vb | 18 +- Wardrobe/SolidWorks/Individual_Drawing.vb | 12 +- Wardrobe/SolidWorks/Instructions.vb | 16 +- Wardrobe/SolidWorks/Multiple_3D.vb | 14 +- Wardrobe/SolidWorks/Multiple_3D_Simplified.vb | 14 +- Wardrobe/SolidWorks/Multiple_Drawing.vb | 8 +- Wardrobe/Wardrobe.vbproj | 10 +- 27 files changed, 747 insertions(+), 576 deletions(-) rename Wardrobe/GUI/{Individual.Designer.vb => Grating_Configurator.Designer.vb} (99%) rename Wardrobe/GUI/{Individual.resx => Grating_Configurator.resx} (100%) rename Wardrobe/GUI/{Individual.vb => Grating_Configurator.vb} (99%) diff --git a/Wardrobe/GUI/AppForm.vb b/Wardrobe/GUI/AppForm.vb index 94b6db3..b61996d 100644 --- a/Wardrobe/GUI/AppForm.vb +++ b/Wardrobe/GUI/AppForm.vb @@ -16,14 +16,20 @@ Public Class AppForm Dim savedData As String() = System.IO.File.ReadAllLines(appDataPath & "\SavedData.txt") 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) - Main_Menu.Button_Order.Enabled = True - Main_Menu.Label_SettingsError.Visible = False + ElseIf savedData(i) = Settings.KBUpdateTimeHead Then + 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 Next - 'FIXA: Add for sales reps. - 'FIXA: Kolla så all settings data är ok + + Settings.Check_Settings() Dim appDir As String = Application.StartupPath @@ -44,10 +50,10 @@ Public Class AppForm Next - Me.Width = 1400 - Me.Height = 800 - Me.Top = 20 - Me.Left = 50 + Me.Width = 800 + Me.Height = 500 + Me.Top = 170 + Me.Left = 350 Panel_Start.Controls.Clear() Main_Menu.TopLevel = False @@ -66,14 +72,14 @@ Public Class AppForm ' Load XCC settings adminClass.loadSettings(Settings.filesFolder, Settings.HLCtFolder, "SolidWorks") - Individual.ComboBox_Type.Items.Add("Pressure Welded") - Individual.ComboBox_Type.Items.Add("Type A") + Grating_Configurator.ComboBox_Type.Items.Add("Pressure Welded") + Grating_Configurator.ComboBox_Type.Items.Add("Type A") 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 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 End Sub diff --git a/Wardrobe/GUI/Draw_Grating.vb b/Wardrobe/GUI/Draw_Grating.vb index d9f7c0b..764b7cd 100644 --- a/Wardrobe/GUI/Draw_Grating.vb +++ b/Wardrobe/GUI/Draw_Grating.vb @@ -10,7 +10,7 @@ Public Shared Sub Load_DrawingPanel() - AddHandler Individual.Panel_Grating.Paint, AddressOf DrawingPanel_Paint + AddHandler Grating_Configurator.Panel_Grating.Paint, AddressOf DrawingPanel_Paint Get_DrawboxParameters() @@ -26,8 +26,8 @@ ' --- Retrive parameters for the drawing box --- Private Shared Sub Get_DrawboxParameters() - guiPanelL = Individual.Panel_Grating.Size.Width - guiPanelW = Individual.Panel_Grating.Size.Height + guiPanelL = Grating_Configurator.Panel_Grating.Size.Width + guiPanelW = Grating_Configurator.Panel_Grating.Size.Height Data.guiPanelMidX = guiPanelL / 2 Data.guiPanelMidY = guiPanelW / 2 @@ -147,7 +147,7 @@ Data.gratingPoints.Rows(3)("X") = (-Data.gratingL / 2) / 1000 Data.gratingPoints.Rows(3)("Y") = (-Data.gratingW / 2) / 1000 - Individual.Panel_Grating.Refresh() + Grating_Configurator.Panel_Grating.Refresh() End Sub ' --- Draw all the lines for the panel and grating --- diff --git a/Wardrobe/GUI/Individual.Designer.vb b/Wardrobe/GUI/Grating_Configurator.Designer.vb similarity index 99% rename from Wardrobe/GUI/Individual.Designer.vb rename to Wardrobe/GUI/Grating_Configurator.Designer.vb index dc9ed3a..3ae87f1 100644 --- a/Wardrobe/GUI/Individual.Designer.vb +++ b/Wardrobe/GUI/Grating_Configurator.Designer.vb @@ -1,5 +1,5 @@  -Partial Class Individual +Partial Class Grating_Configurator Inherits System.Windows.Forms.Form 'Form overrides dispose to clean up the component list. @@ -22,7 +22,7 @@ Partial Class Individual 'Do not modify it using the code editor. 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.Label8 = New System.Windows.Forms.Label() Me.ComboBox_Frame = New System.Windows.Forms.ComboBox() diff --git a/Wardrobe/GUI/Individual.resx b/Wardrobe/GUI/Grating_Configurator.resx similarity index 100% rename from Wardrobe/GUI/Individual.resx rename to Wardrobe/GUI/Grating_Configurator.resx diff --git a/Wardrobe/GUI/Individual.vb b/Wardrobe/GUI/Grating_Configurator.vb similarity index 99% rename from Wardrobe/GUI/Individual.vb rename to Wardrobe/GUI/Grating_Configurator.vb index af656c7..cbd2bc4 100644 --- a/Wardrobe/GUI/Individual.vb +++ b/Wardrobe/GUI/Grating_Configurator.vb @@ -1,5 +1,5 @@  -Public Class Individual +Public Class Grating_Configurator Sub Load_GUI() ' Initialize GUI @@ -444,6 +444,11 @@ Public Class Individual AppForm.Panel_Start.Controls.Clear() Main_Menu.TopLevel = False AppForm.Panel_Start.Controls.Add(Main_Menu) + AppForm.Width = 800 + AppForm.Height = 500 + AppForm.Top = 170 + AppForm.Left = 350 + Main_Menu.Show() End Sub diff --git a/Wardrobe/GUI/Main_Menu.Designer.vb b/Wardrobe/GUI/Main_Menu.Designer.vb index 99e2424..99bbbc7 100644 --- a/Wardrobe/GUI/Main_Menu.Designer.vb +++ b/Wardrobe/GUI/Main_Menu.Designer.vb @@ -31,8 +31,8 @@ Partial Class Main_Menu ' 'Button_Settings ' - Me.Button_Settings.Location = New System.Drawing.Point(68, 59) - Me.Button_Settings.Margin = New System.Windows.Forms.Padding(2, 2, 2, 2) + Me.Button_Settings.Location = New System.Drawing.Point(49, 47) + Me.Button_Settings.Margin = New System.Windows.Forms.Padding(2) Me.Button_Settings.Name = "Button_Settings" Me.Button_Settings.Size = New System.Drawing.Size(127, 41) Me.Button_Settings.TabIndex = 5 @@ -42,7 +42,7 @@ Partial Class Main_Menu 'Button_Multiple ' 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.Size = New System.Drawing.Size(117, 93) Me.Button_Multiple.TabIndex = 4 @@ -52,7 +52,7 @@ Partial Class Main_Menu 'Button_Individual ' 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.Size = New System.Drawing.Size(117, 93) Me.Button_Individual.TabIndex = 3 @@ -62,7 +62,7 @@ Partial Class Main_Menu 'Button_Order ' 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.Size = New System.Drawing.Size(117, 65) Me.Button_Order.TabIndex = 7 @@ -74,7 +74,7 @@ Partial Class Main_Menu 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.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.Name = "Label_SettingsError" 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.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.Button_Order) Me.Controls.Add(Me.Button_Settings) Me.Controls.Add(Me.Button_Multiple) Me.Controls.Add(Me.Button_Individual) 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.Text = "Main_Menu" Me.ResumeLayout(False) diff --git a/Wardrobe/GUI/Main_Menu.vb b/Wardrobe/GUI/Main_Menu.vb index dceeb21..7491155 100644 --- a/Wardrobe/GUI/Main_Menu.vb +++ b/Wardrobe/GUI/Main_Menu.vb @@ -1,7 +1,6 @@  Public Class Main_Menu - Private Sub Generate_Folders() Settings.folderPaths.Add("object_" & Data.objectNum, Settings.folderPaths("order") & "\Object " & Data.objectNum) System.IO.Directory.CreateDirectory(Settings.folderPaths("object_" & Data.objectNum)) @@ -52,25 +51,30 @@ Public Class Main_Menu End Sub Private Sub Button_Individual_Click(sender As Object, e As EventArgs) Handles Button_Individual.Click If AppForm.fillMode = True Then - Individual.Panel_Data.Controls.RemoveByKey("Label_Max_Load") - RemoveHandler Individual.Panel_Data.Controls("TextBox_Max_Load").KeyPress, AddressOf Individual.TextBox_Max_Load_KeyPress - Individual.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") + RemoveHandler Grating_Configurator.Panel_Data.Controls("TextBox_Max_Load").KeyPress, AddressOf Grating_Configurator.TextBox_Max_Load_KeyPress + Grating_Configurator.Panel_Data.Controls.RemoveByKey("TextBox_Max_Load") + Grating_Configurator.Panel_Data.Controls.RemoveByKey("Label_Max_Load_Unit") - Individual.Panel_Data.Controls.RemoveByKey("Label_Max_Weight") - RemoveHandler Individual.Panel_Data.Controls("TextBox_Max_Weight").KeyPress, AddressOf Individual.TextBox_Max_Load_KeyPress - Individual.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") + RemoveHandler Grating_Configurator.Panel_Data.Controls("TextBox_Max_Weight").KeyPress, AddressOf Grating_Configurator.TextBox_Max_Load_KeyPress + Grating_Configurator.Panel_Data.Controls.RemoveByKey("TextBox_Max_Weight") + Grating_Configurator.Panel_Data.Controls.RemoveByKey("Label_Max_Weight_Unit") - RemoveHandler Individual.Panel_Data.Controls("Button_Calculate").Click, AddressOf Individual.Button_Calculate_Click - Individual.Panel_Data.Controls.RemoveByKey("Button_Calculate") + RemoveHandler Grating_Configurator.Panel_Data.Controls("Button_Calculate").Click, AddressOf Grating_Configurator.Button_Calculate_Click + Grating_Configurator.Panel_Data.Controls.RemoveByKey("Button_Calculate") End If AppForm.fillMode = False AppForm.Panel_Start.Controls.Clear() - Individual.TopLevel = False - AppForm.Panel_Start.Controls.Add(Individual) - Individual.Load_GUI() - Individual.Show() + Grating_Configurator.TopLevel = False + AppForm.Panel_Start.Controls.Add(Grating_Configurator) + AppForm.Width = 1400 + AppForm.Height = 800 + AppForm.Top = 20 + AppForm.Left = 50 + + Grating_Configurator.Load_GUI() + Grating_Configurator.Show() Data.objectNum += 1 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 AppForm.fillMode = True AppForm.Panel_Start.Controls.Clear() - Individual.TopLevel = False - AppForm.Panel_Start.Controls.Add(Individual) - Individual.Load_GUI() - Individual.Show() + Grating_Configurator.TopLevel = False + AppForm.Panel_Start.Controls.Add(Grating_Configurator) + AppForm.Width = 1400 + AppForm.Height = 800 + AppForm.Top = 20 + AppForm.Left = 50 + + Grating_Configurator.Load_GUI() + Grating_Configurator.Show() Data.objectNum += 1 Generate_Folders() @@ -95,6 +104,9 @@ Public Class Main_Menu AppForm.Panel_Start.Controls.Clear() Settings.TopLevel = False AppForm.Panel_Start.Controls.Add(Settings) + AppForm.Width = 800 + AppForm.Height = 500 + Settings.Init_Settings() Settings.Show() End Sub @@ -103,7 +115,7 @@ Public Class Main_Menu Button_Individual.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")) Data.objectNum = 0 diff --git a/Wardrobe/GUI/Settings.Designer.vb b/Wardrobe/GUI/Settings.Designer.vb index d317190..8991749 100644 --- a/Wardrobe/GUI/Settings.Designer.vb +++ b/Wardrobe/GUI/Settings.Designer.vb @@ -32,11 +32,17 @@ Partial Class Settings Me.TextBox_Mail = New System.Windows.Forms.TextBox() Me.Label_Mail = New System.Windows.Forms.Label() 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() ' '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.Size = New System.Drawing.Size(160, 68) Me.Button_KB.TabIndex = 0 @@ -45,7 +51,7 @@ Partial Class Settings ' '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.Size = New System.Drawing.Size(160, 68) Me.Button_FilePath.TabIndex = 1 @@ -55,7 +61,7 @@ Partial Class Settings 'Label_Name ' 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.Size = New System.Drawing.Size(38, 13) Me.Label_Name.TabIndex = 2 @@ -64,7 +70,7 @@ Partial Class Settings '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.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.Size = New System.Drawing.Size(171, 21) Me.TextBox_Name.TabIndex = 3 @@ -73,7 +79,7 @@ Partial Class Settings ' 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.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.Size = New System.Drawing.Size(181, 20) Me.Label_UserData.TabIndex = 4 @@ -82,7 +88,7 @@ Partial Class Settings '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.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.Size = New System.Drawing.Size(171, 21) Me.TextBox_Phone.TabIndex = 6 @@ -90,7 +96,7 @@ Partial Class Settings 'Label_Tel ' 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.Size = New System.Drawing.Size(81, 13) Me.Label_Tel.TabIndex = 5 @@ -99,7 +105,7 @@ Partial Class Settings '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.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.Size = New System.Drawing.Size(171, 21) Me.TextBox_Mail.TabIndex = 8 @@ -107,7 +113,7 @@ Partial Class Settings 'Label_Mail ' 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.Size = New System.Drawing.Size(29, 13) Me.Label_Mail.TabIndex = 7 @@ -115,18 +121,80 @@ Partial Class Settings ' '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.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.Text = "Save" 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 ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) 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.TextBox_Mail) Me.Controls.Add(Me.Label_Mail) @@ -155,4 +223,10 @@ Partial Class Settings Friend WithEvents TextBox_Mail As TextBox Friend WithEvents Label_Mail As Label 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 diff --git a/Wardrobe/GUI/Settings.vb b/Wardrobe/GUI/Settings.vb index 9da4102..d25e2d0 100644 --- a/Wardrobe/GUI/Settings.vb +++ b/Wardrobe/GUI/Settings.vb @@ -2,40 +2,77 @@ Public Class Settings Public Shared filesFolder As String Public Shared HLCtFolder As String - Public Shared exportFolder As 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) - 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") + + appDataList.Clear() For i = 0 To appData.Length - 1 appDataList.Add(appData(i)) 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 - 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 - Update_AppData("Sales Representative: Name", SRName) + Update_AppData(SRNameHead, SRName) 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 - Update_AppData("Sales Representative: Phone number", SRPhone) + Update_AppData(SRPhoneHead, SRPhone) 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 - Update_AppData("Sales Representative: Mail", SRMail) + Update_AppData(SRMailHead, SRMail) 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 - 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 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 Settings.exportFolder = ofd.SelectedPath - Update_AppData("Export Folder Path", ofd.SelectedPath) + Update_AppData(exportFolderHead, ofd.SelectedPath) + Label_File_Path.Text = exportFolder End If End Sub 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()) - 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.Label_SettingsError.Visible = False Else @@ -58,11 +106,37 @@ Public Class Settings Main_Menu.Label_SettingsError.Visible = True End If - AppForm.fillMode = True - AppForm.Panel_Start.Controls.Clear() - Main_Menu.TopLevel = False - AppForm.Panel_Start.Controls.Add(Main_Menu) - Main_Menu.Show() + If exportFolder = "" Then + Label_File_Path.Text = "Needed" + Label_File_Path.ForeColor = Color.Red + Else + 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 Private Shared Sub Update_AppData(dataName As String, data As String) diff --git a/Wardrobe/Gratings Data/Calculate_Fill_Grid.vb b/Wardrobe/Gratings Data/Calculate_Fill_Grid.vb index 00f2a81..13d124a 100644 --- a/Wardrobe/Gratings Data/Calculate_Fill_Grid.vb +++ b/Wardrobe/Gratings Data/Calculate_Fill_Grid.vb @@ -19,7 +19,7 @@ Get_Grid_Beams() Calculate_Support_Beams() - Individual.Panel_Grating.Refresh() + Grating_Configurator.Panel_Grating.Refresh() End Sub @@ -34,7 +34,7 @@ Return Data.gratingW End Function 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 loadBarThickness As Integer = 2 @@ -147,7 +147,7 @@ Private Shared Sub Calculate_Support_Beams() ' 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 Dim loadDT As DataTable = Database.database.Tables("LOAD") diff --git a/Wardrobe/Gratings Data/Database.vb b/Wardrobe/Gratings Data/Database.vb index 162f251..67b8fc7 100644 --- a/Wardrobe/Gratings Data/Database.vb +++ b/Wardrobe/Gratings Data/Database.vb @@ -11,13 +11,13 @@ Public Class Database ' Make .csv files of each sheet in Excel excelApp.DisplayAlerts = False 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 Dim activeSheet As Excel.Worksheet activeSheet = excelWB.Sheets(i) 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) Next @@ -32,7 +32,7 @@ Public Class Database .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 Dim words As String() = lines(0).Split(New Char() {","c}) diff --git a/Wardrobe/Gratings Data/User_Input.vb b/Wardrobe/Gratings Data/User_Input.vb index 023866b..39f2703 100644 --- a/Wardrobe/Gratings Data/User_Input.vb +++ b/Wardrobe/Gratings Data/User_Input.vb @@ -20,16 +20,16 @@ Public Shared frameSize As Integer Public Shared Sub TypeChanged(sender As Object, e As EventArgs) - Individual.ComboBox_Material.Enabled = True - Individual.ComboBox_Material.Items.Clear() - gratingType = Individual.ComboBox_Type.Text + Grating_Configurator.ComboBox_Material.Enabled = True + Grating_Configurator.ComboBox_Material.Items.Clear() + gratingType = Grating_Configurator.ComboBox_Type.Text Dim materialDT As DataTable = Database.database.Tables("Material") Dim typeInDT As String = materialDT.Rows(0)("TYPE") For i = 0 To materialDT.Rows.Count - 1 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 Try typeInDT = materialDT.Rows(i + 1)("TYPE") @@ -37,12 +37,12 @@ End Try Next - Individual.ComboBox_Material.Text = Individual.ComboBox_Material.Items(0) + Grating_Configurator.ComboBox_Material.Text = Grating_Configurator.ComboBox_Material.Items(0) End Sub Public Shared Sub MaterialChanged(sender As Object, e As EventArgs) - Individual.ComboBox_Mesh.Enabled = True - gratingMaterial = Individual.ComboBox_Material.Text + Grating_Configurator.ComboBox_Mesh.Enabled = True + gratingMaterial = Grating_Configurator.ComboBox_Material.Text Dim serratedDT As DataTable = Database.database.Tables("Serrated") @@ -55,10 +55,10 @@ If gratingMaterial = materialInDT AndAlso gratingType = typeInDT Then serratedCheckBox.Name = "CheckBox_Serrated" serratedCheckBox.Text = "Serrated" - serratedCheckBox.Left = Individual.ComboBox_Material.Left - serratedCheckBox.Top = Individual.ComboBox_Material.Top + 25 + serratedCheckBox.Left = Grating_Configurator.ComboBox_Material.Left + serratedCheckBox.Top = Grating_Configurator.ComboBox_Material.Top + 25 AddHandler serratedCheckBox.CheckedChanged, AddressOf CheckBox_Serrated_CheckedChanged - Individual.Panel_Data.Controls.Add(serratedCheckBox) + Grating_Configurator.Panel_Data.Controls.Add(serratedCheckBox) serratedCheckBoxBol = True Exit For End If @@ -82,7 +82,7 @@ Next If serratedCheckBoxBol = True AndAlso removeCheckBox = True Then RemoveHandler serratedCheckBox.CheckedChanged, AddressOf CheckBox_Serrated_CheckedChanged - Individual.Panel_Data.Controls.RemoveByKey("CheckBox_Serrated") + Grating_Configurator.Panel_Data.Controls.RemoveByKey("CheckBox_Serrated") serratedCheckBoxBol = False gratingSerrated = False End If @@ -94,16 +94,16 @@ lacqueredCheckBox.Name = "CheckBox_Lacquered" lacqueredCheckBox.Text = "Lacquered" - lacqueredCheckBox.Left = Individual.ComboBox_Material.Left - lacqueredCheckBox.Top = Individual.ComboBox_Material.Top + 50 + lacqueredCheckBox.Left = Grating_Configurator.ComboBox_Material.Left + lacqueredCheckBox.Top = Grating_Configurator.ComboBox_Material.Top + 50 AddHandler lacqueredCheckBox.CheckedChanged, AddressOf CheckBox_Lacquered_CheckedChanged - Individual.Panel_Data.Controls.Add(lacqueredCheckBox) + Grating_Configurator.Panel_Data.Controls.Add(lacqueredCheckBox) lacqueredCheckBoxBol = True ElseIf lacqueredCheckBoxBol = True AndAlso gratingMaterial <> "Hot dip galvanized steel" _ AndAlso gratingMaterial <> "Untreated" Then RemoveHandler lacqueredCheckBox.CheckedChanged, AddressOf CheckBox_Lacquered_CheckedChanged - Individual.Panel_Data.Controls.RemoveByKey("CheckBox_Lacquered") + Grating_Configurator.Panel_Data.Controls.RemoveByKey("CheckBox_Lacquered") lacqueredCheckBoxBol = False gratingLacquered = False End If @@ -130,12 +130,12 @@ End Sub Private Shared Sub Update_AvalaibleMeshes() - Individual.ComboBox_Height.Items.Clear() - Individual.ComboBox_Height.Enabled = False - Individual.ComboBox_Thickness.Items.Clear() - Individual.ComboBox_Thickness.Enabled = False + Grating_Configurator.ComboBox_Height.Items.Clear() + Grating_Configurator.ComboBox_Height.Enabled = False + Grating_Configurator.ComboBox_Thickness.Items.Clear() + 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") @@ -149,14 +149,14 @@ " (" & meshesDT.Rows(i)("NAME") & ")" Dim addItem As Boolean = True - For j = 0 To Individual.ComboBox_Mesh.Items.Count - 1 - If item = Individual.ComboBox_Mesh.Items(j) Then + For j = 0 To Grating_Configurator.ComboBox_Mesh.Items.Count - 1 + If item = Grating_Configurator.ComboBox_Mesh.Items(j) Then addItem = False Exit For End If Next If addItem = True Then - Individual.ComboBox_Mesh.Items.Add(item) + Grating_Configurator.ComboBox_Mesh.Items.Add(item) End If End If Try @@ -167,18 +167,18 @@ End Try Next - If Individual.ComboBox_Mesh.Items.Count = 0 Then - Individual.ComboBox_Mesh.Items.Add("") + If Grating_Configurator.ComboBox_Mesh.Items.Count = 0 Then + Grating_Configurator.ComboBox_Mesh.Items.Add("") End If End Sub Public Shared Sub MeshChanged(sender As Object, e As EventArgs) - Individual.ComboBox_Thickness.Items.Clear() - Individual.ComboBox_Thickness.Enabled = False + Grating_Configurator.ComboBox_Thickness.Items.Clear() + Grating_Configurator.ComboBox_Thickness.Enabled = False - Individual.ComboBox_Height.Enabled = True - Individual.ComboBox_Height.Items.Clear() - gratingMesh = Individual.ComboBox_Mesh.Text + Grating_Configurator.ComboBox_Height.Enabled = True + Grating_Configurator.ComboBox_Height.Items.Clear() + gratingMesh = Grating_Configurator.ComboBox_Mesh.Text loadBarSpacing = CInt(gratingMesh.Split("x")(0)) crossBarSpacing = CInt(gratingMesh.Split("x")(1).Split(" ")(0)) gratingName = gratingMesh.Split("(")(1).Split(")")(0) @@ -222,14 +222,14 @@ tempList.Sort() For i = 0 To tempList.Count - 1 - Individual.ComboBox_Height.Items.Add(tempList(i)) + Grating_Configurator.ComboBox_Height.Items.Add(tempList(i)) Next End Sub Public Shared Sub HeightChanged(sender As Object, e As EventArgs) - Individual.ComboBox_Thickness.Enabled = True - Individual.ComboBox_Thickness.Items.Clear() - gratingHeight = CInt(Individual.ComboBox_Height.Text) + Grating_Configurator.ComboBox_Thickness.Enabled = True + Grating_Configurator.ComboBox_Thickness.Items.Clear() + gratingHeight = CInt(Grating_Configurator.ComboBox_Height.Text) Dim meshesDT As DataTable = Database.database.Tables("Meshes") @@ -272,13 +272,13 @@ tempList.Sort() For i = 0 To tempList.Count - 1 - Individual.ComboBox_Thickness.Items.Add(tempList(i)) + Grating_Configurator.ComboBox_Thickness.Items.Add(tempList(i)) Next - For i = 0 To Individual.ComboBox_Frame.Items.Count - 1 - Dim item As String = Individual.ComboBox_Frame.Items(i) + For i = 0 To Grating_Configurator.ComboBox_Frame.Items.Count - 1 + Dim item As String = Grating_Configurator.ComboBox_Frame.Items(i) 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 End If Next @@ -287,16 +287,16 @@ Public Shared Sub ThicknessChanged(sender As Object, e As EventArgs) - Individual.ComboBox_Width.Enabled = True - Individual.ComboBox_Width.Items.Clear() - Individual.TextBox_Width.Enabled = True - Individual.TextBox_Length.Text = 1000 - Individual.TextBox_Length.Enabled = True + Grating_Configurator.ComboBox_Width.Enabled = True + Grating_Configurator.ComboBox_Width.Items.Clear() + Grating_Configurator.TextBox_Width.Enabled = True + Grating_Configurator.TextBox_Length.Text = 1000 + Grating_Configurator.TextBox_Length.Enabled = True 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 - loadBarThickness = CInt(Individual.ComboBox_Thickness.Text) + loadBarThickness = CInt(Grating_Configurator.ComboBox_Thickness.Text) Dim meshesDT As DataTable = Database.database.Tables("Meshes") @@ -341,22 +341,22 @@ Dim wholeMeshesDT As DataTable = Database.database.Tables("Whole Meshes") For i = 0 To wholeMeshesDT.Rows.Count - 1 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 Next - Individual.ComboBox_Width.Text = Individual.ComboBox_Width.Items(0) - Individual.TextBox_Width.Text = 1000 + Grating_Configurator.ComboBox_Width.Text = Grating_Configurator.ComboBox_Width.Items(0) + Grating_Configurator.TextBox_Width.Text = 1000 End Sub Public Shared Sub WholeMeshWidthsChanged(sender As Object, e As EventArgs) 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 - Individual.ComboBox_Width.DropDownStyle = ComboBoxStyle.DropDown + Grating_Configurator.ComboBox_Width.DropDownStyle = ComboBoxStyle.DropDown Dim CheckTemp As New CheckBox With { .Name = "CheckBox_Edge_Bar", @@ -370,7 +370,7 @@ .BackColor = Color.Transparent } AddHandler CheckTemp.CheckedChanged, AddressOf CheckBox_Edge_Bar_CheckedChanged - Individual.Panel_Data.Controls.Add(CheckTemp) + Grating_Configurator.Panel_Data.Controls.Add(CheckTemp) End If End Sub @@ -382,18 +382,18 @@ Public Shared Sub WidthChanged(sender As Object, e As EventArgs) If AppForm.fillMode Then - If Individual.TextBox_Width.Text <> "" Then - If CInt(Individual.TextBox_Width.Text) >= Individual.ComboBox_Width.Items(Individual.ComboBox_Width.Items.Count - 1) Then - Data.gratingW = CInt(Individual.TextBox_Width.Text) + If Grating_Configurator.TextBox_Width.Text <> "" Then + If CInt(Grating_Configurator.TextBox_Width.Text) >= Grating_Configurator.ComboBox_Width.Items(Grating_Configurator.ComboBox_Width.Items.Count - 1) Then + Data.gratingW = CInt(Grating_Configurator.TextBox_Width.Text) Draw_Grating.Update_GratingPoints() End If Enable_Buttons() End If Else - If Individual.ComboBox_Width.Text <> "" Then - If CInt(Individual.ComboBox_Width.Text) >= Individual.ComboBox_Width.Items(Individual.ComboBox_Width.Items.Count - 1) AndAlso - CInt(Individual.ComboBox_Width.Text) <= Individual.ComboBox_Width.Items(0) Then - Data.gratingW = CInt(Individual.ComboBox_Width.Text) + If Grating_Configurator.ComboBox_Width.Text <> "" Then + If CInt(Grating_Configurator.ComboBox_Width.Text) >= Grating_Configurator.ComboBox_Width.Items(Grating_Configurator.ComboBox_Width.Items.Count - 1) AndAlso + CInt(Grating_Configurator.ComboBox_Width.Text) <= Grating_Configurator.ComboBox_Width.Items(0) Then + Data.gratingW = CInt(Grating_Configurator.ComboBox_Width.Text) Draw_Grating.Update_GratingPoints() End If Enable_Buttons() @@ -402,16 +402,16 @@ End Sub 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 CInt(Individual.TextBox_Length.Text) >= 300 Then - Data.gratingL = CInt(Individual.TextBox_Length.Text) + If CInt(Grating_Configurator.TextBox_Length.Text) >= 300 Then + Data.gratingL = CInt(Grating_Configurator.TextBox_Length.Text) Draw_Grating.Update_GratingPoints() Enable_Buttons() End If Else - If CInt(Individual.TextBox_Length.Text) >= 300 AndAlso CInt(Individual.TextBox_Length.Text) <= 6000 Then - Data.gratingL = CInt(Individual.TextBox_Length.Text) + If CInt(Grating_Configurator.TextBox_Length.Text) >= 300 AndAlso CInt(Grating_Configurator.TextBox_Length.Text) <= 6000 Then + Data.gratingL = CInt(Grating_Configurator.TextBox_Length.Text) Draw_Grating.Update_GratingPoints() Enable_Buttons() End If @@ -420,37 +420,37 @@ End Sub Public Shared Sub FrameChanged(Sender As Object, e As EventArgs) - If Individual.ComboBox_Frame.Text <> "" Then - frameSize = CInt(Individual.ComboBox_Frame.Text.Split(" ")(0)) + If Grating_Configurator.ComboBox_Frame.Text <> "" Then + frameSize = CInt(Grating_Configurator.ComboBox_Frame.Text.Split(" ")(0)) End If End Sub Private Shared Sub Enable_Buttons() If AppForm.fillMode Then - If Individual.TextBox_Width.Text <> "" AndAlso Individual.TextBox_Length.Text <> "" Then - Individual.Button_Export_GUI.Enabled = True - Individual.Button_Export_SW.Enabled = True - Individual.Panel_Data.Controls("Button_Calculate").Enabled = True + If Grating_Configurator.TextBox_Width.Text <> "" AndAlso Grating_Configurator.TextBox_Length.Text <> "" Then + Grating_Configurator.Button_Export_GUI.Enabled = True + Grating_Configurator.Button_Export_SW.Enabled = True + Grating_Configurator.Panel_Data.Controls("Button_Calculate").Enabled = True - Individual.Button_Angle_Corner.Enabled = True - Individual.Button_Angle_Side.Enabled = True - Individual.Button_Square_Corner.Enabled = True - Individual.Button_Square_Side.Enabled = True - Individual.Button_Square_Middle.Enabled = True + Grating_Configurator.Button_Angle_Corner.Enabled = True + Grating_Configurator.Button_Angle_Side.Enabled = True + Grating_Configurator.Button_Square_Corner.Enabled = True + Grating_Configurator.Button_Square_Side.Enabled = True + Grating_Configurator.Button_Square_Middle.Enabled = True - Individual.Panel_Data.Controls("TextBox_Max_Load").Enabled = True - Individual.Panel_Data.Controls("TextBox_Max_Weight").Enabled = True + Grating_Configurator.Panel_Data.Controls("TextBox_Max_Load").Enabled = True + Grating_Configurator.Panel_Data.Controls("TextBox_Max_Weight").Enabled = True End If Else - If Individual.ComboBox_Width.Text <> "" AndAlso Individual.TextBox_Length.Text <> "" Then - Individual.Button_Export_GUI.Enabled = True - Individual.Button_Export_SW.Enabled = True + If Grating_Configurator.ComboBox_Width.Text <> "" AndAlso Grating_Configurator.TextBox_Length.Text <> "" Then + Grating_Configurator.Button_Export_GUI.Enabled = True + Grating_Configurator.Button_Export_SW.Enabled = True - Individual.Button_Angle_Corner.Enabled = True - Individual.Button_Angle_Side.Enabled = True - Individual.Button_Square_Corner.Enabled = True - Individual.Button_Square_Side.Enabled = True - Individual.Button_Square_Middle.Enabled = True + Grating_Configurator.Button_Angle_Corner.Enabled = True + Grating_Configurator.Button_Angle_Side.Enabled = True + Grating_Configurator.Button_Square_Corner.Enabled = True + Grating_Configurator.Button_Square_Side.Enabled = True + Grating_Configurator.Button_Square_Middle.Enabled = True End If End If End Sub @@ -458,8 +458,8 @@ ' --- Creates the table with points data used in SW --- Public Shared Function Create_ExportTable() As DataTable - Dim lSpacing As String = Individual.ComboBox_Mesh.Text.Split("x")(0) - Dim cSpacing As String = Individual.ComboBox_Mesh.Text.Split("x")(1).Split(" ")(0) + Dim lSpacing As String = Grating_Configurator.ComboBox_Mesh.Text.Split("x")(0) + Dim cSpacing As String = Grating_Configurator.ComboBox_Mesh.Text.Split("x")(1).Split(" ")(0) Dim gratingTable As New DataTable gratingTable.Columns.Add("TYPE", GetType(String)) @@ -484,15 +484,15 @@ gratingTable.Rows(0)("NAME") = gratingName gratingTable.Rows(0)("SERRATED") = gratingSerrated gratingTable.Rows(0)("LACQUERED") = gratingLacquered - gratingTable.Rows(0)("WIDTH") = CInt(Individual.ComboBox_Width.Text) - gratingTable.Rows(0)("LENGTH") = CInt(Individual.TextBox_Length.Text) - gratingTable.Rows(0)("LOADBAR_THICKNESS") = CInt(Individual.ComboBox_Thickness.Text) - gratingTable.Rows(0)("LOADBAR_HEIGHT") = CInt(Individual.ComboBox_Height.Text) + gratingTable.Rows(0)("WIDTH") = CInt(Grating_Configurator.ComboBox_Width.Text) + gratingTable.Rows(0)("LENGTH") = CInt(Grating_Configurator.TextBox_Length.Text) + gratingTable.Rows(0)("LOADBAR_THICKNESS") = CInt(Grating_Configurator.ComboBox_Thickness.Text) + gratingTable.Rows(0)("LOADBAR_HEIGHT") = CInt(Grating_Configurator.ComboBox_Height.Text) gratingTable.Rows(0)("LOADBAR_SPACING") = CInt(lSpacing) gratingTable.Rows(0)("CROSSBAR_SPACING") = CInt(cSpacing) 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 gratingTable.Rows(0)("TYPE") = "pressure_welded_serrated" Else diff --git a/Wardrobe/Quote_Export/GUI_Export.vb b/Wardrobe/Quote_Export/GUI_Export.vb index 637576e..f740934 100644 --- a/Wardrobe/Quote_Export/GUI_Export.vb +++ b/Wardrobe/Quote_Export/GUI_Export.vb @@ -22,7 +22,7 @@ Public Class GUI_Export End Sub 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) Draw_Grating.Draw_Grating(graphicImg, 12) diff --git a/Wardrobe/Recess Functions/Corner_Angle.vb b/Wardrobe/Recess Functions/Corner_Angle.vb index f83ddf9..a38e88e 100644 --- a/Wardrobe/Recess Functions/Corner_Angle.vb +++ b/Wardrobe/Recess Functions/Corner_Angle.vb @@ -3,34 +3,34 @@ Private Shared cornerAngleCounter As Integer = 0 ' --- Create textboxes when user clicks the angle corner recess button --- Public Shared Sub AngleButton(sender As Object, e As EventArgs) - Individual.Panel_Recesses.Controls("Button_Angle_Corner").Enabled = False - Individual.Panel_Recesses.Controls("Button_Angle_Side").Enabled = False - Individual.Panel_Recesses.Controls("Button_Square_Corner").Enabled = False - Individual.Panel_Recesses.Controls("Button_Square_Side").Enabled = False - Individual.Panel_Recesses.Controls("Button_Square_Middle").Enabled = False + Grating_Configurator.Panel_Recesses.Controls("Button_Angle_Corner").Enabled = False + Grating_Configurator.Panel_Recesses.Controls("Button_Angle_Side").Enabled = False + Grating_Configurator.Panel_Recesses.Controls("Button_Square_Corner").Enabled = False + Grating_Configurator.Panel_Recesses.Controls("Button_Square_Side").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 buttonY As Integer = Individual.Panel_Recesses.Controls("Button_Angle_Corner").Location.Y + 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 = Grating_Configurator.Panel_Recesses.Controls("Button_Angle_Corner").Location.Y - Individual.Create_TextBox_Recesses("Y_TextBox", "", buttonX + 60, buttonY + 10, 60) - AddHandler Individual.Panel_Recesses.Controls("Y_TextBox").TextChanged, AddressOf FunctionTextCorner_Changed - AddHandler Individual.Panel_Recesses.Controls("Y_TextBox").KeyPress, AddressOf FunctionText_KeyPress - Individual.Create_Label_Recesses("Y_Label", "Width", buttonX + 18, buttonY + 13) + Grating_Configurator.Create_TextBox_Recesses("Y_TextBox", "", buttonX + 60, buttonY + 10, 60) + AddHandler Grating_Configurator.Panel_Recesses.Controls("Y_TextBox").TextChanged, AddressOf FunctionTextCorner_Changed + AddHandler Grating_Configurator.Panel_Recesses.Controls("Y_TextBox").KeyPress, AddressOf FunctionText_KeyPress + Grating_Configurator.Create_Label_Recesses("Y_Label", "Width", buttonX + 18, buttonY + 13) - Individual.Create_TextBox_Recesses("X_TextBox", "", buttonX + 60, buttonY + 40, 60) - AddHandler Individual.Panel_Recesses.Controls("X_TextBox").TextChanged, AddressOf FunctionTextCorner_Changed - AddHandler Individual.Panel_Recesses.Controls("X_TextBox").KeyPress, AddressOf FunctionText_KeyPress - Individual.Create_Label_Recesses("X_Label", "Length", buttonX + 10, buttonY + 43) + Grating_Configurator.Create_TextBox_Recesses("X_TextBox", "", buttonX + 60, buttonY + 40, 60) + AddHandler Grating_Configurator.Panel_Recesses.Controls("X_TextBox").TextChanged, AddressOf FunctionTextCorner_Changed + AddHandler Grating_Configurator.Panel_Recesses.Controls("X_TextBox").KeyPress, AddressOf FunctionText_KeyPress + Grating_Configurator.Create_Label_Recesses("X_Label", "Length", buttonX + 10, buttonY + 43) buttonOffset = 130 - Individual.Panel_Recesses.Controls("Button_Angle_Side").Left = Individual.Panel_Recesses.Controls("Button_Angle_Side").Left + buttonOffset - Individual.Panel_Recesses.Controls("Button_Square_Corner").Left = Individual.Panel_Recesses.Controls("Button_Square_Corner").Left + buttonOffset - Individual.Panel_Recesses.Controls("Button_Square_Side").Left = Individual.Panel_Recesses.Controls("Button_Square_Side").Left + buttonOffset - Individual.Panel_Recesses.Controls("Button_Square_Middle").Left = Individual.Panel_Recesses.Controls("Button_Square_Middle").Left + buttonOffset - Individual.Panel_Recesses.Controls("Button_Radius").Left = Individual.Panel_Recesses.Controls("Button_Radius").Left + buttonOffset + Grating_Configurator.Panel_Recesses.Controls("Button_Angle_Side").Left = Grating_Configurator.Panel_Recesses.Controls("Button_Angle_Side").Left + buttonOffset + Grating_Configurator.Panel_Recesses.Controls("Button_Square_Corner").Left = Grating_Configurator.Panel_Recesses.Controls("Button_Square_Corner").Left + buttonOffset + Grating_Configurator.Panel_Recesses.Controls("Button_Square_Side").Left = Grating_Configurator.Panel_Recesses.Controls("Button_Square_Side").Left + buttonOffset + Grating_Configurator.Panel_Recesses.Controls("Button_Square_Middle").Left = Grating_Configurator.Panel_Recesses.Controls("Button_Square_Middle").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 - Individual.Button_Angle_Corner.FlatAppearance.BorderColor = Color.Red + Grating_Configurator.Button_Angle_Corner.FlatStyle = FlatStyle.Flat + Grating_Configurator.Button_Angle_Corner.FlatAppearance.BorderColor = Color.Red End Sub ' --- Check the key pressed by the user --- @@ -42,15 +42,15 @@ Private Shared Sub FunctionTextCorner_Changed(sender As TextBox, e As EventArgs) Dim value1, value2 As Integer Try - value1 = CInt(Individual.Panel_Recesses.Controls("X_TextBox").Text) - value2 = CInt(Individual.Panel_Recesses.Controls("Y_TextBox").Text) + value1 = CInt(Grating_Configurator.Panel_Recesses.Controls("X_TextBox").Text) + value2 = CInt(Grating_Configurator.Panel_Recesses.Controls("Y_TextBox").Text) Catch ex As Exception value1 = 0 value2 = 0 End Try 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 If Data.gratingPoints.Rows(i)("RECESS OK") Then Dim pointButton As New Button With { @@ -71,19 +71,19 @@ gp.AddEllipse(New Rectangle(New Point(0, 0), New Size(30, 30))) pointButton.Region = New Region(gp) - Individual.Panel_Grating.Controls.Add(pointButton) + Grating_Configurator.Panel_Grating.Controls.Add(pointButton) AddHandler pointButton.Click, AddressOf PointButton_Click End If Next 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 If Data.gratingPoints.Rows(i)("RECESS OK") Then Dim buttonName As String = Data.gratingPoints.Rows(i)("NAME") & "_Button" - RemoveHandler Individual.Panel_Grating.Controls(buttonName).Click, AddressOf PointButton_Click - Individual.Panel_Grating.Controls.RemoveByKey(Data.gratingPoints.Rows(i)("NAME") & "_Button") + RemoveHandler Grating_Configurator.Panel_Grating.Controls(buttonName).Click, AddressOf PointButton_Click + Grating_Configurator.Panel_Grating.Controls.RemoveByKey(Data.gratingPoints.Rows(i)("NAME") & "_Button") End If Next End If @@ -105,8 +105,8 @@ For i = 0 To Data.gratingPoints.Rows.Count - 1 If Data.gratingPoints.Rows(i)("RECESS OK") Then Dim buttonName As String = Data.gratingPoints.Rows(i)("NAME") & "_Button" - RemoveHandler Individual.Panel_Grating.Controls(buttonName).Click, AddressOf PointButton_Click - Individual.Panel_Grating.Controls.RemoveByKey(Data.gratingPoints.Rows(i)("NAME") & "_Button") + RemoveHandler Grating_Configurator.Panel_Grating.Controls(buttonName).Click, AddressOf PointButton_Click + Grating_Configurator.Panel_Grating.Controls.RemoveByKey(Data.gratingPoints.Rows(i)("NAME") & "_Button") End If Next @@ -118,10 +118,10 @@ Dim pX As Decimal = Data.gratingPoints.Rows(index)("X") Dim pY As Decimal = Data.gratingPoints.Rows(index)("Y") - Dim dXGUI As Integer = CInt(Individual.Panel_Recesses.Controls("X_TextBox").Text / Data.scaleDiff) - Dim dYGUI As Integer = CInt(Individual.Panel_Recesses.Controls("Y_TextBox").Text / Data.scaleDiff) - Dim dX As Decimal = Individual.Panel_Recesses.Controls("X_TextBox").Text / 1000 - Dim dY As Decimal = Individual.Panel_Recesses.Controls("Y_TextBox").Text / 1000 + Dim dXGUI As Integer = CInt(Grating_Configurator.Panel_Recesses.Controls("X_TextBox").Text / Data.scaleDiff) + Dim dYGUI As Integer = CInt(Grating_Configurator.Panel_Recesses.Controls("Y_TextBox").Text / Data.scaleDiff) + Dim dX As Decimal = Grating_Configurator.Panel_Recesses.Controls("X_TextBox").Text / 1000 + Dim dY As Decimal = Grating_Configurator.Panel_Recesses.Controls("Y_TextBox").Text / 1000 Data.recessData.Rows.Add() 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 index + 1 = Data.pointsMeasurements(mesName)(0) 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 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 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 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 End If ElseIf index + 1 = Data.pointsMeasurements(mesName)(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 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 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 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 End If End If ElseIf mesName.Split("_")(0) = "SS1" AndAlso index + 2 = Data.pointsMeasurements(mesName)(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.sideSquareMesLine(mesName)(0) = Draw_Grating.sideSquareMesLine(mesName)(0) + dXGUI 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.sideSquareMesLine(mesName)(1) = Draw_Grating.sideSquareMesLine(mesName)(1) + dYGUI 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.sideSquareMesLine(mesName)(0) = Draw_Grating.sideSquareMesLine(mesName)(0) - dXGUI 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.sideSquareMesLine(mesName)(1) = Draw_Grating.sideSquareMesLine(mesName)(1) - dYGUI @@ -245,16 +245,16 @@ Data.angleRecessPoints.Rows.Add(pointRow) ' 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}) - 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}) ' Recess Data 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)("WIDTH") = CInt(Individual.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)("WIDTH") = CInt(Grating_Configurator.Panel_Recesses.Controls("Y_TextBox").Text) + Data.recessData.Rows(Data.recessData.Rows.Count - 1)("LENGTH") = CInt(Grating_Configurator.Panel_Recesses.Controls("X_TextBox").Text) ElseIf pointQuadrant = 2 Then ' Add the new points @@ -285,16 +285,16 @@ Data.angleRecessPoints.Rows.Add(pointRow) ' 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}) - 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}) ' Recess Data 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)("WIDTH") = CInt(Individual.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)("WIDTH") = CInt(Grating_Configurator.Panel_Recesses.Controls("Y_TextBox").Text) + Data.recessData.Rows(Data.recessData.Rows.Count - 1)("LENGTH") = CInt(Grating_Configurator.Panel_Recesses.Controls("X_TextBox").Text) ElseIf pointQuadrant = 3 Then ' Add the new points @@ -324,16 +324,16 @@ Data.angleRecessPoints.Rows.Add(pointRow) ' 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}) - 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}) ' Recess Data 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)("WIDTH") = CInt(Individual.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)("WIDTH") = CInt(Grating_Configurator.Panel_Recesses.Controls("Y_TextBox").Text) + Data.recessData.Rows(Data.recessData.Rows.Count - 1)("LENGTH") = CInt(Grating_Configurator.Panel_Recesses.Controls("X_TextBox").Text) Else ' Add the new points @@ -360,16 +360,16 @@ Data.angleRecessPoints.Rows.Add(pointRow) ' 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}) - 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}) ' Recess Data 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)("WIDTH") = CInt(Individual.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)("WIDTH") = CInt(Grating_Configurator.Panel_Recesses.Controls("Y_TextBox").Text) + Data.recessData.Rows(Data.recessData.Rows.Count - 1)("LENGTH") = CInt(Grating_Configurator.Panel_Recesses.Controls("X_TextBox").Text) End If @@ -378,32 +378,32 @@ Data.gratingPoints.Rows.RemoveAt(index) 'Redraw grating - Individual.Panel_Grating.Refresh() + Grating_Configurator.Panel_Grating.Refresh() - RemoveHandler Individual.Panel_Recesses.Controls("X_TextBox").TextChanged, AddressOf FunctionTextCorner_Changed - RemoveHandler Individual.Panel_Recesses.Controls("X_TextBox").KeyPress, AddressOf FunctionText_KeyPress - Individual.Panel_Recesses.Controls.RemoveByKey("X_TextBox") + RemoveHandler Grating_Configurator.Panel_Recesses.Controls("X_TextBox").TextChanged, AddressOf FunctionTextCorner_Changed + RemoveHandler Grating_Configurator.Panel_Recesses.Controls("X_TextBox").KeyPress, AddressOf FunctionText_KeyPress + Grating_Configurator.Panel_Recesses.Controls.RemoveByKey("X_TextBox") - RemoveHandler Individual.Panel_Recesses.Controls("Y_TextBox").TextChanged, AddressOf FunctionTextCorner_Changed - RemoveHandler Individual.Panel_Recesses.Controls("Y_TextBox").KeyPress, AddressOf FunctionText_KeyPress - Individual.Panel_Recesses.Controls.RemoveByKey("Y_TextBox") + RemoveHandler Grating_Configurator.Panel_Recesses.Controls("Y_TextBox").TextChanged, AddressOf FunctionTextCorner_Changed + RemoveHandler Grating_Configurator.Panel_Recesses.Controls("Y_TextBox").KeyPress, AddressOf FunctionText_KeyPress + Grating_Configurator.Panel_Recesses.Controls.RemoveByKey("Y_TextBox") - Individual.Panel_Recesses.Controls.RemoveByKey("X_Label") - Individual.Panel_Recesses.Controls.RemoveByKey("Y_Label") + Grating_Configurator.Panel_Recesses.Controls.RemoveByKey("X_Label") + Grating_Configurator.Panel_Recesses.Controls.RemoveByKey("Y_Label") - Individual.Panel_Recesses.Controls("Button_Angle_Corner").Enabled = True - Individual.Panel_Recesses.Controls("Button_Angle_Side").Enabled = True - Individual.Panel_Recesses.Controls("Button_Square_Corner").Enabled = True - Individual.Panel_Recesses.Controls("Button_Square_Side").Enabled = True - Individual.Panel_Recesses.Controls("Button_Square_Middle").Enabled = True + Grating_Configurator.Panel_Recesses.Controls("Button_Angle_Corner").Enabled = True + Grating_Configurator.Panel_Recesses.Controls("Button_Angle_Side").Enabled = True + Grating_Configurator.Panel_Recesses.Controls("Button_Square_Corner").Enabled = True + Grating_Configurator.Panel_Recesses.Controls("Button_Square_Side").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 - Individual.Panel_Recesses.Controls("Button_Square_Corner").Left = Individual.Panel_Recesses.Controls("Button_Square_Corner").Left - buttonOffset - Individual.Panel_Recesses.Controls("Button_Square_Side").Left = Individual.Panel_Recesses.Controls("Button_Square_Side").Left - buttonOffset - Individual.Panel_Recesses.Controls("Button_Square_Middle").Left = Individual.Panel_Recesses.Controls("Button_Square_Middle").Left - buttonOffset - Individual.Panel_Recesses.Controls("Button_Radius").Left = Individual.Panel_Recesses.Controls("Button_Radius").Left - buttonOffset + Grating_Configurator.Panel_Recesses.Controls("Button_Angle_Side").Left = Grating_Configurator.Panel_Recesses.Controls("Button_Angle_Side").Left - buttonOffset + Grating_Configurator.Panel_Recesses.Controls("Button_Square_Corner").Left = Grating_Configurator.Panel_Recesses.Controls("Button_Square_Corner").Left - buttonOffset + Grating_Configurator.Panel_Recesses.Controls("Button_Square_Side").Left = Grating_Configurator.Panel_Recesses.Controls("Button_Square_Side").Left - buttonOffset + Grating_Configurator.Panel_Recesses.Controls("Button_Square_Middle").Left = Grating_Configurator.Panel_Recesses.Controls("Button_Square_Middle").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 ' --- Determines the clicked points quadrant --- diff --git a/Wardrobe/Recess Functions/Corner_Rectangle.vb b/Wardrobe/Recess Functions/Corner_Rectangle.vb index ed195ec..92279ba 100644 --- a/Wardrobe/Recess Functions/Corner_Rectangle.vb +++ b/Wardrobe/Recess Functions/Corner_Rectangle.vb @@ -3,32 +3,32 @@ Private Shared cornerRectangleCounter As Integer = 0 ' --- Create textboxes when user clicks the rectangle corner recess button --- Public Shared Sub SquareButtton(sender As Object, e As EventArgs) - Individual.Panel_Recesses.Controls("Button_Angle_Corner").Enabled = False - Individual.Panel_Recesses.Controls("Button_Angle_Side").Enabled = False - Individual.Panel_Recesses.Controls("Button_Square_Corner").Enabled = False - Individual.Panel_Recesses.Controls("Button_Square_Side").Enabled = False - Individual.Panel_Recesses.Controls("Button_Square_Middle").Enabled = False + Grating_Configurator.Panel_Recesses.Controls("Button_Angle_Corner").Enabled = False + Grating_Configurator.Panel_Recesses.Controls("Button_Angle_Side").Enabled = False + Grating_Configurator.Panel_Recesses.Controls("Button_Square_Corner").Enabled = False + Grating_Configurator.Panel_Recesses.Controls("Button_Square_Side").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 buttonY As Integer = Individual.Panel_Recesses.Controls("Button_Square_Corner").Location.Y + 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 = Grating_Configurator.Panel_Recesses.Controls("Button_Square_Corner").Location.Y - Individual.Create_TextBox_Recesses("Y_TextBox", "", buttonX + 60, buttonY + 10, 60) - AddHandler Individual.Panel_Recesses.Controls("Y_TextBox").TextChanged, AddressOf FunctionTextCorner_Changed - AddHandler Individual.Panel_Recesses.Controls("Y_TextBox").KeyPress, AddressOf FunctionText_KeyPress - Individual.Create_Label_Recesses("Y_Label", "Width", buttonX + 18, buttonY + 13) + Grating_Configurator.Create_TextBox_Recesses("Y_TextBox", "", buttonX + 60, buttonY + 10, 60) + AddHandler Grating_Configurator.Panel_Recesses.Controls("Y_TextBox").TextChanged, AddressOf FunctionTextCorner_Changed + AddHandler Grating_Configurator.Panel_Recesses.Controls("Y_TextBox").KeyPress, AddressOf FunctionText_KeyPress + Grating_Configurator.Create_Label_Recesses("Y_Label", "Width", buttonX + 18, buttonY + 13) - Individual.Create_TextBox_Recesses("X_TextBox", "", buttonX + 60, buttonY + 40, 60) - AddHandler Individual.Panel_Recesses.Controls("X_TextBox").TextChanged, AddressOf FunctionTextCorner_Changed - AddHandler Individual.Panel_Recesses.Controls("X_TextBox").KeyPress, AddressOf FunctionText_KeyPress - Individual.Create_Label_Recesses("X_Label", "Length", buttonX + 10, buttonY + 43) + Grating_Configurator.Create_TextBox_Recesses("X_TextBox", "", buttonX + 60, buttonY + 40, 60) + AddHandler Grating_Configurator.Panel_Recesses.Controls("X_TextBox").TextChanged, AddressOf FunctionTextCorner_Changed + AddHandler Grating_Configurator.Panel_Recesses.Controls("X_TextBox").KeyPress, AddressOf FunctionText_KeyPress + Grating_Configurator.Create_Label_Recesses("X_Label", "Length", buttonX + 10, buttonY + 43) buttonOffset = 130 - Individual.Panel_Recesses.Controls("Button_Square_Side").Left = Individual.Panel_Recesses.Controls("Button_Square_Side").Left + buttonOffset - Individual.Panel_Recesses.Controls("Button_Square_Middle").Left = Individual.Panel_Recesses.Controls("Button_Square_Middle").Left + buttonOffset - Individual.Panel_Recesses.Controls("Button_Radius").Left = Individual.Panel_Recesses.Controls("Button_Radius").Left + buttonOffset + Grating_Configurator.Panel_Recesses.Controls("Button_Square_Side").Left = Grating_Configurator.Panel_Recesses.Controls("Button_Square_Side").Left + buttonOffset + Grating_Configurator.Panel_Recesses.Controls("Button_Square_Middle").Left = Grating_Configurator.Panel_Recesses.Controls("Button_Square_Middle").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 - Individual.Button_Square_Corner.FlatAppearance.BorderColor = Color.Red + Grating_Configurator.Button_Square_Corner.FlatStyle = FlatStyle.Flat + Grating_Configurator.Button_Square_Corner.FlatAppearance.BorderColor = Color.Red End Sub @@ -41,15 +41,15 @@ Private Shared Sub FunctionTextCorner_Changed(sender As TextBox, e As EventArgs) Dim value1, value2 As Integer Try - value1 = CInt(Individual.Panel_Recesses.Controls("X_TextBox").Text) - value2 = CInt(Individual.Panel_Recesses.Controls("Y_TextBox").Text) + value1 = CInt(Grating_Configurator.Panel_Recesses.Controls("X_TextBox").Text) + value2 = CInt(Grating_Configurator.Panel_Recesses.Controls("Y_TextBox").Text) Catch ex As Exception value1 = 0 value2 = 0 End Try 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 If Data.gratingPoints.Rows(i)("RECESS OK") Then Dim pointButton As New Button With { @@ -70,19 +70,19 @@ gp.AddEllipse(New Rectangle(New Point(0, 0), New Size(30, 30))) pointButton.Region = New Region(gp) - Individual.Panel_Grating.Controls.Add(pointButton) + Grating_Configurator.Panel_Grating.Controls.Add(pointButton) AddHandler pointButton.Click, AddressOf PointButton_Click End If Next 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 If Data.gratingPoints.Rows(i)("RECESS OK") Then Dim buttonName As String = Data.gratingPoints.Rows(i)("NAME") & "_Button" - RemoveHandler Individual.Panel_Grating.Controls(buttonName).Click, AddressOf PointButton_Click - Individual.Panel_Grating.Controls.RemoveByKey(Data.gratingPoints.Rows(i)("NAME") & "_Button") + RemoveHandler Grating_Configurator.Panel_Grating.Controls(buttonName).Click, AddressOf PointButton_Click + Grating_Configurator.Panel_Grating.Controls.RemoveByKey(Data.gratingPoints.Rows(i)("NAME") & "_Button") End If Next End If @@ -104,8 +104,8 @@ For i = 0 To Data.gratingPoints.Rows.Count - 1 If Data.gratingPoints.Rows(i)("RECESS OK") Then Dim buttonName As String = Data.gratingPoints.Rows(i)("NAME") & "_Button" - RemoveHandler Individual.Panel_Grating.Controls(buttonName).Click, AddressOf PointButton_Click - Individual.Panel_Grating.Controls.RemoveByKey(Data.gratingPoints.Rows(i)("NAME") & "_Button") + RemoveHandler Grating_Configurator.Panel_Grating.Controls(buttonName).Click, AddressOf PointButton_Click + Grating_Configurator.Panel_Grating.Controls.RemoveByKey(Data.gratingPoints.Rows(i)("NAME") & "_Button") End If Next @@ -117,10 +117,10 @@ Dim pX As Decimal = Data.gratingPoints.Rows(index)("X") Dim pY As Decimal = Data.gratingPoints.Rows(index)("Y") - Dim dXGUI As Integer = CInt(Individual.Panel_Recesses.Controls("X_TextBox").Text / Data.scaleDiff) - Dim dYGUI As Integer = CInt(Individual.Panel_Recesses.Controls("Y_TextBox").Text / Data.scaleDiff) - Dim dX As Decimal = Individual.Panel_Recesses.Controls("X_TextBox").Text / 1000 - Dim dY As Decimal = Individual.Panel_Recesses.Controls("Y_TextBox").Text / 1000 + Dim dXGUI As Integer = CInt(Grating_Configurator.Panel_Recesses.Controls("X_TextBox").Text / Data.scaleDiff) + Dim dYGUI As Integer = CInt(Grating_Configurator.Panel_Recesses.Controls("Y_TextBox").Text / Data.scaleDiff) + Dim dX As Decimal = Grating_Configurator.Panel_Recesses.Controls("X_TextBox").Text / 1000 + Dim dY As Decimal = Grating_Configurator.Panel_Recesses.Controls("Y_TextBox").Text / 1000 Data.recessData.Rows.Add() 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 index + 1 = Data.pointsMeasurements(mesName)(0) 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 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 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 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 End If ElseIf index + 1 = Data.pointsMeasurements(mesName)(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 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 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 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 End If End If ElseIf mesName.Split("_")(0) = "SS1" AndAlso index + 2 = Data.pointsMeasurements(mesName)(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.sideSquareMesLine(mesName)(0) = Draw_Grating.sideSquareMesLine(mesName)(0) + dXGUI 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.sideSquareMesLine(mesName)(1) = Draw_Grating.sideSquareMesLine(mesName)(1) + dYGUI 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.sideSquareMesLine(mesName)(0) = Draw_Grating.sideSquareMesLine(mesName)(0) - dXGUI 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.sideSquareMesLine(mesName)(1) = Draw_Grating.sideSquareMesLine(mesName)(1) - dYGUI @@ -247,16 +247,16 @@ Data.pointsMeasurements.Add("S_" & mesNum + 1, {index + 2, index + 3, 4}) ' 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}) - 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}) ' Recess Data 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)("WIDTH") = CInt(Individual.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)("WIDTH") = CInt(Grating_Configurator.Panel_Recesses.Controls("Y_TextBox").Text) + Data.recessData.Rows(Data.recessData.Rows.Count - 1)("LENGTH") = CInt(Grating_Configurator.Panel_Recesses.Controls("X_TextBox").Text) ElseIf pointQuadrant = 2 Then ' Add the new points @@ -284,16 +284,16 @@ Data.pointsMeasurements.Add("S_" & mesNum + 1, {index + 2, index + 3, 1}) ' 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}) - 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}) ' Recess Data 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)("WIDTH") = CInt(Individual.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)("WIDTH") = CInt(Grating_Configurator.Panel_Recesses.Controls("Y_TextBox").Text) + Data.recessData.Rows(Data.recessData.Rows.Count - 1)("LENGTH") = CInt(Grating_Configurator.Panel_Recesses.Controls("X_TextBox").Text) ElseIf pointQuadrant = 3 Then ' Add the new points @@ -320,16 +320,16 @@ Data.pointsMeasurements.Add("S_" & mesNum + 1, {index + 2, index + 3, 2}) ' 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}) - 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}) ' Recess Data 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)("WIDTH") = CInt(Individual.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)("WIDTH") = CInt(Grating_Configurator.Panel_Recesses.Controls("Y_TextBox").Text) + Data.recessData.Rows(Data.recessData.Rows.Count - 1)("LENGTH") = CInt(Grating_Configurator.Panel_Recesses.Controls("X_TextBox").Text) Else ' Add the new points @@ -353,16 +353,16 @@ Data.pointsMeasurements.Add("S_" & mesNum + 1, {index + 2, index + 3, 3}) ' 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}) - 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}) ' Recess Data 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)("WIDTH") = CInt(Individual.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)("WIDTH") = CInt(Grating_Configurator.Panel_Recesses.Controls("Y_TextBox").Text) + Data.recessData.Rows(Data.recessData.Rows.Count - 1)("LENGTH") = CInt(Grating_Configurator.Panel_Recesses.Controls("X_TextBox").Text) End If Data.gratingPoints.Rows.InsertAt(pointRow1, index + 1) @@ -371,30 +371,30 @@ Data.gratingPoints.Rows.RemoveAt(index) 'Redraw grating - Individual.Panel_Grating.Refresh() + Grating_Configurator.Panel_Grating.Refresh() - RemoveHandler Individual.Panel_Recesses.Controls("X_TextBox").TextChanged, AddressOf FunctionTextCorner_Changed - RemoveHandler Individual.Panel_Recesses.Controls("X_TextBox").KeyPress, AddressOf FunctionText_KeyPress - Individual.Panel_Recesses.Controls.RemoveByKey("X_TextBox") + RemoveHandler Grating_Configurator.Panel_Recesses.Controls("X_TextBox").TextChanged, AddressOf FunctionTextCorner_Changed + RemoveHandler Grating_Configurator.Panel_Recesses.Controls("X_TextBox").KeyPress, AddressOf FunctionText_KeyPress + Grating_Configurator.Panel_Recesses.Controls.RemoveByKey("X_TextBox") - RemoveHandler Individual.Panel_Recesses.Controls("Y_TextBox").TextChanged, AddressOf FunctionTextCorner_Changed - RemoveHandler Individual.Panel_Recesses.Controls("Y_TextBox").KeyPress, AddressOf FunctionText_KeyPress - Individual.Panel_Recesses.Controls.RemoveByKey("Y_TextBox") + RemoveHandler Grating_Configurator.Panel_Recesses.Controls("Y_TextBox").TextChanged, AddressOf FunctionTextCorner_Changed + RemoveHandler Grating_Configurator.Panel_Recesses.Controls("Y_TextBox").KeyPress, AddressOf FunctionText_KeyPress + Grating_Configurator.Panel_Recesses.Controls.RemoveByKey("Y_TextBox") - Individual.Panel_Recesses.Controls.RemoveByKey("X_Label") - Individual.Panel_Recesses.Controls.RemoveByKey("Y_Label") + Grating_Configurator.Panel_Recesses.Controls.RemoveByKey("X_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 - Individual.Panel_Recesses.Controls("Button_Square_Middle").Left = Individual.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_Square_Side").Left = Grating_Configurator.Panel_Recesses.Controls("Button_Square_Side").Left - buttonOffset + Grating_Configurator.Panel_Recesses.Controls("Button_Square_Middle").Left = Grating_Configurator.Panel_Recesses.Controls("Button_Square_Middle").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 - Individual.Panel_Recesses.Controls("Button_Angle_Side").Enabled = True - Individual.Panel_Recesses.Controls("Button_Square_Corner").Enabled = True - Individual.Panel_Recesses.Controls("Button_Square_Side").Enabled = True - Individual.Panel_Recesses.Controls("Button_Square_Middle").Enabled = True + Grating_Configurator.Panel_Recesses.Controls("Button_Angle_Corner").Enabled = True + Grating_Configurator.Panel_Recesses.Controls("Button_Angle_Side").Enabled = True + Grating_Configurator.Panel_Recesses.Controls("Button_Square_Corner").Enabled = True + Grating_Configurator.Panel_Recesses.Controls("Button_Square_Side").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 ' --- Determines the clicked points quadrant --- diff --git a/Wardrobe/Recess Functions/Middle_Rectangle.vb b/Wardrobe/Recess Functions/Middle_Rectangle.vb index 47f1871..c345db2 100644 --- a/Wardrobe/Recess Functions/Middle_Rectangle.vb +++ b/Wardrobe/Recess Functions/Middle_Rectangle.vb @@ -5,40 +5,40 @@ ' --- Create textboxes when user clicks the rectangle side recess button --- Public Shared Sub SquareMiddleButtton(sender As Object, e As EventArgs) - Individual.Panel_Recesses.Controls("Button_Angle_Corner").Enabled = False - Individual.Panel_Recesses.Controls("Button_Angle_Side").Enabled = False - Individual.Panel_Recesses.Controls("Button_Square_Corner").Enabled = False - Individual.Panel_Recesses.Controls("Button_Square_Side").Enabled = False - Individual.Panel_Recesses.Controls("Button_Square_Middle").Enabled = False + Grating_Configurator.Panel_Recesses.Controls("Button_Angle_Corner").Enabled = False + Grating_Configurator.Panel_Recesses.Controls("Button_Angle_Side").Enabled = False + Grating_Configurator.Panel_Recesses.Controls("Button_Square_Corner").Enabled = False + Grating_Configurator.Panel_Recesses.Controls("Button_Square_Side").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 buttonY As Integer = Individual.Panel_Recesses.Controls("Button_Square_Middle").Location.Y + 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 = Grating_Configurator.Panel_Recesses.Controls("Button_Square_Middle").Location.Y - Individual.Create_TextBox_Recesses("Y_TextBox", "", buttonX + 60, buttonY + 10, 60) - AddHandler Individual.Panel_Recesses.Controls("Y_TextBox").TextChanged, AddressOf FunctionTextMiddle_Changed - AddHandler Individual.Panel_Recesses.Controls("Y_TextBox").KeyPress, AddressOf FunctionText_KeyPress - Individual.Create_Label_Recesses("Y_Label", "Width", buttonX + 18, buttonY + 13) + Grating_Configurator.Create_TextBox_Recesses("Y_TextBox", "", buttonX + 60, buttonY + 10, 60) + AddHandler Grating_Configurator.Panel_Recesses.Controls("Y_TextBox").TextChanged, AddressOf FunctionTextMiddle_Changed + AddHandler Grating_Configurator.Panel_Recesses.Controls("Y_TextBox").KeyPress, AddressOf FunctionText_KeyPress + Grating_Configurator.Create_Label_Recesses("Y_Label", "Width", buttonX + 18, buttonY + 13) - Individual.Create_TextBox_Recesses("X_TextBox", "", buttonX + 60, buttonY + 40, 60) - AddHandler Individual.Panel_Recesses.Controls("X_TextBox").TextChanged, AddressOf FunctionTextMiddle_Changed - AddHandler Individual.Panel_Recesses.Controls("X_TextBox").KeyPress, AddressOf FunctionText_KeyPress - Individual.Create_Label_Recesses("X_Label", "Length", buttonX + 10, buttonY + 43) + Grating_Configurator.Create_TextBox_Recesses("X_TextBox", "", buttonX + 60, buttonY + 40, 60) + AddHandler Grating_Configurator.Panel_Recesses.Controls("X_TextBox").TextChanged, AddressOf FunctionTextMiddle_Changed + AddHandler Grating_Configurator.Panel_Recesses.Controls("X_TextBox").KeyPress, AddressOf FunctionText_KeyPress + Grating_Configurator.Create_Label_Recesses("X_Label", "Length", buttonX + 10, buttonY + 43) - Individual.Create_TextBox_Recesses("OffX_TextBox", "", buttonX + 185, buttonY + 10, 60) - AddHandler Individual.Panel_Recesses.Controls("OffX_TextBox").TextChanged, AddressOf FunctionTextMiddle_Changed - AddHandler Individual.Panel_Recesses.Controls("OffX_TextBox").KeyPress, AddressOf FunctionText_KeyPress - Individual.Create_Label_Recesses("OffX_Label", "Offset X", buttonX + 126, buttonY + 13) + Grating_Configurator.Create_TextBox_Recesses("OffX_TextBox", "", buttonX + 185, buttonY + 10, 60) + AddHandler Grating_Configurator.Panel_Recesses.Controls("OffX_TextBox").TextChanged, AddressOf FunctionTextMiddle_Changed + AddHandler Grating_Configurator.Panel_Recesses.Controls("OffX_TextBox").KeyPress, AddressOf FunctionText_KeyPress + Grating_Configurator.Create_Label_Recesses("OffX_Label", "Offset X", buttonX + 126, buttonY + 13) - Individual.Create_TextBox_Recesses("OffY_TextBox", "", buttonX + 185, buttonY + 40, 60) - AddHandler Individual.Panel_Recesses.Controls("OffY_TextBox").TextChanged, AddressOf FunctionTextMiddle_Changed - AddHandler Individual.Panel_Recesses.Controls("OffY_TextBox").KeyPress, AddressOf FunctionText_KeyPress - Individual.Create_Label_Recesses("OffY_Label", "Offset Y", buttonX + 126, buttonY + 43) + Grating_Configurator.Create_TextBox_Recesses("OffY_TextBox", "", buttonX + 185, buttonY + 40, 60) + AddHandler Grating_Configurator.Panel_Recesses.Controls("OffY_TextBox").TextChanged, AddressOf FunctionTextMiddle_Changed + AddHandler Grating_Configurator.Panel_Recesses.Controls("OffY_TextBox").KeyPress, AddressOf FunctionText_KeyPress + Grating_Configurator.Create_Label_Recesses("OffY_Label", "Offset Y", buttonX + 126, buttonY + 43) 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 - Individual.Button_Square_Middle.FlatAppearance.BorderColor = Color.Red + Grating_Configurator.Button_Square_Middle.FlatStyle = FlatStyle.Flat + Grating_Configurator.Button_Square_Middle.FlatAppearance.BorderColor = Color.Red End Sub ' --- Check the key pressed by the user --- @@ -49,10 +49,10 @@ ' --- Adds clickable buttons for all sides if conditions are met --- Private Shared Sub FunctionTextMiddle_Changed(sender As TextBox, e As EventArgs) Try - middleSquareValues(0) = CInt(Individual.Panel_Recesses.Controls("X_TextBox").Text) - middleSquareValues(1) = CInt(Individual.Panel_Recesses.Controls("Y_TextBox").Text) - middleSquareValues(2) = CInt(Individual.Panel_Recesses.Controls("OffX_TextBox").Text) - middleSquareValues(3) = CInt(Individual.Panel_Recesses.Controls("OffY_TextBox").Text) + middleSquareValues(0) = CInt(Grating_Configurator.Panel_Recesses.Controls("X_TextBox").Text) + middleSquareValues(1) = CInt(Grating_Configurator.Panel_Recesses.Controls("Y_TextBox").Text) + middleSquareValues(2) = CInt(Grating_Configurator.Panel_Recesses.Controls("OffX_TextBox").Text) + middleSquareValues(3) = CInt(Grating_Configurator.Panel_Recesses.Controls("OffY_TextBox").Text) Catch ex As Exception middleSquareValues(0) = 0 middleSquareValues(1) = 0 @@ -61,7 +61,7 @@ End Try 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 { .Width = middleSquareValues(0) / Data.scaleDiff, .Height = middleSquareValues(1) / Data.scaleDiff, @@ -77,28 +77,28 @@ middleButton.FlatAppearance.MouseOverBackColor = Color.Red middleButton.FlatAppearance.MouseDownBackColor = Color.DarkRed - Individual.Panel_Grating.Controls.Add(middleButton) + Grating_Configurator.Panel_Grating.Controls.Add(middleButton) AddHandler middleButton.Click, AddressOf MiddleButton_Click Else ' Update button size and position - Individual.Panel_Grating.Controls("Button_Middle").Width = middleSquareValues(0) / Data.scaleDiff - Individual.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 - 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").Width = middleSquareValues(0) / Data.scaleDiff + Grating_Configurator.Panel_Grating.Controls("Button_Middle").Height = middleSquareValues(1) / Data.scaleDiff + Grating_Configurator.Panel_Grating.Controls("Button_Middle").Left = Data.grossAreaPoints.Rows(3)("GUI X") + middleSquareValues(2) / Data.scaleDiff + Grating_Configurator.Panel_Grating.Controls("Button_Middle").Top = Data.grossAreaPoints.Rows(3)("GUI Y") - (middleSquareValues(3) + middleSquareValues(1)) / Data.scaleDiff End If - ElseIf Individual.Panel_Grating.Controls.Count > 2 Then - RemoveHandler Individual.Panel_Grating.Controls("Button_Middle").Click, AddressOf MiddleButton_Click - Individual.Panel_Grating.Controls.RemoveByKey("Button_Middle") + ElseIf Grating_Configurator.Panel_Grating.Controls.Count > 2 Then + RemoveHandler Grating_Configurator.Panel_Grating.Controls("Button_Middle").Click, AddressOf MiddleButton_Click + Grating_Configurator.Panel_Grating.Controls.RemoveByKey("Button_Middle") End If End Sub ' --- When a side function button is pressed --- Private Shared Sub MiddleButton_Click(sender As Button, e As EventArgs) ' Remove point buttons - RemoveHandler Individual.Panel_Grating.Controls("Button_Middle").Click, AddressOf MiddleButton_Click - Individual.Panel_Grating.Controls.RemoveByKey("Button_Middle") + RemoveHandler Grating_Configurator.Panel_Grating.Controls("Button_Middle").Click, AddressOf MiddleButton_Click + Grating_Configurator.Panel_Grating.Controls.RemoveByKey("Button_Middle") Dim mesNum As Integer = Data.pointsMeasurements.Count - 1 @@ -173,33 +173,33 @@ ' Add recess measurments (GUI) 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 Y") - middleSquareValues(3) / Data.scaleDiff - 12 - 3, 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 Y") - middleSquareValues(3) / Data.scaleDiff + (middleSquareValues(3) / Data.scaleDiff) / 2 - 6, 1}) Draw_Grating.measureLabels.Add("MS_" & numOfMiddleRectangles & "_" & mesNum + 2, - {CInt(Individual.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 Y") - middleSquareValues(3) / Data.scaleDiff - CInt(Individual.Panel_Recesses.Controls("Y_TextBox").Text) / Data.scaleDiff - 12 - 3, + {CInt(Grating_Configurator.Panel_Recesses.Controls("X_TextBox").Text), + 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(Grating_Configurator.Panel_Recesses.Controls("Y_TextBox").Text) / Data.scaleDiff - 12 - 3, 1}) Draw_Grating.measureLabels.Add("MS_" & numOfMiddleRectangles & "_" & mesNum + 3, - {CInt(Individual.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 Y") - middleSquareValues(3) / Data.scaleDiff - (CInt(Individual.Panel_Recesses.Controls("Y_TextBox").Text) / Data.scaleDiff) / 2 - 6, + {CInt(Grating_Configurator.Panel_Recesses.Controls("Y_TextBox").Text), + 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(Grating_Configurator.Panel_Recesses.Controls("Y_TextBox").Text) / Data.scaleDiff) / 2 - 6, 1}) ' Recess Data 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)("LENGTH") = CInt(Individual.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 Y") = CInt(Individual.Panel_Recesses.Controls("OffY_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(Grating_Configurator.Panel_Recesses.Controls("X_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(Grating_Configurator.Panel_Recesses.Controls("OffY_TextBox").Text) @@ -209,37 +209,37 @@ Data.gratingMiddlePoints.Rows.InsertAt(pointRow4, numOfMiddleRectangles * 4 - 1) 'Redraw grating - Individual.Panel_Grating.Refresh() + Grating_Configurator.Panel_Grating.Refresh() - RemoveHandler Individual.Panel_Recesses.Controls("X_TextBox").TextChanged, AddressOf FunctionTextMiddle_Changed - RemoveHandler Individual.Panel_Recesses.Controls("X_TextBox").KeyPress, AddressOf FunctionText_KeyPress - Individual.Panel_Recesses.Controls.RemoveByKey("X_TextBox") + RemoveHandler Grating_Configurator.Panel_Recesses.Controls("X_TextBox").TextChanged, AddressOf FunctionTextMiddle_Changed + RemoveHandler Grating_Configurator.Panel_Recesses.Controls("X_TextBox").KeyPress, AddressOf FunctionText_KeyPress + Grating_Configurator.Panel_Recesses.Controls.RemoveByKey("X_TextBox") - RemoveHandler Individual.Panel_Recesses.Controls("Y_TextBox").TextChanged, AddressOf FunctionTextMiddle_Changed - RemoveHandler Individual.Panel_Recesses.Controls("Y_TextBox").KeyPress, AddressOf FunctionText_KeyPress - Individual.Panel_Recesses.Controls.RemoveByKey("Y_TextBox") + RemoveHandler Grating_Configurator.Panel_Recesses.Controls("Y_TextBox").TextChanged, AddressOf FunctionTextMiddle_Changed + RemoveHandler Grating_Configurator.Panel_Recesses.Controls("Y_TextBox").KeyPress, AddressOf FunctionText_KeyPress + Grating_Configurator.Panel_Recesses.Controls.RemoveByKey("Y_TextBox") - RemoveHandler Individual.Panel_Recesses.Controls("OffX_TextBox").TextChanged, AddressOf FunctionTextMiddle_Changed - RemoveHandler Individual.Panel_Recesses.Controls("OffX_TextBox").KeyPress, AddressOf FunctionText_KeyPress - Individual.Panel_Recesses.Controls.RemoveByKey("OffX_TextBox") + RemoveHandler Grating_Configurator.Panel_Recesses.Controls("OffX_TextBox").TextChanged, AddressOf FunctionTextMiddle_Changed + RemoveHandler Grating_Configurator.Panel_Recesses.Controls("OffX_TextBox").KeyPress, AddressOf FunctionText_KeyPress + Grating_Configurator.Panel_Recesses.Controls.RemoveByKey("OffX_TextBox") - RemoveHandler Individual.Panel_Recesses.Controls("OffY_TextBox").TextChanged, AddressOf FunctionTextMiddle_Changed - RemoveHandler Individual.Panel_Recesses.Controls("OffY_TextBox").KeyPress, AddressOf FunctionText_KeyPress - Individual.Panel_Recesses.Controls.RemoveByKey("OffY_TextBox") + RemoveHandler Grating_Configurator.Panel_Recesses.Controls("OffY_TextBox").TextChanged, AddressOf FunctionTextMiddle_Changed + RemoveHandler Grating_Configurator.Panel_Recesses.Controls("OffY_TextBox").KeyPress, AddressOf FunctionText_KeyPress + Grating_Configurator.Panel_Recesses.Controls.RemoveByKey("OffY_TextBox") - Individual.Panel_Recesses.Controls.RemoveByKey("X_Label") - Individual.Panel_Recesses.Controls.RemoveByKey("Y_Label") - Individual.Panel_Recesses.Controls.RemoveByKey("OffX_Label") - Individual.Panel_Recesses.Controls.RemoveByKey("OffY_Label") + Grating_Configurator.Panel_Recesses.Controls.RemoveByKey("X_Label") + Grating_Configurator.Panel_Recesses.Controls.RemoveByKey("Y_Label") + Grating_Configurator.Panel_Recesses.Controls.RemoveByKey("OffX_Label") + Grating_Configurator.Panel_Recesses.Controls.RemoveByKey("OffY_Label") - Individual.Panel_Recesses.Controls("Button_Angle_Corner").Enabled = True - Individual.Panel_Recesses.Controls("Button_Angle_Side").Enabled = True - Individual.Panel_Recesses.Controls("Button_Square_Corner").Enabled = True - Individual.Panel_Recesses.Controls("Button_Square_Side").Enabled = True - Individual.Panel_Recesses.Controls("Button_Square_Middle").Enabled = True + Grating_Configurator.Panel_Recesses.Controls("Button_Angle_Corner").Enabled = True + Grating_Configurator.Panel_Recesses.Controls("Button_Angle_Side").Enabled = True + Grating_Configurator.Panel_Recesses.Controls("Button_Square_Corner").Enabled = True + Grating_Configurator.Panel_Recesses.Controls("Button_Square_Side").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 Class diff --git a/Wardrobe/Recess Functions/Side_Rectangle.vb b/Wardrobe/Recess Functions/Side_Rectangle.vb index 0141e03..eacdffb 100644 --- a/Wardrobe/Recess Functions/Side_Rectangle.vb +++ b/Wardrobe/Recess Functions/Side_Rectangle.vb @@ -5,36 +5,36 @@ ' --- Create textboxes when user clicks the rectangle side recess button --- Public Shared Sub SquareSideButtton(sender As Object, e As EventArgs) - Individual.Panel_Recesses.Controls("Button_Angle_Corner").Enabled = False - Individual.Panel_Recesses.Controls("Button_Angle_Side").Enabled = False - Individual.Panel_Recesses.Controls("Button_Square_Corner").Enabled = False - Individual.Panel_Recesses.Controls("Button_Square_Side").Enabled = False - Individual.Panel_Recesses.Controls("Button_Square_Middle").Enabled = False + Grating_Configurator.Panel_Recesses.Controls("Button_Angle_Corner").Enabled = False + Grating_Configurator.Panel_Recesses.Controls("Button_Angle_Side").Enabled = False + Grating_Configurator.Panel_Recesses.Controls("Button_Square_Corner").Enabled = False + Grating_Configurator.Panel_Recesses.Controls("Button_Square_Side").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 buttonY As Integer = Individual.Panel_Recesses.Controls("Button_Square_Side").Location.Y + 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 = Grating_Configurator.Panel_Recesses.Controls("Button_Square_Side").Location.Y - Individual.Create_TextBox_Recesses("Y_TextBox", "", buttonX + 60, buttonY - 7, 60) - AddHandler Individual.Panel_Recesses.Controls("Y_TextBox").TextChanged, AddressOf FunctionTextSide_Changed - AddHandler Individual.Panel_Recesses.Controls("Y_TextBox").KeyPress, AddressOf FunctionText_KeyPress - Individual.Create_Label_Recesses("Y_Label", "Width", buttonX + 18, buttonY - 4) + Grating_Configurator.Create_TextBox_Recesses("Y_TextBox", "", buttonX + 60, buttonY - 7, 60) + AddHandler Grating_Configurator.Panel_Recesses.Controls("Y_TextBox").TextChanged, AddressOf FunctionTextSide_Changed + AddHandler Grating_Configurator.Panel_Recesses.Controls("Y_TextBox").KeyPress, AddressOf FunctionText_KeyPress + Grating_Configurator.Create_Label_Recesses("Y_Label", "Width", buttonX + 18, buttonY - 4) - Individual.Create_TextBox_Recesses("X_TextBox", "", buttonX + 60, buttonY + 23, 60) - AddHandler Individual.Panel_Recesses.Controls("X_TextBox").TextChanged, AddressOf FunctionTextSide_Changed - AddHandler Individual.Panel_Recesses.Controls("X_TextBox").KeyPress, AddressOf FunctionText_KeyPress - Individual.Create_Label_Recesses("X_Label", "Length", buttonX + 10, buttonY + 26) + Grating_Configurator.Create_TextBox_Recesses("X_TextBox", "", buttonX + 60, buttonY + 23, 60) + AddHandler Grating_Configurator.Panel_Recesses.Controls("X_TextBox").TextChanged, AddressOf FunctionTextSide_Changed + AddHandler Grating_Configurator.Panel_Recesses.Controls("X_TextBox").KeyPress, AddressOf FunctionText_KeyPress + Grating_Configurator.Create_Label_Recesses("X_Label", "Length", buttonX + 10, buttonY + 26) - Individual.Create_TextBox_Recesses("Off_TextBox", "", buttonX + 60, buttonY + 53, 60) - AddHandler Individual.Panel_Recesses.Controls("Off_TextBox").TextChanged, AddressOf FunctionTextSide_Changed - AddHandler Individual.Panel_Recesses.Controls("Off_TextBox").KeyPress, AddressOf FunctionText_KeyPress - Individual.Create_Label_Recesses("Off_Label", "Offset", buttonX + 16, buttonY + 56) + Grating_Configurator.Create_TextBox_Recesses("Off_TextBox", "", buttonX + 60, buttonY + 53, 60) + AddHandler Grating_Configurator.Panel_Recesses.Controls("Off_TextBox").TextChanged, AddressOf FunctionTextSide_Changed + AddHandler Grating_Configurator.Panel_Recesses.Controls("Off_TextBox").KeyPress, AddressOf FunctionText_KeyPress + Grating_Configurator.Create_Label_Recesses("Off_Label", "Offset", buttonX + 16, buttonY + 56) buttonOffset = 130 - Individual.Panel_Recesses.Controls("Button_Square_Middle").Left = Individual.Panel_Recesses.Controls("Button_Square_Middle").Left + buttonOffset - Individual.Panel_Recesses.Controls("Button_Radius").Left = Individual.Panel_Recesses.Controls("Button_Radius").Left + buttonOffset + Grating_Configurator.Panel_Recesses.Controls("Button_Square_Middle").Left = Grating_Configurator.Panel_Recesses.Controls("Button_Square_Middle").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 - Individual.Button_Square_Side.FlatAppearance.BorderColor = Color.Red + Grating_Configurator.Button_Square_Side.FlatStyle = FlatStyle.Flat + Grating_Configurator.Button_Square_Side.FlatAppearance.BorderColor = Color.Red End Sub @@ -46,9 +46,9 @@ ' --- Adds clickable buttons for all sides if conditions are met --- Private Shared Sub FunctionTextSide_Changed(sender As TextBox, e As EventArgs) Try - sideSquareValues(0) = CInt(Individual.Panel_Recesses.Controls("X_TextBox").Text) - sideSquareValues(1) = CInt(Individual.Panel_Recesses.Controls("Y_TextBox").Text) - sideSquareValues(2) = CInt(Individual.Panel_Recesses.Controls("Off_TextBox").Text) + sideSquareValues(0) = CInt(Grating_Configurator.Panel_Recesses.Controls("X_TextBox").Text) + sideSquareValues(1) = CInt(Grating_Configurator.Panel_Recesses.Controls("Y_TextBox").Text) + sideSquareValues(2) = CInt(Grating_Configurator.Panel_Recesses.Controls("Off_TextBox").Text) Catch ex As Exception sideSquareValues(0) = 0 sideSquareValues(1) = 0 @@ -56,7 +56,7 @@ End Try 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 Dim sidePoints As New List(Of String) If i = 1 Then @@ -82,30 +82,30 @@ Next Else ' Update button size and position - For i = 2 To Individual.Panel_Grating.Controls.Count - 1 - Dim buttonSide As Integer = CInt(Individual.Panel_Grating.Controls(i).Name.Split("_")(1)) + For i = 2 To Grating_Configurator.Panel_Grating.Controls.Count - 1 + Dim buttonSide As Integer = CInt(Grating_Configurator.Panel_Grating.Controls(i).Name.Split("_")(1)) If buttonSide = 1 Then - Individual.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).Width = sideSquareValues(0) / (Data.scaleDiff) + Grating_Configurator.Panel_Grating.Controls(i).Left = Data.grossAreaPoints.Rows(0)("GUI X") + sideSquareValues(2) / (Data.scaleDiff) ElseIf buttonSide = 2 Then - Individual.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).Height = sideSquareValues(1) / (Data.scaleDiff) + Grating_Configurator.Panel_Grating.Controls(i).Top = Data.grossAreaPoints.Rows(1)("GUI Y") + sideSquareValues(2) / (Data.scaleDiff) ElseIf buttonSide = 3 Then - Individual.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).Width = sideSquareValues(0) / (Data.scaleDiff) + 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 - Individual.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).Height = sideSquareValues(1) / (Data.scaleDiff) + 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 Next End If - ElseIf Individual.Panel_Grating.Controls.Count > 2 Then - For i = 2 To Individual.Panel_Grating.Controls.Count - 1 - RemoveHandler Individual.Panel_Grating.Controls(2).Click, AddressOf SideButton_Click - Individual.Panel_Grating.Controls.RemoveAt(2) + ElseIf Grating_Configurator.Panel_Grating.Controls.Count > 2 Then + For i = 2 To Grating_Configurator.Panel_Grating.Controls.Count - 1 + RemoveHandler Grating_Configurator.Panel_Grating.Controls(2).Click, AddressOf SideButton_Click + Grating_Configurator.Panel_Grating.Controls.RemoveAt(2) Next End If End Sub @@ -127,7 +127,7 @@ sideButton.FlatAppearance.MouseOverBackColor = Color.Red sideButton.FlatAppearance.MouseDownBackColor = Color.DarkRed - Individual.Panel_Grating.Controls.Add(sideButton) + Grating_Configurator.Panel_Grating.Controls.Add(sideButton) AddHandler sideButton.Click, AddressOf SideButton_Click End Sub @@ -138,9 +138,9 @@ Dim sidePressed As Integer = CInt(sender.Name.Split("_")(1)) ' Remove point buttons - For i = 2 To Individual.Panel_Grating.Controls.Count - 1 - RemoveHandler Individual.Panel_Grating.Controls(2).Click, AddressOf SideButton_Click - Individual.Panel_Grating.Controls.RemoveAt(2) + For i = 2 To Grating_Configurator.Panel_Grating.Controls.Count - 1 + RemoveHandler Grating_Configurator.Panel_Grating.Controls(2).Click, AddressOf SideButton_Click + Grating_Configurator.Panel_Grating.Controls.RemoveAt(2) Next Dim sidePoints As New List(Of Integer) @@ -346,25 +346,25 @@ Data.grossAreaPoints.Rows(0)("GUI Y") - 15}) ' 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.grossAreaPoints.Rows(0)("GUI Y") - 15 - 12 - 3, 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), - Data.grossAreaPoints.Rows(0)("GUI X") + sideSquareValues(2) / (Data.scaleDiff) + CInt(Individual.Panel_Recesses.Controls("X_TextBox").Text) / (2 * Data.scaleDiff) - 8, + 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(Grating_Configurator.Panel_Recesses.Controls("X_TextBox").Text) / (2 * Data.scaleDiff) - 8, Data.grossAreaPoints.Rows(0)("GUI Y") + sideSquareValues(1) / (Data.scaleDiff) + 3, 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 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}) ' Recess Data 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)("WIDTH") = CInt(Individual.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)("OFFSET") = CInt(Individual.Panel_Recesses.Controls("Off_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(Grating_Configurator.Panel_Recesses.Controls("X_TextBox").Text) + Data.recessData.Rows(Data.recessData.Rows.Count - 1)("OFFSET") = CInt(Grating_Configurator.Panel_Recesses.Controls("Off_TextBox").Text) ElseIf sidePressed = 2 Then ' Add the new points @@ -403,17 +403,17 @@ Data.grossAreaPoints.Rows(1)("GUI Y") + sideSquareValues(2) / Data.scaleDiff}) ' 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.gratingPoints.Rows(index)("GUI Y") + Data.grossAreaPoints.Rows(1)("GUI Y") + sideSquareValues(2) / Data.scaleDiff) / 2 - 4, 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 Y") + (sideSquareValues(2) + sideSquareValues(1) / 2) / Data.scaleDiff - 4, 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 Y") + sideSquareValues(2) / Data.scaleDiff - 15 - 3, 2}) @@ -421,9 +421,9 @@ ' Recess Data 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)("WIDTH") = CInt(Individual.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)("OFFSET") = CInt(Individual.Panel_Recesses.Controls("Off_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(Grating_Configurator.Panel_Recesses.Controls("X_TextBox").Text) + Data.recessData.Rows(Data.recessData.Rows.Count - 1)("OFFSET") = CInt(Grating_Configurator.Panel_Recesses.Controls("Off_TextBox").Text) ElseIf sidePressed = 3 Then ' Add the new points @@ -459,25 +459,25 @@ Data.grossAreaPoints.Rows(2)("GUI Y") + 15}) ' 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.grossAreaPoints.Rows(2)("GUI Y") + 15 + 3, 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), - Data.grossAreaPoints.Rows(2)("GUI X") - sideSquareValues(2) / (Data.scaleDiff) - CInt(Individual.Panel_Recesses.Controls("X_TextBox").Text) / (2 * Data.scaleDiff) - 8, + 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(Grating_Configurator.Panel_Recesses.Controls("X_TextBox").Text) / (2 * Data.scaleDiff) - 8, Data.grossAreaPoints.Rows(2)("GUI Y") - sideSquareValues(1) / (Data.scaleDiff) - 12 - 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 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}) ' Recess Data 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)("WIDTH") = CInt(Individual.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)("OFFSET") = CInt(Individual.Panel_Recesses.Controls("Off_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(Grating_Configurator.Panel_Recesses.Controls("X_TextBox").Text) + Data.recessData.Rows(Data.recessData.Rows.Count - 1)("OFFSET") = CInt(Grating_Configurator.Panel_Recesses.Controls("Off_TextBox").Text) Else ' Add the new points @@ -513,17 +513,17 @@ Data.grossAreaPoints.Rows(3)("GUI Y") - sideSquareValues(2) / Data.scaleDiff}) ' 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.gratingPoints.Rows(index)("GUI Y") + Data.grossAreaPoints.Rows(3)("GUI Y") - sideSquareValues(2) / Data.scaleDiff) / 2 - 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 Y") - (sideSquareValues(2) + sideSquareValues(1) / 2) / Data.scaleDiff - 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 Y") - sideSquareValues(2) / Data.scaleDiff + 3, 4}) @@ -531,9 +531,9 @@ ' Recess Data 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)("WIDTH") = CInt(Individual.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)("OFFSET") = CInt(Individual.Panel_Recesses.Controls("Off_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(Grating_Configurator.Panel_Recesses.Controls("X_TextBox").Text) + Data.recessData.Rows(Data.recessData.Rows.Count - 1)("OFFSET") = CInt(Grating_Configurator.Panel_Recesses.Controls("Off_TextBox").Text) End If Data.gratingPoints.Rows.InsertAt(pointRow1, index + 1) @@ -544,35 +544,35 @@ numOfSideRectangles += 1 'Redraw grating - Individual.Panel_Grating.Refresh() + Grating_Configurator.Panel_Grating.Refresh() - RemoveHandler Individual.Panel_Recesses.Controls("X_TextBox").TextChanged, AddressOf FunctionTextSide_Changed - RemoveHandler Individual.Panel_Recesses.Controls("X_TextBox").KeyPress, AddressOf FunctionText_KeyPress - Individual.Panel_Recesses.Controls.RemoveByKey("X_TextBox") + RemoveHandler Grating_Configurator.Panel_Recesses.Controls("X_TextBox").TextChanged, AddressOf FunctionTextSide_Changed + RemoveHandler Grating_Configurator.Panel_Recesses.Controls("X_TextBox").KeyPress, AddressOf FunctionText_KeyPress + Grating_Configurator.Panel_Recesses.Controls.RemoveByKey("X_TextBox") - RemoveHandler Individual.Panel_Recesses.Controls("Y_TextBox").TextChanged, AddressOf FunctionTextSide_Changed - RemoveHandler Individual.Panel_Recesses.Controls("Y_TextBox").KeyPress, AddressOf FunctionText_KeyPress - Individual.Panel_Recesses.Controls.RemoveByKey("Y_TextBox") + RemoveHandler Grating_Configurator.Panel_Recesses.Controls("Y_TextBox").TextChanged, AddressOf FunctionTextSide_Changed + RemoveHandler Grating_Configurator.Panel_Recesses.Controls("Y_TextBox").KeyPress, AddressOf FunctionText_KeyPress + Grating_Configurator.Panel_Recesses.Controls.RemoveByKey("Y_TextBox") - RemoveHandler Individual.Panel_Recesses.Controls("Off_TextBox").TextChanged, AddressOf FunctionTextSide_Changed - RemoveHandler Individual.Panel_Recesses.Controls("Off_TextBox").KeyPress, AddressOf FunctionText_KeyPress - Individual.Panel_Recesses.Controls.RemoveByKey("Off_TextBox") + RemoveHandler Grating_Configurator.Panel_Recesses.Controls("Off_TextBox").TextChanged, AddressOf FunctionTextSide_Changed + RemoveHandler Grating_Configurator.Panel_Recesses.Controls("Off_TextBox").KeyPress, AddressOf FunctionText_KeyPress + Grating_Configurator.Panel_Recesses.Controls.RemoveByKey("Off_TextBox") - Individual.Panel_Recesses.Controls.RemoveByKey("X_Label") - Individual.Panel_Recesses.Controls.RemoveByKey("Y_Label") - Individual.Panel_Recesses.Controls.RemoveByKey("Off_Label") + Grating_Configurator.Panel_Recesses.Controls.RemoveByKey("X_Label") + Grating_Configurator.Panel_Recesses.Controls.RemoveByKey("Y_Label") + Grating_Configurator.Panel_Recesses.Controls.RemoveByKey("Off_Label") - Individual.Panel_Recesses.Controls("Button_Angle_Corner").Enabled = True - Individual.Panel_Recesses.Controls("Button_Angle_Side").Enabled = True - Individual.Panel_Recesses.Controls("Button_Square_Corner").Enabled = True - Individual.Panel_Recesses.Controls("Button_Square_Side").Enabled = True - Individual.Panel_Recesses.Controls("Button_Square_Middle").Enabled = True + Grating_Configurator.Panel_Recesses.Controls("Button_Angle_Corner").Enabled = True + Grating_Configurator.Panel_Recesses.Controls("Button_Angle_Side").Enabled = True + Grating_Configurator.Panel_Recesses.Controls("Button_Square_Corner").Enabled = True + Grating_Configurator.Panel_Recesses.Controls("Button_Square_Side").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 - Individual.Panel_Recesses.Controls("Button_Radius").Left = Individual.Panel_Recesses.Controls("Button_Radius").Left - buttonOffset + Grating_Configurator.Panel_Recesses.Controls("Button_Square_Middle").Left = Grating_Configurator.Panel_Recesses.Controls("Button_Square_Middle").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 Class diff --git a/Wardrobe/SolidWorks/Frame_3D.vb b/Wardrobe/SolidWorks/Frame_3D.vb index c6f5e03..6dfd3e3 100644 --- a/Wardrobe/SolidWorks/Frame_3D.vb +++ b/Wardrobe/SolidWorks/Frame_3D.vb @@ -469,9 +469,9 @@ Public Class Frame_3D 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 swEquationMgr = Part.GetEquationMgr() @@ -511,7 +511,7 @@ Public Class Frame_3D Dim swWarnings As Integer 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 Next End Sub diff --git a/Wardrobe/SolidWorks/Frame_Drawing.vb b/Wardrobe/SolidWorks/Frame_Drawing.vb index b9c95e8..b525e57 100644 --- a/Wardrobe/SolidWorks/Frame_Drawing.vb +++ b/Wardrobe/SolidWorks/Frame_Drawing.vb @@ -30,12 +30,12 @@ Public Class Frame_Drawing Dim transMatrix As Object = Nothing For j = 0 To compNames.Count - 2 + endPieceExist 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) = "" Next 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) = "" End If @@ -45,7 +45,7 @@ Public Class Frame_Drawing Dim config As Configuration config = assembly.GetActiveConfiguration 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("Materialsort", 30, "Hot Dip Galvanized Steel", 1) longstatus = swCustPropMgr.Add3("Art. Nr", 30, "TBD", 1) @@ -60,9 +60,9 @@ Public Class Frame_Drawing 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 End Sub @@ -82,7 +82,7 @@ Public Class Frame_Drawing Dim swSheet As Sheet swSheet = iDrawing.GetCurrentSheet() 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.SetScale(1, 10, False, False) swSheet.SetName("Frame 1") @@ -92,14 +92,14 @@ Public Class Frame_Drawing For i = 0 To Frame_3D.cuttingList.Count - 1 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") End If status = layMgr.SetCurrentLayer("Svenska") 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) myView.UseSheetScale() = True myView.SetDisplayTangentEdges2(2) @@ -192,10 +192,10 @@ Public Class Frame_Drawing Next 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(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 diff --git a/Wardrobe/SolidWorks/Individual_3D.vb b/Wardrobe/SolidWorks/Individual_3D.vb index 8ccec4f..c1c00f5 100644 --- a/Wardrobe/SolidWorks/Individual_3D.vb +++ b/Wardrobe/SolidWorks/Individual_3D.vb @@ -81,15 +81,15 @@ Public Class Individual_3D Dim childrenSourcePaths As New List(Of String) Dim childrenDestPaths As New List(Of String) - sourcePath = Settings2ABC.filesFolder & "\Files\CADStart\" & designName & ".SLDASM" - destPath = Settings2ABC.folderPaths("object_" & Data.objectNum & "_models3D_gratings_sw") & "\GRATING_ASSEMBLY.SLDASM" + sourcePath = Settings.filesFolder & "\Files\CADStart\" & designName & ".SLDASM" + destPath = Settings.folderPaths("object_" & Data.objectNum & "_models3D_gratings_sw") & "\GRATING_ASSEMBLY.SLDASM" - childrenSourcePaths.Add(Settings2ABC.HLCtFolder & "\HLCt\Parts\START.SLDPRT") - childrenDestPaths.Add(Settings2ABC.folderPaths("object_" & Data.objectNum & "_models3D_gratings_sw_support") & "\MASTER.SLDPRT") + childrenSourcePaths.Add(Settings.HLCtFolder & "\HLCt\Parts\START.SLDPRT") + childrenDestPaths.Add(Settings.folderPaths("object_" & Data.objectNum & "_models3D_gratings_sw_support") & "\MASTER.SLDPRT") Dim instanceCounter As New Dictionary(Of String, Integer) 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 partNameArray As String() = partName.Split("_") @@ -106,10 +106,10 @@ Public Class Individual_3D End Try 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") 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") End If Next diff --git a/Wardrobe/SolidWorks/Individual_3D_Simplified.vb b/Wardrobe/SolidWorks/Individual_3D_Simplified.vb index ceb42f5..d165bad 100644 --- a/Wardrobe/SolidWorks/Individual_3D_Simplified.vb +++ b/Wardrobe/SolidWorks/Individual_3D_Simplified.vb @@ -116,20 +116,20 @@ Public Class Individual_3D_Simplified Dim childrenSourcePaths 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 - destPath = Settings2ABC.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") + destPath = Settings.folderPaths("object_" & Data.objectNum & "_models3D_gratings_sw_support") & "\GRATING_ASSEMBLY_SIMPLIFIED_WITH_FRAME.SLDASM" + childrenDestPaths.Add(Settings.folderPaths("object_" & Data.objectNum & "_models3D_gratings_sw_support") & "\MASTER_SIMPLIFIED_WITH_FRAME.SLDPRT") Else - destPath = Settings2ABC.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") + destPath = Settings.folderPaths("object_" & Data.objectNum & "_models3D_gratings_sw_support") & "\GRATING_ASSEMBLY_SIMPLIFIED.SLDASM" + childrenDestPaths.Add(Settings.folderPaths("object_" & Data.objectNum & "_models3D_gratings_sw_support") & "\MASTER_SIMPLIFIED.SLDPRT") End If Dim instanceCounter As New Dictionary(Of String, Integer) 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 partNameArray As String() = partName.Split("_") @@ -146,10 +146,10 @@ Public Class Individual_3D_Simplified End Try 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") 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") End If Next diff --git a/Wardrobe/SolidWorks/Individual_Drawing.vb b/Wardrobe/SolidWorks/Individual_Drawing.vb index 453565e..0d18881 100644 --- a/Wardrobe/SolidWorks/Individual_Drawing.vb +++ b/Wardrobe/SolidWorks/Individual_Drawing.vb @@ -112,7 +112,7 @@ Public Class Individual_Drawing Dim iPart As PartDoc iPart = swApp.ActiveDoc 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 config = iPart.GetActiveConfiguration @@ -167,7 +167,7 @@ Public Class Individual_Drawing Dim swSheet As Sheet swSheet = iDrawing.GetCurrentSheet() 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) Dim layMgr As LayerMgr @@ -176,7 +176,7 @@ Public Class Individual_Drawing status = layMgr.SetCurrentLayer("Svenska") 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) myView.UseSheetScale() = True 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("Wmes"), CompName, myView, iDrawing, swExtensions, OutLine, scaleDecimal, X_Mid, Y_Mid, "Wmes") 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) myView2.UseSheetScale() = True @@ -315,7 +315,7 @@ Public Class Individual_Drawing Dim longstatus As Integer 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.SetCurrentLayer("Symbol") @@ -339,7 +339,7 @@ Public Class Individual_Drawing swSkMgr.AddToDB = False 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 Private Shared Sub Add_Dimensions(points() As Integer, CompName As String, myView As View, iDrawing As DrawingDoc, swExtensions As SldWorks.ModelDocExtension _ diff --git a/Wardrobe/SolidWorks/Instructions.vb b/Wardrobe/SolidWorks/Instructions.vb index 95cddb4..fbb8be1 100644 --- a/Wardrobe/SolidWorks/Instructions.vb +++ b/Wardrobe/SolidWorks/Instructions.vb @@ -16,7 +16,7 @@ Public Class Instructions Dim swSheet As Sheet swSheet = iDrawing.GetCurrentSheet() 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.SetScale(1, 10, False, False) swSheet.SetName("Instructions") @@ -28,15 +28,15 @@ Public Class Instructions Dim drawName As String If AppForm.fillMode = 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 - 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 Else 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 - 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 @@ -271,11 +271,11 @@ Public Class Instructions ' --- instruction for support beams --- 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") 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.UseSheetScale() = True @@ -413,7 +413,7 @@ Public Class Instructions End If 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, 2) diff --git a/Wardrobe/SolidWorks/Multiple_3D.vb b/Wardrobe/SolidWorks/Multiple_3D.vb index 1786b04..3317eb7 100644 --- a/Wardrobe/SolidWorks/Multiple_3D.vb +++ b/Wardrobe/SolidWorks/Multiple_3D.vb @@ -121,15 +121,15 @@ Public Class Multiple_3D Dim childrenSourcePaths As New List(Of String) Dim childrenDestPaths As New List(Of String) - sourcePath = Settings2ABC.filesFolder & "\Files\CADStart\" & designName & ".SLDASM" - destPath = Settings2ABC.folderPaths("object_" & Data.objectNum & "_models3D_gratings_sw") & "\GRATINGS_ASSEMBLY.SLDASM" + sourcePath = Settings.filesFolder & "\Files\CADStart\" & designName & ".SLDASM" + destPath = Settings.folderPaths("object_" & Data.objectNum & "_models3D_gratings_sw") & "\GRATINGS_ASSEMBLY.SLDASM" - childrenSourcePaths.Add(Settings2ABC.HLCtFolder & "\HLCt\Parts\START.SLDPRT") - childrenDestPaths.Add(Settings2ABC.folderPaths("object_" & Data.objectNum & "_models3D_gratings_sw_support") & "\MASTER.SLDPRT") + childrenSourcePaths.Add(Settings.HLCtFolder & "\HLCt\Parts\START.SLDPRT") + childrenDestPaths.Add(Settings.folderPaths("object_" & Data.objectNum & "_models3D_gratings_sw_support") & "\MASTER.SLDPRT") Dim instanceCounter As New Dictionary(Of String, Integer) 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 partNameArray As String() = partName.Split("_") @@ -146,10 +146,10 @@ Public Class Multiple_3D End Try 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") 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") End If Next diff --git a/Wardrobe/SolidWorks/Multiple_3D_Simplified.vb b/Wardrobe/SolidWorks/Multiple_3D_Simplified.vb index fdc276c..8b55fa3 100644 --- a/Wardrobe/SolidWorks/Multiple_3D_Simplified.vb +++ b/Wardrobe/SolidWorks/Multiple_3D_Simplified.vb @@ -181,21 +181,21 @@ Public Class Multiple_3D_Simplified Dim childrenSourcePaths 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 = "" If withFrame = True Then frameStr = "_WITH_FRAME" End If - destPath = Settings2ABC.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") + destPath = Settings.folderPaths("object_" & Data.objectNum & "_models3D_gratings_sw_support") & "\GRATINGS_ASSEMBLY_SIMPLIFIED" & frameStr & ".SLDASM" + childrenDestPaths.Add(Settings.folderPaths("object_" & Data.objectNum & "_models3D_gratings_sw_support") & "\MASTER_SIMPLIFIED" & frameStr & ".SLDPRT") Dim instanceCounter As New Dictionary(Of String, Integer) 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 partNameArray As String() = partName.Split("_") @@ -212,10 +212,10 @@ Public Class Multiple_3D_Simplified End Try 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") 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") End If Next diff --git a/Wardrobe/SolidWorks/Multiple_Drawing.vb b/Wardrobe/SolidWorks/Multiple_Drawing.vb index 5bf430f..f3b1e07 100644 --- a/Wardrobe/SolidWorks/Multiple_Drawing.vb +++ b/Wardrobe/SolidWorks/Multiple_Drawing.vb @@ -16,7 +16,7 @@ Public Class Multiple_Drawing Dim swSheet As Sheet swSheet = iDrawing.GetCurrentSheet() 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.SetScale(1, 10, False, False) swSheet.SetName("Assembly") @@ -28,7 +28,7 @@ Public Class Multiple_Drawing Dim adjustedHeightPosInSheet As Double = swSheetHeight / 2 + 0.02 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) myView.UseSheetScale() = True myView.SetDisplayTangentEdges2(2) @@ -431,10 +431,10 @@ Public Class Multiple_Drawing Next 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(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 diff --git a/Wardrobe/Wardrobe.vbproj b/Wardrobe/Wardrobe.vbproj index f027285..f833d7f 100644 --- a/Wardrobe/Wardrobe.vbproj +++ b/Wardrobe/Wardrobe.vbproj @@ -85,10 +85,10 @@ Form - - Individual.vb + + Grating_Configurator.vb - + Form @@ -139,8 +139,8 @@ AppForm.vb Designer - - Individual.vb + + Grating_Configurator.vb Main_Menu.vb