From 1a5fe4a06f756c3ef1a82667a155dd44e9dbd250 Mon Sep 17 00:00:00 2001 From: DarioS Date: Thu, 7 Oct 2021 12:41:15 +0200 Subject: [PATCH] DataBeam : - in FreeContour migliorata gestione SCC. --- LuaLibs/ProcessFreeContour.lua | 60 ++++++++++++++++++++++++---------- 1 file changed, 42 insertions(+), 18 deletions(-) diff --git a/LuaLibs/ProcessFreeContour.lua b/LuaLibs/ProcessFreeContour.lua index 16e5e91..84d4c94 100644 --- a/LuaLibs/ProcessFreeContour.lua +++ b/LuaLibs/ProcessFreeContour.lua @@ -383,13 +383,21 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead) EgtSetMachiningParam( MCH_MP.ENDADDLEN, dEndAddSpec + 1) end -- posizione braccio porta testa - if Proc.Head then - EgtSetMachiningParam( MCH_MP.SCC, MCH_SCC.ADIR_XP) - elseif Proc.Tail then - EgtSetMachiningParam( MCH_MP.SCC, MCH_SCC.ADIR_XM) - elseif AreSameOrOppositeVectorApprox( vtExtr, Z_AX()) then - EgtSetMachiningParam( MCH_MP.SCC, MCH_SCC.ADIR_YP) + local nSCC = MCH_SCC.NONE + if not BD.C_SIMM then + if Proc.Head then + nSCC = MCH_SCC.ADIR_XP + elseif Proc.Tail then + nSCC = MCH_SCC.ADIR_XM + elseif AreSameOrOppositeVectorApprox( vtExtr, Z_AX()) then + nSCC = MCH_SCC.ADIR_YP + elseif vtExtr:getY() > -0.01 then + nSCC = MCH_SCC.ADIR_YP + else + nSCC = MCH_SCC.ADIR_YM + end end + EgtSetMachiningParam( MCH_MP.SCC, nSCC) -- eseguo if not EgtApplyMachining( true, false) then local _, sErr = EgtGetLastMachMgrError() @@ -436,13 +444,21 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead) EgtSetMachiningParam( MCH_MP.STARTADDLEN, dStartAddSpec + 1) end -- posizione braccio porta testa - if Proc.Head then - EgtSetMachiningParam( MCH_MP.SCC, MCH_SCC.ADIR_XP) - elseif Proc.Tail then - EgtSetMachiningParam( MCH_MP.SCC, MCH_SCC.ADIR_XM) - elseif AreSameOrOppositeVectorApprox( vtExtr, Z_AX()) then - EgtSetMachiningParam( MCH_MP.SCC, MCH_SCC.ADIR_YP) + local nSCC = MCH_SCC.NONE + if not BD.C_SIMM then + if Proc.Head then + nSCC = MCH_SCC.ADIR_XP + elseif Proc.Tail then + nSCC = MCH_SCC.ADIR_XM + elseif AreSameOrOppositeVectorApprox( vtExtr, Z_AX()) then + nSCC = MCH_SCC.ADIR_YP + elseif vtExtr:getY() < 0.01 then + nSCC = MCH_SCC.ADIR_YP + else + nSCC = MCH_SCC.ADIR_YM + end end + EgtSetMachiningParam( MCH_MP.SCC, nSCC) -- eseguo if not EgtApplyMachining( true, false) then local _, sErr = EgtGetLastMachMgrError() @@ -520,13 +536,21 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead) EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT) end -- posizione braccio porta testa - if Proc.Head then - EgtSetMachiningParam( MCH_MP.SCC, MCH_SCC.ADIR_XP) - elseif Proc.Tail then - EgtSetMachiningParam( MCH_MP.SCC, MCH_SCC.ADIR_XM) - elseif AreSameOrOppositeVectorApprox( vtExtr, Z_AX()) then - EgtSetMachiningParam( MCH_MP.SCC, MCH_SCC.ADIR_YP) + local nSCC = MCH_SCC.NONE + if not BD.C_SIMM then + if Proc.Head then + nSCC = MCH_SCC.ADIR_XP + elseif Proc.Tail then + nSCC = MCH_SCC.ADIR_XM + elseif AreSameOrOppositeVectorApprox( vtExtr, Z_AX()) then + nSCC = MCH_SCC.ADIR_YP + elseif ( j == 1 and vtExtr:getY() > -0.01) or ( j == 2 and vtExtr:getY() < 0.01) then + nSCC = MCH_SCC.ADIR_YP + else + nSCC = MCH_SCC.ADIR_YM + end end + EgtSetMachiningParam( MCH_MP.SCC, nSCC) -- acquisisco parametro sovramateriale local bFinish local dOriOffset = 0