EgtCAM5 1.6v8 :
- piccole migliorie a tabelle Doors - modifiche per gestione più fasi di lavorazione.
This commit is contained in:
+45
-38
@@ -658,7 +658,10 @@ Namespace EgtCAM5
|
||||
''' Execute the Point. This method is invoked by the PointCommand.
|
||||
''' </summary>
|
||||
Public Sub NewPositioning(ByVal param As Object)
|
||||
|
||||
Dim nPhase As Integer = EgtAddPhase()
|
||||
Dim nDispId As Integer = EgtGetPhaseDisposition(nPhase)
|
||||
' Ricarico la lista delle operazioni
|
||||
Application.Msn.NotifyColleagues(Application.LOADOPERATIONLIST, nDispId)
|
||||
End Sub
|
||||
|
||||
#End Region ' NewPositioningCommand
|
||||
@@ -681,7 +684,7 @@ Namespace EgtCAM5
|
||||
''' Execute the Point. This method is invoked by the PointCommand.
|
||||
''' </summary>
|
||||
Public Sub CancelOperation(ByVal param As Object)
|
||||
' se viene premuto il tasto Esc
|
||||
' Se viene premuto il tasto Esc
|
||||
If DirectCast(param, String) = "Escape" Then
|
||||
If m_NewMachining Then
|
||||
NewMachining = False
|
||||
@@ -689,20 +692,30 @@ Namespace EgtCAM5
|
||||
End If
|
||||
Return
|
||||
End If
|
||||
' in tutti gli altri casi
|
||||
' Se sto inserendo una nuova lavorazione
|
||||
If m_NewMachining Then
|
||||
NewMachining = False
|
||||
ListIsExpanded = True
|
||||
' altrimenti sto cancellandone una vecchia
|
||||
Else
|
||||
If Not IsNothing(SelectedOperation) Then
|
||||
' Salvo indice operazione selezionata
|
||||
' Salvo indice operazione precedente a selezionata
|
||||
Dim nPrevOperId As Integer = EgtGetPrevOperation(SelectedOperation.Id)
|
||||
' Smarco e deseleziono la geometria selezionata
|
||||
EgtResetMark(m_LastMarkedOperationId)
|
||||
EgtDeselectAll()
|
||||
EgtDraw()
|
||||
' Rimuovo l'operazione selezionata
|
||||
EgtRemoveOperation(SelectedOperation.Id)
|
||||
If SelectedOperation.Type = MCH_OY.DISP Then
|
||||
' Posso cancellare solo l'ultima disposizione
|
||||
If EgtGetOperationPhase(SelectedOperation.Id) = EgtGetPhaseCount() Then
|
||||
EgtRemoveLastPhase()
|
||||
Else
|
||||
Return
|
||||
End If
|
||||
Else
|
||||
' Smarco e deseleziono la geometria selezionata
|
||||
EgtResetMark(m_LastMarkedOperationId)
|
||||
EgtDeselectAll()
|
||||
EgtDraw()
|
||||
' Rimuovo l'operazione selezionata
|
||||
EgtRemoveOperation(SelectedOperation.Id)
|
||||
End If
|
||||
' Ricarico la lista delle operazioni
|
||||
Application.Msn.NotifyColleagues(Application.LOADOPERATIONLIST, nPrevOperId)
|
||||
End If
|
||||
@@ -744,7 +757,7 @@ Namespace EgtCAM5
|
||||
Public ReadOnly Property MoveUpCommand As ICommand
|
||||
Get
|
||||
If m_cmdMoveUp Is Nothing Then
|
||||
m_cmdMoveUp = New RelayCommand(AddressOf MoveUp, AddressOf CanMoveUp)
|
||||
m_cmdMoveUp = New RelayCommand(AddressOf MoveUp)
|
||||
End If
|
||||
Return m_cmdMoveUp
|
||||
End Get
|
||||
@@ -760,15 +773,13 @@ Namespace EgtCAM5
|
||||
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
|
||||
' Posso spostare solo se la precedente non è una disposizione (per non cambiare fase)
|
||||
If OperationList(SelectedIndex - 1).Type = MCH_OY.DISP Then Return
|
||||
' Recupero Id entità selezionata e precedente a quella selezionata
|
||||
Dim SelectedId As Integer = OperationList(SelectedIndex).Id
|
||||
Dim PreviousId As Integer = OperationList(SelectedIndex - 1).Id
|
||||
' Sposto l'operazione selezionata nell'ambiente Egt
|
||||
If EgtRelocate(SelectedOperation.Id, PreviousId, GDB_POS.BEFORE) Then
|
||||
If EgtRelocate(SelectedId, PreviousId, GDB_POS.BEFORE) Then
|
||||
' Sposto l'operazione selezionata nella grafica
|
||||
OperationList.Move(SelectedIndex, SelectedIndex - 1)
|
||||
' Ricalcolo la lavorazione selezionata e la precedente
|
||||
@@ -781,13 +792,6 @@ Namespace EgtCAM5
|
||||
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"
|
||||
@@ -798,7 +802,7 @@ Namespace EgtCAM5
|
||||
Public ReadOnly Property MoveDownCommand As ICommand
|
||||
Get
|
||||
If m_cmdMoveDown Is Nothing Then
|
||||
m_cmdMoveDown = New RelayCommand(AddressOf MoveDown, AddressOf CanMoveDown)
|
||||
m_cmdMoveDown = New RelayCommand(AddressOf MoveDown)
|
||||
End If
|
||||
Return m_cmdMoveDown
|
||||
End Get
|
||||
@@ -815,14 +819,14 @@ Namespace EgtCAM5
|
||||
' Trovo indice dell'entità selezionata
|
||||
Dim SelectedIndex As Integer = OperationList.IndexOf(SelectedOperation)
|
||||
' Verifico che l'indice sia < della lunghezza della lista delle operazioni,altrimenti è già ultima e quindi non la posso spostare
|
||||
If SelectedIndex > OperationList.Count - 2 Then
|
||||
Return
|
||||
End If
|
||||
If SelectedIndex > OperationList.Count - 2 Then Return
|
||||
' Posso spostare solo se la successiva non è una disposizione (per non cambiare fase)
|
||||
If OperationList(SelectedIndex + 1).Type = MCH_OY.DISP Then Return
|
||||
' Recupero Id entitàselezionata e successiva a quella selezionata
|
||||
Dim SelectedId As Integer = OperationList(SelectedIndex).Id
|
||||
Dim PostId As Integer = OperationList(SelectedIndex + 1).Id
|
||||
' Sposto l'operazione selezionata nell'ambiente Egt
|
||||
If EgtRelocate(SelectedOperation.Id, PostId, GDB_POS.AFTER) Then
|
||||
If EgtRelocate(SelectedId, PostId, GDB_POS.AFTER) Then
|
||||
' Sposto l'operazione selezionata nella grafica
|
||||
OperationList.Move(SelectedIndex, SelectedIndex + 1)
|
||||
' Ricalcolo la lavorazione selezionata e la successiva
|
||||
@@ -835,13 +839,6 @@ Namespace EgtCAM5
|
||||
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 "UpdateCommand"
|
||||
@@ -862,13 +859,19 @@ Namespace EgtCAM5
|
||||
''' Execute the Point. This method is invoked by the PointCommand.
|
||||
''' </summary>
|
||||
Public Sub Update()
|
||||
' Ricalcolo la lavorazione per tutte le operazioni della lista, saltando le disposizioni
|
||||
' Recupero fase corrente
|
||||
Dim nCurrPhase As Integer = EgtGetCurrPhase()
|
||||
' Ricalcolo la lavorazione per tutte le operazioni della lista
|
||||
For Each Operation In OperationList
|
||||
If Not Operation.Type = MCH_OY.DISP Then
|
||||
If Operation.Type = MCH_OY.DISP Then
|
||||
EgtSetCurrPhase(EgtGetOperationPhase(Operation.Id))
|
||||
Else
|
||||
EgtSetCurrMachining(Operation.Id)
|
||||
EgtApplyMachining(True)
|
||||
End If
|
||||
Next
|
||||
' Ripristino la fase inizialmente corrente
|
||||
EgtSetCurrPhase(nCurrPhase)
|
||||
EgtDraw()
|
||||
End Sub
|
||||
|
||||
@@ -944,6 +947,7 @@ Namespace EgtCAM5
|
||||
Private Sub LoadOperationList()
|
||||
OperationList.Clear()
|
||||
Dim Id As Integer
|
||||
Dim OpStatus As Boolean = True
|
||||
Dim OpName As String = String.Empty
|
||||
Dim OpType As Integer = 0
|
||||
Dim OpTool As String = String.Empty
|
||||
@@ -955,12 +959,15 @@ Namespace EgtCAM5
|
||||
Select Case OpType
|
||||
Case MCH_OY.DRILLING, MCH_OY.SAWING, MCH_OY.MILLING, MCH_OY.POCKETING, MCH_OY.MORTISING, MCH_OY.SAWROUGHING, MCH_OY.SAWFINISHING
|
||||
EgtSetCurrMachining(Id)
|
||||
OpStatus = EgtGetOperationMode(Id)
|
||||
EgtGetMachiningParam(MCH_MP.TOOL, OpTool)
|
||||
EgtGetMachiningParam(MCH_MP.NAME, OpMach)
|
||||
Case MCH_OY.DISP
|
||||
OpStatus = True
|
||||
OpTool = String.Empty
|
||||
OpMach = String.Empty
|
||||
End Select
|
||||
OperationList.Add(New OperationListBoxItem(Id, OpName, OpType, OpTool, OpMach))
|
||||
OperationList.Add(New OperationListBoxItem(Id, OpStatus, OpName, OpType, OpTool, OpMach))
|
||||
Id = EgtGetNextOperation(Id)
|
||||
End While
|
||||
End Sub
|
||||
|
||||
Reference in New Issue
Block a user