From 07dad8f8c20e6439ef93cab312088b7f0bb8ca1e Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Tue, 22 Nov 2022 14:51:39 +0100 Subject: [PATCH] Improvement/DownHeadInFreeContour: - correzione fresatura per casi in cui si parte dalla testa sotto --- LuaLibs/ProcessFreeContour.lua | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/LuaLibs/ProcessFreeContour.lua b/LuaLibs/ProcessFreeContour.lua index 607fb6a..ea36115 100644 --- a/LuaLibs/ProcessFreeContour.lua +++ b/LuaLibs/ProcessFreeContour.lua @@ -381,7 +381,7 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead) EgtSetMachiningGeometry( {{ AuxId, -1}}) -- se lavorazione da sopra o da sotto if nSide == 0 then - bDoubleCham = true + bDoubleCham = false if Proc.Grp == 3 then if not bToolInv then EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT) @@ -563,18 +563,26 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead) end -- verifico se devo fare sgrossatura più finitura local dOffsetPar = EgtGetInfo( Proc.Id, Q_OVERMAT_FOR_FINISH, 'i') or 0 - local sMillingDown + local sMillingDown, sMillingUp if nDouble > 1 and bCanDouble then if nSide == 0 then if BD.DOWN_HEAD then -- recupero la lavorazione - sMillingDown = ML.FindMilling( 'Prof_H2', nil, nil, nil, nil, false, true) + sMillingDown = ML.FindMilling( 'FreeContour_H2', nil, nil, nil, nil, false, true) if not sMillingDown then sWarn = 'Warning : milling from bottom not found in library' EgtOutLog( sWarn) bCanDouble = false end end + if EgtEndsWith( sMilling, '_H2') then + sMillingUp = ML.FindMilling( 'FreeContour', nil, nil, nil, nil, true, false) + if not sMillingDown then + sWarn = 'Warning : milling not found in library' + EgtOutLog( sWarn) + bCanDouble = false + end + end end end -- eseguo @@ -601,7 +609,11 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead) else -- inserisco la lavorazione sName = 'Free_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) - nMchId = EgtAddMachining( sName, EgtIf( j == 2 and BD.DOWN_HEAD and nSide == 0, sMillingDown, sMilling)) + if EgtEndsWith( sMilling, '_H2') then + nMchId = EgtAddMachining( sName, EgtIf( j == 2 and nSide == 0, sMillingUp, sMilling)) + else + nMchId = EgtAddMachining( sName, EgtIf( j == 2 and nSide == 0, sMillingDown, sMilling)) + end if not nMchId then local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling EgtOutLog( sErr)