- in LapJoint per Q02 solo contorno si inverte ordine lavorazione lato principale e opposto, in modo da avere sempre per ultima la lavorazione da sopra
This commit is contained in:
+77
-77
@@ -2458,6 +2458,83 @@ local function MakeContourByMill( Proc, idContourPath, vtTunnelDirection, dTunne
|
||||
|
||||
local bOppositMillingReachesHalfDepth = ToolOpposite.MaxDepth > dTunnelDepth / 2 + dCollSic - dDimStrip / 2
|
||||
|
||||
-- eventuale lavorazione opposta
|
||||
local bMillingOppositeOk
|
||||
if bOppositeMillingNeeded then
|
||||
local sName = 'ContourOppo_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
||||
local idMachining = EgtAddMachining( sName, sMillingOpposite)
|
||||
if not idMachining then
|
||||
local sErr = 'Error : impossible add machining ' .. sName .. '-' .. sMilling
|
||||
return false, sErr
|
||||
end
|
||||
-- geometria
|
||||
EgtSetMachiningGeometry( {{ idContourPath, -1}})
|
||||
-- lato di lavoro sinistro
|
||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT)
|
||||
-- inversione direzione utensile
|
||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
||||
-- SCC
|
||||
local nSCC = MCH_SCC.NONE
|
||||
if not BD.C_SIMM then
|
||||
if AreSameOrOppositeVectorApprox( vtTunnelDirection, Z_AX()) then
|
||||
nSCC = MCH_SCC.ADIR_YM
|
||||
elseif abs( vtTunnelDirection:getX()) < 0.1 then
|
||||
nSCC = EgtIf( BL.IsPartFinalPhase( nPhase), MCH_SCC.ADIR_XM, MCH_SCC.ADIR_XP)
|
||||
elseif vtTunnelDirection:getY() < GEO.EPS_SMALL then
|
||||
nSCC = MCH_SCC.ADIR_YM
|
||||
else
|
||||
nSCC = MCH_SCC.ADIR_YP
|
||||
end
|
||||
end
|
||||
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
|
||||
-- gestione attacco e uscita
|
||||
if EgtCurveIsClosed( idContourPath) then
|
||||
-- attacco e uscita a quarto di cerchio senza allungamenti a inizio e fine
|
||||
EgtSetMachiningParam( MCH_MP.LEADINTYPE, MCH_MILL_LI.TANGENT)
|
||||
EgtSetMachiningParam( MCH_MP.LEADOUTTYPE, MCH_MILL_LO.AS_LI)
|
||||
EgtSetMachiningParam( MCH_MP.LITANG, 0)
|
||||
EgtSetMachiningParam( MCH_MP.LIPERP, 0.5 * Tool.Diameter)
|
||||
EgtSetMachiningParam( MCH_MP.LIELEV, 0)
|
||||
EgtSetMachiningParam( MCH_MP.STARTADDLEN, 0)
|
||||
EgtSetMachiningParam( MCH_MP.ENDADDLEN, 0)
|
||||
else
|
||||
-- nessun attacco e uscita, allungo inizio e fine di raggio utensile + 5mm (per evitare controllo collisioni)
|
||||
EgtSetMachiningParam( MCH_MP.LEADINTYPE, MCH_MILL_LI.NONE)
|
||||
EgtSetMachiningParam( MCH_MP.LEADOUTTYPE, MCH_MILL_LO.AS_LI)
|
||||
EgtSetMachiningParam( MCH_MP.STARTADDLEN, Tool.Diameter / 2 + 5)
|
||||
EgtSetMachiningParam( MCH_MP.ENDADDLEN, Tool.Diameter / 2 + 5)
|
||||
end
|
||||
-- affondamento - la curva è a metà tasca quindi affondamento 0 significa che la lavorazione arriva a metà tasca
|
||||
local dDepth
|
||||
-- si arriva a metà tasca
|
||||
if bOppositMillingReachesHalfDepth then
|
||||
dDepth = -dDimStrip / 2
|
||||
-- si arriva al massimo raggiungibile
|
||||
else
|
||||
dDepth = Tool.MaxDepth - dTunnelDepth / 2 - dCollSic
|
||||
bIncomplete = true
|
||||
end
|
||||
EgtSetMachiningParam( MCH_MP.DEPTH, dDepth)
|
||||
-- Note utente con dichiarazione nessuna generazione sfridi per Vmill e massima elevazione
|
||||
local sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES) or ''
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'VMRS', 0)
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', EgtNumToString( dTunnelDepth / 2 + dDepth, 1))
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
|
||||
-- eseguo
|
||||
if ML.ApplyMachining( true, false) then
|
||||
_, sApplyWarning = EgtGetMachMgrWarning( 0)
|
||||
if EgtIsMachiningEmpty() then
|
||||
EgtSetOperationMode( idMachining, false)
|
||||
end
|
||||
bMillingOppositeOk = true
|
||||
-- altrimenti lavorazione non applicata
|
||||
else
|
||||
_, sApplyWarning = EgtGetLastMachMgrError()
|
||||
EgtSetOperationMode( idMachining, false)
|
||||
bMillingOppositeOk = false
|
||||
end
|
||||
end
|
||||
|
||||
-- applicazione lavorazione lato principale
|
||||
local sName = 'Contour_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
||||
local idMachining = EgtAddMachining( sName, sMilling)
|
||||
@@ -2546,83 +2623,6 @@ local function MakeContourByMill( Proc, idContourPath, vtTunnelDirection, dTunne
|
||||
bMillingOk = false
|
||||
end
|
||||
|
||||
-- eventuale lavorazione opposta
|
||||
local bMillingOppositeOk
|
||||
if bOppositeMillingNeeded then
|
||||
local sName = 'ContourOppo_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
||||
local idMachining = EgtAddMachining( sName, sMillingOpposite)
|
||||
if not idMachining then
|
||||
local sErr = 'Error : impossible add machining ' .. sName .. '-' .. sMilling
|
||||
return false, sErr
|
||||
end
|
||||
-- geometria
|
||||
EgtSetMachiningGeometry( {{ idContourPath, -1}})
|
||||
-- lato di lavoro sinistro
|
||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT)
|
||||
-- inversione direzione utensile
|
||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
||||
-- SCC
|
||||
local nSCC = MCH_SCC.NONE
|
||||
if not BD.C_SIMM then
|
||||
if AreSameOrOppositeVectorApprox( vtTunnelDirection, Z_AX()) then
|
||||
nSCC = MCH_SCC.ADIR_YM
|
||||
elseif abs( vtTunnelDirection:getX()) < 0.1 then
|
||||
nSCC = EgtIf( BL.IsPartFinalPhase( nPhase), MCH_SCC.ADIR_XM, MCH_SCC.ADIR_XP)
|
||||
elseif vtTunnelDirection:getY() < GEO.EPS_SMALL then
|
||||
nSCC = MCH_SCC.ADIR_YM
|
||||
else
|
||||
nSCC = MCH_SCC.ADIR_YP
|
||||
end
|
||||
end
|
||||
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
|
||||
-- gestione attacco e uscita
|
||||
if EgtCurveIsClosed( idContourPath) then
|
||||
-- attacco e uscita a quarto di cerchio senza allungamenti a inizio e fine
|
||||
EgtSetMachiningParam( MCH_MP.LEADINTYPE, MCH_MILL_LI.TANGENT)
|
||||
EgtSetMachiningParam( MCH_MP.LEADOUTTYPE, MCH_MILL_LO.AS_LI)
|
||||
EgtSetMachiningParam( MCH_MP.LITANG, 0)
|
||||
EgtSetMachiningParam( MCH_MP.LIPERP, 0.5 * Tool.Diameter)
|
||||
EgtSetMachiningParam( MCH_MP.LIELEV, 0)
|
||||
EgtSetMachiningParam( MCH_MP.STARTADDLEN, 0)
|
||||
EgtSetMachiningParam( MCH_MP.ENDADDLEN, 0)
|
||||
else
|
||||
-- nessun attacco e uscita, allungo inizio e fine di raggio utensile + 5mm (per evitare controllo collisioni)
|
||||
EgtSetMachiningParam( MCH_MP.LEADINTYPE, MCH_MILL_LI.NONE)
|
||||
EgtSetMachiningParam( MCH_MP.LEADOUTTYPE, MCH_MILL_LO.AS_LI)
|
||||
EgtSetMachiningParam( MCH_MP.STARTADDLEN, Tool.Diameter / 2 + 5)
|
||||
EgtSetMachiningParam( MCH_MP.ENDADDLEN, Tool.Diameter / 2 + 5)
|
||||
end
|
||||
-- affondamento - la curva è a metà tasca quindi affondamento 0 significa che la lavorazione arriva a metà tasca
|
||||
local dDepth
|
||||
-- si arriva a metà tasca
|
||||
if bOppositMillingReachesHalfDepth then
|
||||
dDepth = -dDimStrip / 2
|
||||
-- si arriva al massimo raggiungibile
|
||||
else
|
||||
dDepth = Tool.MaxDepth - dTunnelDepth / 2 - dCollSic
|
||||
bIncomplete = true
|
||||
end
|
||||
EgtSetMachiningParam( MCH_MP.DEPTH, dDepth)
|
||||
-- Note utente con dichiarazione nessuna generazione sfridi per Vmill e massima elevazione
|
||||
local sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES) or ''
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'VMRS', 0)
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', EgtNumToString( dTunnelDepth / 2 + dDepth, 1))
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
|
||||
-- eseguo
|
||||
if ML.ApplyMachining( true, false) then
|
||||
_, sApplyWarning = EgtGetMachMgrWarning( 0)
|
||||
if EgtIsMachiningEmpty() then
|
||||
EgtSetOperationMode( idMachining, false)
|
||||
end
|
||||
bMillingOppositeOk = true
|
||||
-- altrimenti lavorazione non applicata
|
||||
else
|
||||
_, sApplyWarning = EgtGetLastMachMgrError()
|
||||
EgtSetOperationMode( idMachining, false)
|
||||
bMillingOppositeOk = false
|
||||
end
|
||||
end
|
||||
|
||||
if bMillingOk or ( bOppositeMillingNeeded and bMillingOppositeOk) then
|
||||
local sWarning = ''
|
||||
if bIncomplete then
|
||||
|
||||
Reference in New Issue
Block a user