Compare commits

...

13 Commits

Author SHA1 Message Date
NicolaP a568c614fb Migliorata gestione deposito su tavola ausiliaria 2022-10-03 19:14:22 +02:00
NicolaP 6dc5fe5a12 Gestione modifica per scarico su tavola 2 2022-10-03 18:23:20 +02:00
NicolaP c3abca3cee Inizio gestione modifica per spostamenti 2022-09-22 20:16:19 +02:00
NicolaP 9c60ef020f Sacrico tutti i pezzi da tavola ausiliaria 2022-09-21 18:56:49 +02:00
NicolaP ab525c7431 Aggiunta modifica 2022-09-21 17:55:33 +02:00
NicolaP 613b9fa725 Correzione gestione salvataggio fase 2022-09-21 17:52:51 +02:00
NicolaP 41903872b1 Definita funzione per il salvataggio TabAux (ERRORE simulazione) 2022-09-05 12:13:26 +02:00
NicolaP beb3ce841b Inizio gestione creazione grezzi per scarico (ERRORI simulazione) 2022-09-01 20:29:46 +02:00
NicolaP 4a2da4ac41 Merge branch 'Features/Waterjet_Bridges' into develop 2022-09-01 11:23:20 +02:00
NicolaP 869b459c3b Introduzione costanti Bridges e BridgeLine 2022-08-31 17:55:20 +02:00
NicolaP aa84b2c8ab Gestione verifica interferenza Bridge-Region 2022-08-31 17:47:08 +02:00
NicolaP 555d2d029f Gestione eliminazione Ponticelli WaterJet (manca verifica interferenza) 2022-08-31 15:13:46 +02:00
NicolaP 749fb2d949 Gestione creazione di Ponticelli WaterJet 2022-08-30 17:43:34 +02:00
11 changed files with 529 additions and 47 deletions
+9 -1
View File
@@ -93,7 +93,7 @@ Friend Module CamAuto
If nPrjType = CurrentProjectPageUC.PRJ_TYPE.FLATS Then
' Reinserisco tutte le lavorazioni piane
AddMachinings(GDB_ID.NULL, nWarn)
' Se altrimenti progetto con cornici
' Se altrimenti progetto con cornici
ElseIf nPrjType = CurrentProjectPageUC.PRJ_TYPE.FRAMES Then
' Reinserisco tutte le lavorazioni delle cornici
AddFrameMachinings(m_MainWindow.m_FrameCutPageUC.m_FrameMachiningUC.m_dStartTrim, m_MainWindow.m_FrameCutPageUC.m_FrameMachiningUC.m_dEndTrim)
@@ -155,6 +155,14 @@ 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
End Function
' verifico che il contorno passato non sia stato separato
Friend Function VerifyOutLoopIsClosed(nIdLayerOutLoop As Integer)
Dim nIdMy As Integer = EgtGetFirstInGroup(nIdLayerOutLoop)
+5 -3
View File
@@ -155,9 +155,11 @@
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="10*"/>
</Grid.ColumnDefinitions>
</Grid>
<!-- Inserimento della pausa durante il movimento sulla tavola di scarico-->
<Button Name="PauseBtn" Grid.Column="1" Style="{DynamicResource OmagCut_YellowIconButton}">
<Image Source="{DynamicResource Pausa-ON_OFFImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
</Button>
</Grid>
</Grid>
+192 -36
View File
@@ -11,8 +11,12 @@ Public Class MoveRawPartPage
Private m_nAuxTabId As Integer = GDB_ID.NULL
' Fase corrente
Private m_nCurrPhase As Integer = 0
' Disposizione corrente
Private m_nCurrDisposition As Integer = GDB_ID.NULL
' Premuto Prev
Private m_bPrev As Boolean = False
' Pemuto Next
Private m_bToNext As Boolean = False
' Dati movimento
Private m_dStep As Double = 0
Private m_dRotation As Double = 0
@@ -41,6 +45,8 @@ Public Class MoveRawPartPage
m_CurrProjPage = m_MainWindow.m_CurrentProjectPageUC
m_SplitPage = m_MainWindow.m_CadCutPageUC.m_SplitPage
m_bActive = True
' resetto l'inidice del pezzo da mnovimentare
m_CurrRawOnVacuum = GDB_ID.NULL
' Leggo tipo movimento grezzi
m_bByHand = (GetVacuumType() = 0 Or
Not m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.AUTO_MANIP) Or
@@ -68,29 +74,9 @@ Public Class MoveRawPartPage
m_nCurrPhase = EgtGetCurrPhase()
' Se movimento pezzi finale, sistemazioni per tavolo ausiliario
If m_SplitPage.m_bOnAuxTab Then
m_nAuxTabId = EgtGetTableId(AUX_TAB)
' Visualizzo tavolo ausiliario
Dim bOldEnMod As Boolean = EgtGetEnableModified()
If bOldEnMod Then EgtDisableModified()
EgtSetStatus(m_nAuxTabId, GDB_ST.ON_)
If bOldEnMod Then EgtEnableModified()
' Se definizione movimenti
If Not m_SplitPage.m_bShow Then
' Area tavolo ausiliario
Dim b3AuxTab As New BBox3d
EgtGetBBoxGlob(EgtGetFirstNameInGroup(m_nAuxTabId, "A1"), GDB_BB.STANDARD, b3AuxTab)
' Area tavolo principale
Dim b3Tab As New BBox3d
EgtGetTableArea(1, b3Tab)
' Imposto offset su tavolo principale per includere anche il secondario
Dim dOffsXP As Double = Math.Max(b3AuxTab.Max().x - b3Tab.Max().x, 0)
Dim dOffsYP As Double = Math.Max(b3AuxTab.Max().y - b3Tab.Max().y, 0)
Dim dOffsXM As Double = Math.Max(b3Tab.Min().x - b3AuxTab.Min().x, 0)
Dim dOffsYM As Double = Math.Max(b3Tab.Min().y - b3AuxTab.Min().y, 0)
EgtSetTableAreaOffset(dOffsXP, dOffsYP, dOffsXM, dOffsYM)
End If
EgtZoom(ZM.ALL)
' altrimenti, aggiorno visualizzazione
' assegnazione delle info tavola ausiliaria alla dispozione corrente
SetAuxTabInCurrDisposition()
' altrimenti, aggiorno visualizzazione
Else
EgtDraw()
End If
@@ -164,8 +150,9 @@ Public Class MoveRawPartPage
TopRBtn.Visibility = Windows.Visibility.Hidden
BottomLBtn.Visibility = Windows.Visibility.Hidden
BottomRBtn.Visibility = Windows.Visibility.Hidden
PauseBtn.Visibility = Windows.Visibility.Hidden
ResetBtn.Visibility = Windows.Visibility.Hidden
' altrimenti per movimento con ventose
' altrimenti per movimento con ventose
ElseIf Not m_SplitPage.m_bOnAuxTab Then
UpBtn.Visibility = Windows.Visibility.Visible
LeftBtn.Visibility = Windows.Visibility.Visible
@@ -180,8 +167,9 @@ Public Class MoveRawPartPage
TopRBtn.Visibility = Windows.Visibility.Hidden
BottomLBtn.Visibility = Windows.Visibility.Hidden
BottomRBtn.Visibility = Windows.Visibility.Hidden
PauseBtn.Visibility = Windows.Visibility.Hidden
ResetBtn.Visibility = Windows.Visibility.Hidden
' altrimenti per movimento finale dei pezzi
' altrimenti per movimento finale dei pezzi
Else
UpBtn.Visibility = Windows.Visibility.Hidden
LeftBtn.Visibility = Windows.Visibility.Hidden
@@ -196,14 +184,47 @@ Public Class MoveRawPartPage
TopRBtn.Visibility = Windows.Visibility.Visible
BottomLBtn.Visibility = Windows.Visibility.Visible
BottomRBtn.Visibility = Windows.Visibility.Visible
PauseBtn.Visibility = Windows.Visibility.Visible
ResetBtn.Visibility = Windows.Visibility.Visible
End If
' salvo l'idice della fase corrente
m_nCurrDisposition = EgtGetPhaseDisposition(m_nCurrPhase)
' Abilitazione bottone modifica
ModifyBtn.IsEnabled = m_SplitPage.m_bShow
' gestione abilitazione altri bottoni
EnableButtons()
End Sub
Private Sub SetAuxTabInCurrDisposition()
' Se movimento pezzi finale, sistemazioni per tavolo ausiliario
m_nAuxTabId = EgtGetTableId(AUX_TAB)
' Visualizzo tavolo ausiliario
Dim bOldEnMod As Boolean = EgtGetEnableModified()
If bOldEnMod Then EgtDisableModified()
EgtSetStatus(m_nAuxTabId, GDB_ST.ON_)
If bOldEnMod Then EgtEnableModified()
' Se definizione movimenti
If Not m_SplitPage.m_bShow Then
' Area tavolo ausiliario
Dim b3AuxTab As New BBox3d
EgtGetBBoxGlob(EgtGetFirstNameInGroup(m_nAuxTabId, "A1"), GDB_BB.STANDARD, b3AuxTab)
' Area tavolo principale
Dim b3Tab As New BBox3d
EgtGetTableArea(1, b3Tab)
' Imposto offset su tavolo principale per includere anche il secondario
Dim dOffsXP As Double = Math.Max(b3AuxTab.Max().x - b3Tab.Max().x, 0)
Dim dOffsYP As Double = Math.Max(b3AuxTab.Max().y - b3Tab.Max().y, 0)
Dim dOffsXM As Double = Math.Max(b3Tab.Min().x - b3AuxTab.Min().x, 0)
Dim dOffsYM As Double = Math.Max(b3Tab.Min().y - b3AuxTab.Min().y, 0)
EgtSetTableAreaOffset(dOffsXP, dOffsYP, dOffsXM, dOffsYM)
End If
EgtZoom(ZM.ALL)
' verifico che siano state salvate correttamente le info della tavola di scarico
EgtSaveFile("c:\EgtData\OmagCUT\Temp\AuxTab.nge", NGE.BIN)
End Sub
Private Sub OnMyMouseDownScene(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles m_CurrProjPage.OnMouseDownScene
' Verifico di essere il gestore attivo
If Not m_bActive Then Return
@@ -235,14 +256,14 @@ Public Class MoveRawPartPage
' Se il pezzo corrente è selezionato allora lo disattivo -> deposito del pezzo
If nStat = GDB_ST.SEL Then
EgtSetStatus(nId, GDB_ST.ON_)
' prima di rilasciare il pezzo verifico che non vada in collisione con altri pezzi sulla tavola
' prima di rilasciare il pezzo verifico che non vada in collisione con altri pezzi sulla tavola (evito il controllo se ultima fase)
If VerifyCollisionWithOtherRawPart(nId) Then
' mantengo la selezione del pezzo
EgtSetStatus(nId, GDB_ST.SEL)
m_CurrProjPage.SetErrorMessage("Collisione pezzi")
Else
' Se con ventose, le nascondo
If Not m_bByHand Then EgtSetStatus(GetVacuumId(), GDB_ST.OFF)
' mantengo la selezione del pezzo
EgtSetStatus(nId, GDB_ST.SEL)
m_CurrProjPage.SetErrorMessage("Collisione pezzi")
Else
' Se con ventose, le nascondo
If Not m_bByHand Then EgtSetStatus(GetVacuumId(), GDB_ST.OFF)
End If
Else
@@ -316,6 +337,8 @@ Public Class MoveRawPartPage
' Veririfica che il grezzo non entri in colliosione con altri pezzi
Private Function VerifyCollisionWithOtherRawPart(nIdOnVacumm As Integer) As Boolean
' se movimento su tavola di scarico non eseguo il controllo (evito di segnalre errori per pezzi ricavati interni al grezzo...)
If m_SplitPage.m_bOnAuxTab Then Return False
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)
@@ -763,6 +786,16 @@ Public Class MoveRawPartPage
Next
If Not bOkRotate Then Return
Else
' sposto il pezzo in centro tavola → perchè tutti i movimenti sono fatti ruotando il pezzo in centro tavola!
Dim b3Area As New BBox3d
EgtGetTableArea(1, b3Area)
Dim b3RawTemp As New BBox3d
EgtGetRawPartBBox(nRawId, b3RawTemp)
' ricavo il riferimento dell'angolo in basso a sinstra del grezzo rispetto alla tavola
Dim ptCorner As Point3d = New Point3d(b3Area.DimX / 2, b3Area.DimY / 2, 0) - New Vector3d(b3RawTemp.DimX / 2, b3RawTemp.DimY / 2, 0)
' sposto il pezzo in questa posizione
EgtMoveToCornerRawPart(nRawId, ptCorner, MCH_CR.BL)
' riprovo il movimento
If EgtRotateRawPart(nRawId, Vector3d.Z_AX(), -dAngRaw) Then
If Not EgtMoveToCornerRawPart(nRawId, ptRef, nCorn) Then
' riposiziono il pezzo come era prima
@@ -877,6 +910,62 @@ Public Class MoveRawPartPage
Return True
End Function
Private Sub PauseBtn_Click(sender As Object, e As RoutedEventArgs) Handles PauseBtn.Click
' 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(m_nCurrPhase)
' 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, m_SplitPage.m_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)
SetPause(nCurrDisposition)
m_nCurrDisposition = nCurrDisposition
' EgtSetStatus(nRawIdSlected, GDB_ST.OFF)
EgtSetStatus(GetVacuumId(), GDB_ST.OFF)
EgtSetCurrPhase(nNewPhase)
SetAuxTabInCurrDisposition()
' ripulisco la lista degli spostamenti
m_RawMoveDataList.Clear()
' aggiorno la fase corrente
m_nCurrPhase = EgtGetCurrPhase()
End Sub
Private Sub ResetBtn_Click(sender As Object, e As RoutedEventArgs) Handles ResetBtn.Click
' Recupero il primo grezzo selezionato
Dim nRawId As Integer = EgtGetFirstSelectedObj()
@@ -912,7 +1001,30 @@ Public Class MoveRawPartPage
EgtDeselectAll()
' Torno alla fase precedente
m_bPrev = True
' Passo alla pagina delle spezzature
' 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) Then
EgtSetCurrPhase(m_nCurrPhase - 1)
m_nCurrDisposition = nPrevDispId
m_nCurrPhase -= 1
m_bPrev = False
m_SplitPage.m_bShow = True
EgtDraw()
Return
End If
'If EgtGetOperationType(EgtGetPrevOperation(m_nCurrDisposition)) = MCH_OY.DISP AndAlso m_SplitPage.m_bOnAuxTab Then
' EgtSetCurrPhase(m_nCurrPhase - 1)
' m_nCurrDisposition = EgtGetPrevOperation(m_nCurrDisposition)
' m_nCurrPhase -= 1
' m_bPrev = False
' m_SplitPage.m_bShow = True
' EgtDraw()
' Return
'End If
m_MainWindow.m_CadCutPageUC.CadCutPageGrid.Children.Remove(Me)
m_MainWindow.m_CadCutPageUC.CadCutPageGrid.Children.Add(m_SplitPage)
m_MainWindow.m_CadCutPageUC.m_CadCutMode = CadCutPageUC.CadCutModes.Split
@@ -928,6 +1040,19 @@ Public Class MoveRawPartPage
' non cambio pagina
Return
End If
' se la disposizione corrente è sulla tavola ausiliaria allora lo sarà anche quella successiva
If IsDispUnloadOnAuxTab(m_nCurrDisposition) Then
EgtSetCurrPhase(m_nCurrPhase + 1)
m_nCurrDisposition = EgtGetNextOperation(m_nCurrDisposition)
m_nCurrPhase += 1
m_bToNext = False
m_SplitPage.m_bShow = True
EgtDraw()
EnableButtons()
Return
End If
' resetto l'inidice del pezzo da mnovimentare
m_CurrRawOnVacuum = GDB_ID.NULL
' Deseleziono tutto
@@ -973,6 +1098,26 @@ Public Class MoveRawPartPage
EnableButtons()
End Sub
' verifica se la disposizione indicata è uno scarico sulla tavola ausiliaria
Public Function IsDispUnloadOnAuxTab(nCurrDispId 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)
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
Private Sub EnableButtons()
UpBtn.IsEnabled = Not m_SplitPage.m_bShow
LeftBtn.IsEnabled = Not m_SplitPage.m_bShow
@@ -987,11 +1132,22 @@ Public Class MoveRawPartPage
TopRBtn.IsEnabled = Not m_SplitPage.m_bShow
BottomLBtn.IsEnabled = Not m_SplitPage.m_bShow
BottomRBtn.IsEnabled = Not m_SplitPage.m_bShow
PauseBtn.IsEnabled = Not m_SplitPage.m_bShow
ResetBtn.IsEnabled = Not m_SplitPage.m_bShow
NextBtn.IsEnabled = Not m_SplitPage.m_bOnAuxTab
If m_SplitPage.m_bShow Then
NextBtn.IsEnabled = (m_nCurrPhase < EgtGetPhaseCount())
Else
NextBtn.IsEnabled = Not m_SplitPage.m_bOnAuxTab
End If
End Sub
Private Sub MoveRawPartPage_Unloaded(sender As Object, e As EventArgs) Handles Me.Unloaded
' verifico che la fase corrente non sia vuota
Dim nLastDispId As Integer = EgtGetPhaseDisposition(m_nCurrPhase)
If EgtIsOperationEmpty(nLastDispId) And m_SplitPage.m_bOnAuxTab And m_RawMoveDataList.Count = 0 Then
EgtErase(nLastDispId)
End If
' Se movimento con ventose
If Not m_bByHand Then
' nascondo le ventose
@@ -1007,11 +1163,11 @@ Public Class MoveRawPartPage
' imposto eventuale presenza rimozioni manuali
SaveRemoveByHandInDisposition(nDispId, m_bRemovedRaw)
' imposto eventuale movimento pezzi su tavola ausiliaria
SaveMovePartsOnAuxTable( nDispId, m_SplitPage.m_bOnAuxTab)
SaveMovePartsOnAuxTable(nDispId, m_SplitPage.m_bOnAuxTab)
' Eseguo calcolo speciale dei movimenti
SpecialApplyDisposition(nDispId, True, Not m_SplitPage.m_bOnAuxTab)
End If
' se altrimenti movimento senza ventose perchè lama troppo grande
' se altrimenti movimento senza ventose perchè lama troppo grande
ElseIf GetVacuumType() > 0 Then
' se non solo visualizzazione
If Not m_SplitPage.m_bShow Then
+2
View File
@@ -1175,6 +1175,8 @@ Public Class NestPageUC
m_ptPrev = ptCurr
' Terminata esecuzione di drag
m_bDragging = False
' se è stato eseguito il Drag allora cancello tutti i ponticelli
ResetAllBRidges()
End Sub
Private Sub OnMyMouseUpScene(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles m_CurrProjPage.OnMouseUpScene
+13 -2
View File
@@ -48,8 +48,8 @@
</Button>
<Button Name="ModifyBtn" Grid.Column="2" Style="{DynamicResource OmagCut_YellowTextButton}"/>
<Button Name="AutoBtn" Grid.Column="3" Style="{DynamicResource OmagCut_YellowTextButton}"/>
<Button Name="RestartBtn" Grid.Column="3" Style="{DynamicResource OmagCut_YellowTextButton}" Visibility="Hidden"/>
</Grid>
<Button Name="RestartBtn" Grid.Column="3" Style="{DynamicResource OmagCut_YellowTextButton}" Visibility="Hidden"/>
</Grid>
</Grid>
<!--Left Button Grid-->
@@ -125,6 +125,17 @@
<Button Name="CutStartBtn" Grid.Column="1" Style="{DynamicResource OmagCut_YellowIconButton}">
<Image Source="{DynamicResource Inizio-Allunga-AccorciaImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
</Button>
<!-- solo per macchine con lavorazioni Waterjet -->
<ToggleButton Name="BridgesWJBtn" Grid.Column="0" Style="{DynamicResource OmagCut_YellowIconToggleButton}">
<Image Source="{DynamicResource PonticelliWJImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
</ToggleButton>
<!-- solo per macchine con lavorazioni Waterjet -->
<ToggleButton Name="BridgesDeleteWJBtn" Grid.Column="3" Style="{DynamicResource OmagCut_YellowIconToggleButton}">
<Image Source="{DynamicResource PonticelliDeleteWJImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
</ToggleButton>
<Button Name="CutEndBtn" Grid.Column="2" Style="{DynamicResource OmagCut_YellowIconButton}">
<Image Source="{DynamicResource Fine-Allunga-AccorciaImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
</Button>
+298 -5
View File
@@ -7,6 +7,7 @@ Public Class SplitPageUC
' Riferimento alla MainWindow
Private m_MainWindow As MainWindow = DirectCast(Application.Current.MainWindow, MainWindow)
Private WithEvents m_CurrProjPage As CurrentProjectPageUC
' Flag di pagina attiva
Private m_bActive As Boolean = False
' Tipo movimento dei grezzi (manuale o con testa ventosa)
@@ -26,6 +27,22 @@ Public Class SplitPageUC
' verifico che le lavorazioni selezionate siano omogenee (con lo stesso utensile)
Private m_bAreHomogeneous As Boolean = False
' Id tagli WJ per generazione ponticelli tra due percorsi
Private m_nIdSelectedPartWJ_Srt As Integer = GDB_ID.NULL
Private m_nIdSelectedSideWJ_Srt As Integer = GDB_ID.NULL
Private m_nIdSelectedWaterJet_Srt As Integer = GDB_ID.NULL
Private m_nIdSelectedPartWJ_End As Integer = GDB_ID.NULL
Private m_nIdSelectedSideWJ_End As Integer = GDB_ID.NULL
Private m_nIdSelectedWaterJet_End As Integer = GDB_ID.NULL
' Id gruppo Bridges (Nuovo da versione 30/08/2022)
Private m_nIdBridgesGroup As Integer = GDB_ID.NULL
Private m_nIdBridgeLineGroup As Integer = GDB_ID.NULL
Private m_nIdBridge As Integer = GDB_ID.NULL
Private m_ptSrtBridge As New Point3d
Private m_ptEndBridge As New Point3d
Public Const BRIDGES As String = "Bridges"
Public Const BRIDGELINE As String = "BridgeLine"
Private m_ItemList As New ObservableCollection(Of NameIdLsBxItem)
'Private m_CurrInd As Integer = -1
'Private m_CurrItems As New List(Of NameIdLsBxItem)
@@ -70,6 +87,7 @@ Public Class SplitPageUC
ModifyBtn.Content = EgtMsg(MSG_SPLITPAGEUC + 17) ' Modifica
AutoBtn.Content = EgtMsg(MSG_SPLITPAGEUC + 18) ' Auto
RestartBtn.Content = EgtMsg(MSG_SPLITPAGEUC + 19) ' Restart
BridgesWJBtn.ToolTip = "Bridges"
End Sub
Private Sub SplitPageUC_Loaded(sender As Object, e As EventArgs) Handles Me.Loaded
@@ -195,6 +213,176 @@ Public Class SplitPageUC
Next
End Sub
#Region "BRIDGE"
Private Sub OnMyMouseDownSceneBridges(sender As Object, e As System.Windows.Forms.MouseEventArgs,
ByVal IsFirst As Boolean,
ByRef m_nIdSelectedSideWJ As Integer,
ByRef m_nIdSelectedWaterJet As Integer,
ByRef nIdParentPart As Integer)
' Acquisisco punto da disegno
Dim CurrPoint As New Point3d
EgtUnProjectPoint(e.Location, CurrPoint)
' Verifico se selezionato indicativo di pezzo
EgtSetObjFilterForSelWin(False, True, False, False, False)
Dim nSelMy As Integer
EgtSelect(e.Location, Scene.DIM_SEL, Scene.DIM_SEL, nSelMy)
Dim nIdMy As Integer = EgtGetFirstObjInSelWin()
While nIdMy <> GDB_ID.NULL
Dim sLayer As String = String.Empty
' layer di origine
Dim nIdParent As Integer = EgtGetParent(nIdMy)
' recupero il nome del Layer
EgtGetName(nIdParent, sLayer)
' solo se il nome del layer è quello associato ad un lato esterno allora procedo con l'evidenziazione
If sLayer = NAME_OUTLOOP Then
If EgtGetType(nIdMy) = GDB_TY.CRV_ARC OrElse EgtGetType(nIdMy) = GDB_TY.CRV_COMPO OrElse EgtGetType(nIdMy) = GDB_TY.CRV_LINE Then
If m_nIdSelectedSideWJ <> GDB_ID.NULL Or m_nIdSelectedSideWJ = nIdMy Then
EgtDeselectObj(m_nIdSelectedSideWJ)
End If
' recupero il gruppo della lavorazione associata
nIdParentPart = EgtGetParent(nIdParent)
Dim nIdPV As Integer = EgtGetFirstNameInGroup(nIdParentPart, NAME_PREVIEW)
' VERIFICA: recupero l'elenco delle Preview di Tipo WaterJet associate a questo Part
Dim ListGroup As List(Of Integer) = m_MainWindow.m_CadCutPageUC.m_NestPage.ResearchGropuWJ(nIdParent, nIdPV)
' VERIFICA: se esistono delle lavorazioni associate al percorso OutLoop di tipo Saw allora non procedo
Dim ListGroupSaw As List(Of Integer) = m_MainWindow.m_CadCutPageUC.m_NestPage.ResearchGropuSaw(nIdParent, nIdPV)
' se non esiste almeno 1 Preview di tipo WaterJet
If ListGroup.Count > 0 Then
m_nIdSelectedSideWJ = nIdMy
' Ricalcolo tutte le lavorazioni
Dim nWarn As Integer = 0
ResetAllMachinings(nWarn)
' recupero l'indice del PreView che deve essere acceso per indicare la selezione
ListGroup = m_MainWindow.m_CadCutPageUC.m_NestPage.ResearchGropuWJ(nIdParent, nIdPV)
Dim nIdWJ As Integer = m_MainWindow.m_CadCutPageUC.m_NestPage.GetPVIdFromIdSide(ListGroup, nIdMy)
m_MainWindow.m_CadCutPageUC.m_NestPage.GetCurrentPVFromIdSide(ListGroup, nIdMy, nIdWJ, nIdParent)
' recupero il punto più vicino alla curva passata
If IsFirst Then
EgtNearPoint(nIdMy, CurrPoint, GDB_RT.GLOB, m_ptSrtBridge)
Else
' prima di confermare verifico che non ci siano interferenze
EgtNearPoint(nIdMy, CurrPoint, GDB_RT.GLOB, m_ptEndBridge)
EgtModifyCurveEndPoint(m_nIdBridge, m_ptEndBridge, GDB_RT.GLOB)
If VerifyInterference(m_nIdBridge) Then
m_CurrProjPage.ClearMessage()
' salvo nel Gruppo "BridgeLine" gli dei pezzi che sono collegati
EgtSetInfo(EgtGetParent(m_nIdBridge), "PartStart", m_nIdSelectedPartWJ_Srt)
EgtSetInfo(EgtGetParent(m_nIdBridge), "PartEnd", m_nIdSelectedPartWJ_End)
Else
' attendo la selezione di un punto valido
m_nIdSelectedSideWJ = GDB_ID.NULL
m_nIdSelectedWaterJet = GDB_ID.NULL
nIdParentPart = GDB_ID.NULL
m_CurrProjPage.ClearMessage()
m_CurrProjPage.SetWarningMessage("Bridge intersects part")
Return
End If
End If
m_nIdSelectedWaterJet = nIdWJ
' salvo il valore del PreView evidenziato
EgtSetMark(nIdParentPart)
' EgtSetMark(nIdWJ)
EgtSelectObj(nIdMy)
EgtDraw()
Exit While
End If
End If
End If
nIdMy = EgtGetNextObjInSelWin()
End While
End Sub
Private Sub OnMyMouseDownSceneBridgesDelete(sender As Object, e As System.Windows.Forms.MouseEventArgs)
' Acquisisco punto da disegno
Dim CurrPoint As New Point3d
EgtUnProjectPoint(e.Location, CurrPoint)
' Verifico se selezionato indicativo di pezzo
EgtSetObjFilterForSelWin(False, True, False, False, False)
Dim nSelMy As Integer
EgtSelect(e.Location, Scene.DIM_SEL, Scene.DIM_SEL, nSelMy)
Dim nIdMy As Integer = EgtGetFirstObjInSelWin()
While nIdMy <> GDB_ID.NULL
Dim sGroupName As String = String.Empty
' gruppo di appartenenza
Dim nIdParent As Integer = EgtGetParent(nIdMy)
' recupero il nome del Layer
EgtGetName(nIdParent, sGroupName)
If sGroupName.Contains(BRIDGELINE) Then
EgtErase(nIdParent)
EgtDraw()
Return
End If
nIdMy = EgtGetNextObjInSelWin()
End While
End Sub
Private Sub OnMyMouseMoveSceneBridges(ptCurr As Point3d)
ptCurr.z = m_ptSrtBridge.z
' rappresento il egmento
If m_nIdBridge = GDB_ID.NULL Then
m_nIdBridgeLineGroup = EgtCreateGroup(m_nIdBridgesGroup)
EgtSetName(m_nIdBridgeLineGroup, BRIDGELINE)
m_nIdBridge = EgtCreateLine(m_nIdBridgeLineGroup, m_ptSrtBridge, ptCurr, GDB_RT.GLOB)
End If
EgtModifyCurveEndPoint(m_nIdBridge, ptCurr, GDB_RT.GLOB)
EgtDraw()
End Sub
Private Function VerifyInterference(nIdBridge As Integer) As Boolean
' prima di procedere alla verifica accorco il segmento (solo per sicurezza) 10 * EPS_SMALL
Dim dLen As Double
EgtCurveLength(nIdBridge, dLen)
If dLen > 21 AndAlso Not EgtCurveIsClosed(nIdBridge) Then
EgtTrimCurveEndAtLen(nIdBridge, dLen - 10 * EPS_SMALL)
EgtTrimCurveStartAtLen(nIdBridge, 10 * EPS_SMALL)
End If
' EgtSaveFile("c:\EgtData\OmagCUT\Temp\Bridge.nge", NGE.BIN)
Dim nIdPart As Integer = GDB_ID.NULL
nIdPart = EgtGetFirstPartInRawPart(m_CurrProjPage.m_nRawId)
While nIdPart <> GDB_ID.NULL
Dim nIdRegion As Integer = EgtGetFirstNameInGroup(nIdPart, "Region")
Dim nIdSurf As Integer = EgtGetFirstInGroup(nIdRegion)
While nIdSurf <> GDB_ID.NULL
If EgtGetType(nIdSurf) = GDB_TY.SRF_FRGN Then
' EgtSaveFile("c:\EgtData\OmagCUT\Temp\Bridge.nge", NGE.BIN)
' se la linea bridge interseca la superficie allora restitusco false
If EgtCurveWithRegionClassify(nIdBridge, nIdSurf) <> CREGC.OUT Then
EgtExtendCurveStartByLen(nIdBridge, 10 * EPS_SMALL)
Return False
End If
Exit While
End If
End While
nIdPart = EgtGetNextPartInRawPart(nIdPart)
End While
Return True
End Function
Private Sub DeselectWJBridgesPart()
' se in fase di definzione di un ponticello lo elimino
If m_nIdSelectedSideWJ_Srt <> GDB_ID.NULL And m_nIdSelectedSideWJ_End = GDB_ID.NULL And m_nIdBridge <> GDB_ID.NULL Then
EgtErase(EgtGetParent(m_nIdBridge))
End If
m_nIdBridge = GDB_ID.NULL
EgtResetMark(m_nIdSelectedPartWJ_Srt)
m_nIdSelectedPartWJ_Srt = GDB_ID.NULL
EgtDeselectObj(m_nIdSelectedSideWJ_Srt)
m_nIdSelectedSideWJ_Srt = GDB_ID.NULL
m_nIdSelectedWaterJet_Srt = GDB_ID.NULL
EgtResetMark(m_nIdSelectedPartWJ_End)
m_nIdSelectedPartWJ_End = GDB_ID.NULL
EgtDeselectObj(m_nIdSelectedSideWJ_End)
m_nIdSelectedSideWJ_End = GDB_ID.NULL
m_nIdSelectedWaterJet_End = GDB_ID.NULL
EgtDraw()
End Sub
#End Region ' Bridge
Private Sub OnMyMouseDownScene(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles m_CurrProjPage.OnMouseDownScene
' Verifico di essere il gestore attivo e non in modalità sola visualizzazione
If Not m_bActive OrElse m_bShow Then Return
@@ -203,6 +391,27 @@ Public Class SplitPageUC
Not m_CurrProjPage.CurrentProjectScene.IsStatusNull() Then
Return
End If
' definizione dei ponticelli
If BridgesWJBtn.IsChecked Then
If m_nIdSelectedPartWJ_Srt = GDB_ID.NULL Then
OnMyMouseDownSceneBridges(sender, e, True, m_nIdSelectedSideWJ_Srt, m_nIdSelectedWaterJet_Srt, m_nIdSelectedPartWJ_Srt)
Else
OnMyMouseDownSceneBridges(sender, e, False, m_nIdSelectedSideWJ_End, m_nIdSelectedWaterJet_End, m_nIdSelectedPartWJ_End)
End If
' se entrambi i pezzi sono stati definiti allora procedo alla deselezione
If m_nIdSelectedPartWJ_Srt <> GDB_ID.NULL And m_nIdSelectedPartWJ_End <> GDB_ID.NULL Then
DeselectWJBridgesPart()
End If
Return
End If
' eliminazione dei ponticelli
If BridgesDeleteWJBtn.IsChecked Then
OnMyMouseDownSceneBridgesDelete(sender, e)
Return
End If
' Reset drag
m_nDragInd = -1
m_nDragType = 0
@@ -287,13 +496,23 @@ Public Class SplitPageUC
Private Sub OnMyMouseMoveScene(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles m_CurrProjPage.OnMouseMoveScene
' Verifico di essere il gestore attivo e non in modalità sola visualizzazione
If Not m_bActive OrElse m_bShow Then Return
' Ricavo il punto corrente in coordinate mondo
Dim ptCurr As Point3d
EgtUnProjectPoint(e.Location, ptCurr)
' definizione dei ponticelli
If BridgesWJBtn.IsChecked Then
If m_nIdSelectedPartWJ_Srt <> GDB_ID.NULL Then
OnMyMouseMoveSceneBridges(ptCurr)
End If
Return
End If
' Se drag non abilitato o in corso
If m_nDragInd = -1L Or m_bDragging Then Return
m_bDragging = True
Dim nOperId As Integer = m_MachiningList(m_nDragInd).m_nId
' Ricavo il punto corrente in coordinate mondo
Dim ptCurr As Point3d
EgtUnProjectPoint(e.Location, ptCurr)
' Ricavo il vettore di movimento e la variazione di lunghezza
Dim vtMove As Vector3d = ptCurr - m_ptDragPrev
Dim dDelta = vtMove * m_MachiningList(m_nDragInd).m_vtDir
@@ -641,6 +860,50 @@ Public Class SplitPageUC
EnableButtons()
End Sub
Private Sub OnKeyDownScene(sender As Object, e As KeyEventArgs)
If e.Key = Key.Escape Then
' se sono in fase di creazione di un ponticello interrompo
DeselectWJBridgesPart()
End If
End Sub
Private Sub BridgeBtn_Click(sender As Object, e As RoutedEventArgs) Handles BridgesWJBtn.Click
' eventualmente spengo il comando per eliminare i ponticelli
If BridgesDeleteWJBtn.IsChecked Then
BridgesDeleteWJBtn.IsChecked = False
End If
' se deseleziono resetto tutte le variabili
If Not BridgesWJBtn.IsChecked Then
' se sono in fase di creazione di un ponticello interrompo
DeselectWJBridgesPart()
Return
End If
' recuoero il gruppo di lavorazione corrente
Dim nIdCurrMachGroup As Integer = EgtGetCurrMachGroup()
' creo il gruppo per i ponticelli
Dim sNameGroup As String = BRIDGES
Dim nId As Integer = EgtGetFirstNameInGroup(nIdCurrMachGroup, sNameGroup)
If nId <> GDB_ID.NULL Then
m_nIdBridgesGroup = nId
End If
' se non lo trovo allora lo creo
If nId = GDB_ID.NULL Then
m_nIdBridgesGroup = EgtCreateGroup(nIdCurrMachGroup)
EgtSetName(m_nIdBridgesGroup, BRIDGES)
End If
End Sub
Private Sub BridgeDeleteBtn_Click(Sender As Object, e As RoutedEventArgs) Handles BridgesDeleteWJBtn.Click
' eventualmente spengo il comando per inserire i ponticelli
If BridgesWJBtn.IsChecked Then
BridgesWJBtn.IsChecked = False
End If
If Not BridgesDeleteWJBtn.IsChecked Then
DeselectWJBridgesPart()
End If
End Sub
Private Function AdjustBothCuts(nI As Integer,
Optional bAllForced As Boolean = False,
Optional bAccForced As Boolean = False) As Boolean
@@ -1396,6 +1659,16 @@ Public Class SplitPageUC
End Sub
Private Sub NextBtn_Click(sender As Object, e As RoutedEventArgs) Handles NextBtn.Click
If m_bShow Then
Dim CurrDisposition As Integer = EgtGetPhaseDisposition(m_nCurrPhase)
' recupero l'operazione successiva
Dim NextDisposition As Integer = EgtGetNextOperation(CurrDisposition)
If Not IsNothing(m_MainWindow.m_CadCutPageUC.m_MoveRawPartPage) Then
' verifico che l'operazione sia una disposizione, altrimenti cerco
NextDisposition = m_MainWindow.m_CadCutPageUC.m_MoveRawPartPage.GetNextDisposition(NextDisposition)
m_bOnAuxTab = m_MainWindow.m_CadCutPageUC.m_MoveRawPartPage.IsDispUnloadOnAuxTab(NextDisposition)
End If
End If
m_bToNext = True
m_MainWindow.m_CadCutPageUC.CadCutPageGrid.Children.Remove(m_MainWindow.m_CadCutPageUC.m_SplitPage)
m_MainWindow.m_CadCutPageUC.CadCutPageGrid.Children.Add(m_MainWindow.m_CadCutPageUC.m_MoveRawPartPage)
@@ -1512,6 +1785,10 @@ Public Class SplitPageUC
End Sub
Friend Sub ExitSplit(Optional bTrueExit As Boolean = True)
DeselectWJBridgesPart()
BridgesWJBtn.IsChecked = False
BridgesDeleteWJBtn.IsChecked = False
' Rimuovo evidenziazione e numeri
RemoveMarkAndNumbers()
' Ripristino colori lavorazioni
@@ -1623,7 +1900,7 @@ Public Class SplitPageUC
m_bOnAuxTab = False
' Ci deve essere almeno 1 taglio disabilitato e 1 e 1 solo passante
NextBtn.IsEnabled = (GetDisabledCutsCount() > 0 And GetSplitCutsCount() = 1)
' Altrimenti
' Altrimenti
Else
' movimento standard sulla tavola (almeno un taglio disabilitato)
Dim bStdTab As Boolean = (GetDisabledCutsCount() > 0)
@@ -1634,7 +1911,7 @@ Public Class SplitPageUC
' Deve essere permesso almeno un tipo di movimento
NextBtn.IsEnabled = bStdTab Or m_bOnAuxTab Or bFinalMoveTab
End If
' altrimenti sto solo visualizzando
' altrimenti sto solo visualizzando
Else
' movimento su tavola di scarico
m_bOnAuxTab = (m_nCurrPhase = EgtGetPhaseCount() - 1 And m_bEnableOnAuxTab And EgtGetOperationType(EgtGetLastOperation()) = MCH_OY.DISP)
@@ -1754,6 +2031,7 @@ Public Class SplitPageUC
Private Sub VisibilityButtonFromMachinig(ByVal Type As Integer)
If Type <> MCH_OY.SAWING Then
CutBtn.Visibility = Visibility.Hidden
CutStartBtn.Visibility = Visibility.Hidden
CutEndBtn.Visibility = Visibility.Hidden
@@ -1784,6 +2062,21 @@ Public Class SplitPageUC
AllExtendBtn.Visibility = Visibility.Visible
AllReduceBtn.Visibility = Visibility.Visible
End If
' gestione bottone per generazione ponticelli
If Type = MCH_OY.WATERJETTING Then
' siccome la stessa posizione è occupata da due comandi sovrapposti
If CutStartBtn.Visibility = Visibility.Hidden Then
BridgesWJBtn.Visibility = Visibility.Visible
BridgesDeleteWJBtn.Visibility = Visibility.Visible
Else
BridgesWJBtn.Visibility = Visibility.Hidden
BridgesDeleteWJBtn.Visibility = Visibility.Hidden
End If
Else
BridgesWJBtn.Visibility = Visibility.Hidden
BridgesDeleteWJBtn.Visibility = Visibility.Hidden
End If
End Sub
Private Function ModifyOtherLeadIn(nI As Integer, nLiOthType As Integer) As Boolean
+6
View File
@@ -1262,6 +1262,12 @@
<ItemGroup>
<Resource Include="Resources\NewIcons\START-WJ.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\NewIcons\Ponticelli.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\NewIcons\Ponticelli_delete.png" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
<PropertyGroup>
<PostBuildEvent>IF "$(PlatformName)"=="x86" IF "$(ConfigurationName)" == "Release" copy $(TargetPath) c:\EgtProg\OmagCUT\OmagCUTR32.exe
+2
View File
@@ -218,6 +218,8 @@
<!--Machinig-->
<BitmapImage x:Key="Allunga-AccorciaImg" UriSource="Resources/NewIcons/Allunga-o-accorcia.png"></BitmapImage>
<BitmapImage x:Key="Inizio-Allunga-AccorciaImg" UriSource="Resources/NewIcons/Inizio-allunga-o-accorcia.png"></BitmapImage>
<BitmapImage x:Key="PonticelliWJImg" UriSource="Resources/NewIcons/Ponticelli.png"></BitmapImage>
<BitmapImage x:Key="PonticelliDeleteWJImg" UriSource="Resources/NewIcons/Ponticelli_delete.png"></BitmapImage>
<BitmapImage x:Key="Fine-Allunga-AccorciaImg" UriSource="Resources/NewIcons/Fine-allunga-o-accorcia.png"></BitmapImage>
<BitmapImage x:Key="ON_OFF-singolo-taglioImg" UriSource="Resources/NewIcons/ON_OFF-singolo-taglio.png"></BitmapImage>
<BitmapImage x:Key="Tutti-ONImg" UriSource="Resources/NewIcons/Tutti-ON.png"></BitmapImage>
+2
View File
@@ -256,6 +256,8 @@ Public Class ProjectMgrUC
ResetAllSplitCurv()
' cancello tutti i punti di inizio (Waterjet)
ResetAllStartCurv()
' cancello tutti i ponticelli disegnati
ResetAllBRidges()
' Ricalcolo tutte le lavorazioni
Dim nWarn As Integer = 0
ResetAllMachinings(nWarn)
Binary file not shown.

After

Width:  |  Height:  |  Size: 742 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB