From 1ca8c76bbfcc5e9fc5e131dac80b3c3f928d9a23 Mon Sep 17 00:00:00 2001 From: Nicola Pievani Date: Mon, 23 Dec 2024 13:26:50 +0100 Subject: [PATCH] Nuova gestione taglio Saw&Waterjet --- EgtStoneLib/CamAuto.vb | 25 ++++++++++++++++++++++++- MainWindow/MainWindowM.vb | 4 ++-- My Project/AssemblyInfo.vb | 4 ++-- 3 files changed, 28 insertions(+), 5 deletions(-) diff --git a/EgtStoneLib/CamAuto.vb b/EgtStoneLib/CamAuto.vb index 4d51930..8086c3a 100644 --- a/EgtStoneLib/CamAuto.vb +++ b/EgtStoneLib/CamAuto.vb @@ -50,6 +50,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_sCamAutoDir & "\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) @@ -545,6 +565,7 @@ Friend Module CamAuto Dim dReducedDepth As Double = GetPrivateProfileDouble(S_MACH_NEST, K_MACH_REDUCEDDEPTH, 1, CurrentMachine.sMachIniFile) ' 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 @@ -559,12 +580,14 @@ Friend Module CamAuto ' se abilitato e attivo waterjet, lo aggiungo per completare il taglio If CurrentMachine.WaterJettingActive Then Dim nWarn As Integer = 0 - AddWaterJetMachining(nOperId, nWarn) + LocalListOperId.Add(nOperId) + 'AddWaterJetMachining(nOperId, nWarn) End If End If End If nOperId = EgtGetNextOperation(nOperId) End While + If LocalListOperId.Count > 0 Then AddWaterJetMachining(LocalListOperId, 0) Return bModified End Function diff --git a/MainWindow/MainWindowM.vb b/MainWindow/MainWindowM.vb index 9d6c890..2a177ad 100644 --- a/MainWindow/MainWindowM.vb +++ b/MainWindow/MainWindowM.vb @@ -228,8 +228,8 @@ Public Class MainWindowM ' Verifico abilitazione nesting automatico m_bAutoNestOption = Not String.IsNullOrWhiteSpace( sNestKey) ' Recupero livello e opzioni della chiave - Dim bKey As Boolean = EgtGetKeyLevel(9423, 2610, 1, m_nKeyLevel) And - EgtGetKeyOptions(9423, 2610, 1, m_nKeyOptions) + Dim bKey As Boolean = EgtGetKeyLevel(9423, 2612, 1, m_nKeyLevel) And + EgtGetKeyOptions(9423, 2612, 1, m_nKeyOptions) ' Verifico abilitazione prodotto Dim bProd As Boolean = GetKeyOption(KEY_OPT.OFFICE_BASE) ' Inizializzazione generale di EgtInterface diff --git a/My Project/AssemblyInfo.vb b/My Project/AssemblyInfo.vb index b0d5309..cedbf2a 100644 --- a/My Project/AssemblyInfo.vb +++ b/My Project/AssemblyInfo.vb @@ -69,6 +69,6 @@ Imports System.Windows ' by using the '*' as shown below: ' - - + +