From 09da1c79c8d585f4975f805ddb5d41c375f7e800 Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Tue, 29 Sep 2020 16:44:47 +0000 Subject: [PATCH] EgtExecutor : - aggiunta funzione ExeAdvancedImportIsEnabled. --- EXE_Exchange.cpp | 38 ++++++++++++++++++++++++-------------- 1 file changed, 24 insertions(+), 14 deletions(-) diff --git a/EXE_Exchange.cpp b/EXE_Exchange.cpp index b61f316..f14018b 100644 --- a/EXE_Exchange.cpp +++ b/EXE_Exchange.cpp @@ -273,6 +273,29 @@ ExeImportStl( const string& sFilePath, double dScaleFactor) return bOk ; } +//----------------------------------------------------------------------------- +bool +ExeAdvancedImportIsEnabled( void) +{ + // verifico la chiave e le opzioni per l'import avanzato + unsigned int nOpt1, nOpt2 ; + int nOptExpDays ; + int nRet = GetKeyOptions( ExeGetKey(), KEY_BASELIB_PROD, KEY_BASELIB_VER, KEY_BASELIB_LEV, + nOpt1, nOpt2, nOptExpDays) ; + if ( nRet != KEY_OK) { + std::string sErr = "Error on Key (EXA/" + ToString( nRet) + ")" ; + LOG_ERROR( GetLogger(), sErr.c_str()) ; + return false ; + } + if ( ( nOpt1 & ( KEYOPT_EEX_INPADV)) == 0 || + nOptExpDays < GetCurrDay()) { + std::string sErr = "Warning on Key (EXA/OPT)" ; + LOG_ERROR( GetLogger(), sErr.c_str()) ; + return false ; + } + return true ; +} + //----------------------------------------------------------------------------- bool ExeAdvancedImport( const string& sFilePath) @@ -293,21 +316,8 @@ ExeAdvancedImport( const string& sFilePath) return false ; } // verifico la chiave e le opzioni per l'import avanzato - unsigned int nOpt1, nOpt2 ; - int nOptExpDays ; - int nRet = GetKeyOptions( ExeGetKey(), KEY_BASELIB_PROD, KEY_BASELIB_VER, KEY_BASELIB_LEV, - nOpt1, nOpt2, nOptExpDays) ; - if ( nRet != KEY_OK) { - std::string sErr = "Error on Key (EXA/" + ToString( nRet) + ")" ; - LOG_ERROR( GetLogger(), sErr.c_str()) ; + if ( ! ExeAdvancedImportIsEnabled()) return false ; - } - if ( ( nOpt1 & ( KEYOPT_EEX_INPADV)) == 0 || - nOptExpDays < GetCurrDay()) { - std::string sErr = "Warning on Key (EXA/OPT)" ; - LOG_ERROR( GetLogger(), sErr.c_str()) ; - return false ; - } // file intermedio stl string sTempDir ; ExeGetTempDir( sTempDir) ; string sFileOut = sTempDir + "\\AdvImp.stl" ;