EgtMachKernel 1.6e4 :
- aggiunta gestione Assi di macchina per lettura e movimento - aggiunta gestione Teste di macchina per lettura e carico/scarico utensili.
This commit is contained in:
+62
-46
@@ -40,32 +40,11 @@ MachMgr::LoadMachine( const string& sMachineName)
|
||||
if ( IsNull( pMch))
|
||||
return false ;
|
||||
// tento di caricarla
|
||||
string sMachineDir = m_sMachinesDir + "\\" + sMachineName ;
|
||||
if ( pMch->Init( m_nContextId, m_pGeomDB, m_nMachAuxId, sMachineDir, sMachineName)) {
|
||||
if ( pMch->Init( sMachineName, this)) {
|
||||
m_vMachines.push_back( Release( pMch)) ;
|
||||
return true ;
|
||||
}
|
||||
return false ;
|
||||
|
||||
#if 0
|
||||
// verifico esistenza macchina
|
||||
string sMachineDir = m_sMachinesDir + "\\" + sMachineName ;
|
||||
string sMachineMde = sMachineDir + "\\" + sMachineName + ".Mde" ;
|
||||
if ( ! ExistsFile( sMachineMde))
|
||||
return false ;
|
||||
// carico la macchina
|
||||
if ( ! CreateMachAux())
|
||||
return false ;
|
||||
// creo il gruppo per la macchina
|
||||
int nId = m_pGeomDB->InsertGroup( GDB_ID_NULL, m_nMachAuxId, GDB_LAST_SON, GLOB_FRM) ;
|
||||
if ( nId == GDB_ID_NULL)
|
||||
return false ;
|
||||
// imposto nome del gruppo
|
||||
m_pGeomDB->SetName( nId, sMachineName) ;
|
||||
// inserisco la geometria della macchina !!! PROVVISORIO !!!
|
||||
string sMachineNge = sMachineDir + "\\" + sMachineName + ".Nge" ;
|
||||
return m_pGeomDB->Load( sMachineNge, nId) ;
|
||||
#endif
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
@@ -79,29 +58,6 @@ MachMgr::GetMachine( const string& sMachineName) const
|
||||
return int( i) ;
|
||||
}
|
||||
return - 1 ;
|
||||
|
||||
#if 0
|
||||
// verifico validità del nome
|
||||
if ( ! IsValidName( sMachineName))
|
||||
return GDB_ID_NULL ;
|
||||
// se non c'è il gruppo ausiliario per le macchine, non ci può essere la macchina
|
||||
if ( ! VerifyMachAux())
|
||||
return GDB_ID_NULL ;
|
||||
// recupero l'identificativo del gruppo con il nome indicato
|
||||
PtrOwner<IGdbIterator> pIter( CreateGdbIterator( m_pGeomDB)) ;
|
||||
if ( IsNull( pIter))
|
||||
return GDB_ID_NULL ;
|
||||
bool bIter = pIter->GoToFirstGroupInGroup( m_nMachAuxId) ;
|
||||
while( bIter) {
|
||||
// verifico il nome
|
||||
string sMGroupName ;
|
||||
if ( pIter->GetName( sMGroupName) && sMGroupName == sMachineName)
|
||||
return pIter->GetId() ;
|
||||
// passo al successivo
|
||||
bIter = pIter->GoToNextGroup() ;
|
||||
}
|
||||
return GDB_ID_NULL ;
|
||||
#endif
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
@@ -111,5 +67,65 @@ MachMgr::GetCurrMGeoId( void) const
|
||||
if ( m_nCurrMch < 0 || m_nCurrMch >= int( m_vMachines.size()) ||
|
||||
m_vMachines[m_nCurrMch] == nullptr)
|
||||
return GDB_ID_NULL ;
|
||||
return ( m_vMachines[m_nCurrMch]->GetMGeoId()) ;
|
||||
return m_vMachines[m_nCurrMch]->GetMGeoId() ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
MachMgr::SetAxisPos( const string& sAxis, double dVal)
|
||||
{
|
||||
if ( m_nCurrMch < 0 || m_nCurrMch >= int( m_vMachines.size()) ||
|
||||
m_vMachines[m_nCurrMch] == nullptr)
|
||||
return GDB_ID_NULL ;
|
||||
return m_vMachines[m_nCurrMch]->SetAxisPos( sAxis, dVal) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
MachMgr::GetAxisPos( const string& sAxis, double& dVal)
|
||||
{
|
||||
if ( m_nCurrMch < 0 || m_nCurrMch >= int( m_vMachines.size()) ||
|
||||
m_vMachines[m_nCurrMch] == nullptr)
|
||||
return GDB_ID_NULL ;
|
||||
return m_vMachines[m_nCurrMch]->GetAxisPos( sAxis, dVal) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
MachMgr::GetAxisHomePos( const string& sAxis, double& dHomeVal)
|
||||
{
|
||||
if ( m_nCurrMch < 0 || m_nCurrMch >= int( m_vMachines.size()) ||
|
||||
m_vMachines[m_nCurrMch] == nullptr)
|
||||
return GDB_ID_NULL ;
|
||||
return m_vMachines[m_nCurrMch]->GetAxisHomePos( sAxis, dHomeVal) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
MachMgr::ResetAxisPos( const string& sAxis)
|
||||
{
|
||||
if ( m_nCurrMch < 0 || m_nCurrMch >= int( m_vMachines.size()) ||
|
||||
m_vMachines[m_nCurrMch] == nullptr)
|
||||
return GDB_ID_NULL ;
|
||||
return m_vMachines[m_nCurrMch]->ResetAxisPos( sAxis) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
MachMgr::LoadTool( const string& sHead, int nExit, const string& sTool)
|
||||
{
|
||||
if ( m_nCurrMch < 0 || m_nCurrMch >= int( m_vMachines.size()) ||
|
||||
m_vMachines[m_nCurrMch] == nullptr)
|
||||
return false ;
|
||||
return m_vMachines[m_nCurrMch]->LoadTool( sHead, nExit, sTool) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
MachMgr::ResetHeadSet( const string& sHead)
|
||||
{
|
||||
if ( m_nCurrMch < 0 || m_nCurrMch >= int( m_vMachines.size()) ||
|
||||
m_vMachines[m_nCurrMch] == nullptr)
|
||||
return false ;
|
||||
return m_vMachines[m_nCurrMch]->ResetHeadSet( sHead) ;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user