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
+11 -5
View File
@@ -583,8 +583,9 @@ SimulatorSP::UpdateTool( bool bFirst, int& nErr)
return false ;
// se cambiato oppure prima volta, lancio lo script di selezione
if ( bDiffTool || bFirst) {
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 != 0 ? nErr : nCurrErr) ;
if ( nCurrErr != ERR_COLLISION)
return false ;
@@ -623,7 +624,7 @@ SimulatorSP::UpdateTool( 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 != 0 ? nErr : nCurrErr) ;
if ( nCurrErr != ERR_COLLISION)
return false ;
@@ -1744,7 +1745,7 @@ SimulatorSP::OnDispositionEnd( void)
//----------------------------------------------------------------------------
bool
SimulatorSP::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 = 0 ;
@@ -1754,7 +1755,8 @@ SimulatorSP::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() ;
@@ -2256,7 +2258,7 @@ SimulatorSP::AddCollisionObj( int nInd, bool bToolOn, int nFrameId, int nType, c
//----------------------------------------------------------------------------
bool
SimulatorSP::SetToolForVmill( const string& sTool, const string& sHead, int nExit, int nFlag, double dPar1, double dPar2,
const INTVECTOR& vVmill, bool bFirst)
const INTVECTOR& vVmill, bool bFirst)
{
// disabilito eventuale registrazione comandi EXE (riabilitazione automatica)
CmdLogOff cmdLogOff ;
@@ -2288,7 +2290,11 @@ SimulatorSP::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) ;