diff --git a/LuaLibs/ProcessLongCut.lua b/LuaLibs/ProcessLongCut.lua index 0a4df10..d1041c6 100644 --- a/LuaLibs/ProcessLongCut.lua +++ b/LuaLibs/ProcessLongCut.lua @@ -941,13 +941,53 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus -- imposto uso della faccia EgtSetMachiningParam( MCH_MP.FACEUSE, EgtIf( k == 1, nFaceUse, nFaceUse2)) else - EgtSetMachiningParam( MCH_MP.INVERT, false) - EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT) - dSal, dEal = dEal, dSal - -- imposto uso della faccia - EgtSetMachiningParam( MCH_MP.FACEUSE, EgtIf( k == 1, nFaceUse, nFaceUse2)) + if k == 1 then + bIsTopBladeCurrent = true + nFaceUseCurrent = nFaceUse + else + bIsTopBladeCurrent = true + nFaceUseCurrent = nFaceUse2 + end end + -- recupero alcune informazioni utili dalla lavorazione attuale + local bIsCurrentBladeCW + local bIsCurrentMachiningInverted + if bIsTopBladeCurrent then + EgtMdbSetCurrMachining( sCutting) + else + EgtMdbSetCurrMachining( sCuttingDn) + end + bIsCurrentBladeCW = EgtMdbGetCurrMachiningParam( MCH_MP.SPEED) < 0 + bIsCurrentMachiningInverted = EgtMdbGetCurrMachiningParam( MCH_MP.INVERT) + + -- imposto la direzione di lavoro per avere scarico del truciolo ottimale + local nWorkSide, bInvert + if not bIsTopBladeCurrent and abs( nSide) ~= 2 then + if bIsCurrentBladeCW then + nWorkSide = MCH_MILL_WS.LEFT + bInvert = true + dSal, dEal = dEal, dSal + else + nWorkSide = MCH_MILL_WS.RIGHT + bInvert = false + end + else + if bIsCurrentBladeCW then + nWorkSide = MCH_MILL_WS.LEFT + bInvert = false + else + nWorkSide = MCH_MILL_WS.RIGHT + bInvert = true + dSal, dEal = dEal, dSal + end + end + + -- setto la lavorazione con i valori calcolati + EgtSetMachiningParam( MCH_MP.INVERT, bInvert) + EgtSetMachiningParam( MCH_MP.WORKSIDE, nWorkSide) + EgtSetMachiningParam( MCH_MP.FACEUSE, nFaceUseCurrent) + EgtSetMachiningParam( MCH_MP.STARTADDLEN, dSal) EgtSetMachiningParam( MCH_MP.ENDADDLEN, dEal) -- imposto offset radiale diff --git a/LuaLibs/ProcessLongDoubleCut.lua b/LuaLibs/ProcessLongDoubleCut.lua index fddbb06..d906134 100644 --- a/LuaLibs/ProcessLongDoubleCut.lua +++ b/LuaLibs/ProcessLongDoubleCut.lua @@ -723,6 +723,44 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster EgtSetMachiningParam( MCH_MP.FACEUSE, EgtIf( k == 1, nFaceUse, nFaceUse2)) end + -- recupero alcune informazioni utili dalla lavorazione attuale + local bIsCurrentBladeCW + local bIsCurrentMachiningInverted + if bIsTopBladeCurrent then + EgtMdbSetCurrMachining( sCutting) + else + EgtMdbSetCurrMachining( sCuttingDn) + end + bIsCurrentBladeCW = EgtMdbGetCurrMachiningParam( MCH_MP.SPEED) < 0 + bIsCurrentMachiningInverted = EgtMdbGetCurrMachiningParam( MCH_MP.INVERT) + + -- imposto la direzione di lavoro per avere scarico del truciolo ottimale + local nWorkSide, bInvert + if ( not bIsTopBladeCurrent and abs( nSide) ~= 0) or ( bCanUseBlade and bCanUseUnderBlade and nSide == -1) then + if bIsCurrentBladeCW then + nWorkSide = MCH_MILL_WS.LEFT + bInvert = true + dSal, dEal = dEal, dSal + else + nWorkSide = MCH_MILL_WS.RIGHT + bInvert = false + end + else + if bIsCurrentBladeCW then + nWorkSide = MCH_MILL_WS.LEFT + bInvert = false + else + nWorkSide = MCH_MILL_WS.RIGHT + bInvert = true + dSal, dEal = dEal, dSal + end + end + + -- setto la lavorazione con i valori calcolati + EgtSetMachiningParam( MCH_MP.INVERT, bInvert) + EgtSetMachiningParam( MCH_MP.WORKSIDE, nWorkSide) + EgtSetMachiningParam( MCH_MP.FACEUSE, nFaceUseCurrent) + EgtSetMachiningParam( MCH_MP.STARTADDLEN, dSal) EgtSetMachiningParam( MCH_MP.ENDADDLEN, dEal)