EgtMachKernel 1.9d1 :

- aggiunto reset tavola e utensile/testa correnti alla creazione di nuovo gruppo di lavoro.
This commit is contained in:
Dario Sassi
2018-04-04 17:58:51 +00:00
parent 777c2ddd03
commit 62e060dbc6
6 changed files with 52 additions and 11 deletions
BIN
View File
Binary file not shown.
+6
View File
@@ -165,6 +165,12 @@ MachMgr::AddMachGroup( const string& sName, const string& sMachineName)
m_pGeomDB->Erase( nNewId) ;
return GDB_ID_NULL ;
}
// reset tavola e utensile correnti
Machine* pMch = GetCurrMachine() ;
if ( pMch != nullptr) {
pMch->ResetCurrTable() ;
pMch->ResetCurrTool() ;
}
// aggiorno attrezzaggio attivo
UpdateSetup() ;
// nascondo i pezzi rimasti sotto la radice
+3 -1
View File
@@ -842,8 +842,10 @@ Machine::SetLook( int nFlag)
// recupero l'identificativo del gruppo di base della macchina
int nMBaseId = m_pGeomDB->GetFirstInGroup( GetMachineId()) ;
// recupero la tavola corrente
// recupero la tavola corrente (se non definita, prendo la prima)
int nTabId = GetCurrTable() ;
if ( nTabId == GDB_ID_NULL)
nTabId = GetFirstTable() ;
if ( nTabId == GDB_ID_NULL)
return false ;
// nascondo o visualizzo i fratelli e tutti i fratelli degli ascendenti della tavola
+3
View File
@@ -54,6 +54,7 @@ class Machine
return ( IsHeadGroup( nId) ? nId : GDB_ID_NULL) ; }
bool GetAllHeadsNames( STRVECTOR& vNames) const ;
bool GetAllTablesNames( STRVECTOR& vNames) const ;
int GetFirstTable( void) const ;
int GetHeadExitCount( const std::string& sHead) const ;
int GetHeadExitPosDirAux( const std::string& sHead, int nExit, Point3d& ptPos, Vector3d& vtDir, Vector3d& vtAux) const ;
int GetHeadSolCh( const std::string& sHead) const ;
@@ -76,6 +77,7 @@ class Machine
bool ResetAxisPos( const std::string& sAxis) ;
bool ResetAllAxesPos( void) ;
bool SetCurrTable( const std::string& sTable) ;
bool ResetCurrTable( void) ;
int GetCurrTable( void) const ;
bool GetCurrTable( std::string& sTable) const ;
bool GetCurrTableRef1( Point3d& ptRef1) const ;
@@ -83,6 +85,7 @@ class Machine
bool GetCurrTableDeltaRef1( Vector3d& vtDelta1) const ;
bool GetCurrTableIsTilting( bool& bTilting) const ;
bool SetCurrTool( const std::string& sTool, const std::string& sHead, int nExit) ;
bool ResetCurrTool( void) ;
int GetCurrTool( void) const ;
bool GetCurrTool( std::string& sTool) const ;
int GetCurrHead( void) const ;
+27 -10
View File
@@ -67,6 +67,13 @@ Machine::SetCurrTable( const string& sTable)
else
return true ;
}
//----------------------------------------------------------------------------
bool
Machine::ResetCurrTable( void)
{
m_nCalcTabId = GDB_ID_NULL ;
return true ;
}
//----------------------------------------------------------------------------
int
@@ -171,19 +178,11 @@ Machine::GetCurrTableIsTilting( bool& bTilting) const
bool
Machine::SetCurrTool( const string& sTool, const string& sHead, int nExit)
{
// azzero tutto
ResetCurrTool() ;
// controllo GeomDB
if ( m_pGeomDB == nullptr)
return false ;
// azzero tutto
m_nCalcHeadId = GDB_ID_NULL ;
m_nCalcExitId = GDB_ID_NULL ;
m_nCalcToolId = GDB_ID_NULL ;
m_dCalcRot1W = 1 ;
m_nCalcSolCh = MCH_SCC_NONE ;
m_dCalcTLen = 0 ;
m_dCalcTRad = 0 ;
m_dCalcTOvLen = 0 ;
m_dCalcTOvRad = 0 ;
// recupero il gruppo della testa
int nHeadId = GetGroup( sHead) ;
// recupero i dati della testa
@@ -275,6 +274,24 @@ Machine::SetCurrTool( const string& sTool, const string& sHead, int nExit)
return CalculateKinematicChain() ;
}
//----------------------------------------------------------------------------
bool
Machine::ResetCurrTool( void)
{
// azzero tutto
m_nCalcHeadId = GDB_ID_NULL ;
m_nCalcExitId = GDB_ID_NULL ;
m_nCalcToolId = GDB_ID_NULL ;
m_dCalcRot1W = 1 ;
m_nCalcSolCh = MCH_SCC_NONE ;
m_dCalcTLen = 0 ;
m_dCalcTRad = 0 ;
m_dCalcTOvLen = 0 ;
m_dCalcTOvRad = 0 ;
// ritorno
return true ;
}
//----------------------------------------------------------------------------
int
Machine::GetCurrTool( void) const
+13
View File
@@ -38,3 +38,16 @@ Machine::GetAllTablesNames( STRVECTOR& vNames) const
std::sort( vNames.begin(), vNames.end()) ;
return true ;
}
//----------------------------------------------------------------------------
int
Machine::GetFirstTable( void) const
{
// ricerca della prima tavola
for each ( const auto& snGro in m_mapGroups) {
if ( IsTableGroup( snGro.second))
return snGro.second ;
}
// non trovata alcuna tavola
return GDB_ID_NULL ;
}