From 59934d0fdf5ec3a921eae84ed91a41d6e63462ce Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Thu, 12 Oct 2023 10:56:46 +0200 Subject: [PATCH] =?UTF-8?q?DataBeam=20:=20-=20in=20Process=20(lancio=20da?= =?UTF-8?q?=20EgtCAM5=20quindi=20uso=20praticamente=20solo=20interno)=20ag?= =?UTF-8?q?giunta=20possibilit=C3=A0=20di=20tenere=20ordine=20pezzi=20in?= =?UTF-8?q?=20barra=20come=20da=20selezione.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Process.lua | 42 +++++++++++++++++++++++------------------- 1 file changed, 23 insertions(+), 19 deletions(-) diff --git a/Process.lua b/Process.lua index 09d5b8f..37b89be 100644 --- a/Process.lua +++ b/Process.lua @@ -115,23 +115,6 @@ local function MyProcessInputData() end EgtDeselectAll() - -- Le ordino in senso di lunghezza crescente - table.sort( vBeam, function( B1, B2) - if abs( B1.Box:getDimX() - B2.Box:getDimX()) < 1 then - return B1.Ind < B2.Ind - else - return B1.Box:getDimX() < B2.Box:getDimX() - end - end) - do - local sOut = '' - for i = 1, #vBeam do - sOut = sOut .. vBeam[i].Name .. ', ' - end - sOut = sOut:sub( 1, -3) - EgtOutLog( 'Travi ordinate : ' .. sOut, 1) - end - return true end @@ -152,12 +135,13 @@ local function MyProcessBeams() local dAddLen = BD.OVM_HEAD + ( #vBeam - 1) * BD.OVM_MID EgtOutLog( 'Ltot : '..EgtNumToString( dTotLen, 1) .. ' Lagg : '..EgtNumToString( dAddLen, 1)..' MinUnloadRaw : '.. EgtNumToString( BD.MinRaw + BD.OVM_MID, 1), 1) - -- Richiedo lunghezza del grezzo e sovramateriale di testa + -- Richiedo lunghezza del grezzo, sovramateriale di testa, forzatura verticale e ordinamento automatico secondo la lunghezza local vsVal = EgtDialogBox( 'Lavora Travi' .. ' (Ltot='..EgtNumToString( dTotLen + dAddLen + 0.5, 0).. ', Lmax='..EgtNumToString( BD.MAX_RAW, 0)..',MinUlr='..EgtNumToString( BD.MinRaw + BD.OVM_MID, 0)..')', {'Lunghezza grezzo', EgtNumToString( BD.STD_RAW, 0)}, {'Sovramateriale di testa', EgtNumToString( BD.OVM_HEAD, 0)}, - {'Forza sezione verticale', ' CB:true,*false'}) + {'Forza sezione verticale', ' CB:true,*false'}, + {'Ordina per lunghezza', ' CB:true,*false'}) if not vsVal then EgtDraw() return @@ -221,6 +205,26 @@ local function MyProcessBeams() return false end + -- Se richiesto, ordino le travi in senso di lunghezza crescente + local bOrd = ( vsVal[4] == 'true') + if bOrd then + table.sort( vBeam, function( B1, B2) + if abs( B1.Box:getDimX() - B2.Box:getDimX()) < 1 then + return B1.Ind < B2.Ind + else + return B1.Box:getDimX() < B2.Box:getDimX() + end + end) + end + do + local sOut = '' + for i = 1, #vBeam do + sOut = sOut .. vBeam[i].Name .. ', ' + end + sOut = sOut:sub( 1, -3) + EgtOutLog( 'Travi ordinate : ' .. sOut, 1) + end + -- Sistemo le travi nel grezzo local bOk, sErr = BE.ProcessBeams( dRawW, dRawH, dRawL, dOvmHead, vBeam) if not bOk then