Compare commits

..

8 Commits

Author SHA1 Message Date
Nicola Pievani db623544e9 Gestione Split per tagli finali 2025-08-28 19:12:46 +02:00
Nicola Pievani 3075c2f4af Migliorata gestione avvio programma CameraMng 2025-08-27 16:03:31 +02:00
Nicola Pievani 045e7cba61 Gestione spostame tagli finali 2025-08-27 15:54:55 +02:00
Nicola Pievani 57d4a29b74 Gestione configurazione dei comandi RESET, milgiorata funzione ResetFEED 2025-08-27 14:30:14 +02:00
Nicola Pievani b045f0ce7b Gestione aggiornamento lavorazioni inclinate 2025-08-26 11:19:32 +02:00
Nicola Pievani 41767f4f3a Merge branch 'develop' of https://gitlab.steamware.net/egaltech/OmagCUT into develop 2025-08-25 18:56:41 +02:00
Nicola Pievani 85f05f280f Corretta gestione selezione lavorazione inclianata senza cmabio lama 2025-08-25 18:56:06 +02:00
Demetrio Cassarino b4338ef88e -migliorata gestione pagina sideangleUC 2025-08-25 16:12:13 +02:00
9 changed files with 742 additions and 232 deletions
+497 -203
View File
@@ -1,5 +1,6 @@
Imports System.Collections.ObjectModel
Imports System.ComponentModel
Imports System.Reflection
Imports EgtUILib
Public Class SplitPageUC
@@ -203,7 +204,7 @@ Public Class SplitPageUC
If Mach.m_sLay = NAME_ONPATH Then AddTopText(sText)
If Mach.m_bFinalCut Then AddFinalText(sText)
Else
sText = EgtMsg(90791) & " " & i.ToString() & " " & DoubleToString(Mach.m_dSideAng, 2) & "°"
sText = EgtMsg(90791) & " " & i.ToString() & " " & DoubleToString(Mach.m_dSideAng, 2) & "°"
End If
If Mach.m_bPause Then AddPauseText(sText)
AddItemToList(i, Mach, sText, MCH_OY.SAWING)
@@ -916,6 +917,8 @@ Public Class SplitPageUC
Next
m_CurrFirstInd = m_ItemList.IndexOf(ItemList(0))
m_CurrLastInd = m_ItemList.IndexOf(ItemList(ItemList.Count - 1))
' Aggiorno lo stato dei bottoni
UpdateEnableMoveBtn()
EgtDraw()
End Sub
@@ -932,7 +935,9 @@ Public Class SplitPageUC
If m_IsCtrlKeyDown Or m_IsShiftKeyDown Then Return
Dim Index As Integer = MachiningLsBx.SelectedIndex
If Index = -1 Then Return
ChangeMachinig(m_MachiningList(Index).m_nId)
If m_MainWindow.m_CurrentMachine.MountedToolConfig = CurrentMachine.MountedToolConfigs.TOOLCHANGERWITHSAW Then
ChangeMachinig(m_MachiningList(Index).m_nId)
End If
End Sub
Private Sub MoveUpBtn_Click(sender As Object, e As RoutedEventArgs) Handles MoveUpBtn.Click
@@ -962,11 +967,31 @@ Public Class SplitPageUC
End If
End Sub
' Uno spostamento è possibile solo se la pozione di arrivo è un taglio dello stesso tipo (FinalCut)
Private Sub UpdateEnableMoveBtn()
If Not MoveUpBtn.IsEnabled And Not MoveDownBtn.IsEnabled Then Return
' MOVE UP (-1)
If m_CurrFirstInd > 0 Then
Dim OldItem As SplitMach = m_MachiningList(m_CurrFirstInd - 1)
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)
End If
' MOVE DOWN (1)
If m_CurrLastInd < m_MachiningList.Count - 1 Then
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)
End If
End Sub
Private Sub MoveItem(direction As Integer)
' Checking selected item
If m_CurrFirstInd = -1 OrElse MachiningLsBx.SelectedIndex < 0 Then
Return
End If
m_MainWindow.m_CurrentProjectPageUC.ClearMessage()
' Se la direzione è giù
If direction = 1 And m_CurrLastInd < m_ItemList.Count - 1 Then
@@ -990,7 +1015,8 @@ Public Class SplitPageUC
m_CurrFirstInd -= 1
m_CurrLastInd -= 1
End If
' Aggiorno lo stato dei bottoni
UpdateEnableMoveBtn()
' Imposto flag di modifica
m_bModified = True
End Sub
@@ -1250,17 +1276,31 @@ Public Class SplitPageUC
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,
Optional bAllForced As Boolean = False,
Optional bAccForced As Boolean = False) As Boolean
Dim nIndexTwinCut As Integer = GetIndexTwinCut(nI, False)
' 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
EgtSetCurrMachining(m_MachiningList(nI).m_nId)
Dim nLiPrev As Integer
EgtGetMachiningParam(MCH_MP.LEADINTYPE, nLiPrev)
Dim nLoPrev As Integer
EgtGetMachiningParam(MCH_MP.LEADOUTTYPE, nLoPrev)
If (m_MachiningList(nI).m_bStartAll Or m_MachiningList(nI).m_bEndAll) And Not bAllForced Then
' accorcio
If nLiPrev = MCH_SAW_LI.EXT_OUT Then
@@ -1276,6 +1316,28 @@ Public Class SplitPageUC
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
m_MachiningList(nI).m_bStartAll = 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
' allungo
If nLiPrev = MCH_SAW_LI.OUT Then
@@ -1291,20 +1353,44 @@ Public Class SplitPageUC
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
m_MachiningList(nI).m_bStartAll = 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
ColorMachining(m_MachiningList(nI))
Return True
End Function
' Ok: gestione info 'IdTwinCut' per tagli FinalCut
Private Function AdjustStartCut(nI As Integer,
Optional bAllForced As Boolean = False,
Optional bAccForced As Boolean = False) As Boolean
Dim nIndexTwinCut As Integer = GetIndexTwinCut(nI, False)
' 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
EgtSetCurrMachining(m_MachiningList(nI).m_nId)
Dim nLiPrev As Integer
EgtGetMachiningParam(MCH_MP.LEADINTYPE, nLiPrev)
If m_MachiningList(nI).m_bStartAll And Not bAllForced Then
' accorcio
If nLiPrev = MCH_SAW_LI.EXT_OUT Then
@@ -1314,6 +1400,21 @@ Public Class SplitPageUC
End If
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
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
' allungo
If nLiPrev = MCH_SAW_LI.OUT Then
@@ -1323,20 +1424,38 @@ Public Class SplitPageUC
End If
UpdateMachiningPreview(m_MachiningList(nI).m_nId, 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
ColorMachining(m_MachiningList(nI))
Return True
End Function
' Ok: gestione info 'IdTwinCut' per tagli FinalCut
Private Function AdjustEndCut(nI As Integer,
Optional bAllForced As Boolean = False,
Optional bAccForced As Boolean = False) As Boolean
Dim nIndexTwinCut As Integer = GetIndexTwinCut(nI, False)
' 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
EgtSetCurrMachining(m_MachiningList(nI).m_nId)
Dim nLoPrev As Integer
EgtGetMachiningParam(MCH_MP.LEADOUTTYPE, nLoPrev)
If m_MachiningList(nI).m_bEndAll And Not bAllForced Then
' accorcio
If nLoPrev = MCH_SAW_LO.EXT_OUT Then
@@ -1345,6 +1464,21 @@ Public Class SplitPageUC
EgtSetMachiningParam(MCH_MP.LEADOUTTYPE, MCH_SAW_LO.CENT)
End If
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
' allungo
If nLoPrev = MCH_SAW_LO.OUT Then
@@ -1353,62 +1487,106 @@ Public Class SplitPageUC
EgtSetMachiningParam(MCH_MP.LEADOUTTYPE, MCH_SAW_LO.EXT_CENT)
End If
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
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
ColorMachining(m_MachiningList(nI))
Return True
End Function
' Ok: gestione info 'IdTwinCut' per tagli FinalCut
Private Sub OutCenStartBtn_Click(sender As Object, e As RoutedEventArgs) Handles OutCenStartBtn.Click
If m_CurrFirstInd = -1 Then Return
Dim bGenModif As Boolean = False
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
End If
Dim nI As Integer = m_ItemList(Index).Ind
If m_MachiningList(nI).m_sLay = NAME_OUTLOOP Then
' se ho forzato il tipo di ingresso da CamAuto qui non posso moficarlo!
If m_MachiningList(nI).m_bMngLeadInOnIntCorner Then
EgtOutLog(" ⚠️ L'ingresso di taglio associato all'entita'_" & m_MachiningList(nI).m_nEntId & " non puo' essere modificato per problemi di ingombro lama ⚠️")
Else
Do
nCount = nCount + 1
Dim nI As Integer = m_ItemList(CurrIndex).Ind
If m_MachiningList(nI).m_sLay = NAME_OUTLOOP Then
' se ho forzato il tipo di ingresso da CamAuto qui non posso moficarlo!
If m_MachiningList(nI).m_bMngLeadInOnIntCorner Then
EgtOutLog("L'ingresso di taglio associato all'entita'_" & m_MachiningList(nI).m_nEntId & " non puo' essere modificato per problemi di ingombro lama")
Else
EgtSetCurrMachining(m_MachiningList(nI).m_nId)
Dim nLiPrev As Integer
EgtGetMachiningParam(MCH_MP.LEADINTYPE, nLiPrev)
If nLiPrev = MCH_SAW_LI.OUT Then
' accorcio
EgtSetMachiningParam(MCH_MP.LEADINTYPE, MCH_SAW_LI.CENT)
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
ModifyOtherLeadIn(nI, MCH_SAW_LI.CENT)
' ri-verifico interferenza
EgtVerifyMachining(m_MachiningList(nI).m_nId, m_MachiningList(nI).m_nInterf)
ElseIf nLiPrev = MCH_SAW_LI.EXT_OUT Then
' accorcio
EgtSetMachiningParam(MCH_MP.LEADINTYPE, MCH_SAW_LI.EXT_CENT)
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
ModifyOtherLeadIn(nI, MCH_SAW_LI.CENT)
ElseIf nLiPrev = MCH_SAW_LI.CENT Then
' allungo
EgtSetMachiningParam(MCH_MP.LEADINTYPE, MCH_SAW_LI.OUT)
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
ModifyOtherLeadIn(nI, MCH_SAW_LI.OUT)
' ri-verifico interferenza
EgtVerifyMachining(m_MachiningList(nI).m_nId, m_MachiningList(nI).m_nInterf)
ElseIf nLiPrev = MCH_SAW_LI.EXT_CENT Then
' allungo
EgtSetMachiningParam(MCH_MP.LEADINTYPE, MCH_SAW_LI.EXT_OUT)
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
ModifyOtherLeadIn(nI, MCH_SAW_LI.OUT)
End If
ColorMachining(m_MachiningList(nI))
ColorNumberArrow(nI)
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
EgtSetCurrMachining(m_MachiningList(nI).m_nId)
Dim nLiPrev As Integer
EgtGetMachiningParam(MCH_MP.LEADINTYPE, nLiPrev)
If nLiPrev = MCH_SAW_LI.OUT Then
' accorcio
EgtSetMachiningParam(MCH_MP.LEADINTYPE, MCH_SAW_LI.CENT)
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
ModifyOtherLeadIn(nI, MCH_SAW_LI.CENT)
' ri-verifico interferenza
EgtVerifyMachining(m_MachiningList(nI).m_nId, m_MachiningList(nI).m_nInterf)
ElseIf nLiPrev = MCH_SAW_LI.EXT_OUT Then
' accorcio
EgtSetMachiningParam(MCH_MP.LEADINTYPE, MCH_SAW_LI.EXT_CENT)
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
ModifyOtherLeadIn(nI, MCH_SAW_LI.CENT)
ElseIf nLiPrev = MCH_SAW_LI.CENT Then
' allungo
EgtSetMachiningParam(MCH_MP.LEADINTYPE, MCH_SAW_LI.OUT)
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
ModifyOtherLeadIn(nI, MCH_SAW_LI.OUT)
' ri-verifico interferenza
EgtVerifyMachining(m_MachiningList(nI).m_nId, m_MachiningList(nI).m_nInterf)
ElseIf nLiPrev = MCH_SAW_LI.EXT_CENT Then
' allungo
EgtSetMachiningParam(MCH_MP.LEADINTYPE, MCH_SAW_LI.EXT_OUT)
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
ModifyOtherLeadIn(nI, MCH_SAW_LI.OUT)
End If
ColorMachining(m_MachiningList(nI))
ColorNumberArrow(nI)
bGenModif = True
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
' Se modificato qualcosa
If bGenModif Then
@@ -1417,6 +1595,7 @@ Public Class SplitPageUC
End If
End Sub
' Ok: anche per tagli TwinCut con affondament ridotto
Private Sub AllOutStartBtn_Click(sender As Object, e As RoutedEventArgs) Handles AllOutStartBtn.Click
For nI As Integer = 0 To m_MachiningList.Count() - 1
EgtSetCurrMachining(m_MachiningList(nI).m_nId)
@@ -1443,12 +1622,13 @@ Public Class SplitPageUC
m_bModified = True
End Sub
' Ok: anche per tagli TwinCut con affondament ridotto
Private Sub AllCenStartBtn_Click(sender As Object, e As RoutedEventArgs) Handles AllCenStartBtn.Click
For nI As Integer = 0 To m_MachiningList.Count() - 1
' se ho forzato il tipo di ingresso da CamAuto qui non posso moficarlo!
If m_MachiningList(nI).m_bMngLeadInOnIntCorner Then
EgtOutLog(" ⚠️ L'ingresso di taglio associato all'entita'_" & m_MachiningList(nI).m_nEntId & " non puo' essere modificato per problemi di ingombro lama ⚠️")
EgtOutLog("L'ingresso di taglio associato all'entita'_" & m_MachiningList(nI).m_nEntId & " non puo' essere modificato per problemi di ingombro lama")
Else
EgtSetCurrMachining(m_MachiningList(nI).m_nId)
@@ -1478,56 +1658,84 @@ Public Class SplitPageUC
m_bModified = True
End Sub
' Ok: gestione info 'IdTwinCut' per tagli FinalCut
Private Sub OutCenEndBtn_Click(sender As Object, e As RoutedEventArgs) Handles OutCenEndBtn.Click
If m_CurrFirstInd = -1 Then Return
Dim bGenModif As Boolean = False
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
End If
Dim nI As Integer = m_ItemList(Index).Ind
If m_MachiningList(nI).m_sLay = NAME_OUTLOOP Then
' se ho forzato il tipo di ingresso da CamAuto qui non posso moficarlo!
If m_MachiningList(nI).m_bMngLeadInOnIntCorner Then
EgtOutLog(" ⚠️ L'uscita di taglio associato all'entita'_" & m_MachiningList(nI).m_nEntId & " non puo' essere modificato per problemi di ingombro lama ⚠️")
Else
Do
nCount = nCount + 1
Dim nI As Integer = m_ItemList(CurrIndex).Ind
If m_MachiningList(nI).m_sLay = NAME_OUTLOOP Then
' se ho forzato il tipo di ingresso da CamAuto qui non posso moficarlo!
If m_MachiningList(nI).m_bMngLeadInOnIntCorner Then
EgtOutLog("L'uscita di taglio associato all'entita'_" & m_MachiningList(nI).m_nEntId & " non puo' essere modificato per problemi di ingombro lama")
Else
EgtSetCurrMachining(m_MachiningList(nI).m_nId)
Dim nLoPrev As Integer
EgtGetMachiningParam(MCH_MP.LEADOUTTYPE, nLoPrev)
If nLoPrev = MCH_SAW_LO.OUT Then
' accorcio
EgtSetMachiningParam(MCH_MP.LEADOUTTYPE, MCH_SAW_LO.CENT)
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
ModifyOtherLeadOut(nI, MCH_SAW_LO.CENT)
' ri-verifico interferenza
EgtVerifyMachining(m_MachiningList(nI).m_nId, m_MachiningList(nI).m_nInterf)
ElseIf nLoPrev = MCH_SAW_LO.EXT_OUT Then
' accorcio
EgtSetMachiningParam(MCH_MP.LEADOUTTYPE, MCH_SAW_LO.EXT_CENT)
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
ModifyOtherLeadOut(nI, MCH_SAW_LO.CENT)
ElseIf nLoPrev = MCH_SAW_LO.CENT Then
' allungo
EgtSetMachiningParam(MCH_MP.LEADOUTTYPE, MCH_SAW_LO.OUT)
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
ModifyOtherLeadOut(nI, MCH_SAW_LO.OUT)
' ri-verifico interferenza
EgtVerifyMachining(m_MachiningList(nI).m_nId, m_MachiningList(nI).m_nInterf)
ElseIf nLoPrev = MCH_SAW_LO.EXT_CENT Then
' allungo
EgtSetMachiningParam(MCH_MP.LEADOUTTYPE, MCH_SAW_LO.EXT_OUT)
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
ModifyOtherLeadOut(nI, MCH_SAW_LO.OUT)
End If
ColorMachining(m_MachiningList(nI))
ColorNumberArrow(nI)
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
EgtSetCurrMachining(m_MachiningList(nI).m_nId)
Dim nLoPrev As Integer
EgtGetMachiningParam(MCH_MP.LEADOUTTYPE, nLoPrev)
If nLoPrev = MCH_SAW_LO.OUT Then
' accorcio
EgtSetMachiningParam(MCH_MP.LEADOUTTYPE, MCH_SAW_LO.CENT)
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
ModifyOtherLeadOut(nI, MCH_SAW_LO.CENT)
' ri-verifico interferenza
EgtVerifyMachining(m_MachiningList(nI).m_nId, m_MachiningList(nI).m_nInterf)
ElseIf nLoPrev = MCH_SAW_LO.EXT_OUT Then
' accorcio
EgtSetMachiningParam(MCH_MP.LEADOUTTYPE, MCH_SAW_LO.EXT_CENT)
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
ModifyOtherLeadOut(nI, MCH_SAW_LO.CENT)
ElseIf nLoPrev = MCH_SAW_LO.CENT Then
' allungo
EgtSetMachiningParam(MCH_MP.LEADOUTTYPE, MCH_SAW_LO.OUT)
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
ModifyOtherLeadOut(nI, MCH_SAW_LO.OUT)
' ri-verifico interferenza
EgtVerifyMachining(m_MachiningList(nI).m_nId, m_MachiningList(nI).m_nInterf)
ElseIf nLoPrev = MCH_SAW_LO.EXT_CENT Then
' allungo
EgtSetMachiningParam(MCH_MP.LEADOUTTYPE, MCH_SAW_LO.EXT_OUT)
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
ModifyOtherLeadOut(nI, MCH_SAW_LO.OUT)
End If
ColorMachining(m_MachiningList(nI))
ColorNumberArrow(nI)
bGenModif = True
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
' Se modificato qualcosa
If bGenModif Then
@@ -1536,6 +1744,7 @@ Public Class SplitPageUC
End If
End Sub
' Ok: anche per tagli TwinCut con affondament ridotto
Private Sub AllOutEndBtn_Click(sender As Object, e As RoutedEventArgs) Handles AllOutEndBtn.Click
For nI As Integer = 0 To m_MachiningList.Count() - 1
EgtSetCurrMachining(m_MachiningList(nI).m_nId)
@@ -1562,12 +1771,13 @@ Public Class SplitPageUC
m_bModified = True
End Sub
' Ok
Private Sub AllCenEndBtn_Click(sender As Object, e As RoutedEventArgs) Handles AllCenEndBtn.Click
For nI As Integer = 0 To m_MachiningList.Count() - 1
' se ho forzato il tipo di ingresso da CamAuto qui non posso moficarlo!
If m_MachiningList(nI).m_bMngLeadInOnIntCorner Then
EgtOutLog(" ⚠️ L'uscita di taglio associato all'entita'_" & m_MachiningList(nI).m_nEntId & " non puo' essere modificato per problemi di ingombro lama ⚠️")
EgtOutLog("L'uscita di taglio associato all'entita'_" & m_MachiningList(nI).m_nEntId & " non puo' essere modificato per problemi di ingombro lama")
Else
EgtSetCurrMachining(m_MachiningList(nI).m_nId)
@@ -1597,6 +1807,7 @@ Public Class SplitPageUC
m_bModified = True
End Sub
' Ok
Private Sub AllExtendBtn_Click(sender As Object, e As RoutedEventArgs) Handles AllExtendBtn.Click
Dim bModif As Boolean = False
For nI As Integer = 0 To m_MachiningList.Count() - 1
@@ -1618,6 +1829,7 @@ Public Class SplitPageUC
EnableButtons()
End Sub
' Ok
Private Sub AllReduceBtn_Click(sender As Object, e As RoutedEventArgs) Handles AllReduceBtn.Click
Dim bModif As Boolean = False
For nI As Integer = 0 To m_MachiningList.Count() - 1
@@ -1639,6 +1851,7 @@ Public Class SplitPageUC
EnableButtons()
End Sub
' Ok
Private Sub ModifStartBtn_Click(sender As Object, e As RoutedEventArgs) Handles ModifStartBtn.Click
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)
@@ -1659,76 +1872,115 @@ Public Class SplitPageUC
If m_CurrFirstInd = -1 Then Return
Dim bGenModif As Boolean = False
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
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 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 nMachiningType = MCH_MY.SAWING Then
If Not m_MachiningList(nI).m_bCanStartAll Then
EgtOutLog(" ⚠️ Il taglio non puo' essere allungato all'interno del pezzo ⚠️")
Return
End If
' leggo il valore salvato nella geometria
Dim dOrigUsal As Double = 0
EgtGetInfo(nOperId, INFO_MCH_USER_SAL, dOrigUsal)
' ------------------ INIZIO PREPARAZIONE TASTIERINO VIRTUALE ------------------
If bFirstInd Then
' Dialogo richiesta valore
Dim ValWnd As New EditValueWD(m_MainWindow, "SAW: " & EgtMsg(90375)) ' Allungamento
ValWnd.SetVal(dOrigUsal, bLen)
If Not ValWnd.ShowDialog() Then Return
' carico il valore letto dal testierino virtuale
dUsal = ValWnd.GetVal(bLen)
' comunico che ho letto il primo dato
bFirstInd = False
End If
' ------------------ FINE PREPARAZIONE TASTIERINO VIRTUALE ------------------
Dim bRepeat As Boolean = False
Do
' Se c'è limite alla lunghezza libera
If m_MachiningList(nI).m_dStartFreeLen < FREELEN_INF Then
' se abilitati i controlli sugli allungamenti dei lati interni
If Not m_StartEndModifyOnIntCorner Then
' Recupero sicurezza in corner interno
Dim dCornerSafety As Double = Math.Max(GetPrivateProfileDouble(S_MACH_NEST, K_MACH_SAFE_LEN_INTCORNER, 1, m_MainWindow.GetMachIniFile()), 10 * EPS_SMALL)
' Recupero lunghezza baffo del taglio
Dim nPvId As Integer = GDB_ID.NULL
EgtGetInfo(EgtGetFirstNameInGroup(nOperId, NAME_PREVIEW), INFO_PV_ONPART_ID, nPvId)
Dim dDT As Double = 0
EgtGetInfo(EgtGetFirstGroupInGroup(nPvId), "DT", dDT)
dUsal = Math.Min(dUsal, m_MachiningList(nI).m_dStartFreeLen - dDT - dCornerSafety)
' 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")
' Passo al prossimo indice disponibile
Continue For
End If
' leggo il valore salvato nella geometria
Dim dOrigUsal As Double = 0
EgtGetInfo(nOperId, INFO_MCH_USER_SAL, dOrigUsal)
' ------------------ INIZIO PREPARAZIONE TASTIERINO VIRTUALE ------------------
If bFirstInd Then
' Dialogo richiesta valore
Dim ValWnd As New EditValueWD(m_MainWindow, "SAW: " & EgtMsg(90375)) ' Allungamento
ValWnd.SetVal(dOrigUsal, bLen)
If Not ValWnd.ShowDialog() Then Return
' carico il valore letto dal testierino virtuale
dUsal = ValWnd.GetVal(bLen)
' comunico che ho letto il primo dato
bFirstInd = False
End If
' ------------------ FINE PREPARAZIONE TASTIERINO VIRTUALE ------------------
Dim bRepeat As Boolean = False
Do
' Se c'è limite alla lunghezza libera
If m_MachiningList(nI).m_dStartFreeLen < FREELEN_INF Then
' se abilitati i controlli sugli allungamenti dei lati interni
If Not m_StartEndModifyOnIntCorner Then
' Recupero sicurezza in corner interno
Dim dCornerSafety As Double = Math.Max(GetPrivateProfileDouble(S_MACH_NEST, K_MACH_SAFE_LEN_INTCORNER, 1, m_MainWindow.GetMachIniFile()), 10 * EPS_SMALL)
' Recupero lunghezza baffo del taglio
Dim nPvId As Integer = GDB_ID.NULL
EgtGetInfo(EgtGetFirstNameInGroup(nOperId, NAME_PREVIEW), INFO_PV_ONPART_ID, nPvId)
Dim dDT As Double = 0
EgtGetInfo(EgtGetFirstGroupInGroup(nPvId), "DT", dDT)
dUsal = Math.Min(dUsal, m_MachiningList(nI).m_dStartFreeLen - dDT - dCornerSafety)
End If
End If
' Modifica della lavorazione
EgtSetCurrMachining(nOperId)
Dim dAddLen As Double = 0
EgtGetMachiningParam(MCH_MP.STARTADDLEN, dAddLen)
' verifico che non sia sull'angolo interno (altrimenti vieto la modifica)
If Not m_StartEndModifyOnIntCorner And (dAddLen - dOrigUsal < -10 * EPS_SMALL) Then
' Passo al prossimo indice disponibile
Continue For
Return
End If
EgtSetMachiningParam(MCH_MP.STARTADDLEN, dAddLen + dUsal - dOrigUsal)
EgtSetInfo(nOperId, INFO_MCH_USER_SAL, dUsal)
bRepeat = Not UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
If bRepeat Then
EgtSetMachiningParam(MCH_MP.STARTADDLEN, dOrigUsal)
EgtSetInfo(nOperId, INFO_MCH_USER_SAL, dOrigUsal)
dUsal = dOrigUsal
End If
Loop Until Not bRepeat
' verifico interferenza
EgtVerifyMachining(m_MachiningList(nI).m_nId, m_MachiningList(nI).m_nInterf)
ColorMachining(m_MachiningList(nI))
ColorNumberArrow(nI)
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
' Modifica della lavorazione
EgtSetCurrMachining(nOperId)
Dim dAddLen As Double = 0
EgtGetMachiningParam(MCH_MP.STARTADDLEN, dAddLen)
' verifico che non sia sull'angolo interno (altrimenti vieto la modifica)
If Not m_StartEndModifyOnIntCorner And (dAddLen - dOrigUsal < -10 * EPS_SMALL) Then
Return
End If
EgtSetMachiningParam(MCH_MP.STARTADDLEN, dAddLen + dUsal - dOrigUsal)
EgtSetInfo(nOperId, INFO_MCH_USER_SAL, dUsal)
bRepeat = Not UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
If bRepeat Then
EgtSetMachiningParam(MCH_MP.STARTADDLEN, dOrigUsal)
EgtSetInfo(nOperId, INFO_MCH_USER_SAL, dOrigUsal)
dUsal = dOrigUsal
End If
Loop Until Not bRepeat
' verifico interferenza
EgtVerifyMachining(m_MachiningList(nI).m_nId, m_MachiningList(nI).m_nInterf)
ColorMachining(m_MachiningList(nI))
ColorNumberArrow(nI)
bGenModif = True
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
ElseIf nMachiningType = MCH_MY.MILLING And m_MachiningList(nI).m_sLay = NAME_ONPATH Then
@@ -1741,7 +1993,10 @@ Public Class SplitPageUC
' Dialogo richiesta valore
Dim ValWnd As New EditValueWD(m_MainWindow, "MILL: " & EgtMsg(90375)) ' Allungamento
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
dUsal = ValWnd.GetVal(bLen)
' comunico che ho letto il primo dato
@@ -1783,8 +2038,10 @@ Public Class SplitPageUC
ModifStartWnd.SetLiTangDist(nOriginalTangDist)
ModifStartWnd.SetLiPerpDist(nOriginalPerpDist)
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
dWJAddLen = ModifStartWnd.GetElongation()
bWJLiHole = ModifStartWnd.GetHole()
@@ -1820,6 +2077,7 @@ Public Class SplitPageUC
End If
End Sub
' Ok
Private Sub ModifEndBtn_Click(sender As Object, e As RoutedEventArgs) Handles ModifEndBtn.Click
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)
@@ -1839,74 +2097,110 @@ Public Class SplitPageUC
If m_CurrFirstInd = -1 Then Return
Dim bGenModif As Boolean = False
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
Continue For
End If
Dim nI As Integer = m_ItemList(Index).Ind
Dim nOperId As Integer = m_MachiningList(nI).m_nId
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 nMachiningType = MCH_MY.SAWING Then
If Not m_MachiningList(nI).m_bCanEndAll Then
EgtOutLog(" ⚠️ Il taglio non puo' essere allungato all'interno del pezzo ⚠️")
Return
End If
Dim dOrigUeal As Double = 0
EgtGetInfo(nOperId, INFO_MCH_USER_EAL, dOrigUeal)
' ------------------ INIZIO PREPARAZIONE TASTIERINO VIRTUALE ------------------
If bFirstInd Then
' Dialogo richiesta valore
Dim ValWnd As New EditValueWD(m_MainWindow, "SAW: " & EgtMsg(90375)) ' Allungamento
ValWnd.SetVal(dOrigUeal, bLen)
If Not ValWnd.ShowDialog() Then Return
dUeal = ValWnd.GetVal(bLen)
bFirstInd = False
End If
' ------------------ FINE PREPARAZIONE TASTIERINO VIRTUALE ------------------
Dim bRepeat As Boolean = False
Do
' Se c'è limite alla lunghezza libera
If m_MachiningList(nI).m_dEndFreeLen < FREELEN_INF Then
' se abilitati i controlli sugli allungamenti dei lati interni
If Not m_StartEndModifyOnIntCorner Then
' Recupero sicurezza in corner interno
Dim dCornerSafety As Double = Math.Max(GetPrivateProfileDouble(S_MACH_NEST, K_MACH_SAFE_LEN_INTCORNER, 1, m_MainWindow.GetMachIniFile()), 10 * EPS_SMALL)
' Recupero lunghezza baffo del taglio
Dim nPvId As Integer = GDB_ID.NULL
EgtGetInfo(EgtGetFirstNameInGroup(nOperId, NAME_PREVIEW), INFO_PV_ONPART_ID, nPvId)
Dim dDT As Double = 0
EgtGetInfo(EgtGetFirstGroupInGroup(nPvId), "DT", dDT)
dUeal = Math.Min(dUeal, m_MachiningList(nI).m_dEndFreeLen - dDT - dCornerSafety)
' 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")
Return
End If
Dim dOrigUeal As Double = 0
EgtGetInfo(nOperId, INFO_MCH_USER_EAL, dOrigUeal)
' ------------------ INIZIO PREPARAZIONE TASTIERINO VIRTUALE ------------------
If bFirstInd Then
' Dialogo richiesta valore
Dim ValWnd As New EditValueWD(m_MainWindow, "SAW: " & EgtMsg(90375)) ' Allungamento
ValWnd.SetVal(dOrigUeal, bLen)
If Not ValWnd.ShowDialog() Then Return
dUeal = ValWnd.GetVal(bLen)
bFirstInd = False
End If
' ------------------ FINE PREPARAZIONE TASTIERINO VIRTUALE ------------------
Dim bRepeat As Boolean = False
Do
' Se c'è limite alla lunghezza libera
If m_MachiningList(nI).m_dEndFreeLen < FREELEN_INF Then
' se abilitati i controlli sugli allungamenti dei lati interni
If Not m_StartEndModifyOnIntCorner Then
' Recupero sicurezza in corner interno
Dim dCornerSafety As Double = Math.Max(GetPrivateProfileDouble(S_MACH_NEST, K_MACH_SAFE_LEN_INTCORNER, 1, m_MainWindow.GetMachIniFile()), 10 * EPS_SMALL)
' Recupero lunghezza baffo del taglio
Dim nPvId As Integer = GDB_ID.NULL
EgtGetInfo(EgtGetFirstNameInGroup(nOperId, NAME_PREVIEW), INFO_PV_ONPART_ID, nPvId)
Dim dDT As Double = 0
EgtGetInfo(EgtGetFirstGroupInGroup(nPvId), "DT", dDT)
dUeal = Math.Min(dUeal, m_MachiningList(nI).m_dEndFreeLen - dDT - dCornerSafety)
End If
End If
' Modifica della lavorazione
EgtSetCurrMachining(nOperId)
Dim dAddLen As Double = 0
EgtGetMachiningParam(MCH_MP.ENDADDLEN, dAddLen)
If Not m_StartEndModifyOnIntCorner And (dAddLen - dOrigUeal < -10 * EPS_SMALL) Then
Return
End If
EgtSetMachiningParam(MCH_MP.ENDADDLEN, dAddLen + dUeal - dOrigUeal)
EgtSetInfo(nOperId, INFO_MCH_USER_EAL, dUeal)
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
bRepeat = Not UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
If bRepeat Then
EgtSetMachiningParam(MCH_MP.ENDADDLEN, dOrigUeal)
EgtSetInfo(nOperId, INFO_MCH_USER_EAL, dOrigUeal)
dUeal = dOrigUeal
End If
Loop Until Not bRepeat
' verifico interferenza
EgtVerifyMachining(m_MachiningList(nI).m_nId, m_MachiningList(nI).m_nInterf)
ColorMachining(m_MachiningList(nI))
ColorNumberArrow(nI)
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
' Modifica della lavorazione
EgtSetCurrMachining(nOperId)
Dim dAddLen As Double = 0
EgtGetMachiningParam(MCH_MP.ENDADDLEN, dAddLen)
If Not m_StartEndModifyOnIntCorner And (dAddLen - dOrigUeal < -10 * EPS_SMALL) Then
Return
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
EgtSetMachiningParam(MCH_MP.ENDADDLEN, dAddLen + dUeal - dOrigUeal)
EgtSetInfo(nOperId, INFO_MCH_USER_EAL, dUeal)
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
bRepeat = Not UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
If bRepeat Then
EgtSetMachiningParam(MCH_MP.ENDADDLEN, dOrigUeal)
EgtSetInfo(nOperId, INFO_MCH_USER_EAL, dOrigUeal)
dUeal = dOrigUeal
End If
Loop Until Not bRepeat
Loop Until nIndexTwinCut < 0
' verifico interferenza
EgtVerifyMachining(m_MachiningList(nI).m_nId, m_MachiningList(nI).m_nInterf)
ColorMachining(m_MachiningList(nI))
ColorNumberArrow(nI)
bGenModif = True
' se altrimenti fresatura sopra
ElseIf nMachiningType = MCH_MY.MILLING And m_MachiningList(nI).m_sLay = NAME_ONPATH Then
+6 -1
View File
@@ -1563,10 +1563,15 @@ Public Class DrawPageUC
LeftButtonGrd.Children.Remove(m_CompoDimension.m_AlzFrontPage)
End Select
' Pulisco l'ambiente lua
ResetLuaVariables()
Try
VariablesGrd.Children.Remove(m_CompoDimension)
Catch ex As Exception
Dim x As Boolean = True
End Try
End Sub
Private Class CompoVar
+1 -1
View File
@@ -248,5 +248,5 @@ Public Class SecondaryComponentPageUC
m_MainWindow.m_DrawPageUC.LeftButtonGrd.Children.Add(m_MainComponentPage)
End Sub
End Class
+43 -2
View File
@@ -167,7 +167,42 @@ Public Class SideAngleUC
End If
' Gestisco Checkbox e nomi in base al numero di lati inclinabili
TxBlChBxView()
' Controllo se la checkbox SideAngle è attiva
If SideAngleChBx.IsChecked Then
Dim dSideAngle As Double = 0
Dim dHell As Double = 0
' Controllo se l'angolo della nuova entità non è nullo
If Not String.IsNullOrEmpty(NewA1TxBx.Text) Then
StringToDouble(NewA1TxBx.Text, dSideAngle)
' Controllo se l'angolo è diverso da 0
If dSideAngle <> 0 Then
' Aggiorno l'angolo delle entità
UpdateSideAngleAllEntities()
End If
End If
' Controllo se il tallone della nuova entità non è nullo
If Not String.IsNullOrEmpty(NewH1TxBx.Text) Then
StringToDouble(NewH1TxBx.Text, dHell)
' Controllo se il tallone è maggiore di 0
If dHell > 0 Then
' Aggiorno il tallone delle entità
UpdateHeelAllEntities()
End If
End If
' Elimino le righe per riposizionarle
Grid.SetRow(NewEntity, MAX_LINES - m_nShow + 1)
Grid.SetRow(NewA1TxBx, MAX_LINES - m_nShow + 1)
Grid.SetRow(NewH1TxBx, MAX_LINES - m_nShow + 1)
Grid.SetRow(SideAngleBl, MAX_LINES - m_nShow)
Grid.SetRow(HeelBl, MAX_LINES - m_nShow)
Grid.SetRow(SideAngleGrid, MAX_LINES - m_nShow)
' Rendo visibile solo la nuova entità
CollapsedCheckAllTextSideAng()
Else
' Altrimenti eseguo impaginazione classica
TxBlChBxView()
End If
' Aggiorno valori
If m_Mode = ModeOpt.DRIP Then
@@ -406,10 +441,16 @@ Public Class SideAngleUC
Grid.SetRow(NewA1TxBx, MAX_LINES - m_nShow + 1)
Grid.SetRow(NewH1TxBx, MAX_LINES - m_nShow + 1)
NewEntity.Text = "A#"
' Se interrompo la creazione di un unico SideAng
If Not GetSideAngleFromAllEntities() Then Return
CollapsedCheckAllTextSideAng()
End Sub
' Rende visibile NewEntity quando si attiva la spunta sulla checkbox
Private Sub CollapsedCheckAllTextSideAng()
NewEntity.Text = "A#"
PrevBtn.Visibility = Visibility.Collapsed
NextBtn.Visibility = Visibility.Collapsed
+18
View File
@@ -614,6 +614,24 @@ Public Class AlarmsPageUC
m_MainWindow.m_WorkInProgressPageUC.UpdateTools()
' aggiorno la lista delle lavorazioni
RefreschMachining()
' Se è associata anche una lavorazione inclinata allora deve essere resettata
If m_CurrentMachine.MountedToolConfig <> CurrentMachine.MountedToolConfigs.TOOLCHANGERWITHSAW Then
m_CurrentMachine.sCurrSawTilted = CurrSawCmBx.SelectedItem.ToString()
' Se nuova lama incompatibile con lavorazione di taglio corrente, resetto quest'ultima
sMchTuuid = String.Empty
sMchTool = String.Empty
If Not EgtMdbSetCurrMachining(m_CurrentMachine.sCurrSawingTilted) Or
Not EgtMdbGetCurrMachiningParam(MCH_MP.TUUID, sMchTuuid) Or
Not EgtTdbGetToolFromUUID(sMchTuuid, sMchTool) Or
String.Compare(sMchTool, m_CurrentMachine.sCurrSawTilted, True) <> 0 Then
m_CurrentMachine.sCurrSawingTilted = String.Empty
End If
' Aggiorno utensili per lavoro in corso
m_MainWindow.m_WorkInProgressPageUC.UpdateTools()
' aggiorno la lista delle lavorazioni
RefreschMachining()
End If
End Sub
' -- SAW TILTED --
+8 -3
View File
@@ -330,13 +330,18 @@ Public Class CurrentProjectPageUC
EgtSetCurrentContext(CurrentProjectScene.GetCtx())
' Cancello eventuali messaggi
ClearMessage()
' Se è stata modificata l'uso della lama inclinata allora aggiorno anche questa lavorazione
If m_MainWindow.m_CurrentMachine.MountedToolConfig <> CurrentMachine.MountedToolConfigs.TOOLCHANGERWITHSAW Then
' assegno la lavorazione corrente per i tagli di lama inclinati (solo se specificato nella ComboBox della ChooseMachinig)
RestoreDef_Machinig(True)
End If
' Ricalcolo tutte le lavorazioni
Dim nWarn As Integer = 0
ResetAllMachinings(nWarn)
If nWarn = 1 Then SetWarningMessage(EgtMsg(90351)) ' Lama troppo grande per utilizzo ventosa
' Aggiorno visualizzazione
EgtDraw()
End If
' Aggiorno visualizzazione
EgtDraw()
End If
End Sub
Private Sub OnMyMouseDownScene(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles CurrentProjectScene.OnMouseDownScene
+2 -2
View File
@@ -56,10 +56,10 @@
PlacementTarget="{Binding ElementName=ResetCutBtn}">
<WrapPanel Orientation="Vertical"
Background="{DynamicResource OmagCut_Gray}">
<Button x:Name="ResetCut1Btn"
<Button x:Name="ResetCut2Btn"
Width ="78" Height="78"
Style="{DynamicResource OmagCut_YellowTextButton}"/>
<Button x:Name="ResetCut2Btn"
<Button x:Name="ResetCut1Btn"
Width ="78" Height="78"
Style="{DynamicResource OmagCut_YellowTextButton}"/>
</WrapPanel>
+165 -20
View File
@@ -2,6 +2,9 @@
Imports EgtWPFLib
Public Class ProjectMgrUC
' Creo una varibile statica per verificare di non stampare due volte lo stesso messaggio
Public Shared bFirstRun As Boolean = True
' Riferimenti a pagine (condivisi tra tutte le istanze della classe)
Private Shared m_MainWindow As MainWindow = DirectCast(Application.Current.MainWindow, MainWindow)
Private Shared m_CurrProjPage As CurrentProjectPageUC
@@ -11,6 +14,7 @@ Public Class ProjectMgrUC
' usato per scrivere i comadi di movimento test lavorazione
Friend m_CN As CN_generico
' L'inizializzazine avviene 2 volte: una per i tagli CAD ed una per le cornici
Private Sub ProjectMgrUC_Initialized(sender As Object, e As EventArgs) Handles Me.Initialized
' Imposto i messaggi letti dal file dei messaggi
NewBtn.ToolTip = EgtMsg(90303) ' Nuovo
@@ -21,9 +25,12 @@ Public Class ProjectMgrUC
VeinMatchingBtn.ToolTip = EgtMsg(90309) ' Vein Match
RegisterBtn.Content = "REG" ' Shape Registration
ResetCutBtn.Content = EgtMsg(90336) ' Reset
ResetCut2Btn.Content = EgtMsg(91024) ' Reset lavorazioni
ResetCut1Btn.Content = EgtMsg(91025) ' Aggiorna feed/speed
'ResetCutBtn.Content = EgtMsg(90336) ' Reset
'ResetCut2Btn.Content = EgtMsg(91024) ' Reset lavorazioni
'ResetCut1Btn.Content = EgtMsg(91025) ' Aggiorna feed/speed
PopulateListCmdReset()
SimulateBtn.ToolTip = EgtMsg(90301) ' Simulate - Simula
If m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.OFFICE_TYPE) Then
WorkBtn.ToolTip = EgtMsg(90310) ' Export - Esporta
@@ -255,6 +262,8 @@ Public Class ProjectMgrUC
m_MainWindow.m_PrevActivePage = MainWindow.Pages.CadCut
End Sub
#Region "RESET"
Private Sub ResetCutBtn_Click(sender As Object, e As RoutedEventArgs) Handles ResetCutBtn.Click
If (Keyboard.Modifiers And ModifierKeys.Shift) > 0 Then
If ResetCutPopUp.IsOpen Then
@@ -263,18 +272,28 @@ Public Class ProjectMgrUC
ResetCutPopUp.IsOpen = True
End If
Else
ResetCut3Btn_Click()
CallFunction(0)
End If
End Sub
' Reimposto le feed di tutte le lavorazioni
Private Sub ResetCut1Btn_Click(sender As Object, e As RoutedEventArgs) Handles ResetCut1Btn.Click
CallFunction(1)
End Sub
' Reimposto le lavorazioni di default e ripristino i parametri
Private Sub ResetCut2Btn_Click(sender As Object, e As RoutedEventArgs) Handles ResetCut2Btn.Click
CallFunction(2)
End Sub
' Reimposto le feed di tutte le lavorazioni
Private Sub FeedReset()
' eseguo il ricalcolo delle sole FEED di lavorazione
UpdateFeedAllMachining()
End Sub
' Reimposto le lavorazioni di default e ripristino i parametri
Private Sub ResetCut2Btn_Click(sender As Object, e As RoutedEventArgs) Handles ResetCut2Btn.Click
Private Sub HardReset()
EgtSetCurrentContext(m_CurrProjPage.CurrentProjectScene.GetCtx())
' Cancello eventuali messaggi
m_CurrProjPage.ClearMessage()
@@ -307,7 +326,7 @@ Public Class ProjectMgrUC
End Sub
' Resetta i valori dei parametri (ma non le lavorazioni)
Private Sub ResetCut3Btn_Click()
Private Sub StandardReset()
EgtSetCurrentContext(m_CurrProjPage.CurrentProjectScene.GetCtx())
' Cancello eventuali messaggi
m_CurrProjPage.ClearMessage()
@@ -333,6 +352,96 @@ Public Class ProjectMgrUC
EgtDraw()
End Sub
Private Const HARD_RESET As String = "HARD"
Private Const STANDARD_RESET As String = "STANDARD"
Private Const FEED_RESET As String = "FEED"
Private Enum RESET_TYPE
HARD
STANDARD
FEED
End Enum
Private m_ListCmdReset As New List(Of RESET_TYPE) From {RESET_TYPE.HARD, RESET_TYPE.STANDARD, RESET_TYPE.FEED}
Private Sub CallFunction(IndexListCmdReset As Integer)
Select Case m_ListCmdReset(IndexListCmdReset)
Case RESET_TYPE.STANDARD
EgtOutLog("STNADRD Reset")
StandardReset()
Case RESET_TYPE.HARD
EgtOutLog("HARD Reset")
HardReset()
Case RESET_TYPE.FEED
EgtOutLog("FEED Reset")
FeedReset()
End Select
End Sub
Private Sub SetBtnResetContent(IndexListCmdReset As Integer, Btn As Button)
Select Case m_ListCmdReset(IndexListCmdReset)
Case RESET_TYPE.STANDARD
Btn.Content = EgtMsg(90336) ' Reset
Case RESET_TYPE.HARD
Btn.Content = EgtMsg(91024) ' Reset lavorazioni
Case RESET_TYPE.FEED
Btn.Content = EgtMsg(91025) ' Aggiorna feed/speed
End Select
End Sub
Private Sub PopulateListCmdReset()
Dim sConfig As String = "HARD,STANDARD,FEED"
GetPrivateProfileString(S_GENERAL, "ResetCmd", sConfig, sConfig, m_MainWindow.GetIniFile())
Dim sItems As String() = sConfig.Split(",")
' VERIFICA della lettura configurazione
If sItems.Count <> 3 Then
If bFirstRun Then
EgtOutLog("WARNING configurazione: in Config.ini del programma nella sezione 'General/ResetCmd' " &
"non trovato una sequenza del tipo 'HARD,STANDARD,FEED'")
End If
Else
Dim bOk As Boolean = True
Dim sErrMsg As String = String.Empty
' popolo una lista di appoggio
Dim TempList As New List(Of RESET_TYPE) From {RESET_TYPE.STANDARD, RESET_TYPE.STANDARD, RESET_TYPE.STANDARD}
For Index As Integer = 0 To sItems.Count - 1
If sItems(Index).Trim = STANDARD_RESET Then
TempList(Index) = RESET_TYPE.STANDARD
ElseIf sItems(Index).Trim = HARD_RESET Then
TempList(Index) = RESET_TYPE.HARD
ElseIf sItems(Index).Trim = FEED_RESET Then
TempList(Index) = RESET_TYPE.FEED
Else
bOk = False
sErrMsg = sErrMsg & If(String.IsNullOrEmpty(sErrMsg), "", ",") & sItems(Index).Trim
End If
Next
' verifico che non ci siano elementi ripetuti nella lista
If Not bOk Then
If bFirstRun Then
EgtOutLog("WARNING configurazione: in Config.ini del programma nella sezione 'General/ResetCmd' " &
"non trovato una sequenza del tipo 'HARD,STANDARD,FEED' (i seguenti parametri non sono decodificati: " &
sErrMsg & " )")
End If
ElseIf TempList(0) = TempList(1) Or TempList(0) = TempList(2) Or TempList(1) = TempList(2) Then
If bFirstRun Then
EgtOutLog("WARNING configurazione: in Config.ini del programma nella sezione 'General/ResetCmd' " &
"non trovato una sequenza del tipo 'HARD,STANDARD,FEED' (due o più dati sono ripetuti)")
End If
Else
m_ListCmdReset = TempList
End If
End If
SetBtnResetContent(0, ResetCutBtn)
SetBtnResetContent(1, ResetCut1Btn)
SetBtnResetContent(2, ResetCut2Btn)
bFirstRun = False
End Sub
#End Region ' Reset
Private Sub SimulateBtn_Click(sender As Object, e As RoutedEventArgs) Handles SimulateBtn.Click
EgtSetCurrentContext(m_CurrProjPage.CurrentProjectScene.GetCtx())
m_CurrProjPage.m_SceneButtons.MeasureBtn.IsChecked = False
@@ -923,35 +1032,32 @@ Public Class ProjectMgrUC
End Sub
Public Sub UpdateFeedAllMachining()
' recupero il valore di Feed della lavorazione corrente
Dim SettedMachinig As String = String.Empty
EgtMdbGetCurrMachiningParam(MCH_MP.NAME, SettedMachinig)
' Parametri della lavorazione letta da DB
Dim sMachiningName As String = String.Empty
If Not EgtMdbGetCurrMachiningParam(MCH_MP.NAME, sMachiningName) Then
' errore: lavorazione non trovata
EgtOutLog(" - Prima di 'Reset Feed' accedere alla pagina MACCHINA!")
'm_MainWindow.m_CurrentProjectPageUC.SetErrorMessage("Salvare la lavorazione corrente")
Return
End If
Dim dFeed As Double = 0
EgtMdbGetCurrMachiningParam(MCH_MP.FEED, dFeed)
Dim dFeedStarted As Double = 0
EgtMdbGetCurrMachiningParam(MCH_MP.STARTFEED, dFeedStarted)
Dim dFeedEnded As Double = 0
EgtMdbGetCurrMachiningParam(MCH_MP.ENDFEED, dFeedEnded)
Dim dFeedTipped As Double = 0
EgtMdbGetCurrMachiningParam(MCH_MP.TIPFEED, dFeedTipped)
Dim dFeedBack As Double = 0
EgtMdbGetCurrMachiningParam(MCH_MP.BACKFEED, dFeedBack)
Dim dFeedSideAng As Double = 0
EgtMdbGetCurrMachiningParam(MCH_MP.SIDEANGFEED, dFeedSideAng)
' Elenco delle lavorazioni
Dim MachiningList As New List(Of SplitMach)
' Recupero l'indice della fase corrente
Dim nCurrPhase As Integer = 1
' recupero in numero di fasi presenti nel progetto
Dim nCountPhase As Integer = EgtGetPhaseCount()
' ciclo su tutte le fasi di lavorazione
' Numero di lavorazioni del progetto (conteggiate nel ciclo for)
Dim nMach As Integer = 0
' Numero di lavorazioni aggiornate (conteggate nel ciclo for)
Dim nMachUpdated As Integer = 0
' Elenco dei nomi lavorazioni aggiorniate
Dim UpdateMachinigNameList As New List(Of String)
' ciclo su tutte le fasi di lavorazione
For IndexPhase As Integer = 1 To nCountPhase
' imposto la fase corrente
nCurrPhase = IndexPhase
@@ -963,6 +1069,31 @@ Public Class ProjectMgrUC
Dim nOperId As Integer = MachiningList(IndexMachining).m_nId
' setto la lavorazione come corrente
If EgtSetCurrMachining(nOperId) Then
Dim sCurrMachiningName As String = String.Empty
EgtGetMachiningParam(MCH_MP.NAME, sCurrMachiningName)
' Se la lavorazione corrente da DB è diversa da quella della lavorazione allora aggiorno i dati
If sCurrMachiningName <> sMachiningName Then
sMachiningName = sCurrMachiningName
' Recupero la lavorazione dell'operazione indicata
If Not EgtMdbSetCurrMachining(sMachiningName) Then
EgtOutLog("ERRORE: Machining '" & sMachiningName & "' does not exist in DB of machining.")
sMachiningName = String.Empty
Continue For
End If
EgtMdbGetCurrMachiningParam(MCH_MP.FEED, dFeed)
EgtMdbGetCurrMachiningParam(MCH_MP.STARTFEED, dFeedStarted)
EgtMdbGetCurrMachiningParam(MCH_MP.ENDFEED, dFeedEnded)
EgtMdbGetCurrMachiningParam(MCH_MP.TIPFEED, dFeedTipped)
EgtMdbGetCurrMachiningParam(MCH_MP.BACKFEED, dFeedBack)
EgtMdbGetCurrMachiningParam(MCH_MP.SIDEANGFEED, dFeedSideAng)
Else
' verifico se è stata applicata una variazione delle Feed
If UpdateMachinigNameList.FindIndex(Function(x) x = sCurrMachiningName) = -1 Then
' La lavorazione corrente non ha nessun parametro nuovo
Continue For
End If
End If
Dim bUpdate As Boolean = False
' STANDARD
Dim dOrigFeed As Double
@@ -1021,10 +1152,24 @@ Public Class ProjectMgrUC
' conto il numero di lavorazioni aggiornate
If bUpdate Then
nMachUpdated += 1
If UpdateMachinigNameList.FindIndex(Function(x) x = sCurrMachiningName) = -1 Then
UpdateMachinigNameList.Add(sCurrMachiningName)
End If
End If
End If
Next
Next
If UpdateMachinigNameList.Count > 0 Then
Dim sMsg As String = String.Empty
For Each Item As String In UpdateMachinigNameList
sMsg = sMsg & If(String.IsNullOrEmpty(sMsg), "", ",") & Item
Next
EgtOutLog("Le lavorazioni aggiornate sono: " & sMsg)
Else
EgtOutLog("Nessuna lavorazione è stata aggiornata: Feed da DB uguali a quelle impostate nelle lavorazioni")
End If
m_MainWindow.m_CurrentProjectPageUC.SetInfoMessage(EgtMsg(91243) & nMachUpdated & "/ " & nMach) ' Lavorazione aggiornate:
End Sub
+2
View File
@@ -197,6 +197,8 @@ Public Class Camera
' OK: Avvio un processo per ogni tavola presente in macchina
Public Function CamerasHide() As Boolean
If Not m_bCameraLink Then Return False
' Lancio il programma in cieco, se già attivo lo nascondo
m_nCameraCount = GetTableCount()