Merge branch 'develop' into feature/MirroredMachinings

This commit is contained in:
luca.mazzoleni
2023-10-16 10:07:19 +02:00
2 changed files with 18 additions and 9 deletions
+16 -7
View File
@@ -1173,7 +1173,7 @@ local function AddMillings( sMilling, vFace, Proc, nRawId, b3Raw, nConeCut, nAdd
dMaxDepth = EgtIf( WD.MILL_MAX_DEPTH_AS_MAT, EgtTdbGetCurrToolParam( MCH_TP.MAXMAT), dFreeLen) or dMaxDepth
end
end
-- verifico se la facce hanno alcuni lati molto corti e possono quindi essere approssimate a 3 lati
-- verifico se le facce hanno alcuni lati molto corti e possono quindi essere approssimate a 3 lati
for currentFace = 1, #vFace do
if WL.Is3EdgesApprox( Proc, vFace[currentFace].Fac, nAddGrpId) then
vFace[currentFace].Is3EdgesApprox = true
@@ -1790,7 +1790,8 @@ local function AddCuts( sCutting, vFace, Proc, nRawId, b3Raw, dSawThick)
EgtSetMachiningParam( MCH_MP.SCC, MCH_SCC.ADIR_NEAR)
end
-- eseguo
if not EgtApplyMachining( true, false) then
local bApplyOk = EgtApplyMachining( true, false)
if not bApplyOk then
-- provo a invertire direzione, lato di lavoro e attacco/uscita
EgtSetMachiningParam( MCH_MP.INVERT, not bInvert)
EgtSetMachiningParam( MCH_MP.WORKSIDE, EgtIf( not bInvert, MCH_SAW_WS.LEFT, MCH_SAW_WS.RIGHT))
@@ -1799,14 +1800,22 @@ local function AddCuts( sCutting, vFace, Proc, nRawId, b3Raw, dSawThick)
EgtSetMachiningParam( MCH_MP.LEADOUTTYPE, EgtIf( nLeadIn == MCH_SAW_LI.STRICT, MCH_SAW_LO.STRICT, MCH_SAW_LO.CENT))
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dSal)
-- ri-eseguo
if not EgtApplyMachining( true, false) then
local _, sErr = EgtGetLastMachMgrError()
EgtSetOperationMode( nMchId, false)
return false, sErr
bApplyOk = EgtApplyMachining( true, false)
if not bApplyOk then
local nErr, sErr = EgtGetLastMachMgrError()
-- se direzione irraggiungibile (solitamente lama su testa fresa 5A e taglio inclinato) si imposta di usare fresa
if nErr == 2215 then
EgtOutLog( ' Warning : sawing impossible due to unreachable direction, try milling')
EgtRemoveOperation( nMchId)
vFace[i].Type = 4
else
EgtSetOperationMode( nMchId, false)
return false, sErr
end
end
end
-- se limite lunghezza di taglio e taglio lo supera
if WD.CUT_MAX_LENGTH and vFace[i].Len > WD.CUT_MAX_LENGTH then
if bApplyOk and WD.CUT_MAX_LENGTH and vFace[i].Len > WD.CUT_MAX_LENGTH then
-- sdoppio la lavorazione
local sSouName = EgtGetName( nMchId)
local nNewMchId = EgtCopyMachining( sSouName..'_B', sSouName)