From d51f2bc7d5a625b8c412ae014a5b3f9bb2a5732d Mon Sep 17 00:00:00 2001 From: "andrea.villa" Date: Thu, 10 Jul 2025 12:53:34 +0200 Subject: [PATCH] In Process e BatchProcess forzato flag bCalcBestPieceUnloadPosition a true per calcolo prerotazioni in attesa della gestione completa da parte di Aedifica --- BatchProcessNew.lua | 13 ++++++++----- LuaLibs/BeamExec.lua | 2 +- Process.lua | 9 ++++++--- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/BatchProcessNew.lua b/BatchProcessNew.lua index 54ed77d..4f57018 100644 --- a/BatchProcessNew.lua +++ b/BatchProcessNew.lua @@ -201,13 +201,16 @@ elseif BEAM.FLAG == 8 then elseif BEAM.FLAG == 9 then sFlag = 'GET_TOPOLOGY' elseif BEAM.FLAG == 10 then - sFlag = 'QUICK_VERIFY' + sFlag = 'FLIP_ROT' else sFlag = 'FLAG='..tostring( BEAM.FLAG) end local sLog = 'BatchProcess : ' .. BEAM.FILE .. ', ' .. BEAM.MACHINE .. ', ' .. sFlag EgtOutLog( sLog) +-- TODO forzatura calcolo con prerotazioni. Cancellare dopo che è stata aggiunta la gestione corretta +local bCalcBestPieceUnloadPosition = true or BEAM.FLAG == 10 + -- Dati dei file -- TODO spostare a quando flag ~= 6 e 9 local sDir, sTitle = EgtSplitPath( BEAM.FILE) @@ -502,7 +505,7 @@ if bToProcess then end -- Sistemo le travi nel grezzo - local bPbOk, sPbErr = BeamExec.ProcessBeams( dRawW, dRawH, dRawL, dOvmHead, nil, PARTS, BEAM.FLAG ~= 6, BEAM.FLAG == 10) + local bPbOk, sPbErr = BeamExec.ProcessBeams( dRawW, dRawH, dRawL, dOvmHead, nil, PARTS, BEAM.FLAG ~= 6, bCalcBestPieceUnloadPosition) if not bPbOk then BEAM.ERR = 18 BEAM.MSG = sPbErr @@ -573,7 +576,7 @@ if bToProcess then PARTS[i].dHeight = PARTS[i].b3Part:getDimZ() PARTS[i].bSquareSection = abs( PARTS[i].dWidth - PARTS[i].dHeight) < 100 * GEO.EPS_SMALL PARTS[i].nIndexInParts = i - PARTS[i].CombinationList = BeamExec.GetAvailableCombinations( PARTS[i], BEAM.FLAG == 10) + PARTS[i].CombinationList = BeamExec.GetAvailableCombinations( PARTS[i], bCalcBestPieceUnloadPosition) PARTS[i].SplittingPoints = BeamLib.GetPartSplittingPoints( PARTS[i]) PARTS[i].NotClampableLength = { STD = { dHead = 0, dTail = 0}, SIDE = { dHead = 0, dTail = 0}, DOWN = { dHead = 0, dTail = 0}} @@ -621,8 +624,8 @@ if bToProcess then -- Lavoro le features if not GetDataConfig() then return end - BeamExec.GetProcessings( PARTS, BEAM.FLAG == 10) - BeamExec.GetCombinationMatrix( PARTS, BEAM.FLAG == 10) + BeamExec.GetProcessings( PARTS, bCalcBestPieceUnloadPosition) + BeamExec.GetCombinationMatrix( PARTS, bCalcBestPieceUnloadPosition) BeamExec.ProcessMachinings( PARTS) local sOutput = '' diff --git a/LuaLibs/BeamExec.lua b/LuaLibs/BeamExec.lua index 0bb0364..d821cf2 100644 --- a/LuaLibs/BeamExec.lua +++ b/LuaLibs/BeamExec.lua @@ -252,7 +252,7 @@ local function IsCombinationAvailable( sCombination, nUnloadPos, bSquareSection, end -- TODO capire come passare info che il pezzo non ha bisogno di rotazioni per velocizzare il caclolo. Magari non serve neanche entrare in questa funzione -- NO ROTATION : solo posizione di partenza - elseif BEAM.Rotation.bNoRotation then + elseif BEAM.Rotation and BEAM.Rotation.bNoRotation then if sCombination == '1000' and nUnloadPos == 1 then return true else diff --git a/Process.lua b/Process.lua index 0c97450..79fad63 100644 --- a/Process.lua +++ b/Process.lua @@ -15,6 +15,9 @@ EgtAddToPackagePath( BEAM.BASEDIR .. '\\LuaLibs\\?.lua') EgtAddToPackagePath( BEAM.BASEDIR .. '\\Strategies\\Standard\\?.lua') EgtAddToPackagePath( BEAM.BASEDIR .. '\\StrategyLibs\\?.lua') +-- TODO forzatura calcolo con prerotazioni. Cancellare dopo che è stata aggiunta la gestione corretta +local bCalcBestPieceUnloadPosition = true + -- Verifico che la macchina corrente sia abilitata per la lavorazione delle Travi local sMachDir = EgtGetCurrMachineDir() if not sMachDir then @@ -287,7 +290,7 @@ local function MyProcessBeams() end -- Sistemo le travi nel grezzo - local bOk, sErr = BeamExec.ProcessBeams( dRawW, dRawH, dRawL, dOvmHead, dOvmMid, PARTS, nil, false) + local bOk, sErr = BeamExec.ProcessBeams( dRawW, dRawH, dRawL, dOvmHead, dOvmMid, PARTS, nil, bCalcBestPieceUnloadPosition) if not bOk then EgtOutLog( sErr) EgtOutBox( sErr, 'Lavora Travi', 'ERROR') @@ -301,8 +304,8 @@ end -- *** Inserimento delle lavorazioni nelle travi *** ------------------------------------------------------------------------------------------------------------- local function MyProcessFeatures() - BeamExec.GetProcessings( PARTS, false) - BeamExec.GetCombinationMatrix( PARTS, false) + BeamExec.GetProcessings( PARTS, bCalcBestPieceUnloadPosition) + BeamExec.GetCombinationMatrix( PARTS, bCalcBestPieceUnloadPosition) BeamExec.ProcessMachinings( PARTS) local nErrCnt = 0 local nWarnCnt = 0