EgtMachKernel :

- in fresatura aggiunta gestione speciale attacchi e uscite con elevazione per utensili flottanti (due movimenti consecutivi)
- in generazione/stima e simulazione aggiunto flag EMT.TFLOAT a OnToolSelect/OnSimulToolSelect per indicare utensile flottante.
This commit is contained in:
Dario Sassi
2025-01-20 08:34:41 +01:00
parent 57ec816f06
commit b03aad7ecf
14 changed files with 115 additions and 40 deletions
+10 -4
View File
@@ -639,8 +639,9 @@ SimulatorMP::UpdateMachiningTool( bool bFirst, int& nChangeTool, int& nErr)
return false ;
// se cambiato oppure prima volta, lancio lo script di selezione
if ( ( bDiffTool || bFirst) && nChangeTool != 2) {
bool bFloating = m_pMachine->IsCurrToolFloating() ;
int nCurrErr ;
if ( ! OnToolSelect( m_sTool, sHead, nExit, sTcPos, bFirst, nCurrErr)) {
if ( ! OnToolSelect( m_sTool, sHead, nExit, sTcPos, bFirst, bFloating, nCurrErr)) {
nErr = ( nErr != ERR_NONE ? nErr : nCurrErr) ;
if ( nCurrErr != ERR_COLLISION)
return false ;
@@ -691,7 +692,7 @@ SimulatorMP::UpdateDispositionTool( bool bFirst, int& nErr)
return false ;
// eventuale lancio script
int nCurrErr ;
if ( ! OnToolSelect( m_sTool, sHead, nExit, sTcPos, bFirst, nCurrErr)) {
if ( ! OnToolSelect( m_sTool, sHead, nExit, sTcPos, bFirst, false, nCurrErr)) {
nErr = ( nErr != ERR_NONE ? nErr : nCurrErr) ;
if ( nCurrErr != ERR_COLLISION)
return false ;
@@ -1828,7 +1829,7 @@ SimulatorMP::OnDispositionEnd( void)
//----------------------------------------------------------------------------
bool
SimulatorMP::OnToolSelect( const string& sTool, const string& sHead, int nExit, const string& sTcPos,
bool bFirst, int& nErr)
bool bFirst, bool bFloating, int& nErr)
{
// reset stato di errore da script
nErr = ERR_NONE ;
@@ -1838,7 +1839,8 @@ SimulatorMP::OnToolSelect( const string& sTool, const string& sHead, int nExit,
if ( ! m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_TOOL, sTool) ||
! m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_HEAD, sHead) ||
! m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_EXIT, nExit) ||
! m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_TCPOS, sTcPos))
! m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_TCPOS, sTcPos) ||
! m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_TFLOAT, bFloating))
return false ;
// assegno il token e il nome degli assi
bool bIsRobot = m_pMchMgr->GetCurrIsRobot() ;
@@ -2343,7 +2345,11 @@ SimulatorMP::SetToolForVmill( const string& sTool, const string& sHead, int nExi
double dSideAng ; m_pMchMgr->TdbGetCurrToolParam( TPA_SIDEANG, dSideAng) ;
double dMaxMat ; m_pMchMgr->TdbGetCurrToolParam( TPA_MAXMAT, dMaxMat) ;
string sNotes ; m_pMchMgr->TdbGetCurrToolParam( TPA_USERNOTES, sNotes) ;
// verifico se additivo
bool bAdditive = ( nFlag == 1) ;
// se flottante, il primo parametro è l'offset di lunghezza
if ( nFlag == 2)
dLen += dPar1 ;
// ricerca dell'outline e del diametro gambo
int nExitId = m_pMachine->GetExitId( sHead, nExit) ;
int nToolId = m_pGeomDB->GetFirstNameInGroup( nExitId, sTool) ;