diff --git a/EgtMachKernel.rc b/EgtMachKernel.rc index 91071b1..da4e831 100644 Binary files a/EgtMachKernel.rc and b/EgtMachKernel.rc differ diff --git a/MachineLua.cpp b/MachineLua.cpp index 886c719..416534b 100644 --- a/MachineLua.cpp +++ b/MachineLua.cpp @@ -1395,7 +1395,7 @@ Machine::LuaEmtAddToolForVmill( lua_State* L) int Machine::LuaEmtMoveAxes( lua_State* L) { - // 4, ..., 16 parametri : nMoveType, sAx1, dPos1, dStep1 [, sAx2, dPos2, dStep2] [, sAx3, dPos3, dStep3] [, sAx4, dPos4, dStep4] [, sAx5, dPos5, dStep5] + // 4, ..., 31 parametri : nMoveType, sAx1, dPos1, dStep1 [, sAx2, dPos2, dStep2] ... [, sAx10, dPos10, dStep10] int nMoveType ; LuaCheckParam( L, 1, nMoveType) string sAx1 ; @@ -1406,7 +1406,7 @@ Machine::LuaEmtMoveAxes( lua_State* L) LuaCheckParam( L, 4, dStep1) ; SAMVECTOR vAxNaEpSt ; vAxNaEpSt.emplace_back( sAx1, dEnd1, dStep1) ; - for ( int i = 0 ; i < 4 ; ++ i) { + for ( int i = 0 ; i < 9 ; ++ i) { int nInd = 5 + 3 * i ; string sAxN ; double dEndN ; diff --git a/Simulator.cpp b/Simulator.cpp index 1b392cb..d1cb8af 100644 --- a/Simulator.cpp +++ b/Simulator.cpp @@ -1000,8 +1000,18 @@ Simulator::ManageSingleMove( int& nStatus, double& dMove) double dSqCoeff = (( i < 3) ? 1 : 100) ; dSqDist += dSqCoeff * ( AxesEnd[i] - m_AxesVal[i]) * ( AxesEnd[i] - m_AxesVal[i]) ; } + // Calcolo distanza di movimento eventuali assi ausiliari + double dSqDistAux = 0 ; + for ( int i = 0 ; i < int( m_AuxAxesName.size()) ; ++ i) { + if ( m_AuxAxesLink[i] != 0) + continue ; + // coefficiente moltiplicativo per differenziare assi lineari e rotanti + double dSqCoeff = ( m_AuxAxesLinear[i] ? 1 : 100) ; + dSqDistAux += dSqCoeff * ( m_AuxAxesEnd[i] - m_AuxAxesVal[i]) * ( m_AuxAxesEnd[i] - m_AuxAxesVal[i]) ; + } + // Considero il massimo delle due distanze double dPrevCoeff = m_dCoeff ; - double dDist = sqrt( dSqDist) ; + double dDist = sqrt( max( dSqDist, dSqDistAux)) ; if ( dDist > EPS_SMALL) { double dStep = min( ( nMoveType == 0 ? 2 : 1) * m_dStep, MAX_STEP) ; int nStep = max( int( dDist / dStep), 1) ;