EgtMachKernel 2.2j2 :
- aggiunta funzione TdbGetCurrToolThLength in MachMgr.
This commit is contained in:
Binary file not shown.
@@ -182,6 +182,7 @@ class MachMgr : public IMachMgr
|
||||
bool TdbGetCurrToolValInNotes( int nType, const std::string& sKey, std::string& sVal) const override ;
|
||||
bool TdbGetCurrToolMaxDepth( double& dMaxDepth) const override ;
|
||||
bool TdbGetCurrToolThDiam( double& dThDiam) const override ;
|
||||
bool TdbGetCurrToolThLength( double& dThLen) const override ;
|
||||
int TdbCurrToolDraw( int nGenCtx, int nToolCtx) const override ;
|
||||
bool TdbReload( void) override ;
|
||||
bool TdbSave( void) const override ;
|
||||
|
||||
@@ -383,6 +383,18 @@ MachMgr::TdbGetCurrToolThDiam( double& dThDiam) const
|
||||
return pTsMgr->GetCurrToolThDiam( dThDiam) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
MachMgr::TdbGetCurrToolThLength( double& dThLen) const
|
||||
{
|
||||
// recupero il gestore di utensili della macchina corrente
|
||||
ToolsMgr* pTsMgr = GetCurrToolsMgr() ;
|
||||
if ( pTsMgr == nullptr)
|
||||
return false ;
|
||||
// recupero la lunghezza del portautensili
|
||||
return pTsMgr->GetCurrToolThLength( dThLen) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
int
|
||||
MachMgr::TdbCurrToolDraw( int nGenCtx, int nToolCtx) const
|
||||
|
||||
@@ -750,3 +750,39 @@ ToolsMgr::GetCurrToolThDiam( double& dThDiam) const
|
||||
|
||||
return false ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
ToolsMgr::GetCurrToolThLength( double& dThLen) const
|
||||
{
|
||||
// verifico esistenza utensile corrente
|
||||
if ( ! m_bCurrTool)
|
||||
return false ;
|
||||
|
||||
// se punta a forare, lama, fresa o scalpello
|
||||
if ( ( m_tdCurrTool.m_nType & TF_DRILLBIT) != 0 ||
|
||||
( m_tdCurrTool.m_nType & TF_SAWBLADE) != 0 ||
|
||||
( m_tdCurrTool.m_nType & TF_MILL) != 0 ||
|
||||
( m_tdCurrTool.m_nType & TF_CHISEL) != 0) {
|
||||
// recupero le dimensioni del porta utensili
|
||||
double dTHoldLen = 0 ;
|
||||
double dTHoldDiam = 0 ;
|
||||
if ( ! GetValInNotes( m_tdCurrTool.m_sSysNotes, TSI_THLEN, dTHoldLen) ||
|
||||
! GetValInNotes( m_tdCurrTool.m_sSysNotes, TSI_THDIAM, dTHoldDiam)) {
|
||||
(const_cast<ToolsMgr*>(this))->SaveCurrTool() ;
|
||||
Save() ;
|
||||
GetValInNotes( m_tdCurrTool.m_sSysNotes, TSI_THLEN, dTHoldLen) ;
|
||||
GetValInNotes( m_tdCurrTool.m_sSysNotes, TSI_THDIAM, dTHoldDiam) ;
|
||||
}
|
||||
dThLen = dTHoldLen ;
|
||||
return true ;
|
||||
}
|
||||
// se mortasatrice/sega a catena o waterjet
|
||||
else if ( ( m_tdCurrTool.m_nType & TF_MORTISE) != 0 ||
|
||||
( m_tdCurrTool.m_nType & TF_WATERJET) != 0) {
|
||||
dThLen = 0 ;
|
||||
return true ;
|
||||
}
|
||||
|
||||
return false ;
|
||||
}
|
||||
|
||||
@@ -58,6 +58,7 @@ class ToolsMgr
|
||||
template <class T> bool GetCurrToolValInNotes( int nType, const std::string& sKey, T& Val) const ;
|
||||
bool GetCurrToolMaxDepth( double dSafe, double& dMaxDepth) const ;
|
||||
bool GetCurrToolThDiam( double& dThDiam) const ;
|
||||
bool GetCurrToolThLength( double& dThLen) const ;
|
||||
const ToolData* GetCurrTool(void) const
|
||||
{ return (m_bCurrTool ? &m_tdCurrTool : nullptr) ; }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user