EgtMachKernel :

- aggiunta a MachMgr funzione GetClEntAxesMask
- gestione emissione in generazione/simulazione/stima di tutti gli assi rotanti del robot.
This commit is contained in:
Dario Sassi
2024-04-03 08:14:20 +02:00
parent f8d2f26692
commit f701828a25
6 changed files with 170 additions and 72 deletions
+10 -8
View File
@@ -1622,16 +1622,17 @@ Simulator::OnToolSelect( const string& sTool, const string& sHead, int nExit, co
! m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_TCPOS, sTcPos))
return false ;
// assegno il token e il nome degli assi
bool bIsRobot = m_pMchMgr->GetCurrIsRobot() ;
int nNumAxes = int( m_AxesName.size()) ;
for ( int i = 1 ; i <= MAX_AXES ; ++ i) {
if ( i <= nNumAxes) {
if ( ! m_pMachine->LuaSetGlobVar( GetGlobVarAxisToken(i), m_AxesToken[i-1]) ||
! m_pMachine->LuaSetGlobVar( GetGlobVarAxisName(i), m_AxesName[i-1]))
if ( ! m_pMachine->LuaSetGlobVar( GetGlobVarAxisToken( i, bIsRobot), m_AxesToken[i-1]) ||
! m_pMachine->LuaSetGlobVar( GetGlobVarAxisName( i, bIsRobot), m_AxesName[i-1]))
return false ;
}
else {
if ( ! m_pMachine->LuaResetGlobVar( GetGlobVarAxisToken(i)) ||
! m_pMachine->LuaResetGlobVar( GetGlobVarAxisName(i)))
if ( ! m_pMachine->LuaResetGlobVar( GetGlobVarAxisToken( i, bIsRobot)) ||
! m_pMachine->LuaResetGlobVar( GetGlobVarAxisName( i, bIsRobot)))
return false ;
}
}
@@ -1874,16 +1875,17 @@ Simulator::OnMoveStart( const CamData* pCamData, int& nErr)
bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_INDEX, pCamData->GetIndex()) ;
bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_ERR, nErr) ;
// valore degli assi all'inizio e alla fine del movimento
bool bIsRobot = m_pMchMgr->GetCurrIsRobot() ;
int nNumAxes = int( m_AxesName.size()) ;
const DBLVECTOR& AxesEnd = pCamData->GetAxesVal() ;
for ( int i = 1 ; i <= MAX_AXES ; ++ i) {
if ( i <= nNumAxes) {
bOk = bOk && m_pMachine->LuaSetGlobVar( GetGlobVarAxisPrev( i), m_AxesVal[i-1]) ;
bOk = bOk && m_pMachine->LuaSetGlobVar( GetGlobVarAxisValue( i), AxesEnd[i-1]) ;
bOk = bOk && m_pMachine->LuaSetGlobVar( GetGlobVarAxisPrev( i, GLOB_VAR, bIsRobot), m_AxesVal[i-1]) ;
bOk = bOk && m_pMachine->LuaSetGlobVar( GetGlobVarAxisValue( i, GLOB_VAR, bIsRobot), AxesEnd[i-1]) ;
}
else {
bOk = bOk && m_pMachine->LuaResetGlobVar( GetGlobVarAxisPrev( i)) ;
bOk = bOk && m_pMachine->LuaResetGlobVar( GetGlobVarAxisValue( i)) ;
bOk = bOk && m_pMachine->LuaResetGlobVar( GetGlobVarAxisPrev( i, GLOB_VAR, bIsRobot)) ;
bOk = bOk && m_pMachine->LuaResetGlobVar( GetGlobVarAxisValue( i, GLOB_VAR, bIsRobot)) ;
}
}
// versori utensile, correzione e ausiliario alla fine del movimento