- in MachiningLib aggiunta InitMachiningParameters per inizializzarae i parametri della lavorazione a valori di default; FACEBYBLADE / CHAINSAW / MILL usano la nuova funzione invece di creare tabelle vuote
- tutti i riferimenti al tipo di lavorazione MCH_OY diventano MCH_MY
This commit is contained in:
@@ -482,6 +482,86 @@ function MachiningLib.FindChainSaw( Proc, ToolSearchParameters)
|
||||
return ToolInfo
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
function MachiningLib.InitMachiningParameters( nMachiningType)
|
||||
local Machining = {}
|
||||
|
||||
Machining.nType = nMachiningType
|
||||
Machining.sDepth = 0
|
||||
Machining.bInvert = false
|
||||
Machining.nSCC = MCH_SCC.NONE
|
||||
Machining.bToolInvert = false
|
||||
Machining.sBlockedAxis = ''
|
||||
Machining.sInitialAngles = ''
|
||||
Machining.dOverlap = 0
|
||||
Machining.dSideAngle = 0
|
||||
Machining.dStartSafetyLength = BeamData.COLL_SIC
|
||||
Machining.dRadialOffset = 0
|
||||
Machining.dLongitudinalOffset = 0
|
||||
Machining.sUserNotes = ''
|
||||
Machining.Steps = {}
|
||||
Machining.Steps.dStep = 0
|
||||
Machining.Steps.dSideStep = 0
|
||||
|
||||
if nMachiningType == MCH_MY.MILLING then
|
||||
Machining.nWorkside = MCH_MILL_WS.LEFT
|
||||
Machining.nFaceuse = MCH_MILL_FU.NONE
|
||||
Machining.Steps.nStepType = MCH_MILL_ST.ONEWAY
|
||||
Machining.LeadIn = {}
|
||||
Machining.LeadIn.nType = MCH_MILL_LI.LINEAR
|
||||
Machining.LeadIn.dStartAddLength = 0
|
||||
Machining.LeadIn.dTangentDistance = 0
|
||||
Machining.LeadIn.dPerpDistance = 0
|
||||
Machining.LeadIn.dElevation = 0
|
||||
Machining.LeadIn.dCompLength = 0
|
||||
Machining.LeadOut = {}
|
||||
Machining.LeadOut.nType = MCH_MILL_LO.LINEAR
|
||||
Machining.LeadOut.dEndAddLength = 0
|
||||
Machining.LeadOut.dTangentDistance = 0
|
||||
Machining.LeadOut.dPerpDistance = 0
|
||||
Machining.LeadOut.dElevation = 0
|
||||
Machining.LeadOut.dCompLength = 0
|
||||
|
||||
elseif nMachiningType == MCH_MY.MORTISING then
|
||||
Machining.nWorkside = MCH_MORTISE_WS.LEFT
|
||||
Machining.nFaceuse = MCH_MORTISE_FU.NONE
|
||||
Machining.Steps.nStepType = MCH_MORTISE_ST.ONEWAY
|
||||
Machining.LeadIn = {}
|
||||
Machining.LeadIn.dStartAddLength = 0
|
||||
Machining.LeadOut = {}
|
||||
Machining.LeadOut.dEndAddLength = 0
|
||||
|
||||
elseif nMachiningType == MCH_MY.DRILLING then
|
||||
Machining.dReturnPos = 0
|
||||
Machining.dStartSlowLen = 0
|
||||
Machining.dEndSlowLen = 0
|
||||
Machining.dThrouAddLen = 5
|
||||
|
||||
elseif nMachiningType == MCH_MY.POCKETING then
|
||||
Machining.nSubType = MCH_POCK_SUB.ONEWAY
|
||||
Machining.LeadIn = {}
|
||||
Machining.LeadIn.nType = MCH_POCK_LI.ZIGZAG
|
||||
Machining.LeadIn.dTangentDistance = 0
|
||||
Machining.LeadIn.dElevation = 0
|
||||
Machining.LeadOut = {}
|
||||
Machining.LeadOut.nType = MCH_POCK_LO.NONE
|
||||
Machining.LeadOut.dTangentDistance = 0
|
||||
|
||||
elseif nMachiningType == MCH_MY.SAWING then
|
||||
-- TODO da completare
|
||||
Machining.nWorkside = MCH_SAW_WS.CENTER
|
||||
Machining.nHeadSide = MCH_SAW_HS.LEFT
|
||||
Machining.Steps.nStepType = MCH_SAW_ST.ONEWAY
|
||||
Machining.LeadIn.nType = MCH_SAW_LI.CENT
|
||||
Machining.LeadOut.nType = MCH_SAW_LO.CENT
|
||||
|
||||
else
|
||||
error( 'InitMachiningParameters : unknown machining type')
|
||||
end
|
||||
|
||||
return Machining
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
-- salva in lista globale la lavorazione appena calcolata
|
||||
local function AddNewMachining( ProcToAdd, MachiningToAdd, AuxiliaryDataToAdd)
|
||||
@@ -609,7 +689,7 @@ function MachiningLib.AddOperations( vProc, Part, sRotation)
|
||||
{ sName = 'nHeadSide', nMchParam = MCH_MP.HEADSIDE},
|
||||
{ sName = 'nSubType', nMchParam = MCH_MP.SUBTYPE},
|
||||
{ sName = 'dOverlap', nMchParam = MCH_MP.OVERL},
|
||||
{ sName = 'nStepType', nMchParam = MCH_MP.STEPTYPE},
|
||||
{ sName = 'dSideAngle', nMchParam = MCH_MP.SIDEANGLE},
|
||||
{ sName = 'dStartSafetyLength', nMchParam = MCH_MP.STARTPOS},
|
||||
{ sName = 'dReturnPos', nMchParam = MCH_MP.RETURNPOS},
|
||||
{ sName = 'dRadialOffset', nMchParam = MCH_MP.OFFSR},
|
||||
@@ -657,7 +737,8 @@ function MachiningLib.AddOperations( vProc, Part, sRotation)
|
||||
{ sName = 'nOutRaw', sMchParam = 'OutRaw'},
|
||||
{ sName = 'nOpenOutRaw', sMchParam = 'OpenOutRaw'},
|
||||
{ sName = 'nPlunge', sMchParam = 'Plunge'},
|
||||
{ sName = 'vtFaceUse', sMchParam = 'VtFaceUse'}
|
||||
{ sName = 'vtFaceUse', sMchParam = 'VtFaceUse'},
|
||||
{ sName = 'nEdgeFaceUse', sMchParam = 'EdgeFaceUse'}
|
||||
}
|
||||
|
||||
-- parametri da scrivere nelle note di sistema
|
||||
@@ -852,7 +933,7 @@ end
|
||||
function MachiningLib.GetLengthToMachineAllStepsWithLeadInOut( Machining)
|
||||
local dLengthToMachineAllStepsWithLeadInOut = 0
|
||||
|
||||
if Machining.nType == MCH_OY.MILLING then
|
||||
if Machining.nType == MCH_MY.MILLING then
|
||||
-- se non settati, imposto valori di default
|
||||
if not Machining.LeadIn.dTotalEstimatedDistance then
|
||||
Machining.LeadIn.dTotalEstimatedDistance = sqrt( Machining.LeadIn.dPerpDistance ^ 2 + Machining.LeadIn.dTangentDistance ^ 2) + Machining.dStartSafetyLength
|
||||
@@ -870,7 +951,7 @@ function MachiningLib.GetLengthToMachineAllStepsWithLeadInOut( Machining)
|
||||
else
|
||||
dLengthToMachineAllStepsWithLeadInOut = Machining.CloneStepsRadial.nCount * ( Machining.dLengthToMachine + Machining.LeadIn.dTotalEstimatedDistance + Machining.LeadOut.dTotalEstimatedDistance) * Machining.Steps.nCount
|
||||
end
|
||||
elseif Machining.nType == MCH_OY.MORTISING then
|
||||
elseif Machining.nType == MCH_MY.MORTISING then
|
||||
-- se non settati, imposto valori di default
|
||||
if not Machining.CloneStepsLongitudinal then
|
||||
Machining.CloneStepsLongitudinal = {}
|
||||
|
||||
@@ -232,7 +232,7 @@ function STR0001.Make( bAddMachining, Proc, Part, CustomParameters)
|
||||
if Strategy.Machining.bCuttingWithMill then
|
||||
Strategy.Machining.Cutting.Steps = {}
|
||||
Strategy.Machining.Cutting.LeadIn = {}
|
||||
Strategy.Machining.Cutting.nType = MCH_OY.POCKETING
|
||||
Strategy.Machining.Cutting.nType = MCH_MY.POCKETING
|
||||
Strategy.Machining.Cutting.nSubType = MCH_POCK_SUB.SPIRALIN
|
||||
Strategy.Machining.Cutting.LeadIn.nType = MCH_POCK_LI.ZIGZAG
|
||||
Strategy.Machining.Cutting.Steps.dStep = TOOLS[Strategy.Machining.Cutting.ToolInfo.nToolIndex].dStep
|
||||
|
||||
@@ -435,7 +435,7 @@ function STR0002.Make( bAddMachining, Proc, Part, CustomParameters)
|
||||
Pocketing = {}
|
||||
Pocketing.Steps = {}
|
||||
Pocketing.LeadIn = {}
|
||||
Pocketing.nType = MCH_OY.POCKETING
|
||||
Pocketing.nType = MCH_MY.POCKETING
|
||||
Pocketing.nSubType = EgtIf( Proc.Topology.sName == 'Pocket-5-Blind', MCH_POCK_SUB.SPIRALOUT, MCH_POCK_SUB.SPIRALIN)
|
||||
Pocketing.LeadIn.nType = MCH_POCK_LI.ZIGZAG
|
||||
Pocketing.Steps.dStep = TOOLS[Strategy.Machining[j].ToolInfo.nToolIndex].dStep
|
||||
|
||||
@@ -197,7 +197,7 @@ function STR0006.Make( bAddMachining, Proc, Part, CustomParameters)
|
||||
if Strategy.Machining.bCuttingWithMill then
|
||||
Strategy.Machining.Cutting.Steps = {}
|
||||
Strategy.Machining.Cutting.LeadIn = {}
|
||||
Strategy.Machining.Cutting.nType = MCH_OY.POCKETING
|
||||
Strategy.Machining.Cutting.nType = MCH_MY.POCKETING
|
||||
Strategy.Machining.Cutting.nSubType = MCH_POCK_SUB.SPIRALIN
|
||||
Strategy.Machining.Cutting.LeadIn.nType = MCH_POCK_LI.ZIGZAG
|
||||
Strategy.Machining.Cutting.Steps.dStep = TOOLS[Strategy.Machining.Cutting.ToolInfo.nToolIndex].dStep
|
||||
|
||||
@@ -346,7 +346,7 @@ function STR0007.Make( bAddMachining, Proc, Part, CustomParameters)
|
||||
if Strategy.Machining.bCuttingWithMill then
|
||||
Strategy.Machining.Cutting.Steps = {}
|
||||
Strategy.Machining.Cutting.LeadIn = {}
|
||||
Strategy.Machining.Cutting.nType = MCH_OY.POCKETING
|
||||
Strategy.Machining.Cutting.nType = MCH_MY.POCKETING
|
||||
Strategy.Machining.Cutting.nSubType = MCH_POCK_SUB.SPIRALIN
|
||||
Strategy.Machining.Cutting.LeadIn.nType = MCH_POCK_LI.ZIGZAG
|
||||
Strategy.Machining.Cutting.Steps.dStep = TOOLS[Strategy.Machining.Cutting.ToolInfo.nToolIndex].dStep
|
||||
|
||||
@@ -271,7 +271,7 @@ function STR0008.Make( bAddMachining, Proc, Part, CustomParameters)
|
||||
if Strategy.Machining.bCuttingWithMill then
|
||||
Strategy.Machining.Cutting.Steps = {}
|
||||
Strategy.Machining.Cutting.LeadIn = {}
|
||||
Strategy.Machining.Cutting.nType = MCH_OY.POCKETING
|
||||
Strategy.Machining.Cutting.nType = MCH_MY.POCKETING
|
||||
Strategy.Machining.Cutting.nSubType = MCH_POCK_SUB.SPIRALIN
|
||||
Strategy.Machining.Cutting.LeadIn.nType = MCH_POCK_LI.ZIGZAG
|
||||
Strategy.Machining.Cutting.Steps.dStep = TOOLS[Strategy.Machining.Cutting.ToolInfo.nToolIndex].dStep
|
||||
@@ -309,7 +309,7 @@ function STR0008.Make( bAddMachining, Proc, Part, CustomParameters)
|
||||
Pocketing = {}
|
||||
Pocketing.Steps = {}
|
||||
Pocketing.LeadIn = {}
|
||||
Pocketing.nType = MCH_OY.POCKETING
|
||||
Pocketing.nType = MCH_MY.POCKETING
|
||||
Pocketing.nSubType = MCH_POCK_SUB.SPIRALOUT
|
||||
Pocketing.LeadIn.nType = MCH_POCK_LI.ZIGZAG
|
||||
Pocketing.Steps.dStep = TOOLS[Strategy.Machining.Pocketing[i].ToolInfo.nToolIndex].dStep
|
||||
|
||||
@@ -169,7 +169,7 @@ end
|
||||
-- TODO invert avanzato (direzione, Z, alternativa, ...) da gestire
|
||||
-- TODO bilinea da gestire
|
||||
function FACEBYBLADE.Make( Proc, Part, FaceToMachine, EdgeToMachine, OptionalParameters)
|
||||
local Cutting = {}
|
||||
local Cutting = MachiningLib.InitMachiningParameters( MCH_MY.MILLING)
|
||||
Cutting.bIsApplicable = true
|
||||
Cutting.dDepthToMachine = 0
|
||||
Cutting.sMessage = ''
|
||||
@@ -246,7 +246,6 @@ function FACEBYBLADE.Make( Proc, Part, FaceToMachine, EdgeToMachine, OptionalPar
|
||||
end
|
||||
Cutting.nToolIndex = ToolInfo.nToolIndex
|
||||
end
|
||||
Cutting.nType = MCH_OY.MILLING
|
||||
if not TOOLS[Cutting.nToolIndex] or not TOOLS[Cutting.nToolIndex].sName then
|
||||
Cutting.sMessage = 'Blade not found'
|
||||
Cutting.bIsApplicable = false
|
||||
|
||||
@@ -48,7 +48,7 @@ end
|
||||
|
||||
-- TODO calcolo area lavorata per completamento
|
||||
function FACEBYCHAINSAW.Make( Proc, Part, FaceToMachine, EdgeToMachine, OptionalParameters)
|
||||
local Mortising = {}
|
||||
local Mortising = MachiningLib.InitMachiningParameters( MCH_MY.MORTISING)
|
||||
Mortising.bIsApplicable = true
|
||||
Mortising.dDepthToMachine = 0
|
||||
Mortising.dResidualDepth = EdgeToMachine.dElevation
|
||||
@@ -107,7 +107,6 @@ function FACEBYCHAINSAW.Make( Proc, Part, FaceToMachine, EdgeToMachine, Optional
|
||||
ToolSearchParameters.bExtendWithCornerRadius = bExtendWithCornerRadius
|
||||
ToolInfo = MachiningLib.FindChainSaw( Proc, ToolSearchParameters)
|
||||
Mortising.nToolIndex = ToolInfo.nToolIndex
|
||||
Mortising.nType = MCH_OY.MORTISING
|
||||
if not TOOLS[Mortising.nToolIndex] or not TOOLS[Mortising.nToolIndex].sName then
|
||||
Mortising.sMessage = 'Chainsaw not found'
|
||||
Mortising.bIsApplicable = false
|
||||
|
||||
@@ -167,7 +167,7 @@ end
|
||||
-- TODO calcolo area lavorata per completamento
|
||||
-- TODO EdgeToMachineAlternative da gestire
|
||||
function FACEBYMILL.Make( Proc, Part, FaceToMachine, EdgeToMachine, OptionalParameters)
|
||||
local Milling = {}
|
||||
local Milling = MachiningLib.InitMachiningParameters( MCH_MY.MILLING)
|
||||
Milling.bIsApplicable = true
|
||||
Milling.dDepthToMachine = 0
|
||||
Milling.sMessage = ''
|
||||
@@ -247,7 +247,6 @@ function FACEBYMILL.Make( Proc, Part, FaceToMachine, EdgeToMachine, OptionalPara
|
||||
end
|
||||
Milling.nToolIndex = ToolInfo.nToolIndex
|
||||
end
|
||||
Milling.nType = MCH_OY.MILLING
|
||||
if not TOOLS[Milling.nToolIndex] or not TOOLS[Milling.nToolIndex].sName then
|
||||
Milling.sMessage = 'Mill not found'
|
||||
Milling.bIsApplicable = false
|
||||
|
||||
Reference in New Issue
Block a user