From fce0068d453f2c552cb7830cb499f4a6c034d687 Mon Sep 17 00:00:00 2001 From: "daniele.nicoli" Date: Thu, 18 Dec 2025 11:22:17 +0100 Subject: [PATCH] - Arrotondati valori area trapezio - Trasferite operazioni di SimulMoveAxis e SetPVLight, SetPYLight nelle funzioni ExecMovePV e ExecMovePY --- Common_FAST.mlpe | 34 ++++++++++++++++------------------ 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/Common_FAST.mlpe b/Common_FAST.mlpe index 28f92f0..10dcd7d 100644 --- a/Common_FAST.mlpe +++ b/Common_FAST.mlpe @@ -986,21 +986,9 @@ function ExecAuxCmd( sCmd) end end elseif Cmd[1] == '11' then - local dPY = MaxOpen - if Cmd[2] ~= '0' then - dPY = EgtIf( EMT.ROT == -1, EMT.HT, EMT.ST) - end - SimulMoveAxis( 'PY', dPY, MCH_SIM_STEP.RAPID) - SetPYLight( Cmd[2] ~= '0') ExecMovePY( Cmd[2] ~= '0') elseif Cmd[1] == '12' then ExecMovePV( Cmd[2] ~= '0') - local dPV = MaxOpen - if Cmd[2] ~= '0' then - dPV = EgtIf( EMT.ROT == -1, EMT.HT, EMT.ST) - end - SimulMoveAxis( 'PV', dPV, MCH_SIM_STEP.RAPID) - SetPVLight( Cmd[2] ~= '0') elseif Cmd[1] == '21' then local nYDelta = tonumber( Cmd[2]) local nVDelta = tonumber( Cmd[3]) @@ -1186,10 +1174,10 @@ function CheckClamping( sClampName) local dMinClamping = ( MinJoin * MinZClamping) -- si moltiplica per un coefficiente minimo sotto al quale si da l'errore di pinzaggio ClampingCoeffMin = EgtClamp( ClampingCoeffMin, 0.01, 1) - if MinZClamping > 116.6119 then - dMinClamping = MinJoin * 116.6119 + ( math.pow( MinJoin, 2) / 2) - if MinJoin > 280.7729 then - dMinClamping = dMinClamping + ( math.pow( MinJoin - 280.7729, 2)) + if MinZClamping > 116 then + dMinClamping = MinJoin * 116 + ( math.pow( MinJoin, 2) / 2) + if MinJoin > 280 then + dMinClamping = dMinClamping + ( math.pow( MinJoin - 280, 2)) end end @@ -1261,7 +1249,12 @@ end --------------------------------------------------------------------- function ExecMovePY( bClose) --SimulMoveAxes( 'PY', EgtIf( not bClose, MaxHoOpen, EMT.HB), MCH_SIM_STEP.RAPID) - --SetPYLight( bClose) + local dPY = MaxOpen + if bClose then + dPY = EgtIf( EMT.ROT == -1, EMT.HT, EMT.ST) + end + SimulMoveAxis( 'PY', dPY, MCH_SIM_STEP.RAPID) + SetPYLight( bClose) if bClose then CheckClamping( 'PY') end @@ -1270,7 +1263,12 @@ end --------------------------------------------------------------------- function ExecMovePV( bClose) --EgtIf( not bClose, MaxHoOpen, EMT.HB), MCH_SIM_STEP.RAPID) - --SetPVLight( bClose) + local dPV = MaxOpen + if bClose then + dPV = EgtIf( EMT.ROT == -1, EMT.HT, EMT.ST) + end + SimulMoveAxis( 'PV', dPV, MCH_SIM_STEP.RAPID) + SetPVLight( bClose) if bClose then CheckClamping( 'PV') end