From 902c87f17ad509894d96b79a4e9df42bfad21eb0 Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Fri, 11 Oct 2019 05:44:27 +0000 Subject: [PATCH] DataBeam : - correzioni varie. --- LuaLibs/BeamExec.lua | 16 +++++++++------- LuaLibs/ProcessLapJoint.lua | 27 +++++++++++++++++++++++---- 2 files changed, 32 insertions(+), 11 deletions(-) diff --git a/LuaLibs/BeamExec.lua b/LuaLibs/BeamExec.lua index e4b419b..afd3546 100644 --- a/LuaLibs/BeamExec.lua +++ b/LuaLibs/BeamExec.lua @@ -196,14 +196,16 @@ end ------------------------------------------------------------------------------------------------------------- function BeamExec.CalcMinUnloadableRaw( dRawW, dRawH) - - -- Determinazione minimo grezzo scaricabile - if dRawW * dRawH > 40000 then - BD.MinRaw = BD.MINRAW_L - elseif dRawW * dRawH > 14500 then - BD.MinRaw = BD.MINRAW_M - else + local H_S = 200 + local H_L = 400 + -- Determinazione minimo grezzo scaricabile + if dRawH <= H_S then BD.MinRaw = BD.MINRAW_S + elseif dRawH <= H_L then + local Coeff = ( dRawH - H_S) / ( H_L - H_S) + BD.MinRaw = ( 1 - Coeff) * BD.MINRAW_S + Coeff * BD.MINRAW_L + else + BD.MinRaw = BD.MINRAW_L end end diff --git a/LuaLibs/ProcessLapJoint.lua b/LuaLibs/ProcessLapJoint.lua index 13adade..99b1b5f 100644 --- a/LuaLibs/ProcessLapJoint.lua +++ b/LuaLibs/ProcessLapJoint.lua @@ -499,7 +499,7 @@ local function MakeByChainOrSaw( Proc, nPhase, nRawId, nPartId, nFacInd, rfFac, if not sCutting then local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' cutting not found in library' EgtOutLog( sErr) - return false, sErr + return false, sErr, 'MNF' end -- recupero i dati dell'utensile local dSawDiam = 400 @@ -542,16 +542,18 @@ local function MakeByChainOrSaw( Proc, nPhase, nRawId, nPartId, nFacInd, rfFac, if not sSawing then local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' chainsawing not found in library' EgtOutLog( sErr) - return false, sErr + return false, sErr, 'MNF' end -- Recupero i dati dell'utensile local dSawWidth = 75 local dSawThick = 8 + local dMaxDepth = 200 if EgtMdbSetCurrMachining( sSawing) then local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID) if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then dSawWidth = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dSawWidth dSawThick = EgtTdbGetCurrToolParam( MCH_TP.THICK) or dSawThick + dMaxDepth = EgtTdbGetCurrToolMaxDepth() or dMaxDepth end end -- Verifico se necessarie più passate @@ -581,6 +583,13 @@ local function MakeByChainOrSaw( Proc, nPhase, nRawId, nPartId, nFacInd, rfFac, -- imposto offset radiale local dOffs = ( i - 1) * dStep EgtSetMachiningParam( MCH_MP.OFFSR, dOffs) + -- se necessario, limito l'affondamento + if dElev > dMaxDepth + 10 * GEO.EPS_SMALL then + sWarn = 'Warning in LapJoint : elevation (' .. EgtNumToString( dElev, 1) .. ') bigger than max tool depth (' .. EgtNumToString( dMaxDepth, 1) .. ')' + dDepth = dMaxDepth - dElev + EgtOutLog( sWarn .. ' (process ' .. tostring( Proc.Id) .. ')') + EgtSetMachiningParam( MCH_MP.DEPTH_STR, 'TH '..EgtNumToString( dDepth, 1)) + end -- eseguo if not EgtApplyMachining( true, false) then local _, sErr = EgtGetLastMachMgrError() @@ -593,7 +602,7 @@ local function MakeByChainOrSaw( Proc, nPhase, nRawId, nPartId, nFacInd, rfFac, end end end - return true + return true, sWarn end --------------------------------------------------------------------- @@ -647,7 +656,17 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId) return MakeByMill( Proc, nPhase, nRawId, nPartId, nFacInd, rfFac, dH, dV, dFacElev) -- altrimenti provo con la sega a catena o lama else - return MakeByChainOrSaw( Proc, nPhase, nRawId, nPartId, nFacInd, rfFac, dH, dV, dFacElev) + local bOk, sErr, sStat = MakeByChainOrSaw( Proc, nPhase, nRawId, nPartId, nFacInd, rfFac, dH, dV, dFacElev) + if not bOk and sStat == 'MNF' then + sPocketing = ML.FindPocketing( sMchFind, dDiam) + if not sPocketing then + local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' pocketing not found in library' + EgtOutLog( sErr) + return false, sErr + end + else + return bOk, sErr + end end end -- recupero i dati dell'utensile