diff --git a/EgtMachKernel.rc b/EgtMachKernel.rc index 06a3dd4..2453720 100644 Binary files a/EgtMachKernel.rc and b/EgtMachKernel.rc differ diff --git a/MachMgr.h b/MachMgr.h index 0dd535c..9ccd806 100644 --- a/MachMgr.h +++ b/MachMgr.h @@ -117,6 +117,7 @@ class MachMgr : public IMachMgr bool RotatePartInRawPart( int nPartId, const Vector3d& vtAx, double dAngRotDeg) override ; // Tables and Fixtures bool SetTable( const std::string& sTable) override ; + bool GetTable( std::string& sTable) override ; bool GetTableRef( int nInd, Point3d& ptPos) override ; bool GetTableArea( int nInd, BBox3d& b3Area) override ; int AddFixture( const std::string& sName, const Point3d& ptPos, double dAngRotDeg) override ; @@ -130,6 +131,7 @@ class MachMgr : public IMachMgr bool TdbRemoveTool( const std::string& sName) override ; bool TdbGetFirstTool( int nFamily, std::string& sName, int& nType) const override ; bool TdbGetNextTool( int nFamily, std::string& sName, int& nType) const override ; + bool TdbGetToolFromUUID( const std::string& sTuuid, std::string& sName) const override ; bool TdbSetCurrTool( const std::string& sName) override ; bool TdbSaveCurrTool( void) override ; bool TdbIsCurrToolModified( void) const override ; diff --git a/MachMgrDBTools.cpp b/MachMgrDBTools.cpp index 109eb58..0dbd6cc 100644 --- a/MachMgrDBTools.cpp +++ b/MachMgrDBTools.cpp @@ -90,6 +90,27 @@ MachMgr::TdbGetNextTool( int nFamily, string& sName, int& nType) const return pTsMgr->GetNextTool( nFamily, sName, nType) ; } +//---------------------------------------------------------------------------- +bool +MachMgr::TdbGetToolFromUUID( const string& sTuuid, string& sName) const +{ + // pulisco il parametro di ritorno + sName.clear() ; + // recupero il gestore di utensili della macchina corrente + ToolsMgr* pTsMgr = GetCurrToolsMgr() ; + if ( pTsMgr == nullptr) + return false ; + // cerco l'utensile con l'UUID, se trovato ne restituisco il nome + EgtUUID Tuuid ; + if ( ! FromString( sTuuid, Tuuid)) + return false ; + const ToolData* pTdata = pTsMgr->GetTool( Tuuid) ; + if ( pTdata == nullptr) + return false ; + sName = pTdata->m_sName ; + return true ; +} + //---------------------------------------------------------------------------- bool MachMgr::TdbSetCurrTool( const string& sName) diff --git a/MachMgrFixtures.cpp b/MachMgrFixtures.cpp index 00ac2ea..409bcca 100644 --- a/MachMgrFixtures.cpp +++ b/MachMgrFixtures.cpp @@ -32,6 +32,18 @@ MachMgr::SetTable( const string& sTable) return ( pDisp != nullptr && pDisp->SetTable( sTable)) ; } +//---------------------------------------------------------------------------- +bool +MachMgr::GetTable( string& sTable) +{ + // recupero la prima operazione, deve essere la prima disposizione + Disposition* pDisp = ::GetDisposition( m_pGeomDB->GetUserObj( GetFirstOperation())) ; + if ( pDisp == nullptr) + return false ; + // recupero la tavola + return pDisp->GetTable( sTable) ; +} + //---------------------------------------------------------------------------- bool MachMgr::GetTableRef( int nInd, Point3d& ptPos)