EgtMachKernel 1.6x10 :

- aggiunta GetAllHeadsNames
- aggiunto nome asse a SimGetAxisInfoPos.
This commit is contained in:
Dario Sassi
2017-01-30 08:06:33 +00:00
parent 0bafc660b5
commit 9d1b2d8d60
8 changed files with 45 additions and 11 deletions
BIN
View File
Binary file not shown.
+9 -5
View File
@@ -242,7 +242,7 @@ class MachMgr : public IMachMgr
// Simulation
bool SimStart( void) override ;
bool SimMove( int& nStatus) override ;
bool SimGetAxisInfoPos( int nI, std::string& sToken, bool& bLinear, double& dVal) override ;
bool SimGetAxisInfoPos( int nI, std::string& sName, std::string& sToken, bool& bLinear, double& dVal) override ;
bool SimGetToolInfo( std::string& sName, double& dSpeed) override ;
bool SimGetMoveInfo( int& nGmove, double& dFeed) override ;
bool SimSetStep( double dStep) override ;
@@ -285,6 +285,7 @@ class MachMgr : public IMachMgr
bool GetAxisHomePos( const std::string& sAxis, double& dHomeVal) const override ;
bool ResetAxisPos( const std::string& sAxis) override ;
bool ResetAllAxesPos( void) override ;
bool GetAllHeadsNames( STRVECTOR& vNames) const override ;
bool LoadTool( const std::string& sHead, int nExit, const std::string& sTool) override ;
bool GetLoadedTool( const std::string& sHead, int nExit, std::string& sTool) const override ;
bool UnloadTool( const std::string& sHead, int nExit) override ;
@@ -306,13 +307,16 @@ class MachMgr : public IMachMgr
{ return m_sLuaLibsDir ; }
std::string GetLuaLastRequire( void) const
{ return m_sLuaLastRequire ; }
// Current Machine
std::string GetCurrSetupDir( void) const
{ Machine* pMch = GetCurrMachine() ;
return ( pMch != nullptr ? pMch->GetMachineDir() + "\\" + SETUP_DIR : "") ; }
std::string GetCurrFixtDir( void) const
{ Machine* pMch = GetCurrMachine() ;
return ( pMch != nullptr ? pMch->GetMachineDir() + "\\" + FIXTURES_DIR : "") ; }
// MachGroups
std::string GetCurrMGeoName( void) const
{ return ( ExistsCurrMachGroup() ? m_cCurrMGrp.MGeoName : "") ; }
std::string GetCurrSetupDir( void) const
{ return ( ExistsCurrMachGroup() ? m_sMachinesDir + "\\" + m_cCurrMGrp.MGeoName + "\\" + SETUP_DIR : "") ; }
std::string GetCurrFixtDir( void) const
{ return ( ExistsCurrMachGroup() ? m_sMachinesDir + "\\" + m_cCurrMGrp.MGeoName + "\\" + FIXTURES_DIR : "") ; }
int GetCurrSetupGroupId( void) const
{ return ( ExistsCurrMachGroup() ? m_cCurrMGrp.SetupGroupId : GDB_ID_NULL) ; }
int GetCurrFixtGroupId( void) const
+14
View File
@@ -386,6 +386,20 @@ MachMgr::GetCalcRot1W( void) const
return ( ( pMch != nullptr) ? pMch->GetCurrRot1W() : false) ;
}
//----------------------------------------------------------------------------
bool
MachMgr::GetAllHeadsNames( STRVECTOR& vNames) const
{
// pulisco il vettore
vNames.clear() ;
// recupero la macchina corrente
Machine* pMch = GetCurrMachine() ;
if ( pMch == nullptr)
return false ;
// richiedo elenco teste alla macchina
return pMch->GetAllHeadsNames( vNames) ;
}
//----------------------------------------------------------------------------
int
MachMgr::GetCurrLinAxes( void) const
+2 -2
View File
@@ -52,13 +52,13 @@ MachMgr::SimMove( int& nStatus)
//----------------------------------------------------------------------------
bool
MachMgr::SimGetAxisInfoPos( int nI, string& sToken, bool& bLinear, double& dVal)
MachMgr::SimGetAxisInfoPos( int nI, string& sName, string& sToken, bool& bLinear, double& dVal)
{
// verifico simulatore
if ( m_pSimul == nullptr)
return false ;
// recupero dati
return m_pSimul->GetAxisInfoPos( nI, sToken, bLinear, dVal) ;
return m_pSimul->GetAxisInfoPos( nI, sName, sToken, bLinear, dVal) ;
}
//----------------------------------------------------------------------------
+2 -1
View File
@@ -52,7 +52,7 @@ class Machine
int GetHeadId( const std::string& sHead) const
{ int nId = GetGroup( sHead) ;
return ( IsHeadGroup( nId) ? nId : GDB_ID_NULL) ; }
bool SetLook( int nFlag) ;
bool GetAllHeadsNames( STRVECTOR& vNames) const ;
int GetHeadExitCount( const std::string& sHead) const ;
bool LoadTool( const std::string& sHead, int nExit, const std::string& sTool) ;
bool GetLoadedTool( const std::string& sHead, int nExit, std::string& sTool) const ;
@@ -112,6 +112,7 @@ class Machine
bool VerifyOutstroke( double dX, double dY, double dZ, const DBLVECTOR& vAng, int& nStat) const ;
const std::string& GetOutstrokeInfo( void) const
{ return m_sOutstrokeInfo ; }
bool SetLook( int nFlag) ;
bool LinkRawPartToGroup( int nRawPartId, const std::string& sGroupName) ;
bool IsLinkedRawPart( int nRawId) const ;
bool UnlinkRawPartFromGroup( int nRawPartId) ;
+16
View File
@@ -23,6 +23,22 @@
using namespace std ;
//----------------------------------------------------------------------------
bool
Machine::GetAllHeadsNames( STRVECTOR& vNames) const
{
// reset lista nomi
vNames.clear() ;
// ricerca delle teste
for each ( const auto& snGro in m_mapGroups) {
if ( IsHeadGroup( snGro.second))
vNames.push_back( snGro.first) ;
}
// ordino alfabeticamente
std::sort( vNames.begin(), vNames.end()) ;
return true ;
}
//----------------------------------------------------------------------------
int
Machine::GetHeadExitCount( const string& sHead) const
+1 -2
View File
@@ -166,7 +166,7 @@ Simulator::Move( int& nStatus)
//----------------------------------------------------------------------------
bool
Simulator::GetAxisInfoPos( int nI, string& sToken, bool& bLinear, double& dVal) const
Simulator::GetAxisInfoPos( int nI, string& sName, string& sToken, bool& bLinear, double& dVal) const
{
// Verifiche
if ( m_pMchMgr == nullptr || m_pGeomDB == nullptr)
@@ -177,7 +177,6 @@ Simulator::GetAxisInfoPos( int nI, string& sToken, bool& bLinear, double& dVal)
// recupero i dati dell'asse
if ( nI < 0 || nI >= nAxisCount + nAuxAxisCount)
return false ;
string sName ;
if ( nI < nAxisCount) {
sName = m_AxesName[nI] ;
sToken = m_AxesToken[nI] ;
+1 -1
View File
@@ -30,7 +30,7 @@ class Simulator
bool Init( MachMgr* pMchMgr) ;
bool Start( void) ;
bool Move( int& nStatus) ;
bool GetAxisInfoPos( int nI, std::string& sToken, bool& bLinear, double& dVal) const ;
bool GetAxisInfoPos( int nI, std::string& sName, std::string& sToken, bool& bLinear, double& dVal) const ;
bool GetToolInfo( std::string& sName, double& dSpeed) const ;
bool GetMoveInfo( int& nGmove, double& dFeed) const ;
bool SetStep( double dStep) ;