EgtMachKernel 1.6j6 :

- aggiunta TdbIsCurrToolModified.
This commit is contained in:
Dario Sassi
2015-11-01 08:55:36 +00:00
parent 05b5c993ac
commit 3cd111ce12
6 changed files with 64 additions and 0 deletions
BIN
View File
Binary file not shown.
+1
View File
@@ -107,6 +107,7 @@ class MachMgr : public IMachMgr
virtual bool TdbGetNextTool( int nFamily, std::string& sName, int& nType) ;
virtual bool TdbSetCurrTool( const std::string& sName) ;
virtual bool TdbSaveCurrTool( void) ;
virtual bool TdbIsCurrToolModified( void) ;
virtual bool TdbSetCurrToolParam( int nType, int nVal) ;
virtual bool TdbSetCurrToolParam( int nType, double dVal) ;
virtual bool TdbSetCurrToolParam( int nType, const std::string& sVal) ;
+12
View File
@@ -114,6 +114,18 @@ MachMgr::TdbSaveCurrTool( void)
return pTsMgr->SaveCurrTool() ;
}
//----------------------------------------------------------------------------
bool
MachMgr::TdbIsCurrToolModified( void)
{
// recupero il gestore di utensili della macchina corrente
ToolsMgr* pTsMgr = GetCurrToolsMgr() ;
if ( pTsMgr == nullptr)
return false ;
// verifico se l'utensile corrente è stato modificato
return pTsMgr->IsCurrToolModified() ;
}
//----------------------------------------------------------------------------
bool
MachMgr::TdbSetCurrToolParam( int nType, int nVal)
+35
View File
@@ -67,3 +67,38 @@ struct ToolData
bool GetParam( int nType, double& dVal) const ;
bool GetParam( int nType, std::string& sVal) const ;
} ;
//----------------------------------------------------------------------------
inline bool
SameTool( const ToolData& Td1, const ToolData& Td2)
{
return ( Td1.m_Uuid == Td2.m_Uuid &&
Td1.m_sName == Td2.m_sName &&
Td1.m_sDraw == Td2.m_sDraw &&
Td1.m_sTcPos == Td2.m_sTcPos &&
Td1.m_sHead == Td2.m_sHead &&
Td1.m_nExit == Td2.m_nExit &&
Td1.m_nCorr == Td2.m_nCorr &&
Td1.m_nType == Td2.m_nType &&
Td1.m_dMaxSpeed == Td2.m_dMaxSpeed &&
Td1.m_dMaxMat == Td2.m_dMaxMat &&
Td1.m_dDiam == Td2.m_dDiam &&
Td1.m_dTDiam == Td2.m_dTDiam &&
Td1.m_dLen == Td2.m_dLen &&
Td1.m_dTLen == Td2.m_dTLen &&
Td1.m_dThick == Td2.m_dThick &&
Td1.m_dCornRad == Td2.m_dCornRad &&
Td1.m_dSideAng == Td2.m_dSideAng &&
Td1.m_dSpeed == Td2.m_dSpeed &&
Td1.m_dFeed == Td2.m_dFeed &&
Td1.m_dStartFeed == Td2.m_dStartFeed &&
Td1.m_dEndFeed == Td2.m_dEndFeed &&
Td1.m_dTipFeed == Td2.m_dTipFeed &&
Td1.m_dOffsR == Td2.m_dOffsR &&
Td1.m_dOffsL == Td2.m_dOffsL &&
Td1.m_nCoolant == Td2.m_nCoolant &&
Td1.m_dMaxAbsorption == Td2.m_dMaxAbsorption &&
Td1.m_dMinFeed == Td2.m_dMinFeed &&
Td1.m_sSysNotes == Td2.m_sSysNotes &&
Td1.m_sUserNotes == Td2.m_sUserNotes) ;
}
+15
View File
@@ -496,6 +496,21 @@ ToolsMgr::SaveCurrTool( void)
return true ;
}
//----------------------------------------------------------------------------
bool
ToolsMgr::IsCurrToolModified( void)
{
// verifico validità utensile corrente
if ( ! m_bCurrTool)
return false ;
// recupero puntatore a utensile corrente nel DB
auto iIter = m_utData.find( m_tdCurrTool.m_Uuid) ;
if ( iIter == m_utData.end())
return false ;
// eseguo confronto
return ! SameTool( m_tdCurrTool, iIter->second) ;
}
//----------------------------------------------------------------------------
bool
ToolsMgr::SetCurrToolParam( int nType, int nVal)
+1
View File
@@ -37,6 +37,7 @@ class ToolsMgr
bool GetNextTool( int nFamily, std::string& sName, int& nType) const ;
bool SetCurrTool( const std::string& sName) ;
bool SaveCurrTool( void) ;
bool IsCurrToolModified( void) ;
bool SetCurrToolParam( int nType, int nVal) ;
bool SetCurrToolParam( int nType, double dVal) ;
bool SetCurrToolParam( int nType, const std::string& sVal) ;