- alcune modifiche a nomi variabili (Part.b3Raw, nToolTypeId)
- in BeamLib aggiunte GetChainSawInitAngs e GetBlockedAxis da automatismo vecchio, con qualche adattamento - prima versione funzionante di STR0003
This commit is contained in:
@@ -97,8 +97,8 @@ function BeamExec.GetToolsFromDB()
|
||||
|
||||
-- verifico se utensile disponibile in attrezzaggio attuale e che abbia un tipo ben definito
|
||||
local bToolLoadedOnSetup, sToolTCPos = EgtFindToolInCurrSetup( Tool.sName)
|
||||
local dToolTypeID = EgtTdbGetCurrToolParam( MCH_TP.TYPE)
|
||||
local sToolType, sToolFamily = GetToolTypeNameFromToolTypeID( dToolTypeID)
|
||||
local nToolTypeId = EgtTdbGetCurrToolParam( MCH_TP.TYPE)
|
||||
local sToolType, sToolFamily = GetToolTypeNameFromToolTypeID( nToolTypeId)
|
||||
|
||||
-- se verifica condizioni minime, recupero tutti gli altri dati
|
||||
if bToolLoadedOnSetup and sToolType then
|
||||
@@ -108,7 +108,7 @@ function BeamExec.GetToolsFromDB()
|
||||
Tool.sTcPos = sToolTCPos
|
||||
Tool.sFamily = sToolFamily
|
||||
Tool.sType = sToolType
|
||||
Tool.dTypeID = dToolTypeID
|
||||
Tool.nTypeId = nToolTypeId
|
||||
Tool.dMaxMaterial = EgtTdbGetCurrToolParam( MCH_TP.MAXMAT)
|
||||
Tool.dDiameter = EgtTdbGetCurrToolParam( MCH_TP.DIAM)
|
||||
Tool.dLength = EgtTdbGetCurrToolParam( MCH_TP.LEN)
|
||||
@@ -586,7 +586,7 @@ local function AreDrillingsMirrored( Proc, ProcMirror, Part)
|
||||
|
||||
-- centri allineati, equidistanti dalla mezzeria trave, non troppo vicini
|
||||
local vtDisplacement = ptBC - ptBCMirror
|
||||
local ptCenRaw = Part.b3RawBox:getCenter()
|
||||
local ptCenRaw = Part.b3Raw:getCenter()
|
||||
if nDouble == 2 then
|
||||
local dYMinDistance = max( Proc.b3Box:getMin():getY(), ProcMirror.b3Box:getMin():getY()) - min( Proc.b3Box:getMax():getY(), ProcMirror.b3Box:getMax():getY())
|
||||
if not ( abs( vtDisplacement:getX()) < 100 * GEO.EPS_SMALL and abs( vtDisplacement:getZ()) < 100 * GEO.EPS_SMALL and
|
||||
@@ -873,10 +873,10 @@ function BeamExec.ProcessFeatures()
|
||||
while Part.idRaw do
|
||||
-- verifico che il grezzo contenga pezzi oppure sia abbastanza lungo da essere scaricato coi carrelli
|
||||
Part.idPart = EgtGetFirstPartInRawPart( Part.idRaw)
|
||||
Part.b3RawBox = EgtGetRawPartBBox( Part.idRaw)
|
||||
Part.b3Raw = EgtGetRawPartBBox( Part.idRaw)
|
||||
Part.b3Solid = EgtGetBBoxGlob( EgtGetFirstNameInGroup( Part.idPart, 'Box') or GDB_ID.NULL, GDB_BB.STANDARD)
|
||||
|
||||
if not Part.idPart and Part.b3RawBox:getDimX() < BeamData.dMinRaw then break end
|
||||
if not Part.idPart and Part.b3Raw:getDimX() < BeamData.dMinRaw then break end
|
||||
|
||||
-- per ogni rotazione, calcolo come lavorare le feature per decidere posizionamento iniziale e in che rotazione verranno lavorate le singole feature
|
||||
local vProcRot = {}
|
||||
@@ -905,7 +905,7 @@ end
|
||||
|
||||
-- ruoto il grezzo per calcolare la fattibilità delle lavorazioni nella prossima rotazione
|
||||
-- vettore movimento grezzi per rotazione di 90deg ogni step
|
||||
local dDeltaYZ = Part.b3RawBox:getDimY() - Part.b3RawBox:getDimZ()
|
||||
local dDeltaYZ = Part.b3Raw:getDimY() - Part.b3Raw:getDimZ()
|
||||
local vtMove = Vector3d( 0, dDeltaYZ / 2 * EgtIf( BeamData.RIGHT_LOAD, -1, 1), dDeltaYZ / 2)
|
||||
local bPreMove = ( dDeltaYZ < 0)
|
||||
-- ruoto le travi della fase corrente
|
||||
@@ -917,7 +917,7 @@ end
|
||||
EgtMoveRawPart( Part.idRaw, vtMove)
|
||||
end
|
||||
-- aggiorno info pezzo
|
||||
Part.b3RawBox = EgtGetRawPartBBox( Part.idRaw)
|
||||
Part.b3Raw = EgtGetRawPartBBox( Part.idRaw)
|
||||
Part.b3Solid = EgtGetBBoxGlob( EgtGetFirstNameInGroup( Part.idPart, 'Box') or GDB_ID.NULL, GDB_BB.STANDARD)
|
||||
end
|
||||
|
||||
|
||||
+43
-3
@@ -8,6 +8,7 @@ local BeamLib = {}
|
||||
|
||||
-- Include
|
||||
require( 'EgtBase')
|
||||
local BeamData = require( 'BeamData')
|
||||
|
||||
EgtOutLog( ' BeamLib started', 1)
|
||||
|
||||
@@ -262,14 +263,14 @@ function BeamLib.GetFaceHvRefDim( nSurfId, idFace, Part)
|
||||
local dDimH = b3HV:getDimX()
|
||||
local dDimV = b3HV:getDimY()
|
||||
-- se definito grezzo (o solido), applico eventuali limiti
|
||||
if Part.b3RawBox then
|
||||
if Part.b3Raw then
|
||||
local dCoeffY = abs( frHV:getVersX():getY())
|
||||
if dCoeffY > GEO.EPS_SMALL then
|
||||
dDimH = min( dDimH, Part.b3RawBox:getDimY() / dCoeffY)
|
||||
dDimH = min( dDimH, Part.b3Raw:getDimY() / dCoeffY)
|
||||
end
|
||||
local dCoeffZ = abs( frHV:getVersY():getZ())
|
||||
if dCoeffZ > GEO.EPS_SMALL then
|
||||
dDimV = min( dDimV, Part.b3RawBox:getDimZ() / dCoeffZ)
|
||||
dDimV = min( dDimV, Part.b3Raw:getDimZ() / dCoeffZ)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -312,5 +313,44 @@ function BeamLib.LoadCustomParametersInStrategy( CustomParameters)
|
||||
return Parameters
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
function BeamLib.GetChainSawInitAngs( vtN, vtO, nInd)
|
||||
if BeamData.GetChainSawInitAngs then
|
||||
return BeamData.GetChainSawInitAngs( vtN, vtO, nInd)
|
||||
else
|
||||
if BeamData.C_SIMM then
|
||||
return EgtIf( vtN:getY() > 0, 'C=180', 'C=-180')
|
||||
else
|
||||
if nInd == 1 then
|
||||
return ''
|
||||
else
|
||||
return EgtIf( vtN:getY() > 0, 'C=180', 'C=-180')
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
function BeamLib.GetBlockedAxis( nToolIndex, sBlockedAxis, b3Raw, vtTool, vtOut)
|
||||
-- se presente funzione specifica nella macchina, la richiamo
|
||||
if BeamData.GetBlockedAxis then
|
||||
return BeamData.GetBlockedAxis( TOOLS[nToolIndex].sHead, TOOLS[nToolIndex].nTypeId, sBlockedAxis, b3Raw, vtTool, vtOut) or ''
|
||||
-- sezione mantenuta per retrocompatibilità con GetChainSawBlockedAxis
|
||||
elseif TOOLS[nToolIndex].nTypeId == MCH_TY.MORTISE_STD then
|
||||
local nInd = EgtIf( sBlockedAxis == 'parallel', 0, 1)
|
||||
if BeamData.GetChainSawBlockedAxis then
|
||||
return BeamData.GetChainSawBlockedAxis( nInd)
|
||||
else
|
||||
if nInd == 1 then
|
||||
return EgtIf( BeamData.C_SIMM, 'A=90', 'A=90')
|
||||
else
|
||||
return EgtIf( BeamData.C_SIMM, 'A=0', 'A=0')
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return ''
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
return BeamLib
|
||||
|
||||
@@ -111,14 +111,14 @@ end
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
-- restituisce vero se la feature con box b3Proc taglia l'intera sezione della barra, rappresentata dalle sue dimensioni W e H
|
||||
local function IsFeatureCuttingEntireSection( b3Proc, Part)
|
||||
return ( b3Proc:getDimY() > ( Part.b3RawBox:getDimY() - 500 * GEO.EPS_SMALL) and b3Proc:getDimZ() > ( Part.b3RawBox:getDimZ() - 500 * GEO.EPS_SMALL))
|
||||
return ( b3Proc:getDimY() > ( Part.b3Raw:getDimY() - 500 * GEO.EPS_SMALL) and b3Proc:getDimZ() > ( Part.b3Raw:getDimZ() - 500 * GEO.EPS_SMALL))
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
-- restituisce vero se la feature con box b3Proc taglia l'intera lunghezza della barra, rappresentata dalle sue dimensioni W e L oppure H e L
|
||||
local function IsFeatureCuttingEntireLength( b3Proc, Part)
|
||||
return ( ( b3Proc:getDimY() > ( Part.b3RawBox:getDimY() - 500 * GEO.EPS_SMALL) and b3Proc:getDimX() > ( Part.b3RawBox:getDimX() - 500 * GEO.EPS_SMALL)) or
|
||||
( b3Proc:getDimZ() > ( Part.b3RawBox:getDimZ() - 500 * GEO.EPS_SMALL) and b3Proc:getDimX() > ( Part.b3RawBox:getDimX() - 500 * GEO.EPS_SMALL)))
|
||||
return ( ( b3Proc:getDimY() > ( Part.b3Raw:getDimY() - 500 * GEO.EPS_SMALL) and b3Proc:getDimX() > ( Part.b3Raw:getDimX() - 500 * GEO.EPS_SMALL)) or
|
||||
( b3Proc:getDimZ() > ( Part.b3Raw:getDimZ() - 500 * GEO.EPS_SMALL) and b3Proc:getDimX() > ( Part.b3Raw:getDimX() - 500 * GEO.EPS_SMALL)))
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user