OmagCUT :
- in nesting manuale per waterjet sistemata gestione ponticelli.
This commit is contained in:
+3
-6
@@ -304,12 +304,9 @@ Friend Module CamAuto
|
||||
Return bOk
|
||||
End Function
|
||||
|
||||
Friend Function ResetAllBRidges() As Boolean
|
||||
Dim bOk As Boolean = True
|
||||
Dim nMachGroup As Integer = EgtGetCurrMachGroup()
|
||||
Dim nBridgesGroup As Integer = EgtGetFirstNameInGroup(nMachGroup, "Bridges")
|
||||
bOk = EgtErase(nBridgesGroup)
|
||||
Return bOk
|
||||
Friend Function ResetAllBridges() As Boolean
|
||||
Dim nBridgesGroupId As Integer = EgtGetFirstNameInGroup(EgtGetCurrMachGroup(), "Bridges")
|
||||
Return EgtErase(nBridgesGroupId)
|
||||
End Function
|
||||
|
||||
Friend Function ResetAllSplitCut() As Boolean
|
||||
|
||||
+57
-75
@@ -1036,8 +1036,7 @@ Public Class NestPageUC
|
||||
If EgtIsPart(nPartId) Or bPartInTable Then
|
||||
Dim nStat As Integer = GDB_ST.ON_
|
||||
EgtGetStatus(nPartId, nStat)
|
||||
|
||||
' verifico se l'lemento selezionato è il numero di pezzi
|
||||
' verifico se l'elemento selezionato è il numero di pezzi
|
||||
If EgtGetType(nId) = GDB_TY.EXT_TEXT Then
|
||||
Dim NameLayer As String = String.Empty
|
||||
EgtGetName(EgtGetParent(nId), NameLayer)
|
||||
@@ -1065,7 +1064,6 @@ Public Class NestPageUC
|
||||
m_nIdToSel = nPartId
|
||||
End If
|
||||
End If
|
||||
|
||||
' Drag possibile
|
||||
m_bDrag = True
|
||||
Exit While
|
||||
@@ -1208,22 +1206,22 @@ Public Class NestPageUC
|
||||
End If
|
||||
If ModPointRegBtn.IsChecked Then
|
||||
' Ricavo il punto corrente in coordinate mondo
|
||||
Dim ptCurr_ As Point3d
|
||||
EgtUnProjectPoint(e.Location, ptCurr_)
|
||||
Dim ptWdCurr As New Point3d
|
||||
EgtUnProjectPoint(e.Location, ptWdCurr)
|
||||
' Ricavo il vettore di movimento
|
||||
Dim vtMove As Vector3d = ptCurr_ - m_ptPrev
|
||||
Dim vtMove As Vector3d = ptWdCurr - m_ptPrev
|
||||
MoveSpotRegistration(m_nCurrSpotRegId, vtMove)
|
||||
' Aggiorno il punto precedente
|
||||
m_ptPrev = ptCurr_
|
||||
m_ptPrev = ptWdCurr
|
||||
' Terminata esecuzione di drag
|
||||
m_bDragging = False
|
||||
Return
|
||||
End If
|
||||
|
||||
' Determino cosa muovere
|
||||
Dim nMoveId = If(m_nIdToSel <> GDB_ID.NULL, m_nIdToSel, GDB_ID.SEL)
|
||||
Dim nMoveId As Integer = If(m_nIdToSel <> GDB_ID.NULL, m_nIdToSel, GDB_ID.SEL)
|
||||
' Verifico se in tavola o in parcheggio
|
||||
Dim nTestId = If(nMoveId <> GDB_ID.SEL, nMoveId, EgtGetFirstSelectedObj())
|
||||
Dim nTestId As Integer = If(nMoveId <> GDB_ID.SEL, nMoveId, EgtGetFirstSelectedObj())
|
||||
If EgtGetParent(nTestId) <> m_nRawId Then
|
||||
' Dal parcheggio ammesso drag di un singolo pezzo
|
||||
If nMoveId = GDB_ID.SEL Then Return
|
||||
@@ -1263,16 +1261,16 @@ Public Class NestPageUC
|
||||
' Inizio esecuzione di drag
|
||||
m_bDragging = True
|
||||
' Ricavo il punto corrente in coordinate mondo
|
||||
Dim ptCurr As Point3d
|
||||
Dim ptCurr As New Point3d
|
||||
EgtUnProjectPoint(e.Location, ptCurr)
|
||||
|
||||
' la rotazione è attivabile solo se premuto il tasto Ctrl (e non sono in parheggio)
|
||||
m_bKeyCtrlPressed = m_bDrag AndAlso (Keyboard.Modifiers And ModifierKeys.Control) > 0
|
||||
|
||||
'-------------Inizio ROTAZIONE ----------------
|
||||
' Se richiesta ROTAZIONE
|
||||
If m_bKeyCtrlPressed AndAlso (Not m_bFromParking OrElse m_bKeyLeftShiftPressed) Then
|
||||
' Calcolo il centro di rotazione come centro del cluster
|
||||
Dim ptCen As Point3d
|
||||
Dim ptCen As New Point3d
|
||||
If Not EgtGetPartPartClusterCenterGlob(nMoveId, ptCen) Then Return
|
||||
' definisco il vettore dal centro del pezzo alla posizione del cursore
|
||||
Dim vtCurr As Vector3d = ptCurr - ptCen
|
||||
@@ -1313,10 +1311,9 @@ Public Class NestPageUC
|
||||
End If
|
||||
m_dStartAng = dVAng
|
||||
End If
|
||||
'-------------Fine ROTAZIONE ----------------
|
||||
|
||||
' Altrimenti richiesta TRASLAZIONE
|
||||
Else
|
||||
' -------------Inizio TRASLAZIONE ---------------
|
||||
' Ricavo il vettore di movimento
|
||||
Dim vtMove As Vector3d = ptCurr - m_ptPrev
|
||||
' Muovo i pezzi selezionati di quanto possibile
|
||||
@@ -1330,7 +1327,7 @@ Public Class NestPageUC
|
||||
If m_bVerify Then
|
||||
EgtMove(nMoveId, vtMove)
|
||||
m_vtTotMove += vtMove
|
||||
' altrimenti caso con verifica durante il movimento
|
||||
' altrimenti caso con verifica durante il movimento
|
||||
Else
|
||||
' Aggiorno regioni per nesting
|
||||
UpdateNestRegions()
|
||||
@@ -1360,11 +1357,12 @@ Public Class NestPageUC
|
||||
End If
|
||||
m_CurrProjPage.ResetOrderMachiningFlag()
|
||||
End If
|
||||
' -------------Fine TRASLAZIONE ---------------
|
||||
End If
|
||||
End If
|
||||
|
||||
' Aggiorno visualizzazione
|
||||
EgtDraw()
|
||||
|
||||
' Eventuale notifica al VeinMatching
|
||||
If m_bStartMove OrElse m_bStartRot Then
|
||||
If nMoveId = GDB_ID.SEL Then
|
||||
@@ -1382,10 +1380,10 @@ Public Class NestPageUC
|
||||
m_ptPrev = ptCurr
|
||||
' Terminata esecuzione di drag
|
||||
m_bDragging = False
|
||||
'' elimino il ponticello associato: nella visualizzazione il percorso di lavorazioni non si muove! in attesa di gestione
|
||||
'DeleteBridgeAssociated(nMoveId)
|
||||
' Resetto i ponticelli (per ora non sono in grado di muoverli assieme ai pezzi)
|
||||
ResetAllBRidges()
|
||||
' Elimino eventuale ponticello associato (con ricalcolo lavorazioni)
|
||||
If DeleteBridgeAssociated(nMoveId) Then
|
||||
ResetAllMachinings()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub OnMyMouseUpScene(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles m_CurrProjPage.OnMouseUpScene
|
||||
@@ -1521,7 +1519,7 @@ Public Class NestPageUC
|
||||
If ParkIndBtn.IsChecked Then
|
||||
m_SelParkInd.UpdateList()
|
||||
End If
|
||||
' Non superata riporto alla posizione iniziale
|
||||
' Non superata riporto alla posizione iniziale
|
||||
Else
|
||||
If m_bFromParking Then
|
||||
m_CurrProjPage.ClearMessage()
|
||||
@@ -2728,10 +2726,13 @@ Public Class NestPageUC
|
||||
GetFamilyGroupInPark()
|
||||
EgtSetCurrentContext(m_CurrProjPage.CurrentProjectScene.GetCtx())
|
||||
' Ciclo di parcheggio dei pezzi selezionati
|
||||
Dim bNeedRecalc As Boolean= False
|
||||
Dim nId As Integer = EgtGetFirstSelectedObj()
|
||||
While nId <> GDB_ID.NULL
|
||||
' Recupero indice del successivo
|
||||
Dim nNextId = EgtGetNextSelectedObj()
|
||||
' elimino eventuali ponticelli associati al pezzo
|
||||
If DeleteBridgeAssociated(nId) Then bNeedRecalc = True
|
||||
' Metto in parcheggio, se in grezzo
|
||||
StoreOnePart(nId)
|
||||
' Aggiorno lo stato di visualizzazione
|
||||
@@ -2747,6 +2748,8 @@ Public Class NestPageUC
|
||||
End While
|
||||
' Imposto flag posizione pezzi su parcheggio
|
||||
m_nPartPos = PART_POS.NONE_TABLE
|
||||
' Se necessario eseguo ricalcolo lavorazioni
|
||||
If bNeedRecalc Then ResetAllMachinings()
|
||||
' Aggiorno vista
|
||||
EgtZoom(ZM.ALL)
|
||||
' Aggiorno la lista dei parcheggi
|
||||
@@ -2764,12 +2767,8 @@ Public Class NestPageUC
|
||||
(m_nRawId <> GDB_ID.NULL AndAlso EgtGetParent(nId) = m_nRawId) Then
|
||||
' Ripristino lo stato originale
|
||||
PreRemoveOnePart(nId)
|
||||
|
||||
'---------------------- COUNTER PART ----------------------
|
||||
' se esiste almento un pezzo del gruppo in parcheggio esco
|
||||
If ParkInGroupFamily(nId) Then Return True
|
||||
'---------------------- COUNTER PART ----------------------
|
||||
|
||||
' Parcheggio
|
||||
PackPartInStore(nId)
|
||||
' Aggiusto la posizione in Z
|
||||
@@ -2842,9 +2841,7 @@ Public Class NestPageUC
|
||||
If EgtGetFirstSelectedObj() = GDB_ID.NULL Then Return
|
||||
' Chiedo conferma prima di procedere
|
||||
Dim RemovePartWnd As EgtMsgBox = New EgtMsgBox(m_MainWindow, "", EgtMsg(91121), EgtMsgBox.Buttons.OK_CANCEL, EgtMsgBox.Icons.NULL)
|
||||
If RemovePartWnd.m_nPressedBtn = 0 Then
|
||||
Return
|
||||
End If
|
||||
If RemovePartWnd.m_nPressedBtn = 0 Then Return
|
||||
' Verifico se ci sono pezzi provenienti da liste Csv
|
||||
Dim bCsvParts As Boolean = False
|
||||
Dim nId As Integer = EgtGetFirstSelectedObj()
|
||||
@@ -2871,13 +2868,12 @@ Public Class NestPageUC
|
||||
End Select
|
||||
End If
|
||||
' Ciclo di cancellazione dei pezzi selezionati
|
||||
Dim bNeedRecalc As Boolean = False
|
||||
Dim dEraseArea As Double = 0
|
||||
nId = EgtGetFirstSelectedObj()
|
||||
While nId <> GDB_ID.NULL
|
||||
'' elimino eventuali ponticelli associati al pezzo: nella vilualizzazione il percorso di lavorazioni non si muove! in attesa di gestione
|
||||
'DeleteBridgeAssociated(nId)
|
||||
' Resetto i ponticelli (per ora non sono in grado di muoverli assieme ai pezzi)
|
||||
ResetAllBRidges()
|
||||
' elimino eventuali ponticelli associati al pezzo
|
||||
If DeleteBridgeAssociated(nId) Then bNeedRecalc = True
|
||||
' Recupero indice del successivo
|
||||
Dim nNextId = EgtGetNextSelectedObj()
|
||||
' Se abilitata cancellazione in ogni caso o pezzo non da Csv
|
||||
@@ -2886,18 +2882,16 @@ Public Class NestPageUC
|
||||
dEraseArea += GeomCalc.GetPartArea(nId)
|
||||
' Se pezzo in parcheggio cancello direttamente
|
||||
If EgtIsPart(nId) Then
|
||||
'---------------------- COUNTER PART ----------------------
|
||||
' recupero eventuale GUID del gruppo di pezzi
|
||||
Dim sRefGroup As String = String.Empty
|
||||
' recupero l'GUID del gruppo
|
||||
EgtGetInfo(nId, INFO_REFGROUP, sRefGroup)
|
||||
'---------------------- COUNTER PART ----------------------
|
||||
' Rimuovo le lavorazioni
|
||||
EraseMachinings(nId)
|
||||
' Cancello
|
||||
EgtErase(nId)
|
||||
' aggiorno il layer che indica il numero di pezzi in parcheggio (se sRefGroup<>"")
|
||||
' aggiorno il layer che indica il numero di pezzi in parcheggio
|
||||
CountPartInFamily(sRefGroup)
|
||||
' Altrimenti pezzo nel grezzo
|
||||
' Altrimenti pezzo nel grezzo
|
||||
ElseIf EgtGetParent(nId) = m_nRawId Then
|
||||
If EgtRemovePartFromRawPart(nId) Then
|
||||
' Eventuale notifica al VeinMatching
|
||||
@@ -2919,6 +2913,8 @@ Public Class NestPageUC
|
||||
m_CurrProjPage.UpdateTotalArea(-dEraseArea)
|
||||
m_CurrProjPage.UpdateToProduceArea()
|
||||
m_CurrProjPage.ShowAreas()
|
||||
' Se necessario eseguo ricalcolo lavorazioni
|
||||
If bNeedRecalc Then ResetAllMachinings()
|
||||
' Aggiorno vista
|
||||
EgtZoom(ZM.ALL)
|
||||
' Aggiorno la lista dei parcheggi
|
||||
@@ -2966,46 +2962,32 @@ Public Class NestPageUC
|
||||
Return nCount
|
||||
End Function
|
||||
|
||||
Private Sub DeleteBridgeAssociated(nMyId As Integer)
|
||||
' verifico se esistono dei ponticelli associati al pezzo indicato
|
||||
' recuoero il gruppo di lavorazione corrente
|
||||
Dim nIdCurrMachGroup As Integer = EgtGetCurrMachGroup()
|
||||
' creo il gruppo per i ponticelli
|
||||
Dim sNameGroup As String = BRIDGES
|
||||
Dim nIdBridgesGroup As Integer = EgtGetFirstNameInGroup(nIdCurrMachGroup, sNameGroup)
|
||||
If nIdBridgesGroup <> GDB_ID.NULL Then
|
||||
' carico la prima entità del gruppo BRIDGES
|
||||
Dim nIdBridgeLine As Integer = GDB_ID.NULL
|
||||
nIdBridgeLine = EgtGetFirstNameInGroup(nIdBridgesGroup, BRIDGELINE)
|
||||
' ciclo su tutte le entità
|
||||
While nIdBridgeLine <> GDB_ID.NULL
|
||||
Dim nNextBridgeLine As Integer = GDB_ID.NULL
|
||||
Dim nIdPart As Integer = GDB_ID.NULL
|
||||
If EgtGetInfo(nIdBridgeLine, "PartStart", nIdPart) Then
|
||||
If nIdPart = nMyId Then
|
||||
nNextBridgeLine = EgtGetNext(nIdBridgeLine)
|
||||
' il ponticello deve essere eliminato
|
||||
EgtErase(nIdBridgeLine)
|
||||
nIdBridgeLine = nNextBridgeLine
|
||||
' riparto dall'inizio del ciclo
|
||||
Continue While
|
||||
End If
|
||||
Private Function DeleteBridgeAssociated(nMyPartId As Integer) As Boolean
|
||||
' Se non c'è il gruppo dei ponticelli, ho finito
|
||||
Dim nCurrMachGroupId As Integer = EgtGetCurrMachGroup()
|
||||
Dim nBridgesGroupId As Integer = EgtGetFirstNameInGroup(nCurrMachGroupId, BRIDGES)
|
||||
If nBridgesGroupId = GDB_ID.NULL Then Return False
|
||||
' Ciclo su tutte le entità del gruppo
|
||||
Dim bErased As Boolean = False
|
||||
Dim nBridgeLineId As Integer = EgtGetFirstNameInGroup(nBridgesGroupId, BRIDGELINE)
|
||||
While nBridgeLineId <> GDB_ID.NULL
|
||||
Dim nNextBrLnId As Integer = EgtGetNext(nBridgeLineId)
|
||||
Dim nIdPart As Integer = GDB_ID.NULL
|
||||
If EgtGetInfo(nBridgeLineId, INFO_BRIDGE_PARTSTART, nIdPart) AndAlso nIdPart = nMyPartId Then
|
||||
If EgtExistsObj( nBridgeLineId) Then
|
||||
EgtErase(nBridgeLineId)
|
||||
bErased = True
|
||||
End If
|
||||
If EgtGetInfo(nIdBridgeLine, "PartEnd", nIdPart) Then
|
||||
If nIdPart = nMyId Then
|
||||
nNextBridgeLine = EgtGetNext(nIdBridgeLine)
|
||||
' il ponticello deve essere eliminato
|
||||
EgtErase(nIdBridgeLine)
|
||||
nIdBridgeLine = nNextBridgeLine
|
||||
' riparto dall'inizio del ciclo
|
||||
Continue While
|
||||
End If
|
||||
ElseIf EgtGetInfo(nBridgeLineId, INFO_BRIDGE_PARTEND, nIdPart) AndAlso nIdPart = nMyPartId Then
|
||||
If EgtExistsObj( nBridgeLineId) Then
|
||||
EgtErase(nBridgeLineId)
|
||||
bErased = True
|
||||
End If
|
||||
' il BridgeLine corrente non contiene riferimeti al pezzo da eliminare
|
||||
nIdBridgeLine = EgtGetNext(nIdBridgeLine)
|
||||
End While
|
||||
End If
|
||||
End Sub
|
||||
End If
|
||||
nBridgeLineId = nNextBrLnId
|
||||
End While
|
||||
Return bErased
|
||||
End Function
|
||||
|
||||
Private Sub SelectAllBtn_Click(sender As Object, e As RoutedEventArgs) Handles SelectAllBtn.Click
|
||||
EgtSetCurrentContext(m_CurrProjPage.CurrentProjectScene.GetCtx())
|
||||
|
||||
@@ -297,11 +297,11 @@ Public Class SplitPageUC
|
||||
EgtModifyCurveEndPoint(m_nIdBridge, m_ptEndBridge, GDB_RT.GLOB)
|
||||
If VerifyInterference(m_nIdBridge) Then
|
||||
m_CurrProjPage.ClearMessage()
|
||||
EgtSetInfo(m_nIdBridge, "PartStart", m_nIdSelectedPartWJ_Srt)
|
||||
EgtSetInfo(m_nIdBridge, "EntStart", m_nIdSelectedSideWJ_Srt)
|
||||
EgtSetInfo(m_nIdBridge, "PartEnd", m_nIdSelectedPartWJ_End)
|
||||
EgtSetInfo(m_nIdBridge, "EntEnd", m_nIdSelectedSideWJ_End)
|
||||
EgtSetInfo(m_nIdBridge, "Ph", EgtGetCurrPhase())
|
||||
EgtSetInfo(m_nIdBridge, INFO_BRIDGE_PARTSTART, m_nIdSelectedPartWJ_Srt)
|
||||
EgtSetInfo(m_nIdBridge, INFO_BRIDGE_ENTSTART, m_nIdSelectedSideWJ_Srt)
|
||||
EgtSetInfo(m_nIdBridge, INFO_BRIDGE_PARTEND, m_nIdSelectedPartWJ_End)
|
||||
EgtSetInfo(m_nIdBridge, INFO_BRIDGE_ENTEND, m_nIdSelectedSideWJ_End)
|
||||
EgtSetInfo(m_nIdBridge, INFO_BRIDGE_PHASE, EgtGetCurrPhase())
|
||||
' Ricalcolo tutte le lavorazioni
|
||||
Dim nWarn As Integer = 0
|
||||
ResetAllMachinings(nWarn)
|
||||
|
||||
@@ -365,6 +365,16 @@ Module ConstGen
|
||||
Public Const BRIDGES As String = "Bridges"
|
||||
' Nome dell'entità ponticello contenuta nel gruppo BRIDGES
|
||||
Public Const BRIDGELINE As String = "BridgeLine"
|
||||
' Info dell'Id pezzo di partenza del ponticello
|
||||
Public Const INFO_BRIDGE_PARTSTART As String = "PartStart"
|
||||
' Info dell'Id entita' di partenza del ponticello
|
||||
Public Const INFO_BRIDGE_ENTSTART As String = "EntStart"
|
||||
' Info dell'Id pezzo di arrivo del ponticello
|
||||
Public Const INFO_BRIDGE_PARTEND As String = "PartEnd"
|
||||
' Info dell'Id entita' di arrivo del ponticello
|
||||
Public Const INFO_BRIDGE_ENTEND As String = "EntEnd"
|
||||
' Info con la fase di appartenenza del ponticello
|
||||
Public Const INFO_BRIDGE_PHASE As String = "Ph"
|
||||
|
||||
' utensile per le lavorazioni manuali
|
||||
Public Const DUMMY_SAW As String = "DummySAW"
|
||||
|
||||
@@ -302,7 +302,7 @@ Public Class ProjectMgrUC
|
||||
' cancello tutti i punti di inizio (Waterjet)
|
||||
ResetAllStartCurv()
|
||||
' cancello tutti i ponticelli disegnati
|
||||
ResetAllBRidges()
|
||||
ResetAllBridges()
|
||||
' cancella tutti i tagli di separazione inseriti in OFFICE
|
||||
ResetAllSplitCut()
|
||||
|
||||
@@ -315,7 +315,7 @@ Public Class ProjectMgrUC
|
||||
Dim nWarn As Integer = 0
|
||||
ResetAllMachinings(nWarn)
|
||||
If nWarn = 1 Then m_CurrProjPage.SetWarningMessage(EgtMsg(90351)) ' Lama troppo grande per utilizzo ventosa
|
||||
' Se eistono elimino i grezzi delle fasi che non contengono lavorazioni
|
||||
' Se esistono elimino i grezzi delle fasi che non contengono lavorazioni
|
||||
ResetAllRawPart()
|
||||
' Aggiorno Info C Home
|
||||
Dim dCHome As Double
|
||||
@@ -335,14 +335,14 @@ Public Class ProjectMgrUC
|
||||
' cancello tutti i punti di inizio (Waterjet)
|
||||
ResetAllStartCurv()
|
||||
' cancello tutti i ponticelli disegnati
|
||||
ResetAllBRidges()
|
||||
ResetAllBridges()
|
||||
' cancella tutti i tagli di separazione inseriti in OFFICE
|
||||
ResetAllSplitCut()
|
||||
' Ricalcolo tutte le lavorazioni
|
||||
Dim nWarn As Integer = 0
|
||||
ResetAllMachinings(nWarn)
|
||||
If nWarn = 1 Then m_CurrProjPage.SetWarningMessage(EgtMsg(90351)) ' Lama troppo grande per utilizzo ventosa
|
||||
' Se eistono elimino i grezzi delle fasi che non contengono lavorazioni
|
||||
' Se esistono elimino i grezzi delle fasi che non contengono lavorazioni
|
||||
ResetAllRawPart()
|
||||
' Aggiorno Info C Home
|
||||
Dim dCHome As Double
|
||||
|
||||
@@ -713,8 +713,6 @@ Public Class RawPartPageUC
|
||||
End Select
|
||||
' Aggiorno il punto precedente
|
||||
m_ptPrev = ptTemp
|
||||
' Resetto i ponticelli (per ora non sono in grado di muoverli assieme ai pezzi)
|
||||
ResetAllBRidges()
|
||||
End Sub
|
||||
|
||||
Private Sub ModifyRectangle(ptCurr As Point3d)
|
||||
|
||||
Reference in New Issue
Block a user