EgtCAM5 :

- Migliorie lavorazioni.
- Sistemata nuova lavorazione in Db.
This commit is contained in:
Emmanuele Sassi
2016-07-18 10:19:37 +00:00
parent 25f7d05697
commit edd43d516d
8 changed files with 102 additions and 250 deletions
@@ -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"
''' <summary>
''' Returns a command that do Point.
''' </summary>
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
''' <summary>
''' Execute the Point. This method is invoked by the PointCommand.
''' </summary>
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
''' <summary>
''' Returns always true.
''' </summary>
Private Function CanMoveUp(ByVal param As Object) As Boolean
Return True
End Function
#End Region ' MoveUpCommand
#Region "MoveDownCommand"
''' <summary>
''' Returns a command that do Point.
''' </summary>
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
''' <summary>
''' Execute the Point. This method is invoked by the PointCommand.
''' </summary>
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
''' <summary>
''' Returns always true.
''' </summary>
Private Function CanMoveDown(ByVal param As Object) As Boolean
Return True
End Function
#End Region ' MoveDownCommand
#Region "ReloadMachiningCommand"
''' <summary>