Gestione creazione di Ponticelli WaterJet
This commit is contained in:
+1
-1
@@ -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)
|
||||
|
||||
@@ -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>
|
||||
|
||||
+208
-3
@@ -26,6 +26,20 @@ 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
|
||||
|
||||
Private m_ItemList As New ObservableCollection(Of NameIdLsBxItem)
|
||||
'Private m_CurrInd As Integer = -1
|
||||
'Private m_CurrItems As New List(Of NameIdLsBxItem)
|
||||
@@ -70,6 +84,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 +210,128 @@ Public Class SplitPageUC
|
||||
Next
|
||||
End Sub
|
||||
|
||||
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
|
||||
If VerifyInterference(m_nIdBridge) Then
|
||||
m_CurrProjPage.ClearMessage()
|
||||
EgtNearPoint(nIdMy, CurrPoint, GDB_RT.GLOB, m_ptEndBridge)
|
||||
EgtModifyCurveEndPoint(m_nIdBridge, m_ptEndBridge, GDB_RT.GLOB)
|
||||
' 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
|
||||
Return
|
||||
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
|
||||
Dim bOk As Boolean = True
|
||||
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")
|
||||
|
||||
nIdPart = EgtGetNextPartInRawPart(m_CurrProjPage.m_nRawId)
|
||||
End While
|
||||
Return bOk
|
||||
End Function
|
||||
|
||||
Private Sub DeselectWJBridgesPart()
|
||||
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
|
||||
|
||||
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 +340,21 @@ 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
|
||||
|
||||
' Reset drag
|
||||
m_nDragInd = -1
|
||||
m_nDragType = 0
|
||||
@@ -287,13 +439,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 +803,27 @@ Public Class SplitPageUC
|
||||
EnableButtons()
|
||||
End Sub
|
||||
|
||||
Private Sub BridgeBtn_Click(sender As Object, e As RoutedEventArgs) Handles BridgesWJBtn.Click
|
||||
' se deseleziono resetto tutte le variabili
|
||||
If Not BridgesWJBtn.IsChecked Then
|
||||
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 Function AdjustBothCuts(nI As Integer,
|
||||
Optional bAllForced As Boolean = False,
|
||||
Optional bAccForced As Boolean = False) As Boolean
|
||||
@@ -1512,6 +1695,12 @@ Public Class SplitPageUC
|
||||
End Sub
|
||||
|
||||
Friend Sub ExitSplit(Optional bTrueExit As Boolean = True)
|
||||
' se attivo il comando è Bridge
|
||||
If BridgesWJBtn.IsChecked Then
|
||||
DeselectWJBridgesPart()
|
||||
' disattivo
|
||||
BridgesWJBtn.IsChecked = False
|
||||
End If
|
||||
' Rimuovo evidenziazione e numeri
|
||||
RemoveMarkAndNumbers()
|
||||
' Ripristino colori lavorazioni
|
||||
@@ -1754,6 +1943,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 +1974,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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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>
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 742 B |
Binary file not shown.
|
After Width: | Height: | Size: 1.4 KiB |
Reference in New Issue
Block a user