|
|
|
@@ -5110,22 +5110,29 @@ function SawPlusChain.ApplyMachining( Machining, b3Raw)
|
|
|
|
|
local nErr
|
|
|
|
|
nErr, sErr = EgtGetLastMachMgrError()
|
|
|
|
|
-- se mortasatura e l'errore è compatibile (Axes values not calculable) si prova con l'altra configurazione dell'asse bloccato
|
|
|
|
|
-- TODO valutare se c'è modo di capire preventivamente la configurazione dell'asse bloccato e quindi rimuovere questa parte di codice
|
|
|
|
|
if Machining.Type == MCH_OY.MORTISING and nErr == 2507 then
|
|
|
|
|
if Machining.BlockedAxis.Orientation == 'perpendicular' then
|
|
|
|
|
Machining.BlockedAxis.Orientation = 'parallel'
|
|
|
|
|
else
|
|
|
|
|
Machining.BlockedAxis.Orientation = 'perpendicular'
|
|
|
|
|
if Machining.Type == MCH_OY.MORTISING then
|
|
|
|
|
-- se errore "Axes values not calculable" si prova con l'altra configurazione dell'asse bloccato
|
|
|
|
|
if nErr == 2507 then
|
|
|
|
|
if Machining.BlockedAxis.Orientation == 'perpendicular' then
|
|
|
|
|
Machining.BlockedAxis.Orientation = 'parallel'
|
|
|
|
|
else
|
|
|
|
|
Machining.BlockedAxis.Orientation = 'perpendicular'
|
|
|
|
|
end
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, BL.GetBlockedAxis( Machining.Name, Machining.BlockedAxis.Orientation, b3Raw, Machining.BlockedAxis.VtN, Machining.BlockedAxis.VtOut))
|
|
|
|
|
if Machining.SuggestedAngles.Index == 1 then
|
|
|
|
|
Machining.SuggestedAngles.Index = 2
|
|
|
|
|
else
|
|
|
|
|
Machining.SuggestedAngles.Index = 1
|
|
|
|
|
end
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.INITANGS, BL.GetChainSawInitAngs( Machining.SuggestedAngles.VtN, Machining.SuggestedAngles.VtOrtho, Machining.SuggestedAngles.Index))
|
|
|
|
|
sErr = ''
|
|
|
|
|
bIsApplyOk = ML.ApplyMachining( true, false)
|
|
|
|
|
-- se errore "Outstroke" e permesso ToolInvert provo ad invertire il lato di lavorazione
|
|
|
|
|
elseif Machining.AllowToolInvert and nErr == 2508 then
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.TOOLINVERT, not Machining.ToolInvert)
|
|
|
|
|
sErr = ''
|
|
|
|
|
bIsApplyOk = ML.ApplyMachining( true, false)
|
|
|
|
|
end
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, BL.GetBlockedAxis( Machining.Name, Machining.BlockedAxis.Orientation, b3Raw, Machining.BlockedAxis.VtN, Machining.BlockedAxis.VtOut))
|
|
|
|
|
if Machining.SuggestedAngles.Index == 1 then
|
|
|
|
|
Machining.SuggestedAngles.Index = 2
|
|
|
|
|
else
|
|
|
|
|
Machining.SuggestedAngles.Index = 1
|
|
|
|
|
end
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.INITANGS, BL.GetChainSawInitAngs( Machining.SuggestedAngles.VtN, Machining.SuggestedAngles.VtOrtho, Machining.SuggestedAngles.Index))
|
|
|
|
|
sErr = ''
|
|
|
|
|
bIsApplyOk = ML.ApplyMachining( true, false)
|
|
|
|
|
end
|
|
|
|
|
if not bIsApplyOk then
|
|
|
|
|
nErr, sErr = EgtGetLastMachMgrError()
|
|
|
|
@@ -5182,18 +5189,16 @@ function SawPlusChain.Saw.CalculateMachiningParameters( Proc, FaceToMachine, Edg
|
|
|
|
|
Cutting.Message = 'Feature '.. Proc.FeatureId .. ' : strategy ' .. SawPlusChain.Name .. ' not applicable - saw blade not found'
|
|
|
|
|
Cutting.CanApply = false
|
|
|
|
|
EgtOutLog( Cutting.Message)
|
|
|
|
|
return Cutting
|
|
|
|
|
end
|
|
|
|
|
Cutting.Type = MCH_OY.MILLING
|
|
|
|
|
Cutting.Tool = SawPlusChain.GetToolFromMachining( Cutting.Name)
|
|
|
|
|
|
|
|
|
|
-- verifica dimensioni tasca compatibili
|
|
|
|
|
-- verifica dimensioni tasca e direzione compatibili
|
|
|
|
|
-- se tasca meno spessa della lama la strategia non è applicabile
|
|
|
|
|
if Cutting.Tool.Thickness > dPocketHeight + 10 * GEO.EPS_SMALL then
|
|
|
|
|
Cutting.Message = 'Feature '.. Proc.FeatureId .. ' : strategy ' .. SawPlusChain.Name .. ' not applicable - pocket too narrow for saw blade thickness'
|
|
|
|
|
Cutting.CanApply = false
|
|
|
|
|
EgtOutLog( Cutting.Message)
|
|
|
|
|
return Cutting
|
|
|
|
|
end
|
|
|
|
|
if #( Proc.MainFaces.SideFaces) > 1 then
|
|
|
|
|
-- se tasca più stretta della lama la strategia non è applicabile
|
|
|
|
@@ -5201,9 +5206,13 @@ function SawPlusChain.Saw.CalculateMachiningParameters( Proc, FaceToMachine, Edg
|
|
|
|
|
Cutting.Message = 'Feature '.. Proc.FeatureId .. ' : strategy ' .. SawPlusChain.Name .. ' not applicable - pocket too narrow for saw blade diameter'
|
|
|
|
|
Cutting.CanApply = false
|
|
|
|
|
EgtOutLog( Cutting.Message)
|
|
|
|
|
return Cutting
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
if EdgeToMachine.ToolDirection:getZ() < BD.NZ_MINA then
|
|
|
|
|
Cutting.CanApply = false
|
|
|
|
|
Cutting.Message = 'Feature '.. Proc.FeatureId .. ' : skipped sawblade from bottom'
|
|
|
|
|
EgtOutLog( Cutting.Message)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
-- parametri della lavorazione
|
|
|
|
|
-- inizio e fine aperti o chiusi
|
|
|
|
@@ -5334,6 +5343,7 @@ function SawPlusChain.Chainsaw.CalculateMachiningParameters( Proc, FaceToMachine
|
|
|
|
|
Mortising.CanApply = true
|
|
|
|
|
Mortising.Message = ''
|
|
|
|
|
Mortising.ProcId = Proc.Id
|
|
|
|
|
Mortising.AllowToolInvert = false
|
|
|
|
|
local bNeedToMachineOtherSide = false
|
|
|
|
|
local dTestCornerRadius = 43
|
|
|
|
|
-- OneSide | OneSideAndExtend | BothSides | BothSidesAndExtend
|
|
|
|
@@ -5377,18 +5387,21 @@ function SawPlusChain.Chainsaw.CalculateMachiningParameters( Proc, FaceToMachine
|
|
|
|
|
Mortising.Message = 'Feature '.. Proc.FeatureId .. ' : strategy ' .. SawPlusChain.Name .. ' not applicable - chainsaw not found'
|
|
|
|
|
Mortising.CanApply = false
|
|
|
|
|
EgtOutLog( Mortising.Message)
|
|
|
|
|
return Mortising
|
|
|
|
|
end
|
|
|
|
|
Mortising.Type = MCH_OY.MORTISING
|
|
|
|
|
Mortising.Tool = SawPlusChain.GetToolFromMachining( Mortising.Name)
|
|
|
|
|
|
|
|
|
|
-- in caso di tunnel da un lato permetto eventuale inversione lato di lavoro in caso di errori di applicazione (es: Outstroke)
|
|
|
|
|
if Proc.Topology == 'Tunnel' and sMortisingType == 'OneSide' or sMortisingType == 'OneSideAndExtend' then
|
|
|
|
|
Mortising.AllowToolInvert = true
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
-- verifica dimensioni tasca compatibili
|
|
|
|
|
-- se tasca meno spessa della sega a catena la strategia non è applicabile
|
|
|
|
|
if Mortising.Tool.Thickness > dPocketHeight + 10 * GEO.EPS_SMALL then
|
|
|
|
|
Mortising.Message = 'Feature '.. Proc.FeatureId .. ' : strategy ' .. SawPlusChain.Name .. ' not applicable - pocket too narrow for chainsaw thickness'
|
|
|
|
|
Mortising.CanApply = false
|
|
|
|
|
EgtOutLog( Mortising.Message)
|
|
|
|
|
return Mortising
|
|
|
|
|
end
|
|
|
|
|
if #( Proc.MainFaces.SideFaces) > 1 then
|
|
|
|
|
-- se tasca più stretta della sega a catena la strategia non è applicabile
|
|
|
|
@@ -5396,9 +5409,13 @@ function SawPlusChain.Chainsaw.CalculateMachiningParameters( Proc, FaceToMachine
|
|
|
|
|
Mortising.Message = 'Feature '.. Proc.FeatureId .. ' : strategy ' .. SawPlusChain.Name .. ' not applicable - pocket too narrow for chainsaw width'
|
|
|
|
|
Mortising.CanApply = false
|
|
|
|
|
EgtOutLog( Mortising.Message)
|
|
|
|
|
return Mortising
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
if EdgeToMachine.ToolDirection:getZ() < - 10 * GEO.EPS_ANG_SMALL then
|
|
|
|
|
Mortising.CanApply = false
|
|
|
|
|
Mortising.Message = 'Feature '.. Proc.FeatureId .. ' : skipped chainsaw from bottom'
|
|
|
|
|
EgtOutLog( Mortising.Message)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
-- parametri della lavorazione
|
|
|
|
|
-- inizio e fine aperti o chiusi
|
|
|
|
@@ -5555,9 +5572,9 @@ function SawPlusChain.Make( bOnlySaw, Proc, nRawId)
|
|
|
|
|
local bIsCuttingOk = false
|
|
|
|
|
if Cutting.CanApply then
|
|
|
|
|
bIsCuttingOk, Cutting.Message = SawPlusChain.Saw.ApplyAllSteps( Cutting, b3Raw)
|
|
|
|
|
end
|
|
|
|
|
if not bIsCuttingOk then
|
|
|
|
|
return bIsCuttingOk, Cutting.Message
|
|
|
|
|
if not bIsCuttingOk then
|
|
|
|
|
return bIsCuttingOk, Cutting.Message
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
local dBottomDepthToMachine = Cutting.RadialOffset
|
|
|
|
|
-- lato opposto del tunnel
|
|
|
|
@@ -5566,9 +5583,9 @@ function SawPlusChain.Make( bOnlySaw, Proc, nRawId)
|
|
|
|
|
bIsCuttingOk = false
|
|
|
|
|
if Cutting.CanApply then
|
|
|
|
|
bIsCuttingOk, Cutting.Message = SawPlusChain.Saw.ApplyAllSteps( Cutting, b3Raw)
|
|
|
|
|
end
|
|
|
|
|
if not bIsCuttingOk then
|
|
|
|
|
return bIsCuttingOk, Cutting.Message
|
|
|
|
|
if not bIsCuttingOk then
|
|
|
|
|
return bIsCuttingOk, Cutting.Message
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
-- se la lama non è arrivata sul fondo e c'è almeno un lato aperto va lavorato
|
|
|
|
@@ -5579,9 +5596,9 @@ function SawPlusChain.Make( bOnlySaw, Proc, nRawId)
|
|
|
|
|
bIsCuttingOk = false
|
|
|
|
|
if Cutting.CanApply then
|
|
|
|
|
bIsCuttingOk, Cutting.Message = SawPlusChain.Saw.ApplyAllSteps( Cutting, b3Raw)
|
|
|
|
|
end
|
|
|
|
|
if not bIsCuttingOk then
|
|
|
|
|
return bIsCuttingOk, Cutting.Message
|
|
|
|
|
if not bIsCuttingOk then
|
|
|
|
|
return bIsCuttingOk, Cutting.Message
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
-- eventuale lavorazione di lama - lato della tasca in cui finisce la lavorazione
|
|
|
|
@@ -5590,9 +5607,9 @@ function SawPlusChain.Make( bOnlySaw, Proc, nRawId)
|
|
|
|
|
bIsCuttingOk = false
|
|
|
|
|
if Cutting.CanApply then
|
|
|
|
|
bIsCuttingOk, Cutting.Message = SawPlusChain.Saw.ApplyAllSteps( Cutting, b3Raw)
|
|
|
|
|
end
|
|
|
|
|
if not bIsCuttingOk then
|
|
|
|
|
return bIsCuttingOk, Cutting.Message
|
|
|
|
|
if not bIsCuttingOk then
|
|
|
|
|
return bIsCuttingOk, Cutting.Message
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
-- la lama è arrivata sul fondo e tasca passante, non servono ulteriori lavorazioni
|
|
|
|
@@ -5626,9 +5643,9 @@ function SawPlusChain.Make( bOnlySaw, Proc, nRawId)
|
|
|
|
|
bIsMortisingOk = false
|
|
|
|
|
if Mortising.CanApply then
|
|
|
|
|
bIsMortisingOk, Mortising.Message = SawPlusChain.Chainsaw.ApplyAllSteps( Mortising, b3Raw)
|
|
|
|
|
end
|
|
|
|
|
if not bIsMortisingOk then
|
|
|
|
|
return bIsMortisingOk, Mortising.Message
|
|
|
|
|
if not bIsMortisingOk then
|
|
|
|
|
return bIsMortisingOk, Mortising.Message
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
-- se la sega a catena non è arrivata sul fondo e c'è almeno un lato aperto va lavorato
|
|
|
|
@@ -5639,9 +5656,9 @@ function SawPlusChain.Make( bOnlySaw, Proc, nRawId)
|
|
|
|
|
bIsMortisingOk = false
|
|
|
|
|
if Mortising.CanApply then
|
|
|
|
|
bIsMortisingOk, Mortising.Message = SawPlusChain.Chainsaw.ApplyAllSteps( Mortising, b3Raw)
|
|
|
|
|
end
|
|
|
|
|
if not bIsMortisingOk then
|
|
|
|
|
return bIsMortisingOk, Mortising.Message
|
|
|
|
|
if not bIsMortisingOk then
|
|
|
|
|
return bIsMortisingOk, Mortising.Message
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
-- eventuale lavorazione di sega a catena - lato della tasca in cui finisce la lavorazione
|
|
|
|
@@ -5650,9 +5667,9 @@ function SawPlusChain.Make( bOnlySaw, Proc, nRawId)
|
|
|
|
|
bIsMortisingOk = false
|
|
|
|
|
if Mortising.CanApply then
|
|
|
|
|
bIsMortisingOk, Mortising.Message = SawPlusChain.Chainsaw.ApplyAllSteps( Mortising, b3Raw)
|
|
|
|
|
end
|
|
|
|
|
if not bIsMortisingOk then
|
|
|
|
|
return bIsMortisingOk, Mortising.Message
|
|
|
|
|
if not bIsMortisingOk then
|
|
|
|
|
return bIsMortisingOk, Mortising.Message
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|