diff --git a/EgtMachKernel.rc b/EgtMachKernel.rc index 711d35f..5fe1b32 100644 Binary files a/EgtMachKernel.rc and b/EgtMachKernel.rc differ diff --git a/Processor.cpp b/Processor.cpp index c0c6cb8..9fa6494 100644 --- a/Processor.cpp +++ b/Processor.cpp @@ -447,13 +447,13 @@ Processor::ProcessClEnt( int nEntId, int nEntInd, int nClPathId, int nClPathInd, int nMove = pCamData->GetMoveType() ; switch ( nMove) { case 0 : // rapido - if ( ! OnRapid( nMove, AxesEnd, pCamData->GetAxesMask(), + if ( ! OnRapid( nEntId, nEntInd, nMove, AxesEnd, pCamData->GetAxesMask(), pCamData->GetToolDir(), pCamData->GetCorrDir(), pCamData->GetBackAuxDir(), pCamData->GetFlag(), pCamData->GetFlag2(), pCamData->GetIndex())) return false ; break ; case 1 : // linea - if ( ! OnLinear( nMove, AxesEnd, + if ( ! OnLinear( nEntId, nEntInd, nMove, AxesEnd, pCamData->GetToolDir(), pCamData->GetCorrDir(), pCamData->GetBackAuxDir(), pCamData->GetFeed(), pCamData->GetFlag(), pCamData->GetFlag2(), pCamData->GetIndex())) return false ; @@ -462,7 +462,8 @@ Processor::ProcessClEnt( int nEntId, int nEntInd, int nClPathId, int nClPathInd, case 3 : // arco CCW Point3d ptMid( AxesEnd[0], AxesEnd[1], AxesEnd[2]) ; ptMid.Rotate( pCamData->GetAxesCen(), pCamData->GetAxesNormDir(), - pCamData->GetAxesAngCen() / 2) ; - if ( ! OnArc( nMove, AxesEnd, pCamData->GetAxesCen(), ptMid, pCamData->GetAxesRad(), pCamData->GetAxesAngCen(), + if ( ! OnArc( nEntId, nEntInd, nMove, AxesEnd, + pCamData->GetAxesCen(), ptMid, pCamData->GetAxesRad(), pCamData->GetAxesAngCen(), pCamData->GetToolDir(), pCamData->GetCorrDir(), pCamData->GetBackAuxDir(), pCamData->GetFeed(), pCamData->GetFlag(), pCamData->GetFlag2(), pCamData->GetIndex())) return false ; @@ -954,14 +955,17 @@ Processor::OnPathEndAux( int nInd, const string& sAE) //---------------------------------------------------------------------------- bool -Processor::OnRapid( int nMove, const DBLVECTOR& AxesEnd, int nAxesMask, +Processor::OnRapid( int nEntId, int nEntInd, int nMove, const DBLVECTOR& AxesEnd, int nAxesMask, const Vector3d& vtTool, const Vector3d& vtCorr, const Vector3d& vtAux, int nFlag, int nFlag2, int nIndex) { // cancello variabili estranee ResetArcData() ; + // assegno Id e indice entità di movimento + bool bOk = m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_MOVEID, nEntId) ; + bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_MOVEIND, nEntInd) ; // assegno il tipo di movimento - bool bOk = m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_MOVE, nMove) ; + bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_MOVE, nMove) ; // assegno il valore degli assi int nNumAxes = int( AxesEnd.size()) ; for ( int i = 1 ; i <= MAX_AXES ; ++ i) { @@ -991,14 +995,17 @@ Processor::OnRapid( int nMove, const DBLVECTOR& AxesEnd, int nAxesMask, //---------------------------------------------------------------------------- bool -Processor::OnLinear( int nMove, const DBLVECTOR& AxesEnd, +Processor::OnLinear( int nEntId, int nEntInd, int nMove, const DBLVECTOR& AxesEnd, const Vector3d& vtTool, const Vector3d& vtCorr, const Vector3d& vtAux, double dFeed, int nFlag, int nFlag2, int nIndex) { // cancello variabili estranee ResetArcData() ; + // assegno Id e indice entità di movimento + bool bOk = m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_MOVEID, nEntId) ; + bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_MOVEIND, nEntInd) ; // assegno il tipo di movimento - bool bOk = m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_MOVE, nMove) ; + bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_MOVE, nMove) ; // assegno il valore degli assi int nNumAxes = int( AxesEnd.size()) ; for ( int i = 1 ; i <= MAX_AXES ; ++ i) { @@ -1028,12 +1035,16 @@ Processor::OnLinear( int nMove, const DBLVECTOR& AxesEnd, //---------------------------------------------------------------------------- bool -Processor::OnArc( int nMove, const DBLVECTOR& AxesEnd, const Point3d& ptCen, const Point3d& ptMid, double dRad, double dAngCen, +Processor::OnArc( int nEntId, int nEntInd, int nMove, const DBLVECTOR& AxesEnd, + const Point3d& ptCen, const Point3d& ptMid, double dRad, double dAngCen, const Vector3d& vtTool, const Vector3d& vtCorr, const Vector3d& vtAux, double dFeed, int nFlag, int nFlag2, int nIndex) { + // assegno Id e indice entità di movimento + bool bOk = m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_MOVEID, nEntId) ; + bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_MOVEIND, nEntInd) ; // assegno il tipo di movimento - bool bOk = m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_MOVE, nMove) ; + bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_MOVE, nMove) ; // assegno il valore degli assi int nNumAxes = int( AxesEnd.size()) ; for ( int i = 1 ; i <= MAX_AXES ; ++ i) { diff --git a/Processor.h b/Processor.h index a4ce26a..e266f19 100644 --- a/Processor.h +++ b/Processor.h @@ -59,12 +59,14 @@ class Processor bool OnPathEnd( int nAE) ; bool OnPathStartAux( int nInd, const std::string& sAS) ; bool OnPathEndAux( int nInd, const std::string& sAE) ; - bool OnRapid( int nMove, const DBLVECTOR& AxesEnd, int nAxesMask, + bool OnRapid( int nEntId, int nEntInd, int nMove, const DBLVECTOR& AxesEnd, int nAxesMask, const Vector3d& vtTool, const Vector3d& vtCorr, const Vector3d& vtAux, int nFlag, int nFlag2, int nIndex) ; - bool OnLinear( int nMove, const DBLVECTOR& AxesEnd, const Vector3d& vtTool, const Vector3d& vtCorr, const Vector3d& vtAux, + bool OnLinear( int nEntId, int nEntInd, int nMove, const DBLVECTOR& AxesEnd, + const Vector3d& vtTool, const Vector3d& vtCorr, const Vector3d& vtAux, double dFeed, int nFlag, int nFlag2, int nIndex) ; - bool OnArc( int nMove, const DBLVECTOR& AxesEnd, const Point3d& ptCen, const Point3d& ptMid, double dRad, double dAngCen, + bool OnArc( int nEntId, int nEntInd, int nMove, const DBLVECTOR& AxesEnd, + const Point3d& ptCen, const Point3d& ptMid, double dRad, double dAngCen, const Vector3d& vtTool, const Vector3d& vtCorr, const Vector3d& vtAux, double dFeed, int nFlag, int nFlag2, int nIndex) ; bool ResetArcData( void) ;