Compare commits

...

1 Commits

Author SHA1 Message Date
Nicola Pievani db623544e9 Gestione Split per tagli finali 2025-08-28 19:12:46 +02:00
+296 -23
View File
@@ -1,5 +1,6 @@
Imports System.Collections.ObjectModel Imports System.Collections.ObjectModel
Imports System.ComponentModel Imports System.ComponentModel
Imports System.Reflection
Imports EgtUILib Imports EgtUILib
Public Class SplitPageUC Public Class SplitPageUC
@@ -971,14 +972,18 @@ Public Class SplitPageUC
If Not MoveUpBtn.IsEnabled And Not MoveDownBtn.IsEnabled Then Return If Not MoveUpBtn.IsEnabled And Not MoveDownBtn.IsEnabled Then Return
' MOVE UP (-1) ' MOVE UP (-1)
If m_CurrFirstInd > 0 Then
Dim OldItem As SplitMach = m_MachiningList(m_CurrFirstInd - 1) Dim OldItem As SplitMach = m_MachiningList(m_CurrFirstInd - 1)
Dim NewItem As SplitMach = m_MachiningList(m_CurrLastInd) Dim NewItem As SplitMach = m_MachiningList(m_CurrLastInd)
MoveUpBtn.IsEnabled = Not (OldItem.m_bFinalCut Or NewItem.m_bFinalCut) Or (OldItem.m_bFinalCut And NewItem.m_bFinalCut) MoveUpBtn.IsEnabled = Not (OldItem.m_bFinalCut Or NewItem.m_bFinalCut) Or (OldItem.m_bFinalCut And NewItem.m_bFinalCut)
End If
' MOVE DOWN (1) ' MOVE DOWN (1)
OldItem = m_MachiningList(m_CurrLastInd + 1) If m_CurrLastInd < m_MachiningList.Count - 1 Then
NewItem = m_MachiningList(m_CurrFirstInd) Dim OldItem = m_MachiningList(m_CurrLastInd + 1)
Dim NewItem = m_MachiningList(m_CurrFirstInd)
MoveDownBtn.IsEnabled = Not (OldItem.m_bFinalCut Or NewItem.m_bFinalCut) Or (OldItem.m_bFinalCut And NewItem.m_bFinalCut) MoveDownBtn.IsEnabled = Not (OldItem.m_bFinalCut Or NewItem.m_bFinalCut) Or (OldItem.m_bFinalCut And NewItem.m_bFinalCut)
End If
End Sub End Sub
Private Sub MoveItem(direction As Integer) Private Sub MoveItem(direction As Integer)
@@ -1271,17 +1276,31 @@ Public Class SplitPageUC
End Sub End Sub
' Dato l'indice della lavorazione restituisce l'indice della lavorazione TwinCut
Private Function GetIndexTwinCut(nIndex As Integer, Optional OnlyFinalCut As Boolean = True) As Integer
Dim nIndexTwinCut As Integer = -1
If m_MachiningList(nIndex).m_bFinalCut Or Not OnlyFinalCut Then
Dim nIdTwinCut As Integer = -1
EgtGetInfo(m_MachiningList(nIndex).m_nId, "IdTwinCut", nIdTwinCut)
nIndexTwinCut = m_MachiningList.FindIndex(Function(x) x.m_nId = nIdTwinCut)
End If
Return nIndexTwinCut
End Function
' Ok: gestione info 'IdTwinCut' per tagli FinalCut
Private Function AdjustBothCuts(nI As Integer, Private Function AdjustBothCuts(nI As Integer,
Optional bAllForced As Boolean = False, Optional bAllForced As Boolean = False,
Optional bAccForced As Boolean = False) As Boolean Optional bAccForced As Boolean = False) As Boolean
Dim nIndexTwinCut As Integer = GetIndexTwinCut(nI, False)
' Verifico che entrambi gli estremi siano allungabili ' Verifico che entrambi gli estremi siano allungabili
If Not (m_MachiningList(nI).m_bCanStartAll And m_MachiningList(nI).m_bCanEndAll) Then Return False If Not ((m_MachiningList(nI).m_bCanStartAll And m_MachiningList(nI).m_bCanEndAll) Or nIndexTwinCut > -1) Then Return False
' Eseguo allungamento o riporto allo standard ' Eseguo allungamento o riporto allo standard
EgtSetCurrMachining(m_MachiningList(nI).m_nId) EgtSetCurrMachining(m_MachiningList(nI).m_nId)
Dim nLiPrev As Integer Dim nLiPrev As Integer
EgtGetMachiningParam(MCH_MP.LEADINTYPE, nLiPrev) EgtGetMachiningParam(MCH_MP.LEADINTYPE, nLiPrev)
Dim nLoPrev As Integer Dim nLoPrev As Integer
EgtGetMachiningParam(MCH_MP.LEADOUTTYPE, nLoPrev) EgtGetMachiningParam(MCH_MP.LEADOUTTYPE, nLoPrev)
If (m_MachiningList(nI).m_bStartAll Or m_MachiningList(nI).m_bEndAll) And Not bAllForced Then If (m_MachiningList(nI).m_bStartAll Or m_MachiningList(nI).m_bEndAll) And Not bAllForced Then
' accorcio ' accorcio
If nLiPrev = MCH_SAW_LI.EXT_OUT Then If nLiPrev = MCH_SAW_LI.EXT_OUT Then
@@ -1297,6 +1316,28 @@ Public Class SplitPageUC
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True) UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
m_MachiningList(nI).m_bStartAll = False m_MachiningList(nI).m_bStartAll = False
m_MachiningList(nI).m_bEndAll = False m_MachiningList(nI).m_bEndAll = False
' ver_2.7h3
If nIndexTwinCut > -1 And nIndexTwinCut < m_MachiningList.Count Then
' Eseguo allungamento o riporto allo standard
EgtSetCurrMachining(m_MachiningList(nIndexTwinCut).m_nId)
EgtGetMachiningParam(MCH_MP.LEADINTYPE, nLiPrev)
EgtGetMachiningParam(MCH_MP.LEADOUTTYPE, nLoPrev)
' accorcio
If nLiPrev = MCH_SAW_LI.EXT_OUT Then
EgtSetMachiningParam(MCH_MP.LEADINTYPE, MCH_SAW_LI.OUT)
Else
EgtSetMachiningParam(MCH_MP.LEADINTYPE, MCH_SAW_LI.CENT)
End If
If nLoPrev = MCH_SAW_LO.EXT_OUT Then
EgtSetMachiningParam(MCH_MP.LEADOUTTYPE, MCH_SAW_LO.OUT)
Else
EgtSetMachiningParam(MCH_MP.LEADOUTTYPE, MCH_SAW_LO.CENT)
End If
UpdateMachiningPreview(m_MachiningList(nIndexTwinCut).m_nId, True)
End If
ElseIf m_MachiningList(nI).m_bEnabled And Not bAccForced Then ElseIf m_MachiningList(nI).m_bEnabled And Not bAccForced Then
' allungo ' allungo
If nLiPrev = MCH_SAW_LI.OUT Then If nLiPrev = MCH_SAW_LI.OUT Then
@@ -1312,20 +1353,44 @@ Public Class SplitPageUC
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True) UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
m_MachiningList(nI).m_bStartAll = True m_MachiningList(nI).m_bStartAll = True
m_MachiningList(nI).m_bEndAll = True m_MachiningList(nI).m_bEndAll = True
' ver_2.7h3
If nIndexTwinCut > -1 And nIndexTwinCut < m_MachiningList.Count Then
' Eseguo allungamento o riporto allo standard
EgtSetCurrMachining(m_MachiningList(nIndexTwinCut).m_nId)
EgtGetMachiningParam(MCH_MP.LEADINTYPE, nLiPrev)
EgtGetMachiningParam(MCH_MP.LEADOUTTYPE, nLoPrev)
If nLiPrev = MCH_SAW_LI.OUT Then
EgtSetMachiningParam(MCH_MP.LEADINTYPE, MCH_SAW_LI.EXT_OUT)
Else
EgtSetMachiningParam(MCH_MP.LEADINTYPE, MCH_SAW_LI.EXT_CENT)
End If
If nLoPrev = MCH_SAW_LO.OUT Then
EgtSetMachiningParam(MCH_MP.LEADOUTTYPE, MCH_SAW_LO.EXT_OUT)
Else
EgtSetMachiningParam(MCH_MP.LEADOUTTYPE, MCH_SAW_LO.EXT_CENT)
End If
UpdateMachiningPreview(m_MachiningList(nIndexTwinCut).m_nId, True)
End If
End If End If
ColorMachining(m_MachiningList(nI)) ColorMachining(m_MachiningList(nI))
Return True Return True
End Function End Function
' Ok: gestione info 'IdTwinCut' per tagli FinalCut
Private Function AdjustStartCut(nI As Integer, Private Function AdjustStartCut(nI As Integer,
Optional bAllForced As Boolean = False, Optional bAllForced As Boolean = False,
Optional bAccForced As Boolean = False) As Boolean Optional bAccForced As Boolean = False) As Boolean
Dim nIndexTwinCut As Integer = GetIndexTwinCut(nI, False)
' Verifico che l'estremo iniziale sia allungabile ' Verifico che l'estremo iniziale sia allungabile
If Not m_MachiningList(nI).m_bCanStartAll Then Return False If Not (m_MachiningList(nI).m_bCanStartAll Or nIndexTwinCut > -1) Then Return False
' Eseguo allungamento o riporto allo standard ' Eseguo allungamento o riporto allo standard
EgtSetCurrMachining(m_MachiningList(nI).m_nId) EgtSetCurrMachining(m_MachiningList(nI).m_nId)
Dim nLiPrev As Integer Dim nLiPrev As Integer
EgtGetMachiningParam(MCH_MP.LEADINTYPE, nLiPrev) EgtGetMachiningParam(MCH_MP.LEADINTYPE, nLiPrev)
If m_MachiningList(nI).m_bStartAll And Not bAllForced Then If m_MachiningList(nI).m_bStartAll And Not bAllForced Then
' accorcio ' accorcio
If nLiPrev = MCH_SAW_LI.EXT_OUT Then If nLiPrev = MCH_SAW_LI.EXT_OUT Then
@@ -1335,6 +1400,21 @@ Public Class SplitPageUC
End If End If
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True) UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
m_MachiningList(nI).m_bStartAll = False m_MachiningList(nI).m_bStartAll = False
' ver_2.7h3
If nIndexTwinCut > -1 And nIndexTwinCut < m_MachiningList.Count Then
' Eseguo allungamento o riporto allo standard
EgtSetCurrMachining(m_MachiningList(nIndexTwinCut).m_nId)
EgtGetMachiningParam(MCH_MP.LEADINTYPE, nLiPrev)
' accorcio
If nLiPrev = MCH_SAW_LI.EXT_OUT Then
EgtSetMachiningParam(MCH_MP.LEADINTYPE, MCH_SAW_LI.OUT)
Else
EgtSetMachiningParam(MCH_MP.LEADINTYPE, MCH_SAW_LI.CENT)
End If
UpdateMachiningPreview(m_MachiningList(nIndexTwinCut).m_nId, True)
End If
ElseIf m_MachiningList(nI).m_bEnabled And Not bAccForced Then ElseIf m_MachiningList(nI).m_bEnabled And Not bAccForced Then
' allungo ' allungo
If nLiPrev = MCH_SAW_LI.OUT Then If nLiPrev = MCH_SAW_LI.OUT Then
@@ -1344,20 +1424,38 @@ Public Class SplitPageUC
End If End If
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True) UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
m_MachiningList(nI).m_bStartAll = True m_MachiningList(nI).m_bStartAll = True
' ver_2.7h3
If nIndexTwinCut > -1 And nIndexTwinCut < m_MachiningList.Count Then
' Eseguo allungamento o riporto allo standard
EgtSetCurrMachining(m_MachiningList(nIndexTwinCut).m_nId)
EgtGetMachiningParam(MCH_MP.LEADINTYPE, nLiPrev)
' allungo
If nLiPrev = MCH_SAW_LI.OUT Then
EgtSetMachiningParam(MCH_MP.LEADINTYPE, MCH_SAW_LI.EXT_OUT)
Else
EgtSetMachiningParam(MCH_MP.LEADINTYPE, MCH_SAW_LI.EXT_CENT)
End If
UpdateMachiningPreview(m_MachiningList(nIndexTwinCut).m_nId, True)
End If
End If End If
ColorMachining(m_MachiningList(nI)) ColorMachining(m_MachiningList(nI))
Return True Return True
End Function End Function
' Ok: gestione info 'IdTwinCut' per tagli FinalCut
Private Function AdjustEndCut(nI As Integer, Private Function AdjustEndCut(nI As Integer,
Optional bAllForced As Boolean = False, Optional bAllForced As Boolean = False,
Optional bAccForced As Boolean = False) As Boolean Optional bAccForced As Boolean = False) As Boolean
Dim nIndexTwinCut As Integer = GetIndexTwinCut(nI, False)
' Verifico che l'estremo finale sia allungabile ' Verifico che l'estremo finale sia allungabile
If Not m_MachiningList(nI).m_bCanEndAll Then Return False If Not (m_MachiningList(nI).m_bCanEndAll Or nIndexTwinCut > -1) Then Return False
' Eseguo allungamento o riporto allo standard ' Eseguo allungamento o riporto allo standard
EgtSetCurrMachining(m_MachiningList(nI).m_nId) EgtSetCurrMachining(m_MachiningList(nI).m_nId)
Dim nLoPrev As Integer Dim nLoPrev As Integer
EgtGetMachiningParam(MCH_MP.LEADOUTTYPE, nLoPrev) EgtGetMachiningParam(MCH_MP.LEADOUTTYPE, nLoPrev)
If m_MachiningList(nI).m_bEndAll And Not bAllForced Then If m_MachiningList(nI).m_bEndAll And Not bAllForced Then
' accorcio ' accorcio
If nLoPrev = MCH_SAW_LO.EXT_OUT Then If nLoPrev = MCH_SAW_LO.EXT_OUT Then
@@ -1366,6 +1464,21 @@ Public Class SplitPageUC
EgtSetMachiningParam(MCH_MP.LEADOUTTYPE, MCH_SAW_LO.CENT) EgtSetMachiningParam(MCH_MP.LEADOUTTYPE, MCH_SAW_LO.CENT)
End If End If
m_MachiningList(nI).m_bEndAll = False m_MachiningList(nI).m_bEndAll = False
' ver_2.7h3
If nIndexTwinCut > -1 And nIndexTwinCut < m_MachiningList.Count Then
' Eseguo allungamento o riporto allo standard
EgtSetCurrMachining(m_MachiningList(nIndexTwinCut).m_nId)
EgtGetMachiningParam(MCH_MP.LEADOUTTYPE, nLoPrev)
' accorcio
If nLoPrev = MCH_SAW_LO.EXT_OUT Then
EgtSetMachiningParam(MCH_MP.LEADOUTTYPE, MCH_SAW_LO.OUT)
Else
EgtSetMachiningParam(MCH_MP.LEADOUTTYPE, MCH_SAW_LO.CENT)
End If
UpdateMachiningPreview(m_MachiningList(nIndexTwinCut).m_nId, True)
End If
ElseIf m_MachiningList(nI).m_bEnabled And Not bAccForced Then ElseIf m_MachiningList(nI).m_bEnabled And Not bAccForced Then
' allungo ' allungo
If nLoPrev = MCH_SAW_LO.OUT Then If nLoPrev = MCH_SAW_LO.OUT Then
@@ -1374,20 +1487,44 @@ Public Class SplitPageUC
EgtSetMachiningParam(MCH_MP.LEADOUTTYPE, MCH_SAW_LO.EXT_CENT) EgtSetMachiningParam(MCH_MP.LEADOUTTYPE, MCH_SAW_LO.EXT_CENT)
End If End If
m_MachiningList(nI).m_bEndAll = True m_MachiningList(nI).m_bEndAll = True
' ver_2.7h3
If nIndexTwinCut > -1 And nIndexTwinCut < m_MachiningList.Count Then
' Eseguo allungamento o riporto allo standard
EgtSetCurrMachining(m_MachiningList(nIndexTwinCut).m_nId)
EgtGetMachiningParam(MCH_MP.LEADOUTTYPE, nLoPrev)
' allungo
If nLoPrev = MCH_SAW_LO.OUT Then
EgtSetMachiningParam(MCH_MP.LEADOUTTYPE, MCH_SAW_LO.EXT_OUT)
Else
EgtSetMachiningParam(MCH_MP.LEADOUTTYPE, MCH_SAW_LO.EXT_CENT)
End If
UpdateMachiningPreview(m_MachiningList(nIndexTwinCut).m_nId, True)
End If
End If End If
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True) UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
ColorMachining(m_MachiningList(nI)) ColorMachining(m_MachiningList(nI))
Return True Return True
End Function End Function
' Ok: gestione info 'IdTwinCut' per tagli FinalCut
Private Sub OutCenStartBtn_Click(sender As Object, e As RoutedEventArgs) Handles OutCenStartBtn.Click Private Sub OutCenStartBtn_Click(sender As Object, e As RoutedEventArgs) Handles OutCenStartBtn.Click
If m_CurrFirstInd = -1 Then Return If m_CurrFirstInd = -1 Then Return
Dim bGenModif As Boolean = False Dim bGenModif As Boolean = False
For Index As Integer = m_CurrFirstInd To m_CurrLastInd For Index As Integer = m_CurrFirstInd To m_CurrLastInd
If Not m_ItemList(Index).IsSelected Then Dim nIndexTwinCut As Integer = -1
' Indice di controllo LOOP: se > 10 allora il ciclo è potenzialmente infinito!
Dim nCount As Integer = 0
Dim CurrIndex = Index
If Not m_ItemList(CurrIndex).IsSelected Then
Continue For Continue For
End If End If
Dim nI As Integer = m_ItemList(Index).Ind
Do
nCount = nCount + 1
Dim nI As Integer = m_ItemList(CurrIndex).Ind
If m_MachiningList(nI).m_sLay = NAME_OUTLOOP Then If m_MachiningList(nI).m_sLay = NAME_OUTLOOP Then
' se ho forzato il tipo di ingresso da CamAuto qui non posso moficarlo! ' se ho forzato il tipo di ingresso da CamAuto qui non posso moficarlo!
@@ -1427,9 +1564,29 @@ Public Class SplitPageUC
ColorNumberArrow(nI) ColorNumberArrow(nI)
bGenModif = True bGenModif = True
' Recupero il taglio TwinCut associato (Optional: False -> non controllo se è FinalCut)
nIndexTwinCut = GetIndexTwinCut(nI, False)
If nIndexTwinCut > -1 Then
' Se non è stato selezionato allora devo modificarlo, alrtimenti resetto l'indice
If m_ItemList(nIndexTwinCut).IsSelected Then
nIndexTwinCut = -1
Else
CurrIndex = nIndexTwinCut
End If
End If End If
End If End If
End If
If nCount > 10 Then
EgtOutLog("! FATAL ERROR ! In function 'OutCenEndBtn' cycle 'Do Loop Until' is potentially infinte")
' Forzo l'uscita dal ciclo
nIndexTwinCut = -1
End If
Loop Until nIndexTwinCut < 0
' ---- FINE ----- metodo per mofica paramtri
Next Next
' Se modificato qualcosa ' Se modificato qualcosa
If bGenModif Then If bGenModif Then
@@ -1438,6 +1595,7 @@ Public Class SplitPageUC
End If End If
End Sub End Sub
' Ok: anche per tagli TwinCut con affondament ridotto
Private Sub AllOutStartBtn_Click(sender As Object, e As RoutedEventArgs) Handles AllOutStartBtn.Click Private Sub AllOutStartBtn_Click(sender As Object, e As RoutedEventArgs) Handles AllOutStartBtn.Click
For nI As Integer = 0 To m_MachiningList.Count() - 1 For nI As Integer = 0 To m_MachiningList.Count() - 1
EgtSetCurrMachining(m_MachiningList(nI).m_nId) EgtSetCurrMachining(m_MachiningList(nI).m_nId)
@@ -1464,6 +1622,7 @@ Public Class SplitPageUC
m_bModified = True m_bModified = True
End Sub End Sub
' Ok: anche per tagli TwinCut con affondament ridotto
Private Sub AllCenStartBtn_Click(sender As Object, e As RoutedEventArgs) Handles AllCenStartBtn.Click Private Sub AllCenStartBtn_Click(sender As Object, e As RoutedEventArgs) Handles AllCenStartBtn.Click
For nI As Integer = 0 To m_MachiningList.Count() - 1 For nI As Integer = 0 To m_MachiningList.Count() - 1
@@ -1499,14 +1658,23 @@ Public Class SplitPageUC
m_bModified = True m_bModified = True
End Sub End Sub
' Ok: gestione info 'IdTwinCut' per tagli FinalCut
Private Sub OutCenEndBtn_Click(sender As Object, e As RoutedEventArgs) Handles OutCenEndBtn.Click Private Sub OutCenEndBtn_Click(sender As Object, e As RoutedEventArgs) Handles OutCenEndBtn.Click
If m_CurrFirstInd = -1 Then Return If m_CurrFirstInd = -1 Then Return
Dim bGenModif As Boolean = False Dim bGenModif As Boolean = False
For Index As Integer = m_CurrFirstInd To m_CurrLastInd For Index As Integer = m_CurrFirstInd To m_CurrLastInd
If Not m_ItemList(Index).IsSelected Then Dim nIndexTwinCut As Integer = -1
' Indice di controllo LOOP: se > 10 allora il ciclo è potenzialmente infinito!
Dim nCount As Integer = 0
Dim CurrIndex = Index
If Not m_ItemList(CurrIndex).IsSelected Then
Continue For Continue For
End If End If
Dim nI As Integer = m_ItemList(Index).Ind
Do
nCount = nCount + 1
Dim nI As Integer = m_ItemList(CurrIndex).Ind
If m_MachiningList(nI).m_sLay = NAME_OUTLOOP Then If m_MachiningList(nI).m_sLay = NAME_OUTLOOP Then
' se ho forzato il tipo di ingresso da CamAuto qui non posso moficarlo! ' se ho forzato il tipo di ingresso da CamAuto qui non posso moficarlo!
@@ -1546,9 +1714,28 @@ Public Class SplitPageUC
ColorNumberArrow(nI) ColorNumberArrow(nI)
bGenModif = True bGenModif = True
' Recupero il taglio TwinCut associato (Optional: False -> non controllo se è FinalCut)
nIndexTwinCut = GetIndexTwinCut(nI, False)
If nIndexTwinCut > -1 Then
' Se non è stato selezionato allora devo modificarlo, alrtimenti resetto l'indice
If m_ItemList(nIndexTwinCut).IsSelected Then
nIndexTwinCut = -1
Else
CurrIndex = nIndexTwinCut
End If
End If End If
End If End If
End If
If nCount > 10 Then
EgtOutLog("! FATAL ERROR ! In function 'OutCenEndBtn' cycle 'Do Loop Until' is potentially infinte")
' Forzo l'uscita dal ciclo
nIndexTwinCut = -1
End If
Loop Until nIndexTwinCut < 0
Next Next
' Se modificato qualcosa ' Se modificato qualcosa
If bGenModif Then If bGenModif Then
@@ -1557,6 +1744,7 @@ Public Class SplitPageUC
End If End If
End Sub End Sub
' Ok: anche per tagli TwinCut con affondament ridotto
Private Sub AllOutEndBtn_Click(sender As Object, e As RoutedEventArgs) Handles AllOutEndBtn.Click Private Sub AllOutEndBtn_Click(sender As Object, e As RoutedEventArgs) Handles AllOutEndBtn.Click
For nI As Integer = 0 To m_MachiningList.Count() - 1 For nI As Integer = 0 To m_MachiningList.Count() - 1
EgtSetCurrMachining(m_MachiningList(nI).m_nId) EgtSetCurrMachining(m_MachiningList(nI).m_nId)
@@ -1583,6 +1771,7 @@ Public Class SplitPageUC
m_bModified = True m_bModified = True
End Sub End Sub
' Ok
Private Sub AllCenEndBtn_Click(sender As Object, e As RoutedEventArgs) Handles AllCenEndBtn.Click Private Sub AllCenEndBtn_Click(sender As Object, e As RoutedEventArgs) Handles AllCenEndBtn.Click
For nI As Integer = 0 To m_MachiningList.Count() - 1 For nI As Integer = 0 To m_MachiningList.Count() - 1
@@ -1618,6 +1807,7 @@ Public Class SplitPageUC
m_bModified = True m_bModified = True
End Sub End Sub
' Ok
Private Sub AllExtendBtn_Click(sender As Object, e As RoutedEventArgs) Handles AllExtendBtn.Click Private Sub AllExtendBtn_Click(sender As Object, e As RoutedEventArgs) Handles AllExtendBtn.Click
Dim bModif As Boolean = False Dim bModif As Boolean = False
For nI As Integer = 0 To m_MachiningList.Count() - 1 For nI As Integer = 0 To m_MachiningList.Count() - 1
@@ -1639,6 +1829,7 @@ Public Class SplitPageUC
EnableButtons() EnableButtons()
End Sub End Sub
' Ok
Private Sub AllReduceBtn_Click(sender As Object, e As RoutedEventArgs) Handles AllReduceBtn.Click Private Sub AllReduceBtn_Click(sender As Object, e As RoutedEventArgs) Handles AllReduceBtn.Click
Dim bModif As Boolean = False Dim bModif As Boolean = False
For nI As Integer = 0 To m_MachiningList.Count() - 1 For nI As Integer = 0 To m_MachiningList.Count() - 1
@@ -1660,6 +1851,7 @@ Public Class SplitPageUC
EnableButtons() EnableButtons()
End Sub End Sub
' Ok
Private Sub ModifStartBtn_Click(sender As Object, e As RoutedEventArgs) Handles ModifStartBtn.Click Private Sub ModifStartBtn_Click(sender As Object, e As RoutedEventArgs) Handles ModifStartBtn.Click
Dim bLen As Boolean = True Dim bLen As Boolean = True
' abilito la finestra per inserire i valori solo per il primo elemento della lista (di default tutti gli altri oggetti assumono lo stesso valore) ' abilito la finestra per inserire i valori solo per il primo elemento della lista (di default tutti gli altri oggetti assumono lo stesso valore)
@@ -1680,19 +1872,37 @@ Public Class SplitPageUC
If m_CurrFirstInd = -1 Then Return If m_CurrFirstInd = -1 Then Return
Dim bGenModif As Boolean = False Dim bGenModif As Boolean = False
For Index As Integer = m_CurrFirstInd To m_CurrLastInd For Index As Integer = m_CurrFirstInd To m_CurrLastInd
If Not m_ItemList(Index).IsSelected Then Dim nIndexTwinCut As Integer = -1
Dim CurrIndex As Integer = Index
' Indice di controllo LOOP: se > 10 allora il ciclo è potenzialmente infinito!
Dim nCount As Integer = 0
If Not m_ItemList(CurrIndex).IsSelected Then
Continue For Continue For
End If End If
Dim nI As Integer = m_ItemList(Index).Ind
Dim nI As Integer = m_ItemList(CurrIndex).Ind
Dim nOperId As Integer = m_MachiningList(nI).m_nId Dim nOperId As Integer = m_MachiningList(nI).m_nId
Dim nMachiningType As Integer = EgtGetOperationType(nOperId) Dim nMachiningType As Integer = EgtGetOperationType(nOperId)
' Se taglio con lama
If nMachiningType = MCH_MY.SAWING And
(m_MachiningList(nI).m_bIsLine Or m_MachiningList(nI).m_dPrevAng > FL_ARC_ANG_MIN Or m_MachiningList(nI).m_sLay = NAME_ONPATH) Then
If Not m_MachiningList(nI).m_bCanStartAll Then ' Se taglio con lama
If nMachiningType = MCH_MY.SAWING Then
Do
' Riassegno i valori dell'indice corrente
nI = m_ItemList(CurrIndex).Ind
nOperId = m_MachiningList(nI).m_nId
nCount = nCount + 1
If Not (m_MachiningList(nI).m_bIsLine Or m_MachiningList(nI).m_dPrevAng > FL_ARC_ANG_MIN Or m_MachiningList(nI).m_sLay = NAME_ONPATH) Then
Continue For
End If
nIndexTwinCut = GetIndexTwinCut(nI, False)
If Not (m_MachiningList(nI).m_bCanStartAll Or nIndexTwinCut > -1) Then
EgtOutLog("Il taglio non puo' essere allungato all'interno del pezzo") EgtOutLog("Il taglio non puo' essere allungato all'interno del pezzo")
Return ' Passo al prossimo indice disponibile
Continue For
End If End If
' leggo il valore salvato nella geometria ' leggo il valore salvato nella geometria
@@ -1733,6 +1943,8 @@ Public Class SplitPageUC
EgtGetMachiningParam(MCH_MP.STARTADDLEN, dAddLen) EgtGetMachiningParam(MCH_MP.STARTADDLEN, dAddLen)
' verifico che non sia sull'angolo interno (altrimenti vieto la modifica) ' verifico che non sia sull'angolo interno (altrimenti vieto la modifica)
If Not m_StartEndModifyOnIntCorner And (dAddLen - dOrigUsal < -10 * EPS_SMALL) Then If Not m_StartEndModifyOnIntCorner And (dAddLen - dOrigUsal < -10 * EPS_SMALL) Then
' Passo al prossimo indice disponibile
Continue For
Return Return
End If End If
EgtSetMachiningParam(MCH_MP.STARTADDLEN, dAddLen + dUsal - dOrigUsal) EgtSetMachiningParam(MCH_MP.STARTADDLEN, dAddLen + dUsal - dOrigUsal)
@@ -1751,6 +1963,25 @@ Public Class SplitPageUC
ColorNumberArrow(nI) ColorNumberArrow(nI)
bGenModif = True bGenModif = True
' Recupero il taglio TwinCut associato (Optional: False -> non controllo se è FinalCut)
nIndexTwinCut = GetIndexTwinCut(nI, False)
If nIndexTwinCut > -1 Then
' Se non è stato selezionato allora devo modificarlo, alrtimenti resetto l'indice
If m_ItemList(nIndexTwinCut).IsSelected Then
nIndexTwinCut = -1
Else
CurrIndex = nIndexTwinCut
End If
End If
If nCount > 10 Then
EgtOutLog("! FATAL ERROR ! In function 'ModifStartBtn' cycle 'Do Loop Until' is potentially infinte")
' Forzo l'uscita dal ciclo
nIndexTwinCut = -1
End If
Loop Until nIndexTwinCut < 0
' se altrimenti fresatura sopra ' se altrimenti fresatura sopra
ElseIf nMachiningType = MCH_MY.MILLING And m_MachiningList(nI).m_sLay = NAME_ONPATH Then ElseIf nMachiningType = MCH_MY.MILLING And m_MachiningList(nI).m_sLay = NAME_ONPATH Then
@@ -1762,7 +1993,10 @@ Public Class SplitPageUC
' Dialogo richiesta valore ' Dialogo richiesta valore
Dim ValWnd As New EditValueWD(m_MainWindow, "MILL: " & EgtMsg(90375)) ' Allungamento Dim ValWnd As New EditValueWD(m_MainWindow, "MILL: " & EgtMsg(90375)) ' Allungamento
ValWnd.SetVal(dOrigUsal, bLen) ValWnd.SetVal(dOrigUsal, bLen)
If Not ValWnd.ShowDialog() Then Return If Not ValWnd.ShowDialog() Then
' Esco da tutto
Return
End If
' carico il valore letto dal testierino virtuale ' carico il valore letto dal testierino virtuale
dUsal = ValWnd.GetVal(bLen) dUsal = ValWnd.GetVal(bLen)
' comunico che ho letto il primo dato ' comunico che ho letto il primo dato
@@ -1804,8 +2038,10 @@ Public Class SplitPageUC
ModifStartWnd.SetLiTangDist(nOriginalTangDist) ModifStartWnd.SetLiTangDist(nOriginalTangDist)
ModifStartWnd.SetLiPerpDist(nOriginalPerpDist) ModifStartWnd.SetLiPerpDist(nOriginalPerpDist)
ModifStartWnd.SetLeadInType(nOriginalLeadInType) ModifStartWnd.SetLeadInType(nOriginalLeadInType)
If Not ModifStartWnd.ShowDialog() Then Return If Not ModifStartWnd.ShowDialog() Then
' esco da tutto
Return
End If
' carico il valore letto dal testierino virtuale ' carico il valore letto dal testierino virtuale
dWJAddLen = ModifStartWnd.GetElongation() dWJAddLen = ModifStartWnd.GetElongation()
bWJLiHole = ModifStartWnd.GetHole() bWJLiHole = ModifStartWnd.GetHole()
@@ -1841,6 +2077,7 @@ Public Class SplitPageUC
End If End If
End Sub End Sub
' Ok
Private Sub ModifEndBtn_Click(sender As Object, e As RoutedEventArgs) Handles ModifEndBtn.Click Private Sub ModifEndBtn_Click(sender As Object, e As RoutedEventArgs) Handles ModifEndBtn.Click
Dim bLen As Boolean = True Dim bLen As Boolean = True
' abilito la finestra per inserire i valori solo per il primo elemento della lista (di default tutti gli altri oggetti assumono lo stesso valore) ' abilito la finestra per inserire i valori solo per il primo elemento della lista (di default tutti gli altri oggetti assumono lo stesso valore)
@@ -1860,17 +2097,34 @@ Public Class SplitPageUC
If m_CurrFirstInd = -1 Then Return If m_CurrFirstInd = -1 Then Return
Dim bGenModif As Boolean = False Dim bGenModif As Boolean = False
For Index As Integer = m_CurrFirstInd To m_CurrLastInd For Index As Integer = m_CurrFirstInd To m_CurrLastInd
Dim nIndexTwinCut As Integer = -1
Dim CurrIndex As Integer = Index
' Indice di controllo LOOP: se > 10 allora il ciclo è potenzialmente infinito!
Dim nCount As Integer = 0
If Not m_ItemList(Index).IsSelected Then If Not m_ItemList(Index).IsSelected Then
Continue For Continue For
End If End If
Dim nI As Integer = m_ItemList(Index).Ind Dim nI As Integer = m_ItemList(Index).Ind
Dim nOperId As Integer = m_MachiningList(nI).m_nId Dim nOperId As Integer = m_MachiningList(nI).m_nId
Dim nMachiningType As Integer = EgtGetOperationType(nOperId) Dim nMachiningType As Integer = EgtGetOperationType(nOperId)
' Se taglio con lama
If nMachiningType = MCH_MY.SAWING And
(m_MachiningList(nI).m_bIsLine Or m_MachiningList(nI).m_dNextAng > FL_ARC_ANG_MIN Or m_MachiningList(nI).m_sLay = NAME_ONPATH) Then
If Not m_MachiningList(nI).m_bCanEndAll Then ' Se taglio con lama
If nMachiningType = MCH_MY.SAWING Then
Do
' Riassegno i valori dell'indice corrente
nI = m_ItemList(CurrIndex).Ind
nOperId = m_MachiningList(nI).m_nId
nCount = nCount + 1
If Not (m_MachiningList(nI).m_bIsLine Or m_MachiningList(nI).m_dNextAng > FL_ARC_ANG_MIN Or m_MachiningList(nI).m_sLay = NAME_ONPATH) Then
Continue For
End If
nIndexTwinCut = GetIndexTwinCut(nI, False)
If Not (m_MachiningList(nI).m_bCanEndAll Or nIndexTwinCut > -1) Then
EgtOutLog("Il taglio non puo' essere allungato all'interno del pezzo") EgtOutLog("Il taglio non puo' essere allungato all'interno del pezzo")
Return Return
End If End If
@@ -1928,6 +2182,25 @@ Public Class SplitPageUC
ColorMachining(m_MachiningList(nI)) ColorMachining(m_MachiningList(nI))
ColorNumberArrow(nI) ColorNumberArrow(nI)
bGenModif = True bGenModif = True
' Recupero il taglio TwinCut associato (Optional: False -> non controllo se è FinalCut)
nIndexTwinCut = GetIndexTwinCut(nI, False)
If nIndexTwinCut > -1 Then
' Se non è stato selezionato allora devo modificarlo, alrtimenti resetto l'indice
If m_ItemList(nIndexTwinCut).IsSelected Then
nIndexTwinCut = -1
Else
CurrIndex = nIndexTwinCut
End If
End If
If nCount > 10 Then
EgtOutLog("! FATAL ERROR ! In function 'ModifStartBtn' cycle 'Do Loop Until' is potentially infinte")
' Forzo l'uscita dal ciclo
nIndexTwinCut = -1
End If
Loop Until nIndexTwinCut < 0
' se altrimenti fresatura sopra ' se altrimenti fresatura sopra
ElseIf nMachiningType = MCH_MY.MILLING And m_MachiningList(nI).m_sLay = NAME_ONPATH Then ElseIf nMachiningType = MCH_MY.MILLING And m_MachiningList(nI).m_sLay = NAME_ONPATH Then