From c2956b27333d87e883d1c19036810f67b8d36f87 Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Sat, 18 May 2019 16:15:46 +0000 Subject: [PATCH] EgtMachKernel : - correzioni al disegno utensili. --- MachMgrDBTools.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/MachMgrDBTools.cpp b/MachMgrDBTools.cpp index 38eeb05..178e6d6 100644 --- a/MachMgrDBTools.cpp +++ b/MachMgrDBTools.cpp @@ -262,6 +262,9 @@ MachMgr::TdbGetCurrToolMaxDepth( double& dMaxDepth) const int MachMgr::TdbCurrToolDraw( int nGenCtx, int nToolCtx) const { + // imposto contesto generale + if ( ! ExeSetCurrentContext( nGenCtx)) + return TD_INT_ERR ; // recupero il gestore di utensili della macchina corrente ToolsMgr* pTsMgr = GetCurrToolsMgr() ; if ( pTsMgr == nullptr) @@ -290,10 +293,10 @@ MachMgr::TdbCurrToolDraw( int nGenCtx, int nToolCtx) const // altrimenti è disegno custom, lo modifico else { // Carico e aggiorno il disegno dell'utensile - if ( ExeOpenFile( sDrawPath)) + if ( ExeSetCurrentContext( nToolCtx) && ExeOpenFile( sDrawPath)) nErr = UpdateCustomToolDraw( pTdata, nGenCtx, nToolCtx, false) ; else - nErr = TD_INT_ERR ; + nErr = TD_CUSTOMDRAW_ERR ; } return nErr ; } @@ -488,7 +491,7 @@ MachMgr::UpdateStandardToolDraw( const ToolData* pTdata, int nGenCtx, int nToolC // Carico generatore disegno utensile string sMaker = GetPrivateProfileStringUtf8( TOOLS_SEC.c_str(), GetToolMakerKeyFromType( nType).c_str(), "", sMachIni.c_str()) ; if ( sMaker.empty()) - return TD_INT_ERR ; + return TD_TOOLMAKER_ERR ; // Imposto contesto per il disegno utensile if ( ! ExeSetCurrentContext( nToolCtx)) return TD_INT_ERR ;