diff --git a/Common_FAST.mlpe b/Common_FAST.mlpe index bb5e1b8..383271f 100644 --- a/Common_FAST.mlpe +++ b/Common_FAST.mlpe @@ -79,6 +79,14 @@ function OnSimulStart() for j = 1, #( vTools or {}) do if vTools[j] ~= '' then EgtLoadTool( vTcPos[i], j, vTools[j]) + -- Aggiunto controllo lunghezza lama minima * 0.9 per ricavare la tolleranza del VMILL + if EgtTdbSetCurrTool(vTools[j]) then -- set utensile corrente + if EgtTdbGetCurrToolParam( MCH_TP.TYPE) == MCH_TY.SAW_STD or EgtTdbGetCurrToolParam( MCH_TP.TYPE) == MCH_TY.SAW_FLAT then -- controllo tipo utensile sega + local dCurrSawLen = EgtTdbGetCurrToolParam( MCH_TP.LEN) * 0.9 + -- se non definito o minore del valore precedente aggiorna la tolleranza + EMT.VMILLTOL = EgtIf( not EMT.VMILLTOL or dCurrSawLen < EMT.VMILLTOL, dCurrSawLen, EMT.VMILLTOL) + end + end end end ShowToolInTcPos( vTcPos[i], true) @@ -213,7 +221,7 @@ function OnSimulDispositionStart() -- determino la risoluzione dello Zmap local dTol = 4.71 if EmtGetVMillStep then - dTol = EmtGetVMillStep( b3Raw:getDimX(), b3Raw:getDimY(), b3Raw:getDimZ(), 4.71) + dTol = EmtGetVMillStep( b3Raw:getDimX(), b3Raw:getDimY(), b3Raw:getDimZ(), dTol) else local dArea = b3Raw:getDimX() * b3Raw:getDimY() + b3Raw:getDimX() * b3Raw:getDimZ() + b3Raw:getDimY() * b3Raw:getDimZ() if dArea < 0.075e6 then @@ -230,6 +238,7 @@ function OnSimulDispositionStart() dTol = 3.77 end end + dTol = min( dTol, EMT.VMILLTOL or dTol) -- imposto dTol al valore minore tra quello per volume e quello per spessore lama -- creo lo Zmap local VMillId = EgtVolZmapBox( nPartRawId, b3Raw:getMin(), b3Raw:getDimX(), b3Raw:getDimY(), b3Raw:getDimZ(), dTol, true, GDB_RT.GLOB) if VMillId then