diff --git a/LuaLibs/BeamExec.lua b/LuaLibs/BeamExec.lua index 1692450..459686f 100644 --- a/LuaLibs/BeamExec.lua +++ b/LuaLibs/BeamExec.lua @@ -1,4 +1,4 @@ --- BeamExec.lua by Egaltech s.r.l. 2020/10/23 +-- BeamExec.lua by Egaltech s.r.l. 2020/11/06 -- Libreria esecuzione lavorazioni per Travi -- 2019/07/11 Aggiunta gestione stato rotazione di feature per TS3. -- 2019/09/04 Corretto controllo feature di testa e coda con sovramateriale di testa elevato. @@ -1039,7 +1039,7 @@ function BeamExec.ProcessFeatures() -- eventuale spostamento fori sui tenoni MoveDrillsOnTenon( vProc) -- se richiesto ribaltamento (oppure rotazione) - if bSomeDown or bSomeSide then + if ( bSomeDown or bSomeSide) and not BD.DOWN_HEAD then -- ribalto le travi della fase corrente local nRId = nRawId while nRId do @@ -1099,7 +1099,7 @@ function BeamExec.ProcessFeatures() EgtSetInfo( nDispId, 'ORD', nOrd) end -- se richiesta rotazione - if bSomeSide then + if bSomeSide and not BD.DOWN_HEAD then -- vettore movimento grezzi per rotazione di 90deg local dDeltaYZ = EgtGetRawPartBBox( nRawId):getDimY() - EgtGetRawPartBBox( nRawId):getDimZ() local vtMove = Vector3d( 0, dDeltaYZ / 2, dDeltaYZ / 2) @@ -1173,7 +1173,7 @@ function BeamExec.ProcessFeatures() for i = 1, #vProc do -- creo la lavorazione local Proc = vProc[i] - if Proc.Flg ~= 0 and not ( Proc.Down or Proc.Side) then + if Proc.Flg ~= 0 and ( not ( Proc.Down or Proc.Side) or BD.DOWN_HEAD) then local bOk, sMsg, bNewPhase = AddFeatureMachining( Proc, nPhase, nRawId, nPartId, dCurrOvmH, false, b3Raw) if not bOk then nTotErr = nTotErr + 1 diff --git a/LuaLibs/MachiningLib.lua b/LuaLibs/MachiningLib.lua index 1fca944..eff6de8 100644 --- a/LuaLibs/MachiningLib.lua +++ b/LuaLibs/MachiningLib.lua @@ -1,4 +1,4 @@ --- MachiningLib.lua by Egaltech s.r.l. 2020/10/27 +-- MachiningLib.lua by Egaltech s.r.l. 2020/11/06 -- Libreria ricerca lavorazioni per Travi -- Tabella per definizione modulo @@ -81,11 +81,12 @@ function MachiningLib.FindSawing( sType) end --------------------------------------------------------------------- -function MachiningLib.FindDrilling( dDiam, dDepth) +function MachiningLib.FindDrilling( dDiam, dDepth, bDown) -- ricerca sulle forature, dal diametro maggiore al minore + local sDrType = 'Drill' .. EgtIf( bDown, '_H2', '') for i = #Drillings, 1, -1 do local Drilling = Drillings[i] - if Drilling.On and Drilling.Type == 'Drill' and SetCurrMachiningAndTool( Drilling.Name) then + if Drilling.On and Drilling.Type == sDrType and SetCurrMachiningAndTool( Drilling.Name) then local dTDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) local dTMaxMat = EgtTdbGetCurrToolParam( MCH_TP.MAXMAT) local dMaxToolLength = EgtTdbGetCurrToolParam( MCH_TP.TOTLEN) @@ -102,9 +103,10 @@ function MachiningLib.FindDrilling( dDiam, dDepth) end end -- ricerca sulle svuotature, dal diametro maggiore al minore + local sPkType = 'Pocket' .. EgtIf( bDown, '_H2', '') for i = #Drillings, 1, -1 do local Drilling = Drillings[i] - if Drilling.On and Drilling.Type == 'Pocket' and SetCurrMachiningAndTool( Drilling.Name) then + if Drilling.On and Drilling.Type == sPkType and SetCurrMachiningAndTool( Drilling.Name) then local dTDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) local dTMaxDepth = EgtTdbGetCurrToolMaxDepth() local dMaxToolLength = EgtTdbGetCurrToolParam( MCH_TP.TOTLEN) diff --git a/LuaLibs/ProcessCut.lua b/LuaLibs/ProcessCut.lua index 2330bbb..560d54d 100644 --- a/LuaLibs/ProcessCut.lua +++ b/LuaLibs/ProcessCut.lua @@ -1,4 +1,4 @@ --- ProcessCut.lua by Egaltech s.r.l. 2020/10/23 +-- ProcessCut.lua by Egaltech s.r.l. 2020/11/07 -- Gestione calcolo singoli tagli di lama per Travi -- Tabella per definizione modulo @@ -376,9 +376,9 @@ function ProcessCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bFromBottom) end elseif vtN:getY() > -0.02 then if Proc.Head then - vtOrthoO = Y_AX() - else vtOrthoO = -Y_AX() + else + vtOrthoO = Y_AX() end else if Proc.Head then diff --git a/LuaLibs/ProcessDrill.lua b/LuaLibs/ProcessDrill.lua index 62cc0d4..ed3ea45 100644 --- a/LuaLibs/ProcessDrill.lua +++ b/LuaLibs/ProcessDrill.lua @@ -1,4 +1,4 @@ --- ProcessDrill.lua by Egaltech s.r.l. 2020/11/03 +-- ProcessDrill.lua by Egaltech s.r.l. 2020/11/06 -- Gestione calcolo forature per Travi -- Tabella per definizione modulo @@ -176,7 +176,7 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId) if Proc.Flg == -2 then vtExtr = - vtExtr end local bOpen = ( Proc.Fcs ~= 0 and Proc.Fce ~= 0) -- verifico che il foro non sia fattibile solo da sotto - local bToInvert = ( vtExtr:getZ() < BD.DRILL_VZ_MIN) + local bToInvert = ( vtExtr:getZ() < BD.DRILL_VZ_MIN) and not BD.DOWN_HEAD if bToInvert and ( not bOpen or Proc.Flg ~= 1) then local sErr = 'Error : drilling from bottom impossible' EgtOutLog( sErr) @@ -197,7 +197,7 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId) dCheckDepth = nil end -- recupero la lavorazione - local sDrilling, nType, dMaxDepth, dMaxToolLength, dToolDiam, dDiamTh, dToolFreeLen = ML.FindDrilling( dDiam, dCheckDepth) + local sDrilling, nType, dMaxDepth, dMaxToolLength, dToolDiam, dDiamTh, dToolFreeLen = ML.FindDrilling( dDiam, dCheckDepth, Proc.Down) if not sDrilling then -- se non ho passato altezza di taglio utensile allora non è stato trovato utensile if not dCheckDepth then @@ -207,7 +207,7 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId) -- altrimenti rifaccio la ricerca foratura senza passare altezza utensile else dCheckDepth = nil - sDrilling, nType, dMaxDepth, dMaxToolLength, dToolDiam, dDiamTh, dToolFreeLen = ML.FindDrilling( dDiam) + sDrilling, nType, dMaxDepth, dMaxToolLength, dToolDiam, dDiamTh, dToolFreeLen = ML.FindDrilling( dDiam, nil, Proc.Down) if not sDrilling then local sErr = 'Error : drilling not found in library' EgtOutLog( sErr) diff --git a/LuaLibs/ProcessDtMortise.lua b/LuaLibs/ProcessDtMortise.lua index dbdc02d..3c8e40e 100644 --- a/LuaLibs/ProcessDtMortise.lua +++ b/LuaLibs/ProcessDtMortise.lua @@ -1,4 +1,4 @@ --- ProcessDtMortise.lua by Egaltech s.r.l. 2020/10/27 +-- ProcessDtMortise.lua by Egaltech s.r.l. 2020/11/08 -- Gestione calcolo mortase a coda di rondine per Travi -- Tabella per definizione modulo @@ -112,7 +112,7 @@ function ProcessDtMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH) -- ingombro del pezzo local b3Solid = EgtGetBBoxGlob( EgtGetFirstNameInGroup( nPartId, 'Box') or GDB_ID.NULL, GDB_BB.STANDARD) if not b3Solid then - local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' part box not found' + local sErr = 'Error : part box not found' EgtOutLog( sErr) return false, sErr end @@ -127,8 +127,9 @@ function ProcessDtMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH) -- recupero i dati della curva e del top local dDepth = abs( EgtCurveThickness( AuxId)) local vtExtr = EgtCurveExtrusion( AuxId, GDB_RT.GLOB) - -- verifico che la mortasa non sia orientata verso il basso (-5 deg) - if vtExtr:getZ() < - 0.1 then + -- verifico che la mortasa non sia orientata verso il basso (-5 deg) o che ci sia una testa da sotto + local bFaceDown = ( vtExtr:getZ() < - 0.1) + if bFaceDown and not BD.DOWN_HEAD then local sErr = 'Machining from bottom impossible : Error on DtMortise ' .. tostring( Proc.Id) EgtOutLog( sErr) return false, sErr @@ -146,7 +147,7 @@ function ProcessDtMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH) -- recupero gruppo per geometria addizionale local nAddGrpId = BL.GetAddGroup( nPartId) if not nAddGrpId then - local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' missing AddGroup' + local sErr = 'Error : missing AddGroup' EgtOutLog( sErr) return false, sErr end @@ -169,14 +170,15 @@ function ProcessDtMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH) end end -- recupero la lavorazione : prima ricerca per sola tipologia - local sMilling = ML.FindMilling( 'DtMortise') + local sMchExt = EgtIf( bFaceDown or ( BD.DOWN_HEAD and vtExtr:getZ() < 0.1), '_H2', '') + local sMilling = ML.FindMilling( 'DtMortise'..sMchExt) if not sMilling then local sErr = 'Milling not found in library : Error on DtMortise ' .. tostring( Proc.Id) EgtOutLog( sErr) return false, sErr end -- recupero la lavorazione : seconda ricerca con tipologia e diametro massimo - sMilling = ML.FindMilling( 'DtMortise', nil, nil, 2 * dMinRad) + sMilling = ML.FindMilling( 'DtMortise'..sMchExt, nil, nil, 2 * dMinRad) if not sMilling then local sErr = 'Radius too small : Error on DtMortise ' .. tostring( Proc.Id) EgtOutLog( sErr) @@ -216,13 +218,13 @@ function ProcessDtMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH) -- recupero la lavorazione local sPocketing if Proc.Prc ~= 53 then - sPocketing = ML.FindPocketing( 'Mortise', dToolDiam) + sPocketing = ML.FindPocketing( 'Mortise'..sMchExt, dToolDiam) end if not sPocketing then - sPocketing = ML.FindPocketing( 'Pocket', dToolDiam) + sPocketing = ML.FindPocketing( 'Pocket'..sMchExt, dToolDiam) end if not sPocketing then - local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' pocketing not found in library' + local sErr = 'Error : Mortise or Pocket not found in library' EgtOutLog( sErr) return false, sErr end diff --git a/LuaLibs/ProcessDtTenon.lua b/LuaLibs/ProcessDtTenon.lua index ddf5ac4..47b161f 100644 --- a/LuaLibs/ProcessDtTenon.lua +++ b/LuaLibs/ProcessDtTenon.lua @@ -1,4 +1,4 @@ --- ProcessTenon.lua by Egaltech s.r.l. 2020/10/14 +-- ProcessTenon.lua by Egaltech s.r.l. 2020/11/08 -- Gestione calcolo tenone a coda di rondine per Travi -- Tabella per definizione modulo @@ -91,7 +91,10 @@ local function ApplyPocket( Proc, sPocketing, nStep, dSurfStep, nIdSurf, vtExtr) EgtSetMachiningParam( MCH_MP.USERNOTES, sNotes) end -- imposto posizione braccio porta testa - local nSCC = EgtIf( vtExtr:getX() < GEO.EPS_SMALL, MCH_SCC.ADIR_XM, MCH_SCC.ADIR_XP) + local nSCC = MCH_SCC.NONE + if not BD.C_SIMM then + nSCC = EgtIf( vtExtr:getX() < GEO.EPS_SMALL, MCH_SCC.ADIR_XM, MCH_SCC.ADIR_XP) + end EgtSetMachiningParam( MCH_MP.SCC, nSCC) -- eseguo if not EgtApplyMachining( true, false) then @@ -211,7 +214,8 @@ function ProcessDtTenon.Make( Proc, nPhase, nRawId, nPartId, dOvmHead) end end -- recupero la lavorazione - local sMilling = ML.FindMilling( 'DtTenon') + local sMchExt = EgtIf( vtExtr:getZ() < 0.51 and BD.DOWN_HEAD, '_H2', '') + local sMilling = ML.FindMilling( 'DtTenon'..sMchExt) if not sMilling then local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' milling not found in library' EgtOutLog( sErr) @@ -272,9 +276,12 @@ function ProcessDtTenon.Make( Proc, nPhase, nRawId, nPartId, dOvmHead) EgtSetMachiningParam( MCH_MP.WORKSIDE, EgtIf( bCW, MCH_MILL_WS.LEFT, MCH_MILL_WS.RIGHT)) EgtSetMachiningParam( MCH_MP.INVERT, EgtIf( bCW, true, false)) -- imposto posizione braccio porta testa - local nSCC = MCH_SCC.ADIR_YM - if abs( vtExtr:getY()) > 0.088 then - nSCC = EgtIf( vtExtr:getX() < GEO.EPS_SMALL, MCH_SCC.ADIR_XM, MCH_SCC.ADIR_XP) + local nSCC = MCH_SCC.NONE + if not BD.C_SIMM then + nSCC = MCH_SCC.ADIR_YM + if abs( vtExtr:getY()) > 0.088 then + nSCC = EgtIf( vtExtr:getX() < GEO.EPS_SMALL, MCH_SCC.ADIR_XM, MCH_SCC.ADIR_XP) + end end EgtSetMachiningParam( MCH_MP.SCC, nSCC) -- eseguo diff --git a/LuaLibs/ProcessFreeContour.lua b/LuaLibs/ProcessFreeContour.lua index cbdeabc..dc9ebbe 100644 --- a/LuaLibs/ProcessFreeContour.lua +++ b/LuaLibs/ProcessFreeContour.lua @@ -1,4 +1,4 @@ --- ProcessFreeContour.lua by Egaltech s.r.l. 2020/09/03 +-- ProcessFreeContour.lua by Egaltech s.r.l. 2020/11/07 -- Gestione calcolo profilo libero per Travi -- Tabella per definizione modulo @@ -14,6 +14,11 @@ EgtOutLog( ' ProcessFreeContour started', 1) local BD = require( 'BeamData') local ML = require( 'MachiningLib') +-- variabili assegnazione parametri Q +local sDepthChamferMill = 'Q02' -- d +local sOverMaterialForFinish = 'Q03' -- d +local sPreemptiveChamfer = 'Q00' -- i + --------------------------------------------------------------------- -- Riconoscimento della feature function ProcessFreeContour.Identify( Proc) @@ -109,6 +114,58 @@ function ProcessFreeContour.Classify( Proc, b3Raw) end end +--------------------------------------------------------------------- +local function VerifyCham( Proc, AuxId, nRawId, bMakeVertCham, sDephtCham, sOnlyCham) + local nChamfer = 0 + -- ingombro del grezzo + local b3Raw = EgtGetRawPartBBox( nRawId) + -- verifico che lo smusso sia richiesto + local dDepth = EgtGetInfo( Proc.Id, sDephtCham, 'd') or 0 + if dDepth > 0 then + nChamfer = 1 + end + -- verifico se posso fare solo lo smusso + if EgtGetInfo( Proc.Id, sOnlyCham, 'i') == 1 then + if dDepth > 0 then + nChamfer = nChamfer + 1 + -- altrimenti se non ho l'affondamento esco + else + local sErr = 'Error : no chamfer depth' + EgtOutLog( sErr) + return -1, dDepth, sErr + end + end + -- recupero i dati della curva e del profilo + local dWidth = abs( EgtCurveThickness( AuxId)) + local vtExtr = EgtCurveExtrusion( AuxId, GDB_RT.GLOB) + -- eseguo lo smusso solo se direzione orizzontale e il flag di lavorazione verticale è disabilitato + if abs( vtExtr:getZ()) > 0.1 then + if not bMakeVertCham then + if nChamfer == 2 then -- se devo fare solo smusso, genero errore + local sErr = 'Error : not horizontal chamfer' + EgtOutLog( sErr) + return -1, dDepth, sErr + else + local sWarn = 'Warning : skipped not horizontal chamfer' + EgtOutLog( sWarn) + return 0, dDepth + end + end + end + -- recupero la lavorazione + local sMilling + if nChamfer > 0 then + sMilling = ML.FindMilling( 'Mark') + if not sMilling then + local sErr = 'Error : Mark not found in library' + EgtOutLog( sErr) + return -1, 0, sErr + end + end + + return nChamfer, dDepth, sMilling +end + --------------------------------------------------------------------- local function CalcSpecialAdd( nCrv, bStartVsEnd, dToolDiam) -- recupero il dominio della curva @@ -142,7 +199,7 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead) local Ls = EgtGetFirstNameInGroup( nPartId, 'Box') local b3Solid = EgtGetBBoxGlob( Ls or GDB_ID.NULL, GDB_BB.STANDARD) if not b3Solid then - local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' part box not found' + local sErr = 'Error : part box not found' EgtOutLog( sErr) return false, sErr end @@ -150,7 +207,7 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead) local AuxId = EgtGetInfo( Proc.Id, 'AUXID', 'i') or 0 if AuxId then AuxId = AuxId + Proc.Id end if not AuxId or ( EgtGetType( AuxId) & GDB_FY.GEO_CURVE) == 0 then - local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' missing profile geometry' + local sErr = 'Error : missing profile geometry' EgtOutLog( sErr) return false, sErr end @@ -160,10 +217,15 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead) local b3Aux = EgtGetBBoxGlob( AuxId, GDB_BB.STANDARD) local bToolInv = ( vtExtr:getZ() < -0.1) local bDown = ( b3Aux:getMin():getZ() < b3Raw:getMin():getZ() + 5) + -- verifico se in testa o coda + local bHead = Proc.Head + -- verifico se sono presenti i parametri Q per la profondità smusso e + -- per eseguire in esclusiva solo lo smusso + local nChamfer, dDepthCham, sChamfer = VerifyCham( Proc, AuxId, nRawId, true, sDepthChamferMill, sPreemptiveChamfer) -- recupero la lavorazione local sMilling = ML.FindMilling( 'FreeContour') if not sMilling then - local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' milling not found in library' + local sErr = 'Error : FreeContour not found in library' EgtOutLog( sErr) return false, sErr end @@ -189,6 +251,8 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead) end -- eventuale spezzatura sul tratto più lungo se curva chiusa BL.PutStartOnLonger( AuxId) + -- verifico se profilo orientato verso l'alto (1), il basso (-1) o di fianco (0) + local nSide = 0 -- verifiche per affondamento ( possibili lavorazioni in doppio) local bCross = false if abs( vtExtr:getY()) > 0.707 then @@ -196,12 +260,18 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead) bCross = true dDepth = min( dDepth, b3Raw:getDimY()) end + if bDown then + nSide = -1 + else + nSide = 1 + end elseif abs( vtExtr:getZ()) > 0.707 then if b3Aux:getDimZ() > b3Raw:getDimZ() - 1.0 then bCross = true dDepth = min( dDepth, b3Raw:getDimZ()) end end + local dOriDepth = dDepth local nDouble = 1 local bCanDouble = abs( vtExtr:getY()) > 0.707 and bCross local bStripOnSide = false @@ -238,16 +308,174 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead) -- verifico se primo e ultimo tratti corti e con angolo local dStartAddSpec = CalcSpecialAdd( AuxId, true, dToolDiam) local dEndAddSpec = CalcSpecialAdd( AuxId, false, dToolDiam) + -- se devo inserire il chamfer + if nChamfer > 0 and Proc.Grp ~= 0 and dOriDepth > dDepthCham then + local bDoubleCham = false + local dExtra = 2 + -- eseguo + for i = 1, nStep do + -- inserisco la lavorazione + local sNameCh = 'Cham_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) + local nMchId = EgtAddMachining( sNameCh, sChamfer) + if not nMchId then + local sErr = 'Error adding machining ' .. sNameCh .. '-' .. sChamfer + EgtOutLog( sErr) + return false, sErr + end + -- aggiungo geometria + EgtSetMachiningGeometry( {{ AuxId, -1}}) + -- se lavorazione da sopra o da sotto + if nSide ~= 0 then + bDoubleCham = true + end + if Proc.Grp == 3 then + if not bToolInv then + EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT) + EgtSetMachiningParam( MCH_MP.INVERT, true) + else + if vtExtr:getZ() < 0 then + EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT) + EgtSetMachiningParam( MCH_MP.INVERT, true) + EgtSetMachiningParam( MCH_MP.TOOLINVERT, true) + else + EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT) + EgtSetMachiningParam( MCH_MP.INVERT, true) + end + end + end + if Proc.Grp == 4 then + if not bToolInv then + EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT) + EgtSetMachiningParam( MCH_MP.INVERT, true) + else + if vtExtr:getZ() < 0 then + EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT) + EgtSetMachiningParam( MCH_MP.INVERT, true) + EgtSetMachiningParam( MCH_MP.TOOLINVERT, true) + else + EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT) + end + end + end + -- assegno affondamento e offset radiale + EgtSetMachiningParam( MCH_MP.DEPTH, dDepthCham + dExtra) + EgtSetMachiningParam( MCH_MP.OFFSR, dExtra) + -- eventuale accorciamento di testa + if i > 1 then + local dStartAddLen = - ( i - 1) * dStep + EgtSetMachiningParam( MCH_MP.STARTADDLEN, dStartAddLen + 1) + else + EgtSetMachiningParam( MCH_MP.STARTADDLEN, dStartAddSpec + 1) + end + -- eventuale accorciamento di coda + if i < nStep then + local dEndAddLen = - ( nStep - i) * dStep + EgtSetMachiningParam( MCH_MP.ENDADDLEN, dEndAddLen + 1) + else + 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) + end + -- eseguo + if not EgtApplyMachining( true, false) then + local _, sErr = EgtGetLastMachMgrError() + EgtSetOperationMode( nMchId, false) + return false, sErr + end + + -- se lavorazione da due parti, aggiungo la seconda + if bDoubleCham then + -- inserisco la lavorazione + local sName = 'ChamB_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) + local nMchId = EgtAddMachining( sName, sChamfer) + if not nMchId then + local sErr = 'Error adding machining ' .. sName .. '-' .. sChamfer + EgtOutLog( sErr) + return false, sErr + end + -- aggiungo geometria + EgtSetMachiningGeometry( {{ AuxId, -1}}) + if Proc.Grp == 3 then + EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT) + EgtSetMachiningParam( MCH_MP.TOOLINVERT, true) + EgtSetMachiningParam( MCH_MP.INVERT, true) + elseif Proc.Grp == 4 then + EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT) + EgtSetMachiningParam( MCH_MP.TOOLINVERT, true) + EgtSetMachiningParam( MCH_MP.INVERT, true) + end + -- assegno affondamento e offset radiale + EgtSetMachiningParam( MCH_MP.DEPTH, dDepthCham + dExtra) + EgtSetMachiningParam( MCH_MP.OFFSR, dExtra) + -- eventuale accorciamento di testa + if i < nStep then + local dEndAddLen = - ( nStep - i) * dStep + EgtSetMachiningParam( MCH_MP.ENDADDLEN, dEndAddLen + 1) + else + EgtSetMachiningParam( MCH_MP.ENDADDLEN, dEndAddSpec + 1) + end + -- eventuale accorciamento di coda + if i > 1 then + local dStartAddLen = - ( i - 1) * dStep + EgtSetMachiningParam( MCH_MP.STARTADDLEN, dStartAddLen + 1) + else + 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) + end + -- eseguo + if not EgtApplyMachining( true, false) then + local _, sErr = EgtGetLastMachMgrError() + EgtSetOperationMode( nMchId, false) + return false, sErr + end + end + end + end + -- verifico se devo fare sgrossatura più finitura + local dOffsetPar = EgtGetInfo( Proc.Id, sOverMaterialForFinish, 'i') or 0 -- eseguo for i = 1, nStep do for j = 1, nDouble do - -- inserisco la lavorazione - local sName = 'Free_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) - local nMchId = EgtAddMachining( sName, sMilling) - if not nMchId then - local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling - EgtOutLog( sErr) - return false, sErr + local sName + local nMchId + -- se ho smusso abilitato e gruppo 0 e profondità geometria minore della profondità smusso, + -- applico lavorazione smusso + if nChamfer > 0 and Proc.Grp == 0 and dOriDepth <= dDepthCham then + -- inserisco la lavorazione + sName = 'FreeCham_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) + nMchId = EgtAddMachining( sName, sChamfer) + if not nMchId then + local sErr = 'Error adding machining ' .. sName .. '-' .. sChamfer + EgtOutLog( sErr) + return false, sErr + end + dOffsetPar = 0 + -- assegno affondamento + EgtSetMachiningParam( MCH_MP.DEPTH, dDepthCham) + else + -- inserisco la lavorazione + sName = 'Free_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) + nMchId = EgtAddMachining( sName, sMilling) + if not nMchId then + local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling + EgtOutLog( sErr) + return false, sErr + end + -- assegno affondamento + EgtSetMachiningParam( MCH_MP.DEPTH, dDepth) end -- aggiungo geometria EgtSetMachiningGeometry( {{ AuxId, -1}}) @@ -273,8 +501,6 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead) if j == 2 then EgtSetMachiningParam( MCH_MP.INVERT, true) end - -- assegno affondamento - EgtSetMachiningParam( MCH_MP.DEPTH, dDepth) -- assegno lato di lavoro if Proc.Grp == 0 then EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.CENTER) @@ -291,12 +517,41 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead) elseif AreSameOrOppositeVectorApprox( vtExtr, Z_AX()) then EgtSetMachiningParam( MCH_MP.SCC, MCH_SCC.ADIR_YP) end + -- acquisisco parametro sovramateriale + local bFinish + local dOriOffset = 0 + -- se parametro sovramateriale è maggiore di 0 abilito la finitura extra + if dOffsetPar > 0 then + EgtSetMachiningParam( MCH_MP.OFFSR, ( dOriOffset + dOffsetPar)) + bFinish = true + end -- eseguo if not EgtApplyMachining( true, false) then local _, sErr = EgtGetLastMachMgrError() EgtSetOperationMode( nMchId, false) return false, sErr end + -- se abilitata, aggiungo lavorazione di finitura + if bFinish then + -- inserisco la lavorazione + local sNewName = 'Prof_Fin_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) + local nMch2Id = EgtCopyMachining( sNewName, EgtGetName( nMchId)) + if not nMch2Id then + local sErr = 'Error adding machining ' .. sNewName .. '-' .. sMilling + EgtOutLog( sErr) + return false, sErr + else + -- riporto il sovramateriale originale e tolgo i passi + EgtSetMachiningParam( MCH_MP.OFFSR, dOriOffset) + EgtSetMachiningParam( MCH_MP.STEP, 0) + -- eseguo + if not EgtApplyMachining( true, false) then + local _, sErr = EgtGetLastMachMgrError() + EgtSetOperationMode( nMch2Id, false) + return false, sErr + end + end + end end end -- eventuale segnalazione ingombro di testa o coda diff --git a/LuaLibs/ProcessLapJoint.lua b/LuaLibs/ProcessLapJoint.lua index de50195..511b6c2 100644 --- a/LuaLibs/ProcessLapJoint.lua +++ b/LuaLibs/ProcessLapJoint.lua @@ -1,4 +1,4 @@ --- ProcessLapJoint.lua by Egaltech s.r.l. 2020/11/03 +-- ProcessLapJoint.lua by Egaltech s.r.l. 2020/11/08 -- Gestione calcolo mezzo-legno per Travi -- 2019/10/08 Agg. gestione OpenPocket. @@ -3242,9 +3242,9 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa dFacElev, dFacElev2 = dFacElev2, dFacElev bUseOtherFace = true end - -- verifico non sia orientata verso il basso - local bFaceOk = ( vtN:getZ() >= BD.NZ_MINA) - if not bFaceOk then + -- verifico non sia orientata verso il basso o ci sia una testa dal basso + local bFaceDown = ( vtN:getZ() < BD.NZ_MINA) + if bFaceDown and not BD.DOWN_HEAD then local sErr = 'Error : LapJoint from bottom impossible' EgtOutLog( sErr) return false, sErr @@ -3341,6 +3341,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa end --EgtOutLog( 'Mortise Find Diam =' .. EgtNumToString( dDiam)) local sPocketing + if BD.DOWN_HEAD and vtN:getZ() < -BD.NZ_MINA then sMchFind = sMchFind .. '_H2' end if nUseRoughTool == 1 then sMyPocketing, dMyTDiam, dMyTMaxDepth = ML.FindPocketing( sMchFind, dDiam) if sMyPocketing and dMyTMaxDepth > 0.8 * dFacElev + dCollSic then diff --git a/LuaLibs/ProcessLongDoubleCut.lua b/LuaLibs/ProcessLongDoubleCut.lua index e90c1cc..35698f2 100644 --- a/LuaLibs/ProcessLongDoubleCut.lua +++ b/LuaLibs/ProcessLongDoubleCut.lua @@ -1,4 +1,4 @@ --- ProcessLongDoubleCut.lua by Egaltech s.r.l. 2020/10/27 +-- ProcessLongDoubleCut.lua by Egaltech s.r.l. 2020/11/08 -- Gestione calcolo doppio taglio longitudinale per Travi -- Tabella per definizione modulo @@ -108,7 +108,7 @@ function ProcessLong2Cut.GetLongFacesCount( Proc) end --------------------------------------------------------------------- -local function MakeSideFace( nId, nFac, nSide, sMilling, dToolDiam) +local function MakeSideFace( nId, nFac, nSide, sMilling, dToolDiam, nL2CSide) -- inserisco la lavorazione local sNameF = 'L2C_' .. ( EgtGetName( nId) or tostring( nId)) .. '_' .. tostring( nFac) local nMchFId = EgtAddMachining( sNameF, sMilling) @@ -132,6 +132,10 @@ local function MakeSideFace( nId, nFac, nSide, sMilling, dToolDiam) EgtSetMachiningParam( MCH_MP.LITANG, dToolDiam / 2 + 30) EgtSetMachiningParam( MCH_MP.LOPERP, 0) EgtSetMachiningParam( MCH_MP.LOTANG, dToolDiam / 2 + 30) + -- se faccia di fianco e testa da sotto, aumento la sicurezza + if nL2CSide == 0 and BD.DOWN_HEAD then + EgtSetMachiningParam( MCH_MP.STARTPOS, 80) + end -- eseguo if not EgtApplyMachining( true, false) then local _, sErr = EgtGetLastMachMgrError() @@ -146,7 +150,7 @@ local function MakeByPocketing( Proc, nPhase, nRawId, nPartId, nFacInd, dFacElev -- cerco la svuotatura opportuna local sPocketing = ML.FindPocketing( 'OpenPocket', Proc.Box:getDimX()) if not sPocketing then - local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' pocketing not found in library' + local sErr = 'Error : OpenPocket not found in library' EgtOutLog( sErr) return false, sErr end @@ -177,7 +181,7 @@ local function MakeByPocketing( Proc, nPhase, nRawId, nPartId, nFacInd, dFacElev if dFacElev > dMaxDepth + 10 * GEO.EPS_SMALL then EgtSetMachiningParam( MCH_MP.DEPTH, dMaxDepth - dFacElev) dFacElev = dMaxDepth - sWarn = 'Warning in process ' .. tostring( Proc.Id) .. ' : elevation bigger than max tool depth' + sWarn = 'Warning : elevation bigger than max tool depth' EgtOutLog( sWarn) end -- imposto elevazione e dichiaro non si generano sfridi per VMill @@ -232,7 +236,7 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId) -- analisi del taglio local vOrd = {} local vFaceUse = {} - if nSide == 1 then + if nSide == 1 or ( nSide == -1 and BD.DOWN_HEAD) then vOrd = EgtIf( ptC[1]:getY() < ptRef:getY(), { 1, 2}, { 2, 1}) vFaceUse = { BL.GetNearestOrthoOpposite( ptC[1] - ptM), BL.GetNearestOrthoOpposite( ptC[2] - ptM)} elseif nSide == -1 then @@ -261,7 +265,7 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId) -- allora vince il Q3, cioè si utilizza la fresa di fianco ( per i tagli da sopra) -- 2020/09/17 Fabio Squaratti: se lavorazione con fresa di fianco e se ci sono delle facce laterali, l'utensile deve arrivare - -- fino al punto più vicino della faccia laterale (prima l'arretramento era sempre del rggio utensile). + -- fino al punto più vicino della faccia laterale (prima l'arretramento era sempre del raggio utensile). -- Questo viene fatto se Q03=1 o fresa da sotto ---------------------------------------------------------------------------------------------------------------------------------------- local bUseBlade = EgtGetInfo( Proc.Id, 'Q01', 'i') == 1 @@ -274,7 +278,7 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId) -- recupero la lavorazione local sCutting = ML.FindCutting( 'HeadSide') if not sCutting then - local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' sawing not found in library' + local sErr = 'Error : HeadSide not found in library' EgtOutLog( sErr) return false, sErr end @@ -292,8 +296,8 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId) end -- se la distanza dal pezzo successivo è inferiore della metà lama, do un warning if dDistToNextPiece < dToolDiam/2 then - sWarn = 'Warning on saw cut : Cut machining can damage next piece' - EgtOutLog( sWarn .. ' (process ' .. tostring( Proc.Id) .. ')') + sWarn = 'Warning : Cut machining can damage next piece' + EgtOutLog( sWarn) end -- determino numero di parti local dStartAccDist = BD.LONGCUT_ENDLEN @@ -326,7 +330,10 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId) -- si percorrono i lati alto e basso della faccia for i = 1, nC do -- Posizione braccio portatesta - local nSCC = EgtIf( ( BD.C_SIMM or i == 1 or i == nC - 1), MCH_SCC.ADIR_XP, MCH_SCC.ADIR_XM) + local nSCC = MCH_SCC.NONE + if not BD.C_SIMM then + nSCC = EgtIf( ( i == 1 or i == nC - 1), MCH_SCC.ADIR_XP, MCH_SCC.ADIR_XM) + end -- ciclo sulle due facce for j = 1, #vOrd do -- determino se lavorazione da davanti o da dietro @@ -383,7 +390,10 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId) -- si percorrono i lati alto e basso della faccia for i = 1, nC do -- Posizione braccio portatesta - local nSCC = EgtIf( ( BD.C_SIMM or i == 1 or i == nC - 1), MCH_SCC.ADIR_XP, MCH_SCC.ADIR_XM) + local nSCC = MCH_SCC.NONE + if not BD.C_SIMM then + nSCC = EgtIf( ( i == 1 or i == nC - 1), MCH_SCC.ADIR_XP, MCH_SCC.ADIR_XM) + end -- ciclo sulle due facce for j = 1, #vOrd do -- determino se lavorazione da davanti o da dietro @@ -441,7 +451,7 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId) end end -- se non è sotto e non uso fresa di fianco: lavorazione Long2Cut - elseif nSide ~= - 1 and nUseMillOnSide == 0 then + elseif ( nSide ~= - 1 or BD.DOWN_HEAD) and nUseMillOnSide == 0 then -- determino la massima elevazione local dElev = 0 local dFacElev1 = BL.GetFaceElevation( Proc.Id, tFaceLong[1], nPartId) @@ -450,7 +460,7 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId) -- recupero la lavorazione local sMilling = ML.FindMilling( 'Long2Cut', dElev) if not sMilling then - local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' milling not found in library' + local sErr = 'Error : Long2Cut not found in library' EgtOutLog( sErr) return false, sErr end @@ -575,9 +585,12 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId) local dSal = EgtIf( nPos == 1, - EgtIf( i == nIni, dStartDist, dEndDist), - EgtIf( i == nIni, dStartAccDist, dEndAccDist) - ( nPos - 2) * dC) local dEal = EgtIf( nPos == nC, - EgtIf( i == nIni, dEndDist, dStartDist), - EgtIf( i == nIni, dEndAccDist, dStartAccDist) - ( nC - nPos - 1) * dC) -- Posizione braccio portatesta - local nSCC = EgtIf( ( BD.C_SIMM or j == 1 or j == nC - 1), MCH_SCC.ADIR_XP, MCH_SCC.ADIR_XM) + local nSCC = MCH_SCC.NONE + if not BD.C_SIMM then + nSCC = EgtIf( ( j == 1 or j == nC - 1), MCH_SCC.ADIR_XP, MCH_SCC.ADIR_XM) + end -- Verifico se da fare di fianco perchè normale troppo verso il basso (minore di -30deg) - local bSide = ( vtN[vOrd[i]]:getZ() < -0.5) + local bSide = ( vtN[vOrd[i]]:getZ() < -0.5 and not BD.DOWN_HEAD) -- ciclo sulle passate local nO = 1 local dStep = 0 @@ -623,6 +636,10 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId) local dLioPerp = EgtIf( bSide, dToolDiam, dLargh - dOffsR + BD.CUT_SIC) EgtSetMachiningParam( MCH_MP.LIPERP, dLioPerp) EgtSetMachiningParam( MCH_MP.LOPERP, dLioPerp) + -- se faccia di fianco e testa da sotto, aumento la sicurezza + if nSide == 0 and BD.DOWN_HEAD then + EgtSetMachiningParam( MCH_MP.STARTPOS, 80) + end -- eseguo if not EgtApplyMachining( true, false) then local _, sErr = EgtGetLastMachMgrError() @@ -632,11 +649,11 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId) end -- se facce principali convesse, eventuale lavorazione della faccia limitante l'inizio (a destra) if bConvex and j == 1 and not bStartFixed then - MakeSideFace( Proc.Id, tFaceLong[vOrd[i]], 1, sMilling, dToolDiam) + MakeSideFace( Proc.Id, tFaceLong[vOrd[i]], 1, sMilling, dToolDiam, nSide) end -- se facce principali convesse, eventuale lavorazione della faccia limitante la fine (a sinistra) if bConvex and j == nC and not bEndFixed then - MakeSideFace( Proc.Id, tFaceLong[vOrd[i]], -1, sMilling, dToolDiam) + MakeSideFace( Proc.Id, tFaceLong[vOrd[i]], -1, sMilling, dToolDiam, nSide) end end end @@ -670,7 +687,7 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId) end end if not sMilling then - local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' milling not found in library' + local sErr = 'Error : Long2CutSide or Long2CutDown not found in library' EgtOutLog( sErr) return false, sErr end @@ -772,7 +789,7 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId) local dSal = EgtIf( nPos == 1, - EgtIf( i == 1, dStartDist, dEndDist), - EgtIf( i == 1, dStartAccDist, dEndAccDist) - ( nPos - 2) * dC) local dEal = EgtIf( nPos == nC, - EgtIf( i == 1, dEndDist, dStartDist), - EgtIf( i == 1, dEndAccDist, dStartAccDist) - ( nC - nPos - 1) * dC) -- Posizione braccio portatesta - local nSCC = MCH_SCC.ADIR_XP + local nSCC = EgtIf( BD.C_SIMM, MCH_SCC.NONE, MCH_SCC.ADIR_XP) -- inserisco le parti di lavorazione nM = nM + 1 local sNameF = 'L2C_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) .. '_' .. tostring( nM) diff --git a/LuaLibs/ProcessMortise.lua b/LuaLibs/ProcessMortise.lua index a9d7265..8ca553b 100644 --- a/LuaLibs/ProcessMortise.lua +++ b/LuaLibs/ProcessMortise.lua @@ -1,4 +1,4 @@ --- ProcessMortise.lua by Egaltech s.r.l. 2020/10/09 +-- ProcessMortise.lua by Egaltech s.r.l. 2020/11/08 -- Gestione calcolo mortase per Travi -- Tabella per definizione modulo @@ -76,7 +76,7 @@ function ProcessMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH) -- ingombro del pezzo local b3Solid = EgtGetBBoxGlob( EgtGetFirstNameInGroup( nPartId, 'Box') or GDB_ID.NULL, GDB_BB.STANDARD) if not b3Solid then - local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' part box not found' + local sErr = 'Error : part box not found' EgtOutLog( sErr) return false, sErr end @@ -88,7 +88,7 @@ function ProcessMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH) AuxId = AuxId + Proc.Id end if not AuxId or ( EgtGetType( AuxId) & GDB_FY.GEO_CURVE) == 0 then - local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' missing profile geometry' + local sErr = 'Error : missing profile geometry' EgtOutLog( sErr) return false, sErr end @@ -165,15 +165,15 @@ function ProcessMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH) -- Se mortasa chiusa if not bOpenBtm then -- verifico che la mortasa non sia orientata verso il basso (limite -5 deg) - if vtN:getZ() < - 0.1 then - local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' Mortise from bottom impossible' + if vtN:getZ() < -0.1 and not BD.DOWN_HEAD then + local sErr = 'Error : Mortise from bottom impossible' EgtOutLog( sErr) return false, sErr end -- altrimenti passante else -- determino se la mortasa da lavorare sul lato opposto sia di angolo inferiore a quello consentito - if abs(vtN:getZ()) > 0.1 then + if abs( vtN:getZ()) > 0.1 then bForceOneSide = true end -- determino se è meglio lavorare la mortasa nel lato opposto @@ -215,15 +215,16 @@ function ProcessMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH) -- determino larghezza della mortasa if dL < dW then dL, dW = dW, dL end -- recupero la lavorazione + local sMchExt = EgtIf( BD.DOWN_HEAD and vtN:getZ() < 0.1, '_H2', '') local sPocketing if Proc.Prc ~= 53 then - sPocketing = ML.FindPocketing( 'Mortise', dW) + sPocketing = ML.FindPocketing( 'Mortise'..sMchExt, dW) end if not sPocketing then - sPocketing = ML.FindPocketing( 'Pocket', dW) + sPocketing = ML.FindPocketing( 'Pocket'..sMchExt, dW) end if not sPocketing then - local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' pocketing not found in library' + local sErr = 'Error : Mortise or Pocket not found in library' EgtOutLog( sErr) return false, sErr end diff --git a/LuaLibs/ProcessProfCamb.lua b/LuaLibs/ProcessProfCamb.lua index ec1bdcd..8192437 100644 --- a/LuaLibs/ProcessProfCamb.lua +++ b/LuaLibs/ProcessProfCamb.lua @@ -1,4 +1,4 @@ --- ProcessProfCamb.lua by Egaltech s.r.l. 2020/10/14 +-- ProcessProfCamb.lua by Egaltech s.r.l. 2020/10/30 -- Gestione calcolo profilo caudato per Travi -- Tabella per definizione modulo @@ -454,7 +454,7 @@ function ProcessProfCamb.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH) local sNewName = 'Prof_Fin_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) local nMch2Id = EgtCopyMachining( sNewName, EgtGetName( nMchId)) if not nMch2Id then - local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling + local sErr = 'Error adding machining ' .. sNewName .. '-' .. sMilling EgtOutLog( sErr) return false, sErr else diff --git a/LuaLibs/ProcessTenon.lua b/LuaLibs/ProcessTenon.lua index e7e1b1d..0cb5a4b 100644 --- a/LuaLibs/ProcessTenon.lua +++ b/LuaLibs/ProcessTenon.lua @@ -1,4 +1,4 @@ --- ProcessTenon.lua by Egaltech s.r.l. 2020/10/14 +-- ProcessTenon.lua by Egaltech s.r.l. 2020/11/06 -- Gestione calcolo tenone per Travi -- Tabella per definizione modulo @@ -92,7 +92,10 @@ local function ApplyPocket( Proc, sPocketing, nStep, dSurfStep, nIdSurf, vtExtr) EgtSetMachiningParam( MCH_MP.USERNOTES, sNotes) end -- imposto posizione braccio porta testa - local nSCC = EgtIf( vtExtr:getX() < GEO.EPS_SMALL, MCH_SCC.ADIR_XM, MCH_SCC.ADIR_XP) + local nSCC = MCH_SCC.NONE + if not BD.C_SIMM then + nSCC = EgtIf( vtExtr:getX() < GEO.EPS_SMALL, MCH_SCC.ADIR_XM, MCH_SCC.ADIR_XP) + end EgtSetMachiningParam( MCH_MP.SCC, nSCC) -- eseguo if not EgtApplyMachining( true, false) then @@ -278,9 +281,12 @@ function ProcessTenon.Make( Proc, nPhase, nRawId, nPartId, dOvmHead) EgtSetMachiningParam( MCH_MP.LOPERP, 0) end -- imposto posizione braccio porta testa - local nSCC = MCH_SCC.ADIR_YM - if abs( vtExtr:getY()) > 0.088 then - nSCC = EgtIf( vtExtr:getX() < GEO.EPS_SMALL, MCH_SCC.ADIR_XM, MCH_SCC.ADIR_XP) + local nSCC = MCH_SCC.NONE + if not BD.C_SIMM then + nSCC = MCH_SCC.ADIR_YM + if abs( vtExtr:getY()) > 0.088 then + nSCC = EgtIf( vtExtr:getX() < GEO.EPS_SMALL, MCH_SCC.ADIR_XM, MCH_SCC.ADIR_XP) + end end EgtSetMachiningParam( MCH_MP.SCC, nSCC) -- eseguo diff --git a/Process.lua b/Process.lua index 46b1c56..e99c63f 100644 --- a/Process.lua +++ b/Process.lua @@ -208,7 +208,6 @@ local function MyProcessBeams() if not bOk then EgtOutLog( sErr) EgtOutBox( sErr, 'Lavora Travi', 'ERROR') - EgtDraw() return false end @@ -236,11 +235,9 @@ local function MyProcessFeatures() if #sOutput > 0 then EgtOutLog( sOutput) end if nErrCnt > 0 then EgtOutBox( sOutput, 'Lavora Travi', 'ERRORS') - EgtDraw() return false elseif nWarnCnt > 0 then EgtOutBox( sOutput, 'Lavora Travi', 'WARNINGS') - EgtDraw() return true end