- in MachiningLib.GetTimeToMachineAllStepsWithLeadInOut contemplata Pocketing

- in STR0002 modifiche per migliorare il calcolo tempi
This commit is contained in:
luca.mazzoleni
2025-05-08 17:55:10 +02:00
parent 4cd1bf526a
commit 3b785a0907
2 changed files with 44 additions and 6 deletions
+14 -1
View File
@@ -871,7 +871,7 @@ function MachiningLib.AddOperations( vProc, Part, sRotation)
nErr, sErr = EgtGetLastMachMgrError()
EgtSetOperationMode( nOperationId, false)
-- update risultati
-- TODO è corretto mettere non applicabile?????
-- TODO è corretto mettere non applicabile????? disattivare e dare un'incompleta gialla?
RESULT[MACHININGS[i].Proc.nIndexInResult].ChosenStrategy.sStatus = 'Not-Applicable'
RESULT[MACHININGS[i].Proc.nIndexInResult].ChosenStrategy.sApplyInfo = sErr
RESULT[MACHININGS[i].Proc.nIndexInResult].ChosenStrategy.nApplyError = nErr
@@ -996,6 +996,19 @@ function MachiningLib.GetTimeToMachineAllStepsWithLeadInOut( Machining)
dLengthToMachineAllStepsWithLeadInOut = Machining.CloneStepsLongitudinal.nCount * ( ( 2 * Machining.Steps.nCount - 1) * Machining.dLengthToMachine + 2 * 10 * ( Machining.Steps.nCount - 1) + 2 * ( Machining.dDepthToMachine + ( TOOLS[Machining.nToolIndex].SetupInfo.dZSafeDelta or 60) + EgtMdbGetGeneralParam( MCH_GP.SAFEZ)))
dTimeToMachineTotal = Machining.CloneStepsLongitudinal.nCount * ( ( 2 * Machining.Steps.nCount - 1) * dTimeToMachineEdge + 2 * 10 / dToolFeed * ( Machining.Steps.nCount - 1) + dTimeToMachineLeadIn + dTimeToMachineLeadOut)
end
elseif Machining.nType == MCH_MY.POCKETING then
local dDepthToMachine = min( Machining.dElevation, ( Machining.dMaxElev or Machining.dElevation)) - ( max( 0, Machining.ToolInfo.dResidualDepth or 0))
local nSteps = ceil( ( dDepthToMachine - 50 * GEO.EPS_SMALL) / TOOLS[Machining.nToolIndex].dStep)
local _, dLongEdgeDimension, dShortEdgeDimension = EgtSurfTmFacetMinAreaRectangle( Machining.Geometry[1][1], Machining.Geometry[1][2], GDB_ID.ROOT)
-- TODO bisogna calcolare correttamente per lati aperti e chiusi (aperti: aggiungi D/2 - Sidestep, chiusi: sottrai - D/2)
local nOffsets = ceil ( ( dShortEdgeDimension - TOOLS[Machining.nToolIndex].dSideStep) / TOOLS[Machining.nToolIndex].dSideStep) + 1
for i = 1, floor( nOffsets / 2) do
dLengthToMachineAllStepsWithLeadInOut = dLengthToMachineAllStepsWithLeadInOut
+ 2 * ( dShortEdgeDimension - 2 * ( i - 1) * TOOLS[Machining.nToolIndex].dSideStep)
+ 2 * ( dLongEdgeDimension - 2 * ( i - 1) * TOOLS[Machining.nToolIndex].dSideStep)
end
dLengthToMachineAllStepsWithLeadInOut = dLengthToMachineAllStepsWithLeadInOut * nSteps
dTimeToMachineTotal = dLengthToMachineAllStepsWithLeadInOut / dToolFeed
else
error( 'GetTimeToMachineAllStepsWithLeadInOut : unknown machining type')
end