diff --git a/Application.xaml.vb b/Application.xaml.vb
index e13c6b6..579098c 100644
--- a/Application.xaml.vb
+++ b/Application.xaml.vb
@@ -64,6 +64,7 @@ Class Application
Friend Const ISOVIEWSE As String = "IsoViewSE"
Friend Const ISOVIEWNE As String = "IsoViewNE"
Friend Const ISOVIEWNW As String = "IsoViewNW"
+ Friend Const VIEWTOCPLANE As String = "ViewToCPlane"
Friend Const SETSTATUSANALYZE As String = "SetStatusAnalyze"
Friend Const RESETSTATUSANALYZE As String = "ResetStatusAnalyze"
Friend Const SETSTATUSGETDISTANCE As String = "SetStatusGetDistance"
@@ -150,6 +151,11 @@ Class Application
Friend Const RIGHTCLICKEDLAYERTREEITEM As String = "RightClickedLayerTreeItem"
Friend Const SAVEOBJECT As String = "SaveObject"
Friend Const REMOVEMARKFROMLASTOPERATION As String = "RemoveMarkFromLastOperation"
+ Friend Const SELECTEDOPERATION As String = "SelectedOperation"
+
+ ' MachiningOptionPanel
+ ' MachiningTreeViewExpander
+ Friend Const MACHININGTREEVIEWEXPANDERISENABLED As String = "MachiningTreeViewExpanderIsEnabled"
' StatusBar messages
Friend Const STATUSGRIDCOMMAND As String = "StatusGridCommand"
diff --git a/EgtCAM5.vbproj b/EgtCAM5.vbproj
index 5fc63cf..802207d 100644
--- a/EgtCAM5.vbproj
+++ b/EgtCAM5.vbproj
@@ -148,10 +148,10 @@
-
+ DrawOptionPanelView.xaml
-
+ InfoExpanderView.xaml
@@ -160,15 +160,13 @@
InputExpanderView.xaml
-
- MachiningTreeExpanderView.xaml
- ManageLayerExpanderView.xaml
+ OperationExpanderView.xaml
@@ -239,7 +237,7 @@
DesignerMSBuild:Compile
-
+ DesignerMSBuild:Compile
@@ -251,14 +249,14 @@
DesignerMSBuild:Compile
-
- Designer
- MSBuild:Compile
- DesignerMSBuild:Compile
+
+ MSBuild:Compile
+ Designer
+ DesignerMSBuild:Compile
diff --git a/ProjectPage/GridViewPanel/GridViewPanelView.xaml b/ProjectPage/GridViewPanel/GridViewPanelView.xaml
index fe8ff64..3b36ce9 100644
--- a/ProjectPage/GridViewPanel/GridViewPanelView.xaml
+++ b/ProjectPage/GridViewPanel/GridViewPanelView.xaml
@@ -49,6 +49,9 @@
+
diff --git a/ProjectPage/GridViewPanel/GridViewPanelViewModel.vb b/ProjectPage/GridViewPanel/GridViewPanelViewModel.vb
index b21694e..e58d0c2 100644
--- a/ProjectPage/GridViewPanel/GridViewPanelViewModel.vb
+++ b/ProjectPage/GridViewPanel/GridViewPanelViewModel.vb
@@ -160,6 +160,11 @@ Namespace EgtCAM5
Return EgtMsg(MSG_GRIDVIEWPANEL + 15)
End Get
End Property
+ Public ReadOnly Property ViewToCPlaneToolTip As String
+ Get
+ Return EgtMsg(MSG_GRIDVIEWPANEL + 32)
+ End Get
+ End Property
'Proprietà ToolTip
Public ReadOnly Property CurveDirToolTip As String
Get
@@ -273,6 +278,7 @@ Namespace EgtCAM5
Private m_cmdIsoViewSE As ICommand
Private m_cmdIsoViewNE As ICommand
Private m_cmdIsoViewNW As ICommand
+ Private m_cmdViewToCPlane As ICommand
Private m_cmdCurveDir As ICommand
Private m_cmdAnalyze As ICommand
Private m_cmdGetDist As ICommand
@@ -740,95 +746,35 @@ Namespace EgtCAM5
#End Region ' IsoViewNWCommand
- '#Region "CurveDirCommand"
+#Region "ViewToCPlaneCommand"
- ' '''
- ' ''' Returns a command that do CurveDir.
- ' '''
- ' Public ReadOnly Property CurveDirCommand As ICommand
- ' Get
- ' If m_cmdCurveDir Is Nothing Then
- ' m_cmdCurveDir = New RelayCommand(AddressOf CurveDir, AddressOf CanCurveDir)
- ' End If
- ' Return m_cmdCurveDir
- ' End Get
- ' End Property
+ '''
+ ''' Returns a command that do GetDist.
+ '''
+ Public ReadOnly Property ViewToCPlaneCommand As ICommand
+ Get
+ If m_cmdViewToCPlane Is Nothing Then
+ m_cmdViewToCPlane = New RelayCommand(AddressOf ViewToCPlane, AddressOf CanViewToCPlane)
+ End If
+ Return m_cmdViewToCPlane
+ End Get
+ End Property
- ' '''
- ' ''' Execute the CurveDir. This method is invoked by the CurveDirCommand.
- ' '''
- ' Public Sub CurveDir(ByVal param As Object)
- ' Application.Msn.NotifyColleagues(Application.CURVEDIR)
- ' End Sub
+ '''
+ ''' Execute the GetDist. This method is invoked by the GetDistCommand.
+ '''
+ Public Sub ViewToCPlane(ByVal param As Object)
+ Application.Msn.NotifyColleagues(Application.VIEWTOCPLANE)
+ End Sub
- ' '''
- ' ''' Returns always true.
- ' '''
- ' Private Function CanCurveDir(ByVal param As Object) As Boolean
- ' Return True
- ' End Function
+ '''
+ ''' Returns always true.
+ '''
+ Private Function CanViewToCPlane(ByVal param As Object) As Boolean
+ Return True
+ End Function
- '#End Region ' CurveDirCommand
-
- '#Region "AnalyzeCommand"
-
- ' '''
- ' ''' Returns a command that do Analyze.
- ' '''
- ' Public ReadOnly Property AnalyzeCommand As ICommand
- ' Get
- ' If m_cmdAnalyze Is Nothing Then
- ' m_cmdAnalyze = New RelayCommand(AddressOf Analyze, AddressOf CanAnalyze)
- ' End If
- ' Return m_cmdAnalyze
- ' End Get
- ' End Property
-
- ' '''
- ' ''' Execute the Analyze. This method is invoked by the AnalyzeCommand.
- ' '''
- ' Public Sub Analyze(ByVal param As Object)
- ' Application.Msn.NotifyColleagues(Application.ANALYZE)
- ' End Sub
-
- ' '''
- ' ''' Returns always true.
- ' '''
- ' Private Function CanAnalyze(ByVal param As Object) As Boolean
- ' Return True
- ' End Function
-
- '#End Region ' AnalyzeCommand
-
- '#Region "GetDistCommand"
-
- ' '''
- ' ''' Returns a command that do GetDist.
- ' '''
- ' Public ReadOnly Property GetDistCommand As ICommand
- ' Get
- ' If m_cmdGetDist Is Nothing Then
- ' m_cmdGetDist = New RelayCommand(AddressOf GetDist, AddressOf CanGetDist)
- ' End If
- ' Return m_cmdGetDist
- ' End Get
- ' End Property
-
- ' '''
- ' ''' Execute the GetDist. This method is invoked by the GetDistCommand.
- ' '''
- ' Public Sub GetDist(ByVal param As Object)
- ' Application.Msn.NotifyColleagues(Application.GETDIST)
- ' End Sub
-
- ' '''
- ' ''' Returns always true.
- ' '''
- ' Private Function CanGetDist(ByVal param As Object) As Boolean
- ' Return True
- ' End Function
-
- '#End Region ' GetDistCommand
+#End Region ' ViewToCPlaneCommand
#Region "CPlaneTopCommand"
diff --git a/ProjectPage/OptionPanel/DrawOptionPanel/DrawOptionPanelView.xaml b/ProjectPage/OptionPanel/DrawOptionPanelView.xaml
similarity index 100%
rename from ProjectPage/OptionPanel/DrawOptionPanel/DrawOptionPanelView.xaml
rename to ProjectPage/OptionPanel/DrawOptionPanelView.xaml
diff --git a/ProjectPage/OptionPanel/DrawOptionPanel/DrawOptionPanelView.xaml.vb b/ProjectPage/OptionPanel/DrawOptionPanelView.xaml.vb
similarity index 100%
rename from ProjectPage/OptionPanel/DrawOptionPanel/DrawOptionPanelView.xaml.vb
rename to ProjectPage/OptionPanel/DrawOptionPanelView.xaml.vb
diff --git a/ProjectPage/OptionPanel/DrawOptionPanel/DrawOptionPanelViewModel.vb b/ProjectPage/OptionPanel/DrawOptionPanelViewModel.vb
similarity index 100%
rename from ProjectPage/OptionPanel/DrawOptionPanel/DrawOptionPanelViewModel.vb
rename to ProjectPage/OptionPanel/DrawOptionPanelViewModel.vb
diff --git a/ProjectPage/OptionPanel/MachiningOptionPanel/MachiningsTreeViewExpander/MachiningTreeExpanderView.xaml b/ProjectPage/OptionPanel/MachiningOptionPanel/MachiningsTreeViewExpander/MachiningTreeExpanderView.xaml
index fac5732..ae6a7dd 100644
--- a/ProjectPage/OptionPanel/MachiningOptionPanel/MachiningsTreeViewExpander/MachiningTreeExpanderView.xaml
+++ b/ProjectPage/OptionPanel/MachiningOptionPanel/MachiningsTreeViewExpander/MachiningTreeExpanderView.xaml
@@ -1,10 +1,66 @@
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:interactivity="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
+ xmlns:local="clr-namespace:EgtCAM5">
-
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/ProjectPage/OptionPanel/MachiningOptionPanel/MachiningsTreeViewExpander/MachiningTreeExpanderView.xaml.vb b/ProjectPage/OptionPanel/MachiningOptionPanel/MachiningsTreeViewExpander/MachiningTreeExpanderView.xaml.vb
deleted file mode 100644
index 492f63d..0000000
--- a/ProjectPage/OptionPanel/MachiningOptionPanel/MachiningsTreeViewExpander/MachiningTreeExpanderView.xaml.vb
+++ /dev/null
@@ -1,3 +0,0 @@
-Public Class MachiningTreeExpanderView
-
-End Class
diff --git a/ProjectPage/OptionPanel/MachiningOptionPanel/MachiningsTreeViewExpander/MachiningTreeExpanderViewModel.vb b/ProjectPage/OptionPanel/MachiningOptionPanel/MachiningsTreeViewExpander/MachiningTreeExpanderViewModel.vb
index a39dc21..f36579c 100644
--- a/ProjectPage/OptionPanel/MachiningOptionPanel/MachiningsTreeViewExpander/MachiningTreeExpanderViewModel.vb
+++ b/ProjectPage/OptionPanel/MachiningOptionPanel/MachiningsTreeViewExpander/MachiningTreeExpanderViewModel.vb
@@ -1,6 +1,184 @@
-Namespace EgtCAM5
+Imports System.Collections.ObjectModel
+Imports EgtUILib
+
+Namespace EgtCAM5
Public Class MachiningTreeExpanderViewModel
+ Inherits ViewModelBase
+
+#Region "FIELDS & PROPERTIES"
+
+ Private m_IsEnabled As Boolean
+ Public Property IsEnabled As Boolean
+ Get
+ Return m_IsEnabled
+ End Get
+ Set(value As Boolean)
+ If value <> m_IsEnabled Then
+ m_IsEnabled = value
+ OnPropertyChanged("IsEnabled")
+ End If
+ End Set
+ End Property
+
+ ' Lista delle lavorazioni
+ Private m_MachiningsList As New ObservableCollection(Of FamilyMachiningTreeViewExpanderItem)
+ Public Property MachiningsList As ObservableCollection(Of FamilyMachiningTreeViewExpanderItem)
+ Get
+ Return m_MachiningsList
+ End Get
+ Set(value As ObservableCollection(Of FamilyMachiningTreeViewExpanderItem))
+ m_MachiningsList = value
+ End Set
+ End Property
+
+ ' Definizione comandi
+ Private m_cmdTreeViewDoubleClick As ICommand
+
+#End Region
+
+#Region "CONSTRUCTOR"
+
+ Sub New()
+ ' Per caricare l'albero la prima volta che viene aperto
+ IsEnabled = False
+ LoadSelectedMachineMachinings()
+ Application.Msn.Register(Application.PROJECTPAGE_MACHININGMODE, Sub()
+ m_MachiningsList.Clear()
+ LoadSelectedMachineMachinings()
+ End Sub)
+ Application.Msn.Register(Application.MACHININGTREEVIEWEXPANDERISENABLED, Sub(bValue As Boolean)
+ IsEnabled = bValue
+ End Sub)
+ End Sub
+
+#End Region
+
+#Region "COMMANDS"
+
+#Region "TreeViewDoubleClickCommand"
+
+ '''
+ ''' Returns a command that do TreeViewDoubleClick.
+ '''
+ Public ReadOnly Property TreeViewDoubleClickCommand As ICommand
+ Get
+ If m_cmdTreeViewDoubleClick Is Nothing Then
+ m_cmdTreeViewDoubleClick = New RelayCommand(AddressOf TreeViewDoubleClick, AddressOf CanTreeViewDoubleClick)
+ End If
+ Return m_cmdTreeViewDoubleClick
+ End Get
+ End Property
+
+ '''
+ ''' Execute the TreeViewDoubleClick. This method is invoked by the TreeViewDoubleClickCommand.
+ '''
+ Public Sub TreeViewDoubleClick(ByVal param As Object)
+ If TypeOf param Is MachiningTreeViewExpanderItem Then
+ Dim Machining As MachiningTreeViewExpanderItem = DirectCast(param, MachiningTreeViewExpanderItem)
+ Dim x = EgtAddMachining(MachiningTypeToString(DirectCast(Machining.Type, MCH_MY)) & "_1", Machining.Name)
+ Application.Msn.NotifyColleagues(Application.LOADOPERATIONLIST)
+ Application.Msn.NotifyColleagues(Application.MACHININGTREEVIEWEXPANDERISENABLED, False)
+ End If
+ End Sub
+
+ '''
+ ''' Returns always true.
+ '''
+ Private Function CanTreeViewDoubleClick(ByVal param As Object) As Boolean
+ Return True
+ End Function
+
+ Private Function MachiningTypeToString(Type As MCH_MY) As String
+ Select Case Type
+ Case MCH_MY.DRILLING
+ Return EgtMsg(MSG_MACHININGSDBPAGE + 1)
+ Case MCH_MY.SAWING
+ Return EgtMsg(MSG_MACHININGSDBPAGE + 2)
+ Case MCH_MY.MILLING
+ Return EgtMsg(MSG_MACHININGSDBPAGE + 3)
+ Case MCH_MY.POCKETING
+ Return EgtMsg(MSG_MACHININGSDBPAGE + 4)
+ Case MCH_MY.MORTISING
+ Return EgtMsg(MSG_MACHININGSDBPAGE + 5)
+ Case MCH_MY.SAWROUGHING
+ Return EgtMsg(MSG_MACHININGSDBPAGE + 6)
+ Case MCH_MY.SAWFINISHING
+ Return EgtMsg(MSG_MACHININGSDBPAGE + 7)
+ Case Else
+ Return String.Empty
+ End Select
+ End Function
+
+#End Region ' TreeViewDoubleClickCommand
+
+#End Region ' Commands
+
+#Region "METHODS"
+
+ '''
+ ''' Method that search the machines in the correct folder and add to the MachinesList those valid.
+ '''
+ Private Sub LoadSelectedMachineMachinings()
+ Dim ActiveMachiningsTypes() As MachiningsType = ReadActiveMachiningsFamilies()
+ For Each MachiningsType In ActiveMachiningsTypes
+ Dim FamilyTreeView As New FamilyMachiningTreeViewExpanderItem(MachiningsType.TypeName, MachiningsType.TypeId)
+ MachiningsList.Add(FamilyTreeView)
+ Dim MachiningName As String = String.Empty
+ If EgtMdbGetFirstMachining(MachiningsType.TypeId, MachiningName) Then
+ FamilyTreeView.Items.Add(New MachiningTreeViewExpanderItem(MachiningName, MachiningsType.TypeId))
+ While EgtMdbGetNextMachining(MachiningsType.TypeId, MachiningName)
+ FamilyTreeView.Items.Add(New MachiningTreeViewExpanderItem(MachiningName, MachiningsType.TypeId))
+ End While
+ End If
+ Next
+ ' Se esiste almeno una famiglia di lavorazioni, la seleziono
+ If MachiningsList.Count > 0 Then
+ MachiningsList(0).IsSelected = True
+ MachiningsList(0).NotifyPropertyChanged("IsSelected")
+ End If
+ End Sub
+
+ '''
+ ''' Method that search the machines in the correct folder and add to the MachinesList those valid.
+ '''
+ Private Function ReadActiveMachiningsFamilies() As MachiningsType()
+ Dim ActiveMachiningsFamiliesList As New List(Of MachiningsType)
+ If EgtUILib.GetPrivateProfileInt(S_MACHININGS, K_DRILLING, 0, m_sDbsCurrMachIniFilePath) <> 0 Then
+ ActiveMachiningsFamiliesList.Add(New MachiningsType With {.TypeId = MCH_MY.DRILLING, .TypeName = EgtMsg(MSG_MACHININGSDBPAGE + 1)})
+ End If
+ If EgtUILib.GetPrivateProfileInt(S_MACHININGS, K_SAWING, 0, m_sDbsCurrMachIniFilePath) <> 0 Then
+ ActiveMachiningsFamiliesList.Add(New MachiningsType With {.TypeId = MCH_MY.SAWING, .TypeName = EgtMsg(MSG_MACHININGSDBPAGE + 2)})
+ End If
+ If EgtUILib.GetPrivateProfileInt(S_MACHININGS, K_MILLING, 0, m_sDbsCurrMachIniFilePath) <> 0 Then
+ ActiveMachiningsFamiliesList.Add(New MachiningsType With {.TypeId = MCH_MY.MILLING, .TypeName = EgtMsg(MSG_MACHININGSDBPAGE + 3)})
+ End If
+ If EgtUILib.GetPrivateProfileInt(S_MACHININGS, K_POCKETING, 0, m_sDbsCurrMachIniFilePath) <> 0 Then
+ ActiveMachiningsFamiliesList.Add(New MachiningsType With {.TypeId = MCH_MY.POCKETING, .TypeName = EgtMsg(MSG_MACHININGSDBPAGE + 4)})
+ End If
+ If EgtUILib.GetPrivateProfileInt(S_MACHININGS, K_MORTISING, 0, m_sDbsCurrMachIniFilePath) <> 0 Then
+ ActiveMachiningsFamiliesList.Add(New MachiningsType With {.TypeId = MCH_MY.MORTISING, .TypeName = EgtMsg(MSG_MACHININGSDBPAGE + 5)})
+ End If
+ If EgtUILib.GetPrivateProfileInt(S_MACHININGS, K_SAWROUGHING, 0, m_sDbsCurrMachIniFilePath) <> 0 Then
+ ActiveMachiningsFamiliesList.Add(New MachiningsType With {.TypeId = MCH_MY.SAWROUGHING, .TypeName = EgtMsg(MSG_MACHININGSDBPAGE + 6)})
+ End If
+ If EgtUILib.GetPrivateProfileInt(S_MACHININGS, K_SAWFINISHING, 0, m_sDbsCurrMachIniFilePath) <> 0 Then
+ ActiveMachiningsFamiliesList.Add(New MachiningsType With {.TypeId = MCH_MY.SAWFINISHING, .TypeName = EgtMsg(MSG_MACHININGSDBPAGE + 7)})
+ End If
+ Return ActiveMachiningsFamiliesList.ToArray
+ End Function
+
+ '''
+ ''' Structure that represent a tool's family, containing family type and family name
+ '''
+ Structure MachiningsType
+
+ Friend TypeId As MCH_MY
+ Friend TypeName As String
+
+ End Structure
+
+#End Region
End Class
diff --git a/ProjectPage/OptionPanel/MachiningOptionPanel/MachiningsTreeViewExpander/MachiningTreeViewExpander.vb b/ProjectPage/OptionPanel/MachiningOptionPanel/MachiningsTreeViewExpander/MachiningTreeViewExpander.vb
new file mode 100644
index 0000000..129f9f0
--- /dev/null
+++ b/ProjectPage/OptionPanel/MachiningOptionPanel/MachiningsTreeViewExpander/MachiningTreeViewExpander.vb
@@ -0,0 +1,102 @@
+Imports EgtUILib
+
+'''
+''' Class that represent a Machining in the treeview.
+''' It's an element in the treeview that represent the child of familymachiningtreeviewitem, but also the class that read and write in the machining's database
+'''
+Public Class MachiningTreeViewExpanderItem
+ Inherits ChildItem
+
+#Region "Machining Property"
+
+ Private m_Type As MCH_MY
+ Public ReadOnly Property Type As Integer
+ Get
+ Return m_Type
+ End Get
+ End Property
+
+ '''
+ ''' Property that determines if the Machining is selected or not
+ '''
+ Public Overrides Property IsSelected As Boolean
+ Get
+ Return m_isSelected
+ End Get
+ Set(value As Boolean)
+ If (value <> m_isSelected) Then
+ m_isSelected = value
+ ' If Machining is selected, set it as current and notify all machining's property
+ ' to refresh them values with those of the new selected machining
+ If value Then
+ EgtMdbSetCurrMachining(Me.Name)
+ Else
+ End If
+
+ End If
+
+ End Set
+
+ End Property
+
+
+
+#End Region ' Machining Property
+
+#Region "Constructors"
+
+ Sub New(Name As String, Type As MCH_MY)
+ MyBase.New(Name)
+ Me.m_Type = Type
+ End Sub
+
+#End Region ' Constructors
+
+End Class
+
+
+'''
+''' Class that represent a FamilyMachining in the treeview.
+''' It's an element in the treeview that represent a folder, but also a machining family
+'''
+Public Class FamilyMachiningTreeViewExpanderItem
+ Inherits ParentItem
+
+ Private m_MachiningType As MCH_MY
+ '''
+ ''' Property that determines the machining type of the family
+ '''
+ Public Property MachiningType As MCH_MY
+ Get
+ Return m_MachiningType
+ End Get
+ Set(value As MCH_MY)
+ m_MachiningType = value
+ End Set
+ End Property
+
+ '''
+ ''' Property that determines if the Machining is selected or not
+ '''
+ Public Overrides Property IsSelected As Boolean
+ Get
+ Return m_isSelected
+ End Get
+ Set(value As Boolean)
+ If (value <> m_isSelected) Then
+ m_isSelected = value
+ End If
+ End Set
+ End Property
+
+ '''
+ ''' Constructor that receive the name of the FamilyMachiningTreeViewItem, the MachiningType, and set
+ ''' the picture(Folder.png)
+ '''
+ Sub New(Name As String, MachiningType As MCH_MY)
+ MyBase.New(Name)
+ Me.MachiningType = MachiningType
+ Me.PictureString = "/Resources/TreeView/Folder.png"
+ End Sub
+
+End Class
diff --git a/ProjectPage/OptionPanel/MachiningOptionPanel/OperationExpander/OperationExpanderView.xaml b/ProjectPage/OptionPanel/MachiningOptionPanel/OperationExpander/OperationExpanderView.xaml
index e813b4a..2d47ba8 100644
--- a/ProjectPage/OptionPanel/MachiningOptionPanel/OperationExpander/OperationExpanderView.xaml
+++ b/ProjectPage/OptionPanel/MachiningOptionPanel/OperationExpander/OperationExpanderView.xaml
@@ -11,8 +11,8 @@
-
+
diff --git a/ProjectPage/OptionPanel/MachiningOptionPanel/OperationExpander/OperationExpanderViewModel.vb b/ProjectPage/OptionPanel/MachiningOptionPanel/OperationExpander/OperationExpanderViewModel.vb
index 22bbe30..4bb052a 100644
--- a/ProjectPage/OptionPanel/MachiningOptionPanel/OperationExpander/OperationExpanderViewModel.vb
+++ b/ProjectPage/OptionPanel/MachiningOptionPanel/OperationExpander/OperationExpanderViewModel.vb
@@ -37,12 +37,14 @@ Namespace EgtCAM5
End Get
Set(value As OperationListBoxItem)
If value IsNot m_SelectedOperation Then
+ 'EgtSetCurrMachining(value.Id)
If m_LastMarkedOperationId <> GDB_ID.NULL Then
EgtResetMark(m_LastMarkedOperationId)
End If
EgtSetMark(value.Id)
m_LastMarkedOperationId = value.Id
EgtDraw()
+ Application.Msn.NotifyColleagues(Application.SELECTEDOPERATION, value)
m_SelectedOperation = value
End If
End Set
@@ -82,7 +84,8 @@ Namespace EgtCAM5
''' Execute the Point. This method is invoked by the PointCommand.
'''
Public Sub NewMachining(ByVal param As Object)
-
+ EgtDeselectAll()
+ Application.Msn.NotifyColleagues(Application.MACHININGTREEVIEWEXPANDERISENABLED, True)
End Sub
'''
diff --git a/ProjectPage/OptionPanel/MachiningOptionPanel/OperationExpander/OperationListBox.vb b/ProjectPage/OptionPanel/MachiningOptionPanel/OperationExpander/OperationListBox.vb
index 644d918..fa19a35 100644
--- a/ProjectPage/OptionPanel/MachiningOptionPanel/OperationExpander/OperationListBox.vb
+++ b/ProjectPage/OptionPanel/MachiningOptionPanel/OperationExpander/OperationListBox.vb
@@ -1,6 +1,8 @@
-Imports EgtUILib
+Imports System.ComponentModel
+Imports EgtUILib
Public Class OperationListBoxItem
+ Implements INotifyPropertyChanged
Private m_Id As Integer
Public Property Id As Integer
@@ -42,6 +44,20 @@ Public Class OperationListBoxItem
End Set
End Property
+ 'Public Property Invert As Boolean
+ ' Get
+ ' 'EgtSetCurrentContext(IniFile.m_ProjectSceneContext)
+ ' Dim bInvert As Boolean = False
+ ' EgtMdbGetCurrMachiningParam(MCH_MP.INVERT, bInvert)
+ ' Return bInvert
+ ' End Get
+ ' Set(value As Boolean)
+ ' 'EgtSetCurrentContext(IniFile.m_ProjectSceneContext)
+ ' EgtMdbSetCurrMachiningParam(MCH_MP.INVERT, value)
+ ' End Set
+ 'End Property
+
+
Sub New(Id As Integer, Name As String, Type As Integer, Tool As String)
Me.Id = Id
Me.Name = Name
@@ -50,7 +66,7 @@ Public Class OperationListBoxItem
End Sub
Private Function ConvertTypeToImage(Type As Integer) As String
- Select Type
+ Select Case Type
Case MCH_OY.DISP
Return ""
Case MCH_OY.DRILLING
@@ -72,4 +88,10 @@ Public Class OperationListBoxItem
End Select
End Function
+ Public Event PropertyChanged As PropertyChangedEventHandler Implements INotifyPropertyChanged.PropertyChanged
+
+ Public Sub NotifyPropertyChanged(propName As String)
+ RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs(propName))
+ End Sub
+
End Class
diff --git a/ProjectPage/OptionPanel/MachiningOptionPanel/OperationPropertyExpander/OperationPropertyExpanderView.xaml b/ProjectPage/OptionPanel/MachiningOptionPanel/OperationPropertyExpander/OperationPropertyExpanderView.xaml
index 1919f22..3af122d 100644
--- a/ProjectPage/OptionPanel/MachiningOptionPanel/OperationPropertyExpander/OperationPropertyExpanderView.xaml
+++ b/ProjectPage/OptionPanel/MachiningOptionPanel/OperationPropertyExpander/OperationPropertyExpanderView.xaml
@@ -1,11 +1,193 @@
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:local="clr-namespace:EgtCAM5">
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/ProjectPage/OptionPanel/MachiningOptionPanel/OperationPropertyExpander/OperationPropertyExpanderViewModel.vb b/ProjectPage/OptionPanel/MachiningOptionPanel/OperationPropertyExpander/OperationPropertyExpanderViewModel.vb
index 29cae7b..5b1d7dd 100644
--- a/ProjectPage/OptionPanel/MachiningOptionPanel/OperationPropertyExpander/OperationPropertyExpanderViewModel.vb
+++ b/ProjectPage/OptionPanel/MachiningOptionPanel/OperationPropertyExpander/OperationPropertyExpanderViewModel.vb
@@ -1,6 +1,46 @@
-Namespace EgtCAM5
+Imports EgtUILib
+
+Namespace EgtCAM5
Public Class OperationPropertyExpanderViewModel
+ Inherits ViewModelBase
+
+ Private m_SelectedOperation As OperationListBoxItem
+ Public Property SelectedOperation As OperationListBoxItem
+ Get
+ Return m_SelectedOperation
+ End Get
+ Set(value As OperationListBoxItem)
+ If value IsNot m_SelectedOperation Then
+ Dim x = EgtSetCurrMachining(value.Id)
+ m_SelectedOperation = value
+
+ m_SelectedOperation.NotifyPropertyChanged("Invert")
+ End If
+ End Set
+ End Property
+
+ 'Private m_Depth As String
+ 'Public Property Depth As String
+ ' Get
+ ' EgtGetMachiningParam(MCH_MP.DEPTH, m_Depth)
+ ' Return m_Depth
+ ' End Get
+ ' Set(value As String)
+ ' If value <> m_Depth Then
+ ' If EgtSetMachiningParam(MCH_MP.NAME, value) Then
+ ' m_Depth = value
+ ' End If
+ ' End If
+ ' 'OnPropertyChanged("Depth")
+ ' End Set
+ 'End Property
+
+ Sub New()
+ Application.Msn.Register(Application.SELECTEDOPERATION, Sub(SelectedOperation As OperationListBoxItem)
+ Me.SelectedOperation = SelectedOperation
+ End Sub)
+ End Sub
End Class
diff --git a/ProjectPage/ProjectViewModel.vb b/ProjectPage/ProjectViewModel.vb
index 6abd232..1a452dc 100644
--- a/ProjectPage/ProjectViewModel.vb
+++ b/ProjectPage/ProjectViewModel.vb
@@ -404,6 +404,9 @@ Namespace EgtCAM5
Application.Msn.Register(Application.ISOVIEWNW, Sub()
m_ProjectScene.IsoViewNW()
End Sub)
+ Application.Msn.Register(Application.VIEWTOCPLANE, Sub()
+ m_ProjectScene.CPlaneView()
+ End Sub)
Application.Msn.Register(Application.SETSTATUSANALYZE, Sub()
m_ProjectScene.SetStatusAnalyze()
End Sub)