From 0cbd07fe4a44dfb98e0f266dd1fb4498dddc23ee Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Mon, 7 Oct 2019 06:43:26 +0000 Subject: [PATCH] EgtMachKernel 2.1j1 : - aggiunta gestione richiesta diametro portautensile. --- EgtMachKernel.rc | Bin 11774 -> 11782 bytes MachMgr.h | 1 + MachMgrDBTools.cpp | 12 ++++++++++++ ToolsMgr.cpp | 36 ++++++++++++++++++++++++++++++++++++ ToolsMgr.h | 1 + 5 files changed, 50 insertions(+) diff --git a/EgtMachKernel.rc b/EgtMachKernel.rc index 690a2e141eb909ff6100192b547ae0c98109c84e..60d87561ce7c4b53bcddd9cb690e227da423869a 100644 GIT binary patch delta 129 zcmewt-4?Uq8ymYJg8_pMgW=}iY}U-oSqz4gA4=+OPUGrfL6W)1H2H*J9zs?KMHWS$ T2jk{d(k{&SG=r2Vhj0M^?&c=# delta 121 zcmZpR`4_$68yl-7gARl7=D%##%*>e##*-a|bvI`TxiM~D$L+=pm%PX{`HWy5l7b!< PxEzK?X*?R0=5PZ5xbY+D diff --git a/MachMgr.h b/MachMgr.h index f84545f..a6d1384 100644 --- a/MachMgr.h +++ b/MachMgr.h @@ -171,6 +171,7 @@ class MachMgr : public IMachMgr bool TdbGetCurrToolParam( int nType, double& dVal) const override ; bool TdbGetCurrToolParam( int nType, std::string& sVal) const override ; bool TdbGetCurrToolMaxDepth( double& dMaxDepth) const override ; + bool TdbGetCurrToolThDiam( double& dThDiam) const override ; int TdbCurrToolDraw( int nGenCtx, int nToolCtx) const override ; bool TdbReload( void) override ; bool TdbSave( void) const override ; diff --git a/MachMgrDBTools.cpp b/MachMgrDBTools.cpp index 68b26fa..58c89a7 100644 --- a/MachMgrDBTools.cpp +++ b/MachMgrDBTools.cpp @@ -263,6 +263,18 @@ MachMgr::TdbGetCurrToolMaxDepth( double& dMaxDepth) const return pTsMgr->GetCurrToolMaxDepth( dSafe, dMaxDepth) ; } +//---------------------------------------------------------------------------- +bool +MachMgr::TdbGetCurrToolThDiam( double& dThDiam) const +{ + // recupero il gestore di utensili della macchina corrente + ToolsMgr* pTsMgr = GetCurrToolsMgr() ; + if ( pTsMgr == nullptr) + return false ; + // recupero il diametro del portautensili + return pTsMgr->GetCurrToolThDiam( dThDiam) ; +} + //---------------------------------------------------------------------------- int MachMgr::TdbCurrToolDraw( int nGenCtx, int nToolCtx) const diff --git a/ToolsMgr.cpp b/ToolsMgr.cpp index e77e998..22d490c 100644 --- a/ToolsMgr.cpp +++ b/ToolsMgr.cpp @@ -714,3 +714,39 @@ ToolsMgr::GetCurrToolMaxDepth( double dSafe, double& dMaxDepth) const return false ; } + +//---------------------------------------------------------------------------- +bool +ToolsMgr::GetCurrToolThDiam( double& dThDiam) 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(this))->SaveCurrTool() ; + Save() ; + GetValInNotes( m_tdCurrTool.m_sSysNotes, TSI_THLEN, dTHoldLen) ; + GetValInNotes( m_tdCurrTool.m_sSysNotes, TSI_THDIAM, dTHoldDiam) ; + } + dThDiam = dTHoldDiam ; + 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) { + dThDiam = 0 ; + return true ; + } + + return false ; +} diff --git a/ToolsMgr.h b/ToolsMgr.h index 95b03cd..3541715 100644 --- a/ToolsMgr.h +++ b/ToolsMgr.h @@ -52,6 +52,7 @@ class ToolsMgr bool GetCurrToolParam( int nType, double& dVal) const ; bool GetCurrToolParam( int nType, std::string& sVal) const ; bool GetCurrToolMaxDepth( double dSafe, double& dMaxDepth) const ; + bool GetCurrToolThDiam( double& dThDiam) const ; const ToolData* GetCurrTool( void) const { if ( m_bCurrTool) return &m_tdCurrTool ;