diff --git a/Application.xaml.vb b/Application.xaml.vb
index e17fbd5..e556d2e 100644
--- a/Application.xaml.vb
+++ b/Application.xaml.vb
@@ -167,7 +167,9 @@ Class Application
Friend Const MACHININGTREEVIEWEXPANDERISENABLED As String = "MachiningTreeViewExpanderIsEnabled"
Friend Const NEWMACHININGMODEISACTIVE As String = "NewMachiningModeIsActive"
Friend Const SIMULATIONEXPANDER_GET_ISEXPANDED As String = "Get_SimulationExpander_IsExpanded"
+ Friend Const ESTIMATIONEXPANDER_GET_ISEXPANDED As String = "Get_EstimationExpander_IsExpanded"
Friend Const SIMULATIONEXPANDER_SET_ISEXPANDED As String = "Set_SimulationExpander_IsExpanded"
+ Friend Const ESTIMATIONSEXPANDER_SET_ISEXPANDED As String = "Set_EstimationsExpander_IsExpanded"
Friend Const SIMULATIONEXPANDER_UPDATE_CNCDATA As String = "SimulationExpander_Update_CncData"
Friend Const CANCELOPERATIONCOMMAND As String = "CancelOperationCommand"
Friend Const UPDATEOPERATIONMACHININGLIST As String = "UpdateOperationMachiningList"
diff --git a/Constants/ConstIni.vb b/Constants/ConstIni.vb
index 2aa5519..060d7cf 100644
--- a/Constants/ConstIni.vb
+++ b/Constants/ConstIni.vb
@@ -71,6 +71,7 @@ Module ConstIni
Public Const K_ZOOMWIN As String = "ZoomWin"
Public Const K_DISTLINE As String = "DistLine"
Public Const K_MMUNITS As String = "MmUnits"
+ Public Const K_CUSTOMCOLORS As String = "CustomColors"
Public Const S_GRID As String = "Grid"
Public Const K_DRAWSHOWGRID As String = "DrawShowGrid"
diff --git a/Constants/ConstMachIni.vb b/Constants/ConstMachIni.vb
index b2c7144..1ef8ad4 100644
--- a/Constants/ConstMachIni.vb
+++ b/Constants/ConstMachIni.vb
@@ -57,4 +57,6 @@
Public Const S_VMILL As String = "VMill"
Public Const K_VM_ENABLE As String = "Enable"
+ Public Const S_ESTIMATIONS As String = "Estimations"
+
End Module
diff --git a/EgtCAM5.vbproj b/EgtCAM5.vbproj
index 910699e..a1e20bb 100644
--- a/EgtCAM5.vbproj
+++ b/EgtCAM5.vbproj
@@ -151,6 +151,10 @@
+
+ EstimationsDetailsWndV.xaml
+
+ SelMachGroupWndV.xaml
@@ -326,6 +330,10 @@
DesignerMSBuild:Compile
+
+ Designer
+ MSBuild:Compile
+ DesignerMSBuild:Compile
diff --git a/EstimationsDetailsWnd/EstimationsDetailsWndV.xaml b/EstimationsDetailsWnd/EstimationsDetailsWndV.xaml
new file mode 100644
index 0000000..833abd1
--- /dev/null
+++ b/EstimationsDetailsWnd/EstimationsDetailsWndV.xaml
@@ -0,0 +1,14 @@
+
+
+
+
+
diff --git a/EstimationsDetailsWnd/EstimationsDetailsWndV.xaml.vb b/EstimationsDetailsWnd/EstimationsDetailsWndV.xaml.vb
new file mode 100644
index 0000000..61cd0fc
--- /dev/null
+++ b/EstimationsDetailsWnd/EstimationsDetailsWndV.xaml.vb
@@ -0,0 +1,42 @@
+Imports EgtWPFLib5
+
+Public Class EstimationsDetailsWndV
+
+ Private m_EstimationsDetailsWndVM As EstimationsDetailsWndVM
+
+#Region "CONSTRUCTOR"
+
+ Sub New(Owner As Window, EstimationsDetailsWndVM As EstimationsDetailsWndVM)
+ ' Funzione che interpreta l'xaml
+ InitializeComponent()
+ Me.Owner = Owner
+ Me.DataContext = EstimationsDetailsWndVM
+ ' Assegno al riferimento locale al VM il VM preso dal DataContext
+ m_EstimationsDetailsWndVM = EstimationsDetailsWndVM
+ EstimationsWebBrowser.Navigate(New Uri(m_EstimationsDetailsWndVM.FileName))
+ End Sub
+
+#End Region ' CONSTRUCTOR
+
+#Region "EVENTS"
+
+ Private Sub MainWindowV_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
+ ' Carico e imposto posizione finestra
+ WinPosFromIniToWindow(S_ESTIMATIONS, K_WINPLACE, Me, IniFile.m_sCurrMachIniFilePath)
+ End Sub
+
+ Private Sub MainWindowV_Unloaded(sender As Object, e As System.ComponentModel.CancelEventArgs) Handles Me.Closing
+ ' Salvo posizione finestra
+ If WindowState <> WindowState.Minimized Then
+ WinPosFromWindowToIni(Me, S_ESTIMATIONS, K_WINPLACE, IniFile.m_sCurrMachIniFilePath)
+ End If
+ End Sub
+
+
+ Private Sub Me_Closing(sender As Object, e As System.ComponentModel.CancelEventArgs) Handles Me.Closing
+ EstimationsWebBrowser.Dispose()
+ End Sub
+
+#End Region ' EVENTS
+
+End Class
diff --git a/EstimationsDetailsWnd/EstimationsDetailsWndVM.vb b/EstimationsDetailsWnd/EstimationsDetailsWndVM.vb
new file mode 100644
index 0000000..33c927b
--- /dev/null
+++ b/EstimationsDetailsWnd/EstimationsDetailsWndVM.vb
@@ -0,0 +1,43 @@
+Imports EgtUILib
+
+Public Class EstimationsDetailsWndVM
+ Inherits VMBase
+
+#Region "FIELDS & PROPERTIES"
+
+ Private m_FileName As String
+ Public ReadOnly Property FileName As String
+ Get
+ Return m_FileName
+ End Get
+ End Property
+
+#Region "Messages"
+
+ Public ReadOnly Property TitleMsg As String
+ Get
+ Return EgtMsg(MSG_SIMULATION + 42)
+ End Get
+ End Property
+
+#End Region ' Messages
+
+ ' Definizione comandi
+ Private m_cmdOk As ICommand
+ Private m_cmdCancel As ICommand
+
+#End Region 'FIELDS & PROPERTIES
+
+#Region "CONSTRUCTOR"
+
+ Sub New(FileName As String)
+ m_FileName = FileName
+ End Sub
+
+#End Region ' CONSTRUCTOR
+
+#Region "METHODS"
+
+#End Region ' METHODS
+
+End Class
diff --git a/My Project/AssemblyInfo.vb b/My Project/AssemblyInfo.vb
index 12363e4..db585fd 100644
--- a/My Project/AssemblyInfo.vb
+++ b/My Project/AssemblyInfo.vb
@@ -70,5 +70,5 @@ Imports System.Windows
' by using the '*' as shown below:
'
-
-
+
+
diff --git a/OptionPanel/MachiningOptionPanel/OperationExpander/OperationExpanderVM.vb b/OptionPanel/MachiningOptionPanel/OperationExpander/OperationExpanderVM.vb
index 5d1ad27..b1bd187 100644
--- a/OptionPanel/MachiningOptionPanel/OperationExpander/OperationExpanderVM.vb
+++ b/OptionPanel/MachiningOptionPanel/OperationExpander/OperationExpanderVM.vb
@@ -60,6 +60,7 @@ Public Class OperationExpanderVM
OPERATIONLIST
OPERATIONPARAMETERS
SIMULATION
+ ESTIMATIONS
End Enum
Private m_OperViewIsEnabled As Boolean = True
@@ -86,6 +87,8 @@ Public Class OperationExpanderVM
ParametersIsExpanded = False
ElseIf m_CurrExpandedExpander = MachiningOptionPanelExpander.SIMULATION Then
Application.Msn.NotifyColleagues(Application.SIMULATIONEXPANDER_SET_ISEXPANDED, False)
+ ElseIf m_CurrExpandedExpander = MachiningOptionPanelExpander.ESTIMATIONS Then
+ Application.Msn.NotifyColleagues(Application.ESTIMATIONSEXPANDER_SET_ISEXPANDED, False)
End If
m_CurrExpandedExpander = MachiningOptionPanelExpander.OPERATIONLIST
End If
@@ -108,6 +111,9 @@ Public Class OperationExpanderVM
ElseIf m_CurrExpandedExpander = MachiningOptionPanelExpander.SIMULATION Then
m_CurrExpandedExpander = MachiningOptionPanelExpander.OPERATIONPARAMETERS
Application.Msn.NotifyColleagues(Application.SIMULATIONEXPANDER_SET_ISEXPANDED, False)
+ ElseIf m_CurrExpandedExpander = MachiningOptionPanelExpander.ESTIMATIONS Then
+ m_CurrExpandedExpander = MachiningOptionPanelExpander.OPERATIONPARAMETERS
+ Application.Msn.NotifyColleagues(Application.ESTIMATIONSEXPANDER_SET_ISEXPANDED, False)
End If
m_CurrExpandedExpander = MachiningOptionPanelExpander.OPERATIONPARAMETERS
If IsValidDispositionType(SelectedOperation.m_Type) Then
@@ -428,6 +434,24 @@ Public Class OperationExpanderVM
SelectedOperation = CurrSelectedOperation
End If
End Sub)
+ Application.Msn.Register(Application.ESTIMATIONEXPANDER_GET_ISEXPANDED, Sub(bValue As Boolean)
+ If m_CurrExpandedExpander = MachiningOptionPanelExpander.ESTIMATIONS Then
+ ListIsExpanded = True
+ End If
+ If bValue Then
+ If m_NewMachining Then EndNewMachining(GDB_ID.NULL)
+ ListIsExpanded = False
+ ParametersIsExpanded = False
+ m_CurrExpandedExpander = MachiningOptionPanelExpander.ESTIMATIONS
+ Else
+ ' Deseleziono e riseleziono la lavorazione corrente per fargli riselezionare la geometria
+ ' di lavorazione che è stata deselezionata dalla simulazione
+ Dim CurrSelectedOperation As OperationListBoxItem
+ CurrSelectedOperation = SelectedOperation
+ SelectedOperation = Nothing
+ SelectedOperation = CurrSelectedOperation
+ End If
+ End Sub)
Application.Msn.Register(Application.DRAWMODE_ISCHECKED, Sub()
' Annullo creazione nuova lavorazione
If m_NewMachining Then EndNewMachining(GDB_ID.NULL)
diff --git a/OptionPanel/MachiningOptionPanel/SimulationExpander/SimulationExpanderView.xaml b/OptionPanel/MachiningOptionPanel/SimulationExpander/SimulationExpanderView.xaml
index 6ee513d..06aed4e 100644
--- a/OptionPanel/MachiningOptionPanel/SimulationExpander/SimulationExpanderView.xaml
+++ b/OptionPanel/MachiningOptionPanel/SimulationExpander/SimulationExpanderView.xaml
@@ -101,6 +101,38 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/OptionPanel/MachiningOptionPanel/SimulationExpander/SimulationExpanderViewModel.vb b/OptionPanel/MachiningOptionPanel/SimulationExpander/SimulationExpanderViewModel.vb
index f18f648..398c483 100644
--- a/OptionPanel/MachiningOptionPanel/SimulationExpander/SimulationExpanderViewModel.vb
+++ b/OptionPanel/MachiningOptionPanel/SimulationExpander/SimulationExpanderViewModel.vb
@@ -67,6 +67,7 @@ Public Class SimulationExpanderVM
End If
InitializeSimulation()
EgtDraw()
+ Estimation_IsExpanded = False
Else
If m_bSimExecuting Then Return
CloseSimulation()
@@ -83,6 +84,30 @@ Public Class SimulationExpanderVM
End If
End Set
End Property
+
+ Private m_Estimation_IsExpanded As Boolean
+ Public Property Estimation_IsExpanded As Boolean
+ Get
+ Return m_Estimation_IsExpanded
+ End Get
+ Set(value As Boolean)
+ If value <> m_Estimation_IsExpanded Then
+ If value Then
+ EgtDeselectAll()
+ Application.Msn.NotifyColleagues(Application.REMOVEMARKFROMLASTOPERATION)
+ Application.Msn.NotifyColleagues(Application.GETDISTANCE_ISCHECKED, False)
+ OnPropertyChanged("TotalTime")
+ OnPropertyChanged("TotalLength")
+ IsExpanded = False
+ End If
+ m_Estimation_IsExpanded = value
+ Application.Msn.NotifyColleagues(Application.ESTIMATIONEXPANDER_GET_ISEXPANDED, value)
+ OnPropertyChanged("Estimation_IsExpanded")
+ OnPropertyChanged("GenerateIsEnabled")
+ End If
+ End Set
+ End Property
+
Public ReadOnly Property GenerateIsEnabled As Boolean
Get
Return Not m_IsExpanded
@@ -241,11 +266,35 @@ Public Class SimulationExpanderVM
End Set
End Property
+ Public ReadOnly Property TotalTime As String
+ Get
+ Dim nTotalTime As Integer = 0
+ EgtGetInfo(EgtGetCurrMachGroup(), "Ttot", nTotalTime)
+ Dim sTotalTime As New TimeSpan(0, 0, nTotalTime)
+ Return sTotalTime.ToString("hh\:mm\:ss")
+ End Get
+ End Property
+
+ Public ReadOnly Property TotalLength As String
+ Get
+ Dim dTotalLength As Double = 0
+ EgtGetInfo(EgtGetCurrMachGroup(), "Ltot", dTotalLength)
+ Dim sTotalLength As String = ""
+ If EgtUiUnitsAreMM() Then
+ sTotalLength = DoubleToString(dTotalLength / 1000, 1) & " m"
+ Else
+ sTotalLength = DoubleToString(dTotalLength / (ONEINCH * 12), 1) & " ft"
+ End If
+ Return sTotalLength
+ End Get
+ End Property
+
' Definizione comandi
Private m_cmdStep As ICommand
Private m_cmdPlayPause As ICommand
Private m_cmdStop As ICommand
Private m_cmdGenerate As ICommand
+ Private m_cmdDetails As ICommand
#Region "Messages"
@@ -261,6 +310,29 @@ Public Class SimulationExpanderVM
End Get
End Property
+ Public ReadOnly Property EstimationMsg As String
+ Get
+ Return EgtMsg(MSG_SIMULATION + 40) 'Stime
+ End Get
+ End Property
+
+ Public ReadOnly Property TotalTimeMsg As String
+ Get
+ Return EgtMsg(MSG_SIMULATION + 41) 'Tempo totale
+ End Get
+ End Property
+
+ Public ReadOnly Property TotalLengthMsg As String
+ Get
+ Return EgtMsg(MSG_SIMULATION + 42) 'Lunghezza totale
+ End Get
+ End Property
+ Public ReadOnly Property DetailsMsg As String
+ Get
+ Return EgtMsg(MSG_SIMULATION + 43) 'Dettagli
+ End Get
+ End Property
+
Public ReadOnly Property VMillMsg As String
Get
Return EgtMsg(MSG_SIMULATION + 16) 'Virtual Milling
@@ -302,6 +374,9 @@ Public Class SimulationExpanderVM
Application.Msn.Register(Application.SIMULATIONEXPANDER_SET_ISEXPANDED, Sub(bValue As Boolean)
IsExpanded = bValue
End Sub)
+ Application.Msn.Register(Application.ESTIMATIONSEXPANDER_SET_ISEXPANDED, Sub(bValue As Boolean)
+ Estimation_IsExpanded = bValue
+ End Sub)
Application.Msn.Register(Application.SIMULATIONEXPANDER_UPDATE_CNCDATA, Sub()
If IsExpanded Then
ShowCncData()
@@ -515,6 +590,30 @@ Public Class SimulationExpanderVM
#End Region ' GenerateCommand
+#Region "Details"
+
+ '''
+ ''' Returns a command that create a new tool.
+ '''
+ Public ReadOnly Property Details_Command As ICommand
+ Get
+ If m_cmdDetails Is Nothing Then
+ m_cmdDetails = New RelayCommand(AddressOf Details)
+ End If
+ Return m_cmdDetails
+ End Get
+ End Property
+
+ '''
+ ''' Creata the new tool. This method is invoked by the NewCommand.
+ '''
+ Public Sub Details(ByVal param As Object)
+ Dim EstimationsWnd As New EstimationsDetailsWndV(Application.Current.MainWindow, New EstimationsDetailsWndVM("c:\Temp\0088_Mach01.html"))
+ EstimationsWnd.ShowDialog()
+ End Sub
+
+#End Region ' Details
+
#End Region
#Region "METHODS"
diff --git a/OptionPanel/OptionPanelVM.vb b/OptionPanel/OptionPanelVM.vb
index 8711fa2..55d2764 100644
--- a/OptionPanel/OptionPanelVM.vb
+++ b/OptionPanel/OptionPanelVM.vb
@@ -82,6 +82,7 @@ Public Class OptionPanelVM
m_DrawIsChecked = True
m_MachiningIsChecked = False
Application.Msn.NotifyColleagues(Application.SIMULATIONEXPANDER_SET_ISEXPANDED, False)
+ Application.Msn.NotifyColleagues(Application.ESTIMATIONSEXPANDER_SET_ISEXPANDED, False)
OnPropertyChanged("ManageLayerExpander")
OnPropertyChanged("InfoExpander")
OnPropertyChanged("InputExpander")
diff --git a/OptionsWindow/OptionWindowVM.vb b/OptionsWindow/OptionWindowVM.vb
index b79dfc4..3c17d6b 100644
--- a/OptionsWindow/OptionWindowVM.vb
+++ b/OptionsWindow/OptionWindowVM.vb
@@ -287,10 +287,22 @@ Public Class OptionWindowVM
Dim TopColorDialog As New System.Windows.Forms.ColorDialog
Dim BackTopColor As New Color3d(192, 192, 192)
GetPrivateProfileColor(S_SCENE, K_BACKTOP, BackTopColor)
+ TopColorDialog.FullOpen = True
+ Dim sCustomColors As String = ""
+ GetPrivateProfileString(S_SCENE, K_CUSTOMCOLORS, "", sCustomColors)
+ Dim CustomColors() As String = sCustomColors.Split(","c)
+ Dim nCustomColors As New List(Of Integer)
+ For Each Color In CustomColors
+ Dim nColor As Integer
+ If Integer.TryParse(Color, nColor) Then
+ nCustomColors.Add(nColor)
+ End If
+ Next
+ TopColorDialog.CustomColors = nCustomColors.ToArray()
TopColorDialog.Color = System.Drawing.Color.FromArgb(BackTopColor.A,
- BackTopColor.R,
- BackTopColor.G,
- BackTopColor.B)
+ BackTopColor.R,
+ BackTopColor.G,
+ BackTopColor.B)
If TopColorDialog.ShowDialog() = Windows.Forms.DialogResult.OK Then
m_TopSceneBackground = New Color3d(TopColorDialog.Color.R,
TopColorDialog.Color.G,
@@ -298,6 +310,12 @@ Public Class OptionWindowVM
TopColorDialog.Color.A)
Map.refProjectVM.GetScene.SetViewBackground(m_TopSceneBackground, m_BotSceneBackground)
WritePrivateProfileColor(S_SCENE, K_BACKTOP, m_TopSceneBackground)
+ sCustomColors = ""
+ For Each Color In TopColorDialog.CustomColors
+ sCustomColors &= Color & ", "
+ Next
+ sCustomColors.Trim({" "c, ","c})
+ WritePrivateProfileString(S_SCENE, K_CUSTOMCOLORS, sCustomColors)
NotifyPropertyChanged("TopSceneBackground")
End If
End Sub
@@ -325,10 +343,22 @@ Public Class OptionWindowVM
Dim BotColorDialog As New System.Windows.Forms.ColorDialog
Dim BackBotColor As New Color3d(192, 192, 192)
GetPrivateProfileColor(S_SCENE, K_BACKBOTTOM, BackBotColor)
+ BotColorDialog.FullOpen = True
+ Dim sCustomColors As String = ""
+ GetPrivateProfileString(S_SCENE, K_CUSTOMCOLORS, "", sCustomColors)
+ Dim CustomColors() As String = sCustomColors.Split(","c)
+ Dim nCustomColors As New List(Of Integer)
+ For Each Color In CustomColors
+ Dim nColor As Integer
+ If Integer.TryParse(Color, nColor) Then
+ nCustomColors.Add(nColor)
+ End If
+ Next
+ BotColorDialog.CustomColors = nCustomColors.ToArray()
BotColorDialog.Color = System.Drawing.Color.FromArgb(BackBotColor.A,
- BackBotColor.R,
- BackBotColor.G,
- BackBotColor.B)
+ BackBotColor.R,
+ BackBotColor.G,
+ BackBotColor.B)
If BotColorDialog.ShowDialog() = Windows.Forms.DialogResult.OK Then
m_BotSceneBackground = New Color3d(BotColorDialog.Color.R,
BotColorDialog.Color.G,
@@ -336,6 +366,12 @@ Public Class OptionWindowVM
BotColorDialog.Color.A)
Map.refProjectVM.GetScene.SetViewBackground(m_TopSceneBackground, m_BotSceneBackground)
WritePrivateProfileColor(S_SCENE, K_BACKBOTTOM, m_BotSceneBackground)
+ sCustomColors = ""
+ For Each Color In BotColorDialog.CustomColors
+ sCustomColors &= Color & ", "
+ Next
+ sCustomColors.Trim({" "c, ","c})
+ WritePrivateProfileString(S_SCENE, K_CUSTOMCOLORS, sCustomColors)
NotifyPropertyChanged("BotSceneBackground")
End If
End Sub
@@ -363,6 +399,18 @@ Public Class OptionWindowVM
Dim DefColorDialog As New System.Windows.Forms.ColorDialog
Dim DefColor As New Color3d(192, 192, 192)
GetPrivateProfileColor(S_GEOMDB, K_DEFAULTCOLOR, DefColor)
+ DefColorDialog.FullOpen = True
+ Dim sCustomColors As String = ""
+ GetPrivateProfileString(S_SCENE, K_CUSTOMCOLORS, "", sCustomColors)
+ Dim CustomColors() As String = sCustomColors.Split(","c)
+ Dim nCustomColors As New List(Of Integer)
+ For Each Color In CustomColors
+ Dim nColor As Integer
+ If Integer.TryParse(Color, nColor) Then
+ nCustomColors.Add(nColor)
+ End If
+ Next
+ DefColorDialog.CustomColors = nCustomColors.ToArray()
DefColorDialog.Color = System.Drawing.Color.FromArgb(DefColor.A,
DefColor.R,
DefColor.G,
@@ -374,6 +422,13 @@ Public Class OptionWindowVM
100)
Map.refProjectVM.GetScene.SetDefaultMaterial(m_DefMaterialColor)
WritePrivateProfileColor(S_GEOMDB, K_DEFAULTCOLOR, m_DefMaterialColor)
+ sCustomColors = ""
+ For Each Color In DefColorDialog.CustomColors
+ sCustomColors &= Color & ", "
+ Next
+ sCustomColors.Trim({" "c, ","c})
+ WritePrivateProfileString(S_SCENE, K_CUSTOMCOLORS, sCustomColors)
+ EgtDraw()
Application.Msn.NotifyColleagues(Application.UPDATEHEADERCOLOR, m_DefMaterialColor)
Application.Msn.NotifyColleagues(Application.LOADOBJTREE)
NotifyPropertyChanged("DefMaterialColor")