EgtMachKernel 1.6k6 :

- aggiunta a simulazione funzione per info e posizione assi.
This commit is contained in:
Dario Sassi
2015-11-16 08:16:45 +00:00
parent 052e1ba5e1
commit 7bf96be389
5 changed files with 31 additions and 1 deletions
BIN
View File
Binary file not shown.
+1
View File
@@ -166,6 +166,7 @@ class MachMgr : public IMachMgr
// Simulation
virtual bool SimStart( void) ;
virtual bool SimMove( void) ;
virtual bool SimGetAxisInfoPos( int nI, std::string& sName, double& dVal) ;
virtual bool SimSetStep( double dStep) ;
virtual bool SimStop( void) ;
// Generation
+11
View File
@@ -48,6 +48,17 @@ MachMgr::SimMove( void)
return m_pSimul->Move() ;
}
//----------------------------------------------------------------------------
bool
MachMgr::SimGetAxisInfoPos( int nI, string& sName, double& dVal)
{
// verifico simulatore
if ( m_pSimul == nullptr)
return false ;
// recupero quote
return m_pSimul->GetAxisInfoPos( nI, sName, dVal) ;
}
//----------------------------------------------------------------------------
bool
MachMgr::SimSetStep( double dStep)
+18 -1
View File
@@ -70,7 +70,7 @@ Simulator::Start( void)
return false ;
// cerco la prima lavorazione
nOpId = m_pMchMgr->GetNextOperation( nOpId) ;
while ( nOpId != GDB_ID_NULL && ( m_pMchMgr->GetOperationType( nOpId) & OPER_MACH) == 0)
while ( nOpId != GDB_ID_NULL && ! IsValidMachiningType( m_pMchMgr->GetOperationType( nOpId)))
nOpId = m_pMchMgr->GetNextOperation( nOpId) ;
if ( nOpId == GDB_ID_NULL)
return false ;
@@ -97,6 +97,9 @@ Simulator::Start( void)
bool
Simulator::Move( void)
{
// Verifiche
if ( m_pMchMgr == nullptr || m_pGeomDB == nullptr)
return false ;
// Se arrivato alla fine dell'interpolazione, recupero una nuova entità
if ( m_dCoeff > 0.999) {
m_nEntId = m_pGeomDB->GetNext( m_nEntId) ;
@@ -152,6 +155,20 @@ Simulator::Move( void)
return true ;
}
//----------------------------------------------------------------------------
bool
Simulator::GetAxisInfoPos( int nI, string& sName, double& dVal)
{
// Verifiche
if ( m_pMchMgr == nullptr || m_pGeomDB == nullptr)
return false ;
// recupero i dati dell'asse
if ( nI < 0 || nI >= int( m_AxesName.size()))
return false ;
sName = m_AxesName[nI] ;
return m_pMchMgr->GetAxisPos( sName, dVal) ;
}
//----------------------------------------------------------------------------
bool
Simulator::SetStep( double dStep)
+1
View File
@@ -27,6 +27,7 @@ class Simulator
bool Init( MachMgr* pMchMgr) ;
bool Start( void) ;
bool Move( void) ;
bool GetAxisInfoPos( int nI, std::string& sName, double& dVal) ;
bool SetStep( double dStep) ;
bool Stop( void) ;