diff --git a/OptionPanel/MachiningTab/FinalMoveRawModeV.xaml b/OptionPanel/MachiningTab/FinalMoveRawModeV.xaml
index 5d3e815..554fbbe 100644
--- a/OptionPanel/MachiningTab/FinalMoveRawModeV.xaml
+++ b/OptionPanel/MachiningTab/FinalMoveRawModeV.xaml
@@ -2,49 +2,71 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5">
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
+
+
+
+
+
-
+
-
-
-
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/OptionPanel/MachiningTab/FinalMoveRawModeVM.vb b/OptionPanel/MachiningTab/FinalMoveRawModeVM.vb
index 403d931..ad5b4a1 100644
--- a/OptionPanel/MachiningTab/FinalMoveRawModeVM.vb
+++ b/OptionPanel/MachiningTab/FinalMoveRawModeVM.vb
@@ -2,7 +2,28 @@
Imports EgtWPFLib5
Public Class FinalMoveRawModeVM
+#Region "FIELDS and PROPERTIES"
+
+ Public ReadOnly Property PauseMsg As String
+ Get
+ Return "Pause"
+ End Get
+ End Property
+
+ Private m_PauseBtnIsEnable As Boolean = True
+ Public Property PauseBtnIsEnable As Boolean
+ Get
+ Return m_PauseBtnIsEnable
+ End Get
+ Set(value As Boolean)
+ m_PauseBtnIsEnable = value
+ End Set
+ End Property
+
+#End Region ' FIELDS and PROPERTIES
+
#Region "CONSTRUCTOR"
+
Private m_nAuxTabId As Integer = GDB_ID.NULL
Public ReadOnly Property nAuxTabId As Integer
Get
@@ -14,17 +35,11 @@ Public Class FinalMoveRawModeVM
OmagOFFICEMap.SetRefFinalMoveRawModeVM(Me)
End Sub
- ' Definizione comandi
- Private m_cmdTopLeft As ICommand
- Private m_cmdTopRight As ICommand
- Private m_cmdBottomLeft As ICommand
- Private m_cmdBottomRight As ICommand
- Private m_cmdReset As ICommand
-
#End Region ' CONSTRUCTOR
- Public Function Init() As Boolean
-
+#Region "METHODS"
+ ' inizializzo i dati della tavola ausiliaria all'interno della fase corrente
+ Public Function SetAuxTabInCurrDisposition() As Boolean
Dim bOk As Boolean = False
' OmagOFFICEMap.refMoveRawModeVM.InitMoveRaw()
m_nAuxTabId = EgtGetTableId(AUX_TAB)
@@ -49,6 +64,20 @@ Public Class FinalMoveRawModeVM
Return bOk
End Function
+#End Region ' METHODS
+
+ ' Definizione comandi
+ Private m_cmdTopLeft As ICommand
+ Private m_cmdTopRight As ICommand
+ Private m_cmdBottomLeft As ICommand
+ Private m_cmdBottomRight As ICommand
+ Private m_cmdReset As ICommand
+ Private m_cmdPause As ICommand
+
+ Public Function Init() As Boolean
+ Return SetAuxTabInCurrDisposition()
+ End Function
+
#Region "TopLeft"
Public ReadOnly Property TopLeftCommand As ICommand
@@ -136,4 +165,22 @@ Public Class FinalMoveRawModeVM
#End Region ' Reset
+#Region "Pause"
+
+ Public ReadOnly Property PauseCommand As ICommand
+ Get
+ If m_cmdPause Is Nothing Then
+ m_cmdPause = New Command(AddressOf Pause)
+ End If
+ Return m_cmdPause
+ End Get
+ End Property
+
+ Public Sub Pause(ByVal param As Object)
+ ' inserire il libreria questa nuova funzionalità per l'inserimento di una nuova fase
+ OmagOFFICEMap.refMoveRawModeVM.InsertPause()
+ End Sub
+
+#End Region ' Pause
+
End Class
diff --git a/OptionPanel/MachiningTab/MachiningTabVM.vb b/OptionPanel/MachiningTab/MachiningTabVM.vb
index 6abf3c4..75a2d6c 100644
--- a/OptionPanel/MachiningTab/MachiningTabVM.vb
+++ b/OptionPanel/MachiningTab/MachiningTabVM.vb
@@ -6,6 +6,50 @@ Public Class MachiningTabVM
#Region "FIELDS & PROPERTIES"
+ ' Fase corrente
+ Private m_nCurrPhase As Integer = 0
+ Public Property nCurrPhase As Integer
+ Get
+ Return m_nCurrPhase
+ End Get
+ Set(value As Integer)
+ m_nCurrPhase = value
+ End Set
+ End Property
+
+ ' Disposizione corrente
+ Private m_nCurrDisposition As Integer = GDB_ID.NULL
+ Public Property nCurrDisposition As Integer
+ Get
+ Return m_nCurrDisposition
+ End Get
+ Set(value As Integer)
+ m_nCurrDisposition = value
+ End Set
+ End Property
+
+ ' Premuto Prev
+ Private m_bPrev As Boolean = False
+ Public Property bPrev As Boolean
+ Get
+ Return m_bPrev
+ End Get
+ Set(value As Boolean)
+ m_bPrev = value
+ End Set
+ End Property
+
+ ' Pemuto Next
+ Private m_bToNext As Boolean = False
+ Public Property bToNext As Boolean
+ Get
+ Return m_bToNext
+ End Get
+ Set(value As Boolean)
+ m_bToNext = value
+ End Set
+ End Property
+
Enum MachiningModeOpt As Integer
SPLIT
MOVERAWPART
@@ -214,6 +258,26 @@ Public Class MachiningTabVM
Return True
End Function
+ ' verifica se la disposizione indicata è uno scarico sulla tavola ausiliaria
+ Public Function IsDispUnloadOnAuxTab(nCurrDispId As Integer) As Integer
+ ' verifico se la fase precedente è uno scarico su tavola ausiliaria
+ Dim bVal As Integer = 0
+ EgtGetInfo(nCurrDispId, "Pat", bVal)
+ Return bVal
+ End Function
+
+ ' recupero la prima disposizione disponibile tra l'elenco delle operazioni presenti
+ Public Function GetNextDisposition(nCurrDisposId As Integer) As Integer
+ Dim nDispId As Integer = nCurrDisposId
+ While nDispId <> GDB_ID.NULL
+ If EgtGetOperationType(nDispId) = MCH_OY.DISP Then
+ Return nDispId
+ End If
+ nDispId = EgtGetNextOperation(nDispId)
+ End While
+ Return GDB_ID.NULL
+ End Function
+
Friend Function ExitMachining() As Boolean
' salvo movimenti di deposito
If MachiningMode = MachiningModeOpt.MOVERAWPART And OmagOFFICEMap.refSplitModeVM.bOnAuxTab Then
@@ -271,6 +335,40 @@ Public Class MachiningTabVM
End If
' se trovata interferenza tra grezzi (dopo movimentazione) esco
If Not bOk Then Return
+
+ m_bPrev = True
+ ' Passo alla pagina delle spezzature solo se non esiste prima una fased di deposito sulla tavola di scarico
+
+ Dim nPrevDispId As Integer = EgtGetPrevOperation(m_nCurrDisposition)
+ ' verifico se la fasa precedente è di tipo scarico
+ If IsDispUnloadOnAuxTab(nPrevDispId) <> 0 Then
+ EgtSetCurrPhase(m_nCurrPhase - 1)
+ m_nCurrDisposition = nPrevDispId
+ m_nCurrPhase -= 1
+ m_bPrev = False
+ m_bIsShow = True
+ EgtDraw()
+ Return
+ End If
+
+ ' Nascondo eventuale tavola ausiliaria
+ If OmagOFFICEMap.refSplitModeVM.bOnAuxTab Then
+ EgtDisableModified()
+ EgtSetStatus(OmagOFFICEMap.refFinalMoveRawModeVM.nAuxTabId, GDB_ST.OFF)
+ EgtEnableModified()
+ EgtZoom(ZM.ALL, False)
+ If Not m_bPrev Then
+ ' Cancello eventuale manipolatore pezzi
+ EgtDisableModified()
+ RemoveVacuumCups()
+ EgtEnableModified()
+ ' ritorno a fase 1
+ EgtSetCurrPhase(1)
+ ' Ripristino visualizzazione preview lavorazioni
+ ShowAllPhasesMachiningPreview()
+ End If
+ End If
+
' Torno alla fase precedente
EgtSetCurrPhase(EgtGetCurrPhase() - 1)
' Si va sempre in Split
@@ -297,21 +395,51 @@ Public Class MachiningTabVM
Public Sub NextCmd(ByVal param As Object)
Dim bOk As Boolean = True
If m_MachiningMode = MachiningModeOpt.SPLIT Then
+ ' esco dalla pagina split
OmagOFFICEMap.refSplitModeVM.ExitSplitRaw(False)
MachiningMode = MachiningModeOpt.MOVERAWPART
AutoVisibility = Visibility.Hidden
+ ' inizializzo la pagina dei movimenti
bOk = OmagOFFICEMap.refMoveRawModeVM.InitMoveRaw()
+
+ ' verifico che la fase in cui sto per entrare non sia una precdente disposizione sulla tavola ausiliaria
+ If m_bIsShow Then
+ Dim CurrDisposition As Integer = EgtGetPhaseDisposition(m_nCurrPhase)
+ ' recupero l'operazione successiva
+ Dim NextDisposition As Integer = EgtGetNextOperation(CurrDisposition)
+ If NextDisposition <> GDB_ID.NULL Then
+ ' verifico che l'operazione sia una disposizione, altrimenti cerco
+ NextDisposition = GetNextDisposition(NextDisposition)
+ OmagOFFICEMap.refSplitModeVM.bOnAuxTab = IsDispUnloadOnAuxTab(NextDisposition) <> 0
+ End If
+ End If
+
+ ' verifico se è abilitata la tavola ausiliaria
If OmagOFFICEMap.refSplitModeVM.bOnAuxTab Then
- ' se sono all'ultima fase
+ ' se sono all'ultima fase inizializzo i comandi per il parcheggio dei pezzi sulla tavola ausiliaria
If OmagOFFICEMap.refFinalMoveRawModeVM.Init() Then
' disabilito il pulsante per procedere (sono abilitati i TAB)
NextIsEnabled = False
End If
End If
Else
+
' se verificata una interferenza allora esco
bOk = OmagOFFICEMap.refMoveRawModeVM.ExitMoveRaw()
If Not bOk Then Return
+
+ ' se la disposizione corrente è sulla tavola ausiliaria allora lo sarà anche quella successiva
+ If IsDispUnloadOnAuxTab(m_nCurrDisposition) <> 0 Then
+ EgtSetCurrPhase(m_nCurrPhase + 1)
+ m_nCurrDisposition = EgtGetNextOperation(m_nCurrDisposition)
+ m_nCurrPhase += 1
+ m_bToNext = False
+ m_bIsShow = True
+ EgtDraw()
+ ' abilitazione dei bottoni per la modifica...
+ Return
+ End If
+
MachiningMode = MachiningModeOpt.SPLIT
AutoVisibility = Visibility.Visible
OmagOFFICEMap.refSplitModeVM.InitSplitRaw()
diff --git a/OptionPanel/MachiningTab/MoveRawModeVM.vb b/OptionPanel/MachiningTab/MoveRawModeVM.vb
index 5d9c226..69bd6a7 100644
--- a/OptionPanel/MachiningTab/MoveRawModeVM.vb
+++ b/OptionPanel/MachiningTab/MoveRawModeVM.vb
@@ -8,6 +8,8 @@ Public Class MoveRawModeVM
' Fase corrente
Private m_nCurrPhase As Integer = 0
+
+ Private m_bToNext As Boolean = False
' Gestione movimento manuale perpendicolare
Private m_vtDir As New Vector3d ' direzione di movimento
Private m_ptMid As New Point3d ' punto medio del taglio
@@ -136,6 +138,7 @@ Public Class MoveRawModeVM
HideAllMachinings()
End If
m_nCurrPhase = EgtGetCurrPhase()
+ OmagOFFICEMap.refMachiningTabVM.nCurrPhase = m_nCurrPhase
' Aggiorno visualizzazione
EgtDraw()
' Carico i parametri di movimento
@@ -238,6 +241,44 @@ Public Class MoveRawModeVM
SpecialApplyDisposition(nDispId, True)
End If
End If
+
+ ' se la fase precedente è una disposizione allora restituisco false
+ Dim nPrevDispId As Integer = EgtGetPrevOperation(OmagOFFICEMap.refMachiningTabVM.nCurrDisposition)
+ ' verifico se la fasa precedente è di tipo scarico
+ If OmagOFFICEMap.refMachiningTabVM.IsDispUnloadOnAuxTab(nPrevDispId) <> 0 Then
+ EgtSetCurrPhase(OmagOFFICEMap.refMachiningTabVM.nCurrPhase - 1)
+ OmagOFFICEMap.refMachiningTabVM.nCurrDisposition = nPrevDispId
+ OmagOFFICEMap.refMachiningTabVM.nCurrPhase -= 1
+ OmagOFFICEMap.refMachiningTabVM.bPrev = False
+ OmagOFFICEMap.refMachiningTabVM.IsShow = True
+ EgtDraw()
+ Return False
+ End If
+
+ ' Nascondo eventuale tavola ausiliaria
+ If OmagOFFICEMap.refSplitModeVM.bOnAuxTab Then
+ EgtDisableModified()
+ EgtSetStatus(OmagOFFICEMap.refFinalMoveRawModeVM.nAuxTabId, GDB_ST.OFF)
+ EgtEnableModified()
+ EgtZoom(ZM.ALL, False)
+ ' se sto uscendo dalla pagina (non ho selezionato il comando per tornare indietro) allora ripristino la prima fase
+ If Not OmagOFFICEMap.refMachiningTabVM.bPrev Then
+ ' Cancello eventuale manipolatore pezzi
+ EgtDisableModified()
+ RemoveVacuumCups()
+ EgtEnableModified()
+ ' ritorno a fase 1
+ EgtSetCurrPhase(1)
+ ' Ripristino visualizzazione preview lavorazioni
+ ShowAllPhasesMachiningPreview()
+ End If
+ End If
+ ' Se torno indietro
+ If OmagOFFICEMap.refMachiningTabVM.bPrev Then
+ EgtSetCurrPhase(m_nCurrPhase - 1)
+ OmagOFFICEMap.refMachiningTabVM.bPrev = False
+ OmagOFFICEMap.refMachiningTabVM.IsShow = True
+ End If
Return True
End Function
@@ -407,6 +448,64 @@ Public Class MoveRawModeVM
Return False
End Function
+ Public Sub InsertPause()
+ ' verifico che ci sia almeno un elemto selezionato (dati di aggancio pezzo)
+ If m_RawMoveDataList.Count = 0 Then Return
+ ' verifico che sia stato inseito almeno uno spostamento, altrimenti lo rimuovo
+ Dim Index As Integer = 0
+ For Index = m_RawMoveDataList.Count - 1 To 0 Step -1
+ If Math.Abs(m_RawMoveDataList(Index).m_vtRawMove.x) < EPS_SMALL AndAlso Math.Abs(m_RawMoveDataList(Index).m_vtRawMove.y) < EPS_SMALL Then
+ m_RawMoveDataList.RemoveAt(Index)
+ End If
+ Next
+ ' verifico che la lista non sia vuota
+ If m_RawMoveDataList.Count = 0 Then Return
+
+ ' recupero disposizione fase corrente
+ Dim nDispId As Integer = EgtGetPhaseDisposition(OmagOFFICEMap.refMachiningTabVM.nCurrPhase)
+ ' imposto la pausa nella disposizione corrente
+ SetPause(nDispId)
+ ' aggiungo al gruppo disposizione dei sottogruppi con i dati di movimento dei grezzi spostati
+ SaveMoveInfoInDisposition(nDispId, m_RawMoveDataList)
+ ' imposto eventuale movimento pezzi su tavola ausiliaria
+ SaveMovePartsOnAuxTable(nDispId, OmagOFFICEMap.refSplitModeVM.bOnAuxTab)
+ '' Eseguo calcolo speciale dei movimenti: per tavola multicut
+ 'SpecialApplyDisposition(nDispId, True, Not m_SplitPage.m_bOnAuxTab)
+
+ ' Creo nuova fase
+ Dim nNewPhase As Integer = EgtAddPhase()
+
+ ' Eseguo eventuali spezzature dei grezzi e vi sposto i pezzi (i grezzi devono essere sempre copiati per Registrazione con rotazione)
+ Dim nRawId As Integer = EgtGetFirstRawPart()
+ While nRawId <> GDB_ID.NULL
+ ' se il grezzo è presente nella fase precedente e non è quello selezionato allora procedo a creare una copia nella nuova fase
+ If EgtVerifyRawPartPhase(nRawId, nNewPhase - 1) Then
+ Dim bKeepRawPart As Boolean = True
+ For Each RawOnAuxTabData As RawMoveData In m_RawMoveDataList
+ If nRawId = RawOnAuxTabData.m_nId Then
+ bKeepRawPart = False
+ Exit For
+ End If
+ Next
+ If bKeepRawPart Then EgtKeepRawPart(nRawId, nNewPhase - 1)
+ End If
+ ' passo al successivo grezzo
+ nRawId = EgtGetNextRawPart(nRawId)
+ End While
+
+ Dim nCurrDisposition As Integer = EgtGetPhaseDisposition(nNewPhase)
+ ' salvo la disposizione corrente
+ OmagOFFICEMap.refMachiningTabVM.nCurrDisposition = nCurrDisposition
+ ' EgtSetStatus(nRawIdSlected, GDB_ST.OFF)
+ EgtSetStatus(GetVacuumId(), GDB_ST.OFF)
+ EgtSetCurrPhase(nNewPhase)
+ OmagOFFICEMap.refFinalMoveRawModeVM.SetAuxTabInCurrDisposition()
+ ' ripulisco la lista degli spostamenti
+ m_RawMoveDataList.Clear()
+ ' aggiorno la fase corrente
+ m_nCurrPhase = EgtGetCurrPhase()
+ End Sub
+
#End Region ' METHODS
#Region "COMMANDS"
diff --git a/OptionPanel/MachiningTab/SplitModeVM.vb b/OptionPanel/MachiningTab/SplitModeVM.vb
index f40cc5f..329c336 100644
--- a/OptionPanel/MachiningTab/SplitModeVM.vb
+++ b/OptionPanel/MachiningTab/SplitModeVM.vb
@@ -68,7 +68,7 @@ Public Class SplitModeVM
End Property
Private m_bOnAuxTab As Boolean = False
- Public ReadOnly Property bOnAuxTab As Boolean
+ Public Property bOnAuxTab As Boolean
Get
Return m_bOnAuxTab
'Dim nCoutPhase As Integer = EgtGetPhaseCount()
@@ -77,6 +77,9 @@ Public Class SplitModeVM
' OmagOFFICEMap.refMachiningTabVM.bEnableOnAuxTab And
' EgtGetOperationType(EgtGetLastOperation()) = MCH_OY.DISP)
End Get
+ Set(value As Boolean)
+ m_bOnAuxTab = value
+ End Set
End Property
Private m_SplitModeIsEnabled As Boolean