From 8a780e6fc7307c685318051ca7d04684eb5f235b Mon Sep 17 00:00:00 2001 From: DarioS Date: Fri, 20 May 2022 15:56:08 +0200 Subject: [PATCH] EgtMachKernel 2.4e5 : - aggiunti dati EMT.MOVEID e EMT.MOVEIND ai parametri passati agli script di movimento in Generazione e Stima. --- EgtMachKernel.rc | Bin 11774 -> 11774 bytes Processor.cpp | 29 ++++++++++++++++++++--------- Processor.h | 8 +++++--- 3 files changed, 25 insertions(+), 12 deletions(-) diff --git a/EgtMachKernel.rc b/EgtMachKernel.rc index 711d35f0a88a1f91b274a9c5382c6f0b732fe5ae..5fe1b329b2e55378c7dea71920ec9bcb3ffd10b4 100644 GIT binary patch delta 97 zcmewt{V#gMFE&Qg&A-`fnHfzdKa|wnoW?bQ1uSxrY4Qod0+^@}R1`^_2jk{d(jGv4 NK<#LXK~l;gTmUO4BcK2P delta 97 zcmewt{V#gMFE&P#&A-`fnHfzcKa|wnoW?bQ1uSxrY4Qod0+^@}R1`^_2jk{d(jGv4 NK<#LXK~l;gTmUI`BbWdH 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) ;