OmagCUT :

- aggiunta possibilità di invertire lavorazione waterjet inclinata
- in elenco lavorazioni aggiunto angolo di fianco anche per waterjet
- migliorie nella visualizzazione versi durante inversione.
This commit is contained in:
Dario Sassi
2025-11-19 08:47:51 +01:00
parent ae2e64bcb0
commit 79eddf4628
5 changed files with 93 additions and 49 deletions
+18
View File
@@ -149,6 +149,24 @@ Friend Module CamAuto
Return bOk
End Function
Friend Function InvertWaterjet(nOperId As Integer) As Boolean
EgtLuaCreateGlobTable("CAM")
EgtLuaSetGlobIntVar("CAM.OPERID", nOperId)
Dim nErr As Integer = 999
Dim bOk As Boolean = EgtLuaExecFile(m_MainWindow.GetCamAutoDir() & "\CamAuto.lua")
bOk = bOk AndAlso EgtLuaGetGlobIntVar("CAM.ERR", nErr) AndAlso nErr = 0
bOk = bOk AndAlso EgtLuaCallFunction("CAM.InvertWaterjet")
EgtLuaGetGlobIntVar("CAM.ERR", nErr)
EgtLuaResetGlobVar("CAM")
If nErr > 0 Then
bOk = False
EgtOutLog("Error in CamAuto : " & nErr.ToString())
ElseIf nErr < 0 Then
EgtOutLog("Warning in CamAuto : " & nErr.ToString())
End If
Return bOk
End Function
Friend Function ResetAllMachinings() As Boolean
Dim nWarn As Integer = 0
Return ResetAllMachinings(nWarn)
+2 -2
View File
@@ -149,13 +149,13 @@ Public Class CSVPage
Dim sRefGroup As String = String.Empty
EgtGetInfo(m_nIdToSel, INFO_REFGROUP, sRefGroup)
' deseleziono il pezzo corrente
m_MainWindow.m_CadCutPageUC.m_NestPage.DeselectPartInFaimily(sRefGroup)
m_MainWindow.m_CadCutPageUC.m_NestPage.DeselectPartInFamily(sRefGroup)
Select Case SelectWD.NumberOfSelection
Case 0 ' Annulla
' continuo senza eseguire niente
Case Else
' seleziono il numero di pezzi indicati
m_MainWindow.m_CadCutPageUC.m_NestPage.SelectPartInFaimily(sRefGroup, SelectWD.NumberOfSelection)
m_MainWindow.m_CadCutPageUC.m_NestPage.SelectPartInFamily(sRefGroup, SelectWD.NumberOfSelection)
End Select
m_bIsCounterLy = False
' disassegno il riferimento all'oggetto appena creato
+21 -11
View File
@@ -1498,7 +1498,7 @@ Public Class NestPageUC
' Se movimento con sola verifica finale ----- TRASLAZIONE
If Not m_bStartRot And m_bStartMove Then
VerifyMove()
' Se movimento con sola verifica finale ----- TRASLAZIONE + ROTAZIONE
' Se movimento con sola verifica finale ----- TRASLAZIONE + ROTAZIONE
ElseIf m_bStartRot And m_bStartMove Then
If Not m_bFromParking Then
VerifyRot()
@@ -1509,7 +1509,7 @@ Public Class NestPageUC
m_bStartRot = False
End If
VerifyMove()
' verifico se la posizione finale della rotazione è corretta ----- ROTAZIONE
' verifico se la posizione finale della rotazione è corretta ----- ROTAZIONE
ElseIf m_bStartRot And Not m_bStartMove Then
If m_bFromParking Then
VerifyMove()
@@ -1520,12 +1520,12 @@ Public Class NestPageUC
Else
VerifyRot()
End If
' altrimenti caso con verifica durante il movimento
' altrimenti caso con verifica durante il movimento
Else
' Basta reset alla fine
End If
' se è stato selezionato il layer del contatore mostro la finsetra
' se è stato selezionato il layer del contatore mostro la finsetra
ElseIf m_bIsCounterLy Then
'---------------------- COUNTER PART ----------------------
' apro una finestra di dialogo per chiedere se inserire tutti i pezzi della famiglia
@@ -1533,13 +1533,23 @@ Public Class NestPageUC
Dim sRefGroup As String = String.Empty
EgtGetInfo(m_nIdToSel, INFO_REFGROUP, sRefGroup)
' deseleziono il pezzo corrente
DeselectPartInFaimily(sRefGroup)
DeselectPartInFamily(sRefGroup)
Select Case SelectWD.NumberOfSelection
Case 0 ' Annulla
' continuo senza eseguire niente
Case 0
' aggiorno posizione pezzi selezionati
If m_nPartPos = PART_POS.OUT_TABLE Then
If EgtGetSelectedObjCount() = 0 Then m_nPartPos = PART_POS.NONE_TABLE
End If
Case Else
' se ci sono pezzi già selezionati nella posizione opposta, li deseleziono
If m_nPartPos = PART_POS.IN_TABLE Then
EgtDeselectAll()
' Aggiornamento eventuale VeinMatching
VeinMatching.OnDeselectAll()
End If
' seleziono il numero di pezzi indicati
SelectPartInFaimily(sRefGroup, SelectWD.NumberOfSelection)
SelectPartInFamily(sRefGroup, SelectWD.NumberOfSelection)
m_nPartPos = PART_POS.OUT_TABLE
End Select
m_bIsCounterLy = False
' disassegno il riferimento all'oggetto appena creato
@@ -1547,7 +1557,7 @@ Public Class NestPageUC
'---------------------- COUNTER PART ----------------------
' Se selezione da eseguire
' Se selezione da eseguire
ElseIf m_nIdToSel <> GDB_ID.NULL Then
' Determino se pezzo in tavola o in parcheggio
Dim bPartInTable As Boolean = (EgtGetParent(m_nIdToSel) = m_nRawId)
@@ -2655,7 +2665,7 @@ Public Class NestPageUC
End While
End Sub
Public Sub SelectPartInFaimily(sRefGuid As String, nNbrOfSelection As Integer)
Public Sub SelectPartInFamily(sRefGuid As String, nNbrOfSelection As Integer)
' aggiorno il contatore dei pezzi del gruppo
Dim nIdInPark As Integer = EgtGetFirstPart()
Dim nCounter As Integer = 0
@@ -2670,7 +2680,7 @@ Public Class NestPageUC
End While
End Sub
Public Sub DeselectPartInFaimily(sRefGuid As String)
Public Sub DeselectPartInFamily(sRefGuid As String)
' aggiorno il contatore dei pezzi del gruppo
Dim nIdInPark As Integer = EgtGetFirstPart()
While nIdInPark <> GDB_ID.NULL
+2 -2
View File
@@ -173,7 +173,7 @@ Public Module SplitAuto
Mach.m_bStartAll = False
Mach.m_bEndAll = False
End If
' Waterjet
' Waterjet
ElseIf Mach.m_nType = MCH_OY.WATERJETTING Then
Mach.m_nInterf = FMI_TYPE.NONE
' recupero l'angolo di fianco
@@ -182,7 +182,7 @@ Public Module SplitAuto
Mach.m_bCanEndAll = False
Mach.m_bStartAll = False
Mach.m_bEndAll = False
' Forature e fresature
' Forature e fresature
Else
Mach.m_nInterf = FMI_TYPE.NONE
Mach.m_dSideAng = 0
+50 -34
View File
@@ -211,23 +211,20 @@ Public Class SplitPageUC
ElseIf Mach.m_nType = MCH_OY.DRILLING Then ' Foratura
Dim sText As String = EgtMsg(90792) & " " & i.ToString()
If Mach.m_bPause Then AddPauseText(sText)
'm_ItemList.Add(New NameIdLsBxItem(sText, i - 1, Mach.m_bEnabled, MCH_OY.DRILLING))
AddItemToList(i, Mach, sText, MCH_OY.DRILLING)
ElseIf Mach.m_nType = MCH_OY.MILLING Then ' Fresatura
Dim sText As String = EgtMsg(90793) & " " & i.ToString()
If Mach.m_sLay = NAME_ONPATH Then AddTopText(sText)
If Mach.m_bPause Then AddPauseText(sText)
'm_ItemList.Add(New NameIdLsBxItem(sText, i - 1, Mach.m_bEnabled, MCH_OY.MILLING))
AddItemToList(i, Mach, sText, MCH_OY.MILLING)
ElseIf Mach.m_nType = MCH_OY.POCKETING Then ' Svuotatura
Dim sText As String = EgtMsg(90796) & " " & i.ToString()
If Mach.m_bPause Then AddPauseText(sText)
'm_ItemList.Add(New NameIdLsBxItem(sText, i - 1, Mach.m_bEnabled, MCH_OY.POCKETING))
AddItemToList(i, Mach, sText, MCH_OY.POCKETING)
ElseIf Mach.m_nType = MCH_OY.WATERJETTING Then ' Waterjet
Dim sText As String = EgtMsg(90797) & " " & i.ToString()
If Math.Abs(Mach.m_dSideAng) > EPS_ANG_SMALL Then sText &= " " & DoubleToString(Mach.m_dSideAng, 2) & "°"
If Mach.m_bPause Then AddPauseText(sText)
'm_ItemList.Add(New NameIdLsBxItem(sText, i - 1, Mach.m_bEnabled, MCH_OY.WATERJETTING))
AddItemToList(i, Mach, sText, MCH_OY.WATERJETTING)
End If
Next
@@ -2295,44 +2292,63 @@ Public Class SplitPageUC
Continue For
End If
Dim nI As Integer = m_ItemList(Index).Ind
' Si possono invertire solo i tagli di lama
If m_MachiningList(nI).m_nType <> MCH_OY.SAWING And m_MachiningList(nI).m_nType <> MCH_OY.WATERJETTING Then Continue For
' Non si possono invertire i tagli di lama inclinati
If Math.Abs(m_MachiningList(nI).m_dSideAng) > 0.1 Then Continue For
' Se abilitata inversione automatica e quindi non invertito
If m_MachiningList(nI).m_bEnableInvert Then
' Inverto e disabilito inversione automatica
If CamAuto.InvertVerticalCut(m_MachiningList(nI).m_nId) Then
m_MachiningList(nI).m_bInvert = True
m_MachiningList(nI).m_vtDir = -m_MachiningList(nI).m_vtDir
m_MachiningList(nI).m_bEnableInvert = False
SwapStartEndData(nI)
ResetEnableInvert(m_MachiningList(nI).m_nEntId)
EgtErase(m_MachiningList(nI).m_nArrId)
NumberDirectionMachining(nI, False)
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
EgtDraw()
End If
' Se taglio di lama verticale
If m_MachiningList(nI).m_nType = MCH_OY.SAWING And Math.Abs(m_MachiningList(nI).m_dSideAng) < 0.1 Then
' Se abilitata inversione automatica e quindi non invertito
If m_MachiningList(nI).m_bEnableInvert Then
' Inverto e disabilito inversione automatica
If CamAuto.InvertVerticalCut(m_MachiningList(nI).m_nId) Then
m_MachiningList(nI).m_bInvert = True
m_MachiningList(nI).m_vtDir = -m_MachiningList(nI).m_vtDir
m_MachiningList(nI).m_bEnableInvert = False
SwapStartEndData(nI)
ResetEnableInvert(m_MachiningList(nI).m_nEntId)
EgtErase(m_MachiningList(nI).m_nArrId)
NumberDirectionMachining(nI, False)
EgtSetStatus(m_MachiningList(nI).m_nArrId, GDB_ST.ON_)
EgtSetMark(m_MachiningList(nI).m_nArrId)
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
EgtDraw()
End If
' se altrimenti disabilitata inversione automatica e invertito
ElseIf m_MachiningList(nI).m_bInvert Then
' Tolgo inversione e lascio disabilitazione inv. autom.
If CamAuto.InvertVerticalCut(m_MachiningList(nI).m_nId) Then
m_MachiningList(nI).m_bInvert = False
ElseIf m_MachiningList(nI).m_bInvert Then
' Tolgo inversione e lascio disabilitazione inv. autom.
If CamAuto.InvertVerticalCut(m_MachiningList(nI).m_nId) Then
m_MachiningList(nI).m_bInvert = False
m_MachiningList(nI).m_vtDir = -m_MachiningList(nI).m_vtDir
SwapStartEndData(nI)
EgtErase(m_MachiningList(nI).m_nArrId)
NumberDirectionMachining(nI, False)
EgtSetStatus(m_MachiningList(nI).m_nArrId, GDB_ST.ON_)
EgtSetMark(m_MachiningList(nI).m_nArrId)
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
EgtDraw()
End If
' altrimenti disabilitata inversione automatica e non invertito
Else
' Abilito inversione automatica e lascio non invertito
m_MachiningList(nI).m_bEnableInvert = True
SetEnableInvert(m_MachiningList(nI).m_nEntId)
EgtErase(m_MachiningList(nI).m_nArrId)
NumberDirectionMachining(nI, False)
EgtSetStatus(m_MachiningList(nI).m_nArrId, GDB_ST.ON_)
EgtSetMark(m_MachiningList(nI).m_nArrId)
EgtDraw()
End If
' se taglio waterjet
ElseIf m_MachiningList(nI).m_nType = MCH_OY.WATERJETTING Then
' Inverto sempre (non va gestita abilitazione inversione)
If CamAuto.InvertWaterjet(m_MachiningList(nI).m_nId) Then
m_MachiningList(nI).m_bInvert = Not m_MachiningList(nI).m_bInvert
m_MachiningList(nI).m_vtDir = -m_MachiningList(nI).m_vtDir
SwapStartEndData(nI)
EgtErase(m_MachiningList(nI).m_nArrId)
NumberDirectionMachining(nI, False)
EgtSetStatus(m_MachiningList(nI).m_nArrId, GDB_ST.ON_)
EgtSetMark(m_MachiningList(nI).m_nArrId)
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
EgtDraw()
End If
' altrimenti disabilitata inversione automatica e non invertito
Else
' Abilito inversione automatica e lascio non invertito
m_MachiningList(nI).m_bEnableInvert = True
SetEnableInvert(m_MachiningList(nI).m_nEntId)
EgtErase(m_MachiningList(nI).m_nArrId)
NumberDirectionMachining(nI, False)
EgtDraw()
End If
Next
End Sub