diff --git a/MachiningsDbPage/MachiningsDbViewModel.vb b/MachiningsDbPage/MachiningsDbViewModel.vb
index cb99778..8688250 100644
--- a/MachiningsDbPage/MachiningsDbViewModel.vb
+++ b/MachiningsDbPage/MachiningsDbViewModel.vb
@@ -494,9 +494,10 @@ Namespace EgtCAM5
EgtMdbGetCurrMachiningParam(MCH_MP.TYPE, CurrType)
For Each MachiningFamily In MachiningsList
If (MachiningFamily.MachiningType And CurrType) <> 0 Then
- NewMachiningItem = New MachiningTreeViewItem(NewName, DirectCast(MachiningFamily.Type, MCH_MY))
+ NewMachiningItem = New MachiningTreeViewItem(NewName, MachiningFamily.MachiningType)
MachiningFamily.Items.Add(NewMachiningItem)
EgtMdbSaveCurrMachining()
+ NewMachiningItem.NewMachining = True
NewMachiningItem.IsSelected = True
NewMachiningItem.NotifyPropertyChanged("IsSelected")
Exit For
diff --git a/ProjectPage/OptionPanel/DrawOptionPanelViewModel.vb b/ProjectPage/OptionPanel/DrawOptionPanelViewModel.vb
index 24481ce..0b868d6 100644
--- a/ProjectPage/OptionPanel/DrawOptionPanelViewModel.vb
+++ b/ProjectPage/OptionPanel/DrawOptionPanelViewModel.vb
@@ -17,6 +17,7 @@ Namespace EgtCAM5
Application.Msn.NotifyColleagues(Application.PROJECTPAGE_DRAWMODE)
EgtResetCurrMachGroup()
EgtZoom(ZM.ALL)
+ Application.Msn.NotifyColleagues(Application.LOADOBJTREE)
End If
OnPropertyChanged("ManageLayerExpander")
OnPropertyChanged("InfoExpander")
diff --git a/ProjectPage/OptionPanel/MachiningOptionPanel/OperationExpander/OperationExpanderView.xaml b/ProjectPage/OptionPanel/MachiningOptionPanel/OperationExpander/OperationExpanderView.xaml
index 8ee437b..c923026 100644
--- a/ProjectPage/OptionPanel/MachiningOptionPanel/OperationExpander/OperationExpanderView.xaml
+++ b/ProjectPage/OptionPanel/MachiningOptionPanel/OperationExpander/OperationExpanderView.xaml
@@ -39,7 +39,11 @@
-
+
+
+
+
+
@@ -151,7 +155,7 @@
-
+
diff --git a/ProjectPage/OptionPanel/MachiningOptionPanel/OperationExpander/OperationExpanderViewModel.vb b/ProjectPage/OptionPanel/MachiningOptionPanel/OperationExpander/OperationExpanderViewModel.vb
index 654f693..b3f75b3 100644
--- a/ProjectPage/OptionPanel/MachiningOptionPanel/OperationExpander/OperationExpanderViewModel.vb
+++ b/ProjectPage/OptionPanel/MachiningOptionPanel/OperationExpander/OperationExpanderViewModel.vb
@@ -91,6 +91,7 @@ Namespace EgtCAM5
EgtResetMark(m_LastMarkedOperationId)
' Ne deseleziono la geometria
EgtDeselectAll()
+ EgtDraw()
End If
' Verifico se l'operazione è una disposizione
If EgtGetOperationType(value.Id) = MCH_OY.DISP Then
@@ -310,6 +311,8 @@ Namespace EgtCAM5
Private m_cmdNewMachining As ICommand
Private m_cmdNewPositioning As ICommand
Private m_cmdCancelOperation As ICommand
+ Private m_cmdMoveUp As ICommand
+ Private m_cmdMoveDown As ICommand
Private m_cmdReloadMachining As ICommand
Sub New()
@@ -430,6 +433,95 @@ Namespace EgtCAM5
#End Region ' CancelOperationCommand
+#Region "MoveUpCommand"
+
+ '''
+ ''' Returns a command that do Point.
+ '''
+ Public ReadOnly Property MoveUpCommand As ICommand
+ Get
+ If m_cmdMoveUp Is Nothing Then
+ m_cmdMoveUp = New RelayCommand(AddressOf MoveUp, AddressOf CanMoveUp)
+ End If
+ Return m_cmdMoveUp
+ End Get
+ End Property
+
+ '''
+ ''' Execute the Point. This method is invoked by the PointCommand.
+ '''
+ Public Sub MoveUp(ByVal param As Object)
+ If Not IsNothing(SelectedOperation) Then
+ ' Verifico se l'entità selezionata è una lavorazione o una disposizione,
+ ' se è una disposizione esco perchè non si possono spostare
+ If SelectedOperation.Type = MCH_OY.DISP Then Return
+ ' Trovo indice dell'entità selezionata
+ Dim SelectedIndex As Integer = OperationList.IndexOf(SelectedOperation)
+ ' Verifico che l'indice sia >= 2 perchè il primo è e deve essere una disposizione
+ If SelectedIndex < 2 Then
+ Return
+ End If
+ ' Recupero Id entità precedente a quella selezionata
+ Dim PreviousId As Integer = OperationList(SelectedIndex - 1).Id
+ ' Sposto l'entità selezionata
+ EgtRelocate(SelectedOperation.Id, PreviousId, GDB_POS.BEFORE)
+ ' Ricarico la lista delle operazioni
+ Application.Msn.NotifyColleagues(Application.LOADOPERATIONLIST)
+ End If
+ End Sub
+
+ '''
+ ''' Returns always true.
+ '''
+ Private Function CanMoveUp(ByVal param As Object) As Boolean
+ Return True
+ End Function
+
+#End Region ' MoveUpCommand
+
+#Region "MoveDownCommand"
+
+ '''
+ ''' Returns a command that do Point.
+ '''
+ Public ReadOnly Property MoveDownCommand As ICommand
+ Get
+ If m_cmdMoveDown Is Nothing Then
+ m_cmdMoveDown = New RelayCommand(AddressOf MoveDown, AddressOf CanMoveDown)
+ End If
+ Return m_cmdMoveDown
+ End Get
+ End Property
+
+ '''
+ ''' Execute the Point. This method is invoked by the PointCommand.
+ '''
+ Public Sub MoveDown(ByVal param As Object)
+ If m_NewMachining Then
+ NewMachining = False
+ Else
+ If Not IsNothing(SelectedOperation) Then
+ ' Smarco e deseleziono la geometria selezionata
+ EgtResetMark(m_LastMarkedOperationId)
+ EgtDeselectAll()
+ EgtDraw()
+ ' Rimuovo l'operazione selezionata
+ EgtRemoveOperation(SelectedOperation.Id)
+ ' Ricarico la lista delle operazioni
+ Application.Msn.NotifyColleagues(Application.LOADOPERATIONLIST)
+ End If
+ End If
+ End Sub
+
+ '''
+ ''' Returns always true.
+ '''
+ Private Function CanMoveDown(ByVal param As Object) As Boolean
+ Return True
+ End Function
+
+#End Region ' MoveDownCommand
+
#Region "ReloadMachiningCommand"
'''
diff --git a/ProjectPage/OptionPanel/MachiningOptionPanel/OperationPropertyExpander/OperationPropertyExpanderView.xaml b/ProjectPage/OptionPanel/MachiningOptionPanel/OperationPropertyExpander/OperationPropertyExpanderView.xaml
deleted file mode 100644
index e0f8a09..0000000
--- a/ProjectPage/OptionPanel/MachiningOptionPanel/OperationPropertyExpander/OperationPropertyExpanderView.xaml
+++ /dev/null
@@ -1,194 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/ProjectPage/OptionPanel/MachiningOptionPanel/OperationPropertyExpander/OperationPropertyExpanderView.xaml.vb b/ProjectPage/OptionPanel/MachiningOptionPanel/OperationPropertyExpander/OperationPropertyExpanderView.xaml.vb
deleted file mode 100644
index 0306a33..0000000
--- a/ProjectPage/OptionPanel/MachiningOptionPanel/OperationPropertyExpander/OperationPropertyExpanderView.xaml.vb
+++ /dev/null
@@ -1,3 +0,0 @@
-Public Class OperationPropertyExpanderView
-
-End Class
diff --git a/ProjectPage/OptionPanel/MachiningOptionPanel/OperationPropertyExpander/OperationPropertyExpanderViewModel.vb b/ProjectPage/OptionPanel/MachiningOptionPanel/OperationPropertyExpander/OperationPropertyExpanderViewModel.vb
deleted file mode 100644
index 1c006cb..0000000
--- a/ProjectPage/OptionPanel/MachiningOptionPanel/OperationPropertyExpander/OperationPropertyExpanderViewModel.vb
+++ /dev/null
@@ -1,47 +0,0 @@
-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
-
-End Namespace
\ No newline at end of file
diff --git a/ProjectPage/OptionPanel/MachiningOptionPanel/SimulationExpander/SimulationExpanderViewModel.vb b/ProjectPage/OptionPanel/MachiningOptionPanel/SimulationExpander/SimulationExpanderViewModel.vb
index da2a971..8d74f64 100644
--- a/ProjectPage/OptionPanel/MachiningOptionPanel/SimulationExpander/SimulationExpanderViewModel.vb
+++ b/ProjectPage/OptionPanel/MachiningOptionPanel/SimulationExpander/SimulationExpanderViewModel.vb
@@ -444,9 +444,7 @@ Namespace EgtCAM5
Private Sub CloseSimulation()
' Mi assicuro di terminare la simulazione
ResetSimulation()
- ' Nascondo tutte le lavorazioni
- 'HideAllMachinings()
-
+ EgtDraw()
End Sub
Private Sub ResetSimulation()