diff --git a/LuaLibs/ProcessLongCut.lua b/LuaLibs/ProcessLongCut.lua index 8de28bc..4d407d0 100644 --- a/LuaLibs/ProcessLongCut.lua +++ b/LuaLibs/ProcessLongCut.lua @@ -70,6 +70,7 @@ function ProcessLongCut.GetSCC( Proc, nFacet, nCuttingStep, bAreCuttingStepsTowa local function GetToolUUID( sMachining) if EgtMdbSetCurrMachining( sMachining) then local sToolUUID = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID) + return sToolUUID end end @@ -169,9 +170,9 @@ function ProcessLongCut.GetSCC( Proc, nFacet, nCuttingStep, bAreCuttingStepsTowa else nSCC = EgtIf( ( vtAux:getY() > -GEO.EPS_SMALL), MCH_SCC.ADIR_YP, MCH_SCC.ADIR_YM) end - end - + + return nSCC end ----------------------------------------------------------------------------------------------- local function MakeSideFace( nId, nFac, nSide, sMilling, dToolDiam, bForcedLim, dDistToMachine, bUnderDir) @@ -1338,14 +1339,35 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus end -- aggiungo geometria EgtSetMachiningGeometry( {{ Proc.Id, 0}}) + + EgtMdbSetCurrMachining( sMilling) + local bIsCurrentMillCCW = EgtMdbGetCurrMachiningParam( MCH_MP.SPEED) < 0 + local bInvert = not bIsCurrentMillCCW + + -- setto workside e eventuale inversione + if bInvert then + EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT) + EgtSetMachiningParam( MCH_MP.INVERT, true) + else + EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT) + EgtSetMachiningParam( MCH_MP.INVERT, false) + end -- limito opportunamente la lavorazione local dSal = EgtIf( i == 1, -dStartDist, - dStartAccDist - ( i - 2) * dC) - EgtSetMachiningParam( MCH_MP.STARTADDLEN, dSal) local dEal = EgtIf( i == nC, -dEndDist, - dEndAccDist - ( nC - i - 1) * dC) + if bInvert then + dSal, dEal = dEal, dSal + end + EgtSetMachiningParam( MCH_MP.STARTADDLEN, dSal) EgtSetMachiningParam( MCH_MP.ENDADDLEN, dEal) -- imposto offset radiale EgtSetMachiningParam( MCH_MP.OFFSR, ( k - 1) * dStep - BD.CUT_EXTRA) -- Posizione braccio portatesta + + -- TEST -- + local bAreCuttingStepsTowardsHead = true + -- TEST -- + local nSCC = ProcessLongCut.GetSCC( Proc, 0, i, bAreCuttingStepsTowardsHead, nil, nFaceUse, sMilling, bInvert) if BD.TURN then nSCC = EgtIf( nFaceUse == MCH_MILL_FU.ORTHO_DOWN, MCH_SCC.ADIR_ZP, EgtIf( nFaceUse == MCH_MILL_FU.ORTHO_FRONT, MCH_SCC.ADIR_YP, MCH_SCC.ADIR_YM))