From 7a27212cb84f9760aaa781540edbc8840ab85e0d Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Thu, 22 May 2025 10:48:48 +0200 Subject: [PATCH 1/3] =?UTF-8?q?-=20in=20BeamExec.CollectFeatures=20si=20sa?= =?UTF-8?q?lva=20la=20rotazione=20in=20cui=20=C3=A8=20stata=20costruita=20?= =?UTF-8?q?la=20Proc=20-=20in=20BasicCustomerStrategies=20correzione=20in?= =?UTF-8?q?=20lettura=20Q=20-=20in=20STR0002=20in=20caso=20di=202=20facce?= =?UTF-8?q?=20>=2090=C2=B0=20si=20lavorano=20sempre=20entrambe?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LuaLibs/BasicCustomerStrategies.lua | 3 ++- LuaLibs/BeamExec.lua | 5 +++-- Strategies/Standard/STR0002/STR0002.lua | 6 ++++-- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/LuaLibs/BasicCustomerStrategies.lua b/LuaLibs/BasicCustomerStrategies.lua index 28329f3..1e2715f 100644 --- a/LuaLibs/BasicCustomerStrategies.lua +++ b/LuaLibs/BasicCustomerStrategies.lua @@ -698,7 +698,8 @@ local function GetParameters_Essetre( Proc, sStrategyIdToGet) local dDepthChamfer = 0 -- eventuali informazioni da recuperare sulla feature sostituita if Proc.SlaveProcIndexes then - dDepthChamfer = EgtGetInfo( Proc.SlaveProcIndexes or GDB_ID.NULL, 'Q06', 'd') or 0 + local idSlaveProc = PROCESSINGS[Proc.idPart].Rotation[Proc.nCurrentRotation][Proc.SlaveProcIndexes[1]].id + dDepthChamfer = EgtGetInfo( idSlaveProc or GDB_ID.NULL, 'Q06', 'd') or 0 end Parameters = { { sName = 'dDepthChamfer', sValue = dDepthChamfer, sType = 'd'}} end diff --git a/LuaLibs/BeamExec.lua b/LuaLibs/BeamExec.lua index c97ad29..e5505bd 100644 --- a/LuaLibs/BeamExec.lua +++ b/LuaLibs/BeamExec.lua @@ -599,7 +599,7 @@ local function GetFeatureForcedStrategy( Proc) end ------------------------------------------------------------------------------------------------------------- -local function CollectFeatures( Part) +local function CollectFeatures( Part, dRotIndex) -- recupero le feature local nProcCount = 0 local vProc = {} @@ -620,6 +620,7 @@ local function CollectFeatures( Part) Proc.idPart = Part.id Proc.idRaw = Part.idRaw Proc.nIndexPartInParts = Part.nIndexInParts + Proc.nCurrentRotation = dRotIndex Proc.id = ProcId -- id della feature btl ( se non presente info, si prende id dell'entità geometrica) Proc.idFeature = EgtGetInfo( Proc.id, 'PRID', 's') or Proc.id @@ -1198,7 +1199,7 @@ function BeamExec.GetProcessings( PARTS) -- si calcolano le feature solo se la rotazione può essere presa in considerazione if PARTS[nPart].CombinationList.Rotations[dRotIndex] == 1 then -- recupero le feature di lavorazione della trave - table.insert( vProcRot, CollectFeatures( PARTS[nPart])) + table.insert( vProcRot, CollectFeatures( PARTS[nPart], dRotIndex)) -- recupero informazioni ausiliarie feature e dipendenze tra feature stesse -- TODO le dipendenze cambiano in base alla rotazione del pezzo? probabilmente no diff --git a/Strategies/Standard/STR0002/STR0002.lua b/Strategies/Standard/STR0002/STR0002.lua index ddbbbe4..6f8bd24 100644 --- a/Strategies/Standard/STR0002/STR0002.lua +++ b/Strategies/Standard/STR0002/STR0002.lua @@ -281,8 +281,10 @@ local function GetBestPocketingStrategy( Proc) Machining[1].ToolInfo.dResidualDepth = 0 Machining[3].bIsApplicable = false Machining[4].bIsApplicable = false - -- caso speciale 'DoubleBevel-2-Through' che deve lavorare due facce - if Proc.Topology.sName == 'DoubleBevel-2-Through' and Machining[2].bIsApplicable and Machining[2].ToolInfo.dResidualDepth < 10 * GEO.EPS_SMALL then + -- caso speciale in cui si devono lavorare due facce + if ( Proc.nFct == 2 and Proc.AdjacencyMatrix[1][2] >= -89.9) + and Machining[2].bIsApplicable and Machining[2].ToolInfo.dResidualDepth < 10 * GEO.EPS_SMALL then + Machining.sTypeMachining = 'Bottom2' Strategy.Result.sStatus = 'Completed' Strategy.Result.nCompletionIndex = FeatureLib.GetFeatureCompletionIndex( 100) From 564a17fb356417d89c3743ded30e166e11cfbd45 Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Thu, 22 May 2025 15:40:02 +0200 Subject: [PATCH 2/3] - in BatchProcessNew gestito flag 8 CHECK_NOSIM per check senza simulazione; GET_TOPOLOGY diventa 9 --- BatchProcessNew.lua | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/BatchProcessNew.lua b/BatchProcessNew.lua index 7595fdb..880a0f0 100644 --- a/BatchProcessNew.lua +++ b/BatchProcessNew.lua @@ -196,7 +196,9 @@ elseif BEAM.FLAG == 4 then sFlag = 'CHECK+GENERATE' elseif BEAM.FLAG == 6 then sFlag = 'CREATE_BAR' -elseif BEAM.FLAG == 7 then +elseif BEAM.FLAG == 8 then + sFlag = 'CHECK_NOSIM' +elseif BEAM.FLAG == 9 then sFlag = 'GET_TOPOLOGY' else sFlag = 'FLAG='..tostring( BEAM.FLAG) @@ -205,7 +207,7 @@ local sLog = 'BatchProcess : ' .. BEAM.FILE .. ', ' .. BEAM.MACHINE .. ', ' .. s EgtOutLog( sLog) -- Dati dei file --- TODO spostare a quando flag ~= 6 e 7 +-- TODO spostare a quando flag ~= 6 e 9 local sDir, sTitle = EgtSplitPath( BEAM.FILE) local sOriFile = sDir..sTitle..'.ori.bwe' local sNgeFile = sDir..sTitle..'.bwe' @@ -226,8 +228,7 @@ if BEAM.FLAG == 0 then end -- restituisce all'interfaccia il nome della topologia della feature di id passato -- TODO valutare se fare script separato --- TODO gestire grezzo altrimenti la topologia potrebbe essere errata!! -elseif BEAM.FLAG == 7 then +elseif BEAM.FLAG == 9 then if type( BEAM.FEATUREID) == 'number' then local Part = {} Part.id = EgtGetParent( EgtGetParent( BEAM.FEATUREID)) @@ -705,7 +706,7 @@ else -- Passo in modalità lavora EgtSetCurrMachGroup( EgtGetLastMachGroup()) -- Se necessario eseguo aggiornamento con setup corrente e ricalcolo delle lavorazioni - if bToRecalc or BEAM.FLAG == 3 or BEAM.FLAG == 4 then + if bToRecalc or BEAM.FLAG == 3 or BEAM.FLAG == 4 or BEAM.FLAG == 8 then EgtOutLog( ' +++ Recalculating all dispositions and machinings >>>') EgtImportSetup() EgtApplyAllMachinings() From 85f14504aa20abe8488fde2be89c7100359ce398 Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Thu, 22 May 2025 17:30:07 +0200 Subject: [PATCH 3/3] - modificato gitignore e aggiunto compile --- .gitignore | 2 ++ Compile.bat | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 Compile.bat diff --git a/.gitignore b/.gitignore index c6f9a44..5920736 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ .vscode/settings.json +Compile.bat.old +/bin diff --git a/Compile.bat b/Compile.bat new file mode 100644 index 0000000..843d443 --- /dev/null +++ b/Compile.bat @@ -0,0 +1,49 @@ +@echo off +setlocal enabledelayedexpansion + +set LUAC=C:\EgtProg\Dll32\luac54.exe +set ROOT=%cd%\ +set OUTBASE=bin + +if not exist %OUTBASE% mkdir %OUTBASE% + +REM Compile all .lua files excluding bin\ and any dot folders/files +for /f "delims=" %%F in ('dir /b /s /a-d *.lua ^| findstr /v /i /c:"\%OUTBASE%\"') do ( + set FULL=%%F + set REL=!FULL:%ROOT%=! + + REM Skip if REL starts with '.' or contains '\.' + echo !REL! | findstr /r /c:"^\." /c:"\\\." >nul + if errorlevel 1 ( + set OUT=%OUTBASE%\!REL! + + for %%D in ("!OUT!") do mkdir "%%~dpD" 2>nul + + echo Compiling: !REL! + %LUAC% -o "!OUT!" -s "!FULL!" + ) else ( + echo Skipping hidden/dot path: !REL! + ) +) + +REM Copy all .json files excluding bin\ and any dot folders/files +for /f "delims=" %%F in ('dir /b /s /a-d *.json ^| findstr /v /i /c:"\%OUTBASE%\"') do ( + set FULL=%%F + set REL=!FULL:%ROOT%=! + + REM Skip if REL starts with '.' or contains '\.' + echo !REL! | findstr /r /c:"^\." /c:"\\\." >nul + if errorlevel 1 ( + set OUT=%OUTBASE%\!REL! + + for %%D in ("!OUT!") do mkdir "%%~dpD" 2>nul + + echo Copying: !REL! + copy /Y "!FULL!" "!OUT!" >nul + ) else ( + echo Skipping hidden/dot path: !REL! + ) +) + +echo Done. +pause