|
|
|
@@ -17,6 +17,7 @@ Public Class MoveRawModeVM
|
|
|
|
|
Private m_bRemovedRaw As Boolean = False ' flag per rimozione manuale pezzi
|
|
|
|
|
Private m_RawMoveDataList As New List(Of RawMoveData) ' dati di movimento
|
|
|
|
|
Private m_bRawWithCups As Boolean = False ' flag per pezzo corrente con ventose
|
|
|
|
|
Private m_CurrRawOnVacuum As Integer = GDB_ID.NULL ' identificativo pezzo correntemente attaccato alle ventose
|
|
|
|
|
|
|
|
|
|
Private m_dMoveStep As Double
|
|
|
|
|
Public Property MoveStep As String
|
|
|
|
@@ -108,6 +109,17 @@ Public Class MoveRawModeVM
|
|
|
|
|
#Region "METHODS"
|
|
|
|
|
|
|
|
|
|
Friend Function InitMoveRaw() As Boolean
|
|
|
|
|
'' verifico che il pezzo sia depositabile
|
|
|
|
|
'If VerifyCollisionWithOtherRawPart(m_CurrRawOnVacuum) Then
|
|
|
|
|
' ' mantengo la selezione del pezzo
|
|
|
|
|
' EgtSetStatus(m_CurrRawOnVacuum, GDB_ST.SEL)
|
|
|
|
|
' OmagOFFICEMap.refStatusBarVM.SetOutputMessage("Collisione pezzi", 3, MSG_TYPE.ERROR_)
|
|
|
|
|
' EgtDraw()
|
|
|
|
|
' ' non cambio pagina
|
|
|
|
|
' Return False
|
|
|
|
|
'End If
|
|
|
|
|
' resetto l'inidice del pezzo da mnovimentare
|
|
|
|
|
m_CurrRawOnVacuum = GDB_ID.NULL
|
|
|
|
|
' Deseleziono tutto
|
|
|
|
|
EgtDeselectAll()
|
|
|
|
|
' Recupero i tagli allungati prima definiti
|
|
|
|
@@ -158,14 +170,14 @@ Public Class MoveRawModeVM
|
|
|
|
|
' Distanza iniziale
|
|
|
|
|
m_dCurrDist = 0
|
|
|
|
|
End If
|
|
|
|
|
' Non dovrebbe mai accadere, ma inizializzo con default
|
|
|
|
|
' Non dovrebbe mai accadere, ma inizializzo con default
|
|
|
|
|
Else
|
|
|
|
|
m_vtDir = Vector3d.Y_AX()
|
|
|
|
|
m_ptMid = Point3d.ORIG()
|
|
|
|
|
m_dOrigDist = 0
|
|
|
|
|
m_dCurrDist = 0
|
|
|
|
|
End If
|
|
|
|
|
' Altrimenti movimento con ventose
|
|
|
|
|
' Altrimenti movimento con ventose
|
|
|
|
|
Else
|
|
|
|
|
m_bRemovedRaw = False
|
|
|
|
|
m_bRawWithCups = False
|
|
|
|
@@ -182,7 +194,7 @@ Public Class MoveRawModeVM
|
|
|
|
|
If OmagOFFICEMap.refMachiningTabVM.ByHand Then
|
|
|
|
|
LRArrowVisibility = Visibility.Hidden
|
|
|
|
|
RotationVisibility = Visibility.Hidden
|
|
|
|
|
' Altrimenti per movimento con ventose
|
|
|
|
|
' Altrimenti per movimento con ventose
|
|
|
|
|
Else
|
|
|
|
|
LRArrowVisibility = Visibility.Visible
|
|
|
|
|
RotationVisibility = If(CurrentMachine.bRawSplMovRotate, Visibility.Visible, Visibility.Hidden)
|
|
|
|
@@ -195,6 +207,17 @@ Public Class MoveRawModeVM
|
|
|
|
|
End Function
|
|
|
|
|
|
|
|
|
|
Friend Function ExitMoveRaw() As Boolean
|
|
|
|
|
' verifico che il pezzo sia depositabile
|
|
|
|
|
If VerifyCollisionWithOtherRawPart(m_CurrRawOnVacuum) Then
|
|
|
|
|
' mantengo la selezione del pezzo
|
|
|
|
|
EgtSetStatus(m_CurrRawOnVacuum, GDB_ST.SEL)
|
|
|
|
|
OmagOFFICEMap.refStatusBarVM.SetOutputMessage("Collisione pezzi", 3, MSG_TYPE.ERROR_)
|
|
|
|
|
EgtDraw()
|
|
|
|
|
' non cambio pagina
|
|
|
|
|
Return False
|
|
|
|
|
End If
|
|
|
|
|
' resetto l'inidice del pezzo da mnovimentare
|
|
|
|
|
m_CurrRawOnVacuum = GDB_ID.NULL
|
|
|
|
|
' Deseleziono tutto
|
|
|
|
|
EgtDeselectAll()
|
|
|
|
|
' Se movimento con ventose
|
|
|
|
@@ -351,6 +374,39 @@ Public Class MoveRawModeVM
|
|
|
|
|
Return bOk
|
|
|
|
|
End Function
|
|
|
|
|
|
|
|
|
|
' Veririfica che il grezzo non entri in colliosione con altri pezzi
|
|
|
|
|
Private Function VerifyCollisionWithOtherRawPart(nIdOnVacumm As Integer) As Boolean
|
|
|
|
|
If nIdOnVacumm = GDB_ID.NULL Then Return False
|
|
|
|
|
' Creo gruppo temporaneo in cui generare le superfici per la veririfica di collisione
|
|
|
|
|
Dim m_nTempId As Integer = EgtCreateGroup(GDB_ID.ROOT)
|
|
|
|
|
If m_nTempId = GDB_ID.NULL Then Return False
|
|
|
|
|
EgtSetName(m_nTempId, "RawTemp")
|
|
|
|
|
Dim nIdActualRawOutLine As Integer = EgtGetFirstNameInGroup(nIdOnVacumm, "RawOutline")
|
|
|
|
|
Dim ActualRawFlatRegion As Integer = EgtCreateSurfFlatRegion(m_nTempId, nIdActualRawOutLine)
|
|
|
|
|
Dim nCurrPhase As Integer = EgtGetCurrPhase()
|
|
|
|
|
Dim nRawGroupId = EgtGetParent(EgtGetFirstRawPart())
|
|
|
|
|
Dim nIdRaw As Integer = EgtGetFirstRawPart()
|
|
|
|
|
' ciclo su tutti i grezzi per veririficare eventuali collisioni
|
|
|
|
|
While nIdRaw <> GDB_ID.NULL
|
|
|
|
|
' verifico la fase del grezzo
|
|
|
|
|
If EgtVerifyRawPartCurrPhase(nIdRaw) And nIdOnVacumm <> nIdRaw Then
|
|
|
|
|
' recupero il contorno del pezzo
|
|
|
|
|
Dim nIdRawOutLine As Integer = EgtGetFirstNameInGroup(nIdRaw, "RawOutline")
|
|
|
|
|
Dim nIdRawFlatRegion As Integer = EgtCreateSurfFlatRegion(m_nTempId, nIdRawOutLine)
|
|
|
|
|
If EgtSurfFrIntersect(nIdRawFlatRegion, ActualRawFlatRegion) Then
|
|
|
|
|
If EgtExistsObj(nIdRawFlatRegion) Then
|
|
|
|
|
EgtErase(m_nTempId)
|
|
|
|
|
' esiste una intersezione delle superfici
|
|
|
|
|
Return True
|
|
|
|
|
End If
|
|
|
|
|
End If
|
|
|
|
|
End If
|
|
|
|
|
nIdRaw = EgtGetNextRawPart(nIdRaw)
|
|
|
|
|
End While
|
|
|
|
|
EgtErase(m_nTempId)
|
|
|
|
|
Return False
|
|
|
|
|
End Function
|
|
|
|
|
|
|
|
|
|
#End Region ' METHODS
|
|
|
|
|
|
|
|
|
|
#Region "COMMANDS"
|
|
|
|
@@ -685,12 +741,34 @@ Public Class MoveRawModeVM
|
|
|
|
|
' Se trovato il grezzo
|
|
|
|
|
If nParentId = nRawGroupId Then
|
|
|
|
|
Dim nStat As Integer = GDB_ST.ON_
|
|
|
|
|
' Se il pezzo corrente è selezionato allora lo disattivo -> deposito del pezzo
|
|
|
|
|
EgtGetStatus(nId, nStat)
|
|
|
|
|
If nStat = GDB_ST.SEL Then
|
|
|
|
|
EgtSetStatus(nId, GDB_ST.ON_)
|
|
|
|
|
' Se con ventose, le nascondo
|
|
|
|
|
If Not OmagOFFICEMap.refMachiningTabVM.ByHand Then EgtSetStatus(GetVacuumId(), GDB_ST.OFF)
|
|
|
|
|
' prima di rilasciare il pezzo verifico che non vada in collisione con altri pezzi sulla tavola
|
|
|
|
|
If VerifyCollisionWithOtherRawPart(nId) Then
|
|
|
|
|
' mantengo la selezione del pezzo
|
|
|
|
|
EgtSetStatus(nId, GDB_ST.SEL)
|
|
|
|
|
OmagOFFICEMap.refStatusBarVM.SetOutputMessage("Collisione pezzi", 3, MSG_TYPE.ERROR_)
|
|
|
|
|
Else
|
|
|
|
|
' Se con ventose, le nascondo
|
|
|
|
|
If Not OmagOFFICEMap.refMachiningTabVM.ByHand Then EgtSetStatus(GetVacuumId(), GDB_ST.OFF)
|
|
|
|
|
End If
|
|
|
|
|
|
|
|
|
|
Else
|
|
|
|
|
|
|
|
|
|
' verifico che il pezzo precedente possa essere depositato correttamente
|
|
|
|
|
If VerifyCollisionWithOtherRawPart(m_CurrRawOnVacuum) Then
|
|
|
|
|
' mantengo la selezione del pezzo
|
|
|
|
|
EgtSetStatus(m_CurrRawOnVacuum, GDB_ST.SEL)
|
|
|
|
|
OmagOFFICEMap.refStatusBarVM.SetOutputMessage("Collisione pezzi", 3, MSG_TYPE.ERROR_)
|
|
|
|
|
EgtDraw()
|
|
|
|
|
' esco dal ciclo, prima devo depositare correttamente il pezzo
|
|
|
|
|
Exit While
|
|
|
|
|
End If
|
|
|
|
|
' salvo l'indice del pezzo correntemente attaccato alle ventose
|
|
|
|
|
m_CurrRawOnVacuum = nId
|
|
|
|
|
|
|
|
|
|
EgtDeselectAll()
|
|
|
|
|
EgtSetStatus(nId, GDB_ST.SEL)
|
|
|
|
|
' Se con ventose, le posiziono sul grezzo
|
|
|
|
@@ -736,6 +814,15 @@ Public Class MoveRawModeVM
|
|
|
|
|
End If
|
|
|
|
|
nId = EgtGetNextObjInSelWin()
|
|
|
|
|
End While
|
|
|
|
|
|
|
|
|
|
' clicco su un oggetto che non è un grezzo -> verifico che il pezzo precedente possa essere depositato correttamente
|
|
|
|
|
If VerifyCollisionWithOtherRawPart(m_CurrRawOnVacuum) Then
|
|
|
|
|
' mantengo la selezione del pezzo
|
|
|
|
|
EgtSetStatus(m_CurrRawOnVacuum, GDB_ST.SEL)
|
|
|
|
|
OmagOFFICEMap.refStatusBarVM.SetOutputMessage("Collisione pezzi", 3, MSG_TYPE.ERROR_)
|
|
|
|
|
EgtDraw()
|
|
|
|
|
End If
|
|
|
|
|
|
|
|
|
|
End Sub
|
|
|
|
|
|
|
|
|
|
#End Region ' EVENTS
|
|
|
|
|