132 lines
5.7 KiB
VB.net
132 lines
5.7 KiB
VB.net
Imports System.Collections.ObjectModel
|
|
Imports EgtUILib
|
|
Imports EgtWPFLib5
|
|
|
|
Friend Module OptionModule
|
|
|
|
' Parametri che contengono lista delle lingue disponibili e lingua selezionata
|
|
Friend m_LanguageList As New ObservableCollection(Of Language)
|
|
Friend m_SelectedLanguage As Language
|
|
' Colori di sfondo della vista e della griglia
|
|
Friend m_TopSceneBackground As Color3d
|
|
Friend m_BotSceneBackground As Color3d
|
|
Friend m_GridColor As Color3d
|
|
' Flag per visualizzazione spessa delle linee
|
|
Friend m_bThickLine As Boolean
|
|
' Flag per visualizzazione smussata delle superfici
|
|
Friend m_bSmoothTriMesh As Boolean
|
|
' Flag per visualizzazione semplificate sezione strand
|
|
Friend m_bUseSimplifiedSection As Boolean
|
|
|
|
' Colore di default in disegno
|
|
Friend m_DefMaterialColor As Color3d
|
|
' Tolleranza geometrica
|
|
Friend m_dGeometryTolerance As Double
|
|
|
|
' Parametri per import
|
|
Friend m_dDxfScaleFactor As Double
|
|
Friend m_dStlScaleFactor As Double
|
|
Friend m_dImgScaleFactor As Double
|
|
|
|
' Parametri per export
|
|
Friend m_nExportDxfFlag As Integer
|
|
Friend m_nImgWidth As Integer
|
|
Friend m_nImgHeight As Integer
|
|
|
|
' Font di testo
|
|
Friend m_sFontText As String
|
|
|
|
' Parametri per le quotature
|
|
Friend m_dExtLineLen As Double
|
|
Friend m_dArrowLen As Double
|
|
Friend m_dTextDist As Double
|
|
Friend m_nLenIsMM As Integer
|
|
Friend m_nDecDigit As Integer
|
|
Friend m_sFont As String
|
|
Friend m_dTextHeight As Double
|
|
|
|
' Parametri per la griglia
|
|
Friend m_bGridVisibility As Boolean
|
|
Friend m_dSnapStepMm As Double
|
|
Friend m_dSnapStepInch As Double
|
|
Friend m_nMinLineSStep As Integer
|
|
Friend m_nMajLineSStep As Integer
|
|
Friend m_nExtSStep As Integer
|
|
|
|
' Variabili che indicano per ogni tipo di lavorazione quale geometria è selezionabile
|
|
'Friend m_SelGeomSawing As SceneSelModeOpt
|
|
'Friend m_SelGeomDrilling As SceneSelModeOpt
|
|
'Friend m_SelGeomMilling As SceneSelModeOpt
|
|
'Friend m_SelGeomPocketing As SceneSelModeOpt
|
|
'Friend m_SelGeomMortising As SceneSelModeOpt
|
|
'Friend m_SelGeomSawRoughing As SceneSelModeOpt
|
|
'Friend m_SelGeomSawFinishing As SceneSelModeOpt
|
|
'Friend m_SelGeomGenMachining As SceneSelModeOpt
|
|
'Friend m_SelGeomChiseling As SceneSelModeOpt
|
|
'Friend m_SelGeomSurfFinishing As SceneSelModeOpt
|
|
'Friend m_SelGeomWaterJetting As SceneSelModeOpt
|
|
' Flag per aggiungere una nuova lavorazione alla fine della fase o subito dopo la lavorazione selezionata
|
|
Friend m_bNewMachiningIsLastOne As Boolean
|
|
' Variabile che indica se usare lo script per calcolare automaticamente la disposizione quando si passa in lavorazione
|
|
Friend m_bUseDispositionScript As Boolean
|
|
|
|
' inizializzazione lettura variabili ad inizio programma
|
|
Friend Sub InitOptionModule()
|
|
' Leggo elenco lingue disponibili da file ini
|
|
Dim nIndex As Integer = 1
|
|
'Dim ReadLanguage As Language = GetPrivateProfileLanguage(S_LANGUAGES, K_LANGUAGE & nIndex)
|
|
'While Not IsNothing(ReadLanguage)
|
|
' OptionModule.m_LanguageList.Add(ReadLanguage)
|
|
' nIndex += 1
|
|
' ReadLanguage = GetPrivateProfileLanguage(S_LANGUAGES, K_LANGUAGE & nIndex)
|
|
'End While
|
|
'If nIndex = 1 Then
|
|
' EgtOutLog("Error missing languages section in Config.ini")
|
|
' MessageBox.Show( "Error : missing languages informations", "EgtCAM5", MessageBoxButton.OK, MessageBoxImage.Error)
|
|
' End
|
|
'End If
|
|
'' Inizializzo la lingua corrente
|
|
'OptionModule.m_SelectedLanguage = OptionModule.m_LanguageList(0)
|
|
'Dim sMsgName As String = String.Empty
|
|
'GetPrivateProfileString(S_GENERAL, K_MESSAGES, "", sMsgName)
|
|
'For Each Language In OptionModule.m_LanguageList
|
|
' If Language.Name = sMsgName Then
|
|
' OptionModule.m_SelectedLanguage = Language
|
|
' Exit For
|
|
' End If
|
|
'Next
|
|
' Inizializzo variabili colori di sfondo scena, griglia
|
|
Dim BackTopColor As New Color3d(192, 192, 192)
|
|
GetMainPrivateProfileColor(S_SCENE, K_BACKTOP, BackTopColor)
|
|
m_TopSceneBackground = BackTopColor
|
|
Dim BackBotColor As New Color3d(BackTopColor)
|
|
GetMainPrivateProfileColor(S_SCENE, K_BACKBOTTOM, BackBotColor)
|
|
m_BotSceneBackground = BackBotColor
|
|
Dim GridColor As New Color3d(0, 0, 0)
|
|
GetMainPrivateProfileColor(S_GRID, K_MINLNCOLOR, GridColor)
|
|
m_GridColor = GridColor
|
|
' Inizializzo flag linee ingrossate
|
|
m_bThickLine = GetMainPrivateProfileInt(S_SCENE, K_LINEWIDTH, 1) <> 1
|
|
' Inizializzo flag visualizzazione smussata delle superfici
|
|
m_bSmoothTriMesh = GetMainPrivateProfileInt(S_SCENE, K_SHOWTRIAADV, 1) <> 0
|
|
' Inizializzo flag visualizzazione sezione strand semplificata
|
|
m_bUseSimplifiedSection = GetMainPrivateProfileInt(S_SOLIDS, K_SIMPLIFIEDSECTION, 0) <> 0
|
|
' Inizio colore di default in disegno
|
|
Dim DefColor As New Color3d(0, 0, 0)
|
|
GetMainPrivateProfileColor(S_GEOMDB, K_DEFAULTCOLOR, DefColor)
|
|
m_DefMaterialColor = DefColor
|
|
' Inizializzo tolleranza geometrica
|
|
m_dGeometryTolerance = GetMainPrivateProfileDouble(S_GEOMDB, K_SURFTMTOLER, 0.05)
|
|
' Inizializzo variabili per import
|
|
m_dDxfScaleFactor = GetMainPrivateProfileDouble(S_IMPORT, K_DXFSCALE, 1)
|
|
m_dStlScaleFactor = GetMainPrivateProfileDouble(S_IMPORT, K_STLSCALE, 1)
|
|
' Inizializzo parametri griglia
|
|
m_bGridVisibility = (GetMainPrivateProfileInt(S_GRID, K_SHOWGRID, 1) <> 0)
|
|
m_dSnapStepMm = GetMainPrivateProfileDouble(S_GRID, K_SNAPSTEP, 10)
|
|
m_dSnapStepInch = GetMainPrivateProfileDouble(S_GRID, K_SNAPSTEPINCH, 12.7)
|
|
m_nMinLineSStep = GetMainPrivateProfileInt(S_GRID, K_MINLINESSTEP, 1)
|
|
m_nMajLineSStep = GetMainPrivateProfileInt(S_GRID, K_MAJLINESSTEP, 10)
|
|
m_nExtSStep = GetMainPrivateProfileInt(S_GRID, K_EXTSSTEP, 100)
|
|
End Sub
|
|
|
|
End Module |