91 lines
3.3 KiB
VB.net
91 lines
3.3 KiB
VB.net
Imports XCCLibrary
|
|
Imports System.Environment
|
|
|
|
Public Class AppForm
|
|
Public Shared fillMode As Boolean
|
|
Public Shared appDataPath As String
|
|
|
|
Sub AppForm_Load() Handles MyBase.Load
|
|
Dim appData As String = GetFolderPath(SpecialFolder.ApplicationData)
|
|
Dim appDataDir As New IO.DirectoryInfo(appData & "\Floor Grating Configurator")
|
|
appDataPath = appDataDir.FullName
|
|
If Not appDataDir.Exists Then
|
|
System.IO.Directory.CreateDirectory(appDataPath)
|
|
System.IO.File.Create(appDataPath & "\SavedData.txt").Dispose()
|
|
End If
|
|
|
|
Dim savedData As String() = System.IO.File.ReadAllLines(appDataPath & "\SavedData.txt")
|
|
For i = 0 To savedData.Length - 1
|
|
If savedData(i) = Settings.exportFolderHead Then
|
|
Settings.exportFolder = savedData(i + 1)
|
|
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
|
|
|
|
Settings.Check_Settings()
|
|
|
|
|
|
Dim appDir As String = Application.StartupPath
|
|
Dim appDirArray As String() = appDir.Split("\")
|
|
For i = 0 To appDirArray.Length - 5
|
|
If i = appDirArray.Length - 5 Then
|
|
Settings.filesFolder += appDirArray(i)
|
|
Else
|
|
Settings.filesFolder += appDirArray(i) & "\"
|
|
End If
|
|
Next
|
|
For i = 0 To appDirArray.Length - 4
|
|
If i = appDirArray.Length - 4 Then
|
|
Settings.HLCtFolder += appDirArray(i)
|
|
Else
|
|
Settings.HLCtFolder += appDirArray(i) & "\"
|
|
End If
|
|
Next
|
|
|
|
|
|
Me.Width = 800
|
|
Me.Height = 500
|
|
Me.Top = 170
|
|
Me.Left = 350
|
|
|
|
Panel_Start.Controls.Clear()
|
|
Main_Menu.TopLevel = False
|
|
Panel_Start.Controls.Add(Main_Menu)
|
|
Main_Menu.PictureBox_Settings.BackgroundImage = Global.Wardrobe.My.Resources.Resources.Icon_Settings1
|
|
Main_Menu.PictureBox_CreateOrder.BackgroundImage = Global.Wardrobe.My.Resources.Resources.Icon_CreateOrder1_01
|
|
Main_Menu.PictureBox_Individual.BackgroundImage = Global.Wardrobe.My.Resources.Resources.Icon_Individual1_01
|
|
Main_Menu.PictureBox_Multiple.BackgroundImage = Global.Wardrobe.My.Resources.Resources.Icon_Multiple1_01
|
|
|
|
Main_Menu.Show()
|
|
|
|
' Get floor gratings database
|
|
Database.Retrive_Database()
|
|
|
|
' Initialize DataTables, Measurments and more
|
|
Data.Init_Data()
|
|
|
|
' Initialize DrawingPanel
|
|
Draw_Grating.Load_DrawingPanel()
|
|
|
|
' Load XCC settings
|
|
adminClass.loadSettings(Settings.filesFolder, Settings.HLCtFolder, "SolidWorks")
|
|
|
|
Grating_Configurator.ComboBox_Type.Items.Add("Pressure Welded")
|
|
Grating_Configurator.ComboBox_Type.Items.Add("Type A")
|
|
|
|
For i = 25 To 55 Step 5
|
|
Grating_Configurator.ComboBox_Frame.Items.Add(i & " x " & i)
|
|
Next
|
|
For i = 65 To 85 Step 10
|
|
Grating_Configurator.ComboBox_Frame.Items.Add(i & " x " & i)
|
|
Next
|
|
End Sub
|
|
|
|
End Class |