diff --git a/LuaLibs/BeamExec.lua b/LuaLibs/BeamExec.lua index 04d3bbd..4ccf722 100644 --- a/LuaLibs/BeamExec.lua +++ b/LuaLibs/BeamExec.lua @@ -1,4 +1,4 @@ --- BeamExec.lua by Egaltech s.r.l. 2020/06/02 +-- BeamExec.lua by Egaltech s.r.l. 2020/06/04 -- 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. @@ -699,6 +699,7 @@ local function AddFeatureMachining( Proc, nPhase, nRawId, nPartId, dCurrOvmH, bN local sErr = '' local bNewPhase = false -- se intestatura ( 1-340-X ) + EgtOutLog( ' * Process ' .. tostring( Proc.Id) .. ' *') if Hcut.Identify( Proc) then -- esecuzione taglio di testa bOk, sErr = Hcut.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH, bNeedHCut) @@ -932,7 +933,7 @@ function BeamExec.ProcessFeatures() local nDispId = EgtGetPhaseDisposition( nPhase) EgtSetInfo( nDispId, 'TYPE', EgtIf( nPartId, 'START', 'REST')) EgtSetInfo( nDispId, 'ORD', nOrd) - EgtOutLog( 'Phase=' .. tostring( nPhase) .. ' Raw=' .. tostring( nRawId) .. ' Part=' .. tostring( nPartId), 1) + EgtOutLog( ' *** Phase=' .. tostring( nPhase) .. ' Raw=' .. tostring( nRawId) .. ' Part=' .. tostring( nPartId), 1 .. ' ***') -- ingombro del grezzo e sovramateriale di testa local b3Raw = EgtGetRawPartBBox( nRawId) local dCurrOvmH = EgtGetInfo( nRawId, 'HOVM', 'd') or 0 diff --git a/LuaLibs/ProcessScarfJoint.lua b/LuaLibs/ProcessScarfJoint.lua index e4504b1..1f2f769 100644 --- a/LuaLibs/ProcessScarfJoint.lua +++ b/LuaLibs/ProcessScarfJoint.lua @@ -1,4 +1,4 @@ --- ProcessScarfJoint.lua by Egaltech s.r.l. 2020/01/24 +-- ProcessScarfJoint.lua by Egaltech s.r.l. 2020/06/04 -- Gestione calcolo giunto Gerber per Travi -- Tabella per definizione modulo @@ -35,6 +35,92 @@ function ProcessScarfJoint.Classify( Proc) return true, false end +--------------------------------------------------------------------- +-- lavorazione smussi +local function MakeChamfer( Proc, nPhase, nRawId, nPartId, dOvmHead) + -- verifico che lo smusso sia richiesto + local dDepth = EgtGetInfo( Proc.Id, 'Q02', 'd') or 0 + if dDepth < 0.1 then return true end + -- ingombro del grezzo + local b3Raw = EgtGetRawPartBBox( nRawId) + -- recupero e verifico l'entità curva associata + 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 : missing profile geometry' + EgtOutLog( sErr) + return false, sErr + 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 + if abs( vtExtr:getZ()) > 0.1 then + local sWarn = 'Warning : skipped not horizontal chamfer' + EgtOutLog( sWarn) + return true, sWarn + end + -- eseguo lo smusso solo se feature larga come la trave + if dWidth < b3Raw:getDimY() - 1 then + local sWarn = 'Warning : skipped chamfer (feature smaller than beam)' + EgtOutLog( sWarn) + return true, sWarn + end + local dExtra = 2 + -- recupero la lavorazione + local sMilling = ML.FindMilling( 'Mark') + if not sMilling then + local sErr = 'Error : milling not found in library' + EgtOutLog( sErr) + return false, sErr + end + -- Inserisco la lavorazione del lato standard + local sName1 = 'SJN_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) + local nMch1Id = EgtAddMachining( sName1, sMilling) + if not nMch1Id then + local sErr = 'Error adding machining ' .. sName1 .. '-' .. sMilling + EgtOutLog( sErr) + return false, sErr + end + -- aggiungo geometria + EgtSetMachiningGeometry( {{ AuxId, -1}}) + -- assegno affondamento e offset radiale + EgtSetMachiningParam( MCH_MP.DEPTH, dDepth + dExtra) + EgtSetMachiningParam( MCH_MP.OFFSR, dExtra) + -- assegno lato di lavoro + EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT) + -- eseguo + if not EgtApplyMachining( true, false) then + local _, sErr = EgtGetLastMachMgrError() + EgtSetOperationMode( nMchId, false) + return false, sErr + end + -- Inserisco la lavorazione del lato opposto + local sName2 = 'SJN_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) + local nMch2Id = EgtAddMachining( sName2, sMilling) + if not nMch2Id then + local sErr = 'Error adding machining ' .. sName2 .. '-' .. sMilling + EgtOutLog( sErr) + return false, sErr + end + -- aggiungo geometria + EgtSetMachiningGeometry( {{ AuxId, -1}}) + -- inverto direzione utensile + EgtSetMachiningParam( MCH_MP.TOOLINVERT, true) + -- assegno affondamento e offset radiale + EgtSetMachiningParam( MCH_MP.DEPTH, dDepth + dExtra) + EgtSetMachiningParam( MCH_MP.OFFSR, dExtra) + -- assegno lato di lavoro + EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT) + -- eseguo + if not EgtApplyMachining( true, false) then + local _, sErr = EgtGetLastMachMgrError() + EgtSetOperationMode( nMchId, false) + return false, sErr + end + return true +end + --------------------------------------------------------------------- -- Applicazione della lavorazione function ProcessScarfJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead) @@ -44,7 +130,7 @@ function ProcessScarfJoint.Make( 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 @@ -52,7 +138,7 @@ function ProcessScarfJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead) -- verifico che ci siano almeno quattro facce (altrimenti non è da lavorare) local nFacetCnt = EgtSurfTmFacetCount( Proc.Id) if nFacetCnt < 3 then - local sErr = 'Not executed ' .. tostring( Proc.Id) .. ', number of faces not enough' + local sErr = 'Error : number of faces not enough' EgtOutLog( sErr) return false, sErr end @@ -74,7 +160,7 @@ function ProcessScarfJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead) local vFaceOrd = { 0, 0, 0, 0, 0} if nFacetCnt == 5 then -- se ho 5 facce controllo il parallelismo della faccia 2 e 4 if not AreSameVectorApprox( vtN[2], vtN[4]) then - local sErr = 'Error on process ' .. tostring( Proc.Id) .. ', main faces are not parallel(fail btl import)' + local sErr = 'Error : main faces are not parallel (btl import problems)' EgtOutLog( sErr) return false, sErr end @@ -94,7 +180,7 @@ function ProcessScarfJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead) vFaceOrd[i] = i end else -- altrimenti ho una condizione di facce non previsto e do errore - local sErr = 'Error on process ' .. tostring( Proc.Id) .. ', crazy faces(4)' + local sErr = 'Error : crazy faces(4)' EgtOutLog( sErr) return false, sErr end @@ -122,10 +208,14 @@ function ProcessScarfJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead) -- normalizzo vettore di riferimento per le facce ortogonali all'asse trave vtRef:normalize() + -- inserimento smussi + local bOkc, sErrC = MakeChamfer( Proc, nPhase, nRawId, nPartId, dOvmHead) + if not bOkc then return bOkc, sErrC end + -- recupero la lavorazione local sCutting = ML.FindCutting( 'HeadSide') if not sCutting then - local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' cutting not found in library' + local sErr = 'Error : cutting not found in library' EgtOutLog( sErr) return false, sErr end @@ -141,7 +231,7 @@ function ProcessScarfJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead) -- 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 @@ -163,7 +253,7 @@ function ProcessScarfJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead) bOk = bOk and EgtCutSurfTmPlane( nFace4, ptC[vFaceOrd[1]], -vtN[vFaceOrd[1]], false, GDB_ID.ROOT) if not bOk then - local sErr = 'Error on cut surfaces of ' .. tostring( Proc.Id) .. ' cut not good' + local sErr = 'Error : wrong cut surfaces' EgtOutLog( sErr) return false, sErr end @@ -376,7 +466,8 @@ function ProcessScarfJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead) end BL.UpdateTCING( nRawId, dTCI) end - return true + + return true, sErrC end --------------------------------------------------------------------- diff --git a/LuaLibs/ProcessSimpleScarf.lua b/LuaLibs/ProcessSimpleScarf.lua index 7f794a9..d6605ec 100644 --- a/LuaLibs/ProcessSimpleScarf.lua +++ b/LuaLibs/ProcessSimpleScarf.lua @@ -1,4 +1,4 @@ --- ProcessSimpleScarf.lua by Egaltech s.r.l. 2019/10/02 +-- ProcessSimpleScarf.lua by Egaltech s.r.l. 2020/06/04 -- Gestione calcolo giunto Gerber per Travi -- Tabella per definizione modulo @@ -47,7 +47,7 @@ local function MakeChamfer( 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 @@ -56,21 +56,21 @@ local function MakeChamfer( Proc, nPhase, nRawId, nPartId, dOvmHead) local vtExtr = EgtCurveExtrusion( AuxId, GDB_RT.GLOB) -- eseguo lo smusso solo se direzione orizzontale if abs( vtExtr:getZ()) > 0.1 then - local sWarn = 'Warning on process ' .. tostring( Proc.Id) .. ' skipped not horizontale chamfer' + local sWarn = 'Warning : skipped not horizontal chamfer' EgtOutLog( sWarn) - return true + return true, sWarn end -- eseguo lo smusso solo se feature larga come la trave if dWidth < b3Raw:getDimY() - 1 then - local sWarn = 'Warning on process ' .. tostring( Proc.Id) .. ' skipped chamfer (feature smaller than beam)' + local sWarn = 'Warning : skipped chamfer (feature smaller than beam)' EgtOutLog( sWarn) - return true + return true, sWarn end local dExtra = 2 -- recupero la lavorazione local sMilling = ML.FindMilling( 'Mark') if not sMilling then - local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' milling not found in library' + local sErr = 'Error : milling not found in library' EgtOutLog( sErr) return false, sErr end @@ -130,14 +130,14 @@ function ProcessSimpleScarf.Make( 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 -- verifico che ci siano almeno due facce (altrimenti non è da lavorare) local nFacetCnt = EgtSurfTmFacetCount( Proc.Id) if nFacetCnt < 2 then - local sErr = 'Not executed ' .. tostring( Proc.Id) .. ' number of faces not enough' + local sErr = 'Error : number of faces not enough' EgtOutLog( sErr) return false, sErr end @@ -156,7 +156,7 @@ function ProcessSimpleScarf.Make( Proc, nPhase, nRawId, nPartId, dOvmHead) end end if vFaceOrd[3] == 0 then - local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' missing intermediate face' + local sErr = 'Error : missing intermediate face' EgtOutLog( sErr) return false, sErr end @@ -180,10 +180,13 @@ function ProcessSimpleScarf.Make( Proc, nPhase, nRawId, nPartId, dOvmHead) -- vettore di riferimento per le facce ortogonali all'asse trave local vtRef = Vector3d( 0, vtN[vFaceOrd[3]]:getY(), vtN[vFaceOrd[3]]:getZ()) vtRef:normalize() + -- inserimento smussi + local bOkc, sErrC = MakeChamfer( Proc, nPhase, nRawId, nPartId, dOvmHead) + if not bOkc then return bOkc, sErrC end -- recupero la lavorazione local sCutting = ML.FindCutting( 'HeadSide') if not sCutting then - local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' cutting not found in library' + local sErr = 'Error : cutting not found in library' EgtOutLog( sErr) return false, sErr end @@ -214,9 +217,6 @@ function ProcessSimpleScarf.Make( Proc, nPhase, nRawId, nPartId, dOvmHead) if not bOk then return bOk, sNameOrErr end end end - -- inserimento smussi --- local bOkc, sErrC = MakeChamfer( Proc, nPhase, nRawId, nPartId, dOvmHead) --- if not bOkc then return bOkc, sErrC end -- se esistono faccia interna ed intermedia, verifico se richiedono taglio a cubetti local vCuts = {} if vFaceOrd[2] ~= 0 and vFaceOrd[3] ~= 0 then @@ -228,7 +228,7 @@ function ProcessSimpleScarf.Make( Proc, nPhase, nRawId, nPartId, dOvmHead) -- 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 @@ -317,7 +317,7 @@ function ProcessSimpleScarf.Make( Proc, nPhase, nRawId, nPartId, dOvmHead) end BL.UpdateTCING( nRawId, dTCI) end - return true + return true, sErrC end --------------------------------------------------------------------- diff --git a/LuaLibs/ProcessStepJoint.lua b/LuaLibs/ProcessStepJoint.lua index 8440e62..dcab9ee 100644 --- a/LuaLibs/ProcessStepJoint.lua +++ b/LuaLibs/ProcessStepJoint.lua @@ -1,4 +1,4 @@ --- ProcessStepJoint.lua by Egaltech s.r.l. 2020/04/20 +-- ProcessStepJoint.lua by Egaltech s.r.l. 2020/06/04 -- Gestione calcolo giunto a gradino per Travi -- Tabella per definizione modulo @@ -48,6 +48,92 @@ function ProcessStepJoint.Classify( Proc) return true, false end +--------------------------------------------------------------------- +-- lavorazione smussi +local function MakeChamfer( Proc, nPhase, nRawId, nPartId, dOvmHead) + -- verifico che lo smusso sia richiesto + local dDepth = EgtGetInfo( Proc.Id, 'Q01', 'd') or 0 + if dDepth < 0.1 then return true end + -- ingombro del grezzo + local b3Raw = EgtGetRawPartBBox( nRawId) + -- recupero e verifico l'entità curva associata + 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 : missing profile geometry' + EgtOutLog( sErr) + return false, sErr + 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 + if abs( vtExtr:getZ()) > 0.1 then + local sWarn = 'Warning : skipped not horizontal chamfer' + EgtOutLog( sWarn) + return true, sWarn + end + -- eseguo lo smusso solo se feature larga come la trave + if dWidth < b3Raw:getDimY() - 1 then + local sWarn = 'Warning : skipped chamfer (feature smaller than beam)' + EgtOutLog( sWarn) + return true, sWarn + end + local dExtra = 2 + -- recupero la lavorazione + local sMilling = ML.FindMilling( 'Mark') + if not sMilling then + local sErr = 'Error : milling not found in library' + EgtOutLog( sErr) + return false, sErr + end + -- Inserisco la lavorazione del lato standard + local sName1 = 'SJN_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) + local nMch1Id = EgtAddMachining( sName1, sMilling) + if not nMch1Id then + local sErr = 'Error adding machining ' .. sName1 .. '-' .. sMilling + EgtOutLog( sErr) + return false, sErr + end + -- aggiungo geometria + EgtSetMachiningGeometry( {{ AuxId, -1}}) + -- assegno affondamento e offset radiale + EgtSetMachiningParam( MCH_MP.DEPTH, dDepth + dExtra) + EgtSetMachiningParam( MCH_MP.OFFSR, dExtra) + -- assegno lato di lavoro + EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT) + -- eseguo + if not EgtApplyMachining( true, false) then + local _, sErr = EgtGetLastMachMgrError() + EgtSetOperationMode( nMchId, false) + return false, sErr + end + -- Inserisco la lavorazione del lato opposto + local sName2 = 'SJN_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) + local nMch2Id = EgtAddMachining( sName2, sMilling) + if not nMch2Id then + local sErr = 'Error adding machining ' .. sName2 .. '-' .. sMilling + EgtOutLog( sErr) + return false, sErr + end + -- aggiungo geometria + EgtSetMachiningGeometry( {{ AuxId, -1}}) + -- inverto direzione utensile + EgtSetMachiningParam( MCH_MP.TOOLINVERT, true) + -- assegno affondamento e offset radiale + EgtSetMachiningParam( MCH_MP.DEPTH, dDepth + dExtra) + EgtSetMachiningParam( MCH_MP.OFFSR, dExtra) + -- assegno lato di lavoro + EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT) + -- eseguo + if not EgtApplyMachining( true, false) then + local _, sErr = EgtGetLastMachMgrError() + EgtSetOperationMode( nMchId, false) + return false, sErr + end + return true +end + --------------------------------------------------------------------- -- Applicazione della lavorazione al caso due facce local function MakeTwoFaces( Proc, nPhase, nRawId, nPartId, dOvmHead) @@ -57,7 +143,7 @@ local function MakeTwoFaces( 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 @@ -88,7 +174,7 @@ local function MakeTwoFaces( Proc, nPhase, nRawId, nPartId, dOvmHead) -- recupero la lavorazione local sCutting = ML.FindCutting( EgtIf( bHead, 'HeadSide', 'TailSide')) if not sCutting then - local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' cutting not found in library' + local sErr = 'Error : cutting not found in library' EgtOutLog( sErr) return false, sErr end @@ -107,7 +193,7 @@ local function MakeTwoFaces( Proc, nPhase, nRawId, nPartId, dOvmHead) -- 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 @@ -147,7 +233,7 @@ local function MakeTwoFaces( Proc, nPhase, nRawId, nPartId, dOvmHead) -- 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 @@ -220,7 +306,7 @@ local function MakeThreeFaces( 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 @@ -264,7 +350,7 @@ local function MakeThreeFaces( Proc, nPhase, nRawId, nPartId, dOvmHead) -- recupero la lavorazione local sCutting = ML.FindCutting( EgtIf( bHead, 'HeadSide', 'TailSide')) if not sCutting then - local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' cutting not found in library' + local sErr = 'Error : cutting not found in library' EgtOutLog( sErr) return false, sErr end @@ -282,7 +368,7 @@ local function MakeThreeFaces( Proc, nPhase, nRawId, nPartId, dOvmHead) -- 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 @@ -305,7 +391,7 @@ local function MakeThreeFaces( Proc, nPhase, nRawId, nPartId, dOvmHead) -- 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 @@ -371,15 +457,20 @@ end --------------------------------------------------------------------- -- Applicazione della lavorazione function ProcessStepJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead) + -- inserimento smussi + local bOkc, sErrC = MakeChamfer( Proc, nPhase, nRawId, nPartId, dOvmHead) + if not bOkc then return bOkc, sErrC end -- se due facce if Proc.Fct == 2 then - return MakeTwoFaces( Proc, nPhase, nRawId, nPartId, dOvmHead) + local bOk, sErr = MakeTwoFaces( Proc, nPhase, nRawId, nPartId, dOvmHead) + return bOk, sErr or sErrC -- se altrimenti tre facce elseif Proc.Fct == 3 then - return MakeThreeFaces( Proc, nPhase, nRawId, nPartId, dOvmHead) + local bOk, sErr = MakeThreeFaces( Proc, nPhase, nRawId, nPartId, dOvmHead) + return bOk, sErr or sErrC -- altrimenti errore else - local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' face number not allowed' + local sErr = 'Error : face number not allowed' EgtOutLog( sErr) return false, sErr end diff --git a/LuaLibs/ProcessStepJointNotch.lua b/LuaLibs/ProcessStepJointNotch.lua index 12a391b..2199a8f 100644 --- a/LuaLibs/ProcessStepJointNotch.lua +++ b/LuaLibs/ProcessStepJointNotch.lua @@ -1,4 +1,4 @@ --- ProcessStepJointNotch.lua by Egaltech s.r.l. 2020/04/25 +-- ProcessStepJointNotch.lua by Egaltech s.r.l. 2020/06/04 -- Gestione calcolo tacca a gradino per Travi -- Tabella per definizione modulo @@ -54,7 +54,7 @@ local function MachineByBlade( Proc, nPhase, nRawId, nPartId, dOvmHead, b3Solid, -- recupero la lavorazione local sCutting = ML.FindCutting( 'HeadSide') if not sCutting then - local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' cutting not found in library' + local sErr = 'Error : cutting not found in library' EgtOutLog( sErr) return false, sErr end @@ -75,7 +75,7 @@ local function MachineByBlade( Proc, nPhase, nRawId, nPartId, dOvmHead, b3Solid, -- 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 @@ -143,7 +143,7 @@ local function MakePocket( Proc, nPartId, ptPs, vtN, nFaceRef, nDiffWidth, sMchF end local sPocketing = ML.FindPocketing( sMchFind, dDiamTool, dElev + dCollSic) if not sPocketing then - local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' pocketing not found in library' + local sErr = 'Error : pocketing not found in library' EgtOutLog( sErr) return false, sErr end @@ -248,7 +248,7 @@ local function MachineByMill( Proc, nPhase, nRawId, nPartId, b3Solid, ptC, vtN, end if not sMilling then - local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' milling not found in library' + local sErr = 'Error : milling not found in library' EgtOutLog( sErr) return false, sErr end @@ -301,7 +301,7 @@ local function MakeTwoFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, nDiffWidth 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 @@ -341,7 +341,7 @@ local function MakeTwoFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, nDiffWidth return bOk, sErr end else - local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' internal angle less than square angle' + local sErr = 'Error : internal angle less than square angle' EgtOutLog( sErr) return false, sErr end @@ -365,7 +365,7 @@ local function MakeFourFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, nDiffWidt -- 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 @@ -392,7 +392,7 @@ local function MakeChamfer( 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 @@ -437,13 +437,13 @@ local function MakeChamfer( Proc, nPhase, nRawId, nPartId, dOvmHead) -- disabilito smusso se feature non sborda dalla trave almeno da un lato if nTypePos == 1 then - local sWarn = 'Warning on process ' .. tostring( Proc.Id) .. ' skipped chamfer (feature smaller than beam)' + local sWarn = 'Warning : skipped chamfer (feature smaller than beam)' EgtOutLog( sWarn) return true, sWarn , nTypePos end -- salto lo smusso se sborda dal lato in Z- o una direzione diversa da Y e Z if nTypePos >= 5 then - local sWarn = 'Warning on process ' .. tostring( Proc.Id) .. ' skipped chamfer (wrong side to apply)' + local sWarn = 'Warning : skipped chamfer (wrong side to apply)' EgtOutLog( sWarn) return true, sWarn, nTypePos end @@ -497,7 +497,7 @@ local function MakeChamfer( Proc, nPhase, nRawId, nPartId, dOvmHead) -- recupero la lavorazione local sMilling = ML.FindMilling( 'Mark') if not sMilling then - local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' milling not found in library' + local sErr = 'Error : milling not found in library' EgtOutLog( sErr) return false, sErr end @@ -583,7 +583,7 @@ function ProcessStepJointNotch.Make( Proc, nPhase, nRawId, nPartId, dOvmHead) if not bOk then return bOk, sErr end -- altrimenti errore else - local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' face number not allowed' + local sErr = 'Error : face number not allowed' EgtOutLog( sErr) return false, sErr end