diff --git a/OptionsWindow/OptionModule.vb b/OptionsWindow/OptionModule.vb
index 26a768f..b221569 100644
--- a/OptionsWindow/OptionModule.vb
+++ b/OptionsWindow/OptionModule.vb
@@ -1,4 +1,5 @@
Imports System.Collections.ObjectModel
+Imports EgtUILib
Friend Module OptionModule
@@ -23,12 +24,18 @@ Friend Module OptionModule
Friend m_SelGeomGenMachining As SceneSelModeOpt
Friend m_SelGeomChiseling As SceneSelModeOpt
+ ' Tolleranza geometrica
+ Friend m_GeometryTolerance As Double
' Variabile che indica se quando viene creata una nuova operazione di lavorazione deve essere aggiunta in fondo
' alla 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
+ Friend m_TopSceneBackground As Color3d
+ Friend m_BotSceneBackground As Color3d
+ Friend m_DefMaterialColor As Color3d
+
' inizializzazione lettura variabili ad inizio programma
Friend Sub InitOptionModule()
' Inizializzo variabili per export
@@ -54,10 +61,22 @@ Friend Module OptionModule
m_SelGeomGenMachining = If(Temp < 0 Or Temp > 3, SceneSelModeOpt.PARTCURVESANDSURFACES, DirectCast(Temp, SceneSelModeOpt))
Temp = GetPrivateProfileInt(S_MACH, K_SELGEOMCHISELING, -1)
m_SelGeomChiseling = If(Temp < 0 Or Temp > 3, SceneSelModeOpt.PARTCURVESANDSURFACES, DirectCast(Temp, SceneSelModeOpt))
+ ' Inizializzo tolleranza geometrica
+ m_GeometryTolerance = GetPrivateProfileDouble(S_GEOMDB, K_SURFTMTOLER, 0.05)
' Inizializzo variabile che indica posizione nuova operazione di lavorazione
m_bNewMachiningIsLastOne = If(GetPrivateProfileInt(S_OPTIONS, K_NEWMACHININGISLASTONE, 0) <> 0, True, False)
' Inizializzo variabile che indica se usare script di disposizione
m_bUseDispositionScript = If(GetPrivateProfileInt(S_OPTIONS, K_USEDISPOSITIONSCRIPT, 0) <> 0, True, False)
+ ' Inizializzo variabili colori di sfondo scena e materiale default
+ Dim DefColor As New Color3d(0, 0, 0)
+ GetPrivateProfileColor(S_GEOMDB, K_DEFAULTCOLOR, DefColor)
+ Dim BackTopColor As New Color3d(192, 192, 192)
+ GetPrivateProfileColor(S_SCENE, K_BACKTOP, BackTopColor)
+ Dim BackBotColor As New Color3d(BackTopColor)
+ GetPrivateProfileColor(S_SCENE, K_BACKBOTTOM, BackBotColor)
+ m_TopSceneBackground = BackTopColor
+ m_BotSceneBackground = BackBotColor
+ m_DefMaterialColor = DefColor
End Sub
End Module
diff --git a/OptionsWindow/OptionWindowV.xaml b/OptionsWindow/OptionWindowV.xaml
index 9608602..063ef88 100644
--- a/OptionsWindow/OptionWindowV.xaml
+++ b/OptionsWindow/OptionWindowV.xaml
@@ -8,91 +8,146 @@
BorderBrush="{StaticResource EgaltechBlue1}"
WindowStyle="None" ResizeMode="NoResize" TitleBarHeight="30" IsResizable="False"
IsMinimizable="False" WindowStartupLocation="CenterScreen" ShowInTaskbar="False"
+ MinWidth="400" MinHeight="330"
+ Width="400" Height="330"
CloseCommand="{Binding CloseOptionsCommand,Mode=OneWay,UpdateSourceTrigger=PropertyChanged}">
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/OptionsWindow/OptionWindowVM.vb b/OptionsWindow/OptionWindowVM.vb
index cce61a2..9336354 100644
--- a/OptionsWindow/OptionWindowVM.vb
+++ b/OptionsWindow/OptionWindowVM.vb
@@ -2,6 +2,7 @@
Imports EgtUILib
Public Class OptionWindowVM
+ Inherits VMBase
Public ReadOnly Property LanguageList As ObservableCollection(Of Language)
Get
@@ -58,6 +59,50 @@ Public Class OptionWindowVM
End If
End Set
End Property
+ Public Property SelectedPocketingGeomType As SceneSelModeOpt
+ Get
+ Return OptionModule.m_SelGeomPocketing
+ End Get
+ Set(value As SceneSelModeOpt)
+ If WritePrivateProfileString(S_MACH, K_SELGEOMPOCKETING, CInt(value).ToString()) Then
+ OptionModule.m_SelGeomPocketing = value
+ End If
+ End Set
+ End Property
+ Public Property SelectedMortisingGeomType As SceneSelModeOpt
+ Get
+ Return OptionModule.m_SelGeomMortising
+ End Get
+ Set(value As SceneSelModeOpt)
+ If WritePrivateProfileString(S_MACH, K_SELGEOMMORTISING, CInt(value).ToString()) Then
+ OptionModule.m_SelGeomMortising = value
+ End If
+ End Set
+ End Property
+ Public Property SelectedChiselingGeomType As SceneSelModeOpt
+ Get
+ Return OptionModule.m_SelGeomChiseling
+ End Get
+ Set(value As SceneSelModeOpt)
+ If WritePrivateProfileString(S_MACH, K_SELGEOMCHISELING, CInt(value).ToString()) Then
+ OptionModule.m_SelGeomChiseling = value
+ End If
+ End Set
+ End Property
+
+ Public Property GeometryTolerance As String
+ Get
+ Return LenToString(m_GeometryTolerance, -3)
+ End Get
+ Set(value As String)
+ Dim dVal As Double = 0
+ If StringToLen(value, dVal) AndAlso dVal > 0 Then
+ m_GeometryTolerance = dVal
+ Map.refProjectVM.GetController.SetSurfTmTolerance(dVal)
+ WritePrivateProfileString(S_GEOMDB, K_SURFTMTOLER, DoubleToString(0.05, 3))
+ End If
+ End Set
+ End Property
Public Property NewMachiningIsLastOne As Boolean
Get
@@ -79,8 +124,38 @@ Public Class OptionWindowVM
End Set
End Property
+ Public ReadOnly Property TopSceneBackground As Brush
+ Get
+ Return New SolidColorBrush(Color.FromArgb(CByte(255),
+ CByte(m_TopSceneBackground.R),
+ CByte(m_TopSceneBackground.G),
+ CByte(m_TopSceneBackground.B)))
+ End Get
+ End Property
+
+ Public ReadOnly Property BotSceneBackground As Brush
+ Get
+ Return New SolidColorBrush(Color.FromArgb(CByte(255),
+ CByte(m_BotSceneBackground.R),
+ CByte(m_BotSceneBackground.G),
+ CByte(m_BotSceneBackground.B)))
+ End Get
+ End Property
+
+ Public ReadOnly Property DefMaterialColor As Brush
+ Get
+ Return New SolidColorBrush(Color.FromArgb(CByte(255),
+ CByte(m_DefMaterialColor.R),
+ CByte(m_DefMaterialColor.G),
+ CByte(m_DefMaterialColor.B)))
+ End Get
+ End Property
+
' Definizione comandi
Private m_cmdCloseOptions As ICommand
+ Private m_cmdTopSceneBackground As ICommand
+ Private m_cmdBotSceneBackground As ICommand
+ Private m_cmdDefMaterialColor As ICommand
#Region "Messages"
@@ -90,6 +165,22 @@ Public Class OptionWindowVM
End Get
End Property
+ Public ReadOnly Property GenericMsg As String
+ Get
+ Return EgtMsg(MSG_OPTIONPAGE + 14)
+ End Get
+ End Property
+ Public ReadOnly Property CADMsg As String
+ Get
+ Return EgtMsg(MSG_OPTIONPAGE + 15)
+ End Get
+ End Property
+ Public ReadOnly Property CAMMsg As String
+ Get
+ Return EgtMsg(MSG_OPTIONPAGE + 16)
+ End Get
+ End Property
+
Public ReadOnly Property CurrentLanguageMsg As String
Get
Return EgtMsg(MSG_OPTIONPAGE + 1)
@@ -120,7 +211,27 @@ Public Class OptionWindowVM
Return EgtMsg(MSG_MACHININGSDBPAGE + 2)
End Get
End Property
+ Public ReadOnly Property GeomTypePocketingMsg As String
+ Get
+ Return EgtMsg(MSG_MACHININGSDBPAGE + 4)
+ End Get
+ End Property
+ Public ReadOnly Property GeomTypeMortisingMsg As String
+ Get
+ Return EgtMsg(MSG_MACHININGSDBPAGE + 5)
+ End Get
+ End Property
+ Public ReadOnly Property GeomTypeChiselingMsg As String
+ Get
+ Return EgtMsg(MSG_MACHININGSDBPAGE + 9)
+ End Get
+ End Property
+ Public ReadOnly Property GeometryToleranceMsg As String
+ Get
+ Return EgtMsg(MSG_OPTIONPAGE + 13)
+ End Get
+ End Property
Public ReadOnly Property NewMachiningPosMsg As String
Get
Return EgtMsg(MSG_OPTIONPAGE + 7)
@@ -133,10 +244,144 @@ Public Class OptionWindowVM
End Get
End Property
+ Public ReadOnly Property TopSceneBackgroundMsg As String
+ Get
+ Return EgtMsg(MSG_OPTIONPAGE + 10)
+ End Get
+ End Property
+
+ Public ReadOnly Property BotSceneBackgroundMsg As String
+ Get
+ Return EgtMsg(MSG_OPTIONPAGE + 11)
+ End Get
+ End Property
+
+ Public ReadOnly Property DefMaterialColorMsg As String
+ Get
+ Return EgtMsg(MSG_OPTIONPAGE + 12)
+ End Get
+ End Property
+
#End Region
#Region "COMMANDS"
+#Region "TopSceneBackground"
+
+ '''
+ ''' Returns a command that remove the current selected machining.
+ '''
+ Public ReadOnly Property TopSceneBackground_Command() As ICommand
+ Get
+ If m_cmdTopSceneBackground Is Nothing Then
+ m_cmdTopSceneBackground = New RelayCommand(AddressOf TopSceneBackgroundCmd)
+ End If
+ Return m_cmdTopSceneBackground
+ End Get
+ End Property
+
+ '''
+ ''' Manage the MachiningDb closing. This method is invoked by the CloseMachiningDbCommand.
+ '''
+ Public Sub TopSceneBackgroundCmd()
+ Dim TopColorDialog As New System.Windows.Forms.ColorDialog
+ Dim BackTopColor As New Color3d(192, 192, 192)
+ GetPrivateProfileColor(S_SCENE, K_BACKTOP, BackTopColor)
+ TopColorDialog.Color = System.Drawing.Color.FromArgb(BackTopColor.A,
+ BackTopColor.R,
+ BackTopColor.B,
+ BackTopColor.G)
+ If TopColorDialog.ShowDialog() = Windows.Forms.DialogResult.OK Then
+ m_TopSceneBackground = New Color3d(TopColorDialog.Color.R,
+ TopColorDialog.Color.G,
+ TopColorDialog.Color.B,
+ TopColorDialog.Color.A)
+ Map.refProjectVM.GetScene.SetViewBackground(m_TopSceneBackground, m_BotSceneBackground)
+ WritePrivateProfileColor(S_SCENE, K_BACKTOP, m_TopSceneBackground)
+ NotifyPropertyChanged("TopSceneBackground")
+ End If
+ End Sub
+
+#End Region ' TopSceneBackground
+
+#Region "BotSceneBackground"
+
+ '''
+ ''' Returns a command that remove the current selected machining.
+ '''
+ Public ReadOnly Property BotSceneBackground_Command() As ICommand
+ Get
+ If m_cmdBotSceneBackground Is Nothing Then
+ m_cmdBotSceneBackground = New RelayCommand(AddressOf BotSceneBackgroundCmd)
+ End If
+ Return m_cmdBotSceneBackground
+ End Get
+ End Property
+
+ '''
+ ''' Manage the MachiningDb closing. This method is invoked by the CloseMachiningDbCommand.
+ '''
+ Public Sub BotSceneBackgroundCmd()
+ Dim BotColorDialog As New System.Windows.Forms.ColorDialog
+ Dim BackBotColor As New Color3d(192, 192, 192)
+ GetPrivateProfileColor(S_SCENE, K_BACKBOTTOM, BackBotColor)
+ BotColorDialog.Color = System.Drawing.Color.FromArgb(BackBotColor.A,
+ BackBotColor.R,
+ BackBotColor.B,
+ BackBotColor.G)
+ If BotColorDialog.ShowDialog() = Windows.Forms.DialogResult.OK Then
+ m_BotSceneBackground = New Color3d(BotColorDialog.Color.R,
+ BotColorDialog.Color.G,
+ BotColorDialog.Color.B,
+ BotColorDialog.Color.A)
+ Map.refProjectVM.GetScene.SetViewBackground(m_TopSceneBackground, m_BotSceneBackground)
+ WritePrivateProfileColor(S_SCENE, K_BACKBOTTOM, m_BotSceneBackground)
+ NotifyPropertyChanged("BotSceneBackground")
+ End If
+ End Sub
+
+#End Region ' BotSceneBackground
+
+#Region "DefMaterialColor"
+
+ '''
+ ''' Returns a command that remove the current selected machining.
+ '''
+ Public ReadOnly Property DefMaterialColor_Command() As ICommand
+ Get
+ If m_cmdDefMaterialColor Is Nothing Then
+ m_cmdDefMaterialColor = New RelayCommand(AddressOf DefMaterialColorCmd)
+ End If
+ Return m_cmdDefMaterialColor
+ End Get
+ End Property
+
+ '''
+ ''' Manage the MachiningDb closing. This method is invoked by the CloseMachiningDbCommand.
+ '''
+ Public Sub DefMaterialColorCmd()
+ Dim DefColorDialog As New System.Windows.Forms.ColorDialog
+ Dim DefColor As New Color3d(192, 192, 192)
+ GetPrivateProfileColor(S_GEOMDB, K_DEFAULTCOLOR, DefColor)
+ DefColorDialog.Color = System.Drawing.Color.FromArgb(DefColor.A,
+ DefColor.R,
+ DefColor.B,
+ DefColor.G)
+ If DefColorDialog.ShowDialog() = Windows.Forms.DialogResult.OK Then
+ m_DefMaterialColor = New Color3d(DefColorDialog.Color.R,
+ DefColorDialog.Color.G,
+ DefColorDialog.Color.B,
+ 100)
+ Map.refProjectVM.GetScene.SetDefaultMaterial(m_DefMaterialColor)
+ WritePrivateProfileColor(S_GEOMDB, K_DEFAULTCOLOR, m_DefMaterialColor)
+ Application.Msn.NotifyColleagues(Application.UPDATEHEADERCOLOR, m_DefMaterialColor)
+ Application.Msn.NotifyColleagues(Application.LOADOBJTREE)
+ NotifyPropertyChanged("DefMaterialColor")
+ End If
+ End Sub
+
+#End Region ' DefMaterialColor
+
#Region "CloseOptionsCommand"
'''
diff --git a/TopCommandBar/TopCommandBarVM.vb b/TopCommandBar/TopCommandBarVM.vb
index 23dfc5c..f7fcb88 100644
--- a/TopCommandBar/TopCommandBarVM.vb
+++ b/TopCommandBar/TopCommandBarVM.vb
@@ -447,8 +447,6 @@ Public Class TopCommandBarVM
'''
Public Sub Options(ByVal param As Object)
Dim OptionsWindow As New OptionWindowV
- OptionsWindow.Height = 614
- OptionsWindow.Width = 1024
OptionsWindow.DataContext = New OptionWindowVM
OptionsWindow.Owner = Application.Current.MainWindow
OptionsWindow.ShowDialog()
diff --git a/Utility/IniFile.vb b/Utility/IniFile.vb
index 5af11eb..baba10e 100644
--- a/Utility/IniFile.vb
+++ b/Utility/IniFile.vb
@@ -223,6 +223,11 @@ Public Module IniFile
Return EgtUILib.WritePrivateProfileWinPos(IpAppName, IpKeyName, nFlag, nLeft, nTop, nWidth, nHeight, m_sIniFile)
End Function
+ Public Function WritePrivateProfileColor(IpAppName As String, IpKeyName As String, ByRef Color As Color3d) As Boolean
+ Dim sColor As String = Color.R & "," & Color.G & "," & Color.B
+ Return EgtUILib.WritePrivateProfileString(IpAppName, IpKeyName, sColor, m_sIniFile)
+ End Function
+
Friend Function IsActiveDoors() As Boolean
Dim bIsActive As Boolean = (IniFile.m_nKeyOptions And KEY_OPT.DOORS) <> 0 And (GetPrivateProfileInt(S_DOORS, K_DDFENABLE, 0) <> 0)
If bIsActive Then