Nuova gestione tagli parziali Saw&Waterjet

This commit is contained in:
Nicola Pievani
2024-12-23 11:23:53 +01:00
parent 3ea8335357
commit 615d6d2652
2 changed files with 27 additions and 3 deletions
+25 -2
View File
@@ -47,6 +47,26 @@ Friend Module CamAuto
Return bOk
End Function
' versione CamAuto 2.6l1: gestione tagli con ridotto affondamento
Friend Function AddWaterJetMachining(LocaList As List(Of Integer), ByRef nWarn As Integer) As Boolean
EgtLuaCreateGlobTable("CAM")
SetLuaStandardCamParams()
For i As Integer = 0 To LocaList.Count - 1
EgtLuaSetGlobIntVar("CAM.TAB_OPERID." & (i + 1).ToString, LocaList(i))
Next
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.AddWaterJets")
EgtLuaGetGlobIntVar("CAM.ERR", nErr)
EgtLuaResetGlobVar("CAM")
If nErr <> 0 Then
bOk = False
EgtOutLog("Error in CamAuto : " & nErr.ToString())
End If
Return bOk
End Function
Friend Function EraseMachinings(nPartId As Integer) As Boolean
EgtLuaCreateGlobTable("CAM")
EgtLuaSetGlobIntVar("CAM.PARTID", nPartId)
@@ -543,6 +563,7 @@ Friend Module CamAuto
Dim dReducedDepth As Double = GetPrivateProfileDouble(S_MACH_NEST, K_MACH_REDUCEDDEPTH, 1, m_MainWindow.GetMachIniFile())
' Ciclo sulle lavorazioni
Dim nOperId As Integer = EgtGetFirstOperation()
Dim LocalListOperId As New List(Of Integer)
While nOperId <> GDB_ID.NULL
' verifico sia una lavorazione valida di taglio con lama
If IsValidMachining( nOperId) And EgtGetOperationType( nOperId) = MCH_OY.SAWING Then
@@ -557,12 +578,14 @@ Friend Module CamAuto
' se abilitato e attivo waterjet, lo aggiungo per completare il taglio
If m_MainWindow.m_CurrentMachine.WaterJettingActive Then
Dim nWarn As Integer = 0
AddWaterJetMachining(nOperId, nWarn)
LocalListOperId.Add(nOperId)
'AddWaterJetMachining(nOperId, nWarn)
End If
End If
End If
End If
nOperId = EgtGetNextOperation(nOperId)
End While
If LocalListOperId.Count > 0 Then AddWaterJetMachining(LocalListOperId, 0)
Return bModified
End Function
+2 -1
View File
@@ -395,7 +395,8 @@ Public Class Camera
Else
EgtOutLog("Variable for read status of positioning head: " & CameraStateNameVar)
End If
m_MainWindow.m_CurrentProjectPageUC.SetInfoMessage("Going home!")
' 91145=Going home
m_MainWindow.m_CurrentProjectPageUC.SetInfoMessage(EgtMsg(91145))
UpdateUI()
' Eseguo reset variabile posizione home raggiunta
m_MainWindow.m_CNCommunication.m_CN.DVariables_WriteVariables2(CameraStateNameVar, "0")